/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/@geops/mobility-web-component@0.1.9/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
(()=>{var e=Object.create,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,n=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(e&&(t=e(e=0)),t),o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),l=(e,r)=>{for(var i in r)t(e,i,{get:r[i],enumerable:!0})},h=(s,o,l)=>(l=null!=s?e(n(s)):{},((e,n,s,o)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let l of i(n))!a.call(e,l)&&l!==s&&t(e,l,{get:()=>n[l],enumerable:!(o=r(n,l))||o.enumerable});return e})(!o&&s&&s.__esModule?l:t(l,"default",{value:s,enumerable:!0}),s)),A=o(((e,t)=>{var r=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,n=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt,o="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,h=o||l||Function("return this")(),A=Object.prototype.toString,u=Math.max,c=Math.min,d=function(){return h.Date.now()};function p(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function f(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==A.call(e)}(e))return NaN;if(p(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=p(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(r,"");var o=n.test(e);return o||a.test(e)?s(e.slice(2),o?2:8):i.test(e)?NaN:+e}t.exports=function(e,t,r){var i,n,a,s,o,l,h=0,A=!1,g=!1,m=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var r=i,a=n;return i=n=void 0,h=t,s=e.apply(a,r)}function _(e){var r=e-l;return void 0===l||r>=t||r<0||g&&e-h>=a}function v(){var e=d();if(_(e))return w(e);o=setTimeout(v,function(e){var r=t-(e-l);return g?c(r,a-(e-h)):r}(e))}function w(e){return o=void 0,m&&i?y(e):(i=n=void 0,s)}function b(){var e=d(),r=_(e);if(i=arguments,n=this,l=e,r){if(void 0===o)return function(e){return h=e,o=setTimeout(v,t),A?y(e):s}(l);if(g)return o=setTimeout(v,t),y(l)}return void 0===o&&(o=setTimeout(v,t)),s}return t=f(t)||0,p(r)&&(A=!!r.leading,a=(g="maxWait"in r)?u(f(r.maxWait)||0,t):a,m="trailing"in r?!!r.trailing:m),b.cancel=function(){void 0!==o&&clearTimeout(o),h=0,i=l=n=o=void 0},b.flush=function(){return void 0===o?s:w(d())},b}})),u=o(((e,t)=>{var r,i;r=e,i=function(){"use strict";var e={},t={};function r(r,i,n){if(t[r]=n,"index"===r){var a="var sharedModule = {}; ("+t.shared+")(sharedModule); ("+t.worker+")(sharedModule);",s={};return t.shared(s),t.index(e,s),typeof window<"u"&&e.setWorkerUrl(window.URL.createObjectURL(new Blob([a],{type:"text/javascript"}))),e}}return r("shared",0,(function(e){function t(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,o)}l((i=i.apply(e,t||[])).next())}))}function r(e,t){this.x=e,this.y=t}function i(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var n,a;"function"==typeof SuppressedError&&SuppressedError,r.prototype={clone(){return new r(this.x,this.y)},add(e){return this.clone()._add(e)},sub(e){return this.clone()._sub(e)},multByPoint(e){return this.clone()._multByPoint(e)},divByPoint(e){return this.clone()._divByPoint(e)},mult(e){return this.clone()._mult(e)},div(e){return this.clone()._div(e)},rotate(e){return this.clone()._rotate(e)},rotateAround(e,t){return this.clone()._rotateAround(e,t)},matMult(e){return this.clone()._matMult(e)},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(e){return this.x===e.x&&this.y===e.y},dist(e){return Math.sqrt(this.distSqr(e))},distSqr(e){let t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle(){return Math.atan2(this.y,this.x)},angleTo(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith(e){return this.angleWithSep(e.x,e.y)},angleWithSep(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult(e){let t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add(e){return this.x+=e.x,this.y+=e.y,this},_sub(e){return this.x-=e.x,this.y-=e.y,this},_mult(e){return this.x*=e,this.y*=e,this},_div(e){return this.x/=e,this.y/=e,this},_multByPoint(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint(e){return this.x/=e.x,this.y/=e.y,this},_unit(){return this._div(this.mag()),this},_perp(){let e=this.y;return this.y=this.x,this.x=-e,this},_rotate(e){let t=Math.cos(e),r=Math.sin(e),i=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=i,this},_rotateAround(e,t){let r=Math.cos(e),i=Math.sin(e),n=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-i*(this.y-t.y),this.y=n,this},_round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this},constructor:r},r.convert=function(e){if(e instanceof r)return e;if(Array.isArray(e))return new r(+e[0],+e[1]);if(void 0!==e.x&&void 0!==e.y)return new r(+e.x,+e.y);throw new Error("Expected [x, y] or {x, y} point format")};var s=function(){if(a)return n;function e(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}return a=1,n=e,e.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,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=n/a}var s=0,o=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:o=r,r=.5*(o-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},n}(),o=i(s);let l,h;function A(){return null==l&&(l=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),l}function u(){if(null==h&&(h=!1,A())){let e=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(e){for(let t=0;t<25;t++){let r=4*t;e.fillStyle=`rgb(${r},${r+1},${r+2})`,e.fillRect(t%5,Math.floor(t/5),1,1)}let t=e.getImageData(0,0,5,5).data;for(let e=0;e<100;e++)if(e%4!=3&&t[e]!==e){h=!0;break}}}return h||!1}var c=1e-6,d=typeof Float32Array<"u"?Float32Array:Array;function p(){var e=new d(9);return d!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function f(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function g(){var e=new d(3);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function m(e){var t=e[0],r=e[1],i=e[2];return Math.sqrt(t*t+r*r+i*i)}function y(e,t,r){var i=new d(3);return i[0]=e,i[1]=t,i[2]=r,i}function _(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function v(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function w(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[0],o=r[1],l=r[2];return e[0]=n*l-a*o,e[1]=a*s-i*l,e[2]=i*o-n*s,e}var b,x=m;function B(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*a+r[12]*s,e[1]=r[1]*i+r[5]*n+r[9]*a+r[13]*s,e[2]=r[2]*i+r[6]*n+r[10]*a+r[14]*s,e[3]=r[3]*i+r[7]*n+r[11]*a+r[15]*s,e}function C(){var e=new d(4);return d!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function S(e,t,r,i){var n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"zyx",a=Math.PI/360;t*=a,i*=a,r*=a;var s=Math.sin(t),o=Math.cos(t),l=Math.sin(r),h=Math.cos(r),A=Math.sin(i),u=Math.cos(i);switch(n){case"xyz":e[0]=s*h*u+o*l*A,e[1]=o*l*u-s*h*A,e[2]=o*h*A+s*l*u,e[3]=o*h*u-s*l*A;break;case"xzy":e[0]=s*h*u-o*l*A,e[1]=o*l*u-s*h*A,e[2]=o*h*A+s*l*u,e[3]=o*h*u+s*l*A;break;case"yxz":e[0]=s*h*u+o*l*A,e[1]=o*l*u-s*h*A,e[2]=o*h*A-s*l*u,e[3]=o*h*u+s*l*A;break;case"yzx":e[0]=s*h*u+o*l*A,e[1]=o*l*u+s*h*A,e[2]=o*h*A-s*l*u,e[3]=o*h*u-s*l*A;break;case"zxy":e[0]=s*h*u-o*l*A,e[1]=o*l*u+s*h*A,e[2]=o*h*A+s*l*u,e[3]=o*h*u-s*l*A;break;case"zyx":e[0]=s*h*u-o*l*A,e[1]=o*l*u+s*h*A,e[2]=o*h*A-s*l*u,e[3]=o*h*u+s*l*A;break;default:throw new Error("Unknown angle order "+n)}return e}function E(){var e=new d(2);return d!=Float32Array&&(e[0]=0,e[1]=0),e}function I(e,t){var r=new d(2);return r[0]=e,r[1]=t,r}g(),b=new d(4),d!=Float32Array&&(b[0]=0,b[1]=0,b[2]=0,b[3]=0),g(),y(1,0,0),y(0,1,0),C(),C(),p(),E();let T=8192;function F(e,t,r){return t*(T/(e.tileSize*Math.pow(2,r-e.tileID.overscaledZ)))}function P(e,t){return(e%t+t)%t}function L(e,t,r){return e*(1-r)+t*r}function M(e){if(e<=0)return 0;if(e>=1)return 1;let t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}function k(e,t,r,i){let n=new o(e,t,r,i);return e=>n.solve(e)}let U=k(.25,.1,.25,1);function R(e,t,r){return Math.min(r,Math.max(t,e))}function D(e,t,r){let i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function N(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}let O=1;function Q(e,t,r){let i={};for(let r in e)i[r]=t.call(this,e[r],r,e);return i}function z(e,t,r){let i={};for(let r in e)t.call(this,e[r],r,e)&&(i[r]=e[r]);return i}function H(e){return Array.isArray(e)?e.map(H):"object"==typeof e&&e?Q(e,H):e}let j={};function V(e){j[e]||(typeof console<"u"&&console.warn(e),j[e]=!0)}function G(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function K(e){return typeof WorkerGlobalScope<"u"&&void 0!==e&&e instanceof WorkerGlobalScope}let q=null;function Z(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap}let W,$,X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Y(e,r,i,n,a){return t(this,void 0,void 0,(function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");let t=new VideoFrame(e,{timestamp:0});try{let s=t?.format;if(!s||!s.startsWith("BGR")&&!s.startsWith("RGB"))throw new Error(`Unrecognized format ${s}`);let o=s.startsWith("BGR"),l=new Uint8ClampedArray(n*a*4);if(yield t.copyTo(l,function(e,t,r,i,n){let a=4*Math.max(-t,0),s=(Math.max(0,r)-r)*i*4+a,o=4*i,l=Math.max(0,t),h=Math.max(0,r);return{rect:{x:l,y:h,width:Math.min(e.width,t+i)-l,height:Math.min(e.height,r+n)-h},layout:[{offset:s,stride:o}]}}(e,r,i,n,a)),o)for(let e=0;e<l.length;e+=4){let t=l[e];l[e]=l[e+2],l[e+2]=t}return l}finally{t.close()}}))}function J(e,t,r,i){return e.addEventListener(t,r,i),{unsubscribe:()=>{e.removeEventListener(t,r,i)}}}function ee(e){return e*Math.PI/180}function te(e){return e/Math.PI*180}let re={touchstart:!0,touchmove:!0,touchmoveWindow:!0,touchend:!0,touchcancel:!0},ie={dblclick:!0,click:!0,mouseover:!0,mouseout:!0,mousedown:!0,mousemove:!0,mousemoveWindow:!0,mouseup:!0,mouseupWindow:!0,contextmenu:!0,wheel:!0},ne="AbortError";function ae(){return new Error(ne)}let se={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function oe(e){return se.REGISTERED_PROTOCOLS[e.substring(0,e.indexOf("://"))]}let le="global-dispatcher";class he extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}}let Ae=()=>K(self)?self.worker&&self.worker.referrer:("blob:"===window.location.protocol?window.parent:window).location.href,ue=function(e,r){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){let t=oe(e.url);if(t)return t(e,r);if(K(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,targetMapId:le},r)}if(!(/^file:/.test(i=e.url)||/^file:/.test(Ae())&&!/^\w+:/.test(i))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(e,r){return t(this,void 0,void 0,(function*(){let t,i,n=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,cache:e.cache,referrer:Ae(),signal:r.signal});"json"!==e.type||n.headers.has("Accept")||n.headers.set("Accept","application/json");try{t=yield fetch(n)}catch(t){throw new he(0,t.message,e.url,new Blob)}if(!t.ok){let r=yield t.blob();throw new he(t.status,t.statusText,e.url,r)}i="arrayBuffer"===e.type||"image"===e.type?t.arrayBuffer():"json"===e.type?t.json():t.text();let a=yield i;if(r.signal.aborted)throw ae();return{data:a,cacheControl:t.headers.get("Cache-Control"),expires:t.headers.get("Expires")}}))}(e,r);if(K(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:e,mustQueue:!0,targetMapId:le},r)}var i,n,a;return n=e,a=r,new Promise(((e,t)=>{var r;let i=new XMLHttpRequest;i.open(n.method||"GET",n.url,!0),"arrayBuffer"!==n.type&&"image"!==n.type||(i.responseType="arraybuffer");for(let e in n.headers)i.setRequestHeader(e,n.headers[e]);"json"===n.type&&(i.responseType="text",!(null===(r=n.headers)||void 0===r)&&r.Accept||i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===n.credentials,i.onerror=()=>{t(new Error(i.statusText))},i.onload=()=>{if(!a.signal.aborted)if((i.status>=200&&i.status<300||0===i.status)&&null!==i.response){let r=i.response;if("json"===n.type)try{r=JSON.parse(i.response)}catch(e){return void t(e)}e({data:r,cacheControl:i.getResponseHeader("Cache-Control"),expires:i.getResponseHeader("Expires")})}else{let e=new Blob([i.response],{type:i.getResponseHeader("Content-Type")});t(new he(i.status,i.statusText,n.url,e))}},a.signal.addEventListener("abort",(()=>{i.abort(),t(ae())})),i.send(n.body)}))};function ce(e){if(!e||e.indexOf("://")<=0||0===e.indexOf("data:image/")||0===e.indexOf("blob:"))return!0;let t=new URL(e),r=window.location;return t.protocol===r.protocol&&t.host===r.host}function de(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function pe(e,t,r){if(r&&r[e]){let i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}class fe{constructor(e,t={}){N(this,t),this.type=e}}class ge extends fe{constructor(e,t={}){super("error",N({error:e},t))}}class me{on(e,t){return this._listeners=this._listeners||{},de(e,t,this._listeners),{unsubscribe:()=>{this.off(e,t)}}}off(e,t){return pe(e,t,this._listeners),pe(e,t,this._oneTimeListeners),this}once(e,t){return t?(this._oneTimeListeners=this._oneTimeListeners||{},de(e,t,this._oneTimeListeners),this):new Promise((t=>this.once(e,t)))}fire(e,t){"string"==typeof e&&(e=new fe(e,t||{}));let r=e.type;if(this.listens(r)){e.target=this;let t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(let r of t)r.call(this,e);let i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(let t of i)pe(r,t,this._oneTimeListeners),t.call(this,e);let n=this._eventedParent;n&&(N(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof ge&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var ye={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},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:"array",value:"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},"*":{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:"*"},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","property-type":"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","property-type":"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","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"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"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"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","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},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:"*",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"},"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"}},"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"}},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"}}};let _e=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function ve(e,t){let r={};for(let t in e)"ref"!==t&&(r[t]=e[t]);return _e.forEach((e=>{e in t&&(r[e]=t[e])})),r}function we(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!we(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(!we(e[r],t[r]))return!1;return!0}return e===t}function be(e,t){e.push(t)}function xe(e,t,r){be(r,{command:"addSource",args:[e,t[e]]})}function Be(e,t,r){be(t,{command:"removeSource",args:[e]}),r[e]=!0}function Ce(e,t,r,i){Be(e,r,i),xe(e,t,r)}function Se(e,t,r){let i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&"data"!==i&&!we(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&"data"!==i&&!we(e[r][i],t[r][i]))return!1;return!0}function Ee(e,t,r,i,n,a){e=e||{},t=t||{};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&(we(e[s],t[s])||r.push({command:a,args:[i,s,t[s],n]}));for(let s in t)Object.prototype.hasOwnProperty.call(t,s)&&!Object.prototype.hasOwnProperty.call(e,s)&&(we(e[s],t[s])||r.push({command:a,args:[i,s,t[s],n]}))}function Ie(e){return e.id}function Te(e,t){return e[t.id]=t,e}class Fe{constructor(e,t,r,i){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}}function Pe(e,...t){for(let r of t)for(let t in r)e[t]=r[t];return e}class Le extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class Me{constructor(e,t=[]){this.parent=e,this.bindings={};for(let[e,r]of t)this.bindings[e]=r}concat(e){return new Me(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)}}let ke={kind:"null"},Ue={kind:"number"},Re={kind:"string"},De={kind:"boolean"},Ne={kind:"color"},Oe={kind:"projectionDefinition"},Qe={kind:"object"},ze={kind:"value"},He={kind:"collator"},je={kind:"formatted"},Ve={kind:"padding"},Ge={kind:"colorArray"},Ke={kind:"numberArray"},qe={kind:"resolvedImage"},Ze={kind:"variableAnchorOffsetCollection"};function We(e,t){return{kind:"array",itemType:e,N:t}}function $e(e){if("array"===e.kind){let t=$e(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}let Xe=[ke,Ue,Re,De,Ne,Oe,je,Qe,We(ze),Ve,Ke,Ge,qe,Ze];function Ye(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ye(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(let e of Xe)if(!Ye(e,t))return null}return`Expected ${$e(e)} but found ${$e(t)} instead.`}function Je(e,t){return t.some((t=>t.kind===e.kind))}function et(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}function tt(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}let rt=.96422,it=.82521,nt=4/29,at=6/29,st=3*at*at,ot=at*at*at,lt=Math.PI/180,ht=180/Math.PI;function At(e){return(e%=360)<0&&(e+=360),e}function ut([e,t,r,i]){let n,a,s=dt((.2225045*(e=ct(e))+.7168786*(t=ct(t))+.0606169*(r=ct(r)))/1);e===t&&t===r?n=a=s:(n=dt((.4360747*e+.3850649*t+.1430804*r)/rt),a=dt((.0139322*e+.0971045*t+.7141733*r)/it));let o=116*s-16;return[o<0?0:o,500*(n-s),200*(s-a),i]}function ct(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function dt(e){return e>ot?Math.pow(e,1/3):e/st+nt}function pt([e,t,r,i]){let n=(e+16)/116,a=isNaN(t)?n:n+t/500,s=isNaN(r)?n:n-r/200;return n=1*gt(n),a=rt*gt(a),s=it*gt(s),[ft(3.1338561*a-1.6168667*n-.4906146*s),ft(-.9787684*a+1.9161415*n+.033454*s),ft(.0719453*a-.2289914*n+1.4052427*s),i]}function ft(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function gt(e){return e>at?e*e*e:st*(e-nt)}let mt=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function yt(e,t){return mt(e,t)?e[t]:void 0}function _t(e){return parseInt(e.padEnd(2,e),16)/255}function vt(e,t){return wt(t?e/100:e,0,1)}function wt(e,t,r){return Math.min(Math.max(t,e),r)}function bt(e){return!e.some(Number.isNaN)}let xt={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 Bt(e,t,r){return e+r*(t-e)}function Ct(e,t,r){return e.map(((e,i)=>Bt(e,t[i],r)))}class St{constructor(e,t,r,i=1,n=!0){this.r=e,this.g=t,this.b=r,this.a=i,n||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[e,t,r,i]))}static parse(e){if(e instanceof St)return e;if("string"!=typeof e)return;let t=function(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];let t=yt(xt,e);if(t){let[e,r,i]=t;return[e/255,r/255,i/255,1]}if(e.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){let t=e.length<6?1:2,r=1;return[_t(e.slice(r,r+=t)),_t(e.slice(r,r+=t)),_t(e.slice(r,r+=t)),_t(e.slice(r,r+t)||"ff")]}if(e.startsWith("rgb")){let t=e.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(t){let[e,r,i,n,a,s,o,l,h,A,u,c]=t,d=[n||" ",o||" ",A].join("");if("  "===d||"  /"===d||",,"===d||",,,"===d){let e=[i,s,h].join(""),t="%%%"===e?100:""===e?255:0;if(t){let e=[wt(+r/t,0,1),wt(+a/t,0,1),wt(+l/t,0,1),u?vt(+u,c):1];if(bt(e))return e}}return}}let r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){let[e,t,i,n,a,s,o,l,h]=r,A=[i||" ",a||" ",o].join("");if("  "===A||"  /"===A||",,"===A||",,,"===A){let e=[+t,wt(+n,0,100),wt(+s,0,100),l?vt(+l,h):1];if(bt(e))return function([e,t,r,i]){function n(i){let n=(i+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(n-3,9-n,1))}return e=At(e),t/=100,r/=100,[n(0),n(8),n(4),i]}(e)}}}(e);return t?new St(...t,!1):void 0}get rgb(){let{r:e,g:t,b:r,a:i}=this,n=i||1/0;return this.overwriteGetter("rgb",[e/n,t/n,r/n,i])}get hcl(){return this.overwriteGetter("hcl",function(e){let[t,r,i,n]=ut(e),a=Math.sqrt(r*r+i*i);return[Math.round(1e4*a)?At(Math.atan2(i,r)*ht):NaN,a,t,n]}(this.rgb))}get lab(){return this.overwriteGetter("lab",ut(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){let[e,t,r,i]=this.rgb;return`rgba(${[e,t,r].map((e=>Math.round(255*e))).join(",")},${i})`}static interpolate(e,t,r,i="rgb"){switch(i){case"rgb":{let[i,n,a,s]=Ct(e.rgb,t.rgb,r);return new St(i,n,a,s,!1)}case"hcl":{let i,n,[a,s,o,l]=e.hcl,[h,A,u,c]=t.hcl;if(isNaN(a)||isNaN(h))isNaN(a)?isNaN(h)?i=NaN:(i=h,1!==o&&0!==o||(n=A)):(i=a,1!==u&&0!==u||(n=s));else{let e=h-a;h>a&&e>180?e-=360:h<a&&a-h>180&&(e+=360),i=a+r*e}let[d,p,f,g]=function([e,t,r,i]){return e=isNaN(e)?0:e*lt,pt([r,Math.cos(e)*t,Math.sin(e)*t,i])}([i,n??Bt(s,A,r),Bt(o,u,r),Bt(l,c,r)]);return new St(d,p,f,g,!1)}case"lab":{let[i,n,a,s]=pt(Ct(e.lab,t.lab,r));return new St(i,n,a,s,!1)}}}}St.black=new St(0,0,0,1),St.white=new St(1,1,1,1),St.transparent=new St(0,0,0,0),St.red=new St(1,0,0,1);class Et{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}let It=["bottom","center","top"];class Tt{constructor(e,t,r,i,n,a){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n,this.verticalAlign=a}}class Ft{constructor(e){this.sections=e}static fromString(e){return new Ft([new Tt(e,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Ft?e:Ft.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Pt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Pt)return e;if("number"==typeof e)return new Pt([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(let t of e)if("number"!=typeof t)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 Pt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Pt(Ct(e.values,t.values,r))}}class Lt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Lt)return e;if("number"==typeof e)return new Lt([e]);if(Array.isArray(e)){for(let t of e)if("number"!=typeof t)return;return new Lt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new Lt(Ct(e.values,t.values,r))}}class Mt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Mt)return e;if("string"==typeof e){let t=St.parse(e);return t?new Mt([t]):void 0}if(!Array.isArray(e))return;let t=[];for(let r of e){if("string"!=typeof r)return;let e=St.parse(r);if(!e)return;t.push(e)}return new Mt(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,i="rgb"){let n=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)n.push(St.interpolate(e.values[a],t.values[a],r,i));return new Mt(n)}}class kt extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}let Ut=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Rt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Rt)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){let r=e[t],i=e[t+1];if("string"!=typeof r||!Ut.has(r)||!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])return}return new Rt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){let i=e.values,n=t.values;if(i.length!==n.length)throw new kt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);let a=[];for(let e=0;e<i.length;e+=2){if(i[e]!==n[e])throw new kt(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${i[e]}, to[${e}]: ${n[e]}`);a.push(i[e]);let[t,s]=i[e+1],[o,l]=n[e+1];a.push([Bt(t,o,r),Bt(s,l,r)])}return new Rt(a)}}class Dt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Dt({name:e,available:!1}):null}}class Nt{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new Nt(e,t,r)}static parse(e){return e instanceof Nt?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new Nt(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new Nt(e.from,e.to,e.transition):"string"==typeof e?new Nt(e,e,1):void 0}}function Ot(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Qt(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof Nt||e instanceof St||e instanceof Et||e instanceof Ft||e instanceof Pt||e instanceof Lt||e instanceof Mt||e instanceof Rt||e instanceof Dt)return!0;if(Array.isArray(e)){for(let t of e)if(!Qt(t))return!1;return!0}if("object"==typeof e){for(let t in e)if(!Qt(e[t]))return!1;return!0}return!1}function zt(e){if(null===e)return ke;if("string"==typeof e)return Re;if("boolean"==typeof e)return De;if("number"==typeof e)return Ue;if(e instanceof St)return Ne;if(e instanceof Nt)return Oe;if(e instanceof Et)return He;if(e instanceof Ft)return je;if(e instanceof Pt)return Ve;if(e instanceof Lt)return Ke;if(e instanceof Mt)return Ge;if(e instanceof Rt)return Ze;if(e instanceof Dt)return qe;if(Array.isArray(e)){let t,r=e.length;for(let r of e){let e=zt(r);if(t){if(t===e)continue;t=ze;break}t=e}return We(t||ze,r)}return Qe}function Ht(e){let t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof St||e instanceof Nt||e instanceof Ft||e instanceof Pt||e instanceof Lt||e instanceof Mt||e instanceof Rt||e instanceof Dt?e.toString():JSON.stringify(e)}class jt{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Qt(e[1]))return t.error("invalid value");let r=e[1],i=zt(r),n=t.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new jt(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}let Vt={string:Re,number:Ue,boolean:De,object:Qe};class Gt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,i=1,n=e[0];if("array"===n){let n,a;if(e.length>2){let r=e[1];if("string"!=typeof r||!(r in Vt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=Vt[r],i++}else n=ze;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);a=e[2],i++}r=We(n,a)}else{if(!Vt[n])throw new Error(`Types doesn't contain name = ${n}`);r=Vt[n]}let a=[];for(;i<e.length;i++){let r=t.parse(e[i],i,ze);if(!r)return null;a.push(r)}return new Gt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){let r=this.args[t].evaluate(e);if(!Ye(this.type,zt(r)))return r;if(t===this.args.length-1)throw new kt(`Expected value to be of type ${$e(this.type)}, but found ${$e(zt(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let Kt={"to-boolean":De,"to-color":Ne,"to-number":Ue,"to-string":Re};class qt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=e[0];if(!Kt[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");let i=Kt[r],n=[];for(let r=1;r<e.length;r++){let i=t.parse(e[r],r,ze);if(!i)return null;n.push(i)}return new qt(i,n)}evaluate(e){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(e);case"color":{let t,r;for(let i of this.args){if(t=i.evaluate(e),r=null,t instanceof St)return t;if("string"==typeof t){let r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Ot(t[0],t[1],t[2],t[3]),!r))return new St(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new kt(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(let r of this.args){t=r.evaluate(e);let i=Pt.parse(t);if(i)return i}throw new kt(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=Lt.parse(t);if(i)return i}throw new kt(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(let r of this.args){t=r.evaluate(e);let i=Mt.parse(t);if(i)return i}throw new kt(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(let r of this.args){t=r.evaluate(e);let i=Rt.parse(t);if(i)return i}throw new kt(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(let r of this.args){if(t=r.evaluate(e),null===t)return 0;let i=Number(t);if(!isNaN(i))return i}throw new kt(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Ft.fromString(Ht(this.args[0].evaluate(e)));case"resolvedImage":return Dt.fromString(Ht(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return Ht(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}let Zt=["Unknown","Point","LineString","Polygon"];class Wt{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?"number"==typeof this.feature.type?Zt[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 t=this._parseColorCache.get(e);return t||(t=St.parse(e),this._parseColorCache.set(e,t)),t}}class $t{constructor(e,t,r=[],i,n=new Me,a=[]){this.registry=e,this.path=r,this.key=r.map((e=>`[${e}]`)).join(""),this.scope=n,this.errors=a,this.expectedType=i,this._isConstant=t}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new Gt(t,[e]):"coerce"===r?new qt(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');let i=e[0];if("string"!=typeof i)return this.error(`Expression name must be a string, but found ${typeof i} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;let n=this.registry[i];if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){let e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(n.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(n.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(n.kind)||"colorArray"===e.kind&&["value","string","array"].includes(n.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(n.kind))i=r(i,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof jt)&&"resolvedImage"!==i.type.kind&&this._isConstant(i)){let e=new Wt;try{i=new jt(i.type,i.evaluate(e))}catch(e){return this.error(e.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){let i="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new $t(this.registry,this._isConstant,i,t||null,n,this.errors)}error(e,...t){let r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new Le(r,e))}checkSubtype(e,t){let r=Ye(e,t);return r&&this.error(r),r}}class Xt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(let t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);let r=[];for(let i=1;i<e.length-1;i+=2){let n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);let a=t.parse(e[i+1],i+1);if(!a)return null;r.push([n,a])}let i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new Xt(r,i):null}outputDefined(){return this.result.outputDefined()}}class Yt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");let r=e[1];return t.scope.has(r)?new Yt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class Jt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,Ue),i=t.parse(e[2],2,We(t.expectedType||ze));return r&&i?new Jt(i.type.itemType,r,i):null}evaluate(e){let t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new kt(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new kt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new kt(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class er{constructor(e,t){this.type=De,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,ze),i=t.parse(e[2],2,ze);return r&&i?Je(r.type,[De,Re,Ue,ke,ze])?new er(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(r.type)} instead`):null}evaluate(e){let t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!et(t,["boolean","string","number","null"]))throw new kt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(zt(t))} instead.`);if(!et(r,["string","array"]))throw new kt(`Expected second argument to be of type array or string, but found ${$e(zt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class tr{constructor(e,t,r){this.type=Ue,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,ze),i=t.parse(e[2],2,ze);if(!r||!i)return null;if(!Je(r.type,[De,Re,Ue,ke,ze]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${$e(r.type)} instead`);if(4===e.length){let n=t.parse(e[3],3,Ue);return n?new tr(r,i,n):null}return new tr(r,i)}evaluate(e){let t,r=this.needle.evaluate(e),i=this.haystack.evaluate(e);if(!et(r,["boolean","string","number","null"]))throw new kt(`Expected first argument to be of type boolean, string, number or null, but found ${$e(zt(r))} instead.`);if(this.fromIndex&&(t=this.fromIndex.evaluate(e)),et(i,["string"])){let e=i.indexOf(r,t);return-1===e?-1:[...i.slice(0,e)].length}if(et(i,["array"]))return i.indexOf(r,t);throw new kt(`Expected second argument to be of type array or string, but found ${$e(zt(i))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class rr{constructor(e,t,r,i,n,a){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=a}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);let n={},a=[];for(let s=2;s<e.length-1;s+=2){let o=e[s],l=e[s+1];Array.isArray(o)||(o=[o]);let h=t.concat(s);if(0===o.length)return h.error("Expected at least one branch label.");for(let e of o){if("number"!=typeof e&&"string"!=typeof e)return h.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return h.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return h.error("Numeric branch labels must be integer values.");if(r){if(h.checkSubtype(r,zt(e)))return null}else r=zt(e);if(void 0!==n[String(e)])return h.error("Branch labels must be unique.");n[String(e)]=a.length}let A=t.parse(l,s,i);if(!A)return null;i=i||A.type,a.push(A)}let s=t.parse(e[1],1,ze);if(!s)return null;let o=t.parse(e[e.length-1],e.length-1,i);return o?"value"!==s.type.kind&&t.concat(1).checkSubtype(r,s.type)?null:new rr(r,i,s,n,a,o):null}evaluate(e){let t=this.input.evaluate(e);return(zt(t)===this.inputType&&this.outputs[this.cases[t]]||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 ir{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);let i=[];for(let n=1;n<e.length-1;n+=2){let a=t.parse(e[n],n,De);if(!a)return null;let s=t.parse(e[n+1],n+1,r);if(!s)return null;i.push([a,s]),r=r||s.type}let n=t.parse(e[e.length-1],e.length-1,r);if(!n)return null;if(!r)throw new Error("Can't infer output type");return new ir(r,i,n)}evaluate(e){for(let[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(let[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}}class nr{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);let r=t.parse(e[1],1,ze),i=t.parse(e[2],2,Ue);if(!r||!i)return null;if(!Je(r.type,[We(ze),Re,ze]))return t.error(`Expected first argument to be of type array or string, but found ${$e(r.type)} instead`);if(4===e.length){let n=t.parse(e[3],3,Ue);return n?new nr(r.type,r,i,n):null}return new nr(r.type,r,i)}evaluate(e){let t,r=this.input.evaluate(e),i=this.beginIndex.evaluate(e);if(this.endIndex&&(t=this.endIndex.evaluate(e)),et(r,["string"]))return[...r].slice(i,t).join("");if(et(r,["array"]))return r.slice(i,t);throw new kt(`Expected first argument to be of type array or string, but found ${$e(zt(r))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function ar(e,t){let r,i,n=e.length-1,a=0,s=n,o=0;for(;a<=s;)if(o=Math.floor((a+s)/2),r=e[o],i=e[o+1],r<=t){if(o===n||t<i)return o;a=o+1}else{if(!(r>t))throw new kt("Input is not a number.");s=o-1}return 0}class sr{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(let[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");let r=t.parse(e[1],1,Ue);if(!r)return null;let i=[],n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let r=1;r<e.length;r+=2){let a=1===r?-1/0:e[r],s=e[r+1],o=r,l=r+1;if("number"!=typeof a)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',o);if(i.length&&i[i.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',o);let h=t.parse(s,l,n);if(!h)return null;n=n||h.type,i.push([a,h])}return new sr(n,r,i)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[ar(t,i)].evaluate(e)}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}var or,lr,hr,Ar=function(){if(lr)return or;function e(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}return lr=1,or=e,e.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,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=n/a}var s=0,o=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?s=r:o=r,r=.5*(o-s)+s;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},or}(),ur=(hr=Ar)&&hr.__esModule&&Object.prototype.hasOwnProperty.call(hr,"default")?hr.default:hr;class cr{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(let[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=dr(t,e.base,r,i);else if("linear"===e.name)n=dr(t,1,r,i);else if("cubic-bezier"===e.name){let a=e.controlPoints;n=new ur(a[0],a[1],a[2],a[3]).solve(dr(t,1,r,i))}return n}static parse(e,t){let[r,i,n,...a]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){let e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{let e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(n=t.parse(n,2,Ue),!n)return null;let s=[],o=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==Ge?t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType):o=Ne;for(let e=0;e<a.length;e+=2){let r=a[e],i=a[e+1],n=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(s.length&&s[s.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);let h=t.parse(i,l,o);if(!h)return null;o=o||h.type,s.push([r,h])}return tt(o,Ue)||tt(o,Oe)||tt(o,Ne)||tt(o,Ve)||tt(o,Ke)||tt(o,Ge)||tt(o,Ze)||tt(o,We(Ue))?new cr(o,r,i,n,s):t.error(`Type ${$e(o)} is not interpolatable.`)}evaluate(e){let t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);let i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);let n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);let a=ar(t,i),s=cr.interpolationFactor(this.interpolation,i,t[a],t[a+1]),o=r[a].evaluate(e),l=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Bt(o,l,s);case"color":return St.interpolate(o,l,s);case"padding":return Pt.interpolate(o,l,s);case"colorArray":return Mt.interpolate(o,l,s);case"numberArray":return Lt.interpolate(o,l,s);case"variableAnchorOffsetCollection":return Rt.interpolate(o,l,s);case"array":return Ct(o,l,s);case"projectionDefinition":return Nt.interpolate(o,l,s)}case"interpolate-hcl":switch(this.type.kind){case"color":return St.interpolate(o,l,s,"hcl");case"colorArray":return Mt.interpolate(o,l,s,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return St.interpolate(o,l,s,"lab");case"colorArray":return Mt.interpolate(o,l,s,"lab")}}}eachChild(e){e(this.input);for(let t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function dr(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}let pr={color:St.interpolate,number:Bt,padding:Pt.interpolate,numberArray:Lt.interpolate,colorArray:Mt.interpolate,variableAnchorOffsetCollection:Rt.interpolate,array:Ct};class fr{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=null,i=t.expectedType;i&&"value"!==i.kind&&(r=i);let n=[];for(let i of e.slice(1)){let e=t.parse(i,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,n.push(e)}if(!r)throw new Error("No output type");let a=i&&n.some((e=>Ye(i,e.type)));return new fr(a?ze:r,n)}evaluate(e){let t,r=null,i=0;for(let n of this.args)if(i++,r=n.evaluate(e),r&&r instanceof Dt&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}function gr(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function mr(e,t,r,i){return 0===i.compare(t,r)}function yr(e,t,r){let i="=="!==e&&"!="!==e;return class n{constructor(e,t,r){this.type=De,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");let r=e[0],a=t.parse(e[1],1,ze);if(!a)return null;if(!gr(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${$e(a.type)}'.`);let s=t.parse(e[2],2,ze);if(!s)return null;if(!gr(r,s.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${$e(s.type)}'.`);if(a.type.kind!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error(`Cannot compare types '${$e(a.type)}' and '${$e(s.type)}'.`);i&&("value"===a.type.kind&&"value"!==s.type.kind?a=new Gt(s.type,[a]):"value"!==a.type.kind&&"value"===s.type.kind&&(s=new Gt(a.type,[s])));let o=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==s.type.kind&&"value"!==a.type.kind&&"value"!==s.type.kind)return t.error("Cannot use collator to compare non-string types.");if(o=t.parse(e[3],3,He),!o)return null}return new n(a,s,o)}evaluate(n){let a=this.lhs.evaluate(n),s=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){let t=zt(a),r=zt(s);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new kt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){let e=zt(a),r=zt(s);if("string"!==e.kind||"string"!==r.kind)return t(n,a,s)}return this.collator?r(n,a,s,this.collator.evaluate(n)):t(n,a,s)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}let _r=yr("==",(function(e,t,r){return t===r}),mr),vr=yr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!mr(0,t,r,i)})),wr=yr("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),br=yr(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),xr=yr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),Br=yr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0}));class Cr{constructor(e,t,r){this.type=He,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");let r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");let i=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,De);if(!i)return null;let n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,De);if(!n)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,Re),!a)?null:new Cr(i,n,a)}evaluate(e){return new Et(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 Sr{constructor(e,t,r,i,n){this.type=Re,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");let r=t.parse(e[1],1,Ue);if(!r)return null;let i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=t.parse(i.locale,1,Re),!n))return null;let a=null;if(i.currency&&(a=t.parse(i.currency,1,Re),!a))return null;let s=null;if(i["min-fraction-digits"]&&(s=t.parse(i["min-fraction-digits"],1,Ue),!s))return null;let o=null;return i["max-fraction-digits"]&&(o=t.parse(i["max-fraction-digits"],1,Ue),!o)?null:new Sr(r,n,a,s,o)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.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.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Er{constructor(e){this.type=je,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");let i=[],n=!1;for(let r=1;r<=e.length-1;++r){let a=e[r];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,Ue),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,We(Re)),!r))return null;let s=null;if(a["text-color"]&&(s=t.parse(a["text-color"],1,Ne),!s))return null;let o=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!It.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(o=t.parse(a["vertical-align"],1,Re),!o)return null}let l=i[i.length-1];l.scale=e,l.font=r,l.textColor=s,l.verticalAlign=o}else{let a=t.parse(e[r],1,ze);if(!a)return null;let s=a.type.kind;if("string"!==s&&"value"!==s&&"null"!==s&&"resolvedImage"!==s)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Er(i)}evaluate(e){return new Ft(this.sections.map((t=>{let r=t.content.evaluate(e);return zt(r)===qe?new Tt("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Tt(Ht(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.evaluate(e):null)})))}eachChild(e){for(let t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Ir{constructor(e){this.type=qe,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");let r=t.parse(e[1],1,Re);return r?new Ir(r):t.error("No image name provided.")}evaluate(e){let t=this.input.evaluate(e),r=Dt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Tr{constructor(e){this.type=Ue,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${$e(r.type)} instead.`):new Tr(r):null}evaluate(e){let t=this.input.evaluate(e);if("string"==typeof t)return[...t].length;if(Array.isArray(t))return t.length;throw new kt(`Expected value to be of type string or array, but found ${$e(zt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}let Fr=8192;function Pr(e,t){let r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*Fr),Math.round(i*n*Fr)]}function Lr(e,t){let r=Math.pow(2,t.z);return[(n=(e[0]/Fr+t.x)/r,360*n-180),(i=(e[1]/Fr+t.y)/r,360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90)];var i,n}function Mr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function kr(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Ur(e,t,r){let i=e[0]-t[0],n=e[1]-t[1],a=e[0]-r[0],s=e[1]-r[1];return i*s-a*n==0&&i*a<=0&&n*s<=0}function Rr(e,t,r,i){return(n=[i[0]-r[0],i[1]-r[1]])[0]*(a=[t[0]-e[0],t[1]-e[1]])[1]-n[1]*a[0]!=0&&!(!Hr(e,t,r,i)||!Hr(r,i,e,t));var n,a}function Dr(e,t,r){for(let i of r)for(let r=0;r<i.length-1;++r)if(Rr(e,t,i[r],i[r+1]))return!0;return!1}function Nr(e,t,r=!1){let i=!1;for(let o of t)for(let t=0;t<o.length-1;t++){if(Ur(e,o[t],o[t+1]))return r;(a=o[t])[1]>(n=e)[1]!=(s=o[t+1])[1]>n[1]&&n[0]<(s[0]-a[0])*(n[1]-a[1])/(s[1]-a[1])+a[0]&&(i=!i)}var n,a,s;return i}function Or(e,t){for(let r of t)if(Nr(e,r))return!0;return!1}function Qr(e,t){for(let r of e)if(!Nr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(Dr(e[r],e[r+1],t))return!1;return!0}function zr(e,t){for(let r of t)if(Qr(e,r))return!0;return!1}function Hr(e,t,r,i){let n=i[0]-r[0],a=i[1]-r[1],s=(e[0]-r[0])*a-n*(e[1]-r[1]),o=(t[0]-r[0])*a-n*(t[1]-r[1]);return s>0&&o<0||s<0&&o>0}function jr(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=[];for(let i=0;i<e[n].length;i++){let s=Pr(e[n][i],r);Mr(t,s),a.push(s)}i.push(a)}return i}function Vr(e,t,r){let i=[];for(let n=0;n<e.length;n++){let a=jr(e[n],t,r);i.push(a)}return i}function Gr(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){let t=.5*i,n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}Mr(t,e)}function Kr(e,t,r,i){let n=Math.pow(2,i.z)*Fr,a=[i.x*Fr,i.y*Fr],s=[];for(let i of e)for(let e of i){let i=[e.x+a[0],e.y+a[1]];Gr(i,t,r,n),s.push(i)}return s}function qr(e,t,r,i){let n=Math.pow(2,i.z)*Fr,a=[i.x*Fr,i.y*Fr],s=[];for(let r of e){let e=[];for(let i of r){let r=[i.x+a[0],i.y+a[1]];Mr(t,r),e.push(r)}s.push(e)}if(t[2]-t[0]<=n/2){(o=t)[0]=o[1]=1/0,o[2]=o[3]=-1/0;for(let e of s)for(let i of e)Gr(i,t,r,n)}var o;return s}class Zr{constructor(e,t){this.type=De,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qt(e[1])){let t=e[1];if("FeatureCollection"===t.type){let e=[];for(let r of t.features){let{type:t,coordinates:i}=r.geometry;"Polygon"===t&&e.push(i),"MultiPolygon"===t&&e.push(...i)}if(e.length)return new Zr(t,{type:"MultiPolygon",coordinates:e})}else if("Feature"===t.type){let e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new Zr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new Zr(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=jr(t.coordinates,i,n),s=Kr(e.geometry(),r,i,n);if(!kr(r,i))return!1;for(let e of s)if(!Nr(e,a))return!1}if("MultiPolygon"===t.type){let a=Vr(t.coordinates,i,n),s=Kr(e.geometry(),r,i,n);if(!kr(r,i))return!1;for(let e of s)if(!Or(e,a))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){let a=jr(t.coordinates,i,n),s=qr(e.geometry(),r,i,n);if(!kr(r,i))return!1;for(let e of s)if(!Qr(e,a))return!1}if("MultiPolygon"===t.type){let a=Vr(t.coordinates,i,n),s=qr(e.geometry(),r,i,n);if(!kr(r,i))return!1;for(let e of s)if(!zr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Wr=class{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=1+(e<<1),a=i+1;if(a<this.length&&r(t[a],t[i])<0&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}};function $r(e,t,r=0,i=e.length-1,n=Yr){for(;i>r;){if(i-r>600){let a=i-r+1,s=t-r+1,o=Math.log(a),l=.5*Math.exp(2*o/3),h=.5*Math.sqrt(o*l*(a-l)/a)*(s-a/2<0?-1:1);$r(e,t,Math.max(r,Math.floor(t-s*l/a+h)),Math.min(i,Math.floor(t+(a-s)*l/a+h)),n)}let a=e[t],s=r,o=i;for(Xr(e,r,t),n(e[i],a)>0&&Xr(e,r,i);s<o;){for(Xr(e,s,o),s++,o--;n(e[s],a)<0;)s++;for(;n(e[o],a)>0;)o--}0===n(e[r],a)?Xr(e,r,o):(o++,Xr(e,o,i)),o<=t&&(r=o+1),t<=o&&(i=o-1)}}function Xr(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function Yr(e,t){return e<t?-1:e>t?1:0}function Jr(e,t){if(e.length<=1)return[e];let r,i,n=[];for(let t of e){let e=ti(t);0!==e&&(t.area=Math.abs(e),void 0===i&&(i=e<0),i===e<0?(r&&n.push(r),r=[t]):r.push(t))}if(r&&n.push(r),t>1)for(let e=0;e<n.length;e++)n[e].length<=t||($r(n[e],t,1,n[e].length-1,ei),n[e]=n[e].slice(0,t));return n}function ei(e,t){return t.area-e.area}function ti(e){let t=0;for(let r,i,n=0,a=e.length,s=a-1;n<a;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}let ri=1/298.257223563,ii=ri*(2-ri),ni=Math.PI/180;class ai{constructor(e){let t=6378.137*ni*1e3,r=Math.cos(e*ni),i=1/(1-ii*(1-r*r)),n=Math.sqrt(i);this.kx=t*n*r,this.ky=t*n*i*(1-ii)}distance(e,t){let r=this.wrap(e[0]-t[0])*this.kx,i=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+i*i)}pointOnLine(e,t){let r,i,n,a,s=1/0;for(let o=0;o<e.length-1;o++){let l=e[o][0],h=e[o][1],A=this.wrap(e[o+1][0]-l)*this.kx,u=(e[o+1][1]-h)*this.ky,c=0;0===A&&0===u||(c=(this.wrap(t[0]-l)*this.kx*A+(t[1]-h)*this.ky*u)/(A*A+u*u),c>1?(l=e[o+1][0],h=e[o+1][1]):c>0&&(l+=A/this.kx*c,h+=u/this.ky*c)),A=this.wrap(t[0]-l)*this.kx,u=(t[1]-h)*this.ky;let d=A*A+u*u;d<s&&(s=d,r=l,i=h,n=o,a=c)}return{point:[r,i],index:n,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function si(e,t){return t[0]-e[0]}function oi(e){return e[1]-e[0]+1}function li(e,t){return e[1]>=e[0]&&e[1]<t}function hi(e,t){if(e[0]>e[1])return[null,null];let r=oi(e);if(t){if(2===r)return[e,null];let t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];let i=Math.floor(r/2)-1;return[[e[0],e[0]+i],[e[0]+i+1,e[1]]]}function Ai(e,t){if(!li(t,e.length))return[1/0,1/0,-1/0,-1/0];let r=[1/0,1/0,-1/0,-1/0];for(let i=t[0];i<=t[1];++i)Mr(r,e[i]);return r}function ui(e){let t=[1/0,1/0,-1/0,-1/0];for(let r of e)for(let e of r)Mr(t,e);return t}function ci(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function di(e,t,r){if(!ci(e)||!ci(t))return NaN;let i=0,n=0;return e[2]<t[0]&&(i=t[0]-e[2]),e[0]>t[2]&&(i=e[0]-t[2]),e[1]>t[3]&&(n=e[1]-t[3]),e[3]<t[1]&&(n=t[1]-e[3]),r.distance([0,0],[i,n])}function pi(e,t,r){let i=r.pointOnLine(t,e);return r.distance(e,i.point)}function fi(e,t,r,i,n){let a=Math.min(pi(e,[r,i],n),pi(t,[r,i],n)),s=Math.min(pi(r,[e,t],n),pi(i,[e,t],n));return Math.min(a,s)}function gi(e,t,r,i,n){if(!li(t,e.length)||!li(i,r.length))return 1/0;let a=1/0;for(let s=t[0];s<t[1];++s){let t=e[s],o=e[s+1];for(let e=i[0];e<i[1];++e){let i=r[e],s=r[e+1];if(Rr(t,o,i,s))return 0;a=Math.min(a,fi(t,o,i,s,n))}}return a}function mi(e,t,r,i,n){if(!li(t,e.length)||!li(i,r.length))return NaN;let a=1/0;for(let s=t[0];s<=t[1];++s)for(let t=i[0];t<=i[1];++t)if(a=Math.min(a,n.distance(e[s],r[t])),0===a)return a;return a}function yi(e,t,r){if(Nr(e,t,!0))return 0;let i=1/0;for(let n of t){let t=n[0],a=n[n.length-1];if(t!==a&&(i=Math.min(i,pi(e,[a,t],r)),0===i))return i;let s=r.pointOnLine(n,e);if(i=Math.min(i,r.distance(e,s.point)),0===i)return i}return i}function _i(e,t,r,i){if(!li(t,e.length))return NaN;for(let i=t[0];i<=t[1];++i)if(Nr(e[i],r,!0))return 0;let n=1/0;for(let a=t[0];a<t[1];++a){let t=e[a],s=e[a+1];for(let e of r)for(let r=0,a=e.length,o=a-1;r<a;o=r++){let a=e[o],l=e[r];if(Rr(t,s,a,l))return 0;n=Math.min(n,fi(t,s,a,l,i))}}return n}function vi(e,t){for(let r of e)for(let e of r)if(Nr(e,t,!0))return!0;return!1}function wi(e,t,r,i=1/0){let n=ui(e),a=ui(t);if(i!==1/0&&di(n,a,r)>=i)return i;if(kr(n,a)){if(vi(e,t))return 0}else if(vi(t,e))return 0;let s=1/0;for(let i of e)for(let e=0,n=i.length,a=n-1;e<n;a=e++){let n=i[a],o=i[e];for(let e of t)for(let t=0,i=e.length,a=i-1;t<i;a=t++){let i=e[a],l=e[t];if(Rr(n,o,i,l))return 0;s=Math.min(s,fi(n,o,i,l,r))}}return s}function bi(e,t,r,i,n,a){if(!a)return;let s=di(Ai(i,a),n,r);s<t&&e.push([s,a,[0,0]])}function xi(e,t,r,i,n,a,s){if(!a||!s)return;let o=di(Ai(i,a),Ai(n,s),r);o<t&&e.push([o,a,s])}function Bi(e,t,r,i,n=1/0){let a=Math.min(i.distance(e[0],r[0][0]),n);if(0===a)return a;let s=new Wr([[0,[0,e.length-1],[0,0]]],si),o=ui(r);for(;s.length>0;){let n=s.pop();if(n[0]>=a)continue;let l=n[1],h=t?50:100;if(oi(l)<=h){if(!li(l,e.length))return NaN;if(t){let t=_i(e,l,r,i);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){let n=yi(e[t],r,i);if(a=Math.min(a,n),0===a)return 0}}else{let r=hi(l,t);bi(s,a,i,e,o,r[0]),bi(s,a,i,e,o,r[1])}}return a}function Ci(e,t,r,i,n,a=1/0){let s=Math.min(a,n.distance(e[0],r[0]));if(0===s)return s;let o=new Wr([[0,[0,e.length-1],[0,r.length-1]]],si);for(;o.length>0;){let a=o.pop();if(a[0]>=s)continue;let l=a[1],h=a[2],A=t?50:100,u=i?50:100;if(oi(l)<=A&&oi(h)<=u){if(!li(l,e.length)&&li(h,r.length))return NaN;let a;if(t&&i)a=gi(e,l,r,h,n),s=Math.min(s,a);else if(t&&!i){let t=e.slice(l[0],l[1]+1);for(let e=h[0];e<=h[1];++e)if(a=pi(r[e],t,n),s=Math.min(s,a),0===s)return s}else if(!t&&i){let t=r.slice(h[0],h[1]+1);for(let r=l[0];r<=l[1];++r)if(a=pi(e[r],t,n),s=Math.min(s,a),0===s)return s}else a=mi(e,l,r,h,n),s=Math.min(s,a)}else{let a=hi(l,t),A=hi(h,i);xi(o,s,n,e,r,a[0],A[0]),xi(o,s,n,e,r,a[0],A[1]),xi(o,s,n,e,r,a[1],A[0]),xi(o,s,n,e,r,a[1],A[1])}}return s}function Si(e){return"MultiPolygon"===e.type?e.coordinates.map((e=>({type:"Polygon",coordinates:e}))):"MultiLineString"===e.type?e.coordinates.map((e=>({type:"LineString",coordinates:e}))):"MultiPoint"===e.type?e.coordinates.map((e=>({type:"Point",coordinates:e}))):[e]}class Ei{constructor(e,t){this.type=Ue,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Qt(e[1])){let t=e[1];if("FeatureCollection"===t.type)return new Ei(t,t.features.map((e=>Si(e.geometry))).flat());if("Feature"===t.type)return new Ei(t,Si(t.geometry));if("type"in t&&"coordinates"in t)return new Ei(t,Si(t))}return t.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map((t=>Lr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;let n=new ai(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,Ci(i,!1,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ci(i,!1,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Bi(i,!1,e.coordinates,n,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){let r=e.geometry(),i=r.flat().map((t=>Lr([t.x,t.y],e.canonical)));if(0===r.length)return NaN;let n=new ai(i[0][1]),a=1/0;for(let e of t){switch(e.type){case"Point":a=Math.min(a,Ci(i,!0,[e.coordinates],!1,n,a));break;case"LineString":a=Math.min(a,Ci(i,!0,e.coordinates,!0,n,a));break;case"Polygon":a=Math.min(a,Bi(i,!0,e.coordinates,n,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return function(e,t){let r=e.geometry();if(0===r.length||0===r[0].length)return NaN;let i=Jr(r,0).map((t=>t.map((t=>t.map((t=>Lr([t.x,t.y],e.canonical))))))),n=new ai(i[0][0][0][1]),a=1/0;for(let e of t)for(let t of i){switch(e.type){case"Point":a=Math.min(a,Bi([e.coordinates],!1,t,n,a));break;case"LineString":a=Math.min(a,Bi(e.coordinates,!0,t,n,a));break;case"Polygon":a=Math.min(a,wi(t,e.coordinates,n,a))}if(0===a)return a}return a}(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Ii{constructor(e){this.type=ze,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);let r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Ii(r)}evaluate(e){var t;let r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?yt(r,this.key):null}eachChild(){}outputDefined(){return!1}}let Ti={"==":_r,"!=":vr,">":br,"<":wr,">=":Br,"<=":xr,array:Gt,at:Jt,boolean:Gt,case:ir,coalesce:fr,collator:Cr,format:Er,image:Ir,in:er,"index-of":tr,interpolate:cr,"interpolate-hcl":cr,"interpolate-lab":cr,length:Tr,let:Xt,literal:jt,match:rr,number:Gt,"number-format":Sr,object:Gt,slice:nr,step:sr,string:Gt,"to-boolean":qt,"to-color":qt,"to-number":qt,"to-string":qt,var:Yt,within:Zr,distance:Ei,"global-state":Ii};class Fi{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){let r=e[0],i=Fi.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);let n=Array.isArray(i)?i[0]:i.type,a=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,s=a.filter((([t])=>!Array.isArray(t)||t.length===e.length-1)),o=null;for(let[i,a]of s){o=new $t(t.registry,Ui,t.path,null,t.scope);let s=[],l=!1;for(let t=1;t<e.length;t++){let r=e[t],n=Array.isArray(i)?i[t-1]:i.type,a=o.parse(r,1+s.length,n);if(!a){l=!0;break}s.push(a)}if(!l)if(Array.isArray(i)&&i.length!==s.length)o.error(`Expected ${i.length} arguments, but found ${s.length} instead.`);else{for(let e=0;e<s.length;e++){let t=Array.isArray(i)?i[e]:i.type,r=s[e];o.concat(e+1).checkSubtype(t,r.type)}if(0===o.errors.length)return new Fi(r,n,a,s)}}if(1===s.length)t.errors.push(...o.errors);else{let r=(s.length?s:a).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map($e).join(", ")})`:`(${$e(t.type)}...)`;var t})).join(" | "),i=[];for(let r=1;r<e.length;r++){let n=t.parse(e[r],1+i.length);if(!n)return null;i.push($e(n.type))}t.error(`Expected arguments of type ${r}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){Fi.definitions=t;for(let r in t)e[r]=Fi}}function Pi(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);let a=n?n.evaluate(e):1,s=Ot(t,r,i,a);if(s)throw new kt(s);return new St(t/255,r/255,i/255,a,!1)}function Li(e,t){return e in t}function Mi(e,t){let r=t[e];return void 0===r?null:r}function ki(e){return{type:e}}function Ui(e){if(e instanceof Yt)return Ui(e.boundExpression);if(e instanceof Fi&&"error"===e.name||e instanceof Cr||e instanceof Zr||e instanceof Ei||e instanceof Ii)return!1;let t=e instanceof qt||e instanceof Gt,r=!0;return e.eachChild((e=>{r=t?r&&Ui(e):r&&e instanceof jt})),!!r&&Ri(e)&&Ni(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function Ri(e){if(e instanceof Fi&&("get"===e.name&&1===e.args.length||"feature-state"===e.name||"has"===e.name&&1===e.args.length||"properties"===e.name||"geometry-type"===e.name||"id"===e.name||/^filter-/.test(e.name))||e instanceof Zr||e instanceof Ei)return!1;let t=!0;return e.eachChild((e=>{t&&!Ri(e)&&(t=!1)})),t}function Di(e){if(e instanceof Fi&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!Di(e)&&(t=!1)})),t}function Ni(e,t){if(e instanceof Fi&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!Ni(e,t)&&(r=!1)})),r}function Oi(e){return{result:"success",value:e}}function Qi(e){return{result:"error",value:e}}function zi(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function Hi(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function ji(e){return!!e.expression&&e.expression.interpolated}function Vi(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Gi(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&zt(e)===Qe}function Ki(e){return e}function qi(e,t){let r=e.stops&&"object"==typeof e.stops[0][0],i=r||!(r||void 0!==e.property),n=e.type||(ji(t)?"exponential":"interval"),a=function(e){switch(e.type){case"color":return St.parse;case"padding":return Pt.parse;case"numberArray":return Lt.parse;case"colorArray":return Mt.parse;default:return null}}(t);if(a&&((e=Pe({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],a(e[1])]))),e.default=a(e.default?e.default:t.default)),e.colorSpace&&"rgb"!==(s=e.colorSpace)&&"hcl"!==s&&"lab"!==s)throw new Error(`Unknown color space: "${e.colorSpace}"`);var s;let o,l,h=function(e){switch(e){case"exponential":return Xi;case"interval":return $i;case"categorical":return Wi;case"identity":return Yi;default:throw new Error(`Unknown function type "${e}"`)}}(n);if("categorical"===n){o=Object.create(null);for(let t of e.stops)o[t[0]]=t[1];l=typeof e.stops[0][0]}if(r){let r={},i=[];for(let t=0;t<e.stops.length;t++){let n=e.stops[t],a=n[0].zoom;void 0===r[a]&&(r[a]={zoom:a,type:e.type,property:e.property,default:e.default,stops:[]},i.push(a)),r[a].stops.push([n[0].value,n[1]])}let n=[];for(let e of i)n.push([r[e].zoom,qi(r[e],t)]);let a={name:"linear"};return{kind:"composite",interpolationType:a,interpolationFactor:cr.interpolationFactor.bind(void 0,a),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>Xi({stops:n,base:e.base},t,r).evaluate(r,i)}}if(i){let r="exponential"===n?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:cr.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>h(e,t,r,o,l)}}return{kind:"source",evaluate(r,i){let n=i&&i.properties?i.properties[e.property]:void 0;return void 0===n?Zi(e.default,t.default):h(e,t,n,o,l)}}}function Zi(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Wi(e,t,r,i,n){return Zi(typeof r===n?i[r]:void 0,e.default,t.default)}function $i(e,t,r){if("number"!==Vi(r))return Zi(e.default,t.default);let i=e.stops.length;if(1===i||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];let n=ar(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function Xi(e,t,r){let i=void 0!==e.base?e.base:1;if("number"!==Vi(r))return Zi(e.default,t.default);let n=e.stops.length;if(1===n||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];let a=ar(e.stops.map((e=>e[0])),r),s=function(e,t,r,i){let n=i-r,a=e-r;return 0===n?0:1===t?a/n:(Math.pow(t,a)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[a][0],e.stops[a+1][0]),o=e.stops[a][1],l=e.stops[a+1][1],h=pr[t.type]||Ki;return"function"==typeof o.evaluate?{evaluate(...t){let r=o.evaluate.apply(void 0,t),i=l.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return h(r,i,s,e.colorSpace)}}:h(o,l,s,e.colorSpace)}function Yi(e,t,r){switch(t.type){case"color":r=St.parse(r);break;case"formatted":r=Ft.fromString(r.toString());break;case"resolvedImage":r=Dt.fromString(r.toString());break;case"padding":r=Pt.parse(r);break;case"colorArray":r=Mt.parse(r);break;case"numberArray":r=Lt.parse(r);break;default:Vi(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return Zi(r,e.default,t.default)}Fi.register(Ti,{error:[{kind:"error"},[Re],(e,[t])=>{throw new kt(t.evaluate(e))}],typeof:[Re,[ze],(e,[t])=>$e(zt(t.evaluate(e)))],"to-rgba":[We(Ue,4),[Ne],(e,[t])=>{let[r,i,n,a]=t.evaluate(e).rgb;return[255*r,255*i,255*n,a]}],rgb:[Ne,[Ue,Ue,Ue],Pi],rgba:[Ne,[Ue,Ue,Ue,Ue],Pi],has:{type:De,overloads:[[[Re],(e,[t])=>Li(t.evaluate(e),e.properties())],[[Re,Qe],(e,[t,r])=>Li(t.evaluate(e),r.evaluate(e))]]},get:{type:ze,overloads:[[[Re],(e,[t])=>Mi(t.evaluate(e),e.properties())],[[Re,Qe],(e,[t,r])=>Mi(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ze,[Re],(e,[t])=>Mi(t.evaluate(e),e.featureState||{})],properties:[Qe,[],e=>e.properties()],"geometry-type":[Re,[],e=>e.geometryType()],id:[ze,[],e=>e.id()],zoom:[Ue,[],e=>e.globals.zoom],"heatmap-density":[Ue,[],e=>e.globals.heatmapDensity||0],elevation:[Ue,[],e=>e.globals.elevation||0],"line-progress":[Ue,[],e=>e.globals.lineProgress||0],accumulated:[ze,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[Ue,ki(Ue),(e,t)=>{let r=0;for(let i of t)r+=i.evaluate(e);return r}],"*":[Ue,ki(Ue),(e,t)=>{let r=1;for(let i of t)r*=i.evaluate(e);return r}],"-":{type:Ue,overloads:[[[Ue,Ue],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[Ue],(e,[t])=>-t.evaluate(e)]]},"/":[Ue,[Ue,Ue],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[Ue,[Ue,Ue],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[Ue,[],()=>Math.LN2],pi:[Ue,[],()=>Math.PI],e:[Ue,[],()=>Math.E],"^":[Ue,[Ue,Ue],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[Ue,[Ue],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[Ue,[Ue],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[Ue,[Ue],(e,[t])=>Math.log(t.evaluate(e))],log2:[Ue,[Ue],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[Ue,[Ue],(e,[t])=>Math.sin(t.evaluate(e))],cos:[Ue,[Ue],(e,[t])=>Math.cos(t.evaluate(e))],tan:[Ue,[Ue],(e,[t])=>Math.tan(t.evaluate(e))],asin:[Ue,[Ue],(e,[t])=>Math.asin(t.evaluate(e))],acos:[Ue,[Ue],(e,[t])=>Math.acos(t.evaluate(e))],atan:[Ue,[Ue],(e,[t])=>Math.atan(t.evaluate(e))],min:[Ue,ki(Ue),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[Ue,ki(Ue),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[Ue,[Ue],(e,[t])=>Math.abs(t.evaluate(e))],round:[Ue,[Ue],(e,[t])=>{let r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[Ue,[Ue],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[Ue,[Ue],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[De,[Re,ze],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[De,[ze],(e,[t])=>e.id()===t.value],"filter-type-==":[De,[Re],(e,[t])=>e.geometryType()===t.value],"filter-<":[De,[Re,ze],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[De,[ze],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[De,[Re,ze],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[De,[ze],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[De,[Re,ze],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[De,[ze],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[De,[Re,ze],(e,[t,r])=>{let i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[De,[ze],(e,[t])=>{let r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[De,[ze],(e,[t])=>t.value in e.properties()],"filter-has-id":[De,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[De,[We(Re)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[De,[We(ze)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[De,[Re,We(ze)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[De,[Re,We(ze)],(e,[t,r])=>function(e,t,r,i){for(;r<=i;){let n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:De,overloads:[[[De,De],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[ki(De),(e,t)=>{for(let r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:De,overloads:[[[De,De],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[ki(De),(e,t)=>{for(let r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[De,[De],(e,[t])=>!t.evaluate(e)],"is-supported-script":[De,[Re],(e,[t])=>{let r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[Re,[Re],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[Re,[Re],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[Re,ki(ze),(e,t)=>t.map((t=>Ht(t.evaluate(e)))).join("")],"resolved-locale":[Re,[He],(e,[t])=>t.evaluate(e).resolvedLocale()]});class Ji{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new Wt,this._defaultValue=t?function(e){if("color"===e.type&&Gi(e.default))return new St(0,0,0,0);switch(e.type){case"color":return St.parse(e.default)||null;case"padding":return Pt.parse(e.default)||null;case"numberArray":return Lt.parse(e.default)||null;case"colorArray":return Mt.parse(e.default)||null;case"variableAnchorOffsetCollection":return Rt.parse(e.default)||null;case"projectionDefinition":return Nt.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,a){this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=a||null;try{let e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new kt(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,typeof console<"u"&&console.warn(e.message)),this._defaultValue}}}function en(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Ti}function tn(e,t,r){let i=new $t(Ti,Ui,[],t?function(e){let t={color:Ne,string:Re,number:Ue,enum:Re,boolean:De,formatted:je,padding:Ve,numberArray:Ke,colorArray:Ge,projectionDefinition:Oe,resolvedImage:qe,variableAnchorOffsetCollection:Ze};return"array"===e.type?We(t[e.value]||ze,e.length):t[e.type]}(t):void 0),n=i.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return n?Oi(new Ji(n,t,r)):Qi(i.errors)}class rn{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!Di(t.expression),this.globalStateRefs=ln(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}}class nn{constructor(e,t,r,i,n){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!Di(t.expression),this.globalStateRefs=ln(t.expression),this.interpolationType=i,this._globalState=n}evaluateWithoutErrorHandling(e,t,r,i,n,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,a)}evaluate(e,t,r,i,n,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,i,n,a)}interpolationFactor(e,t,r){return this.interpolationType?cr.interpolationFactor(this.interpolationType,e,t,r):0}}function an(e,t,r){let i=tn(e,t,r);if("error"===i.result)return i;let n=i.value.expression,a=Ri(n);if(!a&&!zi(t))return Qi([new Le("","data expressions not supported")]);let s=Ni(n,["zoom"]);if(!s&&!Hi(t))return Qi([new Le("","zoom expressions not supported")]);let o=on(n);return o||s?o instanceof Le?Qi([o]):o instanceof cr&&!ji(t)?Qi([new Le("",'"interpolate" expressions cannot be used with this property')]):Oi(o?new nn(a?"camera":"composite",i.value,o.labels,o instanceof cr?o.interpolation:void 0,r):new rn(a?"constant":"source",i.value,r)):Qi([new Le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class sn{constructor(e,t){this._parameters=e,this._specification=t,Pe(this,qi(this._parameters,this._specification))}static deserialize(e){return new sn(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function on(e){let t=null;if(e instanceof Xt)t=on(e.result);else if(e instanceof fr){for(let r of e.args)if(t=on(r),t)break}else(e instanceof sr||e instanceof cr)&&e.input instanceof Fi&&"zoom"===e.input.name&&(t=e);return t instanceof Le||e.eachChild((e=>{let r=on(e);r instanceof Le?t=r:!t&&r?t=new Le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new Le("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function ln(e,t=new Set){return e instanceof Ii&&t.add(e.key),e.eachChild((e=>{ln(e,t)})),t}function hn(e,t){let{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o}=e??{};return{zoom:r,heatmapDensity:i,elevation:n,lineProgress:a,isSupportedScript:s,accumulated:o,globalState:t}}function An(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(let t of e.slice(1))if(!An(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}let un={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function cn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};An(e)||(e=fn(e));let r=tn(e,un,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,t,i)=>r.value.evaluate(e,t,{},i),needGeometry:pn(e),getGlobalStateRefs:()=>ln(r.value.expression)}}function dn(e,t){return e<t?-1:e>t?1:0}function pn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(pn(e[t]))return!0;return!1}function fn(e){if(!e)return!0;let t=e[0];return e.length<=1?"any"!==t:"=="===t?gn(e[1],e[2],"=="):"!="===t?_n(gn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?gn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(fn))):"all"===t?["all"].concat(e.slice(1).map(fn)):"none"===t?["all"].concat(e.slice(1).map(fn).map(_n)):"in"===t?mn(e[1],e.slice(2)):"!in"===t?_n(mn(e[1],e.slice(2))):"has"===t?yn(e[1]):"!has"!==t||_n(yn(e[1]));var r}function gn(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function mn(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(dn)]]:["filter-in-small",e,["literal",t]]}}function yn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _n(e){return["!",e]}function vn(e){let t=typeof e;if("number"===t||"boolean"===t||"string"===t||null==e)return JSON.stringify(e);if(Array.isArray(e)){let t="[";for(let r of e)t+=`${vn(r)},`;return`${t}]`}let r=Object.keys(e).sort(),i="{";for(let t=0;t<r.length;t++)i+=`${JSON.stringify(r[t])}:${vn(e[r[t]])},`;return`${i}}`}function wn(e){let t="";for(let r of _e)t+=`/${vn(e[r])}`;return t}function bn(e){let t=e.value;return t?[new Fe(e.key,t,"constants have been deprecated as of v8")]:[]}function xn(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function Bn(e){if(Array.isArray(e))return e.map(Bn);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){let t={};for(let r in e)t[r]=Bn(e[r]);return t}return xn(e)}function Cn(e){let t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},a=e.style,s=e.styleSpec,o=e.validateSpec,l=[],h=Vi(r);if("object"!==h)return[new Fe(t,r,`object expected, ${h} found`)];for(let e in r){let h,A=e.split(".")[0],u=yt(i,A)||i["*"];if(yt(n,A))h=n[A];else if(yt(i,A))h=o;else if(n["*"])h=n["*"];else{if(!i["*"]){l.push(new Fe(t,r[e],`unknown property "${e}"`));continue}h=o}l=l.concat(h({key:(t&&`${t}.`)+e,value:r[e],valueSpec:u,style:a,styleSpec:s,object:r,objectKey:e,validateSpec:o},r))}for(let e in i)n[e]||i[e].required&&void 0===i[e].default&&void 0===r[e]&&l.push(new Fe(t,r,`missing required property "${e}"`));return l}function Sn(e){let t=e.value,r=e.valueSpec,i=e.style,n=e.styleSpec,a=e.key,s=e.arrayElementValidator||e.validateSpec;if("array"!==Vi(t))return[new Fe(a,t,`array expected, ${Vi(t)} found`)];if(r.length&&t.length!==r.length)return[new Fe(a,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new Fe(a,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let o={type:r.value,values:r.values};n.$version<7&&(o.function=r.function),"object"===Vi(r.value)&&(o=r.value);let l=[];for(let r=0;r<t.length;r++)l=l.concat(s({array:t,arrayIndex:r,value:t[r],valueSpec:o,validateSpec:e.validateSpec,style:i,styleSpec:n,key:`${a}[${r}]`}));return l}function En(e){let t=e.key,r=e.value,i=e.valueSpec,n=Vi(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new Fe(t,r,`number expected, ${n} found`)]:"minimum"in i&&r<i.minimum?[new Fe(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new Fe(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]}function In(e){let t,r,i,n=e.valueSpec,a=xn(e.value.type),s={},o="categorical"!==a&&void 0===e.value.property,l=!o,h="array"===Vi(e.value.stops)&&"array"===Vi(e.value.stops[0])&&"object"===Vi(e.value.stops[0][0]),A=Cn({key:e.key,value:e.value,valueSpec:e.styleSpec.function,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===a)return[new Fe(e.key,e.value,'identity function may not have a "stops" property')];let t=[],r=e.value;return t=t.concat(Sn({key:e.key,value:r,valueSpec:e.valueSpec,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:u})),"array"===Vi(r)&&0===r.length&&t.push(new Fe(e.key,r,"array must have at least one stop")),t},default:function(e){return e.validateSpec({key:e.key,value:e.value,valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===a&&o&&A.push(new Fe(e.key,e.value,'missing required property "property"')),"identity"===a||e.value.stops||A.push(new Fe(e.key,e.value,'missing required property "stops"')),"exponential"===a&&e.valueSpec.expression&&!ji(e.valueSpec)&&A.push(new Fe(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!zi(e.valueSpec)?A.push(new Fe(e.key,e.value,"property functions not supported")):o&&!Hi(e.valueSpec)&&A.push(new Fe(e.key,e.value,"zoom functions not supported"))),"categorical"!==a&&!h||void 0!==e.value.property||A.push(new Fe(e.key,e.value,'"property" property is required')),A;function u(e){let t=[],a=e.value,o=e.key;if("array"!==Vi(a))return[new Fe(o,a,`array expected, ${Vi(a)} found`)];if(2!==a.length)return[new Fe(o,a,`array length 2 expected, length ${a.length} found`)];if(h){if("object"!==Vi(a[0]))return[new Fe(o,a,`object expected, ${Vi(a[0])} found`)];if(void 0===a[0].zoom)return[new Fe(o,a,"object stop key must have zoom")];if(void 0===a[0].value)return[new Fe(o,a,"object stop key must have value")];if(i&&i>xn(a[0].zoom))return[new Fe(o,a[0].zoom,"stop zoom values must appear in ascending order")];xn(a[0].zoom)!==i&&(i=xn(a[0].zoom),r=void 0,s={}),t=t.concat(Cn({key:`${o}[0]`,value:a[0],valueSpec:{zoom:{}},validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:En,value:c}}))}else t=t.concat(c({key:`${o}[0]`,value:a[0],validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec},a));return en(Bn(a[1]))?t.concat([new Fe(`${o}[1]`,a[1],"expressions are not allowed in function stops.")]):t.concat(e.validateSpec({key:`${o}[1]`,value:a[1],valueSpec:n,validateSpec:e.validateSpec,style:e.style,styleSpec:e.styleSpec}))}function c(e,i){let o=Vi(e.value),l=xn(e.value),h=null!==e.value?e.value:i;if(t){if(o!==t)return[new Fe(e.key,h,`${o} stop domain type must match previous stop domain type ${t}`)]}else t=o;if("number"!==o&&"string"!==o&&"boolean"!==o)return[new Fe(e.key,h,"stop domain value must be a number, string, or boolean")];if("number"!==o&&"categorical"!==a){let t=`number expected, ${o} found`;return zi(n)&&void 0===a&&(t+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Fe(e.key,h,t)]}return"categorical"!==a||"number"!==o||isFinite(l)&&Math.floor(l)===l?"categorical"!==a&&"number"===o&&void 0!==r&&l<r?[new Fe(e.key,h,"stop domain values must appear in ascending order")]:(r=l,"categorical"===a&&l in s?[new Fe(e.key,h,"stop domain values must be unique")]:(s[l]=!0,[])):[new Fe(e.key,h,`integer expected, found ${l}`)]}}function Tn(e){let t=("property"===e.expressionContext?an:tn)(Bn(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new Fe(`${e.key}${t.key}`,e.value,t.message)));let r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new Fe(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!Di(r))return[new Fe(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!Di(r))return[new Fe(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!Ni(r,["zoom","feature-state"]))return[new Fe(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!Ri(r))return[new Fe(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Fn(e){let t=e.key,r=e.value,i=Vi(r);return"string"!==i?[new Fe(t,r,`color expected, ${i} found`)]:St.parse(String(r))?[]:[new Fe(t,r,`color expected, "${r}" found`)]}function Pn(e){let t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(xn(r))&&n.push(new Fe(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(i.values).indexOf(xn(r))&&n.push(new Fe(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function Ln(e){return An(Bn(e.value))?Tn(Pe({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Mn(e)}function Mn(e){let t=e.value,r=e.key;if("array"!==Vi(t))return[new Fe(r,t,`array expected, ${Vi(t)} found`)];let i,n=e.styleSpec,a=[];if(t.length<1)return[new Fe(r,t,"filter array must have at least 1 element")];switch(a=a.concat(Pn({key:`${r}[0]`,value:t[0],valueSpec:n.filter_operator,style:e.style,styleSpec:e.styleSpec})),xn(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===xn(t[1])&&a.push(new Fe(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&a.push(new Fe(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(i=Vi(t[1]),"string"!==i&&a.push(new Fe(`${r}[1]`,t[1],`string expected, ${i} found`)));for(let s=2;s<t.length;s++)i=Vi(t[s]),"$type"===xn(t[1])?a=a.concat(Pn({key:`${r}[${s}]`,value:t[s],valueSpec:n.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==i&&"number"!==i&&"boolean"!==i&&a.push(new Fe(`${r}[${s}]`,t[s],`string, number, or boolean expected, ${i} found`));break;case"any":case"all":case"none":for(let i=1;i<t.length;i++)a=a.concat(Mn({key:`${r}[${i}]`,value:t[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":i=Vi(t[1]),2!==t.length?a.push(new Fe(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==i&&a.push(new Fe(`${r}[1]`,t[1],`string expected, ${i} found`))}return a}function kn(e,t){let r=e.key,i=e.validateSpec,n=e.style,a=e.styleSpec,s=e.value,o=e.objectKey,l=a[`${t}_${e.layerType}`];if(!l)return[];let h=o.match(/^(.*)-transition$/);if("paint"===t&&h&&l[h[1]]&&l[h[1]].transition)return i({key:r,value:s,valueSpec:a.transition,style:n,styleSpec:a});let A,u=e.valueSpec||l[o];if(!u)return[new Fe(r,s,`unknown property "${o}"`)];if("string"===Vi(s)&&zi(u)&&!u.tokens&&(A=/^{([^}]+)}$/.exec(s)))return[new Fe(r,s,`"${o}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(A[1])} }\`.`)];let c=[];return"symbol"===e.layerType&&("text-field"===o&&n&&!n.glyphs&&c.push(new Fe(r,s,'use of "text-field" requires a style "glyphs" property')),"text-font"===o&&Gi(Bn(s))&&"identity"===xn(s.type)&&c.push(new Fe(r,s,'"text-font" does not support identity functions'))),c.concat(i({key:e.key,value:s,valueSpec:u,style:n,styleSpec:a,expressionContext:"property",propertyType:t,propertyKey:o}))}function Un(e){return kn(e,"paint")}function Rn(e){return kn(e,"layout")}function Dn(e){let t=[],r=e.value,i=e.key,n=e.style,a=e.styleSpec;if("object"!==Vi(r))return[new Fe(i,r,`object expected, ${Vi(r)} found`)];r.type||r.ref||t.push(new Fe(i,r,'either "type" or "ref" is required'));let s=xn(r.type),o=xn(r.ref);if(r.id){let a=xn(r.id);for(let s=0;s<e.arrayIndex;s++){let e=n.layers[s];xn(e.id)===a&&t.push(new Fe(i,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new Fe(i,r[e],`"${e}" is prohibited for ref layers`))})),n.layers.forEach((t=>{xn(t.id)===o&&(e=t)})),e?e.ref?t.push(new Fe(i,r.ref,"ref cannot reference another ref layer")):s=xn(e.type):t.push(new Fe(i,r.ref,`ref layer "${o}" not found`))}else if("background"!==s)if(r.source){let e=n.sources&&n.sources[r.source],a=e&&xn(e.type);e?"vector"===a&&"raster"===s?t.push(new Fe(i,r.source,`layer "${r.id}" requires a raster source`)):"raster-dem"!==a&&"hillshade"===s||"raster-dem"!==a&&"color-relief"===s?t.push(new Fe(i,r.source,`layer "${r.id}" requires a raster-dem source`)):"raster"===a&&"raster"!==s?t.push(new Fe(i,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==a||r["source-layer"]?"raster-dem"===a&&"hillshade"!==s&&"color-relief"!==s?t.push(new Fe(i,r.source,"raster-dem source can only be used with layer type 'hillshade' or 'color-relief'.")):"line"!==s||!r.paint||!r.paint["line-gradient"]||"geojson"===a&&e.lineMetrics||t.push(new Fe(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new Fe(i,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new Fe(i,r.source,`source "${r.source}" not found`))}else t.push(new Fe(i,r,'missing required property "source"'));return t=t.concat(Cn({key:i,value:r,valueSpec:a.layer,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":()=>[],type:()=>e.validateSpec({key:`${i}.type`,value:r.type,valueSpec:a.layer.type,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,object:r,objectKey:"type"}),filter:Ln,layout:e=>Cn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Rn(Pe({layerType:s},e))}}),paint:e=>Cn({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,validateSpec:e.validateSpec,objectElementValidators:{"*":e=>Un(Pe({layerType:s},e))}})}})),t}function Nn(e){let t=e.value,r=e.key,i=Vi(t);return"string"!==i?[new Fe(r,t,`string expected, ${i} found`)]:[]}let On={promoteId:function({key:e,value:t}){if("string"===Vi(t))return Nn({key:e,value:t});{let r=[];for(let i in t)r.push(...Nn({key:`${e}.${i}`,value:t[i]}));return r}}};function Qn(e){let t=e.value,r=e.key,i=e.styleSpec,n=e.style,a=e.validateSpec;if(!t.type)return[new Fe(r,t,'"type" is required')];let s,o=xn(t.type);switch(o){case"vector":case"raster":return s=Cn({key:r,value:t,valueSpec:i[`source_${o.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:On,validateSpec:a}),s;case"raster-dem":return s=function(e){var t;let r=null!==(t=e.sourceName)&&void 0!==t?t:"",i=e.value,n=e.styleSpec,a=n.source_raster_dem,s=e.style,o=[],l=Vi(i);if(void 0===i)return o;if("object"!==l)return o.push(new Fe("source_raster_dem",i,`object expected, ${l} found`)),o;let h="custom"===xn(i.encoding),A=["redFactor","greenFactor","blueFactor","baseShift"],u=e.value.encoding?`"${e.value.encoding}"`:"Default";for(let t in i)!h&&A.includes(t)?o.push(new Fe(t,i[t],`In "${r}": "${t}" is only valid when "encoding" is set to "custom". ${u} encoding found`)):a[t]?o=o.concat(e.validateSpec({key:t,value:i[t],valueSpec:a[t],validateSpec:e.validateSpec,style:s,styleSpec:n})):o.push(new Fe(t,i[t],`unknown property "${t}"`));return o}({sourceName:r,value:t,style:e.style,styleSpec:i,validateSpec:a}),s;case"geojson":if(s=Cn({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,validateSpec:a,objectElementValidators:On}),t.cluster)for(let e in t.clusterProperties){let[i,n]=t.clusterProperties[e],a="string"==typeof i?[i,["accumulated"],["get",e]]:i;s.push(...Tn({key:`${r}.${e}.map`,value:n,expressionContext:"cluster-map"})),s.push(...Tn({key:`${r}.${e}.reduce`,value:a,expressionContext:"cluster-reduce"}))}return s;case"video":return Cn({key:r,value:t,valueSpec:i.source_video,style:n,validateSpec:a,styleSpec:i});case"image":return Cn({key:r,value:t,valueSpec:i.source_image,style:n,validateSpec:a,styleSpec:i});case"canvas":return[new Fe(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Pn({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function zn(e){let t=e.value,r=e.styleSpec,i=r.light,n=e.style,a=[],s=Vi(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Fe("light",t,`object expected, ${s} found`)]),a;for(let s in t){let o=s.match(/^(.*)-transition$/);a=a.concat(o&&i[o[1]]&&i[o[1]].transition?e.validateSpec({key:s,value:t[s],valueSpec:r.transition,validateSpec:e.validateSpec,style:n,styleSpec:r}):i[s]?e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r}):[new Fe(s,t[s],`unknown property "${s}"`)])}return a}function Hn(e){let t=e.value,r=e.styleSpec,i=r.sky,n=e.style,a=Vi(t);if(void 0===t)return[];if("object"!==a)return[new Fe("sky",t,`object expected, ${a} found`)];let s=[];for(let a in t)s=s.concat(i[a]?e.validateSpec({key:a,value:t[a],valueSpec:i[a],style:n,styleSpec:r}):[new Fe(a,t[a],`unknown property "${a}"`)]);return s}function jn(e){let t=e.value,r=e.styleSpec,i=r.terrain,n=e.style,a=[],s=Vi(t);if(void 0===t)return a;if("object"!==s)return a=a.concat([new Fe("terrain",t,`object expected, ${s} found`)]),a;for(let s in t)a=a.concat(i[s]?e.validateSpec({key:s,value:t[s],valueSpec:i[s],validateSpec:e.validateSpec,style:n,styleSpec:r}):[new Fe(s,t[s],`unknown property "${s}"`)]);return a}function Vn(e){let t=[],r=e.value,i=e.key;if(Array.isArray(r)){let n=[],a=[];for(let s in r)r[s].id&&n.includes(r[s].id)&&t.push(new Fe(i,r,`all the sprites' ids must be unique, but ${r[s].id} is duplicated`)),n.push(r[s].id),r[s].url&&a.includes(r[s].url)&&t.push(new Fe(i,r,`all the sprites' URLs must be unique, but ${r[s].url} is duplicated`)),a.push(r[s].url),t=t.concat(Cn({key:`${i}[${s}]`,value:r[s],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:e.validateSpec}));return t}return Nn({key:i,value:r})}function Gn(e){return(t=e.value)&&t.constructor===Object?[]:[new Fe(e.key,e.value,`object expected, ${Vi(e.value)} found`)];var t}let Kn={"*":()=>[],array:Sn,boolean:function(e){let t=e.value,r=e.key,i=Vi(t);return"boolean"!==i?[new Fe(r,t,`boolean expected, ${i} found`)]:[]},number:En,color:Fn,constants:bn,enum:Pn,filter:Ln,function:In,layer:Dn,object:Cn,source:Qn,light:zn,sky:Hn,terrain:jn,projection:function(e){let t=e.value,r=e.styleSpec,i=r.projection,n=e.style,a=Vi(t);if(void 0===t)return[];if("object"!==a)return[new Fe("projection",t,`object expected, ${a} found`)];let s=[];for(let a in t)s=s.concat(i[a]?e.validateSpec({key:a,value:t[a],valueSpec:i[a],style:n,styleSpec:r}):[new Fe(a,t[a],`unknown property "${a}"`)]);return s},projectionDefinition:function(e){let t=e.key,r=e.value;r=r instanceof String?r.valueOf():r;let i=Vi(r);return"array"!==i||(n=r,Array.isArray(n)&&3===n.length&&"string"==typeof n[0]&&"string"==typeof n[1]&&"number"==typeof n[2])||function(e){return!!["interpolate","step","literal"].includes(e[0])}(r)?["array","string"].includes(i)?[]:[new Fe(t,r,`projection expected, invalid type "${i}" found`)]:[new Fe(t,r,`projection expected, invalid array ${JSON.stringify(r)} found`)];var n},string:Nn,formatted:function(e){return 0===Nn(e).length?[]:Tn(e)},resolvedImage:function(e){return 0===Nn(e).length?[]:Tn(e)},padding:function(e){let t=e.key,r=e.value;if("array"===Vi(r)){if(r.length<1||r.length>4)return[new Fe(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];let i={type:"number"},n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return En({key:t,value:r,valueSpec:{}})},numberArray:function(e){let t=e.key,r=e.value;if("array"===Vi(r)){let i={type:"number"};if(r.length<1)return[new Fe(t,r,"array length at least 1 expected, length 0 found")];let n=[];for(let a=0;a<r.length;a++)n=n.concat(e.validateSpec({key:`${t}[${a}]`,value:r[a],validateSpec:e.validateSpec,valueSpec:i}));return n}return En({key:t,value:r,valueSpec:{}})},colorArray:function(e){let t=e.key,r=e.value;if("array"===Vi(r)){if(r.length<1)return[new Fe(t,r,"array length at least 1 expected, length 0 found")];let e=[];for(let i=0;i<r.length;i++)e=e.concat(Fn({key:`${t}[${i}]`,value:r[i]}));return e}return Fn({key:t,value:r})},variableAnchorOffsetCollection:function(e){let t=e.key,r=e.value,i=Vi(r),n=e.styleSpec;if("array"!==i||r.length<1||r.length%2!=0)return[new Fe(t,r,"variableAnchorOffsetCollection requires a non-empty array of even length")];let a=[];for(let i=0;i<r.length;i+=2)a=a.concat(Pn({key:`${t}[${i}]`,value:r[i],valueSpec:n.layout_symbol["text-anchor"]})),a=a.concat(Sn({key:`${t}[${i+1}]`,value:r[i+1],valueSpec:{length:2,value:"number"},validateSpec:e.validateSpec,style:e.style,styleSpec:n}));return a},sprite:Vn,state:Gn};function qn(e){let t=e.value,r=e.valueSpec,i=e.styleSpec;return e.validateSpec=qn,r.expression&&Gi(xn(t))?In(e):r.expression&&en(Bn(t))?Tn(e):r.type&&Kn[r.type]?Kn[r.type](e):Cn(Pe({},e,{valueSpec:r.type?i[r.type]:r}))}function Zn(e){let t=e.value,r=e.key,i=Nn(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new Fe(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new Fe(r,t,'"glyphs" url must include a "{range}" token'))),i}function Wn(e,t=ye){let r=[];return r=r.concat(qn({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,validateSpec:qn,objectElementValidators:{glyphs:Zn,"*":()=>[]}})),e.constants&&(r=r.concat(bn({key:"constants",value:e.constants}))),Xn(r)}function $n(e){return function(t){return e(Object.assign({},t,{validateSpec:qn}))}}function Xn(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function Yn(e){return function(...t){return Xn(e.apply(this,t))}}Wn.source=Yn($n(Qn)),Wn.sprite=Yn($n(Vn)),Wn.glyphs=Yn($n(Zn)),Wn.light=Yn($n(zn)),Wn.sky=Yn($n(Hn)),Wn.terrain=Yn($n(jn)),Wn.state=Yn($n(Gn)),Wn.layer=Yn($n(Dn)),Wn.filter=Yn($n(Ln)),Wn.paintProperty=Yn($n(Un)),Wn.layoutProperty=Yn($n(Rn));let Jn=Wn,ea=Jn.light,ta=Jn.sky,ra=Jn.paintProperty,ia=Jn.layoutProperty;function na(e,t){let r=!1;if(t&&t.length)for(let i of t)e.fire(new ge(new Error(i.message))),r=!0;return r}class aa{constructor(e,t,r){let i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;let n=new Int32Array(this.arrayBuffer);e=n[0],this.d=(t=n[1])+2*(r=n[2]);for(let e=0;e<this.d*this.d;e++){let t=n[3+e],r=n[3+e+1];i.push(t===r?null:n.subarray(t,r))}let a=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],a),this.bboxes=n.subarray(a),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;let n=r/t*e;this.min=-n,this.max=e+n}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,i,n,a){this.cells[n].push(a)}query(e,t,r,i,n){let a=this.min,s=this.max;if(e<=a&&t<=a&&s<=r&&s<=i&&!n)return Array.prototype.slice.call(this.keys);{let a=[];return this._forEachCell(e,t,r,i,this._queryCell,a,{},n),a}}_queryCell(e,t,r,i,n,a,s,o){let l=this.cells[n];if(null!==l){let n=this.keys,h=this.bboxes;for(let A=0;A<l.length;A++){let u=l[A];if(void 0===s[u]){let l=4*u;(o?o(h[l+0],h[l+1],h[l+2],h[l+3]):e<=h[l+2]&&t<=h[l+3]&&r>=h[l+0]&&i>=h[l+1])?(s[u]=!0,a.push(n[u])):s[u]=!1}}}}_forEachCell(e,t,r,i,n,a,s,o){let l=this._convertToCellCoord(e),h=this._convertToCellCoord(t),A=this._convertToCellCoord(r),u=this._convertToCellCoord(i);for(let c=l;c<=A;c++)for(let l=h;l<=u;l++){let h=this.d*l+c;if((!o||o(this._convertFromCellCoord(c),this._convertFromCellCoord(l),this._convertFromCellCoord(c+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,h,a,s,o))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;let e=this.cells,t=3+this.cells.length+1+1,r=0;for(let e=0;e<this.cells.length;e++)r+=this.cells[e].length;let i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;t<e.length;t++){let r=e[t];i[3+t]=n,i.set(r,n),n+=r.length}return i[3+e.length]=n,i.set(this.keys,n),n+=this.keys.length,i[3+e.length+1]=n,i.set(this.bboxes,n),n+=this.bboxes.length,i.buffer}static serialize(e,t){let r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(e){return new aa(e.buffer)}}let sa={};function oa(e,t,r={}){if(sa[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),sa[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}oa("Object",Object),oa("Set",Set),oa("TransferableGridIndex",aa),oa("Color",St),oa("Error",Error),oa("AJAXError",he),oa("ResolvedImage",Dt),oa("StylePropertyFunction",sn),oa("StyleExpression",Ji,{omit:["_evaluator"]}),oa("ZoomDependentExpression",nn),oa("ZoomConstantExpression",rn),oa("CompoundExpression",Fi,{omit:["_evaluate"]});for(let e in Ti)Ti[e]._classRegistryKey||oa(`Expression_${e}`,Ti[e]);function la(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function ha(e){return e.$name||e.constructor._classRegistryKey}function Aa(e){return!function(e){if(null===e||"object"!=typeof e)return!1;let t=ha(e);return!(!t||"Object"===t)}(e)&&(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||e instanceof Error||la(e)||Z(e)||ArrayBuffer.isView(e)||e instanceof ImageData)}function ua(e,t){if(Aa(e))return(la(e)||Z(e))&&t&&t.push(e),ArrayBuffer.isView(e)&&t&&t.push(e.buffer),e instanceof ImageData&&t&&t.push(e.data.buffer),e;if(Array.isArray(e)){let r=[];for(let i of e)r.push(ua(i,t));return r}if("object"!=typeof e)throw new Error("can't serialize object of type "+typeof e);let r=ha(e);if(!r)throw new Error(`can't serialize object of unregistered class ${e.constructor.name}`);if(!sa[r])throw new Error(`${r} is not registered.`);let{klass:i}=sa[r],n=i.serialize?i.serialize(e,t):{};if(i.serialize){if(t&&n===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(let i in e){if(!e.hasOwnProperty(i)||sa[r].omit.indexOf(i)>=0)continue;let a=e[i];n[i]=sa[r].shallow.indexOf(i)>=0?a:ua(a,t)}e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==r&&(n.$name=r),n}function ca(e){if(Aa(e))return e;if(Array.isArray(e))return e.map(ca);if("object"!=typeof e)throw new Error("can't deserialize object of type "+typeof e);let t=ha(e)||"Object";if(!sa[t])throw new Error(`can't deserialize unregistered class ${t}`);let{klass:r}=sa[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);let i=Object.create(r.prototype);for(let r of Object.keys(e)){if("$name"===r)continue;let n=e[r];i[r]=sa[t].shallow.indexOf(r)>=0?n:ca(n)}return i}class da{constructor(){this.first=!0}update(e,t){let r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}let pa={"Latin-1 Supplement":e=>e>=128&&e<=255,"Hangul Jamo":e=>e>=4352&&e<=4607,Khmer:e=>e>=6016&&e<=6143,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Kanbun:e=>e>=12688&&e<=12703,"CJK Strokes":e=>e>=12736&&e<=12783,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Hangul Syllables":e=>e>=44032&&e<=55215,"Private Use Area":e=>e>=57344&&e<=63743,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function fa(e){for(let t of e)if(wa(t.charCodeAt(0)))return!0;return!1}function ga(e){for(let t of e)if(!_a(t.charCodeAt(0)))return!1;return!0}function ma(e){let t=e.map((e=>{try{return new RegExp(`\\p{sc=${e}}`,"u").source}catch{return null}})).filter((e=>e));return new RegExp(t.join("|"),"u")}let ya=ma(["Arab","Dupl","Mong","Ougr","Syrc"]);function _a(e){return!ya.test(String.fromCodePoint(e))}let va=ma(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function wa(e){return!(746!==e&&747!==e&&(e<4352||!(pa["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||pa["CJK Compatibility"](e)||pa["CJK Strokes"](e)||!(!pa["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||pa["Enclosed CJK Letters and Months"](e)||pa["Ideographic Description Characters"](e)||pa.Kanbun(e)||pa.Katakana(e)&&12540!==e||!(!pa["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!pa["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||pa["Vertical Forms"](e)||pa["Yijing Hexagram Symbols"](e)||/\p{sc=Cans}/u.test(String.fromCodePoint(e))||/\p{sc=Hang}/u.test(String.fromCodePoint(e))||va.test(String.fromCodePoint(e)))))}function ba(e){return!(wa(e)||(t=e,pa["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||pa["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||pa["Letterlike Symbols"](t)||pa["Number Forms"](t)||pa["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||9003===t||t>=9085&&t<=9114||t>=9150&&t<=9165||9167===t||t>=9169&&t<=9179||t>=9186&&t<=9215)||pa["Control Pictures"](t)&&9251!==t||pa["Optical Character Recognition"](t)||pa["Enclosed Alphanumerics"](t)||pa["Geometric Shapes"](t)||pa["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||pa["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||pa["CJK Symbols and Punctuation"](t)||pa.Katakana(t)||pa["Private Use Area"](t)||pa["CJK Compatibility Forms"](t)||pa["Small Form Variants"](t)||pa["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||t>=9984&&t<=10087||t>=10102&&t<=10131||65532===t||65533===t));var t}let xa=ma(["Adlm","Arab","Armi","Avst","Chrs","Cprt","Egyp","Elym","Gara","Hatr","Hebr","Hung","Khar","Lydi","Mand","Mani","Mend","Merc","Mero","Narb","Nbat","Nkoo","Orkh","Palm","Phli","Phlp","Phnx","Prti","Rohg","Samr","Sarb","Sogo","Syrc","Thaa","Todr","Yezi"]);function Ba(e){return xa.test(String.fromCodePoint(e))}function Ca(e,t){return!(!t&&Ba(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||pa.Khmer(e))}function Sa(e){for(let t of e)if(Ba(t.charCodeAt(0)))return!0;return!1}let Ea=new class{constructor(){this.TIMEOUT=5e3,this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null,this.loadScriptResolve=()=>{}}setState(e){this.pluginStatus=e.pluginStatus,this.pluginURL=e.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(e){if(Ea.isParsed())throw new Error("RTL text plugin already registered.");this.applyArabicShaping=e.applyArabicShaping,this.processBidirectionalText=e.processBidirectionalText,this.processStyledBidirectionalText=e.processStyledBidirectionalText,this.loadScriptResolve()}isParsed(){return null!=this.applyArabicShaping&&null!=this.processBidirectionalText&&null!=this.processStyledBidirectionalText}getRTLTextPluginStatus(){return this.pluginStatus}syncState(e,r){return t(this,void 0,void 0,(function*(){if(this.isParsed())return this.getState();if("loading"!==e.pluginStatus)return this.setState(e),e;let t=e.pluginURL,i=new Promise((e=>{this.loadScriptResolve=e}));r(t);let n=new Promise((e=>setTimeout((()=>e()),this.TIMEOUT)));if(yield Promise.race([i,n]),this.isParsed()){let e={pluginStatus:"loaded",pluginURL:t};return this.setState(e),e}throw this.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${t}`)}))}};class Ia{constructor(e,t){this.isSupportedScript=Ta,this.zoom=e,t?(this.now=t.now||0,this.fadeDuration=t.fadeDuration||0,this.zoomHistory=t.zoomHistory||new da,this.transition=t.transition||{}):(this.now=0,this.fadeDuration=0,this.zoomHistory=new da,this.transition={})}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){let e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}function Ta(e){return function(e,t){for(let r of e)if(!Ca(r.charCodeAt(0),t))return!1;return!0}(e,"loaded"===Ea.getRTLTextPluginStatus())}class Fa{constructor(e,t,r){this.property=e,this.value=t,this.expression=function(e,t,r){if(Gi(e))return new sn(e,t);if(en(e)){let i=an(e,t,r);if("error"===i.result)throw new Error(i.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return i.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=St.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"numberArray"!==t.type||"number"!=typeof e&&!Array.isArray(e)?"colorArray"!==t.type||"string"!=typeof e&&!Array.isArray(e)?"variableAnchorOffsetCollection"===t.type&&Array.isArray(e)?r=Rt.parse(e):"projectionDefinition"===t.type&&"string"==typeof e&&(r=Nt.parse(e)):r=Mt.parse(e):r=Lt.parse(e):r=Pt.parse(e),{globalStateRefs:new Set,_globalState:null,kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification,r)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}getGlobalStateRefs(){return this.expression.globalStateRefs||new Set}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class Pa{constructor(e,t){this.property=e,this.value=new Fa(e,void 0,t)}transitioned(e,t){return new Ma(this.property,this.value,t,N({},e.transition,this.transition),e.now)}untransitioned(){return new Ma(this.property,this.value,null,{},0)}}class La{constructor(e,t){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues),this._globalState=t}getValue(e){return H(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Pa(this._values[e].property,this._globalState)),this._values[e].value=new Fa(this._values[e].property,null===t?void 0:H(t),this._globalState)}getTransition(e){return H(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new Pa(this._values[e].property,this._globalState)),this._values[e].transition=H(t)||void 0}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r);let i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){let r=new ka(this._properties);for(let i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){let e=new ka(this._properties);for(let t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class Ma{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){let i=e.now||0,n=this.value.possiblyEvaluate(e,t,r),a=this.prior;if(a){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return a.possiblyEvaluate(e,t,r);{let s=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(a.possiblyEvaluate(e,t,r),n,M(s))}}return n}}class ka{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){let i=new Da(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(let e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class Ua{constructor(e,t){this._properties=e,this._values=Object.create(e.defaultPropertyValues),this._globalState=t}hasValue(e){return void 0!==this._values[e].value}getValue(e){return H(this._values[e].value)}setValue(e,t){this._values[e]=new Fa(this._values[e].property,null===t?void 0:H(t),this._globalState)}serialize(){let e={};for(let t of Object.keys(this._values)){let r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){let i=new Da(this._properties);for(let n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}}class Ra{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}}class Da{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class Na{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){let i=pr[this.specification.type];return i?i(e,t,r):e}}class Oa{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return new Ra(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new Ra(this,{kind:"constant",value:void 0},e.parameters);let i=pr[this.specification.type];if(i){let n=i(e.value.value,t.value.value,r);return new Ra(this,{kind:"constant",value:n},e.parameters)}return e}evaluate(e,t,r,i,n,a){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,a)}}class Qa extends Oa{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new Ra(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i),a="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n,s=this._calculate(a,a,a,t);return new Ra(this,{kind:"constant",value:s},t)}if("camera"===e.expression.kind){let r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new Ra(this,{kind:"constant",value:r},t)}return new Ra(this,e.expression,t)}evaluate(e,t,r,i,n,a){if("source"===e.kind){let s=e.evaluate(t,r,i,n,a);return this._calculate(s,s,s,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class za{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){let n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Ia(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Ia(Math.floor(t.zoom),t)),e.expression.evaluate(new Ia(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class Ha{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}}class ja{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(let t in e){let r=e[t];r.specification.overridable&&this.overridableProperties.push(t);let i=this.defaultPropertyValues[t]=new Fa(r,void 0,void 0),n=this.defaultTransitionablePropertyValues[t]=new Pa(r,void 0);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}}oa("DataDrivenProperty",Oa),oa("DataConstantProperty",Na),oa("CrossFadedDataDrivenProperty",Qa),oa("CrossFadedProperty",za),oa("ColorRampProperty",Ha);let Va="-transition";class Ga extends me{constructor(e,t,r){if(super(),this.id=e.id,this.type=e.type,this._globalState=r,this._featureFilter={filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter,this._featureFilter=cn(e.filter,r)),t.layout&&(this._unevaluatedLayout=new Ua(t.layout,r)),t.paint)){this._transitionablePaint=new La(t.paint,r);for(let t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(let t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Da(t.paint)}}setFilter(e){this.filter=e,this._featureFilter=cn(e,this._globalState)}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}getLayoutAffectingGlobalStateRefs(){let e=new Set;if(this._unevaluatedLayout)for(let t in this._unevaluatedLayout._values){let r=this._unevaluatedLayout._values[t];for(let t of r.getGlobalStateRefs())e.add(t)}for(let t of this._featureFilter.getGlobalStateRefs())e.add(t);return e}getPaintAffectingGlobalStateRefs(){var e;let t=new globalThis.Map;if(this._transitionablePaint)for(let r in this._transitionablePaint._values){let i=this._transitionablePaint._values[r].value;for(let n of i.getGlobalStateRefs()){let a=null!==(e=t.get(n))&&void 0!==e?e:[];a.push({name:r,value:i.value}),t.set(n,a)}}return t}setLayoutProperty(e,t,r={}){null!=t&&this._validate(ia,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(Va)?this._transitionablePaint.getTransition(e.slice(0,-11)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t&&this._validate(ra,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(Va))return this._transitionablePaint.setTransition(e.slice(0,-11),t||void 0),!1;{let r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),a=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);let s=this._transitionablePaint._values[e].value;return s.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,a,s)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){let e={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),z(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,i,n={}){return(!n||!1!==n.validate)&&na(this,e.call(Jn,{key:t,layerType:this.type,objectKey:r,value:i,styleSpec:ye,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(let e in this.paint._values){let t=this.paint.get(e);if(t instanceof Ra&&zi(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}let Ka={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class qa{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class Za{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){let t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);let t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function Wa(e,t=1){let r=0,i=0;return{members:e.map((e=>{let n=Ka[e.type].BYTES_PER_ELEMENT,a=r=$a(r,Math.max(t,n)),s=e.components||1;return i=Math.max(i,n),r+=n*s,{name:e.name,type:e.type,components:s,offset:a}})),size:$a(r,Math.max(i,t)),alignment:t}}function $a(e,t){return Math.ceil(e/t)*t}class Xa extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}}Xa.prototype.bytesPerElement=4,oa("StructArrayLayout2i4",Xa);class Ya extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}}Ya.prototype.bytesPerElement=6,oa("StructArrayLayout3i6",Ya);class Ja extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.int16[a+0]=t,this.int16[a+1]=r,this.int16[a+2]=i,this.int16[a+3]=n,e}}Ja.prototype.bytesPerElement=8,oa("StructArrayLayout4i8",Ja);class es extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}}es.prototype.bytesPerElement=12,oa("StructArrayLayout2i4i12",es);class ts extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=4*e,l=8*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=a,this.uint8[l+7]=s,e}}ts.prototype.bytesPerElement=8,oa("StructArrayLayout2i4ub8",ts);class rs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}}rs.prototype.bytesPerElement=8,oa("StructArrayLayout2f8",rs);class is extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,h){let A=this.length;return this.resize(A+1),this.emplace(A,e,t,r,i,n,a,s,o,l,h)}emplace(e,t,r,i,n,a,s,o,l,h,A){let u=10*e;return this.uint16[u+0]=t,this.uint16[u+1]=r,this.uint16[u+2]=i,this.uint16[u+3]=n,this.uint16[u+4]=a,this.uint16[u+5]=s,this.uint16[u+6]=o,this.uint16[u+7]=l,this.uint16[u+8]=h,this.uint16[u+9]=A,e}}is.prototype.bytesPerElement=20,oa("StructArrayLayout10ui20",is);class ns extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o){let l=this.length;return this.resize(l+1),this.emplace(l,e,t,r,i,n,a,s,o)}emplace(e,t,r,i,n,a,s,o,l){let h=8*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=a,this.uint16[h+5]=s,this.uint16[h+6]=o,this.uint16[h+7]=l,e}}ns.prototype.bytesPerElement=16,oa("StructArrayLayout8ui16",ns);class as extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,h,A,u){let c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,a,s,o,l,h,A,u)}emplace(e,t,r,i,n,a,s,o,l,h,A,u,c){let d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=a,this.uint16[d+5]=s,this.uint16[d+6]=o,this.uint16[d+7]=l,this.int16[d+8]=h,this.int16[d+9]=A,this.int16[d+10]=u,this.int16[d+11]=c,e}}as.prototype.bytesPerElement=24,oa("StructArrayLayout4i4ui4i24",as);class ss extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}ss.prototype.bytesPerElement=12,oa("StructArrayLayout3f12",ss);class os extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}os.prototype.bytesPerElement=4,oa("StructArrayLayout1ul4",os);class ls extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l){let h=this.length;return this.resize(h+1),this.emplace(h,e,t,r,i,n,a,s,o,l)}emplace(e,t,r,i,n,a,s,o,l,h){let A=10*e,u=5*e;return this.int16[A+0]=t,this.int16[A+1]=r,this.int16[A+2]=i,this.int16[A+3]=n,this.int16[A+4]=a,this.int16[A+5]=s,this.uint32[u+3]=o,this.uint16[A+8]=l,this.uint16[A+9]=h,e}}ls.prototype.bytesPerElement=20,oa("StructArrayLayout6i1ul2ui20",ls);class hs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=6*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,this.int16[o+4]=a,this.int16[o+5]=s,e}}hs.prototype.bytesPerElement=12,oa("StructArrayLayout2i2i2i12",hs);class As extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){let a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n)}emplace(e,t,r,i,n,a){let s=4*e,o=8*e;return this.float32[s+0]=t,this.float32[s+1]=r,this.float32[s+2]=i,this.int16[o+6]=n,this.int16[o+7]=a,e}}As.prototype.bytesPerElement=16,oa("StructArrayLayout2f1f2i16",As);class us extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a){let s=this.length;return this.resize(s+1),this.emplace(s,e,t,r,i,n,a)}emplace(e,t,r,i,n,a,s){let o=16*e,l=4*e,h=8*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[l+1]=i,this.float32[l+2]=n,this.int16[h+6]=a,this.int16[h+7]=s,e}}us.prototype.bytesPerElement=16,oa("StructArrayLayout2ub2f2i16",us);class cs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}}cs.prototype.bytesPerElement=6,oa("StructArrayLayout3ui6",cs);class ds extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g){let m=this.length;return this.resize(m+1),this.emplace(m,e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g)}emplace(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m){let y=24*e,_=12*e,v=48*e;return this.int16[y+0]=t,this.int16[y+1]=r,this.uint16[y+2]=i,this.uint16[y+3]=n,this.uint32[_+2]=a,this.uint32[_+3]=s,this.uint32[_+4]=o,this.uint16[y+10]=l,this.uint16[y+11]=h,this.uint16[y+12]=A,this.float32[_+7]=u,this.float32[_+8]=c,this.uint8[v+36]=d,this.uint8[v+37]=p,this.uint8[v+38]=f,this.uint32[_+10]=g,this.int16[y+22]=m,e}}ds.prototype.bytesPerElement=48,oa("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",ds);class ps extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E){let I=this.length;return this.resize(I+1),this.emplace(I,e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E)}emplace(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E,I){let T=32*e,F=16*e;return this.int16[T+0]=t,this.int16[T+1]=r,this.int16[T+2]=i,this.int16[T+3]=n,this.int16[T+4]=a,this.int16[T+5]=s,this.int16[T+6]=o,this.int16[T+7]=l,this.uint16[T+8]=h,this.uint16[T+9]=A,this.uint16[T+10]=u,this.uint16[T+11]=c,this.uint16[T+12]=d,this.uint16[T+13]=p,this.uint16[T+14]=f,this.uint16[T+15]=g,this.uint16[T+16]=m,this.uint16[T+17]=y,this.uint16[T+18]=_,this.uint16[T+19]=v,this.uint16[T+20]=w,this.uint16[T+21]=b,this.uint16[T+22]=x,this.uint32[F+12]=B,this.float32[F+13]=C,this.float32[F+14]=S,this.uint16[T+30]=E,this.uint16[T+31]=I,e}}ps.prototype.bytesPerElement=64,oa("StructArrayLayout8i15ui1ul2f2ui64",ps);class fs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}fs.prototype.bytesPerElement=4,oa("StructArrayLayout1f4",fs);class gs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=3*e;return this.uint16[6*e+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}gs.prototype.bytesPerElement=12,oa("StructArrayLayout1ui2f12",gs);class ms extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){let i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){let n=4*e;return this.uint32[2*e+0]=t,this.uint16[n+2]=r,this.uint16[n+3]=i,e}}ms.prototype.bytesPerElement=8,oa("StructArrayLayout1ul2ui8",ms);class ys extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){let r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){let i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}}ys.prototype.bytesPerElement=4,oa("StructArrayLayout2ui4",ys);class _s extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){let t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}_s.prototype.bytesPerElement=2,oa("StructArrayLayout1ui2",_s);class vs extends Za{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){let n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){let a=4*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.float32[a+3]=n,e}}vs.prototype.bytesPerElement=16,oa("StructArrayLayout4f16",vs);class ws extends qa{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new r(this.anchorPointX,this.anchorPointY)}}ws.prototype.size=20;class bs extends ls{get(e){return new ws(this,e)}}oa("CollisionBoxArray",bs);class xs extends qa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}xs.prototype.size=48;class Bs extends ds{get(e){return new xs(this,e)}}oa("PlacedSymbolArray",Bs);class Cs extends qa{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+14]}get textAnchorOffsetStartIndex(){return this._structArray.uint16[this._pos2+30]}get textAnchorOffsetEndIndex(){return this._structArray.uint16[this._pos2+31]}}Cs.prototype.size=64;class Ss extends ps{get(e){return new Cs(this,e)}}oa("SymbolInstanceArray",Ss);class Es extends fs{getoffsetX(e){return this.float32[1*e+0]}}oa("GlyphOffsetArray",Es);class Is extends Ya{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}oa("SymbolLineVertexArray",Is);class Ts extends qa{get textAnchor(){return this._structArray.uint16[this._pos2+0]}get textOffset0(){return this._structArray.float32[this._pos4+1]}get textOffset1(){return this._structArray.float32[this._pos4+2]}}Ts.prototype.size=12;class Fs extends gs{get(e){return new Ts(this,e)}}oa("TextAnchorOffsetArray",Fs);class Ps extends qa{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Ps.prototype.size=8;class Ls extends ms{get(e){return new Ps(this,e)}}oa("FeatureIndexArray",Ls);class Ms extends Xa{}class ks extends Xa{}class Us extends Xa{}class Rs extends es{}class Ds extends ts{}class Ns extends rs{}class Os extends is{}class Qs extends ns{}class zs extends as{}class Hs extends ss{}class js extends os{}class Vs extends hs{}class Gs extends us{}class Ks extends cs{}class qs extends ys{}let Zs=Wa([{name:"a_pos",components:2,type:"Int16"}],4),{members:Ws}=Zs;class $s{constructor(e=[]){this._forceNewSegmentOnNextPrepare=!1,this.segments=e}prepareSegment(e,t,r,i){let n=this.segments[this.segments.length-1];return e>$s.MAX_VERTEX_ARRAY_LENGTH&&V(`Max vertices per segment is ${$s.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}. Consider using the \`fillLargeMeshArrays\` function if you require meshes with more than ${$s.MAX_VERTEX_ARRAY_LENGTH} vertices.`),this._forceNewSegmentOnNextPrepare||!n||n.vertexLength+e>$s.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i?this.createNewSegment(t,r,i):n}createNewSegment(e,t,r){let i={vertexOffset:e.length,primitiveOffset:t.length,vertexLength:0,primitiveLength:0,vaos:{}};return void 0!==r&&(i.sortKey=r),this._forceNewSegmentOnNextPrepare=!1,this.segments.push(i),i}getOrCreateLatestSegment(e,t,r){return this.prepareSegment(0,e,t,r)}forceNewSegmentOnNextPrepare(){this._forceNewSegmentOnNextPrepare=!0}get(){return this.segments}destroy(){for(let e of this.segments)for(let t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,i){return new $s([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}}function Xs(e,t){return 256*(e=R(Math.floor(e),0,255))+R(Math.floor(t),0,255)}$s.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,oa("SegmentVector",$s);let Ys=Wa([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),Js=Wa([{name:"a_dasharray_from",components:4,type:"Uint16"},{name:"a_dasharray_to",components:4,type:"Uint16"}]);var eo,to,ro,io={exports:{}},no={exports:{}},ao={exports:{}},so=function(){if(ro)return io.exports;ro=1;var e=(eo||(eo=1,no.exports=function(e,t){var r,i,n,a,s,o,l,h;for(i=e.length-(r=3&e.length),n=t,s=3432918353,o=461845907,h=0;h<i;)l=255&e.charCodeAt(h)|(255&e.charCodeAt(++h))<<8|(255&e.charCodeAt(++h))<<16|(255&e.charCodeAt(++h))<<24,++h,n=27492+(65535&(a=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(h+2))<<16;case 2:l^=(255&e.charCodeAt(h+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(h)))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<15|l>>>17))*o+(((l>>>16)*o&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0}),no.exports),t=(to||(to=1,ao.exports=function(e,t){for(var r,i=e.length,n=t^i,a=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(a)|(255&e.charCodeAt(++a))<<8|(255&e.charCodeAt(++a))<<16|(255&e.charCodeAt(++a))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++a;switch(i){case 3:n^=(255&e.charCodeAt(a+2))<<16;case 2:n^=(255&e.charCodeAt(a+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(a)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}),ao.exports);return io.exports=e,io.exports.murmur3=e,io.exports.murmur2=t,io.exports}(),oo=i(so);class lo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(ho(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");let t=ho(e),r=0,i=this.ids.length-1;for(;r<i;){let e=r+i>>1;this.ids[e]>=t?i=e:r=e+1}let n=[];for(;this.ids[r]===t;)n.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return n}static serialize(e,t){let r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return Ao(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}static deserialize(e){let t=new lo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function ho(e){let t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:oo(String(e))}function Ao(e,t,r,i){for(;r<i;){let n=e[r+i>>1],a=r-1,s=i+1;for(;;){do{a++}while(e[a]<n);do{s--}while(e[s]>n);if(a>=s)break;uo(e,a,s),uo(t,3*a,3*s),uo(t,3*a+1,3*s+1),uo(t,3*a+2,3*s+2)}s-r<i-s?(Ao(e,t,r,s),r=s+1):(Ao(e,t,s+1,i),i=s)}}function uo(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}oa("FeaturePositionMap",lo);class co{constructor(e,t){this.gl=e.gl,this.location=t}}class po extends co{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class fo extends co{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class go extends co{constructor(e,t){super(e,t),this.current=St.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}let mo=new Float32Array(16);function yo(e){return[Xs(255*e.r,255*e.g),Xs(255*e.b,255*e.a)]}class _o{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new go(e,t):new po(e,t)}}class vo{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setConstantDashPositions(e,t){this.dashTo=[0,e.y,e.height,e.width],this.dashFrom=[0,t.y,t.height,t.width]}setUniform(e,t,r,i){let n=null;"u_pattern_to"===i?n=this.patternTo:"u_pattern_from"===i?n=this.patternFrom:"u_dasharray_to"===i?n=this.dashTo:"u_dasharray_from"===i?n=this.dashFrom:"u_pixel_ratio_to"===i?n=this.pixelRatioTo:"u_pixel_ratio_from"===i&&(n=this.pixelRatioFrom),null!==n&&e.set(n)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)||"u_dasharray_"===r.substr(0,12)?new fo(e,t):new po(e,t)}}class wo{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r){let i=this.paintVertexArray.length,n=this.expression.evaluate(new Ia(0,r),t,{},r.canonical,[],r.formattedSection);this.paintVertexArray.resize(e),this._setPaintValue(i,e,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Ia(0,n),r,i);this._setPaintValue(e,t,a)}_setPaintValue(e,t,r){if("color"===this.type){let i=yo(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class bo{constructor(e,t,r,i,n,a){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new a}populatePaintArray(e,t,r){let i=this.expression.evaluate(new Ia(this.zoom,r),t,{},r.canonical,[],r.formattedSection),n=this.expression.evaluate(new Ia(this.zoom+1,r),t,{},r.canonical,[],r.formattedSection),a=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(a,e,i,n)}updatePaintArray(e,t,r,i,n){let a=this.expression.evaluate(new Ia(this.zoom,n),r,i),s=this.expression.evaluate(new Ia(this.zoom+1,n),r,i);this._setPaintValue(e,t,a,s)}_setPaintValue(e,t,r,i){if("color"===this.type){let n=yo(r),a=yo(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],a[0],a[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){let r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=R(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new po(e,t)}}class xo{constructor(e,t,r,i,n,a){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=a,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){let i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,this.getPositionIds(t),r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,this.getPositionIds(r),n)}_setPaintValues(e,t,r,i){let n=this.getPositions(i);if(!n||!r)return;let a=n[r.min],s=n[r.mid],o=n[r.max];if(a&&s&&o)for(let r=e;r<t;r++)this.emplace(this.zoomInPaintVertexArray,r,s,a),this.emplace(this.zoomOutPaintVertexArray,r,s,o)}upload(e){if(this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer){let t=this.getVertexAttributes();this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,t,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,t,this.expression.isStateDependent)}}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Bo extends xo{getPositions(e){return e.imagePositions}getPositionIds(e){return e.patterns&&e.patterns[this.layerId]}getVertexAttributes(){return Ys.members}emplace(e,t,r,i){e.emplace(t,r.tlbr[0],r.tlbr[1],r.tlbr[2],r.tlbr[3],i.tlbr[0],i.tlbr[1],i.tlbr[2],i.tlbr[3],r.pixelRatio,i.pixelRatio)}}class Co extends xo{getPositions(e){return e.dashPositions}getPositionIds(e){return e.dashes&&e.dashes[this.layerId]}getVertexAttributes(){return Js.members}emplace(e,t,r,i){e.emplace(t,0,r.y,r.height,r.width,0,i.y,i.height,i.width)}}class So{constructor(e,t,r){this.binders={},this._buffers=[];let i=[];for(let n in e.paint._values){if(!r(n))continue;let a=e.paint.get(n);if(!(a instanceof Ra&&zi(a.property.specification)))continue;let s=Io(n,e.type),o=a.value,l=a.property.specification.type,h=a.property.useIntegerZoom,A=a.property.specification["property-type"],u="cross-faded"===A||"cross-faded-data-driven"===A;if("constant"===o.kind)this.binders[n]=u?new vo(o.value,s):new _o(o.value,s,l),i.push(`/u_${n}`);else if("source"===o.kind||u){let r=To(n,l,"source");this.binders[n]=u?"line-dasharray"===n?new Co(o,l,h,t,r,e.id):new Bo(o,l,h,t,r,e.id):new wo(o,s,l,r),i.push(`/a_${n}`)}else{let e=To(n,l,"composite");this.binders[n]=new bo(o,s,l,h,t,e),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){let t=this.binders[e];return t instanceof wo||t instanceof bo?t.maxValue:0}populatePaintArrays(e,t,r){for(let i in this.binders){let n=this.binders[i];(n instanceof wo||n instanceof bo||n instanceof xo)&&n.populatePaintArray(e,t,r)}}setConstantPatternPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof vo&&i.setConstantPatternPositions(e,t)}}setConstantDashPositions(e,t){for(let r in this.binders){let i=this.binders[r];i instanceof vo&&i.setConstantDashPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let a=!1;for(let s in e){let o=t.getPositions(s);for(let t of o){let o=r.feature(t.index);for(let r in this.binders){let l=this.binders[r];if((l instanceof wo||l instanceof bo||l instanceof xo)&&!0===l.expression.isStateDependent){let h=i.paint.get(r);l.expression=h.value,l.updatePaintArray(t.start,t.end,o,e[s],n),a=!0}}}}return a}defines(){let e=[];for(let t in this.binders){let r=this.binders[t];(r instanceof _o||r instanceof vo)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof wo||r instanceof bo)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof xo){let t=r.getVertexAttributes();for(let r of t)e.push(r.name)}}return e}getBinderUniforms(){let e=[];for(let t in this.binders){let r=this.binders[t];if(r instanceof _o||r instanceof vo||r instanceof bo)for(let t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){let r=[];for(let i in this.binders){let n=this.binders[i];if(n instanceof _o||n instanceof vo||n instanceof bo)for(let a of n.uniformNames)if(t[a]){let s=n.getBinding(e,t[a],a);r.push({name:a,property:i,binding:s})}}return r}setUniforms(e,t,r,i){for(let{name:e,property:n,binding:a}of t)this.binders[n].setUniform(a,i,r.get(n),e)}updatePaintBuffers(e){this._buffers=[];for(let t in this.binders){let r=this.binders[t];if(e&&r instanceof xo){let t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof wo||r instanceof bo)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(let t in this.binders){let r=this.binders[t];(r instanceof wo||r instanceof bo||r instanceof xo)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(let e in this.binders){let t=this.binders[e];(t instanceof wo||t instanceof bo||t instanceof xo)&&t.destroy()}}}class Eo{constructor(e,t,r=()=>!0){this.programConfigurations={};for(let i of e)this.programConfigurations[i.id]=new So(i,t,r);this.needsUpload=!1,this._featureMap=new lo,this._bufferOffset=0}populatePaintArrays(e,t,r,i){for(let r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(let n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(let t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(let e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Io(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-dasharray":["dasharray_to","dasharray_from"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function To(e,t,r){let i={color:{source:rs,composite:vs},number:{source:fs,composite:rs}},n={"line-pattern":{source:Os,composite:Os},"fill-pattern":{source:Os,composite:Os},"fill-extrusion-pattern":{source:Os,composite:Os},"line-dasharray":{source:Qs,composite:Qs}}[e];return n&&n[r]||i[t][r]}oa("ConstantBinder",_o),oa("CrossFadedConstantBinder",vo),oa("SourceExpressionBinder",wo),oa("CrossFadedPatternBinder",Bo),oa("CrossFadedDasharrayBinder",Co),oa("CompositeExpressionBinder",bo),oa("ProgramConfiguration",So,{omit:["_buffers"]}),oa("ProgramConfigurationSet",Eo);let Fo=Math.pow(2,14)-1,Po=-Fo-1;function Lo(e){let t=T/e.extent,r=e.loadGeometry();for(let e=0;e<r.length;e++){let i=r[e];for(let e=0;e<i.length;e++){let r=i[e],n=Math.round(r.x*t),a=Math.round(r.y*t);r.x=R(n,Po,Fo),r.y=R(a,Po,Fo),(n<r.x||n>r.x+1||a<r.y||a>r.y+1)&&V("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Mo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Lo(e):[]}}let ko,Uo,Ro=-32768;function Do(e,t,r,i,n){e.emplaceBack(Ro+8*t+i,Ro+8*r+n)}class No{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new ks,this.indexArray=new Ks,this.segments=new $s,this.programConfigurations=new Eo(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){let i=this.layers[0],n=[],a=null,s=!1,o="heatmap"===i.type;if("circle"===i.type){let e=i;a=e.layout.get("circle-sort-key"),s=!a.isConstant(),o=o||"map"===e.paint.get("circle-pitch-alignment")}let l=o?t.subdivisionGranularity.circle:1;for(let{feature:t,id:i,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,h=Mo(t,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),h,r))continue;let A=s?a.evaluate(h,{},r):void 0,u={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?h.geometry:Lo(t),patterns:{},sortKey:A};n.push(u)}s&&n.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of n){let{geometry:n,index:a,sourceLayerIndex:s}=i,o=e[a].feature;this.addFeature(i,n,a,r,l),t.featureIndex.insert(o,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Ws),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i,n=1){let a;switch(n){case 1:a=[0,7];break;case 3:a=[0,2,5,7];break;case 5:a=[0,1,3,4,6,7];break;case 7:a=[0,1,2,3,4,5,6,7];break;default:throw new Error(`Invalid circle bucket granularity: ${n}; valid values are 1, 3, 5, 7.`)}let s=a.length;for(let r of t)for(let t of r){let r=t.x,i=t.y;if(r<0||r>=T||i<0||i>=T)continue;let n=this.segments.prepareSegment(s*s,this.layoutVertexArray,this.indexArray,e.sortKey),o=n.vertexLength;for(let e=0;e<s;e++)for(let t=0;t<s;t++)Do(this.layoutVertexArray,r,i,a[t],a[e]);for(let e=0;e<s-1;e++)for(let t=0;t<s-1;t++){let r=o+e*s+t,i=o+(e+1)*s+t;this.indexArray.emplaceBack(r,i+1,r+1),this.indexArray.emplaceBack(r,i,i+1)}n.vertexLength+=s*s,n.primitiveLength+=(s-1)*(s-1)*2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:{},canonical:i})}}function Oo(e,t){for(let r=0;r<e.length;r++)if(Zo(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(Zo(e,t[r]))return!0;return!!jo(e,t)}function Qo(e,t,r){return!!Zo(e,t)||!!Go(t,e,r)}function zo(e,t){if(1===e.length)return qo(t,e[0]);for(let r=0;r<t.length;r++){let i=t[r];for(let t=0;t<i.length;t++)if(Zo(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(qo(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(jo(e,t[r]))return!0;return!1}function Ho(e,t,r){if(e.length>1){if(jo(e,t))return!0;for(let i=0;i<t.length;i++)if(Go(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(Go(e[i],t,r))return!0;return!1}function jo(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++)if(Vo(i,n,t[e],t[e+1]))return!0}return!1}function Vo(e,t,r,i){return G(e,r,i)!==G(t,r,i)&&G(e,t,r)!==G(e,t,i)}function Go(e,t,r){let i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++)if(Ko(e,t[r-1],t[r])<i)return!0;return!1}function Ko(e,t,r){let i=t.distSqr(r);if(0===i)return e.distSqr(t);let n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return e.distSqr(n<0?t:n>1?r:r.sub(t)._mult(n)._add(t))}function qo(e,t){let r,i,n,a=!1;for(let s=0;s<e.length;s++){r=e[s];for(let e=0,s=r.length-1;e<r.length;s=e++)i=r[e],n=r[s],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(a=!a)}return a}function Zo(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){let a=e[i],s=e[n];a.y>t.y!=s.y>t.y&&t.x<(s.x-a.x)*(t.y-a.y)/(s.y-a.y)+a.x&&(r=!r)}return r}function Wo(e,t,r){let i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;let a=G(e,t,r[0]);return a!==G(e,t,r[1])||a!==G(e,t,r[2])||a!==G(e,t,r[3])}function $o(e,t,r){let i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Xo(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function Yo(e,t,i,n,a){if(!t[0]&&!t[1])return e;let s=r.convert(t)._mult(a);"viewport"===i&&s._rotate(-n);let o=[];for(let t=0;t<e.length;t++)o.push(e[t].sub(s));return o}function Jo({queryGeometry:e,size:t},r){return Qo(e,r,t)}function el({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return Qo(e,a,t*(r.projectTileCoordinates(a.x,a.y,i,n).signedDistanceFromCamera/r.cameraToCenterDistance))}function tl({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){let s=r.projectTileCoordinates(a.x,a.y,i,n).signedDistanceFromCamera,o=t*(r.cameraToCenterDistance/s);return Qo(e,nl(a,r,i,n),o)}function rl({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n},a){return Qo(e,nl(a,r,i,n),t)}function il({queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n,pitchAlignment:a="map",pitchScale:s="map"},o){let l="map"===a?"map"===s?Jo:el:"map"===s?tl:rl,h={queryGeometry:e,size:t,transform:r,unwrappedTileID:i,getElevation:n};for(let e of o)for(let t of e)if(l(h,t))return!0;return!1}function nl(e,t,i,n){let a=t.projectTileCoordinates(e.x,e.y,i,n).point;return new r((.5*a.x+.5)*t.width,(.5*-a.y+.5)*t.height)}oa("CircleBucket",No,{omit:["layers"]});var al={get paint(){return Uo=Uo||new ja({"circle-radius":new Oa(ye.paint_circle["circle-radius"]),"circle-color":new Oa(ye.paint_circle["circle-color"]),"circle-blur":new Oa(ye.paint_circle["circle-blur"]),"circle-opacity":new Oa(ye.paint_circle["circle-opacity"]),"circle-translate":new Na(ye.paint_circle["circle-translate"]),"circle-translate-anchor":new Na(ye.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new Na(ye.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new Na(ye.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Oa(ye.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Oa(ye.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Oa(ye.paint_circle["circle-stroke-opacity"])})},get layout(){return ko=ko||new ja({"circle-sort-key":new Oa(ye.layout_circle["circle-sort-key"])})}};class sl extends Ga{constructor(e,t){super(e,al,t)}createBucket(e){return new No(e)}queryRadius(e){let t=e;return $o("circle-radius",this,t)+$o("circle-stroke-width",this,t)+Xo(this.paint.get("circle-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){let l,h,A=Yo(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),-n.bearingInRadians,a),u=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),c=this.paint.get("circle-pitch-scale"),d=this.paint.get("circle-pitch-alignment");return"map"===d?(l=A,h=u*a):(p=n,f=s,g=o,l=A.map((e=>nl(e,p,f,g))),h=u),il({queryGeometry:l,size:h,transform:n,unwrappedTileID:s,getElevation:o,pitchAlignment:d,pitchScale:c},i);var p,f,g}}class ol extends No{}let ll;oa("HeatmapBucket",ol,{omit:["layers"]});var hl={get paint(){return ll=ll||new ja({"heatmap-radius":new Oa(ye.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Oa(ye.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Na(ye.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Ha(ye.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Na(ye.paint_heatmap["heatmap-opacity"])})}};function Al(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`)}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function ul(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;let n=Al({},{width:t,height:r},i);cl(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function cl(e,t,r,i,n,a){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");let s=e.data,o=t.data;if(s===o)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){let h=((r.y+l)*e.width+r.x)*a,A=((i.y+l)*t.width+i.x)*a;for(let e=0;e<n.width*a;e++)o[A+e]=s[h+e]}return t}class dl{constructor(e,t){Al(this,e,1,t)}resize(e){ul(this,e,1)}clone(){return new dl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){cl(e,t,r,i,n,1)}}class pl{constructor(e,t){Al(this,e,4,t)}resize(e){ul(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new pl({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){cl(e,t,r,i,n,4)}setPixel(e,t,r){let i=4*(e*this.width+t);this.data[i+0]=Math.round(255*r.r/r.a),this.data[i+1]=Math.round(255*r.g/r.a),this.data[i+2]=Math.round(255*r.b/r.a),this.data[i+3]=Math.round(255*r.a)}}function fl(e){let t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new pl({width:r,height:i});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);let a=(i,a,s)=>{t[e.evaluationKey]=s;let o=e.expression.evaluate(t);n.setPixel(i/4/r,a/4,o)};if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,s=0;i<r;i++,s+=4){let o=i/(r-1),{start:l,end:h}=e.clips[t];a(n,s,l*(1-o)+h*o)}else for(let e=0,t=0;e<r;e++,t+=4)a(0,t,e/(r-1));return n}oa("AlphaImage",dl),oa("RGBAImage",pl);let gl,ml="big-fb";class yl extends Ga{createBucket(e){return new ol(e)}constructor(e,t){super(e,hl,t),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=fl({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(ml)&&this.heatmapFbos.delete(ml)}queryRadius(e){return $o("heatmap-radius",this,e)}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:r,geometry:i,transform:n,pixelsToTileUnits:a,unwrappedTileID:s,getElevation:o}){return il({queryGeometry:e,size:this.paint.get("heatmap-radius").evaluate(t,r)*a,transform:n,unwrappedTileID:s,getElevation:o},i)}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}}var _l={get paint(){return gl=gl||new ja({"hillshade-illumination-direction":new Na(ye.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-altitude":new Na(ye.paint_hillshade["hillshade-illumination-altitude"]),"hillshade-illumination-anchor":new Na(ye.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new Na(ye.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new Na(ye.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new Na(ye.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new Na(ye.paint_hillshade["hillshade-accent-color"]),"hillshade-method":new Na(ye.paint_hillshade["hillshade-method"])})}};class vl extends Ga{constructor(e,t){super(e,_l,t),this.recalculate({zoom:0,zoomHistory:{}},void 0)}getIlluminationProperties(){let e=this.paint.get("hillshade-illumination-direction").values,t=this.paint.get("hillshade-illumination-altitude").values,r=this.paint.get("hillshade-highlight-color").values,i=this.paint.get("hillshade-shadow-color").values,n=Math.max(e.length,t.length,r.length,i.length);e=e.concat(Array(n-e.length).fill(e.at(-1))),t=t.concat(Array(n-t.length).fill(t.at(-1))),r=r.concat(Array(n-r.length).fill(r.at(-1))),i=i.concat(Array(n-i.length).fill(i.at(-1)));let a=t.map(ee);return{directionRadians:e.map(ee),altitudeRadians:a,shadowColor:i,highlightColor:r}}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}}let wl;var bl={get paint(){return wl=wl||new ja({"color-relief-opacity":new Na(ye["paint_color-relief"]["color-relief-opacity"]),"color-relief-color":new Ha(ye["paint_color-relief"]["color-relief-color"])})}};class xl{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,i)}update(e,t,r){let{width:i,height:n}=e,a=!(this.size&&this.size[0]===i&&this.size[1]===n||r),{context:s}=this,{gl:o}=s;if(this.useMipmap=!(!t||!t.useMipmap),o.bindTexture(o.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===o.RGBA&&(!t||!1!==t.premultiply)),a)this.size=[i,n],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Z(e)?o.texImage2D(o.TEXTURE_2D,0,this.format,this.format,o.UNSIGNED_BYTE,e):o.texImage2D(o.TEXTURE_2D,0,this.format,i,n,0,this.format,o.UNSIGNED_BYTE,e.data);else{let{x:t,y:a}=r||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||Z(e)?o.texSubImage2D(o.TEXTURE_2D,0,t,a,o.RGBA,o.UNSIGNED_BYTE,e):o.texSubImage2D(o.TEXTURE_2D,0,t,a,i,n,o.RGBA,o.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&o.generateMipmap(o.TEXTURE_2D),s.pixelStoreUnpackFlipY.setDefault(),s.pixelStoreUnpack.setDefault(),s.pixelStoreUnpackPremultiplyAlpha.setDefault()}bind(e,t,r){let{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){let{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}class Bl{constructor(e,t,r,i=1,n=1,a=1,s=0){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&!["mapbox","terrarium","custom"].includes(r))return void V(`"${r}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=t.height;let o=this.dim=t.height-2;switch(this.data=new Uint32Array(t.data.buffer),r){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=i,this.greenFactor=n,this.blueFactor=a,this.baseShift=s;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let e=0;e<o;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(o,e)]=this.data[this._idx(o-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,o)]=this.data[this._idx(e,o-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(o,-1)]=this.data[this._idx(o-1,0)],this.data[this._idx(-1,o)]=this.data[this._idx(0,o-1)],this.data[this._idx(o,o)]=this.data[this._idx(o-1,o-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<o;e++)for(let t=0;t<o;t++){let r=this.get(e,t);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){let r=new Uint8Array(this.data.buffer),i=4*this._idx(e,t);return this.unpack(r[i],r[i+1],r[i+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}unpack(e,t,r){return e*this.redFactor+t*this.greenFactor+r*this.blueFactor-this.baseShift}pack(e){return Cl(e,this.getUnpackVector())}getPixels(){return new pl({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,a=r*this.dim,s=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:a=s-1;break;case 1:s=a+1}let o=-t*this.dim,l=-r*this.dim;for(let t=a;t<s;t++)for(let r=i;r<n;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+o,t+l)]}}function Cl(e,t){let r=t[0],i=t[1],n=t[2],a=t[3],s=Math.min(r,i,n),o=Math.round((e+a)/s);return{r:Math.floor(o*s/r)%256,g:Math.floor(o*s/i)%256,b:Math.floor(o*s/n)%256}}oa("DEMData",Bl);class Sl extends Ga{constructor(e,t){super(e,bl,t)}_createColorRamp(e){let t={elevationStops:[],colorStops:[]},r=this._transitionablePaint._values["color-relief-color"].value.expression;if(r instanceof rn&&r._styleExpression.expression instanceof cr){this.colorRampExpression=r;let e=r._styleExpression.expression;t.elevationStops=e.labels,t.colorStops=[];for(let r of t.elevationStops)t.colorStops.push(e.evaluate({globals:{elevation:r}}))}if(t.elevationStops.length<1&&(t.elevationStops=[0],t.colorStops=[St.transparent]),t.elevationStops.length<2&&(t.elevationStops.push(t.elevationStops[0]+1),t.colorStops.push(t.colorStops[0])),t.elevationStops.length<=e)return t;let i={elevationStops:[],colorStops:[]},n=(t.elevationStops.length-1)/(e-1);for(let e=0;e<t.elevationStops.length-.5;e+=n)i.elevationStops.push(t.elevationStops[Math.round(e)]),i.colorStops.push(t.colorStops[Math.round(e)]);return V(`Too many colors in specification of ${this.id} color-relief layer, may not render properly.`),i}_colorRampChanged(){return this.colorRampExpression!=this._transitionablePaint._values["color-relief-color"].value.expression}getColorRampTextures(e,t,r){if(this.colorRampTextures&&!this._colorRampChanged())return this.colorRampTextures;let i=this._createColorRamp(t),n=new pl({width:i.colorStops.length,height:1}),a=new pl({width:i.colorStops.length,height:1});for(let e=0;e<i.elevationStops.length;e++){let t=Cl(i.elevationStops[e],r);a.setPixel(0,e,new St(t.r/255,t.g/255,t.b/255,1)),n.setPixel(0,e,i.colorStops[e])}return this.colorRampTextures={elevationTexture:new xl(e,a,e.gl.RGBA),colorTexture:new xl(e,n,e.gl.RGBA)},this.colorRampTextures}hasOffscreenPass(){return"none"!==this.visibility&&!!this.colorRampTextures}}let El=Wa([{name:"a_pos",components:2,type:"Int16"}],4),{members:Il}=El;function Tl(e,t,r){let i=r.patternDependencies,n=!1;for(let r of t){let t=r.paint.get(`${e}-pattern`);t.isConstant()||(n=!0);let a=t.constantOr(null);a&&(n=!0,i[a.to]=!0,i[a.from]=!0)}return n}function Fl(e,t,r,i,n){let{zoom:a}=i,s=n.patternDependencies;for(let i of t){let t=i.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:a-1},r,{},n.availableImages),o=t.evaluate({zoom:a},r,{},n.availableImages),l=t.evaluate({zoom:a+1},r,{},n.availableImages);e=e&&e.name?e.name:e,o=o&&o.name?o.name:o,l=l&&l.name?l.name:l,s[e]=!0,s[o]=!0,s[l]=!0,r.patterns[i.id]={min:e,mid:o,max:l}}}return r}function Pl(e,t,r,i,n){let a;if(n===function(e,t,r,i){let n=0;for(let a=t,s=r-i;a<r;a+=i)n+=(e[s]-e[a])*(e[a+1]+e[s+1]),s=a;return n}(e,t,r,i)>0)for(let n=t;n<r;n+=i)a=Jl(n/i|0,e[n],e[n+1],a);else for(let n=r-i;n>=t;n-=i)a=Jl(n/i|0,e[n],e[n+1],a);return a&&ql(a,a.next)&&(eh(a),a=a.next),a}function Ll(e,t){if(!e)return e;t||(t=e);let r,i=e;do{if(r=!1,i.steiner||!ql(i,i.next)&&0!==Kl(i.prev,i,i.next))i=i.next;else{if(eh(i),i=t=i.prev,i===i.next)break;r=!0}}while(r||i!==t);return t}function Ml(e,t,r,i,n,a,s){if(!e)return;!s&&a&&function(e,t,r,i){let n=e;do{0===n.z&&(n.z=zl(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){let t,r=1;do{let i,n=e;e=null;let a=null;for(t=0;n;){t++;let s=n,o=0;for(let e=0;e<r&&(o++,s=s.nextZ,s);e++);let l=r;for(;o>0||l>0&&s;)0!==o&&(0===l||!s||n.z<=s.z)?(i=n,n=n.nextZ,o--):(i=s,s=s.nextZ,l--),a?a.nextZ=i:e=i,i.prevZ=a,a=i;n=s}a.nextZ=null,r*=2}while(t>1)}(n)}(e,i,n,a);let o=e;for(;e.prev!==e.next;){let l=e.prev,h=e.next;if(a?Ul(e,i,n,a):kl(e))t.push(l.i,e.i,h.i),eh(e),e=h.next,o=h.next;else if((e=h)===o){s?1===s?Ml(e=Rl(Ll(e),t),t,r,i,n,a,2):2===s&&Dl(e,t,r,i,n,a):Ml(Ll(e),t,r,i,n,a,1);break}}}function kl(e){let t=e.prev,r=e,i=e.next;if(Kl(t,r,i)>=0)return!1;let n=t.x,a=r.x,s=i.x,o=t.y,l=r.y,h=i.y,A=Math.min(n,a,s),u=Math.min(o,l,h),c=Math.max(n,a,s),d=Math.max(o,l,h),p=i.next;for(;p!==t;){if(p.x>=A&&p.x<=c&&p.y>=u&&p.y<=d&&Vl(n,o,a,l,s,h,p.x,p.y)&&Kl(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function Ul(e,t,r,i){let n=e.prev,a=e,s=e.next;if(Kl(n,a,s)>=0)return!1;let o=n.x,l=a.x,h=s.x,A=n.y,u=a.y,c=s.y,d=Math.min(o,l,h),p=Math.min(A,u,c),f=Math.max(o,l,h),g=Math.max(A,u,c),m=zl(d,p,t,r,i),y=zl(f,g,t,r,i),_=e.prevZ,v=e.nextZ;for(;_&&_.z>=m&&v&&v.z<=y;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=g&&_!==n&&_!==s&&Vl(o,A,l,u,h,c,_.x,_.y)&&Kl(_.prev,_,_.next)>=0||(_=_.prevZ,v.x>=d&&v.x<=f&&v.y>=p&&v.y<=g&&v!==n&&v!==s&&Vl(o,A,l,u,h,c,v.x,v.y)&&Kl(v.prev,v,v.next)>=0))return!1;v=v.nextZ}for(;_&&_.z>=m;){if(_.x>=d&&_.x<=f&&_.y>=p&&_.y<=g&&_!==n&&_!==s&&Vl(o,A,l,u,h,c,_.x,_.y)&&Kl(_.prev,_,_.next)>=0)return!1;_=_.prevZ}for(;v&&v.z<=y;){if(v.x>=d&&v.x<=f&&v.y>=p&&v.y<=g&&v!==n&&v!==s&&Vl(o,A,l,u,h,c,v.x,v.y)&&Kl(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Rl(e,t){let r=e;do{let i=r.prev,n=r.next.next;!ql(i,n)&&Zl(i,r,r.next,n)&&Xl(i,n)&&Xl(n,i)&&(t.push(i.i,r.i,n.i),eh(r),eh(r.next),r=e=n),r=r.next}while(r!==e);return Ll(r)}function Dl(e,t,r,i,n,a){let s=e;do{let e=s.next.next;for(;e!==s.prev;){if(s.i!==e.i&&Gl(s,e)){let o=Yl(s,e);return s=Ll(s,s.next),o=Ll(o,o.next),Ml(s,t,r,i,n,a,0),void Ml(o,t,r,i,n,a,0)}e=e.next}s=s.next}while(s!==e)}function Nl(e,t){let r=e.x-t.x;return 0===r&&(r=e.y-t.y,0===r)&&(r=(e.next.y-e.y)/(e.next.x-e.x)-(t.next.y-t.y)/(t.next.x-t.x)),r}function Ol(e,t){let r=function(e,t){let r,i=t,n=e.x,a=e.y,s=-1/0;if(ql(e,i))return i;do{if(ql(e,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){let e=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(e<=n&&e>s&&(s=e,r=i.x<i.next.x?i:i.next,e===n))return r}i=i.next}while(i!==t);if(!r)return null;let o=r,l=r.x,h=r.y,A=1/0;i=r;do{if(n>=i.x&&i.x>=l&&n!==i.x&&jl(a<h?n:s,a,l,h,a<h?s:n,a,i.x,i.y)){let t=Math.abs(a-i.y)/(n-i.x);Xl(i,e)&&(t<A||t===A&&(i.x>r.x||i.x===r.x&&Ql(r,i)))&&(r=i,A=t)}i=i.next}while(i!==o);return r}(e,t);if(!r)return t;let i=Yl(r,e);return Ll(i,i.next),Ll(r,r.next)}function Ql(e,t){return Kl(e.prev,e,t.prev)<0&&Kl(t.next,e,e.next)<0}function zl(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hl(e){let t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function jl(e,t,r,i,n,a,s,o){return(n-s)*(t-o)>=(e-s)*(a-o)&&(e-s)*(i-o)>=(r-s)*(t-o)&&(r-s)*(a-o)>=(n-s)*(i-o)}function Vl(e,t,r,i,n,a,s,o){return!(e===s&&t===o)&&jl(e,t,r,i,n,a,s,o)}function Gl(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){let r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Zl(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(Xl(e,t)&&Xl(t,e)&&function(e,t){let r=e,i=!1,n=(e.x+t.x)/2,a=(e.y+t.y)/2;do{r.y>a!=r.next.y>a&&r.next.y!==r.y&&n<(r.next.x-r.x)*(a-r.y)/(r.next.y-r.y)+r.x&&(i=!i),r=r.next}while(r!==e);return i}(e,t)&&(Kl(e.prev,e,t.prev)||Kl(e,t.prev,t))||ql(e,t)&&Kl(e.prev,e,e.next)>0&&Kl(t.prev,t,t.next)>0)}function Kl(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function ql(e,t){return e.x===t.x&&e.y===t.y}function Zl(e,t,r,i){let n=$l(Kl(e,t,r)),a=$l(Kl(e,t,i)),s=$l(Kl(r,i,e)),o=$l(Kl(r,i,t));return n!==a&&s!==o||!(0!==n||!Wl(e,r,t))||!(0!==a||!Wl(e,i,t))||!(0!==s||!Wl(r,e,i))||!(0!==o||!Wl(r,t,i))}function Wl(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function $l(e){return e>0?1:e<0?-1:0}function Xl(e,t){return Kl(e.prev,e,e.next)<0?Kl(e,t,e.next)>=0&&Kl(e,e.prev,t)>=0:Kl(e,t,e.prev)<0||Kl(e,e.next,t)<0}function Yl(e,t){let r=th(e.i,e.x,e.y),i=th(t.i,t.x,t.y),n=e.next,a=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,a.next=i,i.prev=a,i}function Jl(e,t,r,i){let n=th(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function eh(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function th(e,t,r){return{i:e,x:t,y:r,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}class rh{constructor(e,t){if(t>e)throw new Error("Min granularity must not be greater than base granularity.");this._baseZoomGranularity=e,this._minGranularity=t}getGranularityForZoomLevel(e){return Math.max(Math.floor(this._baseZoomGranularity/(1<<e)),this._minGranularity,1)}}class ih{constructor(e){this.fill=e.fill,this.line=e.line,this.tile=e.tile,this.stencil=e.stencil,this.circle=e.circle}}ih.noSubdivision=new ih({fill:new rh(0,0),line:new rh(0,0),tile:new rh(0,0),stencil:new rh(0,0),circle:1}),oa("SubdivisionGranularityExpression",rh),oa("SubdivisionGranularitySetting",ih);let nh,ah,sh=-32768,oh=32767;class lh{constructor(e,t){this._vertexBuffer=[],this._vertexDictionary=new Map,this._used=!1,this._granularity=e,this._granularityCellSize=T/e,this._canonical=t}_getKey(e,t){return(e+=32768)<<16|t+32768}_vertexToIndex(e,t){if(e<-32768||t<-32768||e>32767||t>32767)throw new Error("Vertex coordinates are out of signed 16 bit integer range.");let r=0|Math.round(e),i=0|Math.round(t),n=this._getKey(r,i);if(this._vertexDictionary.has(n))return this._vertexDictionary.get(n);let a=this._vertexBuffer.length/2;return this._vertexDictionary.set(n,a),this._vertexBuffer.push(r,i),a}_subdivideTrianglesScanline(e){if(this._granularity<2)return function(e,t){let r=[];for(let i=0;i<t.length;i+=3){let n=t[i],a=t[i+1],s=t[i+2],o=e[2*n],l=e[2*n+1];(e[2*a]-o)*(e[2*s+1]-l)-(e[2*a+1]-l)*(e[2*s]-o)>0?(r.push(n),r.push(s),r.push(a)):(r.push(n),r.push(a),r.push(s))}return r}(this._vertexBuffer,e);let t=[],r=e.length;for(let i=0;i<r;i+=3){let r=[e[i+0],e[i+1],e[i+2]],n=[this._vertexBuffer[2*e[i+0]+0],this._vertexBuffer[2*e[i+0]+1],this._vertexBuffer[2*e[i+1]+0],this._vertexBuffer[2*e[i+1]+1],this._vertexBuffer[2*e[i+2]+0],this._vertexBuffer[2*e[i+2]+1]],a=1/0,s=1/0,o=-1/0,l=-1/0;for(let e=0;e<3;e++){let t=n[2*e],r=n[2*e+1];a=Math.min(a,t),o=Math.max(o,t),s=Math.min(s,r),l=Math.max(l,r)}if(a===o||s===l)continue;let h=Math.floor(a/this._granularityCellSize),A=Math.ceil(o/this._granularityCellSize),u=Math.floor(s/this._granularityCellSize),c=Math.ceil(l/this._granularityCellSize);if(h!==A||u!==c)for(let e=u;e<c;e++){let i=this._scanlineGenerateVertexRingForCellRow(e,n,r);uh(this._vertexBuffer,i,t)}else t.push(...r)}return t}_scanlineGenerateVertexRingForCellRow(e,t,r){let i=e*this._granularityCellSize,n=i+this._granularityCellSize,a=[];for(let e=0;e<3;e++){let s=t[2*e],o=t[2*e+1],l=t[2*(e+1)%6],h=t[(2*(e+1)+1)%6],A=t[2*(e+2)%6],u=t[(2*(e+2)+1)%6],c=l-s,d=h-o,p=0===c,f=0===d,g=(i-o)/d,m=(n-o)/d,y=Math.min(g,m),_=Math.max(g,m);if(!f&&(y>=1||_<=0)||f&&(o<i||o>n)){h>=i&&h<=n&&a.push(r[(e+1)%3]);continue}!f&&y>0&&a.push(this._vertexToIndex(s+c*y,o+d*y));let v=s+c*Math.max(y,0),w=s+c*Math.min(_,1);p||this._generateIntraEdgeVertices(a,s,o,l,h,v,w),!f&&_<1&&a.push(this._vertexToIndex(s+c*_,o+d*_)),(f||h>=i&&h<=n)&&a.push(r[(e+1)%3]),!f&&(h<=i||h>=n)&&this._generateInterEdgeVertices(a,s,o,l,h,A,u,w,i,n)}return a}_generateIntraEdgeVertices(e,t,r,i,n,a,s){let o=i-t,l=n-r,h=0===l,A=h?Math.min(t,i):Math.min(a,s),u=h?Math.max(t,i):Math.max(a,s),c=Math.floor(A/this._granularityCellSize)+1,d=Math.ceil(u/this._granularityCellSize)-1;if(h?t<i:a<s)for(let i=c;i<=d;i++){let n=i*this._granularityCellSize;e.push(this._vertexToIndex(n,r+l*(n-t)/o))}else for(let i=d;i>=c;i--){let n=i*this._granularityCellSize;e.push(this._vertexToIndex(n,r+l*(n-t)/o))}}_generateInterEdgeVertices(e,t,r,i,n,a,s,o,l,h){let A=n-r,u=a-i,c=s-n,d=(l-n)/c,p=(h-n)/c,f=Math.min(d,p),g=Math.max(d,p),m=i+u*f,y=Math.floor(Math.min(m,o)/this._granularityCellSize)+1,_=Math.ceil(Math.max(m,o)/this._granularityCellSize)-1,v=o<m,w=0===c;if(w&&(s===l||s===h))return;if(w||f>=1||g<=0){let e=r-s,i=a+(t-a)*Math.min((l-s)/e,(h-s)/e);y=Math.floor(Math.min(i,o)/this._granularityCellSize)+1,_=Math.ceil(Math.max(i,o)/this._granularityCellSize)-1,v=o<i}let b=A>0?h:l;if(v)for(let t=y;t<=_;t++)e.push(this._vertexToIndex(t*this._granularityCellSize,b));else for(let t=_;t>=y;t--)e.push(this._vertexToIndex(t*this._granularityCellSize,b))}_generateOutline(e){let t=[];for(let r of e){let e=Ah(r,this._granularity,!0),i=this._pointArrayToIndices(e),n=[];for(let e=1;e<i.length;e++)n.push(i[e-1]),n.push(i[e]);t.push(n)}return t}_handlePoles(e){let t=!1,r=!1;this._canonical&&(0===this._canonical.y&&(t=!0),this._canonical.y===(1<<this._canonical.z)-1&&(r=!0)),(t||r)&&this._fillPoles(e,t,r)}_ensureNoPoleVertices(){let e=this._vertexBuffer;for(let t=0;t<e.length;t+=2){let r=e[t+1];r===sh&&(e[t+1]=-32767),r===oh&&(e[t+1]=32766)}}_generatePoleQuad(e,t,r,i,n,a){i>n!=(a===sh)?(e.push(t),e.push(r),e.push(this._vertexToIndex(i,a)),e.push(r),e.push(this._vertexToIndex(n,a)),e.push(this._vertexToIndex(i,a))):(e.push(r),e.push(t),e.push(this._vertexToIndex(i,a)),e.push(this._vertexToIndex(n,a)),e.push(r),e.push(this._vertexToIndex(i,a)))}_fillPoles(e,t,r){let i=this._vertexBuffer,n=T,a=e.length;for(let s=2;s<a;s+=3){let a=e[s-2],o=e[s-1],l=e[s],h=i[2*a],A=i[2*a+1],u=i[2*o],c=i[2*o+1],d=i[2*l],p=i[2*l+1];t&&(0===A&&0===c&&this._generatePoleQuad(e,a,o,h,u,sh),0===c&&0===p&&this._generatePoleQuad(e,o,l,u,d,sh),0===p&&0===A&&this._generatePoleQuad(e,l,a,d,h,sh)),r&&(A===n&&c===n&&this._generatePoleQuad(e,a,o,h,u,oh),c===n&&p===n&&this._generatePoleQuad(e,o,l,u,d,oh),p===n&&A===n&&this._generatePoleQuad(e,l,a,d,h,oh))}}_initializeVertices(e){for(let t=0;t<e.length;t+=2)this._vertexToIndex(e[t],e[t+1])}subdividePolygonInternal(e,t){if(this._used)throw new Error("Subdivision: multiple use not allowed.");this._used=!0;let r,{flattened:i,holeIndices:n}=function(e){let t=[],r=[];for(let i of e)if(0!==i.length){i!==e[0]&&t.push(r.length/2);for(let e=0;e<i.length;e++)r.push(i[e].x),r.push(i[e].y)}return{flattened:r,holeIndices:t}}(e);this._initializeVertices(i);try{let e=function(e,t,r=2){let i,n,a,s=t&&t.length,o=s?t[0]*r:e.length,l=Pl(e,0,o,r,!0),h=[];if(!l||l.next===l.prev)return h;if(s&&(l=function(e,t,r,i){let n=[];for(let r=0,a=t.length;r<a;r++){let s=Pl(e,t[r]*i,r<a-1?t[r+1]*i:e.length,i,!1);s===s.next&&(s.steiner=!0),n.push(Hl(s))}n.sort(Nl);for(let e=0;e<n.length;e++)r=Ol(n[e],r);return r}(e,t,l,r)),e.length>80*r){i=e[0],n=e[1];let t=i,s=n;for(let a=r;a<o;a+=r){let r=e[a],o=e[a+1];r<i&&(i=r),o<n&&(n=o),r>t&&(t=r),o>s&&(s=o)}a=Math.max(t-i,s-n),a=0!==a?32767/a:0}return Ml(l,h,r,i,n,a,0),h}(i,n),t=this._convertIndices(i,e);r=this._subdivideTrianglesScanline(t)}catch(e){console.error(e)}let a=[];return t&&(a=this._generateOutline(e)),this._ensureNoPoleVertices(),this._handlePoles(r),{verticesFlattened:this._vertexBuffer,indicesTriangles:r,indicesLineList:a}}_convertIndices(e,t){let r=[];for(let i=0;i<t.length;i++)r.push(this._vertexToIndex(e[2*t[i]],e[2*t[i]+1]));return r}_pointArrayToIndices(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];t.push(this._vertexToIndex(i.x,i.y))}return t}}function hh(e,t,r,i=!0){return new lh(r,t).subdividePolygonInternal(e,i)}function Ah(e,t,i=!1){if(!e||e.length<1)return[];if(e.length<2)return[];let n=e[0],a=e[e.length-1],s=i&&(n.x!==a.x||n.y!==a.y);if(t<2)return s?[...e,e[0]]:[...e];let o=Math.floor(T/t),l=[];l.push(new r(e[0].x,e[0].y));let h=e.length,A=s?h:h-1;for(let t=0;t<A;t++){let i=e[t],n=t<h-1?e[t+1]:e[0],a=i.x,s=i.y,A=n.x,u=n.y,c=a!==A,d=s!==u;if(!c&&!d)continue;let p=A-a,f=u-s,g=Math.abs(p),m=Math.abs(f),y=a,_=s;for(;;){let e=p>0?(Math.floor(y/o)+1)*o:(Math.ceil(y/o)-1)*o,t=f>0?(Math.floor(_/o)+1)*o:(Math.ceil(_/o)-1)*o,i=Math.abs(y-e),n=Math.abs(_-t),a=Math.abs(y-A),s=Math.abs(_-u),h=c?i/g:Number.POSITIVE_INFINITY,v=d?n/m:Number.POSITIVE_INFINITY;if((a<=i||!c)&&(s<=n||!d))break;if(h<v&&c||!d){y=e,_+=f*h;let t=new r(y,Math.round(_));l[l.length-1].x===t.x&&l[l.length-1].y===t.y||l.push(t)}else{y+=p*v,_=t;let e=new r(Math.round(y),_);l[l.length-1].x===e.x&&l[l.length-1].y===e.y||l.push(e)}}let v=new r(A,u);l[l.length-1].x===v.x&&l[l.length-1].y===v.y||l.push(v)}return l}function uh(e,t,r){if(0===t.length)throw new Error("Subdivision vertex ring is empty.");let i=0,n=e[2*t[0]];for(let r=1;r<t.length;r++){let a=e[2*t[r]];a<n&&(n=a,i=r)}let a=t.length,s=i,o=(s+1)%a;for(;;){let i=s-1>=0?s-1:a-1,n=(o+1)%a,l=e[2*t[i]],h=e[2*t[n]],A=e[2*t[s]],u=e[2*t[s]+1],c=e[2*t[o]+1],d=!1;if(l<h)d=!0;else if(l>h)d=!1;else{let r=c-u,a=-(e[2*t[o]]-A),s=u<c?1:-1;((l-A)*r+(e[2*t[i]+1]-u)*a)*s>((h-A)*r+(e[2*t[n]+1]-u)*a)*s&&(d=!0)}if(d){let e=t[i],n=t[s],l=t[o];e!==n&&e!==l&&n!==l&&r.push(l,n,e),s--,s<0&&(s=a-1)}else{let e=t[n],i=t[s],l=t[o];e!==i&&e!==l&&i!==l&&r.push(l,i,e),o++,o>=a&&(o=0)}if(i===n)break}}function ch(e,t,r,i,n,a,s,o,l){let h=n.length/2,A=s&&o&&l;if(h<$s.MAX_VERTEX_ARRAY_LENGTH){let u,c,d=t.prepareSegment(h,r,i),p=d.vertexLength;for(let e=0;e<a.length;e+=3)i.emplaceBack(p+a[e],p+a[e+1],p+a[e+2]);d.vertexLength+=h,d.primitiveLength+=a.length/3,A&&(c=s.prepareSegment(h,r,o),u=c.vertexLength,c.vertexLength+=h);for(let t=0;t<n.length;t+=2)e(n[t],n[t+1]);if(A)for(let e=0;e<l.length;e++){let t=l[e];for(let e=1;e<t.length;e+=2)o.emplaceBack(u+t[e-1],u+t[e]);c.primitiveLength+=t.length/2}}else(function(e,t,r,i,n,a){let s=[];for(let e=0;e<i.length/2;e++)s.push(-1);let o={count:0},l=0,h=e.getOrCreateLatestSegment(t,r),A=h.vertexLength;for(let u=2;u<n.length;u+=3){let c=n[u-2],d=n[u-1],p=n[u],f=s[c]<l,g=s[d]<l,m=s[p]<l;h.vertexLength+((f?1:0)+(g?1:0)+(m?1:0))>$s.MAX_VERTEX_ARRAY_LENGTH&&(h=e.createNewSegment(t,r),l=o.count,f=!0,g=!0,m=!0,A=0);let y=dh(s,i,a,o,c,f,h),_=dh(s,i,a,o,d,g,h),v=dh(s,i,a,o,p,m,h);r.emplaceBack(A+y-l,A+_-l,A+v-l),h.primitiveLength++}})(t,r,i,n,a,e),A&&function(e,t,r,i,n,a){let s=[];for(let e=0;e<i.length/2;e++)s.push(-1);let o={count:0},l=0,h=e.getOrCreateLatestSegment(t,r),A=h.vertexLength;for(let u=0;u<n.length;u++){let c=n[u];for(let d=1;d<n[u].length;d+=2){let n=c[d-1],u=c[d],p=s[n]<l,f=s[u]<l;h.vertexLength+((p?1:0)+(f?1:0))>$s.MAX_VERTEX_ARRAY_LENGTH&&(h=e.createNewSegment(t,r),l=o.count,p=!0,f=!0,A=0);let g=dh(s,i,a,o,n,p,h),m=dh(s,i,a,o,u,f,h);r.emplaceBack(A+g-l,A+m-l),h.primitiveLength++}}}(s,r,o,n,l,e),t.forceNewSegmentOnNextPrepare(),s?.forceNewSegmentOnNextPrepare()}function dh(e,t,r,i,n,a,s){if(a){let a=i.count;return r(t[2*n],t[2*n+1]),e[n]=i.count,i.count++,s.vertexLength++,a}return e[n]}class ph{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.layoutVertexArray=new Us,this.indexArray=new Ks,this.indexArray2=new qs,this.programConfigurations=new Eo(e.layers,e.zoom),this.segments=new $s,this.segments2=new $s,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasDependencies=Tl("fill",this.layers,t);let i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),a=[];for(let{feature:s,id:o,index:l,sourceLayerIndex:h}of e){let e=this.layers[0]._featureFilter.needGeometry,A=Mo(s,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),A,r))continue;let u=n?i.evaluate(A,{},r,t.availableImages):void 0,c={id:o,properties:s.properties,type:s.type,sourceLayerIndex:h,index:l,geometry:e?A.geometry:Lo(s),patterns:{},sortKey:u};a.push(c)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;if(this.hasDependencies){let e=Fl("fill",this.layers,i,{zoom:this.zoom},t);this.patternFeatures.push(e)}else this.addFeature(i,n,a,r,{},t.subdivisionGranularity);t.featureIndex.insert(e[a].feature,n,a,s,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}addFeatures(e,t,r){for(let i of this.patternFeatures)this.addFeature(i,i.geometry,i.index,t,r,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Il),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n,a){for(let e of Jr(t,500)){let t=hh(e,i,a.fill.getGranularityForZoomLevel(i.z)),r=this.layoutVertexArray;ch(((e,t)=>{r.emplaceBack(e,t)}),this.segments,this.layoutVertexArray,this.indexArray,t.verticesFlattened,t.indicesTriangles,this.segments2,this.indexArray2,t.indicesLineList)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}}oa("FillBucket",ph,{omit:["layers","patternFeatures"]});var fh={get paint(){return ah=ah||new ja({"fill-antialias":new Na(ye.paint_fill["fill-antialias"]),"fill-opacity":new Oa(ye.paint_fill["fill-opacity"]),"fill-color":new Oa(ye.paint_fill["fill-color"]),"fill-outline-color":new Oa(ye.paint_fill["fill-outline-color"]),"fill-translate":new Na(ye.paint_fill["fill-translate"]),"fill-translate-anchor":new Na(ye.paint_fill["fill-translate-anchor"]),"fill-pattern":new Qa(ye.paint_fill["fill-pattern"])})},get layout(){return nh=nh||new ja({"fill-sort-key":new Oa(ye.layout_fill["fill-sort-key"])})}};class gh extends Ga{constructor(e,t){super(e,fh,t)}recalculate(e,t){super.recalculate(e,t);let r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new ph(e)}queryRadius(){return Xo(this.paint.get("fill-translate"))}queryIntersectsFeature({queryGeometry:e,geometry:t,transform:r,pixelsToTileUnits:i}){return zo(Yo(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),-r.bearingInRadians,i),t)}isTileClipped(){return!0}}let mh=Wa([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),yh=Wa([{name:"a_centroid",components:2,type:"Int16"}],4),{members:_h}=mh;class vh{constructor(e,t,r,i,n){this.properties={},this.extent=r,this.type=0,this.id=void 0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n,e.readFields(wh,this,t)}loadGeometry(){let e=this._pbf;e.pos=this._geometry;let t,i=e.readVarint()+e.pos,n=[],a=1,s=0,o=0,l=0;for(;e.pos<i;){if(s<=0){let t=e.readVarint();a=7&t,s=t>>3}if(s--,1===a||2===a)o+=e.readSVarint(),l+=e.readSVarint(),1===a&&(t&&n.push(t),t=[]),t&&t.push(new r(o,l));else{if(7!==a)throw new Error(`unknown command ${a}`);t&&t.push(t[0].clone())}}return t&&n.push(t),n}bbox(){let e=this._pbf;e.pos=this._geometry;let t=e.readVarint()+e.pos,r=1,i=0,n=0,a=0,s=1/0,o=-1/0,l=1/0,h=-1/0;for(;e.pos<t;){if(i<=0){let t=e.readVarint();r=7&t,i=t>>3}if(i--,1===r||2===r)n+=e.readSVarint(),a+=e.readSVarint(),n<s&&(s=n),n>o&&(o=n),a<l&&(l=a),a>h&&(h=a);else if(7!==r)throw new Error(`unknown command ${r}`)}return[s,l,o,h]}toGeoJSON(e,t,r){let i,n=this.extent*Math.pow(2,r),a=this.extent*e,s=this.extent*t,o=this.loadGeometry();function l(e){return[360*(e.x+a)/n-180,360/Math.PI*Math.atan(Math.exp((1-2*(e.y+s)/n)*Math.PI))-90]}function h(e){return e.map(l)}if(1===this.type){let e=[];for(let t of o)e.push(t[0]);let t=h(e);i=1===e.length?{type:"Point",coordinates:t[0]}:{type:"MultiPoint",coordinates:t}}else if(2===this.type){let e=o.map(h);i=1===e.length?{type:"LineString",coordinates:e[0]}:{type:"MultiLineString",coordinates:e}}else{if(3!==this.type)throw new Error("unknown feature type");{let e=function(e){let t=e.length;if(t<=1)return[e];let r,i,n=[];for(let a=0;a<t;a++){let t=bh(e[a]);0!==t&&(void 0===i&&(i=t<0),i===t<0?(r&&n.push(r),r=[e[a]]):r&&r.push(e[a]))}return r&&n.push(r),n}(o),t=[];for(let r of e)t.push(r.map(h));i=1===t.length?{type:"Polygon",coordinates:t[0]}:{type:"MultiPolygon",coordinates:t}}}let A={type:"Feature",geometry:i,properties:this.properties};return null!=this.id&&(A.id=this.id),A}}function wh(e,t,r){1===e?t.id=r.readVarint():2===e?function(e,t){let r=e.readVarint()+e.pos;for(;e.pos<r;){let r=t._keys[e.readVarint()],i=t._values[e.readVarint()];t.properties[r]=i}}(r,t):3===e?t.type=r.readVarint():4===e&&(t._geometry=r.pos)}function bh(e){let t=0;for(let r,i,n=0,a=e.length,s=a-1;n<a;s=n++)r=e[n],i=e[s],t+=(i.x-r.x)*(r.y+i.y);return t}vh.types=["Unknown","Point","LineString","Polygon"];class xh{constructor(e,t){this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(Bh,this,t),this.length=this._features.length}feature(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];let t=this._pbf.readVarint()+this._pbf.pos;return new vh(this._pbf,t,this.extent,this._keys,this._values)}}function Bh(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){let t=null,r=e.readVarint()+e.pos;for(;e.pos<r;){let r=e.readVarint()>>3;t=1===r?e.readString():2===r?e.readFloat():3===r?e.readDouble():4===r?e.readVarint64():5===r?e.readVarint():6===r?e.readSVarint():7===r?e.readBoolean():null}if(null==t)throw new Error("unknown feature value");return t}(r))}class Ch{constructor(e,t){this.layers=e.readFields(Sh,{},t)}}function Sh(e,t,r){if(3===e){let e=new xh(r,r.readVarint()+r.pos);e.length&&(t[e.name]=e)}}let Eh,Ih=Math.pow(2,13);function Th(e,t,r,i,n,a,s,o){e.emplaceBack(t,r,2*Math.floor(i*Ih)+s,n*Ih*2,a*Ih*2,Math.round(o))}class Fh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.layoutVertexArray=new Rs,this.centroidVertexArray=new Ms,this.indexArray=new Ks,this.programConfigurations=new Eo(e.layers,e.zoom),this.segments=new $s,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasDependencies=Tl("fill-extrusion",this.layers,t);for(let{feature:i,id:n,index:a,sourceLayerIndex:s}of e){let e=this.layers[0]._featureFilter.needGeometry,o=Mo(i,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),o,r))continue;let l={id:n,sourceLayerIndex:s,index:a,geometry:e?o.geometry:Lo(i),properties:i.properties,type:i.type,patterns:{}};this.hasDependencies?this.features.push(Fl("fill-extrusion",this.layers,l,{zoom:this.zoom},t)):this.addFeature(l,l.geometry,a,r,{},t.subdivisionGranularity),t.featureIndex.insert(i,l.geometry,a,s,this.index,!0)}}addFeatures(e,t,r){for(let i of this.features){let{geometry:n}=i;this.addFeature(i,n,i.index,t,r,e.subdivisionGranularity)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r})}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,_h),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,yh.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n,a){for(let r of Jr(t,500)){let t={x:0,y:0,sampleCount:0},n=this.layoutVertexArray.length;this.processPolygon(t,i,e,r,a);let s=this.layoutVertexArray.length-n,o=Math.floor(t.x/t.sampleCount),l=Math.floor(t.y/t.sampleCount);for(let e=0;e<s;e++)this.centroidVertexArray.emplaceBack(o,l)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,canonical:i})}processPolygon(e,t,r,i,n){if(i.length<1||Mh(i[0]))return;for(let t of i)0!==t.length&&Ph(e,t);let a={segment:this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)},s=n.fill.getGranularityForZoomLevel(t.z),o="Polygon"===vh.types[r.type];for(let e of i){if(0===e.length||Mh(e))continue;let t=Ah(e,s,o);this._generateSideFaces(t,a)}if(!o)return;let l=hh(i,t,s,!1),h=this.layoutVertexArray;ch(((e,t)=>{Th(h,e,t,0,0,1,1,0)}),this.segments,this.layoutVertexArray,this.indexArray,l.verticesFlattened,l.indicesTriangles)}_generateSideFaces(e,t){let r=0;for(let i=1;i<e.length;i++){let n=e[i],a=e[i-1];if(Lh(n,a))continue;t.segment.vertexLength+4>$s.MAX_VERTEX_ARRAY_LENGTH&&(t.segment=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));let s=n.sub(a)._perp()._unit(),o=a.dist(n);r+o>32768&&(r=0),Th(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,0,r),Th(this.layoutVertexArray,n.x,n.y,s.x,s.y,0,1,r),r+=o,Th(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,0,r),Th(this.layoutVertexArray,a.x,a.y,s.x,s.y,0,1,r);let l=t.segment.vertexLength;this.indexArray.emplaceBack(l,l+2,l+1),this.indexArray.emplaceBack(l+1,l+2,l+3),t.segment.vertexLength+=4,t.segment.primitiveLength+=2}}}function Ph(e,t){for(let r=0;r<t.length;r++){let i=t[r];r===t.length-1&&t[0].x===i.x&&t[0].y===i.y||(e.x+=i.x,e.y+=i.y,e.sampleCount++)}}function Lh(e,t){return e.x===t.x&&(e.x<0||e.x>T)||e.y===t.y&&(e.y<0||e.y>T)}function Mh(e){return e.every((e=>e.x<0))||e.every((e=>e.x>T))||e.every((e=>e.y<0))||e.every((e=>e.y>T))}oa("FillExtrusionBucket",Fh,{omit:["layers","features"]});var kh={get paint(){return Eh=Eh||new ja({"fill-extrusion-opacity":new Na(ye["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Oa(ye["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Na(ye["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Na(ye["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Qa(ye["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Oa(ye["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Oa(ye["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Na(ye["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Uh extends Ga{constructor(e,t){super(e,kh,t)}createBucket(e){return new Fh(e)}queryRadius(){return Xo(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:n,transform:a,pixelsToTileUnits:s,pixelPosMatrix:o}){let l=Yo(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),-a.bearingInRadians,s),h=this.paint.get("fill-extrusion-height").evaluate(t,i),A=this.paint.get("fill-extrusion-base").evaluate(t,i),u=function(e,t){let i=[];for(let n of e){let e=[n.x,n.y,0,1];B(e,e,t),i.push(new r(e[0]/e[3],e[1]/e[3]))}return i}(l,o),c=function(e,t,i,n){let a=[],s=[],o=n[8]*t,l=n[9]*t,h=n[10]*t,A=n[11]*t,u=n[8]*i,c=n[9]*i,d=n[10]*i,p=n[11]*i;for(let t of e){let e=[],i=[];for(let a of t){let t=a.x,s=a.y,f=n[0]*t+n[4]*s+n[12],g=n[1]*t+n[5]*s+n[13],m=n[2]*t+n[6]*s+n[14],y=n[3]*t+n[7]*s+n[15],_=m+h,v=y+A,w=f+u,b=g+c,x=m+d,B=y+p,C=new r((f+o)/v,(g+l)/v);C.z=_/v,e.push(C);let S=new r(w/B,b/B);S.z=x/B,i.push(S)}a.push(e),s.push(i)}return[a,s]}(n,A,h,o);return function(e,t,r){let i=1/0;zo(r,t)&&(i=Dh(r,t[0]));for(let n=0;n<t.length;n++){let a=t[n],s=e[n];for(let e=0;e<a.length-1;e++){let t=a[e],n=[t,a[e+1],s[e+1],s[e],t];Oo(r,n)&&(i=Math.min(i,Dh(r,n)))}}return i!==1/0&&i}(c[0],c[1],u)}}function Rh(e,t){return e.x*t.x+e.y*t.y}function Dh(e,t){if(1===e.length){let r,i=0,n=t[i++];for(;!r||n.equals(r);)if(r=t[i++],!r)return 1/0;for(;i<t.length;i++){let a=t[i],s=e[0],o=r.sub(n),l=a.sub(n),h=s.sub(n),A=Rh(o,o),u=Rh(o,l),c=Rh(l,l),d=Rh(h,o),p=Rh(h,l),f=A*c-u*u,g=(c*d-u*p)/f,m=(A*p-u*d)/f,y=n.z*(1-g-m)+r.z*g+a.z*m;if(isFinite(y))return y}return 1/0}{let e=1/0;for(let r of t)e=Math.min(e,r.z);return e}}let Nh,Oh,Qh=Wa([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:zh}=Qh,Hh=Wa([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:jh}=Hh,Vh=Math.cos(Math.PI/180*37.5),Gh=Math.pow(2,14)/.5;class Kh{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasDependencies=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new Ds,this.layoutVertexArray2=new Ns,this.indexArray=new Ks,this.programConfigurations=new Eo(e.layers,e.zoom),this.segments=new $s,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasDependencies=Tl("line",this.layers,t)||this.hasLineDasharray(this.layers);let i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),a=[];for(let{feature:t,id:s,index:o,sourceLayerIndex:l}of e){let e=this.layers[0]._featureFilter.needGeometry,h=Mo(t,e);if(!this.layers[0]._featureFilter.filter(new Ia(this.zoom),h,r))continue;let A=n?i.evaluate(h,{},r):void 0,u={id:s,properties:t.properties,type:t.type,sourceLayerIndex:l,index:o,geometry:e?h.geometry:Lo(t),patterns:{},dashes:{},sortKey:A};a.push(u)}n&&a.sort(((e,t)=>e.sortKey-t.sortKey));for(let i of a){let{geometry:n,index:a,sourceLayerIndex:s}=i;this.hasDependencies?(Tl("line",this.layers,t)?Fl("line",this.layers,i,{zoom:this.zoom},t):this.hasLineDasharray(this.layers)&&this.addLineDashDependencies(this.layers,i,this.zoom,t),this.patternFeatures.push(i)):this.addFeature(i,n,a,r,{},{},t.subdivisionGranularity),t.featureIndex.insert(e[a].feature,n,a,s,this.index)}}update(e,t,r,i){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,{imagePositions:r,dashPositions:i})}addFeatures(e,t,r,i){for(let n of this.patternFeatures)this.addFeature(n,n.geometry,n.index,t,r,i,e.subdivisionGranularity)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,jh)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,zh),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,i,n,a,s){let o=this.layers[0].layout,l=o.get("line-join").evaluate(e,{}),h=o.get("line-cap"),A=o.get("line-miter-limit"),u=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(let r of t)this.addLine(r,e,l,h,A,u,i,s);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{imagePositions:n,dashPositions:a,canonical:i})}addLine(e,t,r,i,n,a,s,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,e=Ah(e,s?o.line.getGranularityForZoomLevel(s.z):1),this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}let l="Polygon"===vh.types[t.type],h=e.length;for(;h>=2&&e[h-1].equals(e[h-2]);)h--;let A=0;for(;A<h-1&&e[A].equals(e[A+1]);)A++;if(h<(l?3:2))return;"bevel"===r&&(n=1.05);let u,c,d,p,f,g=this.overscaling<=16?122880/(512*this.overscaling):0,m=this.segments.prepareSegment(10*h,this.layoutVertexArray,this.indexArray);this.e1=this.e2=-1,l&&(u=e[h-2],f=e[A].sub(u)._unit()._perp());for(let t=A;t<h;t++){if(d=t===h-1?l?e[A+1]:void 0:e[t+1],d&&e[t].equals(d))continue;f&&(p=f),u&&(c=u),u=e[t],f=d?d.sub(u)._unit()._perp():p,p=p||f;let s=p.add(f);0===s.x&&0===s.y||s._unit();let o=p.x*f.x+p.y*f.y,y=s.x*f.x+s.y*f.y,_=0!==y?1/y:1/0,v=2*Math.sqrt(2-2*y),w=y<Vh&&c&&d,b=p.x*f.y-p.y*f.x>0;if(w&&t>A){let e=u.dist(c);if(e>2*g){let t=u.sub(u.sub(c)._mult(g/e)._round());this.updateDistance(c,t),this.addCurrentVertex(t,p,0,0,m),c=t}}let x=c&&d,B=x?r:l?"butt":i;if(x&&"round"===B&&(_<a?B="miter":_<=2&&(B="fakeround")),"miter"===B&&_>n&&(B="bevel"),"bevel"===B&&(_>2&&(B="flipbevel"),_<n&&(B="miter")),c&&this.updateDistance(c,u),"miter"===B)s._mult(_),this.addCurrentVertex(u,s,0,0,m);else if("flipbevel"===B){if(_>100)s=f.mult(-1);else{let e=_*p.add(f).mag()/p.sub(f).mag();s._perp()._mult(e*(b?-1:1))}this.addCurrentVertex(u,s,0,0,m),this.addCurrentVertex(u,s.mult(-1),0,0,m)}else if("bevel"===B||"fakeround"===B){let e=-Math.sqrt(_*_-1),t=b?e:0,r=b?0:e;if(c&&this.addCurrentVertex(u,p,t,r,m),"fakeround"===B){let e=Math.round(180*v/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){let e=r-.5;r+=r*e*(r-1)*((1.0904+o*(o*(3.55645-1.43519*o)-3.2452))*e*e+(.848013+o*(.215638*o-1.06021)))}let i=f.sub(p)._mult(r)._add(p)._unit()._mult(b?-1:1);this.addHalfVertex(u,i.x,i.y,!1,b,0,m)}}d&&this.addCurrentVertex(u,f,-t,-r,m)}else if("butt"===B)this.addCurrentVertex(u,s,0,0,m);else if("square"===B){let e=c?1:-1;this.addCurrentVertex(u,s,e,e,m)}else"round"===B&&(c&&(this.addCurrentVertex(u,p,0,0,m),this.addCurrentVertex(u,p,1,1,m,!0)),d&&(this.addCurrentVertex(u,f,-1,-1,m,!0),this.addCurrentVertex(u,f,0,0,m)));if(w&&t<h-1){let e=u.dist(d);if(e>2*g){let t=u.add(d.sub(u)._mult(g/e)._round());this.updateDistance(u,t),this.addCurrentVertex(t,f,0,0,m),u=t}}}}addCurrentVertex(e,t,r,i,n,a=!1){let s=t.y*i-t.x,o=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,a,!1,r,n),this.addHalfVertex(e,s,o,a,!0,-i,n),this.distance>Gh/2&&0===this.totalDistance&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(e,t,r,i,n,a))}addHalfVertex({x:e,y:t},r,i,n,a,s,o){let l=.5*(this.lineClips?this.scaledDistance*(Gh-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(a?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===s?0:s<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);let h=o.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,h,this.e2),o.primitiveLength++),a?this.e2=h:this.e1=h}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}hasLineDasharray(e){for(let t of e){let e=t.paint.get("line-dasharray");if(e&&!e.isConstant())return!0}return!1}addLineDashDependencies(e,t,r,i){for(let n of e){let e=n.paint.get("line-dasharray");if(!e||"constant"===e.value.kind)continue;let a="round"===n.layout.get("line-cap"),s={dasharray:e.value.evaluate({zoom:r-1},t,{}),round:a},o={dasharray:e.value.evaluate({zoom:r},t,{}),round:a},l={dasharray:e.value.evaluate({zoom:r+1},t,{}),round:a},h=`${s.dasharray.join(",")},${s.round}`,A=`${o.dasharray.join(",")},${o.round}`,u=`${l.dasharray.join(",")},${l.round}`;i.dashDependencies[h]=s,i.dashDependencies[A]=o,i.dashDependencies[u]=l,t.dashes[n.id]={min:h,mid:A,max:u}}}}oa("LineBucket",Kh,{omit:["layers","patternFeatures"]});var qh={get paint(){return Oh=Oh||new ja({"line-opacity":new Oa(ye.paint_line["line-opacity"]),"line-color":new Oa(ye.paint_line["line-color"]),"line-translate":new Na(ye.paint_line["line-translate"]),"line-translate-anchor":new Na(ye.paint_line["line-translate-anchor"]),"line-width":new Oa(ye.paint_line["line-width"]),"line-gap-width":new Oa(ye.paint_line["line-gap-width"]),"line-offset":new Oa(ye.paint_line["line-offset"]),"line-blur":new Oa(ye.paint_line["line-blur"]),"line-dasharray":new Qa(ye.paint_line["line-dasharray"]),"line-pattern":new Qa(ye.paint_line["line-pattern"]),"line-gradient":new Ha(ye.paint_line["line-gradient"])})},get layout(){return Nh=Nh||new ja({"line-cap":new Na(ye.layout_line["line-cap"]),"line-join":new Oa(ye.layout_line["line-join"]),"line-miter-limit":new Na(ye.layout_line["line-miter-limit"]),"line-round-limit":new Na(ye.layout_line["line-round-limit"]),"line-sort-key":new Oa(ye.layout_line["line-sort-key"])})}};class Zh extends Oa{possiblyEvaluate(e,t){return t=new Ia(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=N({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}}let Wh;class $h extends Ga{constructor(e,t){super(e,qh,t),this.gradientVersion=0,Wh||(Wh=new Zh(qh.paint.properties["line-width"].specification),Wh.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(e){if("line-gradient"===e){let e=this.gradientExpression();this.stepInterpolant=!(void 0===e._styleExpression)&&e._styleExpression.expression instanceof sr,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Wh.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Kh(e)}queryRadius(e){let t=e,r=Xh($o("line-width",this,t),$o("line-gap-width",this,t)),i=$o("line-offset",this,t);return r/2+Math.abs(i)+Xo(this.paint.get("line-translate"))}queryIntersectsFeature({queryGeometry:e,feature:t,featureState:i,geometry:n,transform:a,pixelsToTileUnits:s}){let o=Yo(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),-a.bearingInRadians,s),l=s/2*Xh(this.paint.get("line-width").evaluate(t,i),this.paint.get("line-gap-width").evaluate(t,i)),h=this.paint.get("line-offset").evaluate(t,i);return h&&(n=function(e,t){let i=[];for(let n=0;n<e.length;n++){let a=e[n],s=[];for(let e=0;e<a.length;e++){let i=a[e-1],n=a[e],o=a[e+1],l=0===e?new r(0,0):n.sub(i)._unit()._perp(),h=e===a.length-1?new r(0,0):o.sub(n)._unit()._perp(),A=l._add(h)._unit(),u=A.x*h.x+A.y*h.y;0!==u&&A._mult(1/u),s.push(A._mult(t)._add(n))}i.push(s)}return i}(n,h*s)),function(e,t,r){for(let i=0;i<t.length;i++){let n=t[i];if(e.length>=3)for(let t=0;t<n.length;t++)if(Zo(e,n[t]))return!0;if(Ho(e,n,r))return!0}return!1}(o,n,l)}isTileClipped(){return!0}}function Xh(e,t){return t>0?t+2*e:e}let Yh=Wa([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Jh=Wa([{name:"a_projected_pos",components:3,type:"Float32"}],4);Wa([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);let eA=Wa([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);Wa([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]);let tA=Wa([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),rA=Wa([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function iA(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){let i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),Ea.applyArabicShaping&&(e=Ea.applyArabicShaping(e)),e}(e.text,t,r)})),e}Wa([{name:"triangle",components:3,type:"Uint16"}]),Wa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Wa([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",name:"collisionCircleDiameter"},{type:"Uint16",name:"textAnchorOffsetStartIndex"},{type:"Uint16",name:"textAnchorOffsetEndIndex"}]),Wa([{type:"Float32",name:"offsetX"}]),Wa([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),Wa([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);let nA={"!":"︕","#":"＃",$:"＄","%":"％","&":"＆","(":"︵",")":"︶","*":"＊","+":"＋",",":"︐","-":"︲",".":"・","/":"／",":":"︓",";":"︔","<":"︿","=":"＝",">":"﹀","?":"︖","@":"＠","[":"﹇","\\":"＼","]":"﹈","^":"＾",_:"︳","`":"｀","{":"︷","|":"―","}":"︸","~":"～","¢":"￠","£":"￡","¥":"￥","¦":"￤","¬":"￢","¯":"￣","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"￦","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","！":"︕","（":"︵","）":"︶","，":"︐","－":"︲","．":"・","：":"︓","；":"︔","＜":"︿","＞":"﹀","？":"︖","［":"﹇","］":"﹈","＿":"︳","｛":"︷","｜":"―","｝":"︸","｟":"︵","｠":"︶","｡":"︒","｢":"﹁","｣":"﹂"};var aA=24;let sA=4294967296,oA=1/sA,lA=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");class hA{constructor(e=new Uint8Array(16)){this.buf=ArrayBuffer.isView(e)?e:new Uint8Array(e),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(e,t,r=this.length){for(;this.pos<r;){let r=this.readVarint(),i=r>>3,n=this.pos;this.type=7&r,e(i,t,this),this.pos===n&&this.skip(r)}return t}readMessage(e,t){return this.readFields(e,t,this.readVarint()+this.pos)}readFixed32(){let e=this.dataView.getUint32(this.pos,!0);return this.pos+=4,e}readSFixed32(){let e=this.dataView.getInt32(this.pos,!0);return this.pos+=4,e}readFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*sA;return this.pos+=8,e}readSFixed64(){let e=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*sA;return this.pos+=8,e}readFloat(){let e=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,e}readDouble(){let e=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,e}readVarint(e){let t,r,i=this.buf;return r=i[this.pos++],t=127&r,r<128?t:(r=i[this.pos++],t|=(127&r)<<7,r<128?t:(r=i[this.pos++],t|=(127&r)<<14,r<128?t:(r=i[this.pos++],t|=(127&r)<<21,r<128?t:(r=i[this.pos],t|=(15&r)<<28,function(e,t,r){let i,n,a=r.buf;if(n=a[r.pos++],i=(112&n)>>4,n<128||(n=a[r.pos++],i|=(127&n)<<3,n<128)||(n=a[r.pos++],i|=(127&n)<<10,n<128)||(n=a[r.pos++],i|=(127&n)<<17,n<128)||(n=a[r.pos++],i|=(127&n)<<24,n<128)||(n=a[r.pos++],i|=(1&n)<<31,n<128))return function(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t,e,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){let e=this.readVarint();return e%2==1?(e+1)/-2:e/2}readBoolean(){return!!this.readVarint()}readString(){let e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&lA?lA.decode(this.buf.subarray(t,e)):function(e,t,r){let i="",n=t;for(;n<r;){let t,a,s,o=e[n],l=null,h=o>239?4:o>223?3:o>191?2:1;if(n+h>r)break;1===h?o<128&&(l=o):2===h?(t=e[n+1],128==(192&t)&&(l=(31&o)<<6|63&t,l<=127&&(l=null))):3===h?(t=e[n+1],a=e[n+2],128==(192&t)&&128==(192&a)&&(l=(15&o)<<12|(63&t)<<6|63&a,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===h&&(t=e[n+1],a=e[n+2],s=e[n+3],128==(192&t)&&128==(192&a)&&128==(192&s)&&(l=(15&o)<<18|(63&t)<<12|(63&a)<<6|63&s,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,h=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=h}return i}(this.buf,t,e)}readBytes(){let e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t}readPackedVarint(e=[],t){let r=this.readPackedEnd();for(;this.pos<r;)e.push(this.readVarint(t));return e}readPackedSVarint(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSVarint());return e}readPackedBoolean(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readBoolean());return e}readPackedFloat(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFloat());return e}readPackedDouble(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readDouble());return e}readPackedFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed32());return e}readPackedSFixed32(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed32());return e}readPackedFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readFixed64());return e}readPackedSFixed64(e=[]){let t=this.readPackedEnd();for(;this.pos<t;)e.push(this.readSFixed64());return e}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(e){let t=7&e;if(0===t)for(;this.buf[this.pos++]>127;);else if(2===t)this.pos=this.readVarint()+this.pos;else if(5===t)this.pos+=4;else{if(1!==t)throw new Error(`Unimplemented type: ${t}`);this.pos+=8}}writeTag(e,t){this.writeVarint(e<<3|t)}realloc(e){let t=this.length||16;for(;t<this.pos+e;)t*=2;if(t!==this.length){let e=new Uint8Array(t);e.set(this.buf),this.buf=e,this.dataView=new DataView(e.buffer),this.length=t}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeSFixed32(e){this.realloc(4),this.dataView.setInt32(this.pos,e,!0),this.pos+=4}writeFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*oA),!0),this.pos+=8}writeSFixed64(e){this.realloc(8),this.dataView.setInt32(this.pos,-1&e,!0),this.dataView.setInt32(this.pos+4,Math.floor(e*oA),!0),this.pos+=8}writeVarint(e){(e=+e||0)>268435455||e<0?function(e,t){let r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(r=~(-e%4294967296),i=~(-e/4294967296),4294967295^r?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");var n,a;t.realloc(10),n=r,(a=t).buf[a.pos++]=127&n|128,n>>>=7,a.buf[a.pos++]=127&n|128,n>>>=7,a.buf[a.pos++]=127&n|128,n>>>=7,a.buf[a.pos++]=127&n|128,a.buf[a.pos]=127&(n>>>=7),function(e,t){let r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(i,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))}writeSVarint(e){this.writeVarint(e<0?2*-e-1:2*e)}writeBoolean(e){this.writeVarint(+e)}writeString(e){e=String(e),this.realloc(4*e.length),this.pos++;let t=this.pos;this.pos=function(e,t,r){for(let i,n,a=0;a<t.length;a++){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!n){i>56319||a+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}(this.buf,e,this.pos);let r=this.pos-t;r>=128&&AA(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r}writeFloat(e){this.realloc(4),this.dataView.setFloat32(this.pos,e,!0),this.pos+=4}writeDouble(e){this.realloc(8),this.dataView.setFloat64(this.pos,e,!0),this.pos+=8}writeBytes(e){let t=e.length;this.writeVarint(t),this.realloc(t);for(let r=0;r<t;r++)this.buf[this.pos++]=e[r]}writeRawMessage(e,t){this.pos++;let r=this.pos;e(t,this);let i=this.pos-r;i>=128&&AA(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i}writeMessage(e,t,r){this.writeTag(e,2),this.writeRawMessage(t,r)}writePackedVarint(e,t){t.length&&this.writeMessage(e,uA,t)}writePackedSVarint(e,t){t.length&&this.writeMessage(e,cA,t)}writePackedBoolean(e,t){t.length&&this.writeMessage(e,fA,t)}writePackedFloat(e,t){t.length&&this.writeMessage(e,dA,t)}writePackedDouble(e,t){t.length&&this.writeMessage(e,pA,t)}writePackedFixed32(e,t){t.length&&this.writeMessage(e,gA,t)}writePackedSFixed32(e,t){t.length&&this.writeMessage(e,mA,t)}writePackedFixed64(e,t){t.length&&this.writeMessage(e,yA,t)}writePackedSFixed64(e,t){t.length&&this.writeMessage(e,_A,t)}writeBytesField(e,t){this.writeTag(e,2),this.writeBytes(t)}writeFixed32Field(e,t){this.writeTag(e,5),this.writeFixed32(t)}writeSFixed32Field(e,t){this.writeTag(e,5),this.writeSFixed32(t)}writeFixed64Field(e,t){this.writeTag(e,1),this.writeFixed64(t)}writeSFixed64Field(e,t){this.writeTag(e,1),this.writeSFixed64(t)}writeVarintField(e,t){this.writeTag(e,0),this.writeVarint(t)}writeSVarintField(e,t){this.writeTag(e,0),this.writeSVarint(t)}writeStringField(e,t){this.writeTag(e,2),this.writeString(t)}writeFloatField(e,t){this.writeTag(e,5),this.writeFloat(t)}writeDoubleField(e,t){this.writeTag(e,1),this.writeDouble(t)}writeBooleanField(e,t){this.writeVarintField(e,+t)}}function AA(e,t,r){let i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(let t=r.pos-1;t>=e;t--)r.buf[t+i]=r.buf[t]}function uA(e,t){for(let r=0;r<e.length;r++)t.writeVarint(e[r])}function cA(e,t){for(let r=0;r<e.length;r++)t.writeSVarint(e[r])}function dA(e,t){for(let r=0;r<e.length;r++)t.writeFloat(e[r])}function pA(e,t){for(let r=0;r<e.length;r++)t.writeDouble(e[r])}function fA(e,t){for(let r=0;r<e.length;r++)t.writeBoolean(e[r])}function gA(e,t){for(let r=0;r<e.length;r++)t.writeFixed32(e[r])}function mA(e,t){for(let r=0;r<e.length;r++)t.writeSFixed32(e[r])}function yA(e,t){for(let r=0;r<e.length;r++)t.writeFixed64(e[r])}function _A(e,t){for(let r=0;r<e.length;r++)t.writeSFixed64(e[r])}function vA(e,t,r){1===e&&r.readMessage(wA,t)}function wA(e,t,r){if(3===e){let{id:e,bitmap:i,width:n,height:a,left:s,top:o,advance:l}=r.readMessage(bA,{});t.push({id:e,bitmap:new dl({width:n+6,height:a+6},i),metrics:{width:n,height:a,left:s,top:o,advance:l}})}}function bA(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function xA(e){let t=0,r=0;for(let i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort(((e,t)=>t.h-e.h));let i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],n=0,a=0;for(let t of e)for(let e=i.length-1;e>=0;e--){let r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,a=Math.max(a,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){let t=i.pop();t&&e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:a,fill:t/(n*a)||0}}class BA{constructor(e,{pixelRatio:t,version:r,stretchX:i,stretchY:n,content:a,textFitWidth:s,textFitHeight:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=n,this.content=a,this.version=r,this.textFitWidth=s,this.textFitHeight=o}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class CA{constructor(e,t){let r={},i={};this.haveRenderCallbacks=[];let n=[];this.addImages(e,r,n),this.addImages(t,i,n);let{w:a,h:s}=xA(n),o=new pl({width:a||1,height:s||1});for(let t in e){let i=e[t],n=r[t].paddedRect;pl.copy(i.data,o,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(let e in t){let r=t[e],n=i[e].paddedRect,a=n.x+1,s=n.y+1,l=r.data.width,h=r.data.height;pl.copy(r.data,o,{x:0,y:0},{x:a,y:s},r.data),pl.copy(r.data,o,{x:0,y:h-1},{x:a,y:s-1},{width:l,height:1}),pl.copy(r.data,o,{x:0,y:0},{x:a,y:s+h},{width:l,height:1}),pl.copy(r.data,o,{x:l-1,y:0},{x:a-1,y:s},{width:1,height:h}),pl.copy(r.data,o,{x:0,y:0},{x:a+l,y:s},{width:1,height:h})}this.image=o,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(let i in e){let n=e[i],a={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(a),t[i]=new BA(a,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(let r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t||e.version===t.version)return;e.version=t.version;let[i,n]=e.tl;r.update(t.data,void 0,{x:i,y:n})}}var SA;oa("ImagePosition",BA),oa("ImageAtlas",CA),e.ao=void 0,(SA=e.ao||(e.ao={}))[SA.none=0]="none",SA[SA.horizontal=1]="horizontal",SA[SA.vertical=2]="vertical",SA[SA.horizontalOnly=3]="horizontalOnly";class EA{constructor(){this.scale=1,this.fontStack="",this.imageName=null,this.verticalAlign="bottom"}static forText(e,t,r){let i=new EA;return i.scale=e||1,i.fontStack=t,i.verticalAlign=r||"bottom",i}static forImage(e,t){let r=new EA;return r.imageName=e,r.verticalAlign=t||"bottom",r}}class IA{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){let r=new IA;for(let i=0;i<e.sections.length;i++){let n=e.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t="";for(let r=0;r<e.length;r++){let i=e.charCodeAt(r+1)||null,n=e.charCodeAt(r-1)||null;t+=i&&ba(i)&&!nA[e[r+1]]||n&&ba(n)&&!nA[e[r-1]]||!nA[e[r]]?e[r]:nA[e[r]]}return t}(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&FA[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&FA[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){let r=new IA;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}getMaxImageSize(e){let t=0,r=0;for(let i=0;i<this.length();i++){let n=this.getSection(i);if(n.imageName){let i=e[n.imageName];if(!i)continue;let a=i.displaySize;t=Math.max(t,a[0]),r=Math.max(r,a[1])}}return{maxImageWidth:t,maxImageHeight:r}}addTextSection(e,t){this.text+=e.text,this.sections.push(EA.forText(e.scale,e.fontStack||t,e.verticalAlign));let r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){let t=e.image?e.image.name:"";if(0===t.length)return void V("Can't add FormattedSection with an empty image.");let r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(EA.forImage(t,e.verticalAlign)),this.sectionIndex.push(this.sections.length-1)):V("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function TA(t,r,i,n,a,s,o,l,h,A,u,c,d,p,f){let g,m=IA.fromFeature(t,a);c===e.ao.vertical&&m.verticalizePunctuation();let{processBidirectionalText:y,processStyledBidirectionalText:_}=Ea;if(y&&1===m.sections.length){g=[];let e=y(m.toString(),NA(m,A,s,r,n,p));for(let t of e){let e=new IA;e.text=t,e.sections=m.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);g.push(e)}}else if(_){g=[];let e=_(m.text,m.sectionIndex,NA(m,A,s,r,n,p));for(let t of e){let e=new IA;e.text=t[0],e.sectionIndex=t[1],e.sections=m.sections,g.push(e)}}else g=function(e,t){let r=[],i=e.text,n=0;for(let i of t)r.push(e.substring(n,i)),n=i;return n<i.length&&r.push(e.substring(n,i.length)),r}(m,NA(m,A,s,r,n,p));let v=[],w={positionedLines:v,text:m.toString(),top:u[1],bottom:u[1],left:u[0],right:u[0],writingMode:c,iconsInText:!1,verticalizable:!1};return function(e,t,r,i,n,a,s,o,l,h,A,u){let c=0,d=0,p=0,f=0,g="right"===o?1:"left"===o?0:.5,m=aA/u,y=0;for(let s of n){s.trim();let n=s.getMaxScale(),o={positionedGlyphs:[],lineOffset:0};e.positionedLines[y]=o;let u=o.positionedGlyphs,_=0;if(!s.length()){d+=a,++y;continue}let v=QA(i,s,m);for(let a=0;a<s.length();a++){let o,p=s.getSection(a),f=s.getSectionIndex(a),g=s.getCharCode(a),y=HA(l,A,g);if(p.imageName){if(e.iconsInText=!0,p.scale=p.scale*m,o=VA(p,y,n,v,i),!o)continue;_=Math.max(_,o.imageOffset)}else if(o=jA(p,g,y,v,t,r),!o)continue;let{rect:w,metrics:b,baselineOffset:x}=o;u.push({glyph:g,imageName:p.imageName,x:c,y:d+x+-17,vertical:y,scale:p.scale,fontStack:p.fontStack,sectionIndex:f,metrics:b,rect:w}),y?(e.verticalizable=!0,c+=(p.imageName?b.advance:aA)*p.scale+h):c+=b.advance*p.scale+h}0!==u.length&&(p=Math.max(c-h,p),GA(u,0,u.length-1,g)),c=0,o.lineOffset=Math.max(_,(n-1)*aA);let w=a*n+_;d+=w,f=Math.max(w,f),++y}let{horizontalAlign:_,verticalAlign:v}=OA(s);(function(e,t,r,i,n,a,s,o,l){let h=(t-r)*n,A=0;A=a!==s?-o*i- -17:-i*l*s+.5*s;for(let t of e)for(let e of t.positionedGlyphs)e.x+=h,e.y+=A})(e.positionedLines,g,_,v,p,f,a,d,n.length),e.top+=-v*d,e.bottom=e.top+d,e.left+=-_*p,e.right=e.left+p}(w,r,i,n,g,o,l,h,c,A,d,f),!function(e){for(let t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(v)&&w}let FA={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},PA={10:!0,32:!0,38:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0},LA={40:!0};function MA(e,t,r,i,n,a){if(t.imageName){let e=i[t.imageName];return e?e.displaySize[0]*t.scale*aA/a+n:0}{let i=r[t.fontStack],a=i&&i[e];return a?a.metrics.advance*t.scale+n:0}}function kA(e,t,r,i){let n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function UA(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),40!==e&&65288!==e||(i+=50),41!==t&&65289!==t||(i+=50),i}function RA(e,t,r,i,n,a){let s=null,o=kA(t,r,n,a);for(let e of i){let i=kA(t-e.x,r,n,a)+e.badness;i<=o&&(s=e,o=i)}return{index:e,x:t,priorBreak:s,badness:o}}function DA(e){return e?DA(e.priorBreak).concat(e.index):[]}function NA(e,t,r,i,n,a){if(!e)return[];let s=[],o=function(e,t,r,i,n,a){let s=0;for(let r=0;r<e.length();r++){let o=e.getSection(r);s+=MA(e.getCharCode(r),o,i,n,t,a)}return s/Math.max(1,Math.ceil(s/r))}(e,t,r,i,n,a),l=e.text.indexOf("​")>=0,h=0;for(let r=0;r<e.length();r++){let u=e.getSection(r),c=e.getCharCode(r);if(FA[c]||(h+=MA(c,u,i,n,t,a)),r<e.length()-1){let t=!((A=c)<11904)&&(!!pa["CJK Compatibility Forms"](A)||!!pa["CJK Compatibility"](A)||!!pa["CJK Strokes"](A)||!!pa["CJK Symbols and Punctuation"](A)||!!pa["Enclosed CJK Letters and Months"](A)||!!pa["Halfwidth and Fullwidth Forms"](A)||!!pa["Ideographic Description Characters"](A)||!!pa["Vertical Forms"](A)||va.test(String.fromCodePoint(A)));(PA[c]||t||u.imageName||r!==e.length()-2&&LA[e.getCharCode(r+1)])&&s.push(RA(r+1,h,o,s,UA(c,e.getCharCode(r+1),t&&l),!1))}}var A;return DA(RA(e.length(),h,o,s,0,!0))}function OA(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function QA(e,t,r){let i=t.getMaxScale()*aA,{maxImageWidth:n,maxImageHeight:a}=t.getMaxImageSize(e),s=Math.max(i,a*r);return{verticalLineContentWidth:Math.max(i,n*r),horizontalLineContentHeight:s}}function zA(e){switch(e){case"top":return 0;case"center":return.5;default:return 1}}function HA(t,r,i){return!(t===e.ao.horizontal||!r&&!wa(i)||r&&(FA[i]||(n=i,/\p{sc=Arab}/u.test(String.fromCodePoint(n)))));var n}function jA(e,t,r,i,n,a){let s,o=a[e.fontStack],l=function(e,t,r,i){if(e&&e.rect)return e;let n=t[r.fontStack],a=n&&n[i];return a?{rect:null,metrics:a.metrics}:null}(o&&o[t],n,e,t);if(null===l)return null;if(r)s=i.verticalLineContentWidth-e.scale*aA;else{let t=zA(e.verticalAlign);s=(i.horizontalLineContentHeight-e.scale*aA)*t}return{rect:l.rect,metrics:l.metrics,baselineOffset:s}}function VA(e,t,r,i,n){let a=n[e.imageName];if(!a)return null;let s,o=a.paddedRect,l=a.displaySize,h={width:l[0],height:l[1],left:1,top:-3,advance:t?l[1]:l[0]};if(t)s=i.verticalLineContentWidth-l[1]*e.scale;else{let t=zA(e.verticalAlign);s=(i.horizontalLineContentHeight-l[1]*e.scale)*t}return{rect:o,metrics:h,baselineOffset:s,imageOffset:(t?l[0]:l[1])*e.scale-aA*r}}function GA(e,t,r,i){if(0===i)return;let n=e[r],a=(e[r].x+n.metrics.advance*n.scale)*i;for(let i=t;i<=r;i++)e[i].x-=a}function KA(e,t,r){let{horizontalAlign:i,verticalAlign:n}=OA(r),a=t[0]-e.displaySize[0]*i,s=t[1]-e.displaySize[1]*n;return{image:e,top:s,bottom:s+e.displaySize[1],left:a,right:a+e.displaySize[0]}}function qA(e){var t,r;let i=e.left,n=e.top,a=e.right-i,s=e.bottom-n,o=null!==(t=e.image.textFitWidth)&&void 0!==t?t:"stretchOrShrink",l=null!==(r=e.image.textFitHeight)&&void 0!==r?r:"stretchOrShrink",h=(e.image.content[2]-e.image.content[0])/(e.image.content[3]-e.image.content[1]);if("proportional"===l){if("stretchOnly"===o&&a/s<h||"proportional"===o){let e=Math.ceil(s*h);i*=e/a,a=e}}else if("proportional"===o&&"stretchOnly"===l&&0!==h&&a/s>h){let e=Math.ceil(a/h);n*=e/s,s=e}return{x1:i,y1:n,x2:i+a,y2:n+s}}function ZA(e,t,r,i,n,a){let s,o=e.image;if(o.content){let e=o.content,t=o.pixelRatio||1;s=[e[0]/t,e[1]/t,o.displaySize[0]-e[2]/t,o.displaySize[1]-e[3]/t]}let l,h,A,u,c=t.left*a,d=t.right*a;"width"===r||"both"===r?(u=n[0]+c-i[3],h=n[0]+d+i[1]):(u=n[0]+(c+d-o.displaySize[0])/2,h=u+o.displaySize[0]);let p=t.top*a,f=t.bottom*a;return"height"===r||"both"===r?(l=n[1]+p-i[0],A=n[1]+f+i[2]):(l=n[1]+(p+f-o.displaySize[1])/2,A=l+o.displaySize[1]),{image:o,top:l,right:h,bottom:A,left:u,collisionPadding:s}}let WA=128,$A=32640;function XA(e,t){let{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Ia(e+1))};if("source"===r.kind)return{kind:"source"};{let{zoomStops:t,interpolationType:i}=r,n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let a=n;for(;a<t.length&&t[a]<e+1;)a++;a=Math.min(t.length-1,a);let s=t[n],o=t[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:o,interpolationType:i}:{kind:"camera",minZoom:s,maxZoom:o,minSize:r.evaluate(new Ia(s)),maxSize:r.evaluate(new Ia(o)),interpolationType:i}}}function YA(e,t,r){let i="never",n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}let JA,eu,tu=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ru(e,t,r,i,n,a,s,o,l,h,A,u,c){let d=o?Math.min($A,Math.round(o[0])):0,p=o?Math.min($A,Math.round(o[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),a,s,(d<<1)+(l?1:0),p,16*h,16*A,256*u,256*c)}function iu(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function nu(e){for(let t of e.sections)if(Sa(t.text))return!0;return!1}class au{constructor(e){this.layoutVertexArray=new zs,this.indexArray=new Ks,this.programConfigurations=e,this.segments=new $s,this.dynamicLayoutVertexArray=new Hs,this.opacityVertexArray=new js,this.hasVisibleVertices=!1,this.placedSymbolArray=new Bs}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yh.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,Jh.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,tu,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}oa("SymbolBuffers",au);class su{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new $s,this.collisionVertexArray=new Gs}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,eA.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}oa("CollisionBuffers",su);class ou{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasDependencies=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[];let r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=XA(this.zoom,r["text-size"]),this.iconSizeData=XA(this.zoom,r["icon-size"]);let i=this.layers[0].layout,n=i.get("symbol-sort-key"),a=i.get("symbol-z-order");this.canOverlap="never"!==YA(i,"text-overlap","text-allow-overlap")||"never"!==YA(i,"icon-overlap","icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==a&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===a||"auto"===a&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((t=>e.ao[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new au(new Eo(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new au(new Eo(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Es,this.lineVertexArray=new Is,this.symbolInstances=new Ss,this.textAnchorOffsets=new Fs}calculateGlyphDependencies(e,t,r,i,n){for(let a=0;a<e.length;a++)if(t[e.charCodeAt(a)]=!0,(r||i)&&n){let r=nA[e.charAt(a)];r&&(t[r.charCodeAt(0)]=!0)}}populate(t,r,i){let n=this.layers[0],a=n.layout,s=a.get("text-font"),o=a.get("text-field"),l=a.get("icon-image"),h=("constant"!==o.value.kind||o.value.value instanceof Ft&&!o.value.value.isEmpty()||o.value.value.toString().length>0)&&("constant"!==s.value.kind||s.value.value.length>0),A="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,u=a.get("symbol-sort-key");if(this.features=[],!h&&!A)return;let c=r.iconDependencies,d=r.glyphDependencies,p=r.availableImages,f=new Ia(this.zoom);for(let{feature:r,id:o,index:l,sourceLayerIndex:g}of t){let t,m,y=n._featureFilter.needGeometry,_=Mo(r,y);if(!n._featureFilter.filter(f,_,i))continue;if(y||(_.geometry=Lo(r)),h){let e=n.getValueAndResolveTokens("text-field",_,i,p),r=Ft.factory(e),a=this.hasRTLText=this.hasRTLText||nu(r);(!a||"unavailable"===Ea.getRTLTextPluginStatus()||a&&Ea.isParsed())&&(t=iA(r,n,_))}if(A){let e=n.getValueAndResolveTokens("icon-image",_,i,p);m=e instanceof Dt?e:Dt.fromString(e)}if(!t&&!m)continue;let v=this.sortFeaturesByKey?u.evaluate(_,{},i):void 0;if(this.features.push({id:o,text:t,icon:m,index:l,sourceLayerIndex:g,geometry:_.geometry,properties:r.properties,type:vh.types[r.type],sortKey:v}),m&&(c[m.name]=!0),t){let r=s.evaluate(_,{},i).join(","),n="viewport"!==a.get("text-rotation-alignment")&&"point"!==a.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.ao.vertical)>=0;for(let e of t.sections)if(e.image)c[e.image.name]=!0;else{let i=fa(t.toString()),a=e.fontStack||r,s=d[a]=d[a]||{};this.calculateGlyphDependencies(e.text,s,n,this.allowVerticalPlacement,i)}}}"line"===a.get("symbol-placement")&&(this.features=function(e){let t={},r={},i=[],n=0;function a(t){i.push(e[t]),n++}function s(e,t,n){let a=r[e];return delete r[e],r[t]=a,i[a].geometry[0].pop(),i[a].geometry[0]=i[a].geometry[0].concat(n[0]),a}function o(e,r,n){let a=t[r];return delete t[r],t[e]=a,i[a].geometry[0].shift(),i[a].geometry[0]=n[0].concat(i[a].geometry[0]),a}function l(e,t,r){let i=r?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let h=0;h<e.length;h++){let A=e[h],u=A.geometry,c=A.text?A.text.toString():null;if(!c){a(h);continue}let d=l(c,u),p=l(c,u,!0);if(d in r&&p in t&&r[d]!==t[p]){let e=o(d,p,u),n=s(d,p,i[e].geometry);delete t[d],delete r[p],r[l(c,i[n].geometry,!0)]=n,i[e].geometry=null}else d in r?s(d,p,u):p in t?o(d,p,u):(a(h),t[d]=n-1,r[p]=n-1)}return i.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,{imagePositions:r}))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){let r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]),n={};for(let i=e.segment+1;i<t.length;i++)n[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i<t.length-1&&(r+=t[i+1].dist(t[i]));for(let r=e.segment||0;r>=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){let t=n[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,r,i,n,a,s,o,l,h,A,u,c){let d=t.indexArray,p=t.layoutVertexArray,f=t.segments.prepareSegment(4*r.length,p,d,this.canOverlap?s.sortKey:void 0),g=this.glyphOffsetArray.length,m=f.vertexLength,y=this.allowVerticalPlacement&&o===e.ao.vertical?Math.PI/2:0,_=s.text&&s.text.sections;for(let e=0;e<r.length;e++){let{tl:n,tr:a,bl:o,br:h,tex:A,pixelOffsetTL:u,pixelOffsetBR:g,minFontScaleX:m,minFontScaleY:v,glyphOffset:w,isSDF:b,sectionIndex:x}=r[e],B=f.vertexLength,C=w[1];ru(p,l.x,l.y,n.x,C+n.y,A.x,A.y,i,b,u.x,u.y,m,v),ru(p,l.x,l.y,a.x,C+a.y,A.x+A.w,A.y,i,b,g.x,u.y,m,v),ru(p,l.x,l.y,o.x,C+o.y,A.x,A.y+A.h,i,b,u.x,g.y,m,v),ru(p,l.x,l.y,h.x,C+h.y,A.x+A.w,A.y+A.h,i,b,g.x,g.y,m,v),iu(t.dynamicLayoutVertexArray,l,y),d.emplaceBack(B,B+2,B+1),d.emplaceBack(B+1,B+2,B+3),f.vertexLength+=4,f.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(w[0]),e!==r.length-1&&x===r[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(p.length,s,s.index,{imagePositions:{},canonical:c,formattedSection:_&&_[x]})}t.placedSymbolArray.emplaceBack(l.x,l.y,g,this.glyphOffsetArray.length-g,m,h,A,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],o,0,!1,0,u)}_addCollisionDebugVertex(e,t,r,i,n,a){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(a.x),Math.round(a.y))}addCollisionDebugVertices(e,t,i,n,a,s,o){let l=a.segments.prepareSegment(4,a.layoutVertexArray,a.indexArray),h=l.vertexLength,A=a.layoutVertexArray,u=a.collisionVertexArray,c=o.anchorX,d=o.anchorY;this._addCollisionDebugVertex(A,u,s,c,d,new r(e,t)),this._addCollisionDebugVertex(A,u,s,c,d,new r(i,t)),this._addCollisionDebugVertex(A,u,s,c,d,new r(i,n)),this._addCollisionDebugVertex(A,u,s,c,d,new r(e,n)),l.vertexLength+=4;let p=a.indexArray;p.emplaceBack(h,h+1),p.emplaceBack(h+1,h+2),p.emplaceBack(h+2,h+3),p.emplaceBack(h+3,h),l.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){let e=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,i?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new su(Vs,tA.members,qs),this.iconCollisionBox=new su(Vs,tA.members,qs);for(let e=0;e<this.symbolInstances.length;e++){let t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,a,s,o,l){let h={};for(let i=t;i<r;i++){let t=e.get(i);h.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},h.textFeatureIndex=t.featureIndex;break}for(let t=i;t<n;t++){let r=e.get(t);h.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},h.verticalTextFeatureIndex=r.featureIndex;break}for(let t=a;t<s;t++){let r=e.get(t);h.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},h.iconFeatureIndex=r.featureIndex;break}for(let t=o;t<l;t++){let r=e.get(t);h.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},h.verticalIconFeatureIndex=r.featureIndex;break}return h}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){let r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){let r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+2,t+1),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;let t=Math.sin(e),r=Math.cos(e),i=[],n=[],a=[];for(let e=0;e<this.symbolInstances.length;++e){a.push(e);let s=this.symbolInstances.get(e);i.push(0|Math.round(t*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return a.sort(((e,t)=>i[e]-i[t]||n[t]-n[e])),a}addToSortKeyRanges(e,t){let r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(let e of this.symbolInstanceIndexes){let t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}oa("SymbolBucket",ou,{omit:["layers","collisionBoxArray","features","compareText"]}),ou.MAX_GLYPHS=65535,ou.addDynamicAttributes=iu;var lu={get paint(){return eu=eu||new ja({"icon-opacity":new Oa(ye.paint_symbol["icon-opacity"]),"icon-color":new Oa(ye.paint_symbol["icon-color"]),"icon-halo-color":new Oa(ye.paint_symbol["icon-halo-color"]),"icon-halo-width":new Oa(ye.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Oa(ye.paint_symbol["icon-halo-blur"]),"icon-translate":new Na(ye.paint_symbol["icon-translate"]),"icon-translate-anchor":new Na(ye.paint_symbol["icon-translate-anchor"]),"text-opacity":new Oa(ye.paint_symbol["text-opacity"]),"text-color":new Oa(ye.paint_symbol["text-color"],{runtimeType:Ne,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new Oa(ye.paint_symbol["text-halo-color"]),"text-halo-width":new Oa(ye.paint_symbol["text-halo-width"]),"text-halo-blur":new Oa(ye.paint_symbol["text-halo-blur"]),"text-translate":new Na(ye.paint_symbol["text-translate"]),"text-translate-anchor":new Na(ye.paint_symbol["text-translate-anchor"])})},get layout(){return JA=JA||new ja({"symbol-placement":new Na(ye.layout_symbol["symbol-placement"]),"symbol-spacing":new Na(ye.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Na(ye.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Oa(ye.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Na(ye.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Na(ye.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Na(ye.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Na(ye.layout_symbol["icon-ignore-placement"]),"icon-optional":new Na(ye.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Na(ye.layout_symbol["icon-rotation-alignment"]),"icon-size":new Oa(ye.layout_symbol["icon-size"]),"icon-text-fit":new Na(ye.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Na(ye.layout_symbol["icon-text-fit-padding"]),"icon-image":new Oa(ye.layout_symbol["icon-image"]),"icon-rotate":new Oa(ye.layout_symbol["icon-rotate"]),"icon-padding":new Oa(ye.layout_symbol["icon-padding"]),"icon-keep-upright":new Na(ye.layout_symbol["icon-keep-upright"]),"icon-offset":new Oa(ye.layout_symbol["icon-offset"]),"icon-anchor":new Oa(ye.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Na(ye.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Na(ye.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Na(ye.layout_symbol["text-rotation-alignment"]),"text-field":new Oa(ye.layout_symbol["text-field"]),"text-font":new Oa(ye.layout_symbol["text-font"]),"text-size":new Oa(ye.layout_symbol["text-size"]),"text-max-width":new Oa(ye.layout_symbol["text-max-width"]),"text-line-height":new Na(ye.layout_symbol["text-line-height"]),"text-letter-spacing":new Oa(ye.layout_symbol["text-letter-spacing"]),"text-justify":new Oa(ye.layout_symbol["text-justify"]),"text-radial-offset":new Oa(ye.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Na(ye.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Oa(ye.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Oa(ye.layout_symbol["text-anchor"]),"text-max-angle":new Na(ye.layout_symbol["text-max-angle"]),"text-writing-mode":new Na(ye.layout_symbol["text-writing-mode"]),"text-rotate":new Oa(ye.layout_symbol["text-rotate"]),"text-padding":new Na(ye.layout_symbol["text-padding"]),"text-keep-upright":new Na(ye.layout_symbol["text-keep-upright"]),"text-transform":new Oa(ye.layout_symbol["text-transform"]),"text-offset":new Oa(ye.layout_symbol["text-offset"]),"text-allow-overlap":new Na(ye.layout_symbol["text-allow-overlap"]),"text-overlap":new Na(ye.layout_symbol["text-overlap"]),"text-ignore-placement":new Na(ye.layout_symbol["text-ignore-placement"]),"text-optional":new Na(ye.layout_symbol["text-optional"])})}};class hu{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:ke,this.defaultValue=e}evaluate(e){if(e.formattedSection){let t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}oa("FormatSectionOverride",hu,{omit:["defaultValue"]});class Au extends Ga{constructor(e,t){super(e,lu,t)}recalculate(e,t){if(super.recalculate(e,t),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement")){let e=this.layout.get("text-writing-mode");if(e){let t=[];for(let r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){let n=this.layout.get(e).evaluate(t,{},r,i),a=this._unevaluatedLayout._values[e];return a.isDataDriven()||en(a.value)||!n?n:(s=t.properties,n.replace(/{([^{}]+)}/g,((e,t)=>s&&t in s?String(s[t]):"")));var s}createBucket(e){return new ou(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(let e of lu.paint.overridableProperties){if(!Au.hasPaintOverride(this.layout,e))continue;let t=this.paint.get(e),r=new hu(t),i=new Ji(r,t.property.specification),n=null;n="constant"===t.value.kind||"source"===t.value.kind?new rn("source",i):new nn("composite",i,t.value.zoomStops),this.paint._values[e]=new Ra(t.property,n,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&Au.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){let r=e.get("text-field"),i=lu.paint.properties[t],n=!1,a=e=>{for(let t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(n=!0)};if("constant"===r.value.kind&&r.value.value instanceof Ft)a(r.value.value.sections);else if("source"===r.value.kind||"composite"===r.value.kind){let e=t=>{n||(t instanceof jt&&zt(t.value)===je?a(t.value.sections):t instanceof Er?a(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}}let uu;var cu={get paint(){return uu=uu||new ja({"background-color":new Na(ye.paint_background["background-color"]),"background-pattern":new za(ye.paint_background["background-pattern"]),"background-opacity":new Na(ye.paint_background["background-opacity"])})}};class du extends Ga{constructor(e,t){super(e,cu,t)}}let pu;var fu={get paint(){return pu=pu||new ja({"raster-opacity":new Na(ye.paint_raster["raster-opacity"]),"raster-hue-rotate":new Na(ye.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Na(ye.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Na(ye.paint_raster["raster-brightness-max"]),"raster-saturation":new Na(ye.paint_raster["raster-saturation"]),"raster-contrast":new Na(ye.paint_raster["raster-contrast"]),"raster-resampling":new Na(ye.paint_raster["raster-resampling"]),"raster-fade-duration":new Na(ye.paint_raster["raster-fade-duration"])})}};class gu extends Ga{constructor(e,t){super(e,fu,t)}}class mu extends Ga{constructor(e,t){super(e,{},t),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class yu{constructor(e){this._methodToThrottle=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._methodToThrottle()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._methodToThrottle()}),0))}remove(){delete this._channel,this._methodToThrottle=()=>{}}}let _u={once:!0},vu=6371008.8;class wu{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new wu(D(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){let t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return vu*Math.acos(Math.min(n,1))}static convert(e){if(e instanceof wu)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new wu(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new wu(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}let bu=2*Math.PI*vu;function xu(e){return bu*Math.cos(e*Math.PI/180)}function Bu(e){return(180+e)/360}function Cu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Su(e,t){return e/xu(t)}function Eu(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}function Iu(e,t){return e*xu(Eu(t))}class Tu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){let r=wu.convert(e);return new Tu(Bu(r.lng),Cu(r.lat),Su(t,r.lat))}toLngLat(){return new wu(360*this.x-180,Eu(this.y))}toAltitude(){return Iu(this.z,this.y)}meterInMercatorCoordinateUnits(){return 1/bu*(e=Eu(this.y),1/Math.cos(e*Math.PI/180));var e}}function Fu(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}class Pu{constructor(e,t,r){if(n=t,a=r,(i=e)<0||i>25||a<0||a>=Math.pow(2,i)||n<0||n>=Math.pow(2,i))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);var i,n,a;this.z=e,this.x=t,this.y=r,this.key=ku(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){let i=(a=this.y,s=this.z,o=Fu(256*(n=this.x),256*(a=Math.pow(2,s)-a-1),s),l=Fu(256*(n+1),256*(a+1),s),o[0]+","+o[1]+","+l[0]+","+l[1]);var n,a,s,o,l;let h=function(e,t,r){let i,n="";for(let a=e;a>0;a--)i=1<<a-1,n+=(t&i?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,h).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){let t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){let t=Math.pow(2,this.z);return new r((e.x*t-this.x)*T,(e.y*t-this.y)*T)}toString(){return`${this.z}/${this.x}/${this.y}`}}class Lu{constructor(e,t){this.wrap=e,this.canonical=t,this.key=ku(e,t.z,t.z,t.x,t.y)}}class Mu{constructor(e,t,r,i,n){if(this.terrainRttPosMatrix32f=null,e<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new Pu(r,+i,+n),this.key=ku(t,e,r,i,n)}clone(){return new Mu(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let t=this.canonical.z-e;return e>this.canonical.z?new Mu(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Mu(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}isOverscaled(){return this.overscaledZ>this.canonical.z}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);let r=this.canonical.z-e;return e>this.canonical.z?ku(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):ku(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap||this.overscaledZ-e.overscaledZ<=0)return!1;if(0===e.overscaledZ)return this.overscaledZ>0;let t=this.canonical.z-e.canonical.z;return!(t<0)&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new Mu(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];let t=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new Mu(t,this.wrap,t,r,i),new Mu(t,this.wrap,t,r+1,i),new Mu(t,this.wrap,t,r,i+1),new Mu(t,this.wrap,t,r+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new Mu(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new Mu(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new Lu(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new Tu(e.x-this.wrap,e.y))}}function ku(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);let a=1<<r;return(a*a*e+a*n+i).toString(36)+r.toString(36)+t.toString(36)}function Uu(e,t){return t?e.properties[t]:e.id}oa("CanonicalTileID",Pu),oa("OverscaledTileID",Mu,{omit:["terrainRttPosMatrix32f"]});class Ru{constructor(){this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0}extend(e){return this.minX=Math.min(this.minX,e.x),this.minY=Math.min(this.minY,e.y),this.maxX=Math.max(this.maxX,e.x),this.maxY=Math.max(this.maxY,e.y),this}expandBy(e){return this.minX-=e,this.minY-=e,this.maxX+=e,this.maxY+=e,(this.minX>this.maxX||this.minY>this.maxY)&&(this.minX=1/0,this.maxX=-1/0,this.minY=1/0,this.maxY=-1/0),this}shrinkBy(e){return this.expandBy(-e)}map(e){let t=new Ru;return t.extend(e(new r(this.minX,this.minY))),t.extend(e(new r(this.maxX,this.minY))),t.extend(e(new r(this.minX,this.maxY))),t.extend(e(new r(this.maxX,this.maxY))),t}static fromPoints(e){let t=new Ru;for(let r of e)t.extend(r);return t}contains(e){return e.x>=this.minX&&e.x<=this.maxX&&e.y>=this.minY&&e.y<=this.maxY}empty(){return this.minX>this.maxX}width(){return this.maxX-this.minX}height(){return this.maxY-this.minY}covers(e){return!this.empty()&&!e.empty()&&e.minX>=this.minX&&e.maxX<=this.maxX&&e.minY>=this.minY&&e.maxY<=this.maxY}intersects(e){return!this.empty()&&!e.empty()&&e.minX<=this.maxX&&e.maxX>=this.minX&&e.minY<=this.maxY&&e.maxY>=this.minY}}class Du{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){let r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class Nu{constructor(e,t,r,i,n){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=i,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){let e={geometry:this.geometry};for(let t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class Ou{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new aa(T,16,0),this.grid3D=new aa(T,16,0),this.featureIndexArray=new Ls,this.promoteId=t}insert(e,t,r,i,n,a){let s=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);let o=a?this.grid3D:this.grid;for(let e=0;e<t.length;e++){let r=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){let t=r[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}i[0]<T&&i[1]<T&&i[2]>=0&&i[3]>=0&&o.insert(s,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ch(new hA(this.rawTileData)).layers,this.sourceLayerCoder=new Du(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,i,n){this.loadVTLayers();let a=e.params,s=T/e.tileSize/e.scale,o=cn(a.filter,a.globalState),l=e.queryGeometry,h=e.queryPadding*s,A=Ru.fromPoints(l),u=this.grid.query(A.minX-h,A.minY-h,A.maxX+h,A.maxY+h),c=Ru.fromPoints(e.cameraQueryGeometry).expandBy(h),d=this.grid3D.query(c.minX,c.minY,c.maxX,c.maxY,((t,i,n,a)=>function(e,t,i,n,a){for(let r of e)if(t<=r.x&&i<=r.y&&n>=r.x&&a>=r.y)return!0;let s=[new r(t,i),new r(t,a),new r(n,a),new r(n,i)];if(e.length>2)for(let t of s)if(Zo(e,t))return!0;for(let t=0;t<e.length-1;t++)if(Wo(e[t],e[t+1],s))return!0;return!1}(e.cameraQueryGeometry,t-h,i-h,n+h,a+h)));for(let e of d)u.push(e);u.sort(zu);let p,f={};for(let r=0;r<u.length;r++){let h=u[r];if(h===p)continue;p=h;let A=this.featureIndexArray.get(h),c=null;this.loadMatchingFeature(f,A.bucketIndex,A.sourceLayerIndex,A.featureIndex,o,a.layers,a.availableImages,t,i,n,((t,r,i)=>(c||(c=Lo(t)),r.queryIntersectsFeature({queryGeometry:l,feature:t,featureState:i,geometry:c,zoom:this.z,transform:e.transform,pixelsToTileUnits:s,pixelPosMatrix:e.pixelPosMatrix,unwrappedTileID:this.tileID.toUnwrapped(),getElevation:e.getElevation}))))}return f}loadMatchingFeature(e,t,r,i,n,a,s,o,l,h,A){let u=this.bucketLayerIDs[t];if(a&&!u.some((e=>a.has(e))))return;let c=this.sourceLayerCoder.decode(r),d=this.vtLayers[c].feature(i);if(n.needGeometry){let e=Mo(d,!0);if(!n.filter(new Ia(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Ia(this.tileID.overscaledZ),d))return;let p=this.getId(d,c);for(let t=0;t<u.length;t++){let r=u[t];if(a&&!a.has(r))continue;let n=o[r];if(!n)continue;let c={};p&&h&&(c=h.getState(n.sourceLayer||"_geojsonTileLayer",p));let f=N({},l[r]);f.paint=Qu(f.paint,n.paint,d,c,s),f.layout=Qu(f.layout,n.layout,d,c,s);let g=!A||A(d,n,c);if(!g)continue;let m=new Nu(d,this.z,this.x,this.y,p);m.layer=f;let y=e[r];void 0===y&&(y=e[r]=[]),y.push({featureIndex:i,feature:m,intersectionZ:g})}}lookupSymbolFeatures(e,t,r,i,n,a,s,o){let l={};this.loadVTLayers();let h=cn(n.filterSpec,n.globalState);for(let n of e)this.loadMatchingFeature(l,r,i,n,h,a,s,o,t);return l}hasLayer(e){for(let t of this.bucketLayerIDs)for(let r of t)if(e===r)return!0;return!1}getId(e,t){var r;let i=e.id;return this.promoteId&&(i=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]],"boolean"==typeof i&&(i=Number(i)),void 0===i&&!(null===(r=e.properties)||void 0===r)&&r.cluster&&this.promoteId&&(i=Number(e.properties.cluster_id))),i}}function Qu(e,t,r,i,n){return Q(e,((e,a)=>{let s=t instanceof Da?t.get(a):null;return s&&s.evaluate?s.evaluate(r,i,n):s}))}function zu(e,t){return t-e}function Hu(e,t,i,n,a){let s=[];for(let o=0;o<e.length;o++){let l,h=e[o];for(let e=0;e<h.length-1;e++){let o=h[e],A=h[e+1];o.x<t&&A.x<t||(o.x<t?o=new r(t,o.y+(t-o.x)/(A.x-o.x)*(A.y-o.y))._round():A.x<t&&(A=new r(t,o.y+(t-o.x)/(A.x-o.x)*(A.y-o.y))._round()),o.y<i&&A.y<i||(o.y<i?o=new r(o.x+(i-o.y)/(A.y-o.y)*(A.x-o.x),i)._round():A.y<i&&(A=new r(o.x+(i-o.y)/(A.y-o.y)*(A.x-o.x),i)._round()),o.x>=n&&A.x>=n||(o.x>=n?o=new r(n,o.y+(n-o.x)/(A.x-o.x)*(A.y-o.y))._round():A.x>=n&&(A=new r(n,o.y+(n-o.x)/(A.x-o.x)*(A.y-o.y))._round()),o.y>=a&&A.y>=a||(o.y>=a?o=new r(o.x+(a-o.y)/(A.y-o.y)*(A.x-o.x),a)._round():A.y>=a&&(A=new r(o.x+(a-o.y)/(A.y-o.y)*(A.x-o.x),a)._round()),l&&o.equals(l[l.length-1])||(l=[o],s.push(l)),l.push(A)))))}}return s}oa("FeatureIndex",Ou,{omit:["rawTileData","sourceLayerCoder"]});class ju extends r{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new ju(this.x,this.y,this.angle,this.segment)}}function Vu(e,t,r,i,n){if(void 0===t.segment||0===r)return!0;let a=t,s=t.segment+1,o=0;for(;o>-r/2;){if(s--,s<0)return!1;o-=e[s].dist(a),a=e[s]}o+=e[s].dist(e[s+1]),s++;let l=[],h=0;for(;o<r/2;){let t=e[s],r=e[s+1];if(!r)return!1;let a=e[s-1].angleTo(t)-t.angleTo(r);for(a=Math.abs((a+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:o,angleDelta:a}),h+=a;o-l[0].distance>i;)h-=l.shift().angleDelta;if(h>n)return!1;s++,o+=t.dist(r)}return!0}function Gu(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function Ku(e,t,r){return e?.6*t*r:0}function qu(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Zu(e,t,r,i,n,a){let s=Ku(r,n,a),o=qu(r,i)*a,l=0,h=Gu(e)/2;for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1],a=i.dist(n);if(l+a>h){let A=(h-l)/a,u=pr.number(i.x,n.x,A),c=pr.number(i.y,n.y,A),d=new ju(u,c,n.angleTo(i),r);return d._round(),!s||Vu(e,d,o,s,t)?d:void 0}l+=a}}function Wu(e,t,r,i,n,a,s,o,l){let h=Ku(i,a,s),A=qu(i,n),u=A*s,c=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-u<t/4&&(t=u+t/4),$u(e,c?t/2*o%t:(A/2+2*a)*s*o%t,t,h,r,u,c,!1,l)}function $u(e,t,r,i,n,a,s,o,l){let h=a/2,A=Gu(e),u=0,c=t-r,d=[];for(let t=0;t<e.length-1;t++){let s=e[t],o=e[t+1],p=s.dist(o),f=o.angleTo(s);for(;c+r<u+p;){c+=r;let g=(c-u)/p,m=pr.number(s.x,o.x,g),y=pr.number(s.y,o.y,g);if(m>=0&&m<l&&y>=0&&y<l&&c-h>=0&&c+h<=A){let r=new ju(m,y,f,t);r._round(),i&&!Vu(e,r,a,i,n)||d.push(r)}}u+=p}return o||d.length||s||(d=$u(e,u/2,r,i,n,a,s,!0,l)),d}function Xu(e,t,i,n){let a=[],s=e.image,o=s.pixelRatio,l=s.paddedRect.w-2,h=s.paddedRect.h-2,A={x1:e.left,y1:e.top,x2:e.right,y2:e.bottom},u=s.stretchX||[[0,l]],c=s.stretchY||[[0,h]],d=(e,t)=>e+t[1]-t[0],p=u.reduce(d,0),f=c.reduce(d,0),g=l-p,m=h-f,y=0,_=p,v=0,w=f,b=0,x=g,B=0,C=m;if(s.content&&n){let t=s.content,r=t[2]-t[0],i=t[3]-t[1];(s.textFitWidth||s.textFitHeight)&&(A=qA(e)),y=Yu(u,0,t[0]),v=Yu(c,0,t[1]),_=Yu(u,t[0],t[2]),w=Yu(c,t[1],t[3]),b=t[0]-y,B=t[1]-v,x=r-_,C=i-w}let S=A.x1,E=A.y1,I=A.x2-S,T=A.y2-E,F=(e,n,a,l)=>{let h=ec(e.stretch-y,_,I,S),A=tc(e.fixed-b,x,e.stretch,p),u=ec(n.stretch-v,w,T,E),c=tc(n.fixed-B,C,n.stretch,f),d=ec(a.stretch-y,_,I,S),g=tc(a.fixed-b,x,a.stretch,p),m=ec(l.stretch-v,w,T,E),F=tc(l.fixed-B,C,l.stretch,f),P=new r(h,u),L=new r(d,u),M=new r(d,m),k=new r(h,m),U=new r(A/o,c/o),R=new r(g/o,F/o),D=t*Math.PI/180;if(D){let e=Math.sin(D),t=Math.cos(D),r=[t,-e,e,t];P._matMult(r),L._matMult(r),k._matMult(r),M._matMult(r)}let N=e.stretch+e.fixed,O=n.stretch+n.fixed;return{tl:P,tr:L,bl:k,br:M,tex:{x:s.paddedRect.x+1+N,y:s.paddedRect.y+1+O,w:a.stretch+a.fixed-N,h:l.stretch+l.fixed-O},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:U,pixelOffsetBR:R,minFontScaleX:x/o/I,minFontScaleY:C/o/T,isSDF:i}};if(n&&(s.stretchX||s.stretchY)){let e=Ju(u,g,p),t=Ju(c,m,f);for(let r=0;r<e.length-1;r++){let i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++)a.push(F(i,t[e],n,t[e+1]))}}else a.push(F({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:l+1},{fixed:0,stretch:h+1}));return a}function Yu(e,t,r){let i=0;for(let n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function Ju(e,t,r){let i=[{fixed:-1,stretch:0}];for(let[t,r]of e){let e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+1,stretch:r}),i}function ec(e,t,r,i){return e/t*r+i}function tc(e,t,r,i){return e-t*r/i}oa("Anchor",ju);class rc{constructor(e,t,i,n,a,s,o,l,h,A){var u;if(this.boxStartIndex=e.length,h){let e=s.top,t=s.bottom,r=s.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let h=null!==(u=s.image)&&void 0!==u&&u.content&&(s.image.textFitWidth||s.image.textFitHeight)?qA(s):{x1:s.left,y1:s.top,x2:s.right,y2:s.bottom};h.y1=h.y1*o-l[0],h.y2=h.y2*o+l[2],h.x1=h.x1*o-l[3],h.x2=h.x2*o+l[1];let c=s.collisionPadding;if(c&&(h.x1-=c[0]*o,h.y1-=c[1]*o,h.x2+=c[2]*o,h.y2+=c[3]*o),A){let e=new r(h.x1,h.y1),t=new r(h.x2,h.y1),i=new r(h.x1,h.y2),n=new r(h.x2,h.y2),a=A*Math.PI/180;e._rotate(a),t._rotate(a),i._rotate(a),n._rotate(a),h.x1=Math.min(e.x,t.x,i.x,n.x),h.x2=Math.max(e.x,t.x,i.x,n.x),h.y1=Math.min(e.y,t.y,i.y,n.y),h.y2=Math.max(e.y,t.y,i.y,n.y)}e.emplaceBack(t.x,t.y,h.x1,h.y1,h.x2,h.y2,i,n,a)}this.boxEndIndex=e.length}}class ic{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(0===this.length)return;let e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){let{data:t,compare:r}=this,i=t[e];for(;e>0;){let n=e-1>>1,a=t[n];if(r(i,a)>=0)break;t[e]=a,e=n}t[e]=i}_down(e){let{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=1+(e<<1),a=i+1;if(a<this.length&&r(t[a],t[i])<0&&(i=a),r(t[i],n)>=0)break;t[e]=t[i],e=i}t[e]=n}}function nc(e,t=1,i=!1){let n=Ru.fromPoints(e[0]),a=Math.min(n.width(),n.height()),s=a/2,o=new ic([],ac),{minX:l,minY:h,maxX:A,maxY:u}=n;if(0===a)return new r(l,h);for(let t=l;t<A;t+=a)for(let r=h;r<u;r+=a)o.push(new sc(t+s,r+s,s,e));let c=function(e){let t=0,r=0,i=0,n=e[0];for(let e=0,a=n.length,s=a-1;e<a;s=e++){let a=n[e],o=n[s],l=a.x*o.y-o.x*a.y;r+=(a.x+o.x)*l,i+=(a.y+o.y)*l,t+=3*l}return new sc(r/t,i/t,0,e)}(e),d=o.length;for(;o.length;){let r=o.pop();(r.d>c.d||!c.d)&&(c=r,i&&console.log("found best %d after %d probes",Math.round(1e4*r.d)/1e4,d)),r.max-c.d<=t||(s=r.h/2,o.push(new sc(r.p.x-s,r.p.y-s,s,e)),o.push(new sc(r.p.x+s,r.p.y-s,s,e)),o.push(new sc(r.p.x-s,r.p.y+s,s,e)),o.push(new sc(r.p.x+s,r.p.y+s,s,e)),d+=4)}return i&&(console.log(`num probes: ${d}`),console.log(`best distance: ${c.d}`)),c.p}function ac(e,t){return t.max-e.max}function sc(e,t,i,n){this.p=new r(e,t),this.h=i,this.d=function(e,t){let r=!1,i=1/0;for(let n=0;n<t.length;n++){let a=t[n];for(let t=0,n=a.length,s=n-1;t<n;s=t++){let n=a[t],o=a[s];n.y>e.y!=o.y>e.y&&e.x<(o.x-n.x)*(e.y-n.y)/(o.y-n.y)+n.x&&(r=!r),i=Math.min(i,Ko(e,n,o))}}return(r?1:-1)*Math.sqrt(i)}(this.p,n),this.max=this.d+this.h*Math.SQRT2}var oc;e.aE=void 0,(oc=e.aE||(e.aE={}))[oc.center=1]="center",oc[oc.left=2]="left",oc[oc.right=3]="right",oc[oc.top=4]="top",oc[oc.bottom=5]="bottom",oc[oc["top-left"]=6]="top-left",oc[oc["top-right"]=7]="top-right",oc[oc["bottom-left"]=8]="bottom-left",oc[oc["bottom-right"]=9]="bottom-right";let lc=Number.POSITIVE_INFINITY;function hc(e,t){return t[1]!==lc?function(e,t,r){let i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}(e,t[0],t[1]):function(e,t){let r=0,i=0;t<0&&(t=0);let n=t/Math.SQRT2;switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}(e,t[0])}function Ac(e,t,r){var i;let n=e.layout,a=null===(i=n.get("text-variable-anchor-offset"))||void 0===i?void 0:i.evaluate(t,{},r);if(a){let e=a.values,t=[];for(let r=0;r<e.length;r+=2){let i=t[r]=e[r],n=e[r+1].map((e=>e*aA));i.startsWith("top")?n[1]-=7:i.startsWith("bottom")&&(n[1]+=7),t[r+1]=n}return new Rt(t)}let s=n.get("text-variable-anchor");if(s){let i;i=void 0!==e._unevaluatedLayout.getValue("text-radial-offset")?[n.get("text-radial-offset").evaluate(t,{},r)*aA,lc]:n.get("text-offset").evaluate(t,{},r).map((e=>e*aA));let a=[];for(let e of s)a.push(e,hc(e,i));return new Rt(a)}return null}function uc(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function cc(t,r,i,n,a,s,o,l,h,A,u,c){let d=s.textMaxSize.evaluate(r,{});void 0===d&&(d=o);let p,f=t.layers[0].layout,g=f.get("icon-offset").evaluate(r,{},u),m=pc(i.horizontal),y=o/24,_=t.tilePixelRatio*y,v=t.tilePixelRatio*d/24,w=t.tilePixelRatio*l,b=t.tilePixelRatio*f.get("symbol-spacing"),x=f.get("text-padding")*t.tilePixelRatio,B=function(e,t,r,i=1){let n=e.get("icon-padding").evaluate(t,{},r),a=n&&n.values;return[a[0]*i,a[1]*i,a[2]*i,a[3]*i]}(f,r,u,t.tilePixelRatio),C=f.get("text-max-angle")/180*Math.PI,S="viewport"!==f.get("text-rotation-alignment")&&"point"!==f.get("symbol-placement"),E="map"===f.get("icon-rotation-alignment")&&"point"!==f.get("symbol-placement"),I=f.get("symbol-placement"),F=b/2,P=f.get("icon-text-fit");n&&"none"!==P&&(t.allowVerticalPlacement&&i.vertical&&(p=ZA(n,i.vertical,P,f.get("icon-text-fit-padding"),g,y)),m&&(n=ZA(n,m,P,f.get("icon-text-fit-padding"),g,y)));let L=u?c.line.getGranularityForZoomLevel(u.z):1,M=(l,c)=>{c.x<0||c.x>=T||c.y<0||c.y>=T||function(t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C){let S,E,I,T,F=t.addToLineVertexArray(r,i),P=0,L=0,M=0,k=0,U=-1,R=-1,D={},N=oo("");if(t.allowVerticalPlacement&&n.vertical){let e=l.layout.get("text-rotate").evaluate(w,{},B)+90;I=new rc(h,r,A,u,c,n.vertical,d,p,f,e),o&&(T=new rc(h,r,A,u,c,o,m,y,f,e))}if(a){let i=l.layout.get("icon-rotate").evaluate(w,{}),n="none"!==l.layout.get("icon-text-fit"),s=Xu(a,i,x,n),d=o?Xu(o,i,x,n):void 0;E=new rc(h,r,A,u,c,a,m,y,!1,i),P=4*s.length;let p=t.iconSizeData,f=null;"source"===p.kind?(f=[WA*l.layout.get("icon-size").evaluate(w,{})],f[0]>$A&&V(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===p.kind&&(f=[WA*b.compositeIconSizes[0].evaluate(w,{},B),WA*b.compositeIconSizes[1].evaluate(w,{},B)],(f[0]>$A||f[1]>$A)&&V(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,s,f,v,_,w,e.ao.none,r,F.lineStartIndex,F.lineLength,-1,B),U=t.icon.placedSymbolArray.length-1,d&&(L=4*d.length,t.addSymbols(t.icon,d,f,v,_,w,e.ao.vertical,r,F.lineStartIndex,F.lineLength,-1,B),R=t.icon.placedSymbolArray.length-1)}let O=Object.keys(n.horizontal);for(let i of O){let a=n.horizontal[i];if(!S){N=oo(a.text);let e=l.layout.get("text-rotate").evaluate(w,{},B);S=new rc(h,r,A,u,c,a,d,p,f,e)}let o=1===a.positionedLines.length;if(M+=dc(t,r,a,s,l,f,w,g,F,n.vertical?e.ao.horizontal:e.ao.horizontalOnly,o?O:[i],D,U,b,B),o)break}n.vertical&&(k+=dc(t,r,n.vertical,s,l,f,w,g,F,e.ao.vertical,["vertical"],D,R,b,B));let Q=S?S.boxStartIndex:t.collisionBoxArray.length,z=S?S.boxEndIndex:t.collisionBoxArray.length,H=I?I.boxStartIndex:t.collisionBoxArray.length,j=I?I.boxEndIndex:t.collisionBoxArray.length,G=E?E.boxStartIndex:t.collisionBoxArray.length,K=E?E.boxEndIndex:t.collisionBoxArray.length,q=T?T.boxStartIndex:t.collisionBoxArray.length,Z=T?T.boxEndIndex:t.collisionBoxArray.length,W=-1,$=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;W=$(S,W),W=$(I,W),W=$(E,W),W=$(T,W);let X=W>-1?1:0;X&&(W*=C/aA),t.glyphOffsetArray.length>=ou.MAX_GLYPHS&&V("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey);let Y=Ac(l,w,B),[J,ee]=function(t,r){let i=t.length,n=r?.values;if(n?.length>0)for(let r=0;r<n.length;r+=2){let i=n[r+1];t.emplaceBack(e.aE[n[r]],i[0],i[1])}return[i,t.length]}(t.textAnchorOffsets,Y);t.symbolInstances.emplaceBack(r.x,r.y,D.right>=0?D.right:-1,D.center>=0?D.center:-1,D.left>=0?D.left:-1,D.vertical||-1,U,R,N,Q,z,H,j,G,K,q,Z,A,M,k,P,L,X,0,d,W,J,ee)}(t,c,l,i,n,a,p,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,_,[x,x,x,x],S,h,w,B,E,g,r,s,A,u,o)};if("line"===I)for(let e of Hu(r.geometry,0,0,T,T)){let r=Ah(e,L),a=Wu(r,b,C,i.vertical||m,n,24,v,t.overscaling,T);for(let e of a)m&&fc(t,m.text,F,e)||M(r,e)}else if("line-center"===I){for(let e of r.geometry)if(e.length>1){let t=Ah(e,L),r=Zu(t,C,i.vertical||m,n,24,v);r&&M(t,r)}}else if("Polygon"===r.type)for(let e of Jr(r.geometry,0)){let t=nc(e,16);M(Ah(e[0],L,!0),new ju(t.x,t.y,0))}else if("LineString"===r.type)for(let e of r.geometry){let t=Ah(e,L);M(t,new ju(t[0].x,t[0].y,0))}else if("Point"===r.type)for(let e of r.geometry)for(let t of e)M([t],new ju(t.x,t.y,0))}function dc(e,t,i,n,a,s,o,l,h,A,u,c,d,p,f){let g=function(e,t,i,n,a,s,o,l){let h=n.layout.get("text-rotate").evaluate(s,{})*Math.PI/180,A=[];for(let e of t.positionedLines)for(let n of e.positionedGlyphs){if(!n.rect)continue;let s=n.rect||{},u=4,c=!0,d=1,p=0,f=(a||l)&&n.vertical,g=n.metrics.advance*n.scale/2;if(l&&t.verticalizable&&(p=e.lineOffset/2-(n.imageName?-(aA-n.metrics.width*n.scale)/2:(n.scale-1)*aA)),n.imageName){let e=o[n.imageName];c=e.sdf,d=e.pixelRatio,u=1/d}let m=a?[n.x+g,n.y]:[0,0],y=a?[0,0]:[n.x+g+i[0],n.y+i[1]-p],_=[0,0];f&&(_=y,y=[0,0]);let v=n.metrics.isDoubleResolution?2:1,w=(n.metrics.left-u)*n.scale-g+y[0],b=(-n.metrics.top-u)*n.scale+y[1],x=w+s.w/v*n.scale/d,B=b+s.h/v*n.scale/d,C=new r(w,b),S=new r(x,b),E=new r(w,B),I=new r(x,B);if(f){let e=new r(-g,g- -17),t=-Math.PI/2,i=12-g,a=new r(22-i,-(n.imageName?i:0)),s=new r(..._);C._rotateAround(t,e)._add(a)._add(s),S._rotateAround(t,e)._add(a)._add(s),E._rotateAround(t,e)._add(a)._add(s),I._rotateAround(t,e)._add(a)._add(s)}if(h){let e=Math.sin(h),t=Math.cos(h),r=[t,-e,e,t];C._matMult(r),S._matMult(r),E._matMult(r),I._matMult(r)}let T=new r(0,0),F=new r(0,0);A.push({tl:C,tr:S,bl:E,br:I,tex:s,writingMode:t.writingMode,glyphOffset:m,sectionIndex:n.sectionIndex,isSDF:c,pixelOffsetTL:T,pixelOffsetBR:F,minFontScaleX:0,minFontScaleY:0})}return A}(0,i,l,a,s,o,n,e.allowVerticalPlacement),m=e.textSizeData,y=null;"source"===m.kind?(y=[WA*a.layout.get("text-size").evaluate(o,{})],y[0]>$A&&V(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===m.kind&&(y=[WA*p.compositeTextSizes[0].evaluate(o,{},f),WA*p.compositeTextSizes[1].evaluate(o,{},f)],(y[0]>$A||y[1]>$A)&&V(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,g,y,l,s,o,A,t,h.lineStartIndex,h.lineLength,d,f);for(let t of u)c[t]=e.text.placedSymbolArray.length-1;return 4*g.length}function pc(e){for(let t in e)return e[t];return null}function fc(e,t,r,i){let n=e.compareText;if(t in n){let e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}let gc=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class mc{static from(e){if(!(e instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[t,r]=new Uint8Array(e,0,2);if(219!==t)throw new Error("Data does not appear to be in a KDBush format.");let i=r>>4;if(1!==i)throw new Error(`Got v${i} data when expected v1.`);let n=gc[15&r];if(!n)throw new Error("Unrecognized array type.");let[a]=new Uint16Array(e,2,1),[s]=new Uint32Array(e,4,1);return new mc(s,a,n,e)}constructor(e,t=64,r=Float64Array,i){if(isNaN(e)||e<0)throw new Error(`Unpexpected numItems value: ${e}.`);this.numItems=+e,this.nodeSize=Math.min(Math.max(+t,2),65535),this.ArrayType=r,this.IndexArrayType=e<65536?Uint16Array:Uint32Array;let n=gc.indexOf(this.ArrayType),a=2*e*this.ArrayType.BYTES_PER_ELEMENT,s=e*this.IndexArrayType.BYTES_PER_ELEMENT,o=(8-s%8)%8;if(n<0)throw new Error(`Unexpected typed array class: ${r}.`);i&&i instanceof ArrayBuffer?(this.data=i,this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=2*e,this._finished=!0):(this.data=new ArrayBuffer(8+a+s+o),this.ids=new this.IndexArrayType(this.data,8,e),this.coords=new this.ArrayType(this.data,8+s+o,2*e),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+n]),new Uint16Array(this.data,2,1)[0]=t,new Uint32Array(this.data,4,1)[0]=e)}add(e,t){let r=this._pos>>1;return this.ids[r]=r,this.coords[this._pos++]=e,this.coords[this._pos++]=t,r}finish(){let e=this._pos>>1;if(e!==this.numItems)throw new Error(`Added ${e} items when expected ${this.numItems}.`);return yc(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(e,t,r,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:n,coords:a,nodeSize:s}=this,o=[0,n.length-1,0],l=[];for(;o.length;){let h=o.pop()||0,A=o.pop()||0,u=o.pop()||0;if(A-u<=s){for(let s=u;s<=A;s++){let o=a[2*s],h=a[2*s+1];o>=e&&o<=r&&h>=t&&h<=i&&l.push(n[s])}continue}let c=u+A>>1,d=a[2*c],p=a[2*c+1];d>=e&&d<=r&&p>=t&&p<=i&&l.push(n[c]),(0===h?e<=d:t<=p)&&(o.push(u),o.push(c-1),o.push(1-h)),(0===h?r>=d:i>=p)&&(o.push(c+1),o.push(A),o.push(1-h))}return l}within(e,t,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:i,coords:n,nodeSize:a}=this,s=[0,i.length-1,0],o=[],l=r*r;for(;s.length;){let h=s.pop()||0,A=s.pop()||0,u=s.pop()||0;if(A-u<=a){for(let r=u;r<=A;r++)bc(n[2*r],n[2*r+1],e,t)<=l&&o.push(i[r]);continue}let c=u+A>>1,d=n[2*c],p=n[2*c+1];bc(d,p,e,t)<=l&&o.push(i[c]),(0===h?e-r<=d:t-r<=p)&&(s.push(u),s.push(c-1),s.push(1-h)),(0===h?e+r>=d:t+r>=p)&&(s.push(c+1),s.push(A),s.push(1-h))}return o}}function yc(e,t,r,i,n,a){if(n-i<=r)return;let s=i+n>>1;_c(e,t,s,i,n,a),yc(e,t,r,i,s-1,1-a),yc(e,t,r,s+1,n,1-a)}function _c(e,t,r,i,n,a){for(;n>i;){if(n-i>600){let s=n-i+1,o=r-i+1,l=Math.log(s),h=.5*Math.exp(2*l/3),A=.5*Math.sqrt(l*h*(s-h)/s)*(o-s/2<0?-1:1);_c(e,t,r,Math.max(i,Math.floor(r-o*h/s+A)),Math.min(n,Math.floor(r+(s-o)*h/s+A)),a)}let s=t[2*r+a],o=i,l=n;for(vc(e,t,i,r),t[2*n+a]>s&&vc(e,t,i,n);o<l;){for(vc(e,t,o,l),o++,l--;t[2*o+a]<s;)o++;for(;t[2*l+a]>s;)l--}t[2*i+a]===s?vc(e,t,i,l):(l++,vc(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function vc(e,t,r,i){wc(e,r,i),wc(t,2*r,2*i),wc(t,2*r+1,2*i+1)}function wc(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function bc(e,t,r,i){let n=e-r,a=t-i;return n*n+a*a}var xc;e.cx=void 0,(xc=e.cx||(e.cx={})).create="create",xc.load="load",xc.fullLoad="fullLoad";let Bc=null,Cc=[],Sc=1e3/60,Ec="loadTime",Ic="fullLoadTime",Tc={mark(e){performance.mark(e)},frame(e){let t=e;null!=Bc&&Cc.push(t-Bc),Bc=t},clearMetrics(){Bc=null,Cc=[],performance.clearMeasures(Ec),performance.clearMeasures(Ic);for(let t in e.cx)performance.clearMarks(e.cx[t])},getPerformanceMetrics(){performance.measure(Ec,e.cx.create,e.cx.load),performance.measure(Ic,e.cx.create,e.cx.fullLoad);let t=performance.getEntriesByName(Ec)[0].duration,r=performance.getEntriesByName(Ic)[0].duration,i=Cc.length,n=1/(Cc.reduce(((e,t)=>e+t),0)/i/1e3),a=Cc.filter((e=>e>Sc)).reduce(((e,t)=>e+(t-Sc)/Sc),0);return{loadTime:t,fullLoadTime:r,fps:n,percentDroppedFrames:a/(i+a)*100,totalFrames:i}}};e.$=T,e.A=d,e.B=function([e,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(t)*Math.sin(r),y:e*Math.sin(t)*Math.sin(r),z:e*Math.cos(r)}},e.C=pr,e.D=Na,e.E=me,e.F=Ia,e.G=ta,e.H=function(e){if(null==q){let t=e.navigator?e.navigator.userAgent:null;q=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return q},e.I=BA,e.J=class{constructor(e,t){this.target=e,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new yu((()=>this.process())),this.subscription=J(this.target,"message",(e=>this.receive(e)),!1),this.globalScope=K(self)?e:window}registerMessageHandler(e,t){this.messageHandlers[e]=t}sendAsync(e,t){return new Promise(((r,i)=>{let n=Math.round(1e18*Math.random()).toString(36).substring(0,10),a=t?J(t.signal,"abort",(()=>{a?.unsubscribe(),delete this.resolveRejects[n];let t={id:n,type:"<cancel>",origin:location.origin,targetMapId:e.targetMapId,sourceMapId:this.mapId};this.target.postMessage(t)}),_u):null;this.resolveRejects[n]={resolve:e=>{a?.unsubscribe(),r(e)},reject:e=>{a?.unsubscribe(),i(e)}};let s=[],o=Object.assign(Object.assign({},e),{id:n,sourceMapId:this.mapId,origin:location.origin,data:ua(e.data,s)});this.target.postMessage(o,{transfer:s})}))}receive(e){let t=e.data,r=t.id;if(!("file://"!==t.origin&&"file://"!==location.origin&&"resource://android"!==t.origin&&"resource://android"!==location.origin&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if("<cancel>"===t.type){delete this.tasks[r];let e=this.abortControllers[r];return delete this.abortControllers[r],void(e&&e.abort())}if(K(self)||t.mustQueue)return this.tasks[r]=t,this.taskQueue.push(r),void this.invoker.trigger();this.processTask(r,t)}}process(){if(0===this.taskQueue.length)return;let e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,r){return t(this,void 0,void 0,(function*(){if("<response>"===r.type){let t=this.resolveRejects[e];return delete this.resolveRejects[e],t?void(r.error?t.reject(ca(r.error)):t.resolve(ca(r.data))):void 0}if(!this.messageHandlers[r.type])return void this.completeTask(e,new Error(`Could not find a registered handler for ${r.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));let t=ca(r.data),i=new AbortController;this.abortControllers[e]=i;try{let n=yield this.messageHandlers[r.type](r.sourceMapId,t,i);this.completeTask(e,null,n)}catch(t){this.completeTask(e,t)}}))}completeTask(e,t,r){let i=[];delete this.abortControllers[e];let n={id:e,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?ua(t):null,data:ua(r,i)};this.target.postMessage(n,{transfer:i})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},e.K=le,e.L=function(){var e=new d(16);return d!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.M=function(e,t,r){var i,n,a,s,o,l,h,A,u,c,d,p,f=r[0],g=r[1],m=r[2];return t===e?(e[12]=t[0]*f+t[4]*g+t[8]*m+t[12],e[13]=t[1]*f+t[5]*g+t[9]*m+t[13],e[14]=t[2]*f+t[6]*g+t[10]*m+t[14],e[15]=t[3]*f+t[7]*g+t[11]*m+t[15]):(n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],h=t[6],A=t[7],u=t[8],c=t[9],d=t[10],p=t[11],e[0]=i=t[0],e[1]=n,e[2]=a,e[3]=s,e[4]=o,e[5]=l,e[6]=h,e[7]=A,e[8]=u,e[9]=c,e[10]=d,e[11]=p,e[12]=i*f+o*g+u*m+t[12],e[13]=n*f+l*g+c*m+t[13],e[14]=a*f+h*g+d*m+t[14],e[15]=s*f+A*g+p*m+t[15]),e},e.N=function(e,t,r){var i=r[0],n=r[1],a=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*a,e[9]=t[9]*a,e[10]=t[10]*a,e[11]=t[11]*a,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.O=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5],h=t[6],A=t[7],u=t[8],c=t[9],d=t[10],p=t[11],f=t[12],g=t[13],m=t[14],y=t[15],_=r[0],v=r[1],w=r[2],b=r[3];return e[0]=_*i+v*o+w*u+b*f,e[1]=_*n+v*l+w*c+b*g,e[2]=_*a+v*h+w*d+b*m,e[3]=_*s+v*A+w*p+b*y,e[4]=(_=r[4])*i+(v=r[5])*o+(w=r[6])*u+(b=r[7])*f,e[5]=_*n+v*l+w*c+b*g,e[6]=_*a+v*h+w*d+b*m,e[7]=_*s+v*A+w*p+b*y,e[8]=(_=r[8])*i+(v=r[9])*o+(w=r[10])*u+(b=r[11])*f,e[9]=_*n+v*l+w*c+b*g,e[10]=_*a+v*h+w*d+b*m,e[11]=_*s+v*A+w*p+b*y,e[12]=(_=r[12])*i+(v=r[13])*o+(w=r[14])*u+(b=r[15])*f,e[13]=_*n+v*l+w*c+b*g,e[14]=_*a+v*h+w*d+b*m,e[15]=_*s+v*A+w*p+b*y,e},e.P=r,e.Q=function(e,t){let r={};for(let i=0;i<t.length;i++){let n=t[i];n in e&&(r[n]=e[n])}return r},e.R=pl,e.S=wu,e.T=xl,e.U=Cu,e.V=Bu,e.W=A,e.X=u,e.Y=Y,e.Z=Mu,e._=t,e.a=se,e.a$=x,e.a0=function(e,t){var r,i,n,a,s;if(!e)return t??{};if(!t)return e;let o=Object.assign({},e);if(t.removeAll&&(o={removeAll:!0}),t.remove){let i=new Set(t.remove);o.add&&(o.add=o.add.filter((e=>!i.has(e.id)))),o.update&&(o.update=o.update.filter((e=>!i.has(e.id))));let n=new Set((null!==(r=e.add)&&void 0!==r?r:[]).map((e=>e.id)));t.remove=t.remove.filter((e=>!n.has(e)))}if(t.remove){let e=new Set(o.remove?o.remove.concat(t.remove):t.remove);o.remove=Array.from(e.values())}if(t.add){let e=o.add?o.add.concat(t.add):t.add,r=new Map(e.map((e=>[e.id,e])));o.add=Array.from(r.values())}if(t.update){let e=new Map(null===(i=o.update)||void 0===i?void 0:i.map((e=>[e.id,e])));for(let r of t.update){let t=null!==(n=e.get(r.id))&&void 0!==n?n:{id:r.id};r.newGeometry&&(t.newGeometry=r.newGeometry),r.addOrUpdateProperties&&(t.addOrUpdateProperties=(null!==(a=t.addOrUpdateProperties)&&void 0!==a?a:[]).concat(r.addOrUpdateProperties)),r.removeProperties&&(t.removeProperties=(null!==(s=t.removeProperties)&&void 0!==s?s:[]).concat(r.removeProperties)),r.removeAllProperties&&(t.removeAllProperties=!0),e.set(r.id,t)}o.update=Array.from(e.values())}return o.remove&&o.add&&(o.remove=o.remove.filter((e=>-1===o.add.findIndex((t=>t.id===e))))),o},e.a1=Tu,e.a2=Ru,e.a3=25,e.a4=Pu,e.a5=e=>{let t=window.document.createElement("video");return t.muted=!0,new Promise((r=>{t.onloadstart=()=>{r(t)};for(let r of e){let e=window.document.createElement("source");ce(r)||(t.crossOrigin="Anonymous"),e.src=r,t.appendChild(e)}}))},e.a6=Fe,e.a7=function(){return O++},e.a8=bs,e.a9=ou,e.aA=function(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(let a of e)t=Math.min(t,a.x),r=Math.min(r,a.y),i=Math.max(i,a.x),n=Math.max(n,a.y);return[t,r,i,n]},e.aB=aA,e.aC=F,e.aD=function(e,t,r,i,n=!1){if(!r[0]&&!r[1])return[0,0];let a=n?"map"===i?-e.bearingInRadians:0:"viewport"===i?e.bearingInRadians:0;if(a){let e=Math.sin(a),t=Math.cos(a);r=[r[0]*t-r[1]*e,r[0]*e+r[1]*t]}return[n?r[0]:F(t,r[0],e.zoom),n?r[1]:F(t,r[1],e.zoom)]},e.aF=YA,e.aG=uc,e.aH=OA,e.aI=mc,e.aJ=Wa,e.aK=ih,e.aL=Ms,e.aM=$s,e.aN=Ks,e.aO=D,e.aP=te,e.aQ=Iu,e.aR=v,e.aS=_,e.aT=function(e){var t=new d(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.aU=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},e.aV=function(e,t){var r=t[0],i=t[1],n=t[2],a=r*r+i*i+n*n;return a>0&&(a=1/Math.sqrt(a)),e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e},e.aW=w,e.aX=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.aY=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},e.aZ=m,e.a_=function(e,t,r){let i=t[0]*r[0]+t[1]*r[1]+t[2]*r[2];return 0===i?null:(-(e[0]*r[0]+e[1]*r[1]+e[2]*r[2])-r[3])/i},e.aa=cn,e.ab=Mo,e.ac=Nu,e.ad=function(e){let t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,i,n)=>{let a=i||n;return t[r]=!a||a.toLowerCase(),""})),t["max-age"]){let e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t},e.ae=ee,e.af=function(e){return Math.pow(2,e)},e.ag=f,e.ah=R,e.ai=85.051129,e.aj=Su,e.ak=function(e){return Math.log(e)/Math.LN2},e.al=function(e){var t=e[0],r=e[1];return t*t+r*r},e.am=function(e,t){let r=[];for(let i in e)i in t||r.push(i);return r},e.an=function(e,t){let r=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){let{interpolationType:n,minZoom:a,maxZoom:s}=e,o=n?R(cr.interpolationFactor(n,t,a,s),0,1):0;"camera"===e.kind?i=pr.number(e.minSize,e.maxSize,o):r=o}return{uSizeT:r,uSize:i}},e.ap=function(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return"source"===e.kind?i/WA:"composite"===e.kind?pr.number(i/WA,n/WA,r):t},e.aq=function(e,t){var r=t[0],i=t[1],n=t[2],a=t[3],s=t[4],o=t[5],l=t[6],h=t[7],A=t[8],u=t[9],c=t[10],d=t[11],p=t[12],f=t[13],g=t[14],m=t[15],y=r*o-i*s,_=r*l-n*s,v=r*h-a*s,w=i*l-n*o,b=i*h-a*o,x=n*h-a*l,B=A*f-u*p,C=A*g-c*p,S=A*m-d*p,E=u*g-c*f,I=u*m-d*f,T=c*m-d*g,F=y*T-_*I+v*E+w*S-b*C+x*B;return F?(e[0]=(o*T-l*I+h*E)*(F=1/F),e[1]=(n*I-i*T-a*E)*F,e[2]=(f*x-g*b+m*w)*F,e[3]=(c*b-u*x-d*w)*F,e[4]=(l*S-s*T-h*C)*F,e[5]=(r*T-n*S+a*C)*F,e[6]=(g*v-p*x-m*_)*F,e[7]=(A*x-c*v+d*_)*F,e[8]=(s*I-o*S+h*B)*F,e[9]=(i*S-r*I-a*B)*F,e[10]=(p*b-f*v+m*y)*F,e[11]=(u*v-A*b-d*y)*F,e[12]=(o*C-s*E-l*B)*F,e[13]=(r*E-i*C+n*B)*F,e[14]=(f*_-p*w-g*y)*F,e[15]=(A*w-u*_+c*y)*F,e):null},e.ar=E,e.as=function(e){var t=e[0],r=e[1];return Math.sqrt(t*t+r*r)},e.at=function(e){return e[0]=0,e[1]=0,e},e.au=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e},e.av=iu,e.aw=B,e.ax=function(e,t,i,n){let a=t.y-e.y,s=t.x-e.x,o=n.y-i.y,l=n.x-i.x,h=o*s-l*a;if(0===h)return null;let A=(l*(e.y-i.y)-o*(e.x-i.x))/h;return new r(e.x+A*s,e.y+A*a)},e.ay=Hu,e.az=Oo,e.b=Z,e.b$=class extends As{},e.b0=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},e.b1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]},e.b2=Lu,e.b3=ku,e.b4=function(e,t,r,i,n){var a=1/Math.tan(t/2);if(e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0){var s=1/(i-n);e[10]=(n+i)*s,e[14]=2*n*i*s}else e[10]=-1,e[14]=-2*i;return e},e.b5=function(e){var t=new d(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.b6=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],h=t[4],A=t[5],u=t[6],c=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n+h*i,e[1]=s*n+A*i,e[2]=o*n+u*i,e[3]=l*n+c*i,e[4]=h*n-a*i,e[5]=A*n-s*i,e[6]=u*n-o*i,e[7]=c*n-l*i,e},e.b7=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[4],s=t[5],o=t[6],l=t[7],h=t[8],A=t[9],u=t[10],c=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=a*n+h*i,e[5]=s*n+A*i,e[6]=o*n+u*i,e[7]=l*n+c*i,e[8]=h*n-a*i,e[9]=A*n-s*i,e[10]=u*n-o*i,e[11]=c*n-l*i,e},e.b8=function(){let e=new Float32Array(16);return f(e),e},e.b9=function(){let e=new Float64Array(16);return f(e),e},e.bA=function(e,t){let r=P(e,360),i=P(t,360),n=i-r,a=i>r?n-360:n+360;return Math.abs(n)<Math.abs(a)?n:a},e.bB=function(e){return e[0]=0,e[1]=0,e[2]=0,e},e.bC=function(e,t,r,i){let n=Math.sqrt(e*e+t*t),a=Math.sqrt(r*r+i*i);e/=n,t/=n,r/=a,i/=a;let s=Math.acos(e*r+t*i);return-t*r+e*i>0?s:-s},e.bD=function(e,t){let r=P(e,2*Math.PI),i=P(t,2*Math.PI);return Math.min(Math.abs(r-i),Math.abs(r-i+2*Math.PI),Math.abs(r-i-2*Math.PI))},e.bE=function(){let e={},t=ye.$version;for(let r in ye.$root){let i=ye.$root[r];if(i.required){let n=null;n="version"===r?t:"array"===i.type?[]:{},null!=n&&(e[r]=n)}}return e},e.bF=da,e.bG=Ae,e.bH=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(let i=0;i<t.length;i++)if(!e(t[i],r[i]))return!1;return!0}if("object"==typeof t&&null!==t&&null!==r){if("object"!=typeof r||Object.keys(t).length!==Object.keys(r).length)return!1;for(let i in t)if(!e(t[i],r[i]))return!1;return!0}return t===r},e.bI=function(e){e=e.slice();let t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=ve(e[r],t[e[r].ref]));return e},e.bJ=function(e,t){if("custom"===e.type)return new mu(e,t);switch(e.type){case"background":return new du(e,t);case"circle":return new sl(e,t);case"color-relief":return new Sl(e,t);case"fill":return new gh(e,t);case"fill-extrusion":return new Uh(e,t);case"heatmap":return new yl(e,t);case"hillshade":return new vl(e,t);case"line":return new $h(e,t);case"raster":return new gu(e,t);case"symbol":return new Au(e,t)}},e.bK=H,e.bL=function(e,t){if(!e)return[{command:"setStyle",args:[t]}];let r=[];try{if(!we(e.version,t.version))return[{command:"setStyle",args:[t]}];we(e.center,t.center)||r.push({command:"setCenter",args:[t.center]}),we(e.state,t.state)||r.push({command:"setGlobalState",args:[t.state]}),we(e.centerAltitude,t.centerAltitude)||r.push({command:"setCenterAltitude",args:[t.centerAltitude]}),we(e.zoom,t.zoom)||r.push({command:"setZoom",args:[t.zoom]}),we(e.bearing,t.bearing)||r.push({command:"setBearing",args:[t.bearing]}),we(e.pitch,t.pitch)||r.push({command:"setPitch",args:[t.pitch]}),we(e.roll,t.roll)||r.push({command:"setRoll",args:[t.roll]}),we(e.sprite,t.sprite)||r.push({command:"setSprite",args:[t.sprite]}),we(e.glyphs,t.glyphs)||r.push({command:"setGlyphs",args:[t.glyphs]}),we(e.transition,t.transition)||r.push({command:"setTransition",args:[t.transition]}),we(e.light,t.light)||r.push({command:"setLight",args:[t.light]}),we(e.terrain,t.terrain)||r.push({command:"setTerrain",args:[t.terrain]}),we(e.sky,t.sky)||r.push({command:"setSky",args:[t.sky]}),we(e.projection,t.projection)||r.push({command:"setProjection",args:[t.projection]});let i={},n=[];!function(e,t,r,i){let n;for(n in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,n)&&(Object.prototype.hasOwnProperty.call(t,n)||Be(n,r,i));for(n in t)Object.prototype.hasOwnProperty.call(t,n)&&(Object.prototype.hasOwnProperty.call(e,n)?we(e[n],t[n])||("geojson"===e[n].type&&"geojson"===t[n].type&&Se(e,t,n)?be(r,{command:"setGeoJSONSourceData",args:[n,t[n].data]}):Ce(n,t,r,i)):xe(n,t,r))}(e.sources,t.sources,n,i);let a=[];e.layers&&e.layers.forEach((e=>{"source"in e&&i[e.source]?r.push({command:"removeLayer",args:[e.id]}):a.push(e)})),r=r.concat(n),function(e,t,r){t=t||[];let i,n,a,s,o,l=(e=e||[]).map(Ie),h=t.map(Ie),A=e.reduce(Te,{}),u=t.reduce(Te,{}),c=l.slice(),d=Object.create(null);for(let e=0,t=0;e<l.length;e++)i=l[e],Object.prototype.hasOwnProperty.call(u,i)?t++:(be(r,{command:"removeLayer",args:[i]}),c.splice(c.indexOf(i,t),1));for(let e=0,t=0;e<h.length;e++)i=h[h.length-1-e],c[c.length-1-e]!==i&&(Object.prototype.hasOwnProperty.call(A,i)?(be(r,{command:"removeLayer",args:[i]}),c.splice(c.lastIndexOf(i,c.length-t),1)):t++,s=c[c.length-e],be(r,{command:"addLayer",args:[u[i],s]}),c.splice(c.length-e,0,i),d[i]=!0);for(let e=0;e<h.length;e++)if(i=h[e],n=A[i],a=u[i],!d[i]&&!we(n,a))if(we(n.source,a.source)&&we(n["source-layer"],a["source-layer"])&&we(n.type,a.type)){for(o in Ee(n.layout,a.layout,r,i,null,"setLayoutProperty"),Ee(n.paint,a.paint,r,i,null,"setPaintProperty"),we(n.filter,a.filter)||be(r,{command:"setFilter",args:[i,a.filter]}),we(n.minzoom,a.minzoom)&&we(n.maxzoom,a.maxzoom)||be(r,{command:"setLayerZoomRange",args:[i,a.minzoom,a.maxzoom]}),n)Object.prototype.hasOwnProperty.call(n,o)&&"layout"!==o&&"paint"!==o&&"filter"!==o&&"metadata"!==o&&"minzoom"!==o&&"maxzoom"!==o&&(0===o.indexOf("paint.")?Ee(n[o],a[o],r,i,o.slice(6),"setPaintProperty"):we(n[o],a[o])||be(r,{command:"setLayerProperty",args:[i,o,a[o]]}));for(o in a)Object.prototype.hasOwnProperty.call(a,o)&&!Object.prototype.hasOwnProperty.call(n,o)&&"layout"!==o&&"paint"!==o&&"filter"!==o&&"metadata"!==o&&"minzoom"!==o&&"maxzoom"!==o&&(0===o.indexOf("paint.")?Ee(n[o],a[o],r,i,o.slice(6),"setPaintProperty"):we(n[o],a[o])||be(r,{command:"setLayerProperty",args:[i,o,a[o]]}))}else be(r,{command:"removeLayer",args:[i]}),s=c[c.lastIndexOf(i)+1],be(r,{command:"addLayer",args:[a,s]})}(a,t.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:"setStyle",args:[t]}]}return r},e.bM=function(e){let t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.bN=Q,e.bO=z,e.bP=class extends co{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.bQ=go,e.bR=class extends co{constructor(e,t){super(e,t),this.current=mo}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.bS=fo,e.bT=class extends co{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.bU=class extends co{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.bV=p,e.bW=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.bX=function(e,t,r){var i=t[0],n=t[1],a=t[2];return e[0]=i*r[0]+n*r[3]+a*r[6],e[1]=i*r[1]+n*r[4]+a*r[7],e[2]=i*r[2]+n*r[5]+a*r[8],e},e.bY=function(e,t,r,i,n,a,s){var o=1/(t-r),l=1/(i-n),h=1/(a-s);return e[0]=-2*o,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*h,e[11]=0,e[12]=(t+r)*o,e[13]=(n+i)*l,e[14]=(s+a)*h,e[15]=1,e},e.bZ=class extends co{constructor(e,t){super(e,t),this.current=new Array}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(4*e.length);for(let r=0;r<e.length;r++)t[4*r]=e[r].r,t[4*r+1]=e[r].g,t[4*r+2]=e[r].b,t[4*r+3]=e[r].a;this.gl.uniform4fv(this.location,t)}}},e.b_=class extends co{constructor(e,t){super(e,t),this.current=new Array}set(e){if(e!=this.current){this.current=e;let t=new Float32Array(e);this.gl.uniform1fv(this.location,t)}}},e.ba=function(){return new Float64Array(16)},e.bb=function(e,t,r){let i=new Float64Array(4);return S(i,e,t-90,r),i},e.bc=function(e,t,r,i){var n,a,s,o,l,h=t[0],A=t[1],u=t[2],d=t[3],p=r[0],f=r[1],g=r[2],m=r[3];return(a=h*p+A*f+u*g+d*m)<0&&(a=-a,p=-p,f=-f,g=-g,m=-m),1-a>c?(n=Math.acos(a),s=Math.sin(n),o=Math.sin((1-i)*n)/s,l=Math.sin(i*n)/s):(o=1-i,l=i),e[0]=o*h+l*p,e[1]=o*A+l*f,e[2]=o*u+l*g,e[3]=o*d+l*m,e},e.bd=function(e){let t=new Float64Array(9);var r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_;u=(n=(i=e)[0])*(l=n+n),c=(a=i[1])*l,p=(s=i[2])*l,f=s*(h=a+a),m=(o=i[3])*l,y=o*h,_=o*(A=s+s),(r=t)[0]=1-(d=a*h)-(g=s*A),r[3]=c-_,r[6]=p+y,r[1]=c+_,r[4]=1-u-g,r[7]=f-m,r[2]=p-y,r[5]=f+m,r[8]=1-u-d;let v,w,b=te(-Math.asin(R(t[2],-1,1)));return Math.hypot(t[5],t[8])<.001?(v=0,w=-te(Math.atan2(t[3],t[4]))):(v=te(0===t[5]&&0===t[8]?0:Math.atan2(t[5],t[8])),w=te(0===t[1]&&0===t[0]?0:Math.atan2(t[1],t[0]))),{roll:v,pitch:b+90,bearing:w}},e.be=function(e,t){return e.roll==t.roll&&e.pitch==t.pitch&&e.bearing==t.bearing},e.bf=St,e.bg=po,e.bh=sh,e.bi=oh,e.bj=rh,e.bk=L,e.bl=M,e.bm=Nt,e.bn=function(e,t,r,i,n){return L(i,n,R((e-t)/(r-t),0,1))},e.bo=P,e.bp=function(){return new Float64Array(3)},e.bq=function(e,t,r,i){return e[0]=t[0]+r[0]*i,e[1]=t[1]+r[1]*i,e[2]=t[2]+r[2]*i,e},e.br=S,e.bs=function(e,t,r){var i=r[0],n=r[1],a=r[2],s=r[3],o=t[0],l=t[1],h=t[2],A=n*h-a*l,u=a*o-i*h,c=i*l-n*o;return e[0]=o+s*(A+=A)+n*(c+=c)-a*(u+=u),e[1]=l+s*u+a*A-i*c,e[2]=h+s*c+i*u-n*A,e},e.bt=function(e,t,r){let i=(n=[e[0],e[1],e[2],t[0],t[1],t[2],r[0],r[1],r[2]])[0]*((A=n[8])*(s=n[4])-(o=n[5])*(h=n[7]))+n[1]*(-A*(a=n[3])+o*(l=n[6]))+n[2]*(h*a-s*l);var n,a,s,o,l,h,A;if(0===i)return null;let u=w([],[t[0],t[1],t[2]],[r[0],r[1],r[2]]),c=w([],[r[0],r[1],r[2]],[e[0],e[1],e[2]]),d=w([],[e[0],e[1],e[2]],[t[0],t[1],t[2]]),p=v([],u,-e[3]);return _(p,p,v([],c,-t[3])),_(p,p,v([],d,-r[3])),v(p,p,1/i),p},e.bu=vu,e.bv=function(){return new Float64Array(4)},e.bw=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0]*Math.cos(i)-n[1]*Math.sin(i),a[1]=n[0]*Math.sin(i)+n[1]*Math.cos(i),a[2]=n[2],e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},e.bx=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[0],a[1]=n[1]*Math.cos(i)-n[2]*Math.sin(i),a[2]=n[1]*Math.sin(i)+n[2]*Math.cos(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},e.by=function(e,t,r,i){var n=[],a=[];return n[0]=t[0]-r[0],n[1]=t[1]-r[1],n[2]=t[2]-r[2],a[0]=n[2]*Math.sin(i)+n[0]*Math.cos(i),a[1]=n[1],a[2]=n[2]*Math.cos(i)-n[0]*Math.sin(i),e[0]=a[0]+r[0],e[1]=a[1]+r[1],e[2]=a[2]+r[2],e},e.bz=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),a=t[0],s=t[1],o=t[2],l=t[3],h=t[8],A=t[9],u=t[10],c=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=a*n-h*i,e[1]=s*n-A*i,e[2]=o*n-u*i,e[3]=l*n-c*i,e[8]=a*i+h*n,e[9]=s*i+A*n,e[10]=o*i+u*n,e[11]=l*i+c*n,e},e.c=ae,e.c0=rA,e.c1=class extends cs{},e.c2=ml,e.c3=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.c4=fl,e.c5=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=r[3]*i+r[7]*n+r[11]*a+r[15];return e[0]=(r[0]*i+r[4]*n+r[8]*a+r[12])/(s=s||1),e[1]=(r[1]*i+r[5]*n+r[9]*a+r[13])/s,e[2]=(r[2]*i+r[6]*n+r[10]*a+r[14])/s,e},e.c6=class extends Ja{},e.c7=class extends _s{},e.c8=function(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]},e.c9=function(e,t){var r=e[0],i=e[1],n=e[2],a=e[3],s=e[4],o=e[5],l=e[6],h=e[7],A=e[8],u=e[9],d=e[10],p=e[11],f=e[12],g=e[13],m=e[14],y=e[15],_=t[0],v=t[1],w=t[2],b=t[3],x=t[4],B=t[5],C=t[6],S=t[7],E=t[8],I=t[9],T=t[10],F=t[11],P=t[12],L=t[13],M=t[14],k=t[15];return Math.abs(r-_)<=c*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-v)<=c*Math.max(1,Math.abs(i),Math.abs(v))&&Math.abs(n-w)<=c*Math.max(1,Math.abs(n),Math.abs(w))&&Math.abs(a-b)<=c*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(s-x)<=c*Math.max(1,Math.abs(s),Math.abs(x))&&Math.abs(o-B)<=c*Math.max(1,Math.abs(o),Math.abs(B))&&Math.abs(l-C)<=c*Math.max(1,Math.abs(l),Math.abs(C))&&Math.abs(h-S)<=c*Math.max(1,Math.abs(h),Math.abs(S))&&Math.abs(A-E)<=c*Math.max(1,Math.abs(A),Math.abs(E))&&Math.abs(u-I)<=c*Math.max(1,Math.abs(u),Math.abs(I))&&Math.abs(d-T)<=c*Math.max(1,Math.abs(d),Math.abs(T))&&Math.abs(p-F)<=c*Math.max(1,Math.abs(p),Math.abs(F))&&Math.abs(f-P)<=c*Math.max(1,Math.abs(f),Math.abs(P))&&Math.abs(g-L)<=c*Math.max(1,Math.abs(g),Math.abs(L))&&Math.abs(m-M)<=c*Math.max(1,Math.abs(m),Math.abs(M))&&Math.abs(y-k)<=c*Math.max(1,Math.abs(y),Math.abs(k))},e.cA=function(e,t){se.REGISTERED_PROTOCOLS[e]=t},e.cB=function(e){delete se.REGISTERED_PROTOCOLS[e]},e.cC=function(e,t){let r={};for(let i=0;i<e.length;i++){let n=t&&t[e[i].id]||wn(e[i]);t&&(t[e[i].id]=n);let a=r[n];a||(a=r[n]=[]),a.push(e[i])}let i=[];for(let e in r)i.push(r[e]);return i},e.cD=oa,e.cE=Du,e.cF=Ou,e.cG=CA,e.cH=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=T/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;let r=t.bucket.layers[0],i=r.layout,n=r._unevaluatedLayout._values,a={layoutIconSize:n["icon-size"].possiblyEvaluate(new Ia(t.bucket.zoom+1),t.canonical),layoutTextSize:n["text-size"].possiblyEvaluate(new Ia(t.bucket.zoom+1),t.canonical),textMaxSize:n["text-size"].possiblyEvaluate(new Ia(18))};if("composite"===t.bucket.textSizeData.kind){let{minZoom:e,maxZoom:r}=t.bucket.textSizeData;a.compositeTextSizes=[n["text-size"].possiblyEvaluate(new Ia(e),t.canonical),n["text-size"].possiblyEvaluate(new Ia(r),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){let{minZoom:e,maxZoom:r}=t.bucket.iconSizeData;a.compositeIconSizes=[n["icon-size"].possiblyEvaluate(new Ia(e),t.canonical),n["icon-size"].possiblyEvaluate(new Ia(r),t.canonical)]}let s=i.get("text-line-height")*aA,o="viewport"!==i.get("text-rotation-alignment")&&"point"!==i.get("symbol-placement"),l=i.get("text-keep-upright"),h=i.get("text-size");for(let n of t.bucket.features){let A,u=i.get("text-font").evaluate(n,{},t.canonical).join(","),c=h.evaluate(n,{},t.canonical),d=a.layoutTextSize.evaluate(n,{},t.canonical),p=a.layoutIconSize.evaluate(n,{},t.canonical),f={horizontal:{},vertical:void 0},g=n.text,m=[0,0];if(g){let a=g.toString(),h=i.get("text-letter-spacing").evaluate(n,{},t.canonical)*aA,A=ga(a)?h:0,p=i.get("text-anchor").evaluate(n,{},t.canonical),y=Ac(r,n,t.canonical);if(!y){let e=i.get("text-radial-offset").evaluate(n,{},t.canonical);m=e?hc(p,[e*aA,lc]):i.get("text-offset").evaluate(n,{},t.canonical).map((e=>e*aA))}let _=o?"center":i.get("text-justify").evaluate(n,{},t.canonical),v="point"===i.get("symbol-placement")?i.get("text-max-width").evaluate(n,{},t.canonical)*aA:1/0,w=()=>{t.bucket.allowVerticalPlacement&&fa(a)&&(f.vertical=TA(g,t.glyphMap,t.glyphPositions,t.imagePositions,u,v,s,p,"left",A,m,e.ao.vertical,!0,d,c))};if(!o&&y){let r=new Set;if("auto"===_)for(let e=0;e<y.values.length;e+=2)r.add(uc(y.values[e]));else r.add(_);let i=!1;for(let n of r)if(!f.horizontal[n])if(i)f.horizontal[n]=f.horizontal[0];else{let r=TA(g,t.glyphMap,t.glyphPositions,t.imagePositions,u,v,s,"center",n,A,m,e.ao.horizontal,!1,d,c);r&&(f.horizontal[n]=r,i=1===r.positionedLines.length)}w()}else{"auto"===_&&(_=uc(p));let r=TA(g,t.glyphMap,t.glyphPositions,t.imagePositions,u,v,s,p,_,A,m,e.ao.horizontal,!1,d,c);r&&(f.horizontal[_]=r),w(),fa(a)&&o&&l&&(f.vertical=TA(g,t.glyphMap,t.glyphPositions,t.imagePositions,u,v,s,p,_,A,m,e.ao.vertical,!1,d,c))}}let y=!1;if(n.icon&&n.icon.name){let e=t.imageMap[n.icon.name];e&&(A=KA(t.imagePositions[n.icon.name],i.get("icon-offset").evaluate(n,{},t.canonical),i.get("icon-anchor").evaluate(n,{},t.canonical)),y=!!e.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=y:t.bucket.sdfIcons!==y&&V("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.bucket.pixelRatio||0!==i.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}let _=pc(f.horizontal)||f.vertical;t.bucket.iconsInText=!!_&&_.iconsInText,(_||A)&&cc(t.bucket,n,f,A,t.imageMap,a,d,p,m,y,t.canonical,t.subdivisionGranularity)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.cI=ph,e.cJ=Fh,e.cK=Kh,e.cL=Ch,e.cM=hA,e.cN=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.cO=function(e,r,i,n,a){return t(this,void 0,void 0,(function*(){if(u())try{return yield Y(e,r,i,n,a)}catch{}return function(e,t,r,i,n){let a=e.width,s=e.height;W&&$||(W=new OffscreenCanvas(a,s),$=W.getContext("2d",{willReadFrequently:!0})),W.width=a,W.height=s,$.drawImage(e,0,0,a,s);let o=$.getImageData(t,r,i,n);return $.clearRect(0,0,a,s),o.data}(e,r,i,n,a)}))},e.cP=Bl,e.cQ=i,e.cR=xh,e.cS=vh,e.cT=tn,e.cU=function(e,t){let r=new Map;if(null!=e)if("Feature"===e.type)r.set(Uu(e,t),e);else for(let i of e.features)r.set(Uu(i,t),i);return r},e.cV=function(e,t){if(null==e)return!0;if("Feature"===e.type)return null!=Uu(e,t);if("FeatureCollection"===e.type){let r=new Set;for(let i of e.features){let e=Uu(i,t);if(null==e||r.has(e))return!1;r.add(e)}return!0}return!1},e.cW=function(e,t,r){var i,n,a,s;if(t.removeAll&&e.clear(),t.remove)for(let r of t.remove)e.delete(r);if(t.add)for(let i of t.add){let t=Uu(i,r);null!=t&&e.set(t,i)}if(t.update)for(let r of t.update){let t=e.get(r.id);if(null==t)continue;let o=!r.removeAllProperties&&((null===(i=r.removeProperties)||void 0===i?void 0:i.length)>0||(null===(n=r.addOrUpdateProperties)||void 0===n?void 0:n.length)>0);if((r.newGeometry||r.removeAllProperties||o)&&(t=Object.assign({},t),e.set(r.id,t),o&&(t.properties=Object.assign({},t.properties))),r.newGeometry&&(t.geometry=r.newGeometry),r.removeAllProperties)t.properties={};else if((null===(a=r.removeProperties)||void 0===a?void 0:a.length)>0)for(let e of r.removeProperties)Object.prototype.hasOwnProperty.call(t.properties,e)&&delete t.properties[e];if((null===(s=r.addOrUpdateProperties)||void 0===s?void 0:s.length)>0)for(let{key:e,value:i}of r.addOrUpdateProperties)t.properties[e]=i}},e.cX=Ea,e.ca=function(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.cb=e=>"symbol"===e.type,e.cc=e=>"circle"===e.type,e.cd=e=>"heatmap"===e.type,e.ce=e=>"line"===e.type,e.cf=e=>"fill"===e.type,e.cg=e=>"fill-extrusion"===e.type,e.ch=e=>"hillshade"===e.type,e.ci=e=>"color-relief"===e.type,e.cj=e=>"raster"===e.type,e.ck=e=>"background"===e.type,e.cl=e=>"custom"===e.type,e.cm=k,e.cn=function(e,t,r){let i=I(t.x-r.x,t.y-r.y),n=I(e.x-r.x,e.y-r.y);var a,s;return te(Math.atan2(i[0]*n[1]-i[1]*n[0],(a=i)[0]*(s=n)[0]+a[1]*s[1]))},e.co=U,e.cp=function(e,t){return ie[t]&&(e instanceof MouseEvent||e instanceof WheelEvent)},e.cq=function(e,t){return re[t]&&"touches"in e},e.cr=function(e){return re[e]||ie[e]},e.cs=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},e.ct=function(e,t){let{x:r,y:i}=Tu.fromLngLat(t);return!(e<0||e>25||i<0||i>=1||r<0||r>=1)},e.cu=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.cv=class extends Ya{},e.cw=Tc,e.cy=function(e){return e.message===ne},e.cz=he,e.d=ce,e.e=N,e.f=e=>t(void 0,void 0,void 0,(function*(){if(0===e.byteLength)return createImageBitmap(new ImageData(1,1));let t=new Blob([new Uint8Array(e)],{type:"image/png"});try{return createImageBitmap(t)}catch(e){throw new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}})),e.g=oe,e.h=e=>new Promise(((t,r)=>{let i=new Image;i.onload=()=>{t(i),URL.revokeObjectURL(i.src),i.onload=null,window.requestAnimationFrame((()=>{i.src=X}))},i.onerror=()=>r(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));let n=new Blob([new Uint8Array(e)],{type:"image/png"});i.src=e.byteLength?URL.createObjectURL(n):X})),e.i=K,e.j=(e,t)=>ue(N(e,{type:"json"}),t),e.k=ge,e.l=fe,e.m=ue,e.n=(e,t)=>ue(N(e,{type:"arrayBuffer"}),t),e.o=function(e){return new hA(e).readFields(vA,[])},e.p=xA,e.q=dl,e.r=ja,e.s=J,e.t=La,e.u=pa,e.v=ye,e.w=V,e.x=ea,e.y=na,e.z=Jn})),r("worker",0,(function(e){class t{constructor(e,t){this.keyCache={},e&&this.replace(e,t)}replace(e,t){this._layerConfigs={},this._layers={},this.update(e,[],t)}update(t,r,i){for(let r of t){this._layerConfigs[r.id]=r;let t=this._layers[r.id]=e.bJ(r,i);t._featureFilter=e.aa(t.filter,i),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(let e of r)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};let n=e.cC(Object.values(this._layerConfigs),this.keyCache);for(let e of n){let t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;let i=r.source||"",n=this.familiesBySource[i];n||(n=this.familiesBySource[i]={});let a=r.sourceLayer||"_geojsonTileLayer",s=n[a];s||(s=n[a]=[]),s.push(t)}}}class r{constructor(t){let r={},i=[];for(let e in t){let n=t[e],a=r[e]={};for(let e in n){let t=n[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;let r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};i.push(r),a[e]={rect:r,metrics:t.metrics}}}let{w:n,h:a}=e.p(i),s=new e.q({width:n||1,height:a||1});for(let i in t){let n=t[i];for(let t in n){let a=n[+t];if(!a||0===a.bitmap.width||0===a.bitmap.height)continue;let o=r[i][t].rect;e.q.copy(a.bitmap,s,{x:0,y:0},{x:o.x+1,y:o.y+1},a.bitmap)}}this.image=s,this.positions=r}}e.cD("GlyphAtlas",r);class i{constructor(t){this.tileID=new e.Z(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId,this.inFlightDependencies=[]}parse(t,i,a,s,o){return e._(this,void 0,void 0,(function*(){this.status="parsing",this.data=t,this.collisionBoxArray=new e.a8;let l=new e.cE(Object.keys(t.layers).sort()),h=new e.cF(this.tileID,this.promoteId);h.bucketLayerIDs=[];let A={},u={featureIndex:h,iconDependencies:{},patternDependencies:{},glyphDependencies:{},dashDependencies:{},availableImages:a,subdivisionGranularity:o},c=i.familiesBySource[this.source];for(let r in c){let i=t.layers[r];if(!i)continue;1===i.version&&e.w(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);let s=l.encode(r),o=[];for(let e=0;e<i.length;e++){let t=i.feature(e),n=h.getId(t,r);o.push({feature:t,id:n,index:e,sourceLayerIndex:s})}for(let t of c[r]){let r=t[0];r.source!==this.source&&e.w(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(n(t,this.zoom,a),(A[r.id]=r.createBucket({index:h.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:s,sourceID:this.source})).populate(o,u,this.tileID.canonical),h.bucketLayerIDs.push(t.map((e=>e.id))))}}let d=e.bN(u.glyphDependencies,(e=>Object.keys(e).map(Number)));this.inFlightDependencies.forEach((e=>e?.abort())),this.inFlightDependencies=[];let p=Promise.resolve({});if(Object.keys(d).length){let e=new AbortController;this.inFlightDependencies.push(e),p=s.sendAsync({type:"GG",data:{stacks:d,source:this.source,tileID:this.tileID,type:"glyphs"}},e)}let f=Object.keys(u.iconDependencies),g=Promise.resolve({});if(f.length){let e=new AbortController;this.inFlightDependencies.push(e),g=s.sendAsync({type:"GI",data:{icons:f,source:this.source,tileID:this.tileID,type:"icons"}},e)}let m=Object.keys(u.patternDependencies),y=Promise.resolve({});if(m.length){let e=new AbortController;this.inFlightDependencies.push(e),y=s.sendAsync({type:"GI",data:{icons:m,source:this.source,tileID:this.tileID,type:"patterns"}},e)}let _=u.dashDependencies,v=Promise.resolve({});if(Object.keys(_).length){let e=new AbortController;this.inFlightDependencies.push(e),v=s.sendAsync({type:"GDA",data:{dashes:_}},e)}let[w,b,x,B]=yield Promise.all([p,g,y,v]),C=new r(w),S=new e.cG(b,x);for(let t in A){let r=A[t];r instanceof e.a9?(n(r.layers,this.zoom,a),e.cH({bucket:r,glyphMap:w,glyphPositions:C.positions,imageMap:b,imagePositions:S.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical,subdivisionGranularity:u.subdivisionGranularity})):r.hasDependencies&&(r instanceof e.cI||r instanceof e.cJ||r instanceof e.cK)&&(n(r.layers,this.zoom,a),r.addFeatures(u,this.tileID.canonical,S.patternPositions,B))}return this.status="done",{buckets:Object.values(A).filter((e=>!e.isEmpty())),featureIndex:h,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:C.image,imageAtlas:S,dashPositions:B,glyphMap:this.returnDependencies?w:null,iconMap:this.returnDependencies?b:null,glyphPositions:this.returnDependencies?C.positions:null}}))}}function n(t,r,i){let n=new e.F(r);for(let e of t)e.recalculate(n,i)}class a{constructor(e,t,r){this.actor=e,this.layerIndex=t,this.availableImages=r,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){let i=yield e.n(t.request,r);try{return{vectorTile:new e.cL(new e.cM(i.data)),rawData:i.data,cacheControl:i.cacheControl,expires:i.expires}}catch(e){let r=new Uint8Array(i.data),n=`Unable to parse the tile at ${t.request.url}, `;throw n+=31===r[0]&&139===r[1]?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${e.message}`,new Error(n)}}))}loadTile(t){return e._(this,void 0,void 0,(function*(){let r=t.uid,n=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.cN(t.request),a=new i(t);this.loading[r]=a;let s=new AbortController;a.abort=s;try{let i=yield this.loadVectorTile(t,s);if(delete this.loading[r],!i)return null;let o=i.rawData,l={};i.expires&&(l.expires=i.expires),i.cacheControl&&(l.cacheControl=i.cacheControl);let h={};if(n){let e=n.finish();e&&(h.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=i.vectorTile;let A=a.parse(i.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);this.loaded[r]=a,this.fetching[r]={rawTileData:o,cacheControl:l,resourceTiming:h};try{let t=yield A;return e.e({rawTileData:o.slice(0)},t,l,h)}finally{delete this.fetching[r]}}catch(e){throw delete this.loading[r],a.status="done",this.loaded[r]=a,e}}))}reloadTile(t){return e._(this,void 0,void 0,(function*(){let r=t.uid;if(!this.loaded||!this.loaded[r])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");let i=this.loaded[r];if(i.showCollisionBoxes=t.showCollisionBoxes,"parsing"===i.status){let n,a=yield i.parse(i.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity);if(this.fetching[r]){let{rawTileData:t,cacheControl:i,resourceTiming:s}=this.fetching[r];delete this.fetching[r],n=e.e({rawTileData:t.slice(0)},a,i,s)}else n=a;return n}if("done"===i.status&&i.vectorTile)return i.parse(i.vectorTile,this.layerIndex,this.availableImages,this.actor,t.subdivisionGranularity)}))}abortTile(t){return e._(this,void 0,void 0,(function*(){let e=this.loading,r=t.uid;e&&e[r]&&e[r].abort&&(e[r].abort.abort(),delete e[r])}))}removeTile(t){return e._(this,void 0,void 0,(function*(){this.loaded&&this.loaded[t.uid]&&delete this.loaded[t.uid]}))}}class s{constructor(){this.loaded={}}loadTile(t){return e._(this,void 0,void 0,(function*(){let{uid:r,encoding:i,rawImageData:n,redFactor:a,greenFactor:s,blueFactor:o,baseShift:l}=t,h=n.width+2,A=n.height+2,u=e.b(n)?new e.R({width:h,height:A},yield e.cO(n,-1,-1,h,A)):n,c=new e.cP(r,u,i,a,s,o,l);return this.loaded=this.loaded||{},this.loaded[r]=c,c}))}removeTile(e){let t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}var o,l,h=function(){if(l)return o;function e(e,r){if(0!==e.length){t(e[0],r);for(var i=1;i<e.length;i++)t(e[i],!r)}}function t(e,t){for(var r=0,i=0,n=0,a=e.length,s=a-1;n<a;s=n++){var o=(e[n][0]-e[s][0])*(e[s][1]+e[n][1]),l=r+o;i+=Math.abs(r)>=Math.abs(o)?r-l+o:o-l+r,r=l}r+i>=0!=!!t&&e.reverse()}return l=1,o=function t(r,i){var n,a=r&&r.type;if("FeatureCollection"===a)for(n=0;n<r.features.length;n++)t(r.features[n],i);else if("GeometryCollection"===a)for(n=0;n<r.geometries.length;n++)t(r.geometries[n],i);else if("Feature"===a)t(r.geometry,i);else if("Polygon"===a)e(r.coordinates,i);else if("MultiPolygon"===a)for(n=0;n<r.coordinates.length;n++)e(r.coordinates[n],i);return r}}(),A=e.cQ(h);class u extends e.cS{constructor(t,r){super(new e.cM,0,r,[],[]),this.feature=t,this.type=t.type,this.properties=t.tags?t.tags:{},"id"in t&&("string"==typeof t.id?this.id=parseInt(t.id,10):"number"!=typeof t.id||isNaN(t.id)||(this.id=t.id))}loadGeometry(){let t=[],r=1===this.feature.type?[this.feature.geometry]:this.feature.geometry;for(let i of r){let r=[];for(let t of i)r.push(new e.P(t[0],t[1]));t.push(r)}return t}}class c extends e.cR{constructor(t,r){super(new e.cM),this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.version=r?r.version:1,this.extent=r?r.extent:4096,this.length=t.length,this.features=t}feature(e){return new u(this.features[e],this.extent)}}function d(e,t){t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);let r={keys:[],values:[],keycache:{},valuecache:{}};for(let i=0;i<e.length;i++)r.feature=e.feature(i),t.writeMessage(2,p,r);let i=r.keys;for(let e of i)t.writeStringField(3,e);let n=r.values;for(let e of n)t.writeMessage(4,_,e)}function p(e,t){if(!e.feature)return;let r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,f,e),t.writeVarintField(3,r.type),t.writeMessage(4,y,r)}function f(e,t){for(let r in e.feature?.properties){let i=e.feature.properties[r],n=e.keycache[r];if(null===i)continue;void 0===n&&(e.keys.push(r),n=e.keys.length-1,e.keycache[r]=n),t.writeVarint(n),"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i&&(i=JSON.stringify(i));let a=typeof i+":"+i,s=e.valuecache[a];void 0===s&&(e.values.push(i),s=e.values.length-1,e.valuecache[a]=s),t.writeVarint(s)}}function g(e,t){return(t<<3)+(7&e)}function m(e){return e<<1^e>>31}function y(e,t){let r=e.loadGeometry(),i=e.type,n=0,a=0;for(let s of r){let r=1;1===i&&(r=s.length),t.writeVarint(g(1,r));let o=3===i?s.length-1:s.length;for(let e=0;e<o;e++){1===e&&1!==i&&t.writeVarint(g(2,o-1));let r=s[e].x-n,l=s[e].y-a;t.writeVarint(m(r)),t.writeVarint(m(l)),n+=r,a+=l}3===e.type&&t.writeVarint(g(7,1))}}function _(e,t){let r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}let v={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},w=Math.fround||(b=new Float32Array(1),e=>(b[0]=+e,b[0]));var b;class x{constructor(e){this.options=Object.assign(Object.create(v),e),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(e){let{log:t,minZoom:r,maxZoom:i}=this.options;t&&console.time("total time");let n=`prepare ${e.length} points`;t&&console.time(n),this.points=e;let a=[];for(let t=0;t<e.length;t++){let r=e[t];if(!r.geometry)continue;let[i,n]=r.geometry.coordinates,s=w(S(i)),o=w(E(n));a.push(s,o,1/0,t,-1,1),this.options.reduce&&a.push(0)}let s=this.trees[i+1]=this._createTree(a);t&&console.timeEnd(n);for(let e=i;e>=r;e--){let r=+Date.now();s=this.trees[e]=this._createTree(this._cluster(s,e)),t&&console.log("z%d: %d clusters in %dms",e,s.numItems,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,e[1])),n=180===e[2]?180:((e[2]+180)%360+360)%360-180,a=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){let e=this.getClusters([r,i,180,a],t),s=this.getClusters([-180,i,n,a],t);return e.concat(s)}let s=this.trees[this._limitZoom(t)],o=s.range(S(r),E(a),S(n),E(i)),l=s.data,h=[];for(let e of o){let t=this.stride*e;h.push(l[t+5]>1?B(l,t,this.clusterProps):this.points[l[t+3]])}return h}getChildren(e){let t=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);let a=n.data;if(t*this.stride>=a.length)throw new Error(i);let s=this.options.radius/(this.options.extent*Math.pow(2,r-1)),o=n.within(a[t*this.stride],a[t*this.stride+1],s),l=[];for(let t of o){let r=t*this.stride;a[r+4]===e&&l.push(a[r+5]>1?B(a,r,this.clusterProps):this.points[a[r+3]])}if(0===l.length)throw new Error(i);return l}getLeaves(e,t,r){let i=[];return this._appendLeaves(i,e,t=t||10,r=r||0,0),i}getTile(e,t,r){let i=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:a,radius:s}=this.options,o=s/a,l=(r-o)/n,h=(r+1+o)/n,A={features:[]};return this._addTileFeatures(i.range((t-o)/n,l,(t+1+o)/n,h),i.data,t,r,n,A),0===t&&this._addTileFeatures(i.range(1-o/n,l,1,h),i.data,n,r,n,A),t===n-1&&this._addTileFeatures(i.range(0,l,o/n,h),i.data,-1,r,n,A),A.features.length?A:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){let r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,i,n){let a=this.getChildren(t);for(let t of a){let a=t.properties;if(a&&a.cluster?n+a.point_count<=i?n+=a.point_count:n=this._appendLeaves(e,a.cluster_id,r,i,n):n<i?n++:e.push(t),e.length===r)break}return n}_createTree(t){let r=new e.aI(t.length/this.stride|0,this.options.nodeSize,Float32Array);for(let e=0;e<t.length;e+=this.stride)r.add(t[e],t[e+1]);return r.finish(),r.data=t,r}_addTileFeatures(e,t,r,i,n,a){for(let s of e){let e,o,l,h=s*this.stride,A=t[h+5]>1;if(A)e=C(t,h,this.clusterProps),o=t[h],l=t[h+1];else{let r=this.points[t[h+3]];e=r.properties;let[i,n]=r.geometry.coordinates;o=S(i),l=E(n)}let u,c={type:1,geometry:[[Math.round(this.options.extent*(o*n-r)),Math.round(this.options.extent*(l*n-i))]],tags:e};u=A||this.options.generateId?t[h+3]:this.points[t[h+3]].id,void 0!==u&&(c.id=u),a.features.push(c)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){let{radius:r,extent:i,reduce:n,minPoints:a}=this.options,s=r/(i*Math.pow(2,t)),o=e.data,l=[],h=this.stride;for(let r=0;r<o.length;r+=h){if(o[r+2]<=t)continue;o[r+2]=t;let i=o[r],A=o[r+1],u=e.within(o[r],o[r+1],s),c=o[r+5],d=c;for(let e of u){let r=e*h;o[r+2]>t&&(d+=o[r+5])}if(d>c&&d>=a){let e,a=i*c,s=A*c,p=-1,f=(r/h<<5)+(t+1)+this.points.length;for(let i of u){let l=i*h;if(o[l+2]<=t)continue;o[l+2]=t;let A=o[l+5];a+=o[l]*A,s+=o[l+1]*A,o[l+4]=f,n&&(e||(e=this._map(o,r,!0),p=this.clusterProps.length,this.clusterProps.push(e)),n(e,this._map(o,l)))}o[r+4]=f,l.push(a/d,s/d,1/0,f,-1,d),n&&l.push(p)}else{for(let e=0;e<h;e++)l.push(o[r+e]);if(d>1)for(let e of u){let r=e*h;if(!(o[r+2]<=t)){o[r+2]=t;for(let e=0;e<h;e++)l.push(o[r+e])}}}}return l}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t,r){if(e[t+5]>1){let i=this.clusterProps[e[t+6]];return r?Object.assign({},i):i}let i=this.points[e[t+3]].properties,n=this.options.map(i);return r&&n===i?Object.assign({},n):n}}function B(e,t,r){return{type:"Feature",id:e[t+3],properties:C(e,t,r),geometry:{type:"Point",coordinates:[(i=e[t],360*(i-.5)),I(e[t+1])]}};var i}function C(e,t,r){let i=e[t+5],n=i>=1e4?`${Math.round(i/1e3)}k`:i>=1e3?Math.round(i/100)/10+"k":i,a=e[t+6],s=-1===a?{}:Object.assign({},r[a]);return Object.assign(s,{cluster:!0,cluster_id:e[t+3],point_count:i,point_count_abbreviated:n})}function S(e){return e/360+.5}function E(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function I(e){let t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function T(e,t,r,i){let n,a=i,s=t+(r-t>>1),o=r-t,l=e[t],h=e[t+1],A=e[r],u=e[r+1];for(let i=t+3;i<r;i+=3){let t=F(e[i],e[i+1],l,h,A,u);if(t>a)n=i,a=t;else if(t===a){let e=Math.abs(i-s);e<o&&(n=i,o=e)}}a>i&&(n-t>3&&T(e,t,n,i),e[n+2]=a,r-n>3&&T(e,n,r,i))}function F(e,t,r,i,n,a){let s=n-r,o=a-i;if(0!==s||0!==o){let l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return s=e-r,o=t-i,s*s+o*o}function P(e,t,r,i){let n={id:e??null,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if("Point"===t||"MultiPoint"===t||"LineString"===t)L(n,r);else if("Polygon"===t)L(n,r[0]);else if("MultiLineString"===t)for(let e of r)L(n,e);else if("MultiPolygon"===t)for(let e of r)L(n,e[0]);return n}function L(e,t){for(let r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function M(e,t,r,i){if(!t.geometry)return;let n=t.geometry.coordinates;if(n&&0===n.length)return;let a=t.geometry.type,s=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),o=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===a)k(n,o);else if("MultiPoint"===a)for(let e of n)k(e,o);else if("LineString"===a)U(n,o,s,!1);else if("MultiLineString"===a){if(r.lineMetrics){for(let r of n)o=[],U(r,o,s,!1),e.push(P(l,"LineString",o,t.properties));return}R(n,o,s,!1)}else if("Polygon"===a)R(n,o,s,!0);else{if("MultiPolygon"!==a){if("GeometryCollection"===a){for(let n of t.geometry.geometries)M(e,{id:l,geometry:n,properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(let e of n){let t=[];R(e,t,s,!0),o.push(t)}}e.push(P(l,a,o,t.properties))}function k(e,t){t.push(D(e[0]),N(e[1]),0)}function U(e,t,r,i){let n,a,s=0;for(let r=0;r<e.length;r++){let o=D(e[r][0]),l=N(e[r][1]);t.push(o,l,0),r>0&&(s+=i?(n*l-o*a)/2:Math.sqrt(Math.pow(o-n,2)+Math.pow(l-a,2))),n=o,a=l}let o=t.length-3;t[2]=1,T(t,0,o,r),t[o+2]=1,t.size=Math.abs(s),t.start=0,t.end=t.size}function R(e,t,r,i){for(let n=0;n<e.length;n++){let a=[];U(e[n],a,r,i),t.push(a)}}function D(e){return e/360+.5}function N(e){let t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function O(e,t,r,i,n,a,s,o){if(i/=t,a>=(r/=t)&&s<i)return e;if(s<r||a>=i)return null;let l=[];for(let t of e){let e=t.geometry,a=t.type,s=0===n?t.minX:t.minY,h=0===n?t.maxX:t.maxY;if(s>=r&&h<i){l.push(t);continue}if(h<r||s>=i)continue;let A=[];if("Point"===a||"MultiPoint"===a)Q(e,A,r,i,n);else if("LineString"===a)z(e,A,r,i,n,!1,o.lineMetrics);else if("MultiLineString"===a)j(e,A,r,i,n,!1);else if("Polygon"===a)j(e,A,r,i,n,!0);else if("MultiPolygon"===a)for(let t of e){let e=[];j(t,e,r,i,n,!0),e.length&&A.push(e)}if(A.length){if(o.lineMetrics&&"LineString"===a){for(let e of A)l.push(P(t.id,a,e,t.tags));continue}"LineString"!==a&&"MultiLineString"!==a||(1===A.length?(a="LineString",A=A[0]):a="MultiLineString"),"Point"!==a&&"MultiPoint"!==a||(a=3===A.length?"Point":"MultiPoint"),l.push(P(t.id,a,A,t.tags))}}return l.length?l:null}function Q(e,t,r,i,n){for(let a=0;a<e.length;a+=3){let s=e[a+n];s>=r&&s<=i&&V(t,e[a],e[a+1],e[a+2])}}function z(e,t,r,i,n,a,s){let o,l,h=H(e),A=0===n?G:K,u=e.start;for(let c=0;c<e.length-3;c+=3){let d=e[c],p=e[c+1],f=e[c+2],g=e[c+3],m=e[c+4],y=0===n?d:p,_=0===n?g:m,v=!1;s&&(o=Math.sqrt(Math.pow(d-g,2)+Math.pow(p-m,2))),y<r?_>r&&(l=A(h,d,p,g,m,r),s&&(h.start=u+o*l)):y>i?_<i&&(l=A(h,d,p,g,m,i),s&&(h.start=u+o*l)):V(h,d,p,f),_<r&&y>=r&&(l=A(h,d,p,g,m,r),v=!0),_>i&&y<=i&&(l=A(h,d,p,g,m,i),v=!0),!a&&v&&(s&&(h.end=u+o*l),t.push(h),h=H(e)),s&&(u+=o)}let c=e.length-3,d=e[c],p=e[c+1],f=0===n?d:p;f>=r&&f<=i&&V(h,d,p,e[c+2]),c=h.length-3,a&&c>=3&&(h[c]!==h[0]||h[c+1]!==h[1])&&V(h,h[0],h[1],h[2]),h.length&&t.push(h)}function H(e){let t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function j(e,t,r,i,n,a){for(let s of e)z(s,t,r,i,n,a,!1)}function V(e,t,r,i){e.push(t,r,i)}function G(e,t,r,i,n,a){let s=(a-t)/(i-t);return V(e,a,r+(n-r)*s,1),s}function K(e,t,r,i,n,a){let s=(a-r)/(n-r);return V(e,t+(i-t)*s,a,1),s}function q(e,t){let r=[];for(let i=0;i<e.length;i++){let n,a=e[i],s=a.type;if("Point"===s||"MultiPoint"===s||"LineString"===s)n=Z(a.geometry,t);else if("MultiLineString"===s||"Polygon"===s){n=[];for(let e of a.geometry)n.push(Z(e,t))}else if("MultiPolygon"===s){n=[];for(let e of a.geometry){let r=[];for(let i of e)r.push(Z(i,t));n.push(r)}}r.push(P(a.id,s,n,a.tags))}return r}function Z(e,t){let r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(let i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function W(e,t){if(e.transformed)return e;let r=1<<e.z,i=e.x,n=e.y;for(let a of e.features){let e=a.geometry,s=a.type;if(a.geometry=[],1===s)for(let s=0;s<e.length;s+=2)a.geometry.push($(e[s],e[s+1],t,r,i,n));else for(let s=0;s<e.length;s++){let o=[];for(let a=0;a<e[s].length;a+=2)o.push($(e[s][a],e[s][a+1],t,r,i,n));a.geometry.push(o)}}return e.transformed=!0,e}function $(e,t,r,i,n,a){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-a))]}function X(e,t,r,i,n){let a=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),s={features:[],numPoints:0,numSimplified:0,numFeatures:e.length,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(let t of e)Y(s,t,a,n);return s}function Y(e,t,r,i){let n=t.geometry,a=t.type,s=[];if(e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),"Point"===a||"MultiPoint"===a)for(let t=0;t<n.length;t+=3)s.push(n[t],n[t+1]),e.numPoints++,e.numSimplified++;else if("LineString"===a)J(s,n,e,r,!1,!1);else if("MultiLineString"===a||"Polygon"===a)for(let t=0;t<n.length;t++)J(s,n[t],e,r,"Polygon"===a,0===t);else if("MultiPolygon"===a)for(let t=0;t<n.length;t++){let i=n[t];for(let t=0;t<i.length;t++)J(s,i[t],e,r,!0,0===t)}if(s.length){let r=t.tags||null;if("LineString"===a&&i.lineMetrics){r={};for(let e in t.tags)r[e]=t.tags[e];r.mapbox_clip_start=n.start/n.size,r.mapbox_clip_end=n.end/n.size}let o={geometry:s,type:"Polygon"===a||"MultiPolygon"===a?3:"LineString"===a||"MultiLineString"===a?2:1,tags:r};null!==t.id&&(o.id=t.id),e.features.push(o)}}function J(e,t,r,i,n,a){let s=i*i;if(i>0&&t.size<(n?s:i))return void(r.numPoints+=t.length/3);let o=[];for(let e=0;e<t.length;e+=3)(0===i||t[e+2]>s)&&(r.numSimplified++,o.push(t[e],t[e+1])),r.numPoints++;n&&function(e,t){let r=0;for(let t=0,i=e.length,n=i-2;t<i;n=t,t+=2)r+=(e[t]-e[n])*(e[t+1]+e[n+1]);if(r>0===t)for(let t=0,r=e.length;t<r/2;t+=2){let i=e[t],n=e[t+1];e[t]=e[r-2-t],e[t+1]=e[r-1-t],e[r-2-t]=i,e[r-1-t]=n}}(o,a),e.push(o)}let ee={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class te{constructor(e,t){let r=(t=this.options=function(e,t){for(let r in t)e[r]=t[r];return e}(Object.create(ee),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");let i=function(e,t){let r=[];if("FeatureCollection"===e.type)for(let i=0;i<e.features.length;i++)M(r,e.features[i],t,i);else M(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){let r=t.buffer/t.extent,i=e,n=O(e,1,-1-r,r,0,-1,2,t),a=O(e,1,1-r,2+r,0,-1,2,t);return(n||a)&&(i=O(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=q(n,1).concat(i)),a&&(i=i.concat(q(a,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),r&&(i.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(e,t,r,i,n,a,s){let o=[e,t,r,i],l=this.options,h=l.debug;for(;o.length;){i=o.pop(),r=o.pop(),t=o.pop(),e=o.pop();let A=1<<t,u=re(t,r,i),c=this.tiles[u];if(!c&&(h>1&&console.time("creation"),c=this.tiles[u]=X(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),h)){h>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,c.numFeatures,c.numPoints,c.numSimplified),console.timeEnd("creation"));let e=`z${t}`;this.stats[e]=(this.stats[e]||0)+1,this.total++}if(c.source=e,null==n){if(t===l.indexMaxZoom||c.numPoints<=l.indexMaxPoints)continue}else{if(t===l.maxZoom||t===n)continue;if(null!=n){let e=n-t;if(r!==a>>e||i!==s>>e)continue}}if(c.source=null,0===e.length)continue;h>1&&console.time("clipping");let d=.5*l.buffer/l.extent,p=.5-d,f=.5+d,g=1+d,m=null,y=null,_=null,v=null,w=O(e,A,r-d,r+f,0,c.minX,c.maxX,l),b=O(e,A,r+p,r+g,0,c.minX,c.maxX,l);e=null,w&&(m=O(w,A,i-d,i+f,1,c.minY,c.maxY,l),y=O(w,A,i+p,i+g,1,c.minY,c.maxY,l),w=null),b&&(_=O(b,A,i-d,i+f,1,c.minY,c.maxY,l),v=O(b,A,i+p,i+g,1,c.minY,c.maxY,l),b=null),h>1&&console.timeEnd("clipping"),o.push(m||[],t+1,2*r,2*i),o.push(y||[],t+1,2*r,2*i+1),o.push(_||[],t+1,2*r+1,2*i),o.push(v||[],t+1,2*r+1,2*i+1)}}getTile(e,t,r){e=+e,t=+t,r=+r;let i=this.options,{extent:n,debug:a}=i;if(e<0||e>24)return null;let s=1<<e,o=re(e,t=t+s&s-1,r);if(this.tiles[o])return W(this.tiles[o],n);a>1&&console.log("drilling down to z%d-%d-%d",e,t,r);let l,h=e,A=t,u=r;for(;!l&&h>0;)h--,A>>=1,u>>=1,l=this.tiles[re(h,A,u)];return l&&l.source?(a>1&&(console.log("found parent tile z%d-%d-%d",h,A,u),console.time("drilling down")),this.splitTile(l.source,h,A,u,e,t,r),a>1&&console.timeEnd("drilling down"),this.tiles[o]?W(this.tiles[o],n):null):null}}function re(e,t,r){return 32*((1<<e)*r+t)+e}class ie extends a{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(t,r){return e._(this,void 0,void 0,(function*(){let r=t.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");let i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return null;let n=new c(i.features,{version:2,extent:e.$}),a=function(t){let r=new e.cM;return function(e,t){for(let r in e.layers)t.writeMessage(3,d,e.layers[r])}(t,r),r.finish()}(n);return 0===a.byteOffset&&a.byteLength===a.buffer.byteLength||(a=new Uint8Array(a)),{vectorTile:n,rawData:a.buffer}}))}loadData(t){return e._(this,void 0,void 0,(function*(){var r;null===(r=this._pendingRequest)||void 0===r||r.abort();let i=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.cN(t.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(t,this._pendingRequest);let r=yield this._pendingData;this._geoJSONIndex=t.cluster?new x(function({superclusterOptions:t,clusterProperties:r}){if(!r||!t)return t;let i={},n={},a={accumulated:null,zoom:0},s={properties:null},o=Object.keys(r);for(let t of o){let[a,s]=r[t],o=e.cT(s),l=e.cT("string"==typeof a?[a,["accumulated"],["get",t]]:a);i[t]=o.value,n[t]=l.value}return t.map=e=>{s.properties=e;let t={};for(let e of o)t[e]=i[e].evaluate(a,s);return t},t.reduce=(e,t)=>{s.properties=t;for(let t of o)a.accumulated=e[t],e[t]=n[t].evaluate(a,s)},t}(t)).load(r.features):(n=r,a=t.geojsonVtOptions,new te(n,a)),this.loaded={};let s={data:r};if(i){let e=i.finish();e&&(s.resourceTiming={},s.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}return s}catch(t){if(delete this._pendingRequest,e.cy(t))return{abandoned:!0};throw t}var n,a}))}getData(){return e._(this,void 0,void 0,(function*(){return this._pendingData}))}reloadTile(e){let t=this.loaded;return t&&t[e.uid]?super.reloadTile(e):this.loadTile(e)}loadAndProcessGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let i=yield this.loadGeoJSON(t,r);if(delete this._pendingRequest,"object"!=typeof i)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(A(i,!0),t.filter){let r=e.cT(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));i={type:"FeatureCollection",features:i.features.filter((e=>r.value.evaluate({zoom:0},e)))}}return i}))}loadGeoJSON(t,r){return e._(this,void 0,void 0,(function*(){let{promoteId:i}=t;if(t.request){let n=yield e.j(t.request,r);return this._dataUpdateable=e.cV(n.data,i)?e.cU(n.data,i):void 0,n.data}if("string"==typeof t.data)try{let r=JSON.parse(t.data);return this._dataUpdateable=e.cV(r,i)?e.cU(r,i):void 0,r}catch{throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`)}if(!t.dataDiff)throw new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${t.source}`);return e.cW(this._dataUpdateable,t.dataDiff,i),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}}))}removeSource(t){return e._(this,void 0,void 0,(function*(){this._pendingRequest&&this._pendingRequest.abort()}))}getClusterExpansionZoom(e){return this._geoJSONIndex.getClusterExpansionZoom(e.clusterId)}getClusterChildren(e){return this._geoJSONIndex.getChildren(e.clusterId)}getClusterLeaves(e){return this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset)}}class ne{constructor(t){this.self=t,this.actor=new e.J(t),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.globalStates=new Map,this.self.registerWorkerSource=(e,t)=>{if(this.externalWorkerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.externalWorkerSourceTypes[e]=t},this.self.addProtocol=e.cA,this.self.removeProtocol=e.cB,this.self.registerRTLTextPlugin=t=>{e.cX.setMethods(t)},this.actor.registerMessageHandler("LDT",((e,t)=>this._getDEMWorkerSource(e,t.source).loadTile(t))),this.actor.registerMessageHandler("RDT",((t,r)=>e._(this,void 0,void 0,(function*(){this._getDEMWorkerSource(t,r.source).removeTile(r)})))),this.actor.registerMessageHandler("GCEZ",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterExpansionZoom(r)})))),this.actor.registerMessageHandler("GCC",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterChildren(r)})))),this.actor.registerMessageHandler("GCL",((t,r)=>e._(this,void 0,void 0,(function*(){return this._getWorkerSource(t,r.type,r.source).getClusterLeaves(r)})))),this.actor.registerMessageHandler("LD",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadData(t))),this.actor.registerMessageHandler("GD",((e,t)=>this._getWorkerSource(e,t.type,t.source).getData())),this.actor.registerMessageHandler("LT",((e,t)=>this._getWorkerSource(e,t.type,t.source).loadTile(t))),this.actor.registerMessageHandler("RT",((e,t)=>this._getWorkerSource(e,t.type,t.source).reloadTile(t))),this.actor.registerMessageHandler("AT",((e,t)=>this._getWorkerSource(e,t.type,t.source).abortTile(t))),this.actor.registerMessageHandler("RMT",((e,t)=>this._getWorkerSource(e,t.type,t.source).removeTile(t))),this.actor.registerMessageHandler("RS",((t,r)=>e._(this,void 0,void 0,(function*(){if(!this.workerSources[t]||!this.workerSources[t][r.type]||!this.workerSources[t][r.type][r.source])return;let e=this.workerSources[t][r.type][r.source];delete this.workerSources[t][r.type][r.source],void 0!==e.removeSource&&e.removeSource(r)})))),this.actor.registerMessageHandler("RM",(t=>e._(this,void 0,void 0,(function*(){delete this.layerIndexes[t],delete this.availableImages[t],delete this.workerSources[t],delete this.demWorkerSources[t],this.globalStates.delete(t)})))),this.actor.registerMessageHandler("SR",((t,r)=>e._(this,void 0,void 0,(function*(){this.referrer=r})))),this.actor.registerMessageHandler("SRPS",((e,t)=>this._syncRTLPluginState(e,t))),this.actor.registerMessageHandler("IS",((t,r)=>e._(this,void 0,void 0,(function*(){this.self.importScripts(r)})))),this.actor.registerMessageHandler("SI",((e,t)=>this._setImages(e,t))),this.actor.registerMessageHandler("UL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).update(r.layers,r.removedIds,this._getGlobalState(t))})))),this.actor.registerMessageHandler("UGS",((t,r)=>e._(this,void 0,void 0,(function*(){let e=this._getGlobalState(t);for(let t in r)e[t]=r[t]})))),this.actor.registerMessageHandler("SL",((t,r)=>e._(this,void 0,void 0,(function*(){this._getLayerIndex(t).replace(r,this._getGlobalState(t))}))))}_getGlobalState(e){let t=this.globalStates.get(e);return t||(t={},this.globalStates.set(e,t)),t}_setImages(t,r){return e._(this,void 0,void 0,(function*(){this.availableImages[t]=r;for(let e in this.workerSources[t]){let i=this.workerSources[t][e];for(let e in i)i[e].availableImages=r}}))}_syncRTLPluginState(t,r){return e._(this,void 0,void 0,(function*(){return yield e.cX.syncState(r,this.self.importScripts)}))}_getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}_getLayerIndex(e){let r=this.layerIndexes[e];return r||(r=this.layerIndexes[e]=new t),r}_getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){let i={sendAsync:(t,r)=>(t.targetMapId=e,this.actor.sendAsync(t,r))};switch(t){case"vector":this.workerSources[e][t][r]=new a(i,this._getLayerIndex(e),this._getAvailableImages(e));break;case"geojson":this.workerSources[e][t][r]=new ie(i,this._getLayerIndex(e),this._getAvailableImages(e));break;default:this.workerSources[e][t][r]=new this.externalWorkerSourceTypes[t](i,this._getLayerIndex(e),this._getAvailableImages(e))}}return this.workerSources[e][t][r]}_getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new s),this.demWorkerSources[e][t]}}return e.i(self)&&(self.worker=new ne(self)),ne})),r("index",0,(function(e,t){var r="5.8.0";function i(){var e=new t.A(4);return t.A!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e}let n,a,s={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(e,r,i){let n=requestAnimationFrame((e=>{a(),r(e)})),{unsubscribe:a}=t.s(e.signal,"abort",(()=>{a(),cancelAnimationFrame(n),i(t.c())}),!1)},frameAsync(e){return new Promise(((t,r)=>{this.frame(e,t,r)}))},getImageData(e,t=0){return this.getImageCanvasContext(e).getImageData(-t,-t,e.width+2*t,e.height+2*t)},getImageCanvasContext(e){let t=window.document.createElement("canvas"),r=t.getContext("2d",{willReadFrequently:!0});if(!r)throw new Error("failed to create canvas 2d context");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0,e.width,e.height),r},resolveURL:e=>(n||(n=document.createElement("a")),n.href=e,n.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==a&&(a=matchMedia("(prefers-reduced-motion: reduce)")),a.matches)}};class o{static testProp(e){if(!o.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in o.docStyle)return e[t];return e[0]}static create(e,t,r){let i=window.document.createElement(e);return void 0!==t&&(i.className=t),r&&r.appendChild(i),i}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(e,t){e.style[o.transformProp]=t}static addEventListener(e,t,r,i={}){e.addEventListener(t,r,"passive"in i?i:i.capture)}static removeEventListener(e,t,r,i={}){e.removeEventListener(t,r,"passive"in i?i:i.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static getScale(e){let t=e.getBoundingClientRect();return{x:t.width/e.offsetWidth||1,y:t.height/e.offsetHeight||1,boundingClientRect:t}}static getPoint(e,r,i){let n=r.boundingClientRect;return new t.P((i.clientX-n.left)/r.x-e.clientLeft,(i.clientY-n.top)/r.y-e.clientTop)}static mousePos(e,t){let r=o.getScale(e);return o.getPoint(e,r,t)}static touchPos(e,t){let r=[],i=o.getScale(e);for(let n=0;n<t.length;n++)r.push(o.getPoint(e,i,t[n]));return r}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}static sanitize(e){let t=(new DOMParser).parseFromString(e,"text/html").body||document.createElement("body"),r=t.querySelectorAll("script");for(let e of r)e.remove();return o.clean(t),t.innerHTML}static isPossiblyDangerous(e,t){let r=t.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href"].includes(e)||!r.includes("javascript:")&&!r.includes("data:"))||!!e.startsWith("on")||void 0}static clean(e){let t=e.children;for(let e of t)o.removeAttributes(e),o.clean(e)}static removeAttributes(e){for(let{name:t,value:r}of e.attributes)o.isPossiblyDangerous(t,r)&&e.removeAttribute(t)}}o.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);let l,h,A={supported:!1,testSupport:function(e){!u&&h&&(c?d(e):l=e)}},u=!1,c=!1;function d(e){let t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,h),e.isContextLost())return;A.supported=!0}catch{}e.deleteTexture(t),u=!0}var p;typeof document<"u"&&(h=document.createElement("img"),h.onload=()=>{l&&d(l),l=null,c=!0},h.onerror=()=>{u=!0,l=null},h.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(e){let r,i,n,a;e.resetRequestQueue=()=>{r=[],i=0,n=0,a={}},e.addThrottleControl=e=>{let t=n++;return a[t]=e,t},e.removeThrottleControl=e=>{delete a[e],o()},e.getImage=(e,i,n=!0)=>new Promise(((a,s)=>{A.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),t.e(e,{type:"image"}),r.push({abortController:i,requestParameters:e,supportImageRefresh:n,state:"queued",onError:e=>{s(e)},onSuccess:e=>{a(e)}}),o()}));let s=e=>t._(this,void 0,void 0,(function*(){e.state="running";let{requestParameters:r,supportImageRefresh:n,onError:a,onSuccess:s,abortController:h}=e,A=!1===n&&!t.i(self)&&!t.g(r.url)&&(!r.headers||Object.keys(r.headers).reduce(((e,t)=>e&&"accept"===t),!0));i++;let u=A?l(r,h):t.m(r,h);try{let r=yield u;delete e.abortController,e.state="completed",r.data instanceof HTMLImageElement||t.b(r.data)?s(r):r.data&&s({data:yield(c=r.data,"function"==typeof createImageBitmap?t.f(c):t.h(c)),cacheControl:r.cacheControl,expires:r.expires})}catch(t){delete e.abortController,a(t)}finally{i--,o()}var c})),o=()=>{let e=(()=>{for(let e of Object.keys(a))if(a[e]())return!0;return!1})()?t.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:t.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let t=i;t<e&&r.length>0;t++){let e=r.shift();e.abortController.signal.aborted?t--:s(e)}},l=(e,r)=>new Promise(((i,n)=>{let a=new Image,s=e.url,o=e.credentials;o&&"include"===o?a.crossOrigin="use-credentials":(o&&"same-origin"===o||!t.d(s))&&(a.crossOrigin="anonymous"),r.signal.addEventListener("abort",(()=>{a.src="",n(t.c())})),a.fetchPriority="high",a.onload=()=>{a.onerror=a.onload=null,i({data:a})},a.onerror=()=>{a.onerror=a.onload=null,r.signal.aborted||n(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))},a.src=s}))}(p||(p={})),p.resetRequestQueue();class f{constructor(e){this._transformRequestFn=e??null}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function g(e){let t=[];if("string"==typeof e)t.push({id:"default",url:e});else if(e&&e.length>0){let r=[];for(let{id:i,url:n}of e){let e=`${i}${n}`;-1===r.indexOf(e)&&(r.push(e),t.push({id:i,url:n}))}}return t}function m(e,t,r){try{let i=new URL(e);return i.pathname+=`${t}${r}`,i.toString()}catch{throw new Error(`Invalid sprite URL "${e}", must be absolute. Modify style specification directly or use TransformStyleFunction to correct the issue dynamically`)}}function y(e){let{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class _ extends t.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(let{ids:e,promiseResolve:t}of this.requestors)t(this._getImagesForIds(e));this.requestors=[]}}getImage(e){let r=this.images[e];if(r&&!r.data&&r.spriteData){let e=r.spriteData;r.data=new t.R({width:e.width,height:e.height},e.context.getImageData(e.x,e.y,e.width,e.height).data),r.spriteData=null}return r}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(e,r){let i=!0,n=r.data||r.spriteData;return this._validateStretch(r.stretchX,n&&n.width)||(this.fire(new t.k(new Error(`Image "${e}" has invalid "stretchX" value`))),i=!1),this._validateStretch(r.stretchY,n&&n.height)||(this.fire(new t.k(new Error(`Image "${e}" has invalid "stretchY" value`))),i=!1),this._validateContent(r.content,r)||(this.fire(new t.k(new Error(`Image "${e}" has invalid "content" value`))),i=!1),i}_validateStretch(e,t){if(!e)return!0;let r=0;for(let i of e){if(i[0]<r||i[1]<i[0]||t<i[1])return!1;r=i[1]}return!0}_validateContent(e,t){if(!e)return!0;if(4!==e.length)return!1;let r=t.spriteData,i=r&&r.width||t.data.width,n=r&&r.height||t.data.height;return!(e[0]<0||i<e[0]||e[1]<0||n<e[1]||e[2]<0||i<e[2]||e[3]<0||n<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,t,r=!0){let i=this.getImage(e);if(r&&(i.data.width!==t.data.width||i.data.height!==t.data.height))throw new Error(`size mismatch between old image (${i.data.width}x${i.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=i.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){let t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise(((t,r)=>{let i=!0;if(!this.isLoaded())for(let t of e)this.images[t]||(i=!1);this.isLoaded()||i?t(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:t})}))}_getImagesForIds(e){let r={};for(let i of e){let e=this.getImage(i);e||(this.fire(new t.l("styleimagemissing",{id:i})),e=this.getImage(i)),e?r[i]={data:e.data.clone(),pixelRatio:e.pixelRatio,sdf:e.sdf,version:e.version,stretchX:e.stretchX,stretchY:e.stretchY,content:e.content,textFitWidth:e.textFitWidth,textFitHeight:e.textFitHeight,hasRenderCallback:!(!e.userImage||!e.userImage.render)}:t.w(`Image "${i}" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.`)}return r}getPixelSize(){let{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(e){let r=this.patterns[e],i=this.getImage(e);if(!i)return null;if(r&&r.position.version===i.version)return r.position;if(r)r.position.version=i.version;else{let r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},n=new t.I(r,i);this.patterns[e]={bin:r,position:n}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){let r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.T(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)}_updatePatternAtlas(){let e=[];for(let t in this.patterns)e.push(this.patterns[t].bin);let{w:r,h:i}=t.p(e),n=this.atlasImage;n.resize({width:r||1,height:i||1});for(let e in this.patterns){let{bin:r}=this.patterns[e],i=r.x+1,a=r.y+1,s=this.getImage(e).data,o=s.width,l=s.height;t.R.copy(s,n,{x:0,y:0},{x:i,y:a},{width:o,height:l}),t.R.copy(s,n,{x:0,y:l-1},{x:i,y:a-1},{width:o,height:1}),t.R.copy(s,n,{x:0,y:0},{x:i,y:a+l},{width:o,height:1}),t.R.copy(s,n,{x:o-1,y:0},{x:i-1,y:a},{width:1,height:l}),t.R.copy(s,n,{x:0,y:0},{x:i+o,y:a},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(let r of e){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;let e=this.getImage(r);e||t.w(`Image with ID: "${r}" was not found`),y(e)&&this.updateImage(r,e)}}}let v,w=1e20;function b(e,t,r,i,n,a,s,o,l){for(let h=t;h<t+i;h++)x(e,r*a+h,a,n,s,o,l);for(let h=r;h<r+n;h++)x(e,h*a+t,1,i,s,o,l)}function x(e,t,r,i,n,a,s){a[0]=0,s[0]=-w,s[1]=w,n[0]=e[t];for(let o=1,l=0,h=0;o<i;o++){n[o]=e[t+o*r];let i=o*o;do{let e=a[l];h=(n[o]-n[e]+i-e*e)/(o-e)/2}while(h<=s[l]&&--l>-1);l++,a[l]=o,s[l]=h,s[l+1]=w}for(let o=0,l=0;o<i;o++){for(;s[l+1]<o;)l++;let i=a[l],h=o-i;e[t+o*r]=n[i]+h*h}}class B{constructor(e,t,r){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={},this.lang=r}setURL(e){this.url=e}getGlyphs(e){return t._(this,void 0,void 0,(function*(){let t=[];for(let r in e)for(let i of e[r])t.push(this._getAndCacheGlyphsPromise(r,i));let r=yield Promise.all(t),i={};for(let{stack:e,id:t,glyph:n}of r)i[e]||(i[e]={}),i[e][t]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};return i}))}_getAndCacheGlyphsPromise(e,r){return t._(this,void 0,void 0,(function*(){let t=this.entries[e];t||(t=this.entries[e]={glyphs:{},requests:{},ranges:{}});let i=t.glyphs[r];if(void 0!==i)return{stack:e,id:r,glyph:i};if(i=this._tinySDF(t,e,r),i)return t.glyphs[r]=i,{stack:e,id:r,glyph:i};let n=Math.floor(r/256);if(256*n>65535)throw new Error("glyphs > 65535 not supported");if(t.ranges[n])return{stack:e,id:r,glyph:i};if(!this.url)throw new Error("glyphsUrl is not set");if(!t.requests[n]){let r=B.loadGlyphRange(e,n,this.url,this.requestManager);t.requests[n]=r}let a=yield t.requests[n];for(let e in a)this._doesCharSupportLocalGlyph(+e)||(t.glyphs[+e]=a[+e]);return t.ranges[n]=!0,{stack:e,id:r,glyph:a[r]||null}}))}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&(/\p{Ideo}|\p{sc=Hang}|\p{sc=Hira}|\p{sc=Kana}/u.test(String.fromCodePoint(e))||t.u["CJK Unified Ideographs"](e)||t.u["Hangul Syllables"](e)||t.u.Hiragana(e)||t.u.Katakana(e)||t.u["CJK Symbols and Punctuation"](e)||t.u["Halfwidth and Fullwidth Forms"](e))}_tinySDF(e,r,i){let n=this.localIdeographFontFamily;if(!n||!this._doesCharSupportLocalGlyph(i))return;let a=e.tinySDF;if(!a){let t="400";/bold/i.test(r)?t="900":/medium/i.test(r)?t="500":/light/i.test(r)&&(t="200"),a=e.tinySDF=new B.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,lang:this.lang,fontFamily:n,fontWeight:t})}let s=a.draw(String.fromCharCode(i));return{id:i,bitmap:new t.q({width:s.width||60,height:s.height||60},s.data),metrics:{width:s.glyphWidth/2||24,height:s.glyphHeight/2||24,left:s.glyphLeft/2+.5||0,top:s.glyphTop/2-27.5||-8,advance:s.glyphAdvance/2||24,isDoubleResolution:!0}}}}B.loadGlyphRange=function(e,r,i,n){return t._(this,void 0,void 0,(function*(){let a=256*r,s=a+255,o=n.transformRequest(i.replace("{fontstack}",e).replace("{range}",`${a}-${s}`),"Glyphs"),l=yield t.n(o,new AbortController);if(!l||!l.data)throw new Error(`Could not load glyph range. range: ${r}, ${a}-${s}`);let h={};for(let e of t.o(l.data))h[e.id]=e;return h}))},B.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:i=.25,fontFamily:n="sans-serif",fontWeight:a="normal",fontStyle:s="normal",lang:o=null}={}){this.buffer=t,this.cutoff=i,this.radius=r,this.lang=o;let l=this.size=e+4*t,h=this._createCanvas(l),A=this.ctx=h.getContext("2d",{willReadFrequently:!0});A.font=`${s} ${a} ${e}px ${n}`,A.textBaseline="alphabetic",A.textAlign="left",A.fillStyle="black",this.gridOuter=new Float64Array(l*l),this.gridInner=new Float64Array(l*l),this.f=new Float64Array(l),this.z=new Float64Array(l+1),this.v=new Uint16Array(l)}_createCanvas(e){let t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){let{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:i,actualBoundingBoxLeft:n,actualBoundingBoxRight:a}=this.ctx.measureText(e),s=Math.ceil(r),o=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(a-n))),l=Math.min(this.size-this.buffer,s+Math.ceil(i)),h=o+2*this.buffer,A=l+2*this.buffer,u=Math.max(h*A,0),c=new Uint8ClampedArray(u),d={data:c,width:h,height:A,glyphWidth:o,glyphHeight:l,glyphTop:s,glyphLeft:0,glyphAdvance:t};if(0===o||0===l)return d;let{ctx:p,buffer:f,gridInner:g,gridOuter:m}=this;this.lang&&(p.lang=this.lang),p.clearRect(f,f,o,l),p.fillText(e,f,f+s);let y=p.getImageData(f,f,o,l);m.fill(w,0,u),g.fill(0,0,u);for(let e=0;e<l;e++)for(let t=0;t<o;t++){let r=y.data[4*(e*o+t)+3]/255;if(0===r)continue;let i=(e+f)*h+t+f;if(1===r)m[i]=0,g[i]=w;else{let e=.5-r;m[i]=e>0?e*e:0,g[i]=e<0?e*e:0}}b(m,0,0,h,A,h,this.f,this.v,this.z),b(g,f,f,o,l,h,this.f,this.v,this.z);for(let e=0;e<u;e++){let t=Math.sqrt(m[e])-Math.sqrt(g[e]);c[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return d}};class C{constructor(){this.specification=t.v.light.position}possiblyEvaluate(e,r){return t.B(e.expression.evaluate(r))}interpolate(e,r,i){return{x:t.C.number(e.x,r.x,i),y:t.C.number(e.y,r.y,i),z:t.C.number(e.z,r.z,i)}}}class S extends t.E{constructor(e){super(),v=v||new t.r({anchor:new t.D(t.v.light.anchor),position:new C,color:new t.D(t.v.light.color),intensity:new t.D(t.v.light.intensity)}),this._transitionable=new t.t(v,void 0),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,r={}){if(!this._validate(t.x,e,r))for(let t in e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,i){return(!i||!1!==i.validate)&&t.y(this,e.call(t.z,{value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v}))}}let E=new t.r({"sky-color":new t.D(t.v.sky["sky-color"]),"horizon-color":new t.D(t.v.sky["horizon-color"]),"fog-color":new t.D(t.v.sky["fog-color"]),"fog-ground-blend":new t.D(t.v.sky["fog-ground-blend"]),"horizon-fog-blend":new t.D(t.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new t.D(t.v.sky["sky-horizon-blend"]),"atmosphere-blend":new t.D(t.v.sky["atmosphere-blend"])});class I extends t.E{constructor(e){super(),this._transitionable=new t.t(E,void 0),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.F(0))}setSky(e,r={}){if(!this._validate(t.G,e,r)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(let t in e){let r=e[t];t.endsWith("-transition")?this._transitionable.setTransition(t.slice(0,-11),r):this._transitionable.setValue(t,r)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,r,i={}){return!1!==i?.validate&&t.y(this,e.call(t.z,t.e({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class T{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){let r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){let i=[],n=e.length%2==1?-e[e.length-1]*r:0,a=e[0]*r,s=!0;i.push({left:n,right:a,isDash:s,zeroLength:0===e[0]});let o=e[0];for(let t=1;t<e.length;t++){s=!s;let l=e[t];n=o*r,o+=l,a=o*r,i.push({left:n,right:a,isDash:s,zeroLength:0===l})}return i}addRoundDash(e,t,r){let i=t/2;for(let t=-r;t<=r;t++){let n=this.width*(this.nextRow+r+t),a=0,s=e[a];for(let o=0;o<this.width;o++){o/s.right>1&&(s=e[++a]);let l,h=Math.abs(o-s.left),A=Math.abs(o-s.right),u=Math.min(h,A),c=t/r*(i+1);if(s.isDash){let e=i-Math.abs(c);l=Math.sqrt(u*u+e*e)}else l=i-Math.sqrt(u*u+c*c);this.data[n+o]=Math.max(0,Math.min(255,l+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){let r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}let t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);let i=this.width*this.nextRow,n=0,a=e[n];for(let t=0;t<this.width;t++){t/a.right>1&&(a=e[++n]);let r=Math.abs(t-a.left),s=Math.abs(t-a.right),o=Math.min(r,s);this.data[i+t]=Math.max(0,Math.min(255,(a.isDash?o:-o)+128))}}addDash(e,r){let i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return t.w("LineAtlas out of space"),null;let a=0;for(let t=0;t<e.length;t++)a+=e[t];if(0!==a){let t=this.width/a,n=this.getDashRanges(e,this.width,t);r?this.addRoundDash(n,t,i):this.addRegularDash(n)}let s={y:this.nextRow+i,height:2*i,width:a};return this.nextRow+=n,this.dirty=!0,s}bind(e){let t=e.gl;this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))}}let F="maplibre_preloaded_worker_pool";class P{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<P.workerCount;)this.workers.push(new Worker(t.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[F]}numActive(){return Object.keys(this.active).length}}let L,M,k=Math.floor(s.hardwareConcurrency/2);function U(){return L||(L=new P),L}P.workerCount=t.H(globalThis)?Math.max(Math.min(k,3),1):1;class R{constructor(e,r){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=r;let i=this.workerPool.acquire(r);for(let e=0;e<i.length;e++){let n=new t.J(i[e],r);n.name=`Worker ${e}`,this.actors.push(n)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,t){let r=[];for(let i of this.actors)r.push(i.sendAsync({type:e,data:t}));return Promise.all(r)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach((e=>{e.remove()})),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,t){for(let r of this.actors)r.registerMessageHandler(e,t)}}function D(){return M||(M=new R(U(),t.K),M.registerMessageHandler("GR",((e,r,i)=>t.m(r,i)))),M}function N(e,r){let i=t.L();return t.M(i,i,[1,1,0]),t.N(i,i,[.5*e.width,.5*e.height,1]),e.calculatePosMatrix?t.O(i,i,e.calculatePosMatrix(r.toUnwrapped())):i}function O(e,t,r,i,n,a,s){var o;let l=function(e,t,r){if(e)for(let i of e){let e=t[i];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(let e in t){let i=t[e];if(i.source===r&&"fill-extrusion"===i.type)return!0}return!1}(null!==(o=n?.layers)&&void 0!==o?o:null,t,e.id),h=a.maxPitchScaleFactor(),A=e.tilesIn(i,h,l);A.sort(Q);let u=[];for(let i of A)u.push({wrappedTileID:i.tileID.wrapped().key,queryResults:i.tile.queryRenderedFeatures(t,r,e._state,i.queryGeometry,i.cameraQueryGeometry,i.scale,n,a,h,N(e.transform,i.tileID),s?(e,t)=>s(i.tileID,e,t):void 0)});return function(e,t){for(let r in e)for(let i of e[r])z(i,t);return e}(function(e){let t={},r={};for(let i of e){let e=i.queryResults,n=i.wrappedTileID,a=r[n]=r[n]||{};for(let r in e){let i=e[r],n=a[r]=a[r]||{},s=t[r]=t[r]||[];for(let e of i)n[e.featureIndex]||(n[e.featureIndex]=!0,s.push(e))}}return t}(u),e)}function Q(e,t){let r=e.tileID,i=t.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}function z(e,t){let r=e.feature,i=t.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=i}function H(e,r,i){return t._(this,void 0,void 0,(function*(){let n=e;if(e.url?n=(yield t.j(r.transformRequest(e.url,"Source"),i)).data:yield s.frameAsync(i),!n)return null;let a=t.Q(t.e(n,e),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in n&&n.vector_layers&&(a.vectorLayerIds=n.vector_layers.map((e=>e.id))),a}))}class j{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):Array.isArray(e)&&(4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof t.S?new t.S(e.lng,e.lat):t.S.convert(e),this}setSouthWest(e){return this._sw=e instanceof t.S?new t.S(e.lng,e.lat):t.S.convert(e),this}extend(e){let r,i,n=this._sw,a=this._ne;if(e instanceof t.S)r=e,i=e;else{if(!(e instanceof j))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(j.convert(e)):this.extend(t.S.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(t.S.convert(e)):this;if(r=e._sw,i=e._ne,!r||!i)return this}return n||a?(n.lng=Math.min(r.lng,n.lng),n.lat=Math.min(r.lat,n.lat),a.lng=Math.max(i.lng,a.lng),a.lat=Math.max(i.lat,a.lat)):(this._sw=new t.S(r.lng,r.lat),this._ne=new t.S(i.lng,i.lat)),this}getCenter(){return new t.S((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new t.S(this.getWest(),this.getNorth())}getSouthEast(){return new t.S(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){let{lng:r,lat:i}=t.S.convert(e),n=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(n=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=i&&i<=this._ne.lat&&n}static convert(e){return e instanceof j?e:e&&new j(e)}static fromLngLat(e,r=0){let i=360*r/40075017,n=i/Math.cos(Math.PI/180*e.lat);return new j(new t.S(e.lng-n,e.lat-i),new t.S(e.lng+n,e.lat+i))}adjustAntiMeridian(){let e=new t.S(this._sw.lng,this._sw.lat),r=new t.S(this._ne.lng,this._ne.lat);return new j(e,e.lng>r.lng?new t.S(r.lng+360,r.lat):r)}}class V{constructor(e,t,r){this.bounds=j.convert(this.validateBounds(e)),this.minzoom=t||0,this.maxzoom=r||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){let r=Math.pow(2,e.z),i=Math.floor(t.V(this.bounds.getWest())*r),n=Math.floor(t.U(this.bounds.getNorth())*r),a=Math.ceil(t.V(this.bounds.getEast())*r),s=Math.ceil(t.U(this.bounds.getSouth())*r);return e.x>=i&&e.x<a&&e.y>=n&&e.y<s}}class G extends t.E{constructor(e,r,i,n){if(super(),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.e(this,t.Q(r,["url","scheme","tileSize","promoteId"])),this._options=t.e({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let e=yield H(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(t.e(this,e),e.bounds&&(this.tileBounds=new V(e.bounds,this.minzoom,this.maxzoom)),this.fire(new t.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.l("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,this.fire(new t.k(e))}}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return t.e({},this._options)}loadTile(e){return t._(this,void 0,void 0,(function*(){let t=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),r={request:this.map._requestManager.transformRequest(t,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};r.request.collectResourceTiming=this._collectResourceTiming;let i="RT";if(e.actor&&"expired"!==e.state){if("loading"===e.state)return new Promise(((t,r)=>{e.reloadPromise={resolve:t,reject:r}}))}else e.actor=this.dispatcher.getActor(),i="LT";e.abortController=new AbortController;try{let t=yield e.actor.sendAsync({type:i,data:r},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,t)}catch(t){if(delete e.abortController,e.aborted)return;if(t&&404!==t.status)throw t;this._afterTileLoadWorkerResponse(e,null)}}))}_afterTileLoadWorkerResponse(e,t){if(t&&t.resourceTiming&&(e.resourceTiming=t.resourceTiming),t&&this.map._refreshExpiredTiles&&e.setExpiryData(t),e.loadVectorData(t,this.map.painter),e.reloadPromise){let t=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(t.resolve).catch(t.reject)}}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))}))}hasTransition(){return!1}}class K extends t.E{constructor(e,r,i,n){super(),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.e({type:"raster"},r),t.e(this,t.Q(r,["url","scheme","tileSize"]))}load(){return t._(this,arguments,void 0,(function*(e=!1){this._loaded=!1,this.fire(new t.l("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{let r=yield H(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,r&&(t.e(this,r),r.bounds&&(this.tileBounds=new V(r.bounds,this.minzoom,this.maxzoom)),this.fire(new t.l("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new t.l("data",{dataType:"source",sourceDataType:"content",sourceDataChanged:e})))}catch(e){this._tileJSONRequest=null,this._loaded=!0,this.fire(new t.k(e))}}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load(!0)}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}serialize(){return t.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return t._(this,void 0,void 0,(function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{let i=yield p.getImage(this.map._requestManager.transformRequest(r,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(i&&i.data){this.map._refreshExpiredTiles&&(i.cacheControl||i.expires)&&e.setExpiryData({cacheControl:i.cacheControl,expires:i.expires});let r=this.map.painter.context,n=r.gl,a=i.data;e.texture=this.map.painter.getTileTexture(a.width),e.texture?e.texture.update(a,{useMipmap:!0}):(e.texture=new t.T(r,a,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)}))}hasTransition(){return!1}}class q extends K{constructor(e,r,i,n){super(e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=t.e({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox",this.redFactor=r.redFactor,this.greenFactor=r.greenFactor,this.blueFactor=r.blueFactor,this.baseShift=r.baseShift}loadTile(e){return t._(this,void 0,void 0,(function*(){let r=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),i=this.map._requestManager.transformRequest(r,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{let r=yield p.getImage(i,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(r&&r.data){let i=r.data;this.map._refreshExpiredTiles&&(r.cacheControl||r.expires)&&e.setExpiryData({cacheControl:r.cacheControl,expires:r.expires});let n=t.b(i)&&t.W()?i:yield this.readImageNow(i),a={type:this.type,uid:e.uid,source:this.id,rawImageData:n,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||"expired"===e.state){e.actor=this.dispatcher.getActor();let t=yield e.actor.sendAsync({type:"LDT",data:a});e.dem=t,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(t){if(delete e.abortController,e.aborted)e.state="unloaded";else if(t)throw e.state="errored",t}}))}readImageNow(e){return t._(this,void 0,void 0,(function*(){if(typeof VideoFrame<"u"&&t.X()){let r=e.width+2,i=e.height+2;try{return new t.R({width:r,height:i},yield t.Y(e,-1,-1,r,i))}catch{}}return s.getImageData(e,1)}))}_getNeighboringTiles(e){let r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,a=0===r.x?e.wrap-1:e.wrap,s=(r.x+1+i)%i,o=r.x+1===i?e.wrap+1:e.wrap,l={};return l[new t.Z(e.overscaledZ,a,r.z,n,r.y).key]={backfilled:!1},l[new t.Z(e.overscaledZ,o,r.z,s,r.y).key]={backfilled:!1},r.y>0&&(l[new t.Z(e.overscaledZ,a,r.z,n,r.y-1).key]={backfilled:!1},l[new t.Z(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new t.Z(e.overscaledZ,o,r.z,s,r.y-1).key]={backfilled:!1}),r.y+1<i&&(l[new t.Z(e.overscaledZ,a,r.z,n,r.y+1).key]={backfilled:!1},l[new t.Z(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new t.Z(e.overscaledZ,o,r.z,s,r.y+1).key]={backfilled:!1}),l}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))}))}}class Z extends t.E{constructor(e,r,i,n){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._isUpdatingWorker=!1,this._pendingWorkerUpdate={data:r.data},this.actor=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=t.e({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,void 0!==r.clusterMaxZoom&&this.maxzoom<=r.clusterMaxZoom&&t.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${r.clusterMaxZoom}".`),this.workerOptions=t.e({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:this._pixelsToTileUnits(void 0!==r.buffer?r.buffer:128),tolerance:this._pixelsToTileUnits(void 0!==r.tolerance?r.tolerance:.375),extent:t.$,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:this._getClusterMaxZoom(r.clusterMaxZoom),minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.$,radius:this._pixelsToTileUnits(r.clusterRadius||50),log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions),"string"==typeof this.promoteId&&(this.workerOptions.promoteId=this.promoteId)}_pixelsToTileUnits(e){return e*(t.$/this.tileSize)}_getClusterMaxZoom(e){let r=e?Math.round(e):this.maxzoom-1;return Number.isInteger(e)||void 0===e||t.w(`Integer expected for option 'clusterMaxZoom': provided value "${e}" rounded to "${r}"`),r}load(){return t._(this,void 0,void 0,(function*(){yield this._updateWorkerData()}))}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._pendingWorkerUpdate={data:e},this._updateWorkerData(),this}updateData(e){return this._pendingWorkerUpdate.diff=t.a0(this._pendingWorkerUpdate.diff,e),this._updateWorkerData(),this}getData(){return t._(this,void 0,void 0,(function*(){let e=t.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})}))}getCoordinatesFromGeometry(e){return"GeometryCollection"===e.type?e.geometries.map((e=>e.coordinates)).flat(1/0):e.coordinates.flat(1/0)}getBounds(){return t._(this,void 0,void 0,(function*(){let e,t=new j,r=yield this.getData();switch(r.type){case"FeatureCollection":e=r.features.map((e=>this.getCoordinatesFromGeometry(e.geometry))).flat(1/0);break;case"Feature":e=this.getCoordinatesFromGeometry(r.geometry);break;default:e=this.getCoordinatesFromGeometry(r)}if(0==e.length)return t;for(let r=0;r<e.length-1;r+=2)t.extend([e[r],e[r+1]]);return t}))}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(void 0!==e.clusterRadius&&(this.workerOptions.superclusterOptions.radius=this._pixelsToTileUnits(e.clusterRadius)),void 0!==e.clusterMaxZoom&&(this.workerOptions.superclusterOptions.maxZoom=this._getClusterMaxZoom(e.clusterMaxZoom))),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,t,r){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:t,offset:r}})}_updateWorkerData(){return t._(this,void 0,void 0,(function*(){if(this._isUpdatingWorker)return;let{data:e,diff:r}=this._pendingWorkerUpdate;if(!e&&!r)return void t.w(`No data or diff provided to GeoJSONSource ${this.id}.`);let i=t.e({type:this.type},this.workerOptions);e?("string"==typeof e?(i.request=this.map._requestManager.transformRequest(s.resolveURL(e),"Source"),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(e),this._pendingWorkerUpdate.data=void 0):r&&(i.dataDiff=r,this._pendingWorkerUpdate.diff=void 0),this._isUpdatingWorker=!0,this.fire(new t.l("dataloading",{dataType:"source"}));try{let e=yield this.actor.sendAsync({type:"LD",data:i});if(this._isUpdatingWorker=!1,this._removed||e.abandoned)return void this.fire(new t.l("dataabort",{dataType:"source"}));this._data=e.data;let r=null;e.resourceTiming&&e.resourceTiming[this.id]&&(r=e.resourceTiming[this.id].slice(0));let n={dataType:"source"};this._collectResourceTiming&&r&&r.length>0&&t.e(n,{resourceTiming:r}),this.fire(new t.l("data",Object.assign(Object.assign({},n),{sourceDataType:"metadata"}))),this.fire(new t.l("data",Object.assign(Object.assign({},n),{sourceDataType:"content"})))}catch(e){if(this._isUpdatingWorker=!1,this._removed)return void this.fire(new t.l("dataabort",{dataType:"source"}));this.fire(new t.k(e))}finally{(this._pendingWorkerUpdate.data||this._pendingWorkerUpdate.diff)&&this._updateWorkerData()}}))}loaded(){return!this._isUpdatingWorker&&void 0===this._pendingWorkerUpdate.data&&void 0===this._pendingWorkerUpdate.diff}loadTile(e){return t._(this,void 0,void 0,(function*(){let t=e.actor?"RT":"LT";e.actor=this.actor;let r={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId,subdivisionGranularity:this.map.style.projection.subdivisionGranularity};e.abortController=new AbortController;let i=yield this.actor.sendAsync({type:t,data:r},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(i,this.map.painter,"RT"===t)}))}abortTile(e){return t._(this,void 0,void 0,(function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0}))}unloadTile(e){return t._(this,void 0,void 0,(function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})}))}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return t.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}class W extends t.E{constructor(e,t,r,i){super(),this.flippedWindingOrder=!1,this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=t}load(e){return t._(this,void 0,void 0,(function*(){this._loaded=!1,this.fire(new t.l("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{let t=yield p.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,t&&t.data&&(this.image=t.data,e&&(this.coordinates=e),this._finishLoading())}catch(e){this._request=null,this._loaded=!0,this.fire(new t.k(e))}}))}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally((()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.l("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;let r=e.map(t.a1.fromLngLat);var i;return this.tileID=function(e){let r=t.a2.fromPoints(e),i=r.width(),n=r.height(),a=Math.max(i,n),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),o=Math.pow(2,s);return new t.a4(s,Math.floor((r.minX+r.maxX)/2*o),Math.floor((r.minY+r.maxY)/2*o))}(r),this.terrainTileRanges=this._getOverlappingTileRanges(r),this.minzoom=this.maxzoom=this.tileID.z,this.tileCoords=r.map((e=>this.tileID.getTilePoint(e)._round())),this.flippedWindingOrder=((i=this.tileCoords)[1].x-i[0].x)*(i[2].y-i[0].y)-(i[1].y-i[0].y)*(i[2].x-i[0].x)<0,this.fire(new t.l("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;let e=this.map.painter.context,r=e.gl;this.texture||(this.texture=new t.T(e,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new t.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return t._(this,void 0,void 0,(function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"}))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}_getOverlappingTileRanges(e){let{minX:r,minY:i,maxX:n,maxY:a}=t.a2.fromPoints(e),s={};for(let e=0;e<=t.a3;e++){let t=Math.pow(2,e),o=Math.floor(r*t),l=Math.floor(i*t),h=Math.floor(n*t),A=Math.floor(a*t);s[e]={minTileX:o,minTileY:l,maxTileX:h,maxTileY:A}}return s}}class $ extends W{constructor(e,t,r,i){super(e,t,r,i),this.roundZoom=!0,this.type="video",this.options=t}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!1;let e=this.options;this.urls=[];for(let t of e.urls)this.urls.push(this.map._requestManager.transformRequest(t,"Source").url);try{let e=yield t.a5(this.urls);if(this._loaded=!0,!e)return;this.video=e,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading()}catch(e){this.fire(new t.k(e))}}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){let r=this.video.seekable;e<r.start(0)||e>r.end(0)?this.fire(new t.k(new t.a6(`sources.${this.id}`,null,`Playback for this video can be set only between the ${r.start(0)} and ${r.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;let e=this.map.painter.context,r=e.gl;this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new t.T(e,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));let i=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,i=!0)}i&&this.fire(new t.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class X extends W{constructor(e,r,i,n){super(e,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new t.k(new t.a6(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.k(new t.a6(`sources.${e}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.k(new t.a6(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new t.k(new t.a6(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new t.k(new t.a6(`sources.${e}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){return t._(this,void 0,void 0,(function*(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.k(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())}))}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||0===Object.keys(this.tiles).length)return;let r=this.map.painter.context,i=r.gl;this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.T(r,this.canvas,i.RGBA,{premultiply:!0});let n=!1;for(let e in this.tiles){let t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture,n=!0)}n&&this.fire(new t.l("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(let e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}let Y={},J=e=>{switch(e){case"geojson":return Z;case"image":return W;case"raster":return K;case"raster-dem":return q;case"vector":return G;case"video":return $;case"canvas":return X}return Y[e]},ee="RTLPluginLoaded";class te extends t.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=D()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch((e=>{throw this.status="error",e}))}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return t._(this,arguments,void 0,(function*(e,t=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=s.resolveURL(e),!this.url)throw new Error(`requested url ${e} is invalid`);if("unavailable"===this.status){if(!t)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if("requested"===this.status)return this._requestImport()}))}_requestImport(){return t._(this,void 0,void 0,(function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new t.l(ee))}))}lazyLoad(){"unavailable"===this.status?this.status="requested":"deferred"===this.status&&this._requestImport()}}let re=null;function ie(){return re||(re=new te),re}class ne{constructor(e,r){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=t.a7(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){let t=e+this.timeAdded;t<this.fadeEndTime||(this.fadeEndTime=t)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,r,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(e,t){let r={};if(!t)return r;for(let i of e){let e=i.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){i.layers=e,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(let t of e)r[t.id]=i}}return r}(e.buckets,r?.style),this.hasSymbolBuckets=!1;for(let e in this.buckets){let r=this.buckets[e];if(r instanceof t.a9){if(this.hasSymbolBuckets=!0,!i)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(let e in this.buckets){let r=this.buckets[e];if(r instanceof t.a9&&r.hasRTLText){this.hasRTLText=!0,ie().lazyLoad();break}}this.queryPadding=0;for(let e in this.buckets){let t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(e).queryRadius(t))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage),this.dashPositions=e.dashPositions}else this.collisionBoxArray=new t.a8}unloadVectorData(){for(let e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.dashPositions&&(this.dashPositions=null),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(let t in this.buckets){let r=this.buckets[t];r.uploadPending()&&r.upload(e)}let r=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new t.T(e,this.imageAtlas.image,r.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new t.T(e,this.glyphAtlasImage,r.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,i,n,a,s,o,l,h,A){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:a,tileSize:this.tileSize,pixelPosMatrix:h,transform:o,params:s,queryPadding:this.queryPadding*l,getElevation:A},e,t,r):{}}querySourceFeatures(e,r){let i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;let n=i.loadVTLayers(),a=r&&r.sourceLayer?r.sourceLayer:"",s=n._geojsonTileLayer||n[a];if(!s)return;let o=t.aa(r?.filter,r?.globalState),{z:l,x:h,y:A}=this.tileID.canonical,u={z:l,x:h,y:A};for(let r=0;r<s.length;r++){let n=s.feature(r);if(o.needGeometry){let e=t.ab(n,!0);if(!o.filter(new t.F(this.tileID.overscaledZ),e,this.tileID.canonical))continue}else if(!o.filter(new t.F(this.tileID.overscaledZ),n))continue;let c=i.getId(n,a),d=new t.ac(n,l,h,A,c);d.tile=u,e.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){let r=this.expirationTime;if(e.cacheControl){let r=t.ad(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){let e=Date.now(),t=!1;if(this.expirationTime>e)t=!1;else if(r)if(this.expirationTime<r)t=!0;else{let i=this.expirationTime-r;i?this.expirationTime=e+Math.max(i,3e4):t=!0}else t=!0;t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-(new Date).getTime(),Math.pow(2,31)-1)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;let r=this.latestFeatureIndex.loadVTLayers();for(let i in this.buckets){if(!t.style.hasLayer(i))continue;let n=this.buckets[i],a=n.layers[0].sourceLayer||"_geojsonTileLayer",s=r[a],o=e[a];if(!s||!o||0===Object.keys(o).length)continue;n.update(o,s,this.imageAtlas&&this.imageAtlas.patternPositions||{},this.dashPositions||{});let l=t&&t.style&&t.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<s.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=s.now()+e}setDependencies(e,t){let r={};for(let e of t)r[e]=!0;this.dependencies[e]=r}hasDependency(e,t){for(let r of e){let e=this.dependencies[r];if(e)for(let r of t)if(e[r])return!0}return!1}}class ae{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(let e in this.data)for(let t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){let i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);let n={value:t,timeout:void 0};if(void 0!==r&&(n.timeout=setTimeout((()=>{this.remove(e,n)}),r)),this.data[i].push(n),this.order.push(i),this.order.length>this.max){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){let t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){let t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;let r=e.wrapped().key,i=void 0===t?0:this.data[r].indexOf(t),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){let e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){let t=[];for(let r in this.data)for(let i of this.data[r])e(i.value)||t.push(i);for(let e of t)this.remove(e.value.tileID,e)}}class se{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,r,i){let n=String(r);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][n]=this.stateChanges[e][n]||{},t.e(this.stateChanges[e][n],i),null===this.deletedStates[e]){this.deletedStates[e]={};for(let t in this.state[e])t!==n&&(this.deletedStates[e][t]=null)}else if(this.deletedStates[e]&&null===this.deletedStates[e][n]){this.deletedStates[e][n]={};for(let t in this.state[e][n])i[t]||(this.deletedStates[e][n][t]=null)}else for(let t in i)this.deletedStates[e]&&this.deletedStates[e][n]&&null===this.deletedStates[e][n][t]&&delete this.deletedStates[e][n][t]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;let i=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][i]&&(this.deletedStates[e][i]=this.deletedStates[e][i]||{},this.deletedStates[e][i][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][i])for(r in this.deletedStates[e][i]={},this.stateChanges[e][i])this.deletedStates[e][i][r]=null;else this.deletedStates[e][i]=null;else this.deletedStates[e]=null}getState(e,r){let i=String(r),n=t.e({},(this.state[e]||{})[i],(this.stateChanges[e]||{})[i]);if(null===this.deletedStates[e])return{};if(this.deletedStates[e]){let t=this.deletedStates[e][r];if(null===t)return{};for(let e in t)delete n[e]}return n}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(e,r){let i={};for(let e in this.stateChanges){this.state[e]=this.state[e]||{};let r={};for(let i in this.stateChanges[e])this.state[e][i]||(this.state[e][i]={}),t.e(this.state[e][i],this.stateChanges[e][i]),r[i]=this.state[e][i];i[e]=r}for(let e in this.deletedStates){this.state[e]=this.state[e]||{};let r={};if(null===this.deletedStates[e])for(let t in this.state[e])r[t]={},this.state[e][t]={};else for(let t in this.deletedStates[e]){if(null===this.deletedStates[e][t])this.state[e][t]={};else for(let r of Object.keys(this.deletedStates[e][t]))delete this.state[e][t][r];r[t]=this.state[e][t]}i[e]=i[e]||{},t.e(i[e],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(let t in e)e[t].setFeatureState(i,r)}}let oe=89.25;function le(e,r){let i=t.ah(r.lat,-t.ai,t.ai);return new t.P(t.V(r.lng)*e,t.U(i)*e)}function he(e,r){return new t.a1(r.x/e,r.y/e).toLngLat()}function Ae(e){return e.cameraToCenterDistance*Math.min(.85*Math.tan(t.ae(90-e.pitch)),Math.tan(t.ae(oe-e.pitch)))}function ue(e,r){let i=e.canonical,n=r/t.af(i.z),a=i.x+Math.pow(2,i.z)*e.wrap,s=t.ag(new Float64Array(16));return t.M(s,s,[a*n,i.y*n,0]),t.N(s,s,[n/t.$,n/t.$,1]),s}function ce(e,r,i,n,a){let s=t.a1.fromLngLat(e,r),o=a*t.aj(1,e.lat),l=o*Math.cos(t.ae(i)),h=Math.sqrt(o*o-l*l),A=h*Math.sin(t.ae(-n)),u=h*Math.cos(t.ae(-n));return new t.a1(s.x+A,s.y+u,s.z+l)}function de(e,t,r){let i=t.intersectsFrustum(e);if(!r||0===i)return i;let n=t.intersectsPlane(r);return 0===n?0:2===i&&2===n?2:1}function pe(e,t,r){let i=0,n=(r-t)/10;for(let a=0;a<10;a++)i+=n*Math.pow(Math.cos(t+(a+.5)/10*(r-t)),e);return i}function fe(e,r){return function(i,n,a,s,o){let l=2*((e-1)/t.ak(Math.cos(t.ae(oe-o))/Math.cos(t.ae(oe)))-1),h=Math.acos(a/s),A=2*pe(l-1,0,t.ae(o/2)),u=Math.min(t.ae(oe),h+t.ae(o/2)),c=pe(l-1,Math.min(u,h-t.ae(o/2)),u),d=Math.atan(n/a),p=Math.hypot(n,a),f=i;return f+=t.ak(s/p/Math.max(.5,Math.cos(t.ae(o/2)))),f+=l*t.ak(Math.cos(d))/2,f-=t.ak(Math.max(1,c/A/r))/2,f}}let ge=fe(9.314,3);function me(e,r){let i=(r.roundZoom?Math.round:Math.floor)(e.zoom+t.ak(e.tileSize/r.tileSize));return Math.max(0,i)}function ye(e,r){let i=e.getCameraFrustum(),n=e.getClippingPlane(),a=e.screenPointToMercatorCoordinate(e.getCameraPoint()),s=t.a1.fromLngLat(e.center,e.elevation);a.z=s.z+Math.cos(e.pitchInRadians)*e.cameraToCenterDistance/e.worldSize;let o=e.getCoveringTilesDetailsProvider(),l=o.allowVariableZoom(e,r),h=me(e,r),A=r.minzoom||0,u=void 0!==r.maxzoom?r.maxzoom:e.maxZoom,c=Math.min(Math.max(0,h),u),d=Math.pow(2,c),p=[d*a.x,d*a.y,0],f=[d*s.x,d*s.y,0],g=Math.hypot(s.x-a.x,s.y-a.y),m=Math.abs(s.z-a.z),y=Math.hypot(g,m),_=e=>({zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),v=[],w=[];if(e.renderWorldCopies&&o.allowWorldCopies())for(let e=1;e<=3;e++)v.push(_(-e)),v.push(_(e));for(v.push(_(0));v.length>0;){let d=v.pop(),g=d.x,_=d.y,b=d.fullyVisible,x={x:g,y:_,z:d.zoom},B=o.getTileBoundingVolume(x,d.wrap,e.elevation,r);if(!b){let e=de(i,B,n);if(0===e)continue;b=2===e}let C=o.distanceToTile2d(a.x,a.y,x,B),S=h;l&&(S=(r.calculateTileZoom||ge)(e.zoom+t.ak(e.tileSize/r.tileSize),C,m,y,e.fov)),S=(r.roundZoom?Math.round:Math.floor)(S),S=Math.max(0,S);let E=Math.min(S,u);if(d.wrap=o.getWrap(s,x,d.wrap),d.zoom>=E){if(d.zoom<A)continue;let e=c-d.zoom,i=p[0]-.5-(g<<e),n=p[1]-.5-(_<<e),a=r.reparseOverscaled?Math.max(d.zoom,S):d.zoom;w.push({tileID:new t.Z(d.zoom===u?a:d.zoom,d.wrap,d.zoom,g,_),distanceSq:t.al([f[0]-.5-g,f[1]-.5-_]),tileDistanceToCamera:Math.sqrt(i*i+n*n)})}else for(let e=0;e<4;e++)v.push({zoom:d.zoom+1,x:(g<<1)+e%2,y:(_<<1)+(e>>1),wrap:d.wrap,fullyVisible:b})}return w.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}let _e=t.a2.fromPoints([new t.P(0,0),new t.P(t.$,t.$)]);class ve extends t.E{constructor(e,t,r){super(),this.id=e,this.dispatcher=r,this.on("data",(e=>this._dataHandler(e))),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=((e,t,r,i)=>{let n=new(J(t.type))(e,t,r,i);if(n.id!==e)throw new Error(`Expected Source id to be ${e} instead of ${n.id}`);return n})(e,t,r,this),this._tiles={},this._cache=new ae(0,(e=>this._unloadTile(e))),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new se,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(void 0===this.used&&void 0===this.usedForTerrain||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(let e in this._tiles){let t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;let e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,r,i){return t._(this,void 0,void 0,(function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,r,i)}catch(r){e.state="errored",404!==r.status?this._source.fire(new t.k(r,{tile:e})):this.update(this.transform,this.terrain)}}))}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new t.l("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(let t in this._tiles){let r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(we).map((e=>e.key))}getRenderableIds(e){let r=[];for(let t in this._tiles)this._isIdRenderable(t,e)&&r.push(this._tiles[t]);return e?r.sort(((e,r)=>{let i=e.tileID,n=r.tileID,a=new t.P(i.canonical.x,i.canonical.y)._rotate(-this.transform.bearingInRadians),s=new t.P(n.canonical.x,n.canonical.y)._rotate(-this.transform.bearingInRadians);return i.overscaledZ-n.overscaledZ||s.y-a.y||s.x-a.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(we).map((e=>e.key))}hasRenderableParent(e){let t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(e){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(let t in this._tiles)e?this._reloadTile(t,"expired"):"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")}}_reloadTile(e,r){return t._(this,void 0,void 0,(function*(){let t=this._tiles[e];t&&("loading"!==t.state&&(t.state=r),yield this._loadTile(t,e,r))}))}_tileLoaded(e,r,i){e.timeAdded=s.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new t.l("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){let t=this.getRenderableIds();for(let i=0;i<t.length;i++){let n=t[i];if(e.neighboringTiles&&e.neighboringTiles[n]){let t=this.getTileByID(n);r(e,t),r(t,e)}}function r(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x,i=t.tileID.canonical.y-e.tileID.canonical.y,n=Math.pow(2,e.tileID.canonical.z),a=t.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,i),e.neighboringTiles&&e.neighboringTiles[a]&&(e.neighboringTiles[a].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t){let r=Object.values(e),i=this._getLoadedDescendents(r),n={};for(let e of r){let r=i[e.key];if(!r?.length){n[e.key]=e;continue}let a=e.overscaledZ+ve.maxUnderzooming,s=r.filter((e=>e.tileID.overscaledZ<=a));if(!s.length){n[e.key]=e;continue}let o=Math.min(...s.map((e=>e.tileID.overscaledZ))),l=s.filter((e=>e.tileID.overscaledZ===o)).map((e=>e.tileID));for(let e of l)t[e.key]=e;this._areDescendentsComplete(l,o,e.overscaledZ)||(n[e.key]=e)}return n}_getLoadedDescendents(e){var t;let r={};for(let i in this._tiles){let n=this._tiles[i];if(n.hasData())for(let i of e)n.tileID.isChildOf(i)&&(r[t=i.key]||(r[t]=[])).push(n)}return r}_areDescendentsComplete(e,t,r){return 1===e.length&&e[0].isOverscaled()?e[0].overscaledZ===t:Math.pow(4,t-r)===e.length}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){let r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){let t=e.scaledTo(r),i=this._getLoadedTile(t);if(i)return i}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){let t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){let r=Math.ceil(e.width/this._source.tileSize)+1,i=Math.ceil(e.height/this._source.tileSize)+1,n=Math.floor(r*i*(null===this._maxTileCacheZoomLevels?t.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),a="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,n):n;this._cache.setMaxSize(a)}handleWrapJump(e){let t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){let e={};for(let r in this._tiles){let i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),e[i.tileID.key]=i}this._tiles=e;for(let e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(let e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}}update(e,r){if(!this._sourceLoaded||this._paused)return;let i;this.transform=e,this.terrain=r,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?i=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((e=>new t.Z(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y))):(i=ye(e,{tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r,calculateTileZoom:this._source.calculateTileZoom}),this._source.hasTile&&(i=i.filter((e=>this._source.hasTile(e))))):i=[],this.usedForTerrain&&(i=this._addTerrainIdealTiles(i));let n=me(e,this._source),a=Math.max(n-ve.maxOverzooming,this._source.minzoom),s=0===i.length&&!this._updated&&this._didEmitContent;this._updated=!0,s&&this.fire(new t.l("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));let o=this._updateRetainedTiles(i,n);be(this._source.type)&&!r&&this._updateFadingTiles(o,a);for(let e in o)this._tiles[e].clearFadeHold();let l=t.am(this._tiles,o);for(let e of l){let t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(e)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}_addTerrainIdealTiles(e){let t=[];for(let r of e)if(r.canonical.z>this._source.minzoom){let e=r.scaledTo(r.canonical.z-1);t.push(e);let i=r.scaledTo(Math.max(this._source.minzoom,Math.min(r.canonical.z,5)));t.push(i)}return e.concat(t)}releaseSymbolFadeTiles(){for(let e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){var r;let i={},n={},a=Math.max(t-ve.maxOverzooming,this._source.minzoom),s={};for(let t of e){let e=this._addTile(t);i[t.key]=t,e.hasData()||(s[t.key]=t)}s=this._retainLoadedChildren(s,i);for(let e in s){let t=s[e],o=this._tiles[e],l=o?.wasRequested();for(let e=t.overscaledZ-1;e>=a;--e){let a=t.scaledTo(e);if(n[a.key])break;if(n[a.key]=!0,o=this.getTile(a),!o&&l&&(o=this._addTile(a)),o){let e=o.hasData();if((e||!(null!==(r=this.map)&&void 0!==r&&r.cancelPendingTileRequestsWhileZooming)||l)&&(i[a.key]=a),l=o.wasRequested(),e)break}}}return i}_updateFadingTiles(e,t){let r={},i={},n=Object.keys(e),a=s.now();for(let s of n){let n=e[s],o=this._tiles[s];if(!o||0!==o.fadeEndTime&&o.fadeEndTime<=a)continue;let l=this.findLoadedParent(n,t),h=this.findLoadedSibling(n),A=l||h||null;A&&(this._addTile(A.tileID),r[A.tileID.key]=A.tileID),i[s]=n}this._retainLoadedChildren(i,e);for(let t in r)e[t]||(this._coveredTiles[t]=!0,e[t]=r[t])}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(let e in this._tiles){let t,r=[],i=this._tiles[e].tileID;for(;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){t=this._loadedParentTiles[i.key];break}r.push(i.key);let e=i.scaledTo(i.overscaledZ-1);if(t=this._getLoadedTile(e),t)break;i=e}for(let e of r)this._loadedParentTiles[e]=t}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(let e in this._tiles){let t=this._tiles[e].tileID,r=this._getLoadedTile(t);this._loadedSiblingTiles[t.key]=r}}_addTile(e){let r=this._tiles[e.key];if(r)return r;r=this._cache.getAndRemove(e),r&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));let i=r;return r||(r=new ne(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,e.key,r.state)),r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.l("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);let r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}refreshTiles(e){for(let t in this._tiles)(this._isIdRenderable(t)||"errored"==this._tiles[t].state)&&e.some((e=>e.equals(this._tiles[t].tileID.canonical)))&&this._reloadTile(t,"expired")}_removeTile(e){let t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}_dataHandler(e){let t=e.sourceDataType;"source"===e.dataType&&"metadata"===t&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===t&&(this.reload(e.sourceDataChanged),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(let e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,r,i){let n=[],a=this.transform;if(!a)return n;let s=a.getCoveringTilesDetailsProvider().allowWorldCopies(),o=i?a.getCameraQueryGeometry(e):e,l=e=>a.screenPointToMercatorCoordinate(e,this.terrain),h=this.transformBbox(e,l,!s),A=this.transformBbox(o,l,!s),u=this.getIds(),c=t.a2.fromPoints(A);for(let e=0;e<u.length;e++){let i=this._tiles[u[e]];if(i.holdingForFade())continue;let o=s?[i.tileID]:[i.tileID.unwrapTo(-1),i.tileID.unwrapTo(0)],l=Math.pow(2,a.zoom-i.tileID.overscaledZ),d=r*i.queryPadding*t.$/i.tileSize/l;for(let e of o){let r=c.map((r=>e.getTilePoint(new t.a1(r.x,r.y))));if(r.expandBy(d),r.intersects(_e)){let t=h.map((t=>e.getTilePoint(t))),r=A.map((t=>e.getTilePoint(t)));n.push({tile:i,tileID:s?e:e.unwrapTo(0),queryGeometry:t,cameraQueryGeometry:r,scale:l})}}}return n}transformBbox(e,r,i){let n=e.map(r);if(i){let i=t.a2.fromPoints(e);i.shrinkBy(.001*Math.min(i.width(),i.height()));let a=i.map(r);t.a2.fromPoints(n).covers(a)||(n=n.map((e=>e.x>.5?new t.a1(e.x-1,e.y,e.z):e)))}return n}getVisibleCoordinates(e){let t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));return this.transform&&this.transform.populateCache(t),t}hasTransition(){if(this._source.hasTransition())return!0;if(be(this._source.type)){let e=s.now();for(let t in this._tiles)if(this._tiles[t].fadeEndTime>=e)return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){let i=this._tiles[e];i&&i.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(let r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}}function we(e,t){let r=Math.abs(2*e.wrap)-+(e.wrap<0),i=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||i-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function be(e){return"raster"===e||"image"===e||"video"===e}ve.maxOverzooming=10,ve.maxUnderzooming=3;class xe{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(1===this.points.length)return this.points[0];e=t.ah(e,0,1);let r=1,i=this._distances[r],n=e*this.paddedLength+this.padding;for(;i<n&&r<this._distances.length;)i=this._distances[++r];let a=r-1,s=this._distances[a],o=i-s,l=o>0?(n-s)/o:0;return this.points[a].mult(1-l).add(this.points[r].mult(l))}}function Be(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class Ce{constructor(e,t,r){let i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;e<this.xCellCount*this.yCellCount;e++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}insertCircle(e,t,r,i){this._forEachCell(t-i,r-i,t+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(i)}_insertBoxCell(e,t,r,i,n,a){this.boxCells[n].push(a)}_insertCircleCell(e,t,r,i,n,a){this.circleCells[n].push(a)}_query(e,t,r,i,n,a,s){if(r<0||e>this.width||i<0||t>this.height)return[];let o=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=i){if(n)return[{key:null,x1:e,y1:t,x2:r,y2:i}];for(let e=0;e<this.boxKeys.length;e++)o.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){let t=this.circles[3*e],r=this.circles[3*e+1],i=this.circles[3*e+2];o.push({key:this.circleKeys[e],x1:t-i,y1:r-i,x2:t+i,y2:r+i})}}else this._forEachCell(e,t,r,i,this._queryCell,o,{hitTest:n,overlapMode:a,seenUids:{box:{},circle:{}}},s);return o}query(e,t,r,i){return this._query(e,t,r,i,!1,null)}hitTest(e,t,r,i,n,a){return this._query(e,t,r,i,!0,n,a).length>0}hitTestCircle(e,t,r,i,n){let a=e-r,s=e+r,o=t-r,l=t+r;if(s<0||a>this.width||l<0||o>this.height)return!1;let h=[];return this._forEachCell(a,o,s,l,this._queryCellCircle,h,{hitTest:!0,overlapMode:i,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},n),h.length>0}_queryCell(e,t,r,i,n,a,s,o){let{seenUids:l,hitTest:h,overlapMode:A}=s,u=this.boxCells[n];if(null!==u){let n=this.bboxes;for(let s of u)if(!l.box[s]){l.box[s]=!0;let u=4*s,c=this.boxKeys[s];if(e<=n[u+2]&&t<=n[u+3]&&r>=n[u+0]&&i>=n[u+1]&&(!o||o(c))&&(!h||!Be(A,c.overlapMode))&&(a.push({key:c,x1:n[u],y1:n[u+1],x2:n[u+2],y2:n[u+3]}),h))return!0}}let c=this.circleCells[n];if(null!==c){let n=this.circles;for(let s of c)if(!l.circle[s]){l.circle[s]=!0;let u=3*s,c=this.circleKeys[s];if(this._circleAndRectCollide(n[u],n[u+1],n[u+2],e,t,r,i)&&(!o||o(c))&&(!h||!Be(A,c.overlapMode))){let e=n[u],t=n[u+1],r=n[u+2];if(a.push({key:c,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),h)return!0}}}return!1}_queryCellCircle(e,t,r,i,n,a,s,o){let{circle:l,seenUids:h,overlapMode:A}=s,u=this.boxCells[n];if(null!==u){let e=this.bboxes;for(let t of u)if(!h.box[t]){h.box[t]=!0;let r=4*t,i=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!o||o(i))&&!Be(A,i.overlapMode))return a.push(!0),!0}}let c=this.circleCells[n];if(null!==c){let e=this.circles;for(let t of c)if(!h.circle[t]){h.circle[t]=!0;let r=3*t,i=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!o||o(i))&&!Be(A,i.overlapMode))return a.push(!0),!0}}}_forEachCell(e,t,r,i,n,a,s,o){let l=this._convertToXCellCoord(e),h=this._convertToYCellCoord(t),A=this._convertToXCellCoord(r),u=this._convertToYCellCoord(i);for(let c=l;c<=A;c++)for(let l=h;l<=u;l++)if(n.call(this,e,t,r,i,this.xCellCount*l+c,a,s,o))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,i,n,a){let s=i-e,o=n-t,l=r+a;return l*l>s*s+o*o}_circleAndRectCollide(e,t,r,i,n,a,s){let o=(a-i)/2,l=Math.abs(e-(i+o));if(l>o+r)return!1;let h=(s-n)/2,A=Math.abs(t-(n+h));if(A>h+r)return!1;if(l<=o||A<=h)return!0;let u=l-o,c=A-h;return u*u+c*c<=r*r}}function Se(e,r,n){let a=t.L();if(!e){let{vecSouth:e,vecEast:t}=Ie(r),n=i();n[0]=t[0],n[1]=t[1],n[2]=e[0],n[3]=e[1],s=n,(c=(l=(o=n)[0])*(u=o[3])-(A=o[2])*(h=o[1]))&&(s[0]=u*(c=1/c),s[1]=-h*c,s[2]=-A*c,s[3]=l*c),a[0]=n[0],a[1]=n[1],a[4]=n[2],a[5]=n[3]}var s,o,l,h,A,u,c;return t.N(a,a,[1/n,1/n,1]),a}function Ee(e,r,i,n){if(e){let e=t.L();if(!r){let{vecSouth:t,vecEast:r}=Ie(i);e[0]=r[0],e[1]=r[1],e[4]=t[0],e[5]=t[1]}return t.N(e,e,[n,n,1]),e}return i.pixelsToClipSpaceMatrix}function Ie(e){let r=Math.cos(e.rollInRadians),i=Math.sin(e.rollInRadians),n=Math.cos(e.pitchInRadians),a=Math.cos(e.bearingInRadians),s=Math.sin(e.bearingInRadians),o=t.ar();o[0]=-a*n*i-s*r,o[1]=-s*n*i+a*r;let l=t.as(o);l<1e-9?t.at(o):t.au(o,o,1/l);let h=t.ar();h[0]=a*n*r-s*i,h[1]=s*n*r+a*i;let A=t.as(h);return A<1e-9?t.at(h):t.au(h,h,1/A),{vecEast:h,vecSouth:o}}function Te(e,r,i,n){let a;n?(a=[e,r,n(e,r),1],t.aw(a,a,i)):(a=[e,r,0,1],Ke(a,a,i));let s=a[3];return{point:new t.P(a[0]/s,a[1]/s),signedDistanceFromCamera:s,isOccluded:!1}}function Fe(e,t){return.5+e/t*.5}function Pe(e,t){return e.x>=-t[0]&&e.x<=t[0]&&e.y>=-t[1]&&e.y<=t[1]}function Le(e,r,i,n,a,s,o,l,h,A,u,c,d){let p=i?e.textSizeData:e.iconSizeData,f=t.an(p,r.transform.zoom),g=[256/r.width*2+1,256/r.height*2+1],m=i?e.text.dynamicLayoutVertexArray:e.icon.dynamicLayoutVertexArray;m.clear();let y=e.lineVertexArray,_=i?e.text.placedSymbolArray:e.icon.placedSymbolArray,v=r.transform.width/r.transform.height,w=!1;for(let i=0;i<_.length;i++){let b=_.get(i);if(b.hidden||b.writingMode===t.ao.vertical&&!w){Ge(b.numGlyphs,m);continue}w=!1;let x=new t.P(b.anchorX,b.anchorY),B={getElevation:d,pitchedLabelPlaneMatrix:n,lineVertexArray:y,pitchWithMap:s,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:r.transform,tileAnchorPoint:x,unwrappedTileID:h,width:A,height:u,translation:c},C=Qe(b.anchorX,b.anchorY,B);if(!Pe(C.point,g)){Ge(b.numGlyphs,m);continue}let S=Fe(r.transform.cameraToCenterDistance,C.signedDistanceFromCamera),E=t.ap(p,f,b),I=s?E*r.transform.getPitchedTextCorrection(b.anchorX,b.anchorY,h)/S:E*S,T=Ue({projectionContext:B,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:I,flip:!1,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l});w=T.useVertical,(T.notEnoughRoom||w||T.needsFlipping&&Ue({projectionContext:B,pitchedLabelPlaneMatrixInverse:a,symbol:b,fontSize:I,flip:!0,keepUpright:o,glyphOffsetArray:e.glyphOffsetArray,dynamicLayoutVertexArray:m,aspectRatio:v,rotateToLine:l}).notEnoughRoom)&&Ge(b.numGlyphs,m)}i?e.text.dynamicLayoutVertexBuffer.updateData(m):e.icon.dynamicLayoutVertexBuffer.updateData(m)}function Me(e,t,r,i,n,a,s,o){let l=a.glyphStartIndex+a.numGlyphs,h=a.lineStartIndex,A=a.lineStartIndex+a.lineLength,u=t.getoffsetX(a.glyphStartIndex),c=t.getoffsetX(l-1),d=je(e*u,r,i,n,a.segment,h,A,o,s);if(!d)return null;let p=je(e*c,r,i,n,a.segment,h,A,o,s);return p?o.projectionCache.anyProjectionOccluded?null:{first:d,last:p}:null}function ke(e,r,i,n){return e===t.ao.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(e===t.ao.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function Ue(e){let r,{projectionContext:i,pitchedLabelPlaneMatrixInverse:n,symbol:a,fontSize:s,flip:o,keepUpright:l,glyphOffsetArray:h,dynamicLayoutVertexArray:A,aspectRatio:u,rotateToLine:c}=e,d=s/24,p=a.lineOffsetX*d,f=a.lineOffsetY*d;if(a.numGlyphs>1){let e=a.glyphStartIndex+a.numGlyphs,t=a.lineStartIndex,s=a.lineStartIndex+a.lineLength,A=Me(d,h,p,f,o,a,c,i);if(!A)return{notEnoughRoom:!0};let g=Oe(A.first.point.x,A.first.point.y,i,n),m=Oe(A.last.point.x,A.last.point.y,i,n);if(l&&!o){let e=ke(a.writingMode,g,m,u);if(e)return e}r=[A.first];for(let n=a.glyphStartIndex+1;n<e-1;n++){let e=je(d*h.getoffsetX(n),p,f,o,a.segment,t,s,i,c);if(!e)return{notEnoughRoom:!0};r.push(e)}r.push(A.last)}else{if(l&&!o){let e=Ne(i.tileAnchorPoint.x,i.tileAnchorPoint.y,i).point,r=a.lineStartIndex+a.segment+1,s=new t.P(i.lineVertexArray.getx(r),i.lineVertexArray.gety(r)),o=Ne(s.x,s.y,i),l=o.signedDistanceFromCamera>0?o.point:Re(i.tileAnchorPoint,s,e,1,i),h=Oe(e.x,e.y,i,n),A=Oe(l.x,l.y,i,n),c=ke(a.writingMode,h,A,u);if(c)return c}let e=je(d*h.getoffsetX(a.glyphStartIndex),p,f,o,a.segment,a.lineStartIndex,a.lineStartIndex+a.lineLength,i,c);if(!e||i.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};r=[e]}for(let e of r)t.av(A,e.point,e.angle);return{}}function Re(e,t,r,i,n){let a=e.add(e.sub(t)._unit()),s=Ne(a.x,a.y,n).point,o=r.sub(s);return r.add(o._mult(i/o.mag()))}function De(e,r,i){let n=r.projectionCache;if(n.projections[e])return n.projections[e];let a=new t.P(r.lineVertexArray.getx(e),r.lineVertexArray.gety(e)),s=Ne(a.x,a.y,r);if(s.signedDistanceFromCamera>0)return n.projections[e]=s.point,n.anyProjectionOccluded=n.anyProjectionOccluded||s.isOccluded,s.point;let o=e-i.direction;return Re(0===i.distanceFromAnchor?r.tileAnchorPoint:new t.P(r.lineVertexArray.getx(o),r.lineVertexArray.gety(o)),a,i.previousVertex,i.absOffsetX-i.distanceFromAnchor+1,r)}function Ne(e,t,r){let i,n=e+r.translation[0],a=t+r.translation[1];return r.pitchWithMap?(i=Te(n,a,r.pitchedLabelPlaneMatrix,r.getElevation),i.isOccluded=!1):(i=r.transform.projectTileCoordinates(n,a,r.unwrappedTileID,r.getElevation),i.point.x=(.5*i.point.x+.5)*r.width,i.point.y=(.5*-i.point.y+.5)*r.height),i}function Oe(e,r,i,n){if(i.pitchWithMap){let a=[e,r,0,1];return t.aw(a,a,n),i.transform.projectTileCoordinates(a[0]/a[3],a[1]/a[3],i.unwrappedTileID,i.getElevation).point}return{x:e/i.width*2-1,y:1-r/i.height*2}}function Qe(e,t,r){return r.transform.projectTileCoordinates(e,t,r.unwrappedTileID,r.getElevation)}function ze(e,t,r){return e._unit()._perp()._mult(t*r)}function He(e,r,i,n,a,s,o,l,h){if(l.projectionCache.offsets[e])return l.projectionCache.offsets[e];let A=i.add(r);if(e+h.direction<n||e+h.direction>=a)return l.projectionCache.offsets[e]=A,A;let u=De(e+h.direction,l,h),c=ze(u.sub(i),o,h.direction),d=i.add(c),p=u.add(c);return l.projectionCache.offsets[e]=t.ax(s,A,d,p)||A,l.projectionCache.offsets[e]}function je(e,t,r,i,n,a,s,o,l){let h=i?e-t:e+t,A=h>0?1:-1,u=0;i&&(A*=-1,u=Math.PI),A<0&&(u+=Math.PI);let c,d=A>0?a+n:a+n+1;o.projectionCache.cachedAnchorPoint?c=o.projectionCache.cachedAnchorPoint:(c=Ne(o.tileAnchorPoint.x,o.tileAnchorPoint.y,o).point,o.projectionCache.cachedAnchorPoint=c);let p,f,g,m=c,y=c,_=0,v=0,w=Math.abs(h),b=[];for(;_+v<=w;){if(d+=A,d<a||d>=s)return null;_+=v,y=m,f=p;let e={absOffsetX:w,direction:A,distanceFromAnchor:_,previousVertex:y};if(m=De(d,o,e),0===r)b.push(y),g=m.sub(y);else{let t,i=m.sub(y);t=0===i.mag()?ze(De(d+A,o,e).sub(m),r,A):ze(i,r,A),f||(f=y.add(t)),p=He(d,t,m,a,s,f,r,o,e),b.push(f),g=p.sub(f)}v=g.mag()}let x=g._mult((w-_)/v)._add(f||y),B=u+Math.atan2(m.y-y.y,m.x-y.x);return b.push(x),{point:x,angle:l?B:0,path:b}}let Ve=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Ge(e,t){for(let r=0;r<e;r++){let e=t.length;t.resize(e+4),t.float32.set(Ve,3*e)}}function Ke(e,t,r){let i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e[3]=r[3]*i+r[7]*n+r[15],e}let qe=100;class Ze{constructor(e,t=new Ce(e.width+200,e.height+200,25),r=new Ce(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchFactor=Math.cos(e.pitch*Math.PI/180)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+qe,this.screenBottomBoundary=e.height+qe,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,i,n,a,s,o,l,h,A,u){let c,d=this.projectAndGetPerspectiveRatio(e.anchorPointX+o[0],e.anchorPointY+o[1],n,h,u),p=r*d.perspectiveRatio;if(a||s)c=this._projectCollisionBox(e,p,i,n,a,s,o,d,h,A,u);else{let t=d.x+(A?A.x*p:0),r=d.y+(A?A.y*p:0);c={allPointsOccluded:!1,box:[t+e.x1*p,r+e.y1*p,t+e.x2*p,r+e.y2*p]}}let[f,g,m,y]=c.box,_=a?c.allPointsOccluded:d.isOccluded,v=_;return v||(v=d.perspectiveRatio<this.perspectiveRatioCutoff),v||(v=!this.isInsideGrid(f,g,m,y)),v||"always"!==t&&this.grid.hitTest(f,g,m,y,t,l)?{box:[f,g,m,y],placeable:!1,offscreen:!1,occluded:_}:{box:[f,g,m,y],placeable:!0,offscreen:this.isOffscreen(f,g,m,y),occluded:_}}placeCollisionCircles(e,r,i,n,a,s,o,l,h,A,u,c,d,p){let f=[],g=new t.P(r.anchorX,r.anchorY),m=this.getPerspectiveRatio(g.x,g.y,s,p),y=(h?a*this.transform.getPitchedTextCorrection(r.anchorX,r.anchorY,s)/m:a*m)/t.aB,_={getElevation:p,pitchedLabelPlaneMatrix:o,lineVertexArray:i,pitchWithMap:h,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},transform:this.transform,tileAnchorPoint:g,unwrappedTileID:s,width:this.transform.width,height:this.transform.height,translation:d},v=Me(y,n,r.lineOffsetX*y,r.lineOffsetY*y,!1,r,!1,_),w=!1,b=!1,x=!0;if(v){let r=.5*u*m+c,i=new t.P(-100,-100),n=new t.P(this.screenRightBoundary,this.screenBottomBoundary),a=new xe,s=v.first,o=v.last,d=[];for(let e=s.path.length-1;e>=1;e--)d.push(s.path[e]);for(let e=1;e<o.path.length;e++)d.push(o.path[e]);let p=2.5*r;if(h){let e=this.projectPathToScreenSpace(d,_);d=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let g=[];if(d.length>0){let e=d[0].clone(),r=d[0].clone();for(let t=1;t<d.length;t++)e.x=Math.min(e.x,d[t].x),e.y=Math.min(e.y,d[t].y),r.x=Math.max(r.x,d[t].x),r.y=Math.max(r.y,d[t].y);g=e.x>=i.x&&r.x<=n.x&&e.y>=i.y&&r.y<=n.y?[d]:r.x<i.x||e.x>n.x||r.y<i.y||e.y>n.y?[]:t.ay([d],i.x,i.y,n.x,n.y)}for(let t of g){a.reset(t,.25*r);let i=0;i=a.length<=.5*r?1:Math.ceil(a.paddedLength/p)+1;for(let t=0;t<i;t++){let n=t/Math.max(i-1,1),s=a.lerp(n),o=s.x+qe,h=s.y+qe;f.push(o,h,r,0);let u=o-r,c=h-r,d=o+r,p=h+r;if(x=x&&this.isOffscreen(u,c,d,p),b=b||this.isInsideGrid(u,c,d,p),"always"!==e&&this.grid.hitTestCircle(o,h,r,e,A)&&(w=!0,!l))return{circles:[],offscreen:!1,collisionDetected:w}}}}return{circles:!l&&w||!b||m<this.perspectiveRatioCutoff?[]:f,offscreen:x,collisionDetected:w}}projectPathToScreenSpace(e,r){return function(e){let t=0,r=0,i=0,n=0;for(let a=0;a<e.length;a++)e[a].isOccluded?(i=a+1,n=0):(n++,n>r&&(r=n,t=i));return e.slice(t,t+r)}(function(e,r){let i=t.L();return t.aq(i,r.pitchedLabelPlaneMatrix),e.map((e=>{let t=Te(e.x,e.y,i,r.getElevation),n=r.transform.projectTileCoordinates(t.point.x,t.point.y,r.unwrappedTileID,r.getElevation);return n.point.x=(.5*n.point.x+.5)*r.width,n.point.y=(.5*-n.point.y+.5)*r.height,n}))}(e,r))}queryRenderedSymbols(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};let r=[],i=new t.a2;for(let n of e){let e=new t.P(n.x+qe,n.y+qe);i.extend(e),r.push(e)}let{minX:n,minY:a,maxX:s,maxY:o}=i,l=this.grid.query(n,a,s,o).concat(this.ignoredGrid.query(n,a,s,o)),h={},A={};for(let e of l){let i=e.key;if(void 0===h[i.bucketInstanceId]&&(h[i.bucketInstanceId]={}),h[i.bucketInstanceId][i.featureIndex])continue;let n=[new t.P(e.x1,e.y1),new t.P(e.x2,e.y1),new t.P(e.x2,e.y2),new t.P(e.x1,e.y2)];t.az(r,n)&&(h[i.bucketInstanceId][i.featureIndex]=!0,void 0===A[i.bucketInstanceId]&&(A[i.bucketInstanceId]=[]),A[i.bucketInstanceId].push(i.featureIndex))}return A}insertCollisionBox(e,t,r,i,n,a){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,i,n,a){let s=r?this.ignoredGrid:this.grid,o={bucketInstanceId:i,featureIndex:n,collisionGroupID:a,overlapMode:t};for(let t=0;t<e.length;t+=4)s.insertCircle(o,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(e,r,i,n,a){if(a){let i;n?(i=[e,r,n(e,r),1],t.aw(i,i,a)):(i=[e,r,0,1],Ke(i,i,a));let s=i[3];return{x:(i[0]/s+1)/2*this.transform.width+qe,y:(-i[1]/s+1)/2*this.transform.height+qe,perspectiveRatio:.5+this.transform.cameraToCenterDistance/s*.5,isOccluded:!1,signedDistanceFromCamera:s}}{let t=this.transform.projectTileCoordinates(e,r,i,n);return{x:(t.point.x+1)/2*this.transform.width+qe,y:(1-t.point.y)/2*this.transform.height+qe,perspectiveRatio:.5+this.transform.cameraToCenterDistance/t.signedDistanceFromCamera*.5,isOccluded:t.isOccluded,signedDistanceFromCamera:t.signedDistanceFromCamera}}}getPerspectiveRatio(e,t,r,i){let n=this.transform.projectTileCoordinates(e,t,r,i);return.5+this.transform.cameraToCenterDistance/n.signedDistanceFromCamera*.5}isOffscreen(e,t,r,i){return r<qe||e>=this.screenRightBoundary||i<qe||t>this.screenBottomBoundary}isInsideGrid(e,t,r,i){return r>=0&&e<this.gridRightBoundary&&i>=0&&t<this.gridBottomBoundary}getViewportMatrix(){let e=t.ag([]);return t.M(e,e,[-100,-100,0]),e}_projectCollisionBox(e,r,i,n,a,s,o,l,h,A,u){let c=1,d=0,p=0,f=1,g=e.anchorPointX+o[0],m=e.anchorPointY+o[1];if(s&&!a){let e=this.projectAndGetPerspectiveRatio(g+1,m,n,h,u),t=e.x-l.x,r=Math.atan((e.y-l.y)/t)+(t<0?Math.PI:0),i=Math.sin(r),a=Math.cos(r);c=a,d=i,p=-i,f=a}else if(!s&&a){let e=Ie(this.transform);c=e.vecEast[0],d=e.vecEast[1],p=e.vecSouth[0],f=e.vecSouth[1]}let y=l.x,_=l.y,v=r;a&&(y=g,_=m,v=Math.pow(2,-(this.transform.zoom-i.overscaledZ)),v*=this.transform.getPitchedTextCorrection(g,m,n),A||(v*=t.ah(.5+l.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))),A&&(y+=c*A.x*v+p*A.y*v,_+=d*A.x*v+f*A.y*v);let w=e.x1*v,b=e.x2*v,x=(w+b)/2,B=e.y1*v,C=e.y2*v,S=(B+C)/2,E=[{offsetX:w,offsetY:B},{offsetX:x,offsetY:B},{offsetX:b,offsetY:B},{offsetX:b,offsetY:S},{offsetX:b,offsetY:C},{offsetX:x,offsetY:C},{offsetX:w,offsetY:C},{offsetX:w,offsetY:S}],I=[];for(let{offsetX:e,offsetY:r}of E)I.push(new t.P(y+c*e+p*r,_+d*e+f*r));let T=!1;if(a){let e=I.map((e=>this.projectAndGetPerspectiveRatio(e.x,e.y,n,h,u)));T=e.some((e=>!e.isOccluded)),I=e.map((e=>new t.P(e.x,e.y)))}else T=!0;return{box:t.aA(I),allPointsOccluded:!T}}}class We{constructor(e,t,r,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):i&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class $e{constructor(e,t,r,i,n){this.text=new We(e?e.text:null,t,r,n),this.icon=new We(e?e.icon:null,t,i,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Xe{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Ye{constructor(e,t,r,i,n){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}}class Je{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){let t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function et(e,r,i,n,a){let{horizontalAlign:s,verticalAlign:o}=t.aH(e);return new t.P(-(s-.5)*r+n[0]*a,-(o-.5)*i+n[1]*a)}class tt{constructor(e,t,r,i,n){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new Ze(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new Je(i),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){let t=this.terrain;return t?(r,i)=>t.getElevation(e,r,i):null}getBucketParts(e,r,i,n){let a=i.getBucket(r),s=i.latestFeatureIndex;if(!a||!s||r.id!==a.layerIds[0])return;let o=i.collisionBoxArray,l=a.layers[0].layout,h=a.layers[0].paint,A=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),u=i.tileSize/t.$,c=i.tileID.toUnwrapped(),d="map"===l.get("text-rotation-alignment"),p=t.aC(i,1,this.transform.zoom),f=t.aD(this.collisionIndex.transform,i,h.get("text-translate"),h.get("text-translate-anchor")),g=t.aD(this.collisionIndex.transform,i,h.get("icon-translate"),h.get("icon-translate-anchor")),m=Se(d,this.transform,p);this.retainedQueryData[a.bucketInstanceId]=new Ye(a.bucketInstanceId,s,a.sourceLayerIndex,a.index,i.tileID);let y={bucket:a,layout:l,translationText:f,translationIcon:g,unwrappedTileID:c,pitchedLabelPlaneMatrix:m,scale:A,textPixelRatio:u,holdingForFade:i.holdingForFade(),collisionBoxArray:o,partiallyEvaluatedTextSize:t.an(a.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(a.sourceID)};if(n)for(let t of a.sortKeyRanges){let{sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n}=t;e.push({sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:a.symbolInstances.length,parameters:y})}attemptAnchorPlacement(e,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v){let w=t.aE[e.textAnchor],b=[e.textOffset0,e.textOffset1],x=et(w,i,n,b,a),B=this.collisionIndex.placeCollisionBox(r,c,l,h,A,o,s,g,u.predicate,_,x,v);if((!y||this.collisionIndex.placeCollisionBox(y,c,l,h,A,o,s,m,u.predicate,_,x,v).placeable)&&B.placeable){let e;if(this.prevPlacement&&this.prevPlacement.variableOffsets[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID]&&this.prevPlacement.placements[d.crossTileID].text&&(e=this.prevPlacement.variableOffsets[d.crossTileID].anchor),0===d.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[d.crossTileID]={textOffset:b,width:i,height:n,anchor:w,textBoxScale:a,prevAnchor:e},this.markUsedJustification(p,w,d,f),p.allowVerticalPlacement&&(this.markUsedOrientation(p,f,d),this.placedOrientations[d.crossTileID]=f),{shift:x,placedGlyphBoxes:B}}}placeLayerBucketPart(e,r,i){let{bucket:n,layout:a,translationText:s,translationIcon:o,unwrappedTileID:l,pitchedLabelPlaneMatrix:h,textPixelRatio:A,holdingForFade:u,collisionBoxArray:c,partiallyEvaluatedTextSize:d,collisionGroup:p}=e.parameters,f=a.get("text-optional"),g=a.get("icon-optional"),m=t.aF(a,"text-overlap","text-allow-overlap"),y="always"===m,_=t.aF(a,"icon-overlap","icon-allow-overlap"),v="always"===_,w="map"===a.get("text-rotation-alignment"),b="map"===a.get("text-pitch-alignment"),x="none"!==a.get("icon-text-fit"),B="viewport-y"===a.get("symbol-z-order"),C=y&&(v||!n.hasIconData()||g),S=v&&(y||!n.hasTextData()||f);!n.collisionArrays&&c&&n.deserializeCollisionBoxes(c);let E=this.retainedQueryData[n.bucketInstanceId].tileID,I=this._getTerrainElevationFunc(E),T=this.transform.getFastPathSimpleProjectionMatrix(E),F=(e,c,v)=>{var B,F;if(r[e.crossTileID])return;if(u)return void(this.placements[e.crossTileID]=new Xe(!1,!1,!1));let P=!1,L=!1,M=!0,k=null,U={box:null,placeable:!1,offscreen:null,occluded:!1},R={placeable:!1},D=null,N=null,O=null,Q=0,z=0,H=0;c.textFeatureIndex?Q=c.textFeatureIndex:e.useRuntimeCollisionCircles&&(Q=e.featureIndex),c.verticalTextFeatureIndex&&(z=c.verticalTextFeatureIndex);let j=c.textBox;if(j){let r=r=>{let i=t.ao.horizontal;if(n.allowVerticalPlacement&&!r&&this.prevPlacement){let t=this.prevPlacement.placedOrientations[e.crossTileID];t&&(this.placedOrientations[e.crossTileID]=t,i=t,this.markUsedOrientation(n,i,e))}return i},a=(r,i)=>{if(n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&c.verticalTextBox){for(let e of n.writingModes)if(e===t.ao.vertical?(U=i(),R=U):U=r(),U&&U.placeable)break}else U=r()},h=e.textAnchorOffsetStartIndex,u=e.textAnchorOffsetEndIndex;if(u===h){let i=(t,r)=>{let i=this.collisionIndex.placeCollisionBox(t,m,A,E,l,b,w,s,p.predicate,I,void 0,T);return i&&i.placeable&&(this.markUsedOrientation(n,r,e),this.placedOrientations[e.crossTileID]=r),i};a((()=>i(j,t.ao.horizontal)),(()=>{let r=c.verticalTextBox;return n.allowVerticalPlacement&&e.numVerticalGlyphVertices>0&&r?i(r,t.ao.vertical):{box:null,offscreen:null}})),r(U&&U.placeable)}else{let d=t.aE[null===(F=null===(B=this.prevPlacement)||void 0===B?void 0:B.variableOffsets[e.crossTileID])||void 0===F?void 0:F.anchor],f=(t,r,a)=>{let c=t.x2-t.x1,f=t.y2-t.y1,g=e.textBoxScale,y=x&&"never"===_?r:null,v=null,B="never"===m?1:2,C="never";d&&B++;for(let r=0;r<B;r++){for(let r=h;r<u;r++){let i=n.textAnchorOffsets.get(r);if(d&&i.textAnchor!==d)continue;let h=this.attemptAnchorPlacement(i,t,c,f,g,w,b,A,E,l,p,C,e,n,a,s,o,y,I);if(h&&(v=h.placedGlyphBoxes,v&&v.placeable))return P=!0,k=h.shift,v}d?d=null:C=m}return i&&!v&&(v={box:this.collisionIndex.placeCollisionBox(j,"always",A,E,l,b,w,s,p.predicate,I,void 0,T).box,offscreen:!1,placeable:!1,occluded:!1}),v};a((()=>f(j,c.iconBox,t.ao.horizontal)),(()=>{let r=c.verticalTextBox;return n.allowVerticalPlacement&&(!U||!U.placeable)&&e.numVerticalGlyphVertices>0&&r?f(r,c.verticalIconBox,t.ao.vertical):{box:null,occluded:!0,offscreen:null}})),U&&(P=U.placeable,M=U.offscreen);let g=r(U&&U.placeable);if(!P&&this.prevPlacement){let t=this.prevPlacement.variableOffsets[e.crossTileID];t&&(this.variableOffsets[e.crossTileID]=t,this.markUsedJustification(n,t.anchor,e,g))}}}if(D=U,P=D&&D.placeable,M=D&&D.offscreen,e.useRuntimeCollisionCircles&&e.centerJustifiedTextSymbolIndex>=0){let r=n.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),o=t.ap(n.textSizeData,d,r),A=a.get("text-padding");N=this.collisionIndex.placeCollisionCircles(m,r,n.lineVertexArray,n.glyphOffsetArray,o,l,h,i,b,p.predicate,e.collisionCircleDiameter,A,s,I),N.circles.length&&N.collisionDetected&&!i&&t.w("Collisions detected, but collision boxes are not shown"),P=y||N.circles.length>0&&!N.collisionDetected,M=M&&N.offscreen}if(c.iconFeatureIndex&&(H=c.iconFeatureIndex),c.iconBox){let e=e=>this.collisionIndex.placeCollisionBox(e,_,A,E,l,b,w,o,p.predicate,I,x&&k?k:void 0,T);R&&R.placeable&&c.verticalIconBox?(O=e(c.verticalIconBox),L=O.placeable):(O=e(c.iconBox),L=O.placeable),M=M&&O.offscreen}let V=f||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,G=g||0===e.numIconVertices;V||G?G?V||(L=L&&P):P=L&&P:L=P=L&&P;let K=L&&O.placeable;if(P&&D.placeable&&this.collisionIndex.insertCollisionBox(D.box,m,a.get("text-ignore-placement"),n.bucketInstanceId,R&&R.placeable&&z?z:Q,p.ID),K&&this.collisionIndex.insertCollisionBox(O.box,_,a.get("icon-ignore-placement"),n.bucketInstanceId,H,p.ID),N&&P&&this.collisionIndex.insertCollisionCircles(N.circles,m,a.get("text-ignore-placement"),n.bucketInstanceId,Q,p.ID),i&&this.storeCollisionData(n.bucketInstanceId,v,c,D,O,N),0===e.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[e.crossTileID]=new Xe((P||C)&&!D?.occluded,(L||S)&&!O?.occluded,M||n.justReloaded),r[e.crossTileID]=!0};if(B){if(0!==e.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");let t=n.getSortedSymbolIndexes(-this.transform.bearingInRadians);for(let e=t.length-1;e>=0;--e){let r=t[e];F(n.symbolInstances.get(r),n.collisionArrays[r],r)}}else for(let t=e.symbolInstanceStart;t<e.symbolInstanceEnd;t++)F(n.symbolInstances.get(t),n.collisionArrays[t],t);n.justReloaded=!1}storeCollisionData(e,t,r,i,n,a){if(r.textBox||r.iconBox){let a,s;this.collisionBoxArrays.has(e)?a=this.collisionBoxArrays.get(e):(a=new Map,this.collisionBoxArrays.set(e,a)),a.has(t)?s=a.get(t):(s={text:null,icon:null},a.set(t,s)),r.textBox&&(s.text=i.box),r.iconBox&&(s.icon=n.box)}if(a){let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=[]);for(let e=0;e<a.circles.length;e+=4)t.push(a.circles[e+0]-qe),t.push(a.circles[e+1]-qe),t.push(a.circles[e+2]),t.push(a.collisionDetected?1:0)}}markUsedJustification(e,r,i,n){let a;a=n===t.ao.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.aG(r)];let s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(let t of s)t>=0&&(e.text.placedSymbolArray.get(t).crossTileID=a>=0&&t!==a?0:i.crossTileID)}markUsedOrientation(e,r,i){let n=r===t.ao.horizontal||r===t.ao.horizontalOnly?r:0,a=r===t.ao.vertical?r:0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(let t of s)e.text.placedSymbolArray.get(t).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=a)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;let t=this.prevPlacement,r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;let i=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},a=t?t.variableOffsets:{},s=t?t.placedOrientations:{};for(let e in this.placements){let t=this.placements[e],a=n[e];a?(this.opacities[e]=new $e(a,i,t.text,t.icon),r=r||t.text!==a.text.placed||t.icon!==a.icon.placed):(this.opacities[e]=new $e(null,i,t.text,t.icon,t.skipFade),r=r||t.text||t.icon)}for(let e in n){let t=n[e];if(!this.opacities[e]){let n=new $e(t,i,!1,!1);n.isHidden()||(this.opacities[e]=n,r=r||t.text.placed||t.icon.placed)}}for(let e in a)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=a[e]);for(let e in s)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=s[e]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){let r={};for(let i of t){let t=i.getBucket(e);t&&i.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,i.tileID,r,i.collisionBoxArray)}}updateBucketOpacities(e,r,i,n){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();let a=e.layers[0],s=a.layout,o=new $e(null,0,!1,!1,!0),l=s.get("text-allow-overlap"),h=s.get("icon-allow-overlap"),A=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),u="map"===s.get("text-rotation-alignment"),c="map"===s.get("text-pitch-alignment"),d="none"!==s.get("icon-text-fit"),p=new $e(null,0,l&&(h||!e.hasIconData()||s.get("icon-optional")),h&&(l||!e.hasTextData()||s.get("text-optional")),!0);!e.collisionArrays&&n&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(n);let f=(e,t,r)=>{for(let i=0;i<t/4;i++)e.opacityVertexArray.emplaceBack(r);e.hasVisibleVertices=e.hasVisibleVertices||r!==ut},g=this.collisionBoxArrays.get(e.bucketInstanceId);for(let r=0;r<e.symbolInstances.length;r++){let n=e.symbolInstances.get(r),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:s,crossTileID:l}=n,h=this.opacities[l];i[l]?h=o:h||(h=p,this.opacities[l]=h),i[l]=!0;let m=n.numIconVertices>0,y=this.placedOrientations[n.crossTileID],_=y===t.ao.vertical,v=y===t.ao.horizontal||y===t.ao.horizontalOnly;if(a>0||s>0){let t=At(h.text);f(e.text,a,_?ut:t),f(e.text,s,v?ut:t);let r=h.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((t=>{t>=0&&(e.text.placedSymbolArray.get(t).hidden=r||_?1:0)})),n.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=r||v?1:0);let i=this.variableOffsets[n.crossTileID];i&&this.markUsedJustification(e,i.anchor,n,y);let o=this.placedOrientations[n.crossTileID];o&&(this.markUsedJustification(e,"left",n,o),this.markUsedOrientation(e,o,n))}if(m){let t=At(h.icon),r=!(d&&n.verticalPlacedIconSymbolIndex&&_);n.placedIconSymbolIndex>=0&&(f(e.icon,n.numIconVertices,r?t:ut),e.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=h.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(f(e.icon,n.numVerticalIconVertices,r?ut:t),e.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=h.icon.isHidden())}let w=g&&g.has(r)?g.get(r):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){let i=e.collisionArrays[r];if(i){let r=new t.P(0,0);if(i.textBox||i.verticalTextBox){let t=!0;if(A){let e=this.variableOffsets[l];e?(r=et(e.anchor,e.width,e.height,e.textOffset,e.textBoxScale),u&&r._rotate(c?-this.transform.bearingInRadians:this.transform.bearingInRadians)):t=!1}if(i.textBox||i.verticalTextBox){let n;i.textBox&&(n=_),i.verticalTextBox&&(n=v),rt(e.textCollisionBox.collisionVertexArray,h.text.placed,!t||n,w.text,r.x,r.y)}}if(i.iconBox||i.verticalIconBox){let t,n=!(v||!i.verticalIconBox);i.iconBox&&(t=n),i.verticalIconBox&&(t=!n),rt(e.iconCollisionBox.collisionVertexArray,h.icon.placed,t,w.icon,d?r.x:0,d?r.y:0)}}}}if(e.sortFeatures(-this.transform.bearingInRadians),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);e.bucketInstanceId in this.collisionCircleArrays&&(e.collisionCircleArray=this.collisionCircleArrays[e.bucketInstanceId],delete this.collisionCircleArrays[e.bucketInstanceId])}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){let r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function rt(e,t,r,i,n,a){i&&0!==i.length||(i=[0,0,0,0]);let s=i[0]-qe,o=i[1]-qe,l=i[2]-qe,h=i[3]-qe;e.emplaceBack(t?1:0,r?1:0,n||0,a||0,s,o),e.emplaceBack(t?1:0,r?1:0,n||0,a||0,l,o),e.emplaceBack(t?1:0,r?1:0,n||0,a||0,l,h),e.emplaceBack(t?1:0,r?1:0,n||0,a||0,s,h)}let it=Math.pow(2,25),nt=Math.pow(2,24),at=Math.pow(2,17),st=Math.pow(2,16),ot=Math.pow(2,9),lt=Math.pow(2,8),ht=Math.pow(2,1);function At(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;let t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*it+t*nt+r*at+t*st+r*ot+t*lt+r*ht+t}let ut=0;class ct{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,i,n){let a=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(a,i,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,a.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<a.length;)if(t.placeLayerBucketPart(a[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1}}class dt{constructor(e,t,r,i,n,a,s,o){this.placement=new tt(e,t,a,s,o),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(e,t,r){let i=s.now(),n=()=>!this._forceFullPlacement&&s.now()-i>2;for(;this._currentPlacementIndex>=0;){let i=t[e[this._currentPlacementIndex]],a=this.placement.collisionIndex.transform.zoom;if("symbol"===i.type&&(!i.minzoom||i.minzoom<=a)&&(!i.maxzoom||i.maxzoom>a)){if(this._inProgressLayer||(this._inProgressLayer=new ct(i)),this._inProgressLayer.continuePlacement(r[i.source],this.placement,this._showCollisionBoxes,i,n))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}let pt=512/t.$/2;class ft{constructor(e,r,i){this.tileID=e,this.bucketInstanceId=i,this._symbolsByKey={};let n=new Map;for(let e=0;e<r.length;e++){let t=r.get(e),i=t.key,a=n.get(i);a?a.push(t):n.set(i,[t])}for(let[e,r]of n){let i={positions:r.map((e=>({x:Math.floor(e.anchorX*pt),y:Math.floor(e.anchorY*pt)}))),crossTileIDs:r.map((e=>e.crossTileID))};if(i.positions.length>128){let e=new t.aI(i.positions.length,16,Uint16Array);for(let{x:t,y:r}of i.positions)e.add(t,r);e.finish(),delete i.positions,i.index=e}this._symbolsByKey[e]=i}}getScaledCoordinates(e,r){let{x:i,y:n,z:a}=this.tileID.canonical,{x:s,y:o,z:l}=r.canonical,h=pt/Math.pow(2,l-a),A=(o*t.$+e.anchorY)*h,u=n*t.$*pt;return{x:Math.floor((s*t.$+e.anchorX)*h-i*t.$*pt),y:Math.floor(A-u)}}findMatches(e,t,r){let i=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let n=0;n<e.length;n++){let a=e.get(n);if(a.crossTileID)continue;let s=this._symbolsByKey[a.key];if(!s)continue;let o=this.getScaledCoordinates(a,t);if(s.index){let e=s.index.range(o.x-i,o.y-i,o.x+i,o.y+i).sort();for(let t of e){let e=s.crossTileIDs[t];if(!r[e]){r[e]=!0,a.crossTileID=e;break}}}else if(s.positions)for(let e=0;e<s.positions.length;e++){let t=s.positions[e],n=s.crossTileIDs[e];if(Math.abs(t.x-o.x)<=i&&Math.abs(t.y-o.y)<=i&&!r[n]){r[n]=!0,a.crossTileID=n;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map((({crossTileIDs:e})=>e))}}class gt{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class mt{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){let t=Math.round((e-this.lng)/360);if(0!==t)for(let e in this.indexes){let r=this.indexes[e],i={};for(let e in r){let n=r[e];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),i[n.tileID.key]=n}this.indexes[e]=i}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});let i=this.usedCrossTileIDs[e.overscaledZ];for(let r in this.indexes){let n=this.indexes[r];if(Number(r)>e.overscaledZ)for(let r in n){let a=n[r];a.tileID.isChildOf(e)&&a.findMatches(t.symbolInstances,e,i)}else{let a=n[e.scaledTo(Number(r)).key];a&&a.findMatches(t.symbolInstances,e,i)}}for(let e=0;e<t.symbolInstances.length;e++){let n=t.symbolInstances.get(e);n.crossTileID||(n.crossTileID=r.generate(),i[n.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new ft(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(let r of t.getCrossTileIDsLists())for(let t of r)delete this.usedCrossTileIDs[e][t]}removeStaleBuckets(e){let t=!1;for(let r in this.indexes){let i=this.indexes[r];for(let n in i)e[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],t=!0)}return t}}class yt{constructor(){this.layerIndexes={},this.crossTileIDs=new gt,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new mt);let n=!1,a={};i.handleWrapJump(r);for(let r of t){let t=r.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(r.tileID,t,this.crossTileIDs)&&(n=!0),a[t.bucketInstanceId]=!0)}return i.removeStaleBuckets(a)&&(n=!0),n}pruneUnusedLayers(e){let t={};e.forEach((e=>{t[e]=!0}));for(let e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}var _t="void main() {fragColor=vec4(1.0);}";let vt={prelude:wt("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nout highp vec4 fragColor;","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}mat3 rotationMatrixFromAxisAngle(vec3 u,float angle) {float c=cos(angle);float s=sin(angle);float c2=1.0-c;return mat3(u.x*u.x*c2+      c,u.x*u.y*c2-u.z*s,u.x*u.z*c2+u.y*s,u.y*u.x*c2+u.z*s,u.y*u.y*c2+    c,u.y*u.z*c2-u.x*s,u.z*u.x*c2-u.y*s,u.z*u.y*c2+u.x*s,u.z*u.z*c2+    c\n);}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\n#ifdef GLOBE\nif ((pos.y <-32767.5) || (pos.y > 32766.5)) {return 0.0;}\n#endif\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return elevation*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}const float PI=3.141592653589793;uniform mat4 u_projection_matrix;"),projectionMercator:wt("","float projectLineThickness(float tileY) {return 1.0;}float projectCircleRadius(float tileY) {return 1.0;}vec4 projectTile(vec2 p) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);return result;}vec4 projectTile(vec2 p,vec2 rawPos) {vec4 result=u_projection_matrix*vec4(p,0.0,1.0);if (rawPos.y <-32767.5 || rawPos.y > 32766.5) {result.z=-10000000.0;}return result;}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_projection_matrix*vec4(posInTile,elevation,1.0);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {return projectTileWithElevation(posInTile,elevation);}"),projectionGlobe:wt("","#define GLOBE_RADIUS 6371008.8\nuniform highp vec4 u_projection_tile_mercator_coords;uniform highp vec4 u_projection_clipping_plane;uniform highp float u_projection_transition;uniform mat4 u_projection_fallback_matrix;vec3 globeRotateVector(vec3 vec,vec2 angles) {vec3 axisRight=vec3(vec.z,0.0,-vec.x);vec3 axisUp=cross(axisRight,vec);axisRight=normalize(axisRight);axisUp=normalize(axisUp);vec2 t=tan(angles);return normalize(vec+axisRight*t.x+axisUp*t.y);}mat3 globeGetRotationMatrix(vec3 spherePos) {vec3 axisRight=vec3(spherePos.z,0.0,-spherePos.x);vec3 axisDown=cross(axisRight,spherePos);axisRight=normalize(axisRight);axisDown=normalize(axisDown);return mat3(axisRight,axisDown,spherePos\n);}float circumferenceRatioAtTileY(float tileY) {float mercator_pos_y=u_projection_tile_mercator_coords.y+u_projection_tile_mercator_coords.w*tileY;float spherical_y=2.0*atan(exp(PI-(mercator_pos_y*PI*2.0)))-PI*0.5;return cos(spherical_y);}float projectLineThickness(float tileY) {float thickness=1.0/circumferenceRatioAtTileY(tileY); \nif (u_projection_transition < 0.999) {return mix(1.0,thickness,u_projection_transition);} else {return thickness;}}vec3 projectToSphere(vec2 translatedPos,vec2 rawPos) {vec2 mercator_pos=u_projection_tile_mercator_coords.xy+u_projection_tile_mercator_coords.zw*translatedPos;vec2 spherical;spherical.x=mercator_pos.x*PI*2.0+PI;spherical.y=2.0*atan(exp(PI-(mercator_pos.y*PI*2.0)))-PI*0.5;float len=cos(spherical.y);vec3 pos=vec3(sin(spherical.x)*len,sin(spherical.y),cos(spherical.x)*len\n);if (rawPos.y <-32767.5) {pos=vec3(0.0,1.0,0.0);}if (rawPos.y > 32766.5) {pos=vec3(0.0,-1.0,0.0);}return pos;}vec3 projectToSphere(vec2 posInTile) {return projectToSphere(posInTile,vec2(0.0,0.0));}float globeComputeClippingZ(vec3 spherePos) {return (1.0-(dot(spherePos,u_projection_clipping_plane.xyz)+u_projection_clipping_plane.w));}vec4 interpolateProjection(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);globePosition.z=globeComputeClippingZ(elevatedPos)*globePosition.w;if (u_projection_transition > 0.999) {return globePosition;}vec4 flatPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);const float z_globeness_threshold=0.2;vec4 result=globePosition;result.z=mix(0.0,globePosition.z,clamp((u_projection_transition-z_globeness_threshold)/(1.0-z_globeness_threshold),0.0,1.0));result.xyw=mix(flatPosition.xyw,globePosition.xyw,u_projection_transition);if ((posInTile.y <-32767.5) || (posInTile.y > 32766.5)) {result=globePosition;const float poles_hidden_anim_percentage=0.02;result.z=mix(globePosition.z,100.0,pow(max((1.0-u_projection_transition)/poles_hidden_anim_percentage,0.0),8.0));}return result;}vec4 interpolateProjectionFor3D(vec2 posInTile,vec3 spherePos,float elevation) {vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);vec4 globePosition=u_projection_matrix*vec4(elevatedPos,1.0);if (u_projection_transition > 0.999) {return globePosition;}vec4 fallbackPosition=u_projection_fallback_matrix*vec4(posInTile,elevation,1.0);return mix(fallbackPosition,globePosition,u_projection_transition);}vec4 projectTile(vec2 posInTile) {return interpolateProjection(posInTile,projectToSphere(posInTile),0.0);}vec4 projectTile(vec2 posInTile,vec2 rawPos) {return interpolateProjection(posInTile,projectToSphere(posInTile,rawPos),0.0);}vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return interpolateProjection(posInTile,projectToSphere(posInTile),elevation);}vec4 projectTileFor3D(vec2 posInTile,float elevation) {vec3 spherePos=projectToSphere(posInTile,posInTile);return interpolateProjectionFor3D(posInTile,spherePos,elevation);}"),background:wt("uniform vec4 u_color;uniform float u_opacity;void main() {fragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),backgroundPattern:wt("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;void main() {gl_Position=projectTile(a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),circle:wt("in vec3 v_data;in float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);float antialiased_blur=v_data.z;float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));fragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);const float epsilon=0.5/255.0;if (fragColor.r < epsilon && fragColor.g < epsilon && fragColor.b < epsilon && fragColor.a < epsilon) {discard;}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform highp float u_globe_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;uniform vec2 u_translate;in vec2 a_pos;out vec3 v_data;out float v_visibility;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 pos_raw=a_pos+32768.0;vec2 extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);vec2 circle_center=floor(pos_raw/8.0)+u_translate;float ele=get_elevation(circle_center);v_visibility=calculate_visibility(projectTileWithElevation(circle_center,ele));if (u_pitch_with_map) {\n#ifdef GLOBE\nvec3 center_vector=projectToSphere(circle_center);\n#endif\nfloat angle_scale=u_globe_extrude_scale;vec2 corner_position=circle_center;if (u_scale_with_map) {angle_scale*=(radius+stroke_width);corner_position+=extrude*u_extrude_scale*(radius+stroke_width);} else {\n#ifdef GLOBE\nvec4 projected_center=interpolateProjection(circle_center,center_vector,ele);\n#else\nvec4 projected_center=projectTileWithElevation(circle_center,ele);\n#endif\ncorner_position+=extrude*u_extrude_scale*(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);angle_scale*=(radius+stroke_width)*(projected_center.w/u_camera_to_center_distance);}\n#ifdef GLOBE\nvec2 angles=extrude*angle_scale;vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(corner_position,corner_vector,ele);\n#else\ngl_Position=projectTileWithElevation(corner_position,ele);\n#endif\n} else {gl_Position=projectTileWithElevation(circle_center,ele);if (gl_Position.z/gl_Position.w > 1.0) {gl_Position.xy=vec2(10000.0);}if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}float antialiasblur=-max(1.0/u_device_pixel_ratio/(radius+stroke_width),blur);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"),clippingMask:wt(_t,"in vec2 a_pos;void main() {gl_Position=projectTile(a_pos);}"),heatmap:wt("uniform highp float u_intensity;in vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);fragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;uniform highp float u_globe_extrude_scale;in vec2 a_pos;out vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 pos_raw=a_pos+32768.0;vec2 unscaled_extrude=vec2(mod(pos_raw,8.0)/7.0*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec2 circle_center=floor(pos_raw/8.0);\n#ifdef GLOBE\nvec2 angles=v_extrude*radius*u_globe_extrude_scale;vec3 center_vector=projectToSphere(circle_center);vec3 corner_vector=globeRotateVector(center_vector,angles);gl_Position=interpolateProjection(circle_center+extrude,corner_vector,0.0);\n#else\ngl_Position=projectTileFor3D(circle_center+extrude,get_elevation(circle_center));\n#endif\n}"),heatmapTexture:wt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;in vec2 v_pos;void main() {float t=texture(u_image,v_pos).r;vec4 color=texture(u_color_ramp,vec2(t,0.5));fragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(0.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),collisionBox:wt("in float v_placed;in float v_notUsed;void main() {float alpha=0.5;fragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {fragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {fragColor*=.1;}}","in vec2 a_anchor_pos;in vec2 a_placed;in vec2 a_box_real;uniform vec2 u_pixel_extrude_scale;out float v_placed;out float v_notUsed;void main() {gl_Position=projectTileWithElevation(a_anchor_pos,get_elevation(a_anchor_pos));gl_Position.xy=((a_box_real+0.5)*u_pixel_extrude_scale*2.0-1.0)*vec2(1.0,-1.0)*gl_Position.w;if (gl_Position.z/gl_Position.w < 1.1) {gl_Position.z=0.5;}v_placed=a_placed.x;v_notUsed=a_placed.y;}"),collisionCircle:wt("in float v_radius;in vec2 v_extrude;in float v_collision;void main() {float alpha=0.5;float stroke_radius=0.9;float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);fragColor=color*alpha*opacity_t;}","in vec2 a_pos;in float a_radius;in vec2 a_flags;uniform vec2 u_viewport_size;out float v_radius;out vec2 v_extrude;out float v_collision;void main() {float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_collision=collision;gl_Position=vec4((a_pos/u_viewport_size*2.0-1.0)*vec2(1.0,-1.0),0.0,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),colorRelief:wt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;uniform vec4 u_unpack;uniform sampler2D u_elevation_stops;uniform sampler2D u_color_stops;uniform int u_color_ramp_size;uniform float u_opacity;in vec2 v_pos;float getElevation(vec2 coord) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}float getElevationStop(int stop) {float x=(float(stop)+0.5)/float(u_color_ramp_size);vec4 data=texture(u_elevation_stops,vec2(x,0))*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {float el=getElevation(v_pos);int r=(u_color_ramp_size-1);int l=0;float el_l=getElevationStop(l);float el_r=getElevationStop(r);while(r-l > 1){int m=(r+l)/2;float el_m=getElevationStop(m);if(el < el_m){r=m;el_r=el_m;}else\n{l=m;el_l=el_m;}}float x=(float(l)+(el-el_l)/(el_r-el_l)+0.5)/float(u_color_ramp_size);fragColor=u_opacity*texture(u_color_stops,vec2(x,0));\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_dimension;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_pos/8192.0)*scale+epsilon;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),debug:wt("uniform highp vec4 u_color;uniform sampler2D u_overlay;in vec2 v_uv;void main() {vec4 overlay_color=texture(u_overlay,v_uv);fragColor=mix(u_color,overlay_color,overlay_color.a);}","in vec2 a_pos;out vec2 v_uv;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=projectTileWithElevation(a_pos*u_overlay_scale,get_elevation(a_pos));}"),depth:wt(_t,"in vec2 a_pos;void main() {\n#ifdef GLOBE\ngl_Position=projectTileFor3D(a_pos,0.0);\n#else\ngl_Position=u_projection_matrix*vec4(a_pos,0.0,1.0);\n#endif\n}"),fill:wt("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\nfragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_fill_translate;in vec2 a_pos;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);}"),fillOutline:wt("in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=outline_color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillOutlinePattern:wt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;in vec2 v_pos_a;in vec2 v_pos_b;in vec2 v_pos;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);fragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;out vec2 v_pos;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n}"),fillPattern:wt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);fragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;uniform vec2 u_fill_translate;in vec2 a_pos;out vec2 v_pos_a;out vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=projectTile(a_pos+u_fill_translate,a_pos);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"),fillExtrusion:wt("in vec4 v_color;void main() {fragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\nout vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nfloat colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;vec3 normalForLighting=normal/16384.0;float directional=clamp(dot(normalForLighting,u_lightpos),0.0,1.0);\n#ifdef GLOBE\nmat3 rotMatrix=globeGetRotationMatrix(spherePos);normalForLighting=rotMatrix*normalForLighting;directional=mix(directional,clamp(dot(normalForLighting,u_lightpos_globe),0.0,1.0),u_projection_transition);\n#endif\ndirectional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"),fillExtrusionPattern:wt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;in vec2 v_pos_a;in vec2 v_pos_b;in vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);fragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec2 u_fill_translate;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp vec3 u_lightpos_globe;uniform lowp float u_lightintensity;in vec2 a_pos;in vec4 a_normal_ed;\n#ifdef TERRAIN3D\nin vec2 a_centroid;\n#endif\n#ifdef GLOBE\nout vec3 v_sphere_pos;\n#endif\nout vec2 v_pos_a;out vec2 v_pos_b;out vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;\n#ifdef TERRAIN3D\nfloat height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);\n#else\nfloat height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;\n#endif\nbase=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float elevation=t > 0.0 ? height : base;vec2 posInTile=a_pos+u_fill_translate;\n#ifdef GLOBE\nvec3 spherePos=projectToSphere(posInTile,a_pos);vec3 elevatedPos=spherePos*(1.0+elevation/GLOBE_RADIUS);v_sphere_pos=elevatedPos;gl_Position=interpolateProjectionFor3D(posInTile,spherePos,elevation);\n#else\ngl_Position=u_projection_matrix*vec4(posInTile,elevation,1.0);\n#endif\nvec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,elevation*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"),hillshadePrepare:wt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack);}void main() {vec2 epsilon=1.0/u_dimension;float tileSize=u_dimension.x-2.0;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))*tileSize/pow(2.0,exaggeration+(28.2562-u_zoom));fragColor=clamp(vec4(deriv.x/8.0+0.5,deriv.y/8.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_dimension;in vec2 a_pos;in vec2 a_texture_pos;out vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),hillshade:wt("uniform sampler2D u_image;in vec2 v_pos;uniform vec2 u_latrange;uniform float u_exaggeration;uniform vec4 u_accent;uniform int u_method;uniform float u_altitudes[NUM_ILLUMINATION_SOURCES];uniform float u_azimuths[NUM_ILLUMINATION_SOURCES];uniform vec4 u_shadows[NUM_ILLUMINATION_SOURCES];uniform vec4 u_highlights[NUM_ILLUMINATION_SOURCES];\n#define PI 3.141592653589793\n#define STANDARD 0\n#define COMBINED 1\n#define IGOR 2\n#define MULTIDIRECTIONAL 3\n#define BASIC 4\nfloat get_aspect(vec2 deriv){return deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);}void igor_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float aspect=get_aspect(deriv);float azimuth=u_azimuths[0]+PI;float slope_stength=atan(length(deriv))*2.0/PI;float aspect_strength=1.0-abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);float shadow_strength=slope_stength*aspect_strength;float highlight_strength=slope_stength*(1.0-aspect_strength);fragColor=u_shadows[0]*shadow_strength+u_highlights[0]*highlight_strength;}void standard_hillshade(vec2 deriv){float azimuth=u_azimuths[0]+PI;float slope=atan(0.625*length(deriv));float aspect=get_aspect(deriv);float intensity=u_exaggeration;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadows[0],u_highlights[0],shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);fragColor=accent_color*(1.0-shade_color.a)+shade_color;}void basic_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor=u_highlights[0]*(2.0*shade-1.0);}else\n{fragColor=u_shadows[0]*(1.0-2.0*shade);}}void multidirectional_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;fragColor=vec4(0,0,0,0);for(int i=0; i < NUM_ILLUMINATION_SOURCES; i++){float cos_alt=cos(u_altitudes[i]);float sin_alt=sin(u_altitudes[i]);float cos_az=-cos(u_azimuths[i]);float sin_az=-sin(u_azimuths[i]);float cang=(sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv));float shade=clamp(cang,0.0,1.0);if(shade > 0.5){fragColor+=u_highlights[i]*(2.0*shade-1.0)/float(NUM_ILLUMINATION_SOURCES);}else\n{fragColor+=u_shadows[i]*(1.0-2.0*shade)/float(NUM_ILLUMINATION_SOURCES);}}}void combined_hillshade(vec2 deriv){deriv=deriv*u_exaggeration*2.0;float azimuth=u_azimuths[0]+PI;float cos_az=cos(azimuth);float sin_az=sin(azimuth);float cos_alt=cos(u_altitudes[0]);float sin_alt=sin(u_altitudes[0]);float cang=acos((sin_alt-(deriv.y*cos_az*cos_alt-deriv.x*sin_az*cos_alt))/sqrt(1.0+dot(deriv,deriv)));cang=clamp(cang,0.0,PI/2.0);float shade=cang*atan(length(deriv))*4.0/PI/PI;float highlight=(PI/2.0-cang)*atan(length(deriv))*4.0/PI/PI;fragColor=u_shadows[0]*shade+u_highlights[0]*highlight;}void main() {vec4 pixel=texture(u_image,v_pos);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));vec2 deriv=((pixel.rg*8.0)-4.0)/scaleFactor;if (u_method==BASIC) {basic_hillshade(deriv);} else if (u_method==COMBINED) {combined_hillshade(deriv);} else if (u_method==IGOR) {igor_hillshade(deriv);} else if (u_method==MULTIDIRECTIONAL) {multidirectional_hillshade(deriv);} else if (u_method==STANDARD) {standard_hillshade(deriv);} else {standard_hillshade(deriv);}\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;in vec2 a_pos;out vec2 v_pos;void main() {gl_Position=projectTile(a_pos,a_pos);v_pos=a_pos/8192.0;if (a_pos.y <-32767.5) {v_pos.y=0.0;}if (a_pos.y > 32766.5) {v_pos.y=1.0;}}"),line:wt("uniform lowp float u_device_pixel_ratio;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp float v_linesofar;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:wt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;in vec2 v_width2;in vec2 v_normal;in float v_gamma_scale;in highp vec2 v_uv;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture(u_image,v_uv);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nin vec2 a_pos_normal;in vec4 a_data;in float a_uv_x;in float a_split_index;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;out vec2 v_normal;out vec2 v_width2;out float v_gamma_scale;out highp vec2 v_uv;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:wt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;in vec2 v_normal;in vec2 v_width2;in float v_linesofar;in float v_gamma_scale;in float v_width;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture(u_image,pos_a),texture(u_image,pos_b),u_fade);fragColor=color*alpha*opacity;\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;out vec2 v_normal;out vec2 v_width2;out float v_linesofar;out float v_gamma_scale;out float v_width;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:wt("uniform lowp float u_device_pixel_ratio;uniform lowp float u_lineatlas_width;uniform sampler2D u_image;uniform float u_mix;in vec2 v_normal;in vec2 v_width2;in vec2 v_tex_a;in vec2 v_tex_b;in float v_gamma_scale;\n#ifdef GLOBE\nin float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture(u_image,v_tex_a).a;float sdfdist_b=texture(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);float sdfgamma=(u_lineatlas_width/256.0)/min(dasharray_from.w,dasharray_to.w);alpha*=smoothstep(0.5-sdfgamma/floorwidth,0.5+sdfgamma/floorwidth,sdfdist);fragColor=color*(alpha*opacity);\n#ifdef GLOBE\nif (v_depth > 1.0) {discard;}\n#endif\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nin vec2 a_pos_normal;in vec4 a_data;uniform vec2 u_translation;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_tileratio;uniform float u_crossfade_from;uniform float u_crossfade_to;uniform float u_lineatlas_height;out vec2 v_normal;out vec2 v_width2;out vec2 v_tex_a;out vec2 v_tex_b;out float v_gamma_scale;\n#ifdef GLOBE\nout float v_depth;\n#endif\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define mediump vec4 dasharray_from\n#pragma mapbox: define mediump vec4 dasharray_to\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 dasharray_from\n#pragma mapbox: initialize mediump vec4 dasharray_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);float adjustedThickness=projectLineThickness(pos.y);vec4 projected_no_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation);vec4 projected_with_extrude=projectTile(pos+offset2/u_ratio*adjustedThickness+u_translation+dist/u_ratio*adjustedThickness);gl_Position=projected_with_extrude;\n#ifdef GLOBE\nv_depth=gl_Position.z/gl_Position.w;\n#endif\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length((projected_with_extrude.xy-projected_no_extrude.xy)/projected_with_extrude.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;\n#endif\nfloat u_patternscale_a_x=u_tileratio/dasharray_from.w/u_crossfade_from;float u_patternscale_a_y=-dasharray_from.z/2.0/u_lineatlas_height;float u_patternscale_b_x=u_tileratio/dasharray_to.w/u_crossfade_to;float u_patternscale_b_y=-dasharray_to.z/2.0/u_lineatlas_height;v_tex_a=vec2(a_linesofar*u_patternscale_a_x/floorwidth,normal.y*u_patternscale_a_y+(float(dasharray_from.y)+0.5)/u_lineatlas_height);v_tex_b=vec2(a_linesofar*u_patternscale_b_x/floorwidth,normal.y*u_patternscale_b_y+(float(dasharray_to.y)+0.5)/u_lineatlas_height);v_width2=vec2(outset,inset);}"),raster:wt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;in vec2 v_pos0;in vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture(u_image0,v_pos0);vec4 color1=texture(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);fragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;uniform vec4 u_coords_top;uniform vec4 u_coords_bottom;in vec2 a_pos;out vec2 v_pos0;out vec2 v_pos1;void main() {vec2 fractionalPos=a_pos/8192.0;vec2 position=mix(mix(u_coords_top.xy,u_coords_top.zw,fractionalPos.x),mix(u_coords_bottom.xy,u_coords_bottom.zw,fractionalPos.x),fractionalPos.y);gl_Position=projectTile(position,position);v_pos0=((fractionalPos-0.5)/u_buffer_scale)+0.5;\n#ifdef GLOBE\nif (a_pos.y <-32767.5) {v_pos0.y=0.0;}if (a_pos.y > 32766.5) {v_pos0.y=1.0;}\n#endif\nv_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:wt("uniform sampler2D u_texture;in vec2 v_tex;in float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;fragColor=texture(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_tex;out float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}gl_Position=finalPos;v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:wt("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;in vec2 v_data0;in vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float inner_edge=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);inner_edge=inner_edge+gamma*gamma_scale;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(inner_edge-gamma_scaled,inner_edge+gamma_scaled,dist);if (u_is_halo) {lowp float halo_edge=(6.0-halo_width/fontScale)/SDF_PX;alpha=min(smoothstep(halo_edge-gamma_scaled,halo_edge+gamma_scaled,dist),1.0-alpha);}fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec4 a_pixeloffset;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_translation;uniform float u_pitched_scale;out vec2 v_data0;out vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:wt("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;in vec4 v_data0;in vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;fragColor=texture(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);fragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\nfragColor=vec4(1.0);\n#endif\n}","in vec4 a_pos_offset;in vec4 a_data;in vec3 a_projected_pos;in float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;uniform bool u_is_along_line;uniform bool u_is_variable_anchor;uniform vec2 u_translation;uniform float u_pitched_scale;out vec4 v_data0;out vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;float ele=get_elevation(a_pos);highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec2 translated_a_pos=a_pos+u_translation;vec4 projectedPoint=projectTileWithElevation(translated_a_pos,ele);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=projectTileWithElevation(translated_a_pos+vec2(1,0),ele);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos;if (u_is_along_line || u_is_variable_anchor) {projected_pos=vec4(a_projected_pos.xy,ele,1.0);} else if (u_pitch_with_map) {projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy+u_translation,ele,1.0);} else {projected_pos=u_label_plane_matrix*projectTileWithElevation(a_projected_pos.xy+u_translation,ele);}float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;float projectionScaling=1.0;\n#ifdef GLOBE\nif(u_pitch_with_map && !u_is_along_line) {float anchor_pos_tile_y=(u_coord_matrix*vec4(projected_pos.xy/projected_pos.w,z,1.0)).y;projectionScaling=mix(projectionScaling,1.0/circumferenceRatioAtTileY(anchor_pos_tile_y)*u_pitched_scale,u_projection_transition);}\n#endif\nvec4 finalPos=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale)*projectionScaling,z,1.0);if(u_pitch_with_map) {finalPos=projectTileWithElevation(finalPos.xy,finalPos.z);}float gamma_scale=finalPos.w;gl_Position=finalPos;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}"),terrain:wt("uniform sampler2D u_texture;uniform vec4 u_fog_color;uniform vec4 u_horizon_color;uniform float u_fog_ground_blend;uniform float u_fog_ground_blend_opacity;uniform float u_horizon_fog_blend;uniform bool u_is_globe_mode;in vec2 v_texture_pos;in float v_fog_depth;const float gamma=2.2;vec4 gammaToLinear(vec4 color) {return pow(color,vec4(gamma));}vec4 linearToGamma(vec4 color) {return pow(color,vec4(1.0/gamma));}void main() {vec4 surface_color=texture(u_texture,vec2(v_texture_pos.x,1.0-v_texture_pos.y));if (!u_is_globe_mode && v_fog_depth > u_fog_ground_blend) {vec4 surface_color_linear=gammaToLinear(surface_color);float blend_color=smoothstep(0.0,1.0,max((v_fog_depth-u_horizon_fog_blend)/(1.0-u_horizon_fog_blend),0.0));vec4 fog_horizon_color_linear=mix(gammaToLinear(u_fog_color),gammaToLinear(u_horizon_color),blend_color);float factor_fog=max(v_fog_depth-u_fog_ground_blend,0.0)/(1.0-u_fog_ground_blend);fragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {fragColor=surface_color;}}","in vec3 a_pos3d;uniform mat4 u_fog_matrix;uniform float u_ele_delta;out vec2 v_texture_pos;out float v_fog_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,get_elevation(a_pos3d.xy)-ele_delta);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:wt("in float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {fragColor=pack(v_depth);}","in vec3 a_pos3d;uniform float u_ele_delta;out float v_depth;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:wt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;in vec2 v_texture_pos;void main() {vec4 rgba=texture(u_texture,v_texture_pos);fragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","in vec3 a_pos3d;uniform float u_ele_delta;out vec2 v_texture_pos;void main() {float ele=get_elevation(a_pos3d.xy);float ele_delta=a_pos3d.z==1.0 ? u_ele_delta : 0.0;v_texture_pos=a_pos3d.xy/8192.0;gl_Position=projectTileFor3D(a_pos3d.xy,ele-ele_delta);}"),projectionErrorMeasurement:wt("in vec4 v_output_error_encoded;void main() {fragColor=v_output_error_encoded;}","in vec2 a_pos;uniform highp float u_input;uniform highp float u_output_expected;out vec4 v_output_error_encoded;void main() {float real_output=2.0*atan(exp(PI-(u_input*PI*2.0)))-PI*0.5;float error=real_output-u_output_expected;float abs_error=abs(error)*128.0;v_output_error_encoded.x=min(floor(abs_error*256.0),255.0)/255.0;abs_error-=v_output_error_encoded.x;v_output_error_encoded.y=min(floor(abs_error*65536.0),255.0)/255.0;abs_error-=v_output_error_encoded.x/255.0;v_output_error_encoded.z=min(floor(abs_error*16777216.0),255.0)/255.0;v_output_error_encoded.w=error >=0.0 ? 1.0 : 0.0;gl_Position=vec4(a_pos,0.0,1.0);}"),atmosphere:wt("in vec3 view_direction;uniform vec3 u_sun_pos;uniform vec3 u_globe_position;uniform float u_globe_radius;uniform float u_atmosphere_blend;/**Shader use from https:*Made some change to adapt to MapLibre Globe geometry*/const float PI=3.141592653589793;const int iSteps=5;const int jSteps=3;/*radius of the planet*/const float EARTH_RADIUS=6371e3;/*radius of the atmosphere*/const float ATMOS_RADIUS=6471e3;vec2 rsi(vec3 r0,vec3 rd,float sr) {float a=dot(rd,rd);float b=2.0*dot(rd,r0);float c=dot(r0,r0)-(sr*sr);float d=(b*b)-4.0*a*c;if (d < 0.0) return vec2(1e5,-1e5);return vec2((-b-sqrt(d))/(2.0*a),(-b+sqrt(d))/(2.0*a));}vec4 atmosphere(vec3 r,vec3 r0,vec3 pSun,float iSun,float rPlanet,float rAtmos,vec3 kRlh,float kMie,float shRlh,float shMie,float g) {pSun=normalize(pSun);r=normalize(r);vec2 p=rsi(r0,r,rAtmos);if (p.x > p.y) {return vec4(0.0,0.0,0.0,1.0);}if (p.x < 0.0) {p.x=0.0;}vec3 pos=r0+r*p.x;vec2 p2=rsi(r0,r,rPlanet);if (p2.x <=p2.y && p2.x > 0.0) {p.y=min(p.y,p2.x);}float iStepSize=(p.y-p.x)/float(iSteps);float iTime=p.x+iStepSize*0.5;vec3 totalRlh=vec3(0,0,0);vec3 totalMie=vec3(0,0,0);float iOdRlh=0.0;float iOdMie=0.0;float mu=dot(r,pSun);float mumu=mu*mu;float gg=g*g;float pRlh=3.0/(16.0*PI)*(1.0+mumu);float pMie=3.0/(8.0*PI)*((1.0-gg)*(mumu+1.0))/(pow(1.0+gg-2.0*mu*g,1.5)*(2.0+gg));for (int i=0; i < iSteps; i++) {vec3 iPos=r0+r*iTime;float iHeight=length(iPos)-rPlanet;float odStepRlh=exp(-iHeight/shRlh)*iStepSize;float odStepMie=exp(-iHeight/shMie)*iStepSize;iOdRlh+=odStepRlh;iOdMie+=odStepMie;float jStepSize=rsi(iPos,pSun,rAtmos).y/float(jSteps);float jTime=jStepSize*0.5;float jOdRlh=0.0;float jOdMie=0.0;for (int j=0; j < jSteps; j++) {vec3 jPos=iPos+pSun*jTime;float jHeight=length(jPos)-rPlanet;jOdRlh+=exp(-jHeight/shRlh)*jStepSize;jOdMie+=exp(-jHeight/shMie)*jStepSize;jTime+=jStepSize;}vec3 attn=exp(-(kMie*(iOdMie+jOdMie)+kRlh*(iOdRlh+jOdRlh)));totalRlh+=odStepRlh*attn;totalMie+=odStepMie*attn;iTime+=iStepSize;}float opacity=exp(-(length(kRlh)*length(totalRlh)+kMie*length(totalMie)));vec3 color=iSun*(pRlh*kRlh*totalRlh+pMie*kMie*totalMie);return vec4(color,opacity);}void main() {vec3 scale_camera_pos=-u_globe_position*EARTH_RADIUS/u_globe_radius;vec4 color=atmosphere(normalize(view_direction),scale_camera_pos,u_sun_pos,22.0,EARTH_RADIUS,ATMOS_RADIUS,vec3(5.5e-6,13.0e-6,22.4e-6),21e-6,8e3,1.2e3,0.758\n);color.rgb=1.0-exp(-1.0*color.rgb);color=pow(color,vec4(1.0/2.2));fragColor=vec4(color.rgb,1.0-color.a)*u_atmosphere_blend;}","in vec2 a_pos;uniform mat4 u_inv_proj_matrix;out vec3 view_direction;void main() {view_direction=(u_inv_proj_matrix*vec4(a_pos,0.0,1.0)).xyz;gl_Position=vec4(a_pos,0.0,1.0);}"),sky:wt("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform vec2 u_horizon;uniform vec2 u_horizon_normal;uniform float u_sky_horizon_blend;uniform float u_sky_blend;void main() {float x=gl_FragCoord.x;float y=gl_FragCoord.y;float blend=(y-u_horizon.y)*u_horizon_normal.y+(x-u_horizon.x)*u_horizon_normal.x;if (blend > 0.0) {if (blend < u_sky_horizon_blend) {fragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {fragColor=u_sky_color;}}fragColor=mix(fragColor,vec4(vec3(0.0),0.0),u_sky_blend);}","in vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function wt(e,t){let r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=t.match(/in ([\w]+) ([\w]+)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),s=a?a.concat(n):n,o={};return{fragmentSource:e=e.replace(r,((e,t,r,i,n)=>(o[n]=!0,"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nin ${r} ${i} ${n};\n#else\nuniform ${r} ${i} u_${n};\n#endif\n`:`\n#ifdef HAS_UNIFORM_u_${n}\n    ${r} ${i} ${n} = u_${n};\n#endif\n`))),vertexSource:t=t.replace(r,((e,t,r,i,n)=>{let a="float"===i?"vec2":"vec4",s=n.match(/color/)?"color":a;return o[n]?"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${r} ${a} a_${n};\nout ${r} ${i} ${n};\n#else\nuniform ${r} ${i} u_${n};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${n}\n    ${n} = a_${n};\n#else\n    ${r} ${i} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n    ${n} = unpack_mix_${s}(a_${n}, u_${n}_t);\n#else\n    ${r} ${i} ${n} = u_${n};\n#endif\n`:"define"===t?`\n#ifndef HAS_UNIFORM_u_${n}\nuniform lowp float u_${n}_t;\nin ${r} ${a} a_${n};\n#else\nuniform ${r} ${i} u_${n};\n#endif\n`:"vec4"===s?`\n#ifndef HAS_UNIFORM_u_${n}\n    ${r} ${i} ${n} = a_${n};\n#else\n    ${r} ${i} ${n} = u_${n};\n#endif\n`:`\n#ifndef HAS_UNIFORM_u_${n}\n    ${r} ${i} ${n} = unpack_mix_${s}(a_${n}, u_${n}_t);\n#else\n    ${r} ${i} ${n} = u_${n};\n#endif\n`})),staticAttributes:i,staticUniforms:s}}class bt{constructor(e,t,r){this.vertexBuffer=e,this.indexBuffer=t,this.segments=r}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}var xt=t.aJ([{name:"a_pos",type:"Int16",components:2}]);let Bt="#define PROJECTION_MERCATOR",Ct="mercator";class St{constructor(){this._cachedMesh=null}get name(){return"mercator"}get useSubdivision(){return!1}get shaderVariantName(){return Ct}get shaderDefine(){return Bt}get shaderPreludeCode(){return vt.projectionMercator}get vertexShaderPreludeCode(){return vt.projectionMercator.vertexSource}get subdivisionGranularity(){return t.aK.noSubdivision}get useGlobeControls(){return!1}get transitionState(){return 0}get latitudeErrorCorrectionRadians(){return 0}destroy(){}updateGPUdependent(e){}getMeshFromTileID(e,r,i,n,a){if(this._cachedMesh)return this._cachedMesh;let s=new t.aL;s.emplaceBack(0,0),s.emplaceBack(t.$,0),s.emplaceBack(0,t.$),s.emplaceBack(t.$,t.$);let o=e.createVertexBuffer(s,xt.members),l=t.aM.simpleSegment(0,0,4,2),h=new t.aN;h.emplaceBack(1,0,2),h.emplaceBack(1,2,3);let A=e.createIndexBuffer(h);return this._cachedMesh=new bt(o,A,l),this._cachedMesh}recalculate(){}hasTransition(){return!1}setErrorQueryLatitudeDegrees(e){}}class Et{constructor(e=0,t=0,r=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=t,this.left=r,this.right=i}interpolate(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.C.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.C.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.C.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.C.number(e.right,r.right,i)),this}getCenter(e,r){let i=t.ah((this.left+e-this.right)/2,0,e),n=t.ah((this.top+r-this.bottom)/2,0,r);return new t.P(i,n)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new Et(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}function It(e,t){if(!e.renderWorldCopies||e.lngRange)return;let r=t.lng-e.center.lng;t.lng+=r>180?-360:r<-180?360:0}function Tt(e){return Math.max(0,Math.floor(e))}class Ft{constructor(e,r,i,n,a,s){this._callbacks=e,this._tileSize=512,this._renderWorldCopies=void 0===s||!!s,this._minZoom=r||0,this._maxZoom=i||22,this._minPitch=n??0,this._maxPitch=a??60,this.setMaxBounds(),this._width=0,this._height=0,this._center=new t.S(0,0),this._elevation=0,this._zoom=0,this._tileZoom=Tt(this._zoom),this._scale=t.af(this._zoom),this._bearingInRadians=0,this._fovInRadians=.6435011087932844,this._pitchInRadians=0,this._rollInRadians=0,this._unmodified=!0,this._edgeInsets=new Et,this._minElevationForCurrentTile=0,this._autoCalculateNearFarZ=!0}apply(e,r,i){this._latRange=e.latRange,this._lngRange=e.lngRange,this._width=e.width,this._height=e.height,this._center=e.center,this._elevation=e.elevation,this._minElevationForCurrentTile=e.minElevationForCurrentTile,this._zoom=e.zoom,this._tileZoom=Tt(this._zoom),this._scale=t.af(this._zoom),this._bearingInRadians=e.bearingInRadians,this._fovInRadians=e.fovInRadians,this._pitchInRadians=e.pitchInRadians,this._rollInRadians=e.rollInRadians,this._unmodified=e.unmodified,this._edgeInsets=new Et(e.padding.top,e.padding.bottom,e.padding.left,e.padding.right),this._minZoom=e.minZoom,this._maxZoom=e.maxZoom,this._minPitch=e.minPitch,this._maxPitch=e.maxPitch,this._renderWorldCopies=e.renderWorldCopies,this._cameraToCenterDistance=e.cameraToCenterDistance,this._nearZ=e.nearZ,this._farZ=e.farZ,this._autoCalculateNearFarZ=!i&&e.autoCalculateNearFarZ,r&&this._constrain(),this._calcMatrices()}get pixelsToClipSpaceMatrix(){return this._pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._clipSpaceToPixelsMatrix}get minElevationForCurrentTile(){return this._minElevationForCurrentTile}setMinElevationForCurrentTile(e){this._minElevationForCurrentTile=e}get tileSize(){return this._tileSize}get tileZoom(){return this._tileZoom}get scale(){return this._scale}get width(){return this._width}get height(){return this._height}get bearingInRadians(){return this._bearingInRadians}get lngRange(){return this._lngRange}get latRange(){return this._latRange}get pixelsToGLUnits(){return this._pixelsToGLUnits}get minZoom(){return this._minZoom}setMinZoom(e){this._minZoom!==e&&(this._minZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get maxZoom(){return this._maxZoom}setMaxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.setZoom(this.getConstrained(this._center,this.zoom).zoom))}get minPitch(){return this._minPitch}setMinPitch(e){this._minPitch!==e&&(this._minPitch=e,this.setPitch(Math.max(this.pitch,e)))}get maxPitch(){return this._maxPitch}setMaxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.setPitch(Math.min(this.pitch,e)))}get renderWorldCopies(){return this._renderWorldCopies}setRenderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this._tileSize*this._scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new t.P(this._width,this._height)}get bearing(){return this._bearingInRadians/Math.PI*180}setBearing(e){let r=t.aO(e,-180,180)*Math.PI/180;var n,a,s,o,l,h,A,u,c;this._bearingInRadians!==r&&(this._unmodified=!1,this._bearingInRadians=r,this._calcMatrices(),this._rotationMatrix=i(),n=this._rotationMatrix,s=-this._bearingInRadians,o=(a=this._rotationMatrix)[0],l=a[1],h=a[2],A=a[3],u=Math.sin(s),c=Math.cos(s),n[0]=o*c+h*u,n[1]=l*c+A*u,n[2]=o*-u+h*c,n[3]=l*-u+A*c)}get rotationMatrix(){return this._rotationMatrix}get pitchInRadians(){return this._pitchInRadians}get pitch(){return this._pitchInRadians/Math.PI*180}setPitch(e){let r=t.ah(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitchInRadians!==r&&(this._unmodified=!1,this._pitchInRadians=r,this._calcMatrices())}get rollInRadians(){return this._rollInRadians}get roll(){return this._rollInRadians/Math.PI*180}setRoll(e){let t=e/180*Math.PI;this._rollInRadians!==t&&(this._unmodified=!1,this._rollInRadians=t,this._calcMatrices())}get fovInRadians(){return this._fovInRadians}get fov(){return t.aP(this._fovInRadians)}setFov(e){e=t.ah(e,.1,150),this.fov!==e&&(this._unmodified=!1,this._fovInRadians=t.ae(e),this._calcMatrices())}get zoom(){return this._zoom}setZoom(e){let r=this.getConstrained(this._center,e).zoom;this._zoom!==r&&(this._unmodified=!1,this._zoom=r,this._tileZoom=Math.max(0,Math.floor(r)),this._scale=t.af(r),this._constrain(),this._calcMatrices())}get center(){return this._center}setCenter(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}setElevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}setPadding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this._width,this._height)}get pixelsPerMeter(){return this._pixelPerMeter}get unmodified(){return this._unmodified}get cameraToCenterDistance(){return this._cameraToCenterDistance}get nearZ(){return this._nearZ}get farZ(){return this._farZ}get autoCalculateNearFarZ(){return this._autoCalculateNearFarZ}overrideNearFarZ(e,t){this._autoCalculateNearFarZ=!1,this._nearZ=e,this._farZ=t,this._calcMatrices()}clearNearFarZOverride(){this._autoCalculateNearFarZ=!0,this._calcMatrices()}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}resize(e,t,r=!0){this._width=e,this._height=t,r&&this._constrain(),this._calcMatrices()}getMaxBounds(){return this._latRange&&2===this._latRange.length&&this._lngRange&&2===this._lngRange.length?new j([this._lngRange[0],this._latRange[0]],[this._lngRange[1],this._latRange[1]]):null}setMaxBounds(e){e?(this._lngRange=[e.getWest(),e.getEast()],this._latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this._lngRange=null,this._latRange=[-t.ai,t.ai])}getConstrained(e,t){return this._callbacks.getConstrained(e,t)}getCameraQueryGeometry(e,r){if(1===r.length)return[r[0],e];{let{minX:i,minY:n,maxX:a,maxY:s}=t.a2.fromPoints(r).extend(e);return[new t.P(i,n),new t.P(a,n),new t.P(a,s),new t.P(i,s),new t.P(i,n)]}}_constrain(){if(!this.center||!this._width||!this._height||this._constraining)return;this._constraining=!0;let e=this._unmodified,{center:t,zoom:r}=this.getConstrained(this.center,this.zoom);this.setCenter(t),this.setZoom(r),this._unmodified=e,this._constraining=!1}_calcMatrices(){if(this._width&&this._height){this._pixelsToGLUnits=[2/this._width,-2/this._height];let e=t.ag(new Float64Array(16));t.N(e,e,[this._width/2,-this._height/2,1]),t.M(e,e,[1,-1,0]),this._clipSpaceToPixelsMatrix=e,e=t.ag(new Float64Array(16)),t.N(e,e,[1,-1,1]),t.M(e,e,[-1,-1,0]),t.N(e,e,[2/this._width,2/this._height,1]),this._pixelsToClipSpaceMatrix=e,this._cameraToCenterDistance=.5/Math.tan(this.fovInRadians/2)*this._height}this._callbacks.calcMatrices()}calculateCenterFromCameraLngLatAlt(e,r,i,n){let a,s=void 0!==i?i:this.bearing,o=n=void 0!==n?n:this.pitch,l=t.a1.fromLngLat(e,r),h=-Math.cos(t.ae(o)),A=Math.sin(t.ae(o)),u=A*Math.sin(t.ae(s)),c=-A*Math.cos(t.ae(s)),d=this.elevation,p=r-d;h*p>=0||Math.abs(h)<.1?(a=1e4,d=r+a*h):a=-p/h;let f,g,m=t.aQ(1,l.y),y=0;do{if(y+=1,y>10)break;g=a/m,f=new t.a1(l.x+u*g,l.y+c*g),m=1/f.meterInMercatorCoordinateUnits()}while(Math.abs(a-g*m)>1e-12);return{center:f.toLngLat(),elevation:d,zoom:t.ak(this.height/2/Math.tan(this.fovInRadians/2)/g/this.tileSize)}}recalculateZoomAndCenter(e){if(this.elevation-e==0)return;let r=t.aj(1,this.center.lat)*this.worldSize,i=this.cameraToCenterDistance/r,n=t.a1.fromLngLat(this.center,this.elevation),a=ce(this.center,this.elevation,this.pitch,this.bearing,i);this._elevation=e;let s=this.calculateCenterFromCameraLngLatAlt(a.toLngLat(),t.aQ(a.z,n.y),this.bearing,this.pitch);this._elevation=s.elevation,this._center=s.center,this.setZoom(s.zoom)}getCameraPoint(){let e=Math.tan(this.pitchInRadians)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.P(e*Math.sin(this.rollInRadians),e*Math.cos(this.rollInRadians)))}getCameraAltitude(){return Math.cos(this.pitchInRadians)*this._cameraToCenterDistance/this._pixelPerMeter+this.elevation}getCameraLngLat(){let e=t.aj(1,this.center.lat)*this.worldSize;return ce(this.center,this.elevation,this.pitch,this.bearing,this.cameraToCenterDistance/e).toLngLat()}getMercatorTileCoordinates(e){if(!e)return[0,0,1,1];let r=e.canonical.z>=0?1<<e.canonical.z:Math.pow(2,e.canonical.z);return[e.canonical.x/r,e.canonical.y/r,1/r/t.$,1/r/t.$]}}class Pt{constructor(e,r){this.min=e,this.max=r,this.center=t.aR([],t.aS([],this.min,this.max),.5)}quadrant(e){let r=[e%2==0,e<2],i=t.aT(this.min),n=t.aT(this.max);for(let e=0;e<r.length;e++)i[e]=r[e]?this.min[e]:this.center[e],n[e]=r[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new Pt(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersectsFrustum(e){let t=!0;for(let r=0;r<e.planes.length;r++){let i=this.intersectsPlane(e.planes[r]);if(0===i)return 0;1===i&&(t=!1)}return t?2:e.aabb.min[0]>this.max[0]||e.aabb.min[1]>this.max[1]||e.aabb.min[2]>this.max[2]||e.aabb.max[0]<this.min[0]||e.aabb.max[1]<this.min[1]||e.aabb.max[2]<this.min[2]?0:1}intersectsPlane(e){let t=e[3],r=e[3];for(let i=0;i<3;i++)e[i]>0?(t+=e[i]*this.min[i],r+=e[i]*this.max[i]):(r+=e[i]*this.min[i],t+=e[i]*this.max[i]);return t>=0?2:r<0?0:1}}class Lt{distanceToTile2d(e,t,r,i){let n=i.distanceX([e,t]),a=i.distanceY([e,t]);return Math.hypot(n,a)}getWrap(e,t,r){return r}getTileBoundingVolume(e,r,i,n){var a,s;let o=0,l=0;if(n?.terrain){let h=new t.Z(e.z,r,e.z,e.x,e.y),A=n.terrain.getMinMaxElevation(h);o=null!==(a=A.minElevation)&&void 0!==a?a:Math.min(0,i),l=null!==(s=A.maxElevation)&&void 0!==s?s:Math.max(0,i)}let h=1<<e.z;return new Pt([r+e.x/h,e.y/h,o],[r+(e.x+1)/h,(e.y+1)/h,l])}allowVariableZoom(e,r){let i=e.fov*(Math.abs(Math.cos(e.rollInRadians))*e.height+Math.abs(Math.sin(e.rollInRadians))*e.width)/e.height,n=t.ah(78.5-i/2,0,60);return!!r.terrain||e.pitch>n}allowWorldCopies(){return!0}prepareNextFrame(){}}class Mt{constructor(e,t,r){this.points=e,this.planes=t,this.aabb=r}static fromInvProjectionMatrix(e,r=1,i=0,n,a){let s=a?[[6,5,4],[0,1,2],[0,3,7],[2,1,5],[3,2,6],[0,4,5]]:[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]],o=Math.pow(2,i),l=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map((i=>function(e,r,i,n){let a=t.aw([],e,r),s=1/a[3]/i*n;return t.aY(a,a,[s,s,1/a[3],s])}(i,e,r,o)));n&&function(e,r,i,n){let a=n?4:0,s=n?0:4,o=0,l=[],h=[];for(let r=0;r<4;r++){let i=t.aU([],e[r+s],e[r+a]),n=t.aZ(i);t.aR(i,i,1/n),l.push(n),h.push(i)}for(let r=0;r<4;r++){let n=t.a_(e[r+a],h[r],i);o=null!==n&&n>=0?Math.max(o,n):Math.max(o,l[r])}let A=function(e,r){let i=t.aU([],e[r[0]],e[r[1]]),n=t.aU([],e[r[2]],e[r[1]]),a=[0,0,0,0];return t.aV(a,t.aW([],i,n)),a[3]=-t.aX(a,e[r[0]]),a}(e,r),u=function(e,r){let i=t.a$(e),n=t.b0([],e,1/i),a=t.aU([],r,t.aR([],n,t.aX(r,n))),s=t.a$(a);if(s>0){let e=Math.sqrt(1-n[3]*n[3]),i=t.aR([],n,-n[3]),o=t.aS([],i,t.aR([],a,e/s));return t.b1(r,o)}return null}(i,A);if(null!==u){let e=u/t.aX(h[0],A);o=Math.min(o,e)}for(let t=0;t<4;t++){let r=Math.min(o,l[t]);e[t+s]=[e[t+a][0]+h[t][0]*r,e[t+a][1]+h[t][1]*r,e[t+a][2]+h[t][2]*r,1]}}(l,s[0],n,a);let h=s.map((e=>{let r=t.aU([],l[e[0]],l[e[1]]),i=t.aU([],l[e[2]],l[e[1]]),n=t.aV([],t.aW([],r,i)),a=-t.aX(n,l[e[1]]);return n.concat(a)})),A=[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY],u=[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY];for(let e of l)for(let t=0;t<3;t++)A[t]=Math.min(A[t],e[t]),u[t]=Math.max(u[t],e[t]);return new Mt(l,h,new Pt(A,u))}}class kt{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,r){return this._helper.interpolatePadding(e,t,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,r=!0){this._helper.resize(e,t,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e,t){}constructor(e,t,r,i,n){this._posMatrixCache=new Map,this._alignedPosMatrixCache=new Map,this._fogMatrixCacheF32=new Map,this._helper=new Ft({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,t)=>this.getConstrained(e,t)},e,t,r,i,n),this._coveringTilesDetailsProvider=new Lt}clone(){let e=new kt;return e.apply(this),e}apply(e,t,r){this._helper.apply(e,t,r)}get cameraPosition(){return this._cameraPosition}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._viewProjMatrix}get inverseProjectionMatrix(){return this._invProjMatrix}get mercatorMatrix(){return this._mercatorMatrix}getVisibleUnwrappedCoordinates(e){let r=[new t.b2(0,e)];if(this._helper._renderWorldCopies){let i=this.screenPointToMercatorCoordinate(new t.P(0,0)),n=this.screenPointToMercatorCoordinate(new t.P(this._helper._width,0)),a=this.screenPointToMercatorCoordinate(new t.P(this._helper._width,this._helper._height)),s=this.screenPointToMercatorCoordinate(new t.P(0,this._helper._height)),o=Math.floor(Math.min(i.x,n.x,a.x,s.x)),l=Math.floor(Math.max(i.x,n.x,a.x,s.x)),h=1;for(let i=o-h;i<=l+h;i++)0!==i&&r.push(new t.b2(i,e))}return r}getCameraFrustum(){return Mt.fromInvProjectionMatrix(this._invViewProjMatrix,this.worldSize)}getClippingPlane(){return null}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){let t=this.screenPointToLocation(this.centerPoint,e),r=e?e.getElevationForLngLatZoom(t,this._helper._tileZoom):0;this._helper.recalculateZoomAndCenter(r)}setLocationAtPoint(e,r){let i=t.aj(this.elevation,this.center.lat),n=this.screenPointToMercatorCoordinateAtZ(r,i),a=this.screenPointToMercatorCoordinateAtZ(this.centerPoint,i),s=t.a1.fromLngLat(e),o=new t.a1(s.x-(n.x-a.x),s.y-(n.y-a.y));this.setCenter(o?.toLngLat()),this._helper._renderWorldCopies&&this.setCenter(this.center.wrap())}locationToScreenPoint(e,r){return r?this.coordinatePoint(t.a1.fromLngLat(e),r.getElevationForLngLatZoom(e,this._helper._tileZoom),this._pixelMatrix3D):this.coordinatePoint(t.a1.fromLngLat(e))}screenPointToLocation(e,t){var r;return null===(r=this.screenPointToMercatorCoordinate(e,t))||void 0===r?void 0:r.toLngLat()}screenPointToMercatorCoordinate(e,t){if(t){let r=t.pointCoordinate(e);if(null!=r)return r}return this.screenPointToMercatorCoordinateAtZ(e)}screenPointToMercatorCoordinateAtZ(e,r){let i=r||0,n=[e.x,e.y,0,1],a=[e.x,e.y,1,1];t.aw(n,n,this._pixelMatrixInverse),t.aw(a,a,this._pixelMatrixInverse);let s=n[3],o=a[3],l=n[1]/s,h=a[1]/o,A=n[2]/s,u=a[2]/o,c=A===u?0:(i-A)/(u-A);return new t.a1(t.C.number(n[0]/s,a[0]/o,c)/this.worldSize,t.C.number(l,h,c)/this.worldSize,i)}coordinatePoint(e,r=0,i=this._pixelMatrix){let n=[e.x*this.worldSize,e.y*this.worldSize,r,1];return t.aw(n,n,i),new t.P(n[0]/n[3],n[1]/n[3])}getBounds(){let e=Math.max(0,this._helper._height/2-Ae(this));return(new j).extend(this.screenPointToLocation(new t.P(0,e))).extend(this.screenPointToLocation(new t.P(this._helper._width,e))).extend(this.screenPointToLocation(new t.P(this._helper._width,this._helper._height))).extend(this.screenPointToLocation(new t.P(0,this._helper._height)))}isPointOnMapSurface(e,t){return t?null!=t.pointCoordinate(e):e.y>this.height/2-Ae(this)}calculatePosMatrix(e,r=!1,i){var n;let a=null!==(n=e.key)&&void 0!==n?n:t.b3(e.wrap,e.canonical.z,e.canonical.z,e.canonical.x,e.canonical.y),s=r?this._alignedPosMatrixCache:this._posMatrixCache;if(s.has(a)){let e=s.get(a);return i?e.f32:e.f64}let o=ue(e,this.worldSize);t.O(o,r?this._alignedProjMatrix:this._viewProjMatrix,o);let l={f64:o,f32:new Float32Array(o)};return s.set(a,l),i?l.f32:l.f64}calculateFogMatrix(e){let r=e.key,i=this._fogMatrixCacheF32;if(i.has(r))return i.get(r);let n=ue(e,this.worldSize);return t.O(n,this._fogMatrix,n),i.set(r,new Float32Array(n)),i.get(r)}getConstrained(e,r){r=t.ah(+r,this.minZoom,this.maxZoom);let i={center:new t.S(e.lng,e.lat),zoom:r},n=this._helper._lngRange;if(!this._helper._renderWorldCopies&&null===n){let e=179.9999999999;n=[-e,e]}let a=this.tileSize*t.af(i.zoom),s=0,o=a,l=0,h=a,A=0,u=0,{x:c,y:d}=this.size;if(this._helper._latRange){let e=this._helper._latRange;s=t.U(e[1])*a,o=t.U(e[0])*a,o-s<d&&(A=d/(o-s))}n&&(l=t.aO(t.V(n[0])*a,0,a),h=t.aO(t.V(n[1])*a,0,a),h<l&&(h+=a),h-l<c&&(u=c/(h-l)));let p,f,{x:g,y:m}=le(a,e),y=Math.max(u||0,A||0);if(y){let e=new t.P(u?(h+l)/2:g,A?(o+s)/2:m);return i.center=he(a,e).wrap(),i.zoom+=t.ak(y),i}if(this._helper._latRange){let e=d/2;m-e<s&&(f=s+e),m+e>o&&(f=o-e)}if(n){let e=(l+h)/2,r=g;this._helper._renderWorldCopies&&(r=t.aO(g,e-a/2,e+a/2));let i=c/2;r-i<l&&(p=l+i),r+i>h&&(p=h-i)}if(void 0!==p||void 0!==f){let e=new t.P(p??g,f??m);i.center=he(a,e).wrap()}return i}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}_calculateNearFarZIfNeeded(e,r,i){if(!this._helper.autoCalculateNearFarZ)return;let n=Math.min(this.elevation,this.minElevationForCurrentTile,this.getCameraAltitude()-100),a=e-n*this._helper._pixelPerMeter/Math.cos(r),s=n<0?a:e,o=Math.PI/2+this.pitchInRadians,l=t.ae(this.fov)*(Math.abs(Math.cos(t.ae(this.roll)))*this.height+Math.abs(Math.sin(t.ae(this.roll)))*this.width)/this.height*(.5+i.y/this.height),h=Math.sin(l)*s/Math.sin(t.ah(Math.PI-o-l,.01,Math.PI-.01)),A=Ae(this),u=Math.atan(A/this._helper.cameraToCenterDistance),c=t.ae(.75),d=u>c?2*u*(.5+i.y/(2*A)):c,p=Math.sin(d)*s/Math.sin(t.ah(Math.PI-o-d,.01,Math.PI-.01)),f=Math.min(h,p);this._helper._farZ=1.01*(Math.cos(Math.PI/2-r)*f+s),this._helper._nearZ=this._helper._height/50}_calcMatrices(){if(!this._helper._height)return;let e=this.centerOffset,r=le(this.worldSize,this.center),i=r.x,n=r.y;this._helper._pixelPerMeter=t.aj(1,this.center.lat)*this.worldSize;let a,s=t.ae(Math.min(this.pitch,oe)),o=Math.max(this._helper.cameraToCenterDistance/2,this._helper.cameraToCenterDistance+this._helper._elevation*this._helper._pixelPerMeter/Math.cos(s));this._calculateNearFarZIfNeeded(o,s,e),a=new Float64Array(16),t.b4(a,this.fovInRadians,this._helper._width/this._helper._height,this._helper._nearZ,this._helper._farZ),this._invProjMatrix=new Float64Array(16),t.aq(this._invProjMatrix,a),a[8]=2*-e.x/this._helper._width,a[9]=2*e.y/this._helper._height,this._projectionMatrix=t.b5(a),t.N(a,a,[1,-1,1]),t.M(a,a,[0,0,-this._helper.cameraToCenterDistance]),t.b6(a,a,-this.rollInRadians),t.b7(a,a,this.pitchInRadians),t.b6(a,a,-this.bearingInRadians),t.M(a,a,[-i,-n,0]),this._mercatorMatrix=t.N([],a,[this.worldSize,this.worldSize,this.worldSize]),t.N(a,a,[1,1,this._helper._pixelPerMeter]),this._pixelMatrix=t.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,a),t.M(a,a,[0,0,-this.elevation]),this._viewProjMatrix=a,this._invViewProjMatrix=t.aq([],a);let l=[0,0,-1,1];t.aw(l,l,this._invViewProjMatrix),this._cameraPosition=[l[0]/l[3],l[1]/l[3],l[2]/l[3]],this._fogMatrix=new Float64Array(16),t.b4(this._fogMatrix,this.fovInRadians,this.width/this.height,o,this._helper._farZ),this._fogMatrix[8]=2*-e.x/this.width,this._fogMatrix[9]=2*e.y/this.height,t.N(this._fogMatrix,this._fogMatrix,[1,-1,1]),t.M(this._fogMatrix,this._fogMatrix,[0,0,-this.cameraToCenterDistance]),t.b6(this._fogMatrix,this._fogMatrix,-this.rollInRadians),t.b7(this._fogMatrix,this._fogMatrix,this.pitchInRadians),t.b6(this._fogMatrix,this._fogMatrix,-this.bearingInRadians),t.M(this._fogMatrix,this._fogMatrix,[-i,-n,0]),t.N(this._fogMatrix,this._fogMatrix,[1,1,this._helper._pixelPerMeter]),t.M(this._fogMatrix,this._fogMatrix,[0,0,-this.elevation]),this._pixelMatrix3D=t.O(new Float64Array(16),this.clipSpaceToPixelsMatrix,a);let h=this._helper._width%2/2,A=this._helper._height%2/2,u=Math.cos(this.bearingInRadians),c=Math.sin(-this.bearingInRadians),d=i-Math.round(i)+u*h+c*A,p=n-Math.round(n)+u*A+c*h,f=new Float64Array(a);if(t.M(f,f,[d>.5?d-1:d,p>.5?p-1:p,0]),this._alignedProjMatrix=f,a=t.aq(new Float64Array(16),this._pixelMatrix),!a)throw new Error("failed to invert matrix");this._pixelMatrixInverse=a,this._clearMatrixCaches()}_clearMatrixCaches(){this._posMatrixCache.clear(),this._alignedPosMatrixCache.clear(),this._fogMatrixCacheF32.clear()}maxPitchScaleFactor(){if(!this._pixelMatrixInverse)return 1;let e=this.screenPointToMercatorCoordinate(new t.P(0,0)),r=[e.x*this.worldSize,e.y*this.worldSize,0,1];return t.aw(r,r,this._pixelMatrix)[3]/this._helper.cameraToCenterDistance}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){let e=t.aj(1,this.center.lat)*this.worldSize;return ce(this.center,this.elevation,this.pitch,this.bearing,this._helper.cameraToCenterDistance/e).toLngLat()}lngLatToCameraDepth(e,r){let i=t.a1.fromLngLat(e),n=[i.x*this.worldSize,i.y*this.worldSize,r,1];return t.aw(n,n,this._viewProjMatrix),n[2]/n[3]}getProjectionData(e){let r,{overscaledTileID:i,aligned:n,applyTerrainMatrix:a}=e,s=this._helper.getMercatorTileCoordinates(i),o=i?this.calculatePosMatrix(i,n,!0):null;return r=i&&i.terrainRttPosMatrix32f&&a?i.terrainRttPosMatrix32f:o||t.b8(),{mainMatrix:r,tileMercatorCoords:s,clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:r}}isLocationOccluded(e){return!1}getPixelScale(){return 1}getCircleRadiusCorrection(){return 1}getPitchedTextCorrection(e,t,r){return 1}transformLightDirection(e){return t.aT(e)}getRayDirectionFromPixel(e){throw new Error("Not implemented.")}projectTileCoordinates(e,r,i,n){let a,s=this.calculatePosMatrix(i);n?(a=[e,r,n(e,r),1],t.aw(a,a,s)):(a=[e,r,0,1],Ke(a,a,s));let o=a[3];return{point:new t.P(a[0]/o,a[1]/o),signedDistanceFromCamera:o,isOccluded:!1}}populateCache(e){for(let t of e)this.calculatePosMatrix(t)}getMatrixForModel(e,r){let i=t.a1.fromLngLat(e,r),n=i.meterInMercatorCoordinateUnits(),a=t.b9();return t.M(a,a,[i.x,i.y,i.z]),t.b6(a,a,Math.PI),t.b7(a,a,Math.PI/2),t.N(a,a,[-n,n,n]),a}getProjectionDataForCustomLayer(e=!0){let r=new t.Z(0,0,0,0,0),i=this.getProjectionData({overscaledTileID:r,applyGlobeMatrix:e}),n=ue(r,this.worldSize);t.O(n,this._viewProjMatrix,n),i.tileMercatorCoords=[0,0,1,1];let a=[t.$,t.$,this.worldSize/this._helper.pixelsPerMeter],s=t.ba();return t.N(s,n,a),i.fallbackMatrix=s,i.mainMatrix=s,i}getFastPathSimpleProjectionMatrix(e){return this.calculatePosMatrix(e)}}function Ut(){t.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.")}function Rt(e){if(e.useSlerp)if(e.k<1){let r=t.bb(e.startEulerAngles.roll,e.startEulerAngles.pitch,e.startEulerAngles.bearing),i=t.bb(e.endEulerAngles.roll,e.endEulerAngles.pitch,e.endEulerAngles.bearing),n=new Float64Array(4);t.bc(n,r,i,e.k);let a=t.bd(n);e.tr.setRoll(a.roll),e.tr.setPitch(a.pitch),e.tr.setBearing(a.bearing)}else e.tr.setRoll(e.endEulerAngles.roll),e.tr.setPitch(e.endEulerAngles.pitch),e.tr.setBearing(e.endEulerAngles.bearing);else e.tr.setRoll(t.C.number(e.startEulerAngles.roll,e.endEulerAngles.roll,e.k)),e.tr.setPitch(t.C.number(e.startEulerAngles.pitch,e.endEulerAngles.pitch,e.k)),e.tr.setBearing(t.C.number(e.startEulerAngles.bearing,e.endEulerAngles.bearing,e.k))}function Dt(e,r,i,n,a){let s=a.padding,o=le(a.worldSize,i.getNorthWest()),l=le(a.worldSize,i.getNorthEast()),h=le(a.worldSize,i.getSouthEast()),A=le(a.worldSize,i.getSouthWest()),u=t.ae(-n),c=o.rotate(u),d=l.rotate(u),p=h.rotate(u),f=A.rotate(u),g=new t.P(Math.max(c.x,d.x,f.x,p.x),Math.max(c.y,d.y,f.y,p.y)),m=new t.P(Math.min(c.x,d.x,f.x,p.x),Math.min(c.y,d.y,f.y,p.y)),y=g.sub(m),_=(a.width-(s.left+s.right+r.left+r.right))/y.x,v=(a.height-(s.top+s.bottom+r.top+r.bottom))/y.y;if(v<0||_<0)return void Ut();let w=Math.min(t.ak(a.scale*Math.min(_,v)),e.maxZoom),b=t.P.convert(e.offset),x=new t.P((r.left-r.right)/2,(r.top-r.bottom)/2).rotate(t.ae(n)),B=b.add(x).mult(a.scale/t.af(w));return{center:he(a.worldSize,o.add(h).div(2).sub(B)),zoom:w,bearing:n}}class Nt{get useGlobeControls(){return!1}handlePanInertia(e,t){let r=e.mag(),i=Math.abs(Ae(t));return{easingOffset:e.mult(Math.min(.75*i/r,1)),easingCenter:t.center}}handleMapControlsRollPitchBearingZoom(e,t){e.bearingDelta&&t.setBearing(t.bearing+e.bearingDelta),e.pitchDelta&&t.setPitch(t.pitch+e.pitchDelta),e.rollDelta&&t.setRoll(t.roll+e.rollDelta),e.zoomDelta&&t.setZoom(t.zoom+e.zoomDelta)}handleMapControlsPan(e,t,r){e.around.distSqr(t.centerPoint)<.01||t.setLocationAtPoint(r,e.around)}cameraForBoxAndBearing(e,t,r,i,n){return Dt(e,t,r,i,n)}handleJumpToCenterZoom(e,r){e.zoom!==(void 0!==r.zoom?+r.zoom:e.zoom)&&e.setZoom(+r.zoom),void 0!==r.center&&e.setCenter(t.S.convert(r.center))}handleEaseTo(e,r){let i=e.zoom,n=e.padding,a={roll:e.roll,pitch:e.pitch,bearing:e.bearing},s={roll:void 0===r.roll?e.roll:r.roll,pitch:void 0===r.pitch?e.pitch:r.pitch,bearing:void 0===r.bearing?e.bearing:r.bearing},o=void 0!==r.zoom,l=!e.isPaddingEqual(r.padding),h=!1,A=o?+r.zoom:e.zoom,u=e.centerPoint.add(r.offsetAsPoint),c=e.screenPointToLocation(u),{center:d,zoom:p}=e.getConstrained(t.S.convert(r.center||c),A??i);It(e,d);let f=le(e.worldSize,c),g=le(e.worldSize,d).sub(f),m=t.af(p-i);return h=p!==i,{easeFunc:o=>{if(h&&e.setZoom(t.C.number(i,p,o)),t.be(a,s)||Rt({startEulerAngles:a,endEulerAngles:s,tr:e,k:o,useSlerp:a.roll!=s.roll}),l&&(e.interpolatePadding(n,r.padding,o),u=e.centerPoint.add(r.offsetAsPoint)),r.around)e.setLocationAtPoint(r.around,r.aroundPoint);else{let r=t.af(e.zoom-i),n=p>i?Math.min(2,m):Math.max(.5,m),a=Math.pow(n,1-o),s=he(e.worldSize,f.add(g.mult(o*a)).mult(r));e.setLocationAtPoint(e.renderWorldCopies?s.wrap():s,u)}},isZooming:h,elevationCenter:d}}handleFlyTo(e,r){let i=void 0!==r.zoom,n=e.zoom,a=e.getConstrained(t.S.convert(r.center||r.locationAtOffset),i?+r.zoom:n),s=a.center,o=a.zoom;It(e,s);let l,h=le(e.worldSize,r.locationAtOffset),A=le(e.worldSize,s).sub(h),u=A.mag(),c=t.af(o-n);if(void 0!==r.minZoom){let i=Math.min(+r.minZoom,n,o),a=e.getConstrained(s,i).zoom;l=t.af(a-n)}return{easeFunc:(r,i,a,l)=>{e.setZoom(1===r?o:n+t.ak(i));let u=1===r?s:he(e.worldSize,h.add(A.mult(a)).mult(i));e.setLocationAtPoint(e.renderWorldCopies?u.wrap():u,l)},scaleOfZoom:c,targetCenter:s,scaleOfMinZoom:l,pixelPathLength:u}}}class Ot{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}Ot.Replace=[1,0],Ot.disabled=new Ot(Ot.Replace,t.bf.transparent,[!1,!1,!1,!1]),Ot.unblended=new Ot(Ot.Replace,t.bf.transparent,[!0,!0,!0,!0]),Ot.alphaBlended=new Ot([1,771],t.bf.transparent,[!0,!0,!0,!0]);let Qt=2305;class zt{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}zt.disabled=new zt(!1,1029,Qt),zt.backCCW=new zt(!0,1029,Qt),zt.frontCCW=new zt(!0,1028,Qt);class Ht{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}Ht.ReadOnly=!1,Ht.ReadWrite=!0,Ht.disabled=new Ht(519,Ht.ReadOnly,[0,1]);let jt=7680;class Vt{constructor(e,t,r,i,n,a){this.test=e,this.ref=t,this.mask=r,this.fail=i,this.depthFail=n,this.pass=a}}Vt.disabled=new Vt({func:519,mask:0},0,0,jt,jt,jt);let Gt=new WeakMap;function Kt(e){var t;if(Gt.has(e))return Gt.get(e);{let r=null===(t=e.getParameter(e.VERSION))||void 0===t?void 0:t.startsWith("WebGL 2.0");return Gt.set(e,r),r}}class qt{get awaitingQuery(){return!!this._readbackQueue}constructor(e){this._readbackWaitFrames=4,this._measureWaitFrames=6,this._texWidth=1,this._texHeight=1,this._measuredError=0,this._updateCount=0,this._lastReadbackFrame=-1e3,this._readbackQueue=null,this._cachedRenderContext=e;let r=e.context,i=r.gl;this._texFormat=i.RGBA,this._texType=i.UNSIGNED_BYTE;let n=new t.aL;n.emplaceBack(-1,-1),n.emplaceBack(2,-1),n.emplaceBack(-1,2);let a=new t.aN;a.emplaceBack(0,1,2),this._fullscreenTriangle=new bt(r.createVertexBuffer(n,xt.members),r.createIndexBuffer(a),t.aM.simpleSegment(0,0,n.length,a.length)),this._resultBuffer=new Uint8Array(4),r.activeTexture.set(i.TEXTURE1);let s=i.createTexture();i.bindTexture(i.TEXTURE_2D,s),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.NEAREST),i.texImage2D(i.TEXTURE_2D,0,this._texFormat,this._texWidth,this._texHeight,0,this._texFormat,this._texType,null),this._fbo=r.createFramebuffer(this._texWidth,this._texHeight,!1,!1),this._fbo.colorAttachment.set(s),Kt(i)&&(this._pbo=i.createBuffer(),i.bindBuffer(i.PIXEL_PACK_BUFFER,this._pbo),i.bufferData(i.PIXEL_PACK_BUFFER,4,i.STREAM_READ),i.bindBuffer(i.PIXEL_PACK_BUFFER,null))}destroy(){let e=this._cachedRenderContext.context.gl;this._fullscreenTriangle.destroy(),this._fbo.destroy(),e.deleteBuffer(this._pbo),this._fullscreenTriangle=null,this._fbo=null,this._pbo=null,this._resultBuffer=null}updateErrorLoop(e,t){let r=this._updateCount;return this._readbackQueue?r>=this._readbackQueue.frameNumberIssued+this._readbackWaitFrames&&this._tryReadback():r>=this._lastReadbackFrame+this._measureWaitFrames&&this._renderErrorTexture(e,t),this._updateCount++,this._measuredError}_bindFramebuffer(){let e=this._cachedRenderContext.context,t=e.gl;e.activeTexture.set(t.TEXTURE1),t.bindTexture(t.TEXTURE_2D,this._fbo.colorAttachment.get()),e.bindFramebuffer.set(this._fbo.framebuffer)}_renderErrorTexture(e,r){let i=this._cachedRenderContext.context,n=i.gl;if(this._bindFramebuffer(),i.viewport.set([0,0,this._texWidth,this._texHeight]),i.clear({color:t.bf.transparent}),this._cachedRenderContext.useProgram("projectionErrorMeasurement").draw(i,n.TRIANGLES,Ht.disabled,Vt.disabled,Ot.unblended,zt.disabled,{u_input:e,u_output_expected:r},null,null,"$clipping",this._fullscreenTriangle.vertexBuffer,this._fullscreenTriangle.indexBuffer,this._fullscreenTriangle.segments),this._pbo&&Kt(n)){n.bindBuffer(n.PIXEL_PACK_BUFFER,this._pbo),n.readBuffer(n.COLOR_ATTACHMENT0),n.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,0),n.bindBuffer(n.PIXEL_PACK_BUFFER,null);let e=n.fenceSync(n.SYNC_GPU_COMMANDS_COMPLETE,0);n.flush(),this._readbackQueue={frameNumberIssued:this._updateCount,sync:e}}else this._readbackQueue={frameNumberIssued:this._updateCount,sync:null}}_tryReadback(){let e=this._cachedRenderContext.context.gl;if(this._pbo&&this._readbackQueue&&Kt(e)){let r=e.clientWaitSync(this._readbackQueue.sync,0,0);if(r===e.WAIT_FAILED)return t.w("WebGL2 clientWaitSync failed."),this._readbackQueue=null,void(this._lastReadbackFrame=this._updateCount);if(r===e.TIMEOUT_EXPIRED)return;e.bindBuffer(e.PIXEL_PACK_BUFFER,this._pbo),e.getBufferSubData(e.PIXEL_PACK_BUFFER,0,this._resultBuffer,0,4),e.bindBuffer(e.PIXEL_PACK_BUFFER,null)}else this._bindFramebuffer(),e.readPixels(0,0,this._texWidth,this._texHeight,this._texFormat,this._texType,this._resultBuffer);this._readbackQueue=null,this._measuredError=qt._parseRGBA8float(this._resultBuffer),this._lastReadbackFrame=this._updateCount}static _parseRGBA8float(e){let t=0;return t+=e[0]/256,t+=e[1]/65536,t+=e[2]/16777216,e[3]<127&&(t=-t),t/128}}let Zt=t.$/128;function Wt(e,r){let i=void 0!==e.granularity?Math.max(e.granularity,1):1,n=i+(e.generateBorders?2:0),a=i+(e.extendToNorthPole||e.generateBorders?1:0)+(e.extendToSouthPole||e.generateBorders?1:0),s=n+1,o=a+1,l=e.generateBorders?-1:0,h=e.generateBorders||e.extendToNorthPole?-1:0,A=i+(e.generateBorders?1:0),u=i+(e.generateBorders||e.extendToSouthPole?1:0),c=s*o,d=n*a*6,p=s*o>65536;if(p&&"16bit"===r)throw new Error("Granularity is too large and meshes would not fit inside 16 bit vertex indices.");let f=p||"32bit"===r,g=new Int16Array(2*c),m=0;for(let r=h;r<=u;r++)for(let n=l;n<=A;n++){let a=n/i*t.$;-1===n&&(a=-Zt),n===i+1&&(a=t.$+Zt);let s=r/i*t.$;-1===r&&(s=e.extendToNorthPole?t.bh:-Zt),r===i+1&&(s=e.extendToSouthPole?t.bi:t.$+Zt),g[m++]=a,g[m++]=s}let y=f?new Uint32Array(d):new Uint16Array(d),_=0;for(let e=0;e<a;e++)for(let t=0;t<n;t++){let r=t+1+e*s,i=t+(e+1)*s,n=t+1+(e+1)*s;y[_++]=t+e*s,y[_++]=i,y[_++]=r,y[_++]=r,y[_++]=i,y[_++]=n}return{vertices:g.buffer.slice(0),indices:y.buffer.slice(0),uses32bitIndices:f}}let $t=new t.aK({fill:new t.bj(128,2),line:new t.bj(512,0),tile:new t.bj(128,32),stencil:new t.bj(128,1),circle:3});class Xt{constructor(){this._tileMeshCache={},this._errorCorrectionUsable=0,this._errorMeasurementLastValue=0,this._errorCorrectionPreviousValue=0,this._errorMeasurementLastChangeTime=-1e3}get name(){return"vertical-perspective"}get transitionState(){return 1}get useSubdivision(){return!0}get shaderVariantName(){return"globe"}get shaderDefine(){return"#define GLOBE"}get shaderPreludeCode(){return vt.projectionGlobe}get vertexShaderPreludeCode(){return vt.projectionMercator.vertexSource}get subdivisionGranularity(){return $t}get useGlobeControls(){return!0}get latitudeErrorCorrectionRadians(){return this._errorCorrectionUsable}destroy(){this._errorMeasurement&&this._errorMeasurement.destroy()}updateGPUdependent(e){this._errorMeasurement||(this._errorMeasurement=new qt(e));let r=t.U(this._errorQueryLatitudeDegrees),i=2*Math.atan(Math.exp(Math.PI-r*Math.PI*2))-.5*Math.PI,n=this._errorMeasurement.updateErrorLoop(r,i),a=s.now();n!==this._errorMeasurementLastValue&&(this._errorCorrectionPreviousValue=this._errorCorrectionUsable,this._errorMeasurementLastValue=n,this._errorMeasurementLastChangeTime=a);let o=Math.min(Math.max((a-this._errorMeasurementLastChangeTime)/1e3/.5,0),1);this._errorCorrectionUsable=t.bk(this._errorCorrectionPreviousValue,-this._errorMeasurementLastValue,t.bl(o))}_getMeshKey(e){return`${e.granularity.toString(36)}_${e.generateBorders?"b":""}${e.extendToNorthPole?"n":""}${e.extendToSouthPole?"s":""}`}getMeshFromTileID(e,t,r,i,n){let a=("stencil"===n?$t.stencil:$t.tile).getGranularityForZoomLevel(t.z);return this._getMesh(e,{granularity:a,generateBorders:r,extendToNorthPole:0===t.y&&i,extendToSouthPole:t.y===(1<<t.z)-1&&i})}_getMesh(e,r){let i=this._getMeshKey(r);if(i in this._tileMeshCache)return this._tileMeshCache[i];let n=function(e,r){let i=Wt(r,"16bit"),n=t.aL.deserialize({arrayBuffer:i.vertices,length:i.vertices.byteLength/2/2}),a=t.aN.deserialize({arrayBuffer:i.indices,length:i.indices.byteLength/2/3});return new bt(e.createVertexBuffer(n,xt.members),e.createIndexBuffer(a),t.aM.simpleSegment(0,0,n.length,a.length))}(e,r);return this._tileMeshCache[i]=n,n}recalculate(e){}hasTransition(){let e=s.now(),t=!1;return t=t||(e-this._errorMeasurementLastChangeTime)/1e3<.7,t=t||this._errorMeasurement&&this._errorMeasurement.awaitingQuery,t}setErrorQueryLatitudeDegrees(e){this._errorQueryLatitudeDegrees=e}}let Yt=new t.r({type:new t.D(t.v.projection.type)});class Jt extends t.E{constructor(e){super(),this._transitionable=new t.t(Yt,void 0),this.setProjection(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new t.F(0)),this._mercatorProjection=new St,this._verticalPerspectiveProjection=new Xt}get transitionState(){let e=this.properties.get("type");if("string"==typeof e&&"mercator"===e)return 0;if("string"==typeof e&&"vertical-perspective"===e)return 1;if(e instanceof t.bm){if("vertical-perspective"===e.from&&"mercator"===e.to)return 1-e.transition;if("mercator"===e.from&&"vertical-perspective"===e.to)return e.transition}return 1}get useGlobeRendering(){return this.transitionState>0}get latitudeErrorCorrectionRadians(){return this._verticalPerspectiveProjection.latitudeErrorCorrectionRadians}get currentProjection(){return this.useGlobeRendering?this._verticalPerspectiveProjection:this._mercatorProjection}get name(){return"globe"}get useSubdivision(){return this.currentProjection.useSubdivision}get shaderVariantName(){return this.currentProjection.shaderVariantName}get shaderDefine(){return this.currentProjection.shaderDefine}get shaderPreludeCode(){return this.currentProjection.shaderPreludeCode}get vertexShaderPreludeCode(){return this.currentProjection.vertexShaderPreludeCode}get subdivisionGranularity(){return this.currentProjection.subdivisionGranularity}get useGlobeControls(){return this.transitionState>0}destroy(){this._mercatorProjection.destroy(),this._verticalPerspectiveProjection.destroy()}updateGPUdependent(e){this._mercatorProjection.updateGPUdependent(e),this._verticalPerspectiveProjection.updateGPUdependent(e)}getMeshFromTileID(e,t,r,i,n){return this.currentProjection.getMeshFromTileID(e,t,r,i,n)}setProjection(e){this._transitionable.setValue("type",e?.type||"mercator")}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()||this.currentProjection.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}setErrorQueryLatitudeDegrees(e){this._verticalPerspectiveProjection.setErrorQueryLatitudeDegrees(e),this._mercatorProjection.setErrorQueryLatitudeDegrees(e)}}function er(e){let t=ir(e.worldSize,e.center.lat);return 2*Math.PI*t}function tr(e,r,i,n,a){let s=1/(1<<a),o=r/t.$*s+n*s,l=t.bo((e/t.$*s+i*s)*Math.PI*2+Math.PI,2*Math.PI),h=2*Math.atan(Math.exp(Math.PI-o*Math.PI*2))-.5*Math.PI,A=Math.cos(h),u=new Float64Array(3);return u[0]=Math.sin(l)*A,u[1]=Math.sin(h),u[2]=Math.cos(l)*A,u}function rr(e){return function(e,t){let r=Math.cos(t),i=new Float64Array(3);return i[0]=Math.sin(e)*r,i[1]=Math.sin(t),i[2]=Math.cos(e)*r,i}(e.lng*Math.PI/180,e.lat*Math.PI/180)}function ir(e,t){return e/(2*Math.PI)/Math.cos(t*Math.PI/180)}function nr(e){let r=Math.asin(e[1])/Math.PI*180,i=Math.sqrt(e[0]*e[0]+e[2]*e[2]);if(i>1e-6){let n=e[0]/i,a=Math.acos(e[2]/i),s=(n>0?a:-a)/Math.PI*180;return new t.S(t.aO(s,-180,180),r)}return new t.S(0,r)}function ar(e){return Math.cos(e*Math.PI/180)}function sr(e,r){let i=ar(e),n=ar(r);return t.ak(n/i)}function or(e,r){let i=e.rotate(r.bearingInRadians),n=r.zoom+sr(r.center.lat,0),a=t.bk(1/ar(r.center.lat),1/ar(Math.min(Math.abs(r.center.lat),60)),t.bn(n,7,3,0,1)),s=360/er({worldSize:r.worldSize,center:{lat:r.center.lat}});return new t.S(r.center.lng-i.x*s*a,t.ah(r.center.lat+i.y*s,-t.ai,t.ai))}function lr(e){let t=.5*e,r=Math.sin(t),i=Math.cos(t);return Math.log(r+i)-Math.log(i-r)}function hr(e,r,i,n){let a=e.lat+i*n;if(Math.abs(i)>1){let s=(Math.sign(e.lat+i)!==Math.sign(e.lat)?-Math.abs(e.lat):Math.abs(e.lat))*Math.PI/180,o=Math.abs(e.lat+i)*Math.PI/180,l=lr(s+n*(o-s)),h=lr(s),A=lr(o);return new t.S(e.lng+r*((l-h)/(A-h)),a)}return new t.S(e.lng+r*n,a)}class Ar{constructor(e){this._cachePrevious=new Map,this._cache=new Map,this._hadAnyChanges=!1,this._boundingVolumeFactory=e}swapBuffers(){if(!this._hadAnyChanges)return;let e=this._cachePrevious;this._cachePrevious=this._cache,this._cache=e,this._cache.clear(),this._hadAnyChanges=!1}getTileBoundingVolume(e,t,r,i){let n=`${e.z}_${e.x}_${e.y}_${i?.terrain?"t":""}`,a=this._cache.get(n);if(a)return a;let s=this._cachePrevious.get(n);if(s)return this._cache.set(n,s),s;let o=this._boundingVolumeFactory(e,t,r,i);return this._cache.set(n,o),this._hadAnyChanges=!0,o}}class ur{constructor(e,t,r,i){this.min=r,this.max=i,this.points=e,this.planes=t}static fromAabb(e,t){let r=[];for(let i=0;i<8;i++)r.push([1&~i?e[0]:t[0],1==(i>>1&1)?t[1]:e[1],1==(i>>2&1)?t[2]:e[2]]);return new ur(r,[[-1,0,0,t[0]],[1,0,0,-e[0]],[0,-1,0,t[1]],[0,1,0,-e[1]],[0,0,-1,t[2]],[0,0,1,-e[2]]],e,t)}static fromCenterSizeAngles(e,r,i){let n=t.br([],i[0],i[1],i[2]),a=t.bs([],[r[0],0,0],n),s=t.bs([],[0,r[1],0],n),o=t.bs([],[0,0,r[2]],n),l=[...e],h=[...e];for(let t=0;t<8;t++)for(let r=0;r<3;r++){let i=e[r]+a[r]*(1&~t?-1:1)+s[r]*(1==(t>>1&1)?1:-1)+o[r]*(1==(t>>2&1)?1:-1);l[r]=Math.min(l[r],i),h[r]=Math.max(h[r],i)}let A=[];for(let r=0;r<8;r++){let i=[...e];t.aS(i,i,t.aR([],a,1&~r?-1:1)),t.aS(i,i,t.aR([],s,1==(r>>1&1)?1:-1)),t.aS(i,i,t.aR([],o,1==(r>>2&1)?1:-1)),A.push(i)}return new ur(A,[[...a,-t.aX(a,A[0])],[...s,-t.aX(s,A[0])],[...o,-t.aX(o,A[0])],[-a[0],-a[1],-a[2],-t.aX(a,A[7])],[-s[0],-s[1],-s[2],-t.aX(s,A[7])],[-o[0],-o[1],-o[2],-t.aX(o,A[7])]],l,h)}intersectsFrustum(e){let t=!0,r=this.points.length,i=this.planes.length,n=e.planes.length,a=e.points.length;for(let i=0;i<n;i++){let n=e.planes[i],a=0;for(let e=0;e<r;e++){let t=this.points[e];n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]>=0&&a++}if(0===a)return 0;a<r&&(t=!1)}if(t)return 2;for(let t=0;t<i;t++){let r=this.planes[t],i=0;for(let t=0;t<a;t++){let n=e.points[t];r[0]*n[0]+r[1]*n[1]+r[2]*n[2]+r[3]>=0&&i++}if(0===i)return 0}return 1}intersectsPlane(e){let t=this.points.length,r=0;for(let i=0;i<t;i++){let t=this.points[i];e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]>=0&&r++}return r===t?2:0===r?0:1}}function cr(e,t,r){let i=e-t;return i<0?-i:Math.max(0,i-r)}function dr(e,t,r,i,n){let a,s=e-r;return a=s<0?Math.min(-s,1+s-n):s>1?Math.min(Math.max(s-n,0),1-s):0,Math.max(a,cr(t,i,n))}class pr{constructor(){this._boundingVolumeCache=new Ar(this._computeTileBoundingVolume)}prepareNextFrame(){this._boundingVolumeCache.swapBuffers()}distanceToTile2d(e,t,r,i){let n=1<<r.z,a=1/n,s=r.x/n,o=r.y/n,l=2;return l=Math.min(l,dr(e,t,s,o,a)),l=Math.min(l,dr(e,t,s+.5,-o-a,a)),l=Math.min(l,dr(e,t,s+.5,2-o-a,a)),l}getWrap(e,t,r){let i=1<<t.z,n=1/i,a=t.x/i,s=cr(e.x,a,n),o=cr(e.x,a-1,n),l=cr(e.x,a+1,n),h=Math.min(s,o,l);return h===l?1:h===o?-1:0}allowVariableZoom(e,t){return me(e,t)>4}allowWorldCopies(){return!1}getTileBoundingVolume(e,t,r,i){return this._boundingVolumeCache.getTileBoundingVolume(e,t,r,i)}_computeTileBoundingVolume(e,r,i,n){var a,s;let o=0,l=0;if(n?.terrain){let h=new t.Z(e.z,r,e.z,e.x,e.y),A=n.terrain.getMinMaxElevation(h);o=null!==(a=A.minElevation)&&void 0!==a?a:Math.min(0,i),l=null!==(s=A.maxElevation)&&void 0!==s?s:Math.max(0,i)}if(o/=t.bu,l/=t.bu,o+=1,l+=1,e.z<=0)return ur.fromAabb([-l,-l,-l],[l,l,l]);if(1===e.z)return ur.fromAabb([0===e.x?-l:0,0===e.y?0:-l,-l],[0===e.x?0:l,0===e.y?l:0,l]);{let r=[tr(0,0,e.x,e.y,e.z),tr(t.$,0,e.x,e.y,e.z),tr(t.$,t.$,e.x,e.y,e.z),tr(0,t.$,e.x,e.y,e.z)],i=[];for(let e of r)i.push(t.aR([],e,l));if(l!==o)for(let e of r)i.push(t.aR([],e,o));0===e.y&&i.push([0,1,0]),e.y===(1<<e.z)-1&&i.push([0,-1,0]);let n=[1,1,1],a=[-1,-1,-1];for(let e of i)for(let t=0;t<3;t++)n[t]=Math.min(n[t],e[t]),a[t]=Math.max(a[t],e[t]);let s=tr(t.$/2,t.$/2,e.x,e.y,e.z),h=t.aW([],[0,1,0],s);t.aV(h,h);let A=t.aW([],s,h);t.aV(A,A);let u=t.aW([],r[2],r[1]);t.aV(u,u);let c=t.aW([],r[0],r[3]);t.aV(c,c),i.push(t.aR([],s,l)),e.y>=(1<<e.z)/2&&i.push(t.aR([],tr(t.$/2,0,e.x,e.y,e.z),l)),e.y<(1<<e.z)/2&&i.push(t.aR([],tr(t.$/2,t.$,e.x,e.y,e.z),l));let d=fr(s,i),p=fr(A,i),f=[-s[0],-s[1],-s[2],d.max],g=[s[0],s[1],s[2],-d.min],m=[-A[0],-A[1],-A[2],p.max],y=[A[0],A[1],A[2],-p.min],_=[...u,0],v=[...c,0],w=[];return 0===e.y?w.push(t.bt(v,_,f),t.bt(v,_,g)):w.push(t.bt(m,_,f),t.bt(m,_,g),t.bt(m,v,f),t.bt(m,v,g)),e.y===(1<<e.z)-1?w.push(t.bt(v,_,f),t.bt(v,_,g)):w.push(t.bt(y,_,f),t.bt(y,_,g),t.bt(y,v,f),t.bt(y,v,g)),new ur(w,[f,g,m,y,_,v],n,a)}}}function fr(e,r){let i=1/0,n=-1/0;for(let a of r){let r=t.aX(e,a);i=Math.min(i,r),n=Math.max(n,r)}return{min:i,max:n}}class gr{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,r){return this._helper.interpolatePadding(e,t,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t){this._helper.resize(e,t)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}setTransitionState(e){}constructor(){this._cachedClippingPlane=t.bv(),this._projectionMatrix=t.b9(),this._globeViewProjMatrix32f=t.b8(),this._globeViewProjMatrixNoCorrection=t.b9(),this._globeViewProjMatrixNoCorrectionInverted=t.b9(),this._globeProjMatrixInverted=t.b9(),this._cameraPosition=t.bp(),this._globeLatitudeErrorCorrectionRadians=0,this._helper=new Ft({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,t)=>this.getConstrained(e,t)}),this._coveringTilesDetailsProvider=new pr}clone(){let e=new gr;return e.apply(this),e}apply(e,t){this._globeLatitudeErrorCorrectionRadians=t||0,this._helper.apply(e)}get projectionMatrix(){return this._projectionMatrix}get modelViewProjectionMatrix(){return this._globeViewProjMatrixNoCorrection}get inverseProjectionMatrix(){return this._globeProjMatrixInverted}get cameraPosition(){let e=t.bp();return e[0]=this._cameraPosition[0],e[1]=this._cameraPosition[1],e[2]=this._cameraPosition[2],e}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}getProjectionData(e){let{overscaledTileID:t,applyGlobeMatrix:r}=e,i=this._helper.getMercatorTileCoordinates(t);return{mainMatrix:this._globeViewProjMatrix32f,tileMercatorCoords:i,clippingPlane:this._cachedClippingPlane,projectionTransition:r?1:0,fallbackMatrix:this._globeViewProjMatrix32f}}_computeClippingPlane(e){let r=this.pitchInRadians,i=this.cameraToCenterDistance/e,n=Math.sin(r)*i,a=Math.cos(r)*i+1,s=1/Math.sqrt(n*n+a*a)*1,o=-n,l=a,h=Math.sqrt(o*o+l*l);o/=h,l/=h;let A=[0,o,l];t.bw(A,A,[0,0,0],-this.bearingInRadians),t.bx(A,A,[0,0,0],-1*this.center.lat*Math.PI/180),t.by(A,A,[0,0,0],this.center.lng*Math.PI/180);let u=1/t.aZ(A);return t.aR(A,A,u),[...A,-s*u]}isLocationOccluded(e){return!this.isSurfacePointVisible(rr(e))}transformLightDirection(e){let r=this._helper._center.lng*Math.PI/180,i=this._helper._center.lat*Math.PI/180,n=Math.cos(i),a=[Math.sin(r)*n,Math.sin(i),Math.cos(r)*n],s=[a[2],0,-a[0]],o=[0,0,0];t.aW(o,s,a),t.aV(s,s),t.aV(o,o);let l=[0,0,0];return t.aV(l,[s[0]*e[0]+o[0]*e[1]+a[0]*e[2],s[1]*e[0]+o[1]*e[1]+a[1]*e[2],s[2]*e[0]+o[2]*e[1]+a[2]*e[2]]),l}getPixelScale(){return 1/Math.cos(this._helper._center.lat*Math.PI/180)}getCircleRadiusCorrection(){return Math.cos(this._helper._center.lat*Math.PI/180)}getPitchedTextCorrection(e,r,i){let n=function(e,r,i){let n=1/(1<<i.z);return new t.a1(e/t.$*n+i.x*n,r/t.$*n+i.y*n)}(e,r,i.canonical),a=(s=n.y,[t.bo(n.x*Math.PI*2+Math.PI,2*Math.PI),2*Math.atan(Math.exp(Math.PI-s*Math.PI*2))-.5*Math.PI]);var s;return this.getCircleRadiusCorrection()/Math.cos(a[1])}projectTileCoordinates(e,r,i,n){let a=i.canonical,s=tr(e,r,a.x,a.y,a.z),o=1+(n?n(e,r):0)/t.bu,l=[s[0]*o,s[1]*o,s[2]*o,1];t.aw(l,l,this._globeViewProjMatrixNoCorrection);let h=this._cachedClippingPlane,A=h[0]*s[0]+h[1]*s[1]+h[2]*s[2]+h[3]<0;return{point:new t.P(l[0]/l[3],l[1]/l[3]),signedDistanceFromCamera:l[3],isOccluded:A}}_calcMatrices(){if(!this._helper._width||!this._helper._height)return;let e=ir(this.worldSize,this.center.lat),r=t.ba(),i=t.ba();this._helper.autoCalculateNearFarZ&&(this._helper._nearZ=.5,this._helper._farZ=this.cameraToCenterDistance+2*e),t.b4(r,this.fovInRadians,this.width/this.height,this._helper._nearZ,this._helper._farZ);let n=this.centerOffset;r[8]=2*-n.x/this._helper._width,r[9]=2*n.y/this._helper._height,this._projectionMatrix=t.b5(r),this._globeProjMatrixInverted=t.ba(),t.aq(this._globeProjMatrixInverted,r),t.M(r,r,[0,0,-this.cameraToCenterDistance]),t.b6(r,r,this.rollInRadians),t.b7(r,r,-this.pitchInRadians),t.b6(r,r,this.bearingInRadians),t.M(r,r,[0,0,-e]);let a=t.bp();a[0]=e,a[1]=e,a[2]=e,t.b7(i,r,this.center.lat*Math.PI/180),t.bz(i,i,-this.center.lng*Math.PI/180),t.N(i,i,a),this._globeViewProjMatrixNoCorrection=i,t.b7(r,r,this.center.lat*Math.PI/180-this._globeLatitudeErrorCorrectionRadians),t.bz(r,r,-this.center.lng*Math.PI/180),t.N(r,r,a),this._globeViewProjMatrix32f=new Float32Array(r),this._globeViewProjMatrixNoCorrectionInverted=t.ba(),t.aq(this._globeViewProjMatrixNoCorrectionInverted,i);let s=t.bp();this._cameraPosition=t.bp(),this._cameraPosition[2]=this.cameraToCenterDistance/e,t.bw(this._cameraPosition,this._cameraPosition,s,-this.rollInRadians),t.bx(this._cameraPosition,this._cameraPosition,s,this.pitchInRadians),t.bw(this._cameraPosition,this._cameraPosition,s,-this.bearingInRadians),t.aS(this._cameraPosition,this._cameraPosition,[0,0,1]),t.bx(this._cameraPosition,this._cameraPosition,s,-this.center.lat*Math.PI/180),t.by(this._cameraPosition,this._cameraPosition,s,this.center.lng*Math.PI/180),this._cachedClippingPlane=this._computeClippingPlane(e);let o=t.b5(this._globeViewProjMatrixNoCorrectionInverted);t.N(o,o,[1,1,-1]),this._cachedFrustum=Mt.fromInvProjectionMatrix(o,1,0,this._cachedClippingPlane,!0)}calculateFogMatrix(e){t.w("calculateFogMatrix is not supported on globe projection.");let r=t.ba();return t.ag(r),r}getVisibleUnwrappedCoordinates(e){return[new t.b2(0,e)]}getCameraFrustum(){return this._cachedFrustum}getClippingPlane(){return this._cachedClippingPlane}getCoveringTilesDetailsProvider(){return this._coveringTilesDetailsProvider}recalculateZoomAndCenter(e){e&&t.w("terrain is not fully supported on vertical perspective projection."),this._helper.recalculateZoomAndCenter(0)}maxPitchScaleFactor(){return 1}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,r){if(!this._globeViewProjMatrixNoCorrection)return 1;let i=rr(e);t.aR(i,i,1+r/t.bu);let n=t.bv();return t.aw(n,[i[0],i[1],i[2],1],this._globeViewProjMatrixNoCorrection),n[2]/n[3]}populateCache(e){}getBounds(){let e=.5*this.width,r=.5*this.height,i=[new t.P(0,0),new t.P(e,0),new t.P(this.width,0),new t.P(this.width,r),new t.P(this.width,this.height),new t.P(e,this.height),new t.P(0,this.height),new t.P(0,r)],n=[];for(let e of i)n.push(this.unprojectScreenPoint(e));let a=0,s=0,o=0,l=0,h=this.center;for(let e of n){let r=t.bA(h.lng,e.lng),i=t.bA(h.lat,e.lat);r<s&&(s=r),r>a&&(a=r),i<l&&(l=i),i>o&&(o=i)}let A=[h.lng+s,h.lat+l,h.lng+a,h.lat+o];return this.isSurfacePointOnScreen([0,1,0])&&(A[3]=90,A[0]=-180,A[2]=180),this.isSurfacePointOnScreen([0,-1,0])&&(A[1]=-90,A[0]=-180,A[2]=180),new j(A)}getConstrained(e,r){let i=t.ah(e.lat,-t.ai,t.ai),n=t.ah(+r,this.minZoom+sr(0,i),this.maxZoom);return{center:new t.S(e.lng,i),zoom:n}}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}setLocationAtPoint(e,r){let i=rr(this.unprojectScreenPoint(r)),n=rr(e),a=t.bp();t.bB(a);let s=t.bp();t.by(s,i,a,-this.center.lng*Math.PI/180),t.bx(s,s,a,this.center.lat*Math.PI/180);let o=n[0]*n[0]+n[2]*n[2],l=s[0]*s[0];if(o<l)return;let h=Math.sqrt(o-l),A=-h,u=t.bC(n[0],n[2],s[0],h),c=t.bC(n[0],n[2],s[0],A),d=t.bp();t.by(d,n,a,-u);let p=t.bC(d[1],d[2],s[1],s[2]),f=t.bp();t.by(f,n,a,-c);let g,m,y=t.bC(f[1],f[2],s[1],s[2]),_=.5*Math.PI,v=p>=-_&&p<=_,w=y>=-_&&y<=_;if(v&&w){let e=this.center.lng*Math.PI/180,r=this.center.lat*Math.PI/180;t.bD(u,e)+t.bD(p,r)<t.bD(c,e)+t.bD(y,r)?(g=u,m=p):(g=c,m=y)}else if(v)g=u,m=p;else{if(!w)return;g=c,m=y}let b=g/Math.PI*180,x=m/Math.PI*180,B=this.center.lat;this.setCenter(new t.S(b,t.ah(x,-90,90))),this.setZoom(this.zoom+sr(B,this.center.lat))}locationToScreenPoint(e,r){let i=rr(e);if(r){let n=r.getElevationForLngLatZoom(e,this._helper._tileZoom);t.aR(i,i,1+n/t.bu)}return this._projectSurfacePointToScreen(i)}_projectSurfacePointToScreen(e){let r=t.bv();return t.aw(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],new t.P((.5*r[0]+.5)*this.width,(.5*-r[1]+.5)*this.height)}screenPointToMercatorCoordinate(e,r){if(r){let t=r.pointCoordinate(e);if(t)return t}return t.a1.fromLngLat(this.unprojectScreenPoint(e))}screenPointToLocation(e,t){var r;return null===(r=this.screenPointToMercatorCoordinate(e,t))||void 0===r?void 0:r.toLngLat()}isPointOnMapSurface(e,t){let r=this._cameraPosition,i=this.getRayDirectionFromPixel(e);return!!this.rayPlanetIntersection(r,i)}getRayDirectionFromPixel(e){let r=t.bv();r[0]=e.x/this.width*2-1,r[1]=-1*(e.y/this.height*2-1),r[2]=1,r[3]=1,t.aw(r,r,this._globeViewProjMatrixNoCorrectionInverted),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3];let i=t.bp();i[0]=r[0]-this._cameraPosition[0],i[1]=r[1]-this._cameraPosition[1],i[2]=r[2]-this._cameraPosition[2];let n=t.bp();return t.aV(n,i),n}isSurfacePointVisible(e){let t=this._cachedClippingPlane;return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]>=0}isSurfacePointOnScreen(e){if(!this.isSurfacePointVisible(e))return!1;let r=t.bv();return t.aw(r,[...e,1],this._globeViewProjMatrixNoCorrection),r[0]/=r[3],r[1]/=r[3],r[2]/=r[3],r[0]>-1&&r[0]<1&&r[1]>-1&&r[1]<1&&r[2]>-1&&r[2]<1}rayPlanetIntersection(e,r){let i=t.aX(e,r),n=t.bp(),a=t.bp();t.aR(a,r,i),t.aU(n,e,a);let s=1-t.aX(n,n);if(s<0)return null;let o=t.aX(e,e)-1,l=-i+(i<0?1:-1)*Math.sqrt(s),h=o/l,A=l;return{tMin:Math.min(h,A),tMax:Math.max(h,A)}}unprojectScreenPoint(e){let r=this._cameraPosition,i=this.getRayDirectionFromPixel(e),n=this.rayPlanetIntersection(r,i);if(n){let e=t.bp();t.aS(e,r,[i[0]*n.tMin,i[1]*n.tMin,i[2]*n.tMin]);let a=t.bp();return t.aV(a,e),nr(a)}let a=this._cachedClippingPlane,s=a[0]*i[0]+a[1]*i[1]+a[2]*i[2],o=-t.b1(a,r)/s,l=t.bp();if(o>0)t.aS(l,r,[i[0]*o,i[1]*o,i[2]*o]);else{let e=t.bp();t.aS(e,r,[2*i[0],2*i[1],2*i[2]]);let n=t.b1(this._cachedClippingPlane,e);t.aU(l,e,[this._cachedClippingPlane[0]*n,this._cachedClippingPlane[1]*n,this._cachedClippingPlane[2]*n])}let h=function(e){let r=t.bp();return r[0]=e[0]*-e[3],r[1]=e[1]*-e[3],r[2]=e[2]*-e[3],{center:r,radius:Math.sqrt(1-e[3]*e[3])}}(a);return nr(function(e,r,i){let n=t.bp();t.aU(n,i,e);let a=t.bp();return t.bq(a,e,n,r/t.a$(n)),a}(h.center,h.radius,l))}getMatrixForModel(e,r){let i=t.S.convert(e),n=1/t.bu,a=t.b9();return t.bz(a,a,i.lng/180*Math.PI),t.b7(a,a,-i.lat/180*Math.PI),t.M(a,a,[0,0,1+r/t.bu]),t.b7(a,a,.5*Math.PI),t.N(a,a,[n,n,n]),a}getProjectionDataForCustomLayer(e=!0){let r=this.getProjectionData({overscaledTileID:new t.Z(0,0,0,0,0),applyGlobeMatrix:e});return r.tileMercatorCoords=[0,0,1,1],r}getFastPathSimpleProjectionMatrix(e){}}class mr{get pixelsToClipSpaceMatrix(){return this._helper.pixelsToClipSpaceMatrix}get clipSpaceToPixelsMatrix(){return this._helper.clipSpaceToPixelsMatrix}get pixelsToGLUnits(){return this._helper.pixelsToGLUnits}get centerOffset(){return this._helper.centerOffset}get size(){return this._helper.size}get rotationMatrix(){return this._helper.rotationMatrix}get centerPoint(){return this._helper.centerPoint}get pixelsPerMeter(){return this._helper.pixelsPerMeter}setMinZoom(e){this._helper.setMinZoom(e)}setMaxZoom(e){this._helper.setMaxZoom(e)}setMinPitch(e){this._helper.setMinPitch(e)}setMaxPitch(e){this._helper.setMaxPitch(e)}setRenderWorldCopies(e){this._helper.setRenderWorldCopies(e)}setBearing(e){this._helper.setBearing(e)}setPitch(e){this._helper.setPitch(e)}setRoll(e){this._helper.setRoll(e)}setFov(e){this._helper.setFov(e)}setZoom(e){this._helper.setZoom(e)}setCenter(e){this._helper.setCenter(e)}setElevation(e){this._helper.setElevation(e)}setMinElevationForCurrentTile(e){this._helper.setMinElevationForCurrentTile(e)}setPadding(e){this._helper.setPadding(e)}interpolatePadding(e,t,r){return this._helper.interpolatePadding(e,t,r)}isPaddingEqual(e){return this._helper.isPaddingEqual(e)}resize(e,t,r=!0){this._helper.resize(e,t,r)}getMaxBounds(){return this._helper.getMaxBounds()}setMaxBounds(e){this._helper.setMaxBounds(e)}overrideNearFarZ(e,t){this._helper.overrideNearFarZ(e,t)}clearNearFarZOverride(){this._helper.clearNearFarZOverride()}getCameraQueryGeometry(e){return this._helper.getCameraQueryGeometry(this.getCameraPoint(),e)}get tileSize(){return this._helper.tileSize}get tileZoom(){return this._helper.tileZoom}get scale(){return this._helper.scale}get worldSize(){return this._helper.worldSize}get width(){return this._helper.width}get height(){return this._helper.height}get lngRange(){return this._helper.lngRange}get latRange(){return this._helper.latRange}get minZoom(){return this._helper.minZoom}get maxZoom(){return this._helper.maxZoom}get zoom(){return this._helper.zoom}get center(){return this._helper.center}get minPitch(){return this._helper.minPitch}get maxPitch(){return this._helper.maxPitch}get pitch(){return this._helper.pitch}get pitchInRadians(){return this._helper.pitchInRadians}get roll(){return this._helper.roll}get rollInRadians(){return this._helper.rollInRadians}get bearing(){return this._helper.bearing}get bearingInRadians(){return this._helper.bearingInRadians}get fov(){return this._helper.fov}get fovInRadians(){return this._helper.fovInRadians}get elevation(){return this._helper.elevation}get minElevationForCurrentTile(){return this._helper.minElevationForCurrentTile}get padding(){return this._helper.padding}get unmodified(){return this._helper.unmodified}get renderWorldCopies(){return this._helper.renderWorldCopies}get cameraToCenterDistance(){return this._helper.cameraToCenterDistance}get nearZ(){return this._helper.nearZ}get farZ(){return this._helper.farZ}get autoCalculateNearFarZ(){return this._helper.autoCalculateNearFarZ}get isGlobeRendering(){return this._globeness>0}setTransitionState(e,t){this._globeness=e,this._globeLatitudeErrorCorrectionRadians=t,this._calcMatrices(),this._verticalPerspectiveTransform.getCoveringTilesDetailsProvider().prepareNextFrame(),this._mercatorTransform.getCoveringTilesDetailsProvider().prepareNextFrame()}get currentTransform(){return this.isGlobeRendering?this._verticalPerspectiveTransform:this._mercatorTransform}constructor(){this._globeLatitudeErrorCorrectionRadians=0,this._globeness=1,this._helper=new Ft({calcMatrices:()=>{this._calcMatrices()},getConstrained:(e,t)=>this.getConstrained(e,t)}),this._globeness=1,this._mercatorTransform=new kt,this._verticalPerspectiveTransform=new gr}clone(){let e=new mr;return e._globeness=this._globeness,e._globeLatitudeErrorCorrectionRadians=this._globeLatitudeErrorCorrectionRadians,e.apply(this),e}apply(e){this._helper.apply(e),this._mercatorTransform.apply(this),this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians)}get projectionMatrix(){return this.currentTransform.projectionMatrix}get modelViewProjectionMatrix(){return this.currentTransform.modelViewProjectionMatrix}get inverseProjectionMatrix(){return this.currentTransform.inverseProjectionMatrix}get cameraPosition(){return this.currentTransform.cameraPosition}getProjectionData(e){let t=this._mercatorTransform.getProjectionData(e),r=this._verticalPerspectiveTransform.getProjectionData(e);return{mainMatrix:this.isGlobeRendering?r.mainMatrix:t.mainMatrix,clippingPlane:r.clippingPlane,tileMercatorCoords:r.tileMercatorCoords,projectionTransition:e.applyGlobeMatrix?this._globeness:0,fallbackMatrix:t.fallbackMatrix}}isLocationOccluded(e){return this.currentTransform.isLocationOccluded(e)}transformLightDirection(e){return this.currentTransform.transformLightDirection(e)}getPixelScale(){return t.bk(this._mercatorTransform.getPixelScale(),this._verticalPerspectiveTransform.getPixelScale(),this._globeness)}getCircleRadiusCorrection(){return t.bk(this._mercatorTransform.getCircleRadiusCorrection(),this._verticalPerspectiveTransform.getCircleRadiusCorrection(),this._globeness)}getPitchedTextCorrection(e,r,i){let n=this._mercatorTransform.getPitchedTextCorrection(e,r,i),a=this._verticalPerspectiveTransform.getPitchedTextCorrection(e,r,i);return t.bk(n,a,this._globeness)}projectTileCoordinates(e,t,r,i){return this.currentTransform.projectTileCoordinates(e,t,r,i)}_calcMatrices(){this._helper._width&&this._helper._height&&(this._verticalPerspectiveTransform.apply(this,this._globeLatitudeErrorCorrectionRadians),this._helper._nearZ=this._verticalPerspectiveTransform.nearZ,this._helper._farZ=this._verticalPerspectiveTransform.farZ,this._mercatorTransform.apply(this,!0,this.isGlobeRendering),this._helper._nearZ=this._mercatorTransform.nearZ,this._helper._farZ=this._mercatorTransform.farZ)}calculateFogMatrix(e){return this.currentTransform.calculateFogMatrix(e)}getVisibleUnwrappedCoordinates(e){return this.currentTransform.getVisibleUnwrappedCoordinates(e)}getCameraFrustum(){return this.currentTransform.getCameraFrustum()}getClippingPlane(){return this.currentTransform.getClippingPlane()}getCoveringTilesDetailsProvider(){return this.currentTransform.getCoveringTilesDetailsProvider()}recalculateZoomAndCenter(e){this._mercatorTransform.recalculateZoomAndCenter(e),this._verticalPerspectiveTransform.recalculateZoomAndCenter(e)}maxPitchScaleFactor(){return this._mercatorTransform.maxPitchScaleFactor()}getCameraPoint(){return this._helper.getCameraPoint()}getCameraAltitude(){return this._helper.getCameraAltitude()}getCameraLngLat(){return this._helper.getCameraLngLat()}lngLatToCameraDepth(e,t){return this.currentTransform.lngLatToCameraDepth(e,t)}populateCache(e){this._mercatorTransform.populateCache(e),this._verticalPerspectiveTransform.populateCache(e)}getBounds(){return this.currentTransform.getBounds()}getConstrained(e,t){return this.currentTransform.getConstrained(e,t)}calculateCenterFromCameraLngLatAlt(e,t,r,i){return this._helper.calculateCenterFromCameraLngLatAlt(e,t,r,i)}setLocationAtPoint(e,t){if(!this.isGlobeRendering)return this._mercatorTransform.setLocationAtPoint(e,t),void this.apply(this._mercatorTransform);this._verticalPerspectiveTransform.setLocationAtPoint(e,t),this.apply(this._verticalPerspectiveTransform)}locationToScreenPoint(e,t){return this.currentTransform.locationToScreenPoint(e,t)}screenPointToMercatorCoordinate(e,t){return this.currentTransform.screenPointToMercatorCoordinate(e,t)}screenPointToLocation(e,t){return this.currentTransform.screenPointToLocation(e,t)}isPointOnMapSurface(e,t){return this.currentTransform.isPointOnMapSurface(e,t)}getRayDirectionFromPixel(e){return this._verticalPerspectiveTransform.getRayDirectionFromPixel(e)}getMatrixForModel(e,t){return this.currentTransform.getMatrixForModel(e,t)}getProjectionDataForCustomLayer(e=!0){let t=this._mercatorTransform.getProjectionDataForCustomLayer(e);if(!this.isGlobeRendering)return t;let r=this._verticalPerspectiveTransform.getProjectionDataForCustomLayer(e);return r.fallbackMatrix=t.mainMatrix,r}getFastPathSimpleProjectionMatrix(e){return this.currentTransform.getFastPathSimpleProjectionMatrix(e)}}class yr{get useGlobeControls(){return!0}handlePanInertia(e,r){let i=or(e,r);return Math.abs(i.lng-r.center.lng)>180&&(i.lng=r.center.lng+179.5*Math.sign(i.lng-r.center.lng)),{easingCenter:i,easingOffset:new t.P(0,0)}}handleMapControlsRollPitchBearingZoom(e,r){let i=e.around,n=r.screenPointToLocation(i);e.bearingDelta&&r.setBearing(r.bearing+e.bearingDelta),e.pitchDelta&&r.setPitch(r.pitch+e.pitchDelta),e.rollDelta&&r.setRoll(r.roll+e.rollDelta);let a=r.zoom;e.zoomDelta&&r.setZoom(r.zoom+e.zoomDelta);let s=r.zoom-a;if(0===s)return;let o=t.bA(r.center.lng,n.lng),l=o/(Math.abs(o/180)+1),h=t.bA(r.center.lat,n.lat),A=r.getRayDirectionFromPixel(i),u=r.cameraPosition,c=-1*t.aX(u,A),d=t.bp();t.aS(d,u,[A[0]*c,A[1]*c,A[2]*c]);let p=t.aZ(d)-1,f=Math.exp(.5*-Math.max(p-.3,0)),g=ir(r.worldSize,r.center.lat)/Math.min(r.width,r.height),m=t.bn(g,.9,.5,1,.25),y=(1-t.af(-s))*Math.min(f,m),_=r.center.lat,v=r.zoom,w=new t.S(r.center.lng+l*y,t.ah(r.center.lat+h*y,-t.ai,t.ai));r.setLocationAtPoint(n,i);let b=r.center,x=t.bn(Math.abs(o),45,85,0,1),B=t.bn(g,.75,.35,0,1),C=Math.pow(Math.max(x,B),.25),S=t.bA(b.lng,w.lng),E=t.bA(b.lat,w.lat);r.setCenter(new t.S(b.lng+S*C,b.lat+E*C).wrap()),r.setZoom(v+sr(_,r.center.lat))}handleMapControlsPan(e,t,r){if(!e.panDelta)return;let i=t.center.lat,n=t.zoom;t.setCenter(or(e.panDelta,t).wrap()),t.setZoom(n+sr(i,t.center.lat))}cameraForBoxAndBearing(e,r,i,n,a){let s=Dt(e,r,i,n,a),o=r.left/a.width*2-1,l=(a.width-r.right)/a.width*2-1,h=r.top/a.height*-2+1,A=(a.height-r.bottom)/a.height*-2+1,u=t.bA(i.getWest(),i.getEast())<0,c=u?i.getEast():i.getWest(),d=u?i.getWest():i.getEast(),p=Math.max(i.getNorth(),i.getSouth()),f=Math.min(i.getNorth(),i.getSouth()),g=c+.5*t.bA(c,d),m=p+.5*t.bA(p,f),y=a.clone();y.setCenter(s.center),y.setBearing(s.bearing),y.setPitch(0),y.setRoll(0),y.setZoom(s.zoom);let _=y.modelViewProjectionMatrix,v=[rr(i.getNorthWest()),rr(i.getNorthEast()),rr(i.getSouthWest()),rr(i.getSouthEast()),rr(new t.S(d,m)),rr(new t.S(c,m)),rr(new t.S(g,p)),rr(new t.S(g,f))],w=rr(s.center),b=Number.POSITIVE_INFINITY;for(let e of v)o<0&&(b=yr.getLesserNonNegativeNonNull(b,yr.solveVectorScale(e,w,_,"x",o))),l>0&&(b=yr.getLesserNonNegativeNonNull(b,yr.solveVectorScale(e,w,_,"x",l))),h>0&&(b=yr.getLesserNonNegativeNonNull(b,yr.solveVectorScale(e,w,_,"y",h))),A<0&&(b=yr.getLesserNonNegativeNonNull(b,yr.solveVectorScale(e,w,_,"y",A)));if(Number.isFinite(b)&&0!==b)return s.zoom=y.zoom+t.ak(b),s;Ut()}handleJumpToCenterZoom(e,r){let i=e.center.lat,n=e.getConstrained(r.center?t.S.convert(r.center):e.center,e.zoom).center;e.setCenter(n.wrap());let a=void 0!==r.zoom?+r.zoom:e.zoom+sr(i,n.lat);e.zoom!==a&&e.setZoom(a)}handleEaseTo(e,r){let i=e.zoom,n=e.center,a=e.padding,s={roll:e.roll,pitch:e.pitch,bearing:e.bearing},o={roll:void 0===r.roll?e.roll:r.roll,pitch:void 0===r.pitch?e.pitch:r.pitch,bearing:void 0===r.bearing?e.bearing:r.bearing},l=void 0!==r.zoom,h=!e.isPaddingEqual(r.padding),A=!1,u=r.center?t.S.convert(r.center):n,c=e.getConstrained(u,i).center;It(e,c);let d=e.clone();d.setCenter(c),d.setZoom(l?+r.zoom:i+sr(n.lat,u.lat)),d.setBearing(r.bearing);let p=new t.P(t.ah(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),t.ah(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));d.setLocationAtPoint(c,p);let f=(r.offset&&r.offsetAsPoint.mag())>0?d.center:c,g=l?+r.zoom:i+sr(n.lat,f.lat),m=i+sr(n.lat,0),y=g+sr(f.lat,0),_=t.bA(n.lng,f.lng),v=t.bA(n.lat,f.lat),w=t.af(y-m);return A=g!==i,{easeFunc:i=>{if(t.be(s,o)||Rt({startEulerAngles:s,endEulerAngles:o,tr:e,k:i,useSlerp:s.roll!=o.roll}),h&&e.interpolatePadding(a,r.padding,i),r.around)t.w("Easing around a point is not supported under globe projection."),e.setLocationAtPoint(r.around,r.aroundPoint);else{let t=y>m?Math.min(2,w):Math.max(.5,w),r=Math.pow(t,1-i),a=hr(n,_,v,i*r);e.setCenter(a.wrap())}if(A){let r=t.C.number(m,y,i)+sr(0,e.center.lat);e.setZoom(r)}},isZooming:A,elevationCenter:f}}handleFlyTo(e,r){let i=void 0!==r.zoom,n=e.center,a=e.zoom,s=e.padding,o=!e.isPaddingEqual(r.padding),l=e.getConstrained(t.S.convert(r.center||r.locationAtOffset),a).center,h=i?+r.zoom:e.zoom+sr(e.center.lat,l.lat),A=e.clone();A.setCenter(l),A.setZoom(h),A.setBearing(r.bearing);let u=new t.P(t.ah(e.centerPoint.x+r.offsetAsPoint.x,0,e.width),t.ah(e.centerPoint.y+r.offsetAsPoint.y,0,e.height));A.setLocationAtPoint(l,u);let c=A.center;It(e,c);let d,p=function(e,r,i){let n=rr(r),a=rr(i),s=t.aX(n,a),o=Math.acos(s),l=er(e);return o/(2*Math.PI)*l}(e,n,c),f=a+sr(n.lat,0),g=h+sr(c.lat,0),m=t.af(g-f);if("number"==typeof r.minZoom){let i=+r.minZoom+sr(c.lat,0),n=Math.min(i,f,g)+sr(0,c.lat),a=e.getConstrained(c,n).zoom+sr(c.lat,0);d=t.af(a-f)}let y=t.bA(n.lng,c.lng),_=t.bA(n.lat,c.lat);return{easeFunc:(i,a,l,A)=>{let u=hr(n,y,_,l);o&&e.interpolatePadding(s,r.padding,i);let d=1===i?c:u;e.setCenter(d.wrap());let p=f+t.ak(a);e.setZoom(1===i?h:p+sr(0,d.lat))},scaleOfZoom:m,targetCenter:c,scaleOfMinZoom:d,pixelPathLength:p}}static solveVectorScale(e,t,r,i,n){let a="x"===i?[r[0],r[4],r[8],r[12]]:[r[1],r[5],r[9],r[13]],s=[r[3],r[7],r[11],r[15]],o=e[0]*a[0]+e[1]*a[1]+e[2]*a[2],l=e[0]*s[0]+e[1]*s[1]+e[2]*s[2],h=t[0]*a[0]+t[1]*a[1]+t[2]*a[2],A=t[0]*s[0]+t[1]*s[1]+t[2]*s[2];return h+n*l===o+n*A||s[3]*(o-h)+a[3]*(A-l)+o*A==h*l?null:(h+a[3]-n*A-n*s[3])/(h-o-n*A+n*l)}static getLesserNonNegativeNonNull(e,t){return null!==t&&t>=0&&t<e?t:e}}class _r{constructor(e){this._globe=e,this._mercatorCameraHelper=new Nt,this._verticalPerspectiveCameraHelper=new yr}get useGlobeControls(){return this._globe.useGlobeRendering}get currentHelper(){return this.useGlobeControls?this._verticalPerspectiveCameraHelper:this._mercatorCameraHelper}handlePanInertia(e,t){return this.currentHelper.handlePanInertia(e,t)}handleMapControlsRollPitchBearingZoom(e,t){return this.currentHelper.handleMapControlsRollPitchBearingZoom(e,t)}handleMapControlsPan(e,t,r){this.currentHelper.handleMapControlsPan(e,t,r)}cameraForBoxAndBearing(e,t,r,i,n){return this.currentHelper.cameraForBoxAndBearing(e,t,r,i,n)}handleJumpToCenterZoom(e,t){this.currentHelper.handleJumpToCenterZoom(e,t)}handleEaseTo(e,t){return this.currentHelper.handleEaseTo(e,t)}handleFlyTo(e,t){return this.currentHelper.handleFlyTo(e,t)}}let vr=(e,r)=>t.y(e,r&&r.filter((e=>"source.canvas"!==e.identifier))),wr=t.bE();class br extends t.E{constructor(e,r={}){var i,n;super(),this._rtlPluginLoaded=()=>{for(let e in this.sourceCaches){let t=this.sourceCaches[e].getSource().type;"vector"!==t&&"geojson"!==t||this.sourceCaches[e].reload()}},this.map=e,this.dispatcher=new R(U(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",((e,t)=>this.getGlyphs(e,t))),this.dispatcher.registerMessageHandler("GI",((e,t)=>this.getImages(e,t))),this.dispatcher.registerMessageHandler("GDA",((e,t)=>this.getDashes(e,t))),this.imageManager=new _,this.imageManager.setEventedParent(this);let a=(null===(i=e._container)||void 0===i?void 0:i.lang)||typeof document<"u"&&(null===(n=document.documentElement)||void 0===n?void 0:n.lang)||void 0;this.glyphManager=new B(e._requestManager,r.localIdeographFontFamily,a),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new yt,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.bF,this._loaded=!1,this._availableImages=[],this._globalState={},this._resetUpdates(),this.dispatcher.broadcast("SR",t.bG()),ie().on(ee,this._rtlPluginLoaded),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;let t=this.sourceCaches[e.sourceId];if(!t)return;let r=t.getSource();if(r&&r.vectorLayerIds)for(let e in this._layers){let t=this._layers[e];t.source===r.id&&this._validateLayer(t)}}))}setGlobalStateProperty(e,r){var i,n,a;this._checkLoaded();let s=null===r?null!==(a=null===(n=null===(i=this.stylesheet.state)||void 0===i?void 0:i[e])||void 0===n?void 0:n.default)&&void 0!==a?a:null:r;if(t.bH(s,this._globalState[e]))return this;this._globalState[e]=s,this._applyGlobalStateChanges([e])}getGlobalState(){return this._globalState}setGlobalState(e){this._checkLoaded();let r=[];for(let i in e)!t.bH(this._globalState[i],e[i].default)&&(r.push(i),this._globalState[i]=e[i].default);this._applyGlobalStateChanges(r)}_applyGlobalStateChanges(e){if(0===e.length)return;let t=new Set,r={};for(let i of e){r[i]=this._globalState[i];for(let e in this._layers){let r=this._layers[e],n=r.getLayoutAffectingGlobalStateRefs(),a=r.getPaintAffectingGlobalStateRefs();if(n.has(i)&&t.add(r.source),a.has(i))for(let{name:e,value:t}of a.get(i))this._updatePaintProperty(r,e,t)}}this.dispatcher.broadcast("UGS",r);for(let e in this.sourceCaches)t.has(e)&&(this._reloadSource(e),this._changed=!0)}loadURL(e,r={},i){this.fire(new t.l("dataloading",{dataType:"style"})),r.validate="boolean"!=typeof r.validate||r.validate;let n=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;let a=this._loadStyleRequest;t.j(n,this._loadStyleRequest).then((e=>{this._loadStyleRequest=null,this._load(e.data,r,i)})).catch((e=>{this._loadStyleRequest=null,e&&!a.signal.aborted&&this.fire(new t.k(e))}))}loadJSON(e,r={},i){this.fire(new t.l("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,s.frameAsync(this._frameRequest).then((()=>{this._frameRequest=null,r.validate=!1!==r.validate,this._load(e,r,i)})).catch((()=>{}))}loadEmpty(){this.fire(new t.l("dataloading",{dataType:"style"})),this._load(wr,{validate:!1})}_load(e,r,i){var n,a;let s=r.transformStyle?r.transformStyle(i,e):e;if(!r.validate||!vr(this,t.z(s))){s=Object.assign({},s),this._loaded=!0,this.stylesheet=s;for(let e in s.sources)this.addSource(e,s.sources[e],{validate:!1});s.sprite?this._loadSprite(s.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(s.glyphs),this._createLayers(),this.light=new S(this.stylesheet.light),this._setProjectionInternal((null===(n=this.stylesheet.projection)||void 0===n?void 0:n.type)||"mercator"),this.sky=new I(this.stylesheet.sky),this.map.setTerrain(null!==(a=this.stylesheet.terrain)&&void 0!==a?a:null),this.fire(new t.l("data",{dataType:"style"})),this.fire(new t.l("style.load"))}}_createLayers(){var e;let r=t.bI(this.stylesheet.layers);this.setGlobalState(null!==(e=this.stylesheet.state)&&void 0!==e?e:null),this.dispatcher.broadcast("SL",r),this._order=r.map((e=>e.id)),this._layers={},this._serializedLayers=null;for(let e of r){let r=t.bJ(e,this._globalState);r.setEventedParent(this,{layer:{id:e.id}}),this._layers[e.id]=r}}_loadSprite(e,r=!1,i=void 0){let n;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(e,r,i,n){return t._(this,void 0,void 0,(function*(){let a=g(e),o=i>1?"@2x":"",l={},h={};for(let{id:e,url:i}of a){let a=r.transformRequest(m(i,o,".json"),"SpriteJSON");l[e]=t.j(a,n);let s=r.transformRequest(m(i,o,".png"),"SpriteImage");h[e]=p.getImage(s,n)}return yield Promise.all([...Object.values(l),...Object.values(h)]),function(e,r){return t._(this,void 0,void 0,(function*(){let t={};for(let i in e){t[i]={};let n=s.getImageCanvasContext((yield r[i]).data),a=(yield e[i]).data;for(let e in a){let{width:r,height:s,x:o,y:l,sdf:h,pixelRatio:A,stretchX:u,stretchY:c,content:d,textFitWidth:p,textFitHeight:f}=a[e];t[i][e]={data:null,pixelRatio:A,sdf:h,stretchX:u,stretchY:c,content:d,textFitWidth:p,textFitHeight:f,spriteData:{width:r,height:s,x:o,y:l,context:n}}}}return t}))}(l,h)}))}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then((e=>{if(this._spriteRequest=null,e)for(let t in e){this._spritesImagesIds[t]=[];let i=this._spritesImagesIds[t]?this._spritesImagesIds[t].filter((t=>!(t in e))):[];for(let e of i)this.imageManager.removeImage(e),this._changedImages[e]=!0;for(let i in e[t]){let n="default"===t?i:`${t}:${i}`;this._spritesImagesIds[t].push(n),n in this.imageManager.images?this.imageManager.updateImage(n,e[t][i],!1):this.imageManager.addImage(n,e[t][i]),r&&(this._changedImages[n]=!0)}}})).catch((e=>{this._spriteRequest=null,n=e,this.fire(new t.k(n))})).finally((()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),r&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.l("data",{dataType:"style"})),i&&i(n)}))}_unloadSprite(){for(let e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.l("data",{dataType:"style"}))}_validateLayer(e){let r=this.sourceCaches[e.source];if(!r)return;let i=e.sourceLayer;if(!i)return;let n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new t.k(new Error(`Source layer "${i}" does not exist on source "${n.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(let e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,r=!1){let i=this._serializedAllLayers();if(!e||0===e.length)return Object.values(r?t.bK(i):i);let n=[];for(let a of e)if(i[a]){let e=r?t.bK(i[a]):i[a];n.push(e)}return n}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};let t=Object.keys(this._layers);for(let r of t){let t=this._layers[r];"custom"!==t.type&&(e[r]=t.serialize())}return e}hasTransitions(){var e,t,r;if(null!==(e=this.light)&&void 0!==e&&e.hasTransition()||null!==(t=this.sky)&&void 0!==t&&t.hasTransition()||null!==(r=this.projection)&&void 0!==r&&r.hasTransition())return!0;for(let e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(let e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;let r=this._changed;if(r){let t=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(t.length||r.length)&&this._updateWorkerLayers(t,r);for(let e in this._updatedSources){let t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(let t in this._updatedPaintProps)this._layers[t].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}let i={};for(let e in this.sourceCaches){let t=this.sourceCaches[e];i[e]=t.used,t.used=!1}for(let t of this._order){let r=this._layers[t];r.recalculate(e,this._availableImages),!r.isHidden(e.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(let e in i){let r=this.sourceCaches[e];!!i[e]!=!!r.used&&r.fire(new t.l("data",{sourceDataType:"visibility",dataType:"source",sourceId:e}))}this.light.recalculate(e),this.sky.recalculate(e),this.projection.recalculate(e),this.z=e.zoom,r&&this.fire(new t.l("data",{dataType:"style"}))}_updateTilesForChangedImages(){let e=Object.keys(this._changedImages);if(e.length){for(let t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(let e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,r={}){var i;this._checkLoaded();let n=this.serialize();if(e=r.transformStyle?r.transformStyle(n,e):e,(null===(i=r.validate)||void 0===i||i)&&vr(this,t.z(e)))return!1;(e=t.bK(e)).layers=t.bI(e.layers);let a=t.bL(n,e),s=this._getOperationsToPerform(a);if(s.unimplemented.length>0)throw new Error(`Unimplemented: ${s.unimplemented.join(", ")}.`);if(0===s.operations.length)return!1;for(let e of s.operations)e();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){let t=[],r=[];for(let i of e)switch(i.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":case"setRoll":continue;case"addLayer":t.push((()=>this.addLayer.apply(this,i.args)));break;case"removeLayer":t.push((()=>this.removeLayer.apply(this,i.args)));break;case"setPaintProperty":t.push((()=>this.setPaintProperty.apply(this,i.args)));break;case"setLayoutProperty":t.push((()=>this.setLayoutProperty.apply(this,i.args)));break;case"setFilter":t.push((()=>this.setFilter.apply(this,i.args)));break;case"addSource":t.push((()=>this.addSource.apply(this,i.args)));break;case"removeSource":t.push((()=>this.removeSource.apply(this,i.args)));break;case"setLayerZoomRange":t.push((()=>this.setLayerZoomRange.apply(this,i.args)));break;case"setLight":t.push((()=>this.setLight.apply(this,i.args)));break;case"setGeoJSONSourceData":t.push((()=>this.setGeoJSONSourceData.apply(this,i.args)));break;case"setGlyphs":t.push((()=>this.setGlyphs.apply(this,i.args)));break;case"setSprite":t.push((()=>this.setSprite.apply(this,i.args)));break;case"setTerrain":t.push((()=>this.map.setTerrain.apply(this,i.args)));break;case"setSky":t.push((()=>this.setSky.apply(this,i.args)));break;case"setProjection":this.setProjection.apply(this,i.args);break;case"setGlobalState":t.push((()=>this.setGlobalState.apply(this,i.args)));break;case"setTransition":t.push((()=>{}));break;default:r.push(i.command)}return{operations:t,unimplemented:r}}addImage(e,r){if(this.getImage(e))return this.fire(new t.k(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,r),this._afterImageUpdated(e)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new t.k(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.l("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,r,i={}){if(this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error(`Source "${e}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(t.z.source,`sources.${e}`,r,null,i))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);let n=this.sourceCaches[e]=new ve(e,r,this.dispatcher);n.style=this,n.setEventedParent(this,(()=>({isSourceLoaded:n.loaded(),source:n.serialize(),sourceId:e}))),n.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(let r in this._layers)if(this._layers[r].source===e)return this.fire(new t.k(new Error(`Source "${e}" cannot be removed while layer "${r}" is using it.`)));let r=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],r.fire(new t.l("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);let r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,r,i={}){this._checkLoaded();let n,a=e.id;if(this.getLayer(a))return void this.fire(new t.k(new Error(`Layer "${a}" already exists on this map.`)));if("custom"===e.type){if(vr(this,t.bM(e)))return;n=t.bJ(e,this._globalState)}else{if("source"in e&&"object"==typeof e.source&&(this.addSource(a,e.source),e=t.bK(e),e=t.e(e,{source:a})),this._validate(t.z.layer,`layers.${a}`,e,{arrayIndex:-1},i))return;n=t.bJ(e,this._globalState),this._validateLayer(n),n.setEventedParent(this,{layer:{id:a}})}let s=r?this._order.indexOf(r):this._order.length;if(r&&-1===s)this.fire(new t.k(new Error(`Cannot add layer "${a}" before non-existing layer "${r}".`)));else{if(this._order.splice(s,0,a),this._layerOrderChanged=!0,this._layers[a]=n,this._removedLayers[a]&&n.source&&"custom"!==n.type){let e=this._removedLayers[a];delete this._removedLayers[a],e.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())}this._updateLayer(n),n.onAdd&&n.onAdd(this.map)}}moveLayer(e,r){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new t.k(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===r)return;let i=this._order.indexOf(e);this._order.splice(i,1);let n=r?this._order.indexOf(r):this._order.length;r&&-1===n?this.fire(new t.k(new Error(`Cannot move layer "${e}" before non-existing layer "${r}".`))):(this._order.splice(n,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();let r=this._layers[e];if(!r)return void this.fire(new t.k(new Error(`Cannot remove non-existing layer "${e}".`)));r.setEventedParent(null);let i=this._order.indexOf(e);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=r,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,r,i){this._checkLoaded();let n=this.getLayer(e);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new t.k(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,r,i={}){this._checkLoaded();let n=this.getLayer(e);if(n){if(!t.bH(n.filter,r))return null==r?(n.setFilter(void 0),void this._updateLayer(n)):void(this._validate(t.z.filter,`layers.${n.id}.filter`,r,null,i)||(n.setFilter(t.bK(r)),this._updateLayer(n)))}else this.fire(new t.k(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return t.bK(this.getLayer(e).filter)}setLayoutProperty(e,r,i,n={}){this._checkLoaded();let a=this.getLayer(e);a?t.bH(a.getLayoutProperty(r),i)||(a.setLayoutProperty(r,i,n),this._updateLayer(a)):this.fire(new t.k(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,r){let i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.k(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,r,i,n={}){this._checkLoaded();let a=this.getLayer(e);a?t.bH(a.getPaintProperty(r),i)||this._updatePaintProperty(a,r,i,n):this.fire(new t.k(new Error(`Cannot style non-existing layer "${e}".`)))}_updatePaintProperty(e,t,r,i={}){e.setPaintProperty(t,r,i)&&this._updateLayer(e),this._changed=!0,this._updatedPaintProps[e.id]=!0,this._serializedLayers=null}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(e,r){this._checkLoaded();let i=e.source,n=e.sourceLayer,a=this.sourceCaches[i];if(void 0===a)return void this.fire(new t.k(new Error(`The source '${i}' does not exist in the map's style.`)));let s=a.getSource().type;"geojson"===s&&n?this.fire(new t.k(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==s||n?(void 0===e.id&&this.fire(new t.k(new Error("The feature id parameter must be provided."))),a.setFeatureState(n,e.id,r)):this.fire(new t.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,r){this._checkLoaded();let i=e.source,n=this.sourceCaches[i];if(void 0===n)return void this.fire(new t.k(new Error(`The source '${i}' does not exist in the map's style.`)));let a=n.getSource().type,s="vector"===a?e.sourceLayer:void 0;"vector"!==a||s?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.k(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(s,e.id,r):this.fire(new t.k(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();let r=e.source,i=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n)return"vector"!==n.getSource().type||i?(void 0===e.id&&this.fire(new t.k(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,e.id)):void this.fire(new t.k(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new t.k(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return t.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;let e=t.bN(this.sourceCaches,(e=>e.serialize())),r=this._serializeByIds(this._order,!0),i=this.map.getTerrain()||void 0,n=this.stylesheet;return t.bO({version:n.version,name:n.name,metadata:n.metadata,light:n.light,sky:n.sky,center:n.center,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,sprite:n.sprite,glyphs:n.glyphs,transition:n.transition,projection:n.projection,sources:e,layers:r,terrain:i},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){let t=e=>"fill-extrusion"===this._layers[e].type,r={},i=[];for(let n=this._order.length-1;n>=0;n--){let a=this._order[n];if(t(a)){r[a]=n;for(let t of e){let e=t[a];if(e)for(let t of e)i.push(t)}}}i.sort(((e,t)=>t.intersectionZ-e.intersectionZ));let n=[];for(let a=this._order.length-1;a>=0;a--){let s=this._order[a];if(t(s))for(let e=i.length-1;e>=0;e--){let t=i[e].feature;if(r[t.layer.id]<a)break;n.push(t),i.pop()}else for(let t of e){let e=t[s];if(e)for(let t of e)n.push(t.feature)}}return n}queryRenderedFeatures(e,r,i){r&&r.filter&&this._validate(t.z.filter,"queryRenderedFeatures.filter",r.filter,null,r);let n={};if(r&&r.layers){if(!(Array.isArray(r.layers)||r.layers instanceof Set))return this.fire(new t.k(new Error("parameters.layers must be an Array or a Set of strings"))),[];for(let e of r.layers){let r=this._layers[e];if(!r)return this.fire(new t.k(new Error(`The layer '${e}' does not exist in the map's style and cannot be queried for features.`))),[];n[r.source]=!0}}let a=[];r.availableImages=this._availableImages;let s=this._serializedAllLayers(),o=r.layers instanceof Set?r.layers:Array.isArray(r.layers)?new Set(r.layers):null,l=Object.assign(Object.assign({},r),{layers:o,globalState:this._globalState});for(let t in this.sourceCaches)r.layers&&!n[t]||a.push(O(this.sourceCaches[t],this._layers,s,e,l,i,this.map.terrain?(e,t,r)=>this.map.terrain.getElevation(e,t,r):void 0));return this.placement&&a.push(function(e,t,r,i,n,a,s){let o={},l=a.queryRenderedSymbols(i),h=[];for(let e of Object.keys(l).map(Number))h.push(s[e]);h.sort(Q);for(let r of h){let i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,{filterSpec:n.filter,globalState:n.globalState},n.layers,n.availableImages,e);for(let e in i){let t=o[e]=o[e]||[],n=i[e];n.sort(((e,t)=>{let i=r.featureSortOrder;if(i){let r=i.indexOf(e.featureIndex);return i.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}));for(let e of n)t.push(e)}}return function(e,t,r){for(let i in e)for(let n of e[i])z(n,r[t[i].source]);return e}(o,e,r)}(this._layers,s,this.sourceCaches,e,l,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(a)}querySourceFeatures(e,r){r?.filter&&this._validate(t.z.filter,"querySourceFeatures.filter",r.filter,null,r);let i=this.sourceCaches[e];return i?function(e,t){let r=e.getRenderableIds().map((t=>e.getTileByID(t))),i=[],n={};for(let e=0;e<r.length;e++){let a=r[e],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,t))}return i}(i,r?Object.assign(Object.assign({},r),{globalState:this._globalState}):{globalState:this._globalState}):[]}getLight(){return this.light.getLight()}setLight(e,r={}){this._checkLoaded();let i=this.light.getLight(),n=!1;for(let r in e)if(!t.bH(e[r],i[r])){n=!0;break}if(!n)return;let a={now:s.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,r),this.light.updateTransitions(a)}getProjection(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.projection}setProjection(e){if(this._checkLoaded(),this.projection){if(this.projection.name===e.type)return;this.projection.destroy(),delete this.projection}this.stylesheet.projection=e,this._setProjectionInternal(e.type)}getSky(){var e;return null===(e=this.stylesheet)||void 0===e?void 0:e.sky}setSky(e,r={}){this._checkLoaded();let i=this.getSky(),n=!1;if(!e&&!i)return;if(e&&!i)n=!0;else if(!e&&i)n=!0;else for(let r in e)if(!t.bH(e[r],i[r])){n=!0;break}if(!n)return;let a={now:s.now(),transition:t.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,r),this.sky.updateTransitions(a)}_setProjectionInternal(e){let r=function(e){if(Array.isArray(e)){let t=new Jt({type:e});return{projection:t,transform:new mr,cameraHelper:new _r(t)}}switch(e){case"mercator":return{projection:new St,transform:new kt,cameraHelper:new Nt};case"globe":{let e=new Jt({type:["interpolate",["linear"],["zoom"],11,"vertical-perspective",12,"mercator"]});return{projection:e,transform:new mr,cameraHelper:new _r(e)}}case"vertical-perspective":return{projection:new Xt,transform:new gr,cameraHelper:new yr};default:return t.w(`Unknown projection name: ${e}. Falling back to mercator projection.`),{projection:new St,transform:new kt,cameraHelper:new Nt}}}(e);this.projection=r.projection,this.map.migrateProjection(r.transform,r.cameraHelper);for(let e in this.sourceCaches)this.sourceCaches[e].reload()}_validate(e,r,i,n,a={}){return(!a||!1!==a.validate)&&vr(this,e.call(t.z,t.e({key:r,style:this.serialize(),value:i,styleSpec:t.v},n)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),ie().off(ee,this._rtlPluginLoaded);for(let e in this._layers)this._layers[e].setEventedParent(null);for(let e in this.sourceCaches){let t=this.sourceCaches[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(let t in this.sourceCaches)this.sourceCaches[t].update(e,this.map.terrain)}_generateCollisionBoxes(){for(let e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,t,r,i,n=!1){let a=!1,o=!1,l={};for(let t of this._order){let r=this._layers[t];if("symbol"!==r.type)continue;if(!l[r.source]){let e=this.sourceCaches[r.source];l[r.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}let i=this.crossTileSymbolIndex.addLayer(r,l[r.source],e.center.lng);a=a||i}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((n=n||this._layerOrderChanged||0===r)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(s.now(),e.zoom))&&(this.pauseablePlacement=new dt(e,this.map.terrain,this._order,n,t,r,i,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(s.now()),o=!0),a&&this.pauseablePlacement.placement.setStale()),o||a)for(let e of this._order){let t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(s.now())}_releaseSymbolFadeTiles(){for(let e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,r){return t._(this,void 0,void 0,(function*(){let e=yield this.imageManager.getImages(r.icons);this._updateTilesForChangedImages();let t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,r.icons),e}))}getGlyphs(e,r){return t._(this,void 0,void 0,(function*(){let e=yield this.glyphManager.getGlyphs(r.stacks),t=this.sourceCaches[r.source];return t&&t.setDependencies(r.tileID.key,r.type,[""]),e}))}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,r={}){this._checkLoaded(),e&&this._validate(t.z.glyphs,"glyphs",e,null,r)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}getDashes(e,r){return t._(this,void 0,void 0,(function*(){let e={};for(let[t,i]of Object.entries(r.dashes))e[t]=this.lineAtlas.getDash(i.dasharray,i.round);return e}))}addSprite(e,r,i={},n){this._checkLoaded();let a=[{id:e,url:r}],s=[...g(this.stylesheet.sprite),...a];this._validate(t.z.sprite,"sprite",s,null,i)||(this.stylesheet.sprite=s,this._loadSprite(a,!0,n))}removeSprite(e){this._checkLoaded();let r=g(this.stylesheet.sprite);if(r.find((t=>t.id===e))){if(this._spritesImagesIds[e])for(let t of this._spritesImagesIds[e])this.imageManager.removeImage(t),this._changedImages[t]=!0;r.splice(r.findIndex((t=>t.id===e)),1),this.stylesheet.sprite=r.length>0?r:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new t.l("data",{dataType:"style"}))}else this.fire(new t.k(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return g(this.stylesheet.sprite)}setSprite(e,r={},i){this._checkLoaded(),e&&this._validate(t.z.sprite,"sprite",e,null,r)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,i):(this._unloadSprite(),i&&i(null)))}}var xr=t.aJ([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Br{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,i,n,a,s,o,l){this.context=e;let h=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!h&&e<i.length;e++)this.boundPaintVertexBuffers[e]!==i[e]&&(h=!0);!this.vao||this.boundProgram!==t||this.boundLayoutVertexBuffer!==r||h||this.boundIndexBuffer!==n||this.boundVertexOffset!==a||this.boundDynamicVertexBuffer!==s||this.boundDynamicVertexBuffer2!==o||this.boundDynamicVertexBuffer3!==l?this.freshBind(t,r,i,n,a,s,o,l):(e.bindVertexArray.set(this.vao),s&&s.bind(),n&&n.dynamicDraw&&n.bind(),o&&o.bind(),l&&l.bind())}freshBind(e,t,r,i,n,a,s,o){let l=e.numAttributes,h=this.context,A=h.gl;this.vao&&this.destroy(),this.vao=h.createVertexArray(),h.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=a,this.boundDynamicVertexBuffer2=s,this.boundDynamicVertexBuffer3=o,t.enableAttributes(A,e);for(let t of r)t.enableAttributes(A,e);a&&a.enableAttributes(A,e),s&&s.enableAttributes(A,e),o&&o.enableAttributes(A,e),t.bind(),t.setVertexAttribPointers(A,e,n);for(let t of r)t.bind(),t.setVertexAttribPointers(A,e,n);a&&(a.bind(),a.setVertexAttribPointers(A,e,n)),i&&i.bind(),s&&(s.bind(),s.setVertexAttribPointers(A,e,n)),o&&(o.bind(),o.setVertexAttribPointers(A,e,n)),h.currentNumAttributes=l}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}let Cr=(e,r,i,n,a)=>({u_texture:0,u_ele_delta:e,u_fog_matrix:r,u_fog_color:i?i.properties.get("fog-color"):t.bf.white,u_fog_ground_blend:i?i.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:a?0:i?i.calculateFogBlendOpacity(n):0,u_horizon_color:i?i.properties.get("horizon-color"):t.bf.white,u_horizon_fog_blend:i?i.properties.get("horizon-fog-blend"):1,u_is_globe_mode:a?1:0}),Sr={mainMatrix:"u_projection_matrix",tileMercatorCoords:"u_projection_tile_mercator_coords",clippingPlane:"u_projection_clipping_plane",projectionTransition:"u_projection_transition",fallbackMatrix:"u_projection_fallback_matrix"};function Er(e){let t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;let i=e[r].split(" ");t.push(i.pop())}return t}class Ir{constructor(e,r,i,n,a,s,o,l,h=[]){let A=e.gl;this.program=A.createProgram();let u=Er(r.staticAttributes),c=i?i.getBinderAttributes():[],d=u.concat(c),p=vt.prelude.staticUniforms?Er(vt.prelude.staticUniforms):[],f=o.staticUniforms?Er(o.staticUniforms):[],g=r.staticUniforms?Er(r.staticUniforms):[],m=i?i.getBinderUniforms():[],y=p.concat(f).concat(g).concat(m),_=[];for(let e of y)_.indexOf(e)<0&&_.push(e);let v=i?i.defines():[];Kt(A)&&v.unshift("#version 300 es"),a&&v.push("#define OVERDRAW_INSPECTOR;"),s&&v.push("#define TERRAIN3D;"),l&&v.push(l),h&&v.push(...h);let w=v.concat(vt.prelude.fragmentSource,o.fragmentSource,r.fragmentSource).join("\n"),b=v.concat(vt.prelude.vertexSource,o.vertexSource,r.vertexSource).join("\n");Kt(A)||(w=w.replace(/\bin\s/g,"varying ").replace("out highp vec4 fragColor;","").replace(/fragColor/g,"gl_FragColor").replace(/texture\(/g,"texture2D("),b=function(e){return e.replace(/\bin\s/g,"attribute ").replace(/\bout\s/g,"varying ").replace(/texture\(/g,"texture2D(")}(b));let x=A.createShader(A.FRAGMENT_SHADER);if(A.isContextLost())return void(this.failedToCreate=!0);if(A.shaderSource(x,w),A.compileShader(x),!A.getShaderParameter(x,A.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${A.getShaderInfoLog(x)}`);A.attachShader(this.program,x);let B=A.createShader(A.VERTEX_SHADER);if(A.isContextLost())return void(this.failedToCreate=!0);if(A.shaderSource(B,b),A.compileShader(B),!A.getShaderParameter(B,A.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${A.getShaderInfoLog(B)}`);A.attachShader(this.program,B),this.attributes={};let C={};this.numAttributes=d.length;for(let e=0;e<this.numAttributes;e++)d[e]&&(A.bindAttribLocation(this.program,e,d[e]),this.attributes[d[e]]=e);if(A.linkProgram(this.program),!A.getProgramParameter(this.program,A.LINK_STATUS))throw new Error(`Program failed to link: ${A.getProgramInfoLog(this.program)}`);A.deleteShader(B),A.deleteShader(x);for(let e=0;e<_.length;e++){let t=_[e];if(t&&!C[t]){let e=A.getUniformLocation(this.program,t);e&&(C[t]=e)}}this.fixedUniforms=n(e,C),this.terrainUniforms=((e,r)=>({u_depth:new t.bP(e,r.u_depth),u_terrain:new t.bP(e,r.u_terrain),u_terrain_dim:new t.bg(e,r.u_terrain_dim),u_terrain_matrix:new t.bR(e,r.u_terrain_matrix),u_terrain_unpack:new t.bS(e,r.u_terrain_unpack),u_terrain_exaggeration:new t.bg(e,r.u_terrain_exaggeration)}))(e,C),this.projectionUniforms=((e,r)=>({u_projection_matrix:new t.bR(e,r.u_projection_matrix),u_projection_tile_mercator_coords:new t.bS(e,r.u_projection_tile_mercator_coords),u_projection_clipping_plane:new t.bS(e,r.u_projection_clipping_plane),u_projection_transition:new t.bg(e,r.u_projection_transition),u_projection_fallback_matrix:new t.bR(e,r.u_projection_fallback_matrix)}))(e,C),this.binderUniforms=i?i.getUniforms(e,C):[]}draw(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y){let _=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(a),o){e.activeTexture.set(_.TEXTURE2),_.bindTexture(_.TEXTURE_2D,o.depthTexture),e.activeTexture.set(_.TEXTURE3),_.bindTexture(_.TEXTURE_2D,o.texture);for(let e in this.terrainUniforms)this.terrainUniforms[e].set(o[e])}if(l)for(let e in l)this.projectionUniforms[Sr[e]].set(l[e]);if(s)for(let e in this.fixedUniforms)this.fixedUniforms[e].set(s[e]);f&&f.setUniforms(e,this.binderUniforms,d,{zoom:p});let v=0;switch(t){case _.LINES:v=2;break;case _.TRIANGLES:v=3;break;case _.LINE_STRIP:v=1}for(let r of c.get()){let i=r.vaos||(r.vaos={});(i[h]||(i[h]=new Br)).bind(e,this,A,f?f.getPaintVertexBuffers():[],u,r.vertexOffset,g,m,y),_.drawElements(t,r.primitiveLength*v,_.UNSIGNED_SHORT,r.primitiveOffset*v*2)}}}function Tr(e,r,i){let n=1/t.aC(i,1,r.transform.tileZoom),a=Math.pow(2,i.tileID.overscaledZ),s=i.tileSize*Math.pow(2,r.transform.tileZoom)/a,o=s*(i.tileID.canonical.x+i.tileID.wrap*a),l=s*i.tileID.canonical.y;return{u_image:0,u_texsize:i.imageAtlasTexture.size,u_scale:[n,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[o>>16,l>>16],u_pixel_coord_lower:[65535&o,65535&l]}}let Fr=(e,r,i,n)=>{let a=e.style.light,s=a.properties.get("position"),o=[s.x,s.y,s.z],l=t.bV();"viewport"===a.properties.get("anchor")&&t.bW(l,e.transform.bearingInRadians),t.bX(o,o,l);let h=e.transform.transformLightDirection(o),A=a.properties.get("color");return{u_lightpos:o,u_lightpos_globe:h,u_lightintensity:a.properties.get("intensity"),u_lightcolor:[A.r,A.g,A.b],u_vertical_gradient:+r,u_opacity:i,u_fill_translate:n}},Pr=(e,r,i,n,a,s,o)=>t.e(Fr(e,r,i,n),Tr(s,e,o),{u_height_factor:-Math.pow(2,a.overscaledZ)/o.tileSize/8}),Lr=(e,r,i,n)=>t.e(Tr(r,e,i),{u_fill_translate:n}),Mr=(e,t)=>({u_world:e,u_fill_translate:t}),kr=(e,r,i,n,a)=>t.e(Lr(e,r,i,a),{u_world:n}),Ur=(e,r,i,n,a)=>{let s,o,l=e.transform,h=0;if("map"===i.paint.get("circle-pitch-alignment")){let e=t.aC(r,1,l.zoom);s=!0,o=[e,e],h=e/(t.$*Math.pow(2,r.tileID.overscaledZ))*2*Math.PI*a}else s=!1,o=l.pixelsToGLUnits;return{u_camera_to_center_distance:l.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_pitch_with_map:+s,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:o,u_globe_extrude_scale:h,u_translate:n}},Rr=e=>({u_pixel_extrude_scale:[1/e.width,1/e.height]}),Dr=e=>({u_viewport_size:[e.width,e.height]}),Nr=(e,t=1)=>({u_color:e,u_overlay:0,u_overlay_scale:t}),Or=(e,r,i,n)=>{let a=t.aC(e,1,r)/(t.$*Math.pow(2,e.tileID.overscaledZ))*2*Math.PI*n;return{u_extrude_scale:t.aC(e,1,r),u_intensity:i,u_globe_extrude_scale:a}},Qr=(e,r,i,n)=>{let a=t.L();t.bY(a,0,e.width,e.height,0,0,1);let s=e.context.gl;return{u_matrix:a,u_world:[s.drawingBufferWidth,s.drawingBufferHeight],u_image:i,u_color_ramp:n,u_opacity:r.paint.get("heatmap-opacity")}},zr=(e,t,r)=>{let i,n=r.paint.get("hillshade-accent-color");switch(r.paint.get("hillshade-method")){case"basic":i=4;break;case"combined":i=1;break;case"igor":i=2;break;case"multidirectional":i=3;break;default:i=0}let a=r.getIlluminationProperties();for(let t=0;t<a.directionRadians.length;t++)"viewport"===r.paint.get("hillshade-illumination-anchor")&&(a.directionRadians[t]+=e.transform.bearingInRadians);return{u_image:0,u_latrange:jr(0,t.tileID),u_exaggeration:r.paint.get("hillshade-exaggeration"),u_altitudes:a.altitudeRadians,u_azimuths:a.directionRadians,u_accent:n,u_method:i,u_highlights:a.highlightColor,u_shadows:a.shadowColor}},Hr=(e,r)=>{let i=r.stride,n=t.L();return t.bY(n,0,t.$,-t.$,0,0,1),t.M(n,n,[0,-t.$,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:e.overscaledZ,u_unpack:r.getUnpackVector()}};function jr(e,r){let i=Math.pow(2,r.canonical.z),n=r.canonical.y;return[new t.a1(0,n/i).toLngLat().lat,new t.a1(0,(n+1)/i).toLngLat().lat]}let Vr=(e,t,r=0)=>({u_image:0,u_unpack:t.getUnpackVector(),u_dimension:[t.stride,t.stride],u_elevation_stops:1,u_color_stops:4,u_color_ramp_size:r,u_opacity:e.paint.get("color-relief-opacity")}),Gr=(e,r,i,n)=>{let a=e.transform;return{u_translation:$r(e,r,i),u_ratio:n/t.aC(r,1,a.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/a.pixelsToGLUnits[0],1/a.pixelsToGLUnits[1]]}},Kr=(e,r,i,n,a)=>t.e(Gr(e,r,i,n),{u_image:0,u_image_height:a}),qr=(e,r,i,n,a)=>{let s=e.transform,o=Wr(r,s);return{u_translation:$r(e,r,i),u_texsize:r.imageAtlasTexture.size,u_ratio:n/t.aC(r,1,s.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[o,a.fromScale,a.toScale],u_fade:a.t,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},Zr=(e,r,i,n,a)=>{let s=Wr(r,e.transform);return t.e(Gr(e,r,i,n),{u_tileratio:s,u_crossfade_from:a.fromScale,u_crossfade_to:a.toScale,u_image:0,u_mix:a.t,u_lineatlas_width:e.lineAtlas.width,u_lineatlas_height:e.lineAtlas.height})};function Wr(e,r){return 1/t.aC(e,1,r.tileZoom)}function $r(e,r,i){return t.aD(e.transform,r,i.paint.get("line-translate"),i.paint.get("line-translate-anchor"))}let Xr=(e,t,r,i,n)=>{return{u_tl_parent:e,u_scale_parent:t,u_buffer_scale:1,u_fade_t:r.mix,u_opacity:r.opacity*i.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:i.paint.get("raster-brightness-min"),u_brightness_high:i.paint.get("raster-brightness-max"),u_saturation_factor:(s=i.paint.get("raster-saturation"),s>0?1-1/(1.001-s):-s),u_contrast_factor:(a=i.paint.get("raster-contrast"),a>0?1/(1-a):1+a),u_spin_weights:Yr(i.paint.get("raster-hue-rotate")),u_coords_top:[n[0].x,n[0].y,n[1].x,n[1].y],u_coords_bottom:[n[3].x,n[3].y,n[2].x,n[2].y]};var a,s};function Yr(e){e*=Math.PI/180;let t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}let Jr=(e,t,r,i,n,a,s,o,l,h,A,u,c)=>{let d=s.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:d.cameraToCenterDistance,u_pitch:d.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:d.width/d.height,u_fade_change:s.options.fadeDuration?s.symbolFadeChange:1,u_label_plane_matrix:o,u_coord_matrix:l,u_is_text:+A,u_pitch_with_map:+i,u_is_along_line:n,u_is_variable_anchor:a,u_texsize:u,u_texture:0,u_translation:h,u_pitched_scale:c}},ei=(e,r,i,n,a,s,o,l,h,A,u,c,d,p)=>{let f=o.transform;return t.e(Jr(e,r,i,n,a,s,o,l,h,A,u,c,p),{u_gamma_scale:n?Math.cos(f.pitch*Math.PI/180)*f.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:1})},ti=(e,r,i,n,a,s,o,l,h,A,u,c,d)=>t.e(ei(e,r,i,n,a,s,o,l,h,A,!0,u,0,d),{u_texsize_icon:c,u_texture_icon:1}),ri=(e,t)=>({u_opacity:e,u_color:t}),ii=(e,r,i,n,a)=>t.e(function(e,r,i,n){let a=i.imageManager.getPattern(e.from.toString()),s=i.imageManager.getPattern(e.to.toString()),{width:o,height:l}=i.imageManager.getPixelSize(),h=Math.pow(2,n.tileID.overscaledZ),A=n.tileSize*Math.pow(2,i.transform.tileZoom)/h,u=A*(n.tileID.canonical.x+n.tileID.wrap*h),c=A*n.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:a.tl,u_pattern_br_a:a.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[o,l],u_mix:r.t,u_pattern_size_a:a.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:r.fromScale,u_scale_b:r.toScale,u_tile_units_to_pixels:1/t.aC(n,1,i.transform.tileZoom),u_pixel_coord_upper:[u>>16,c>>16],u_pixel_coord_lower:[65535&u,65535&c]}}(i,a,r,n),{u_opacity:e}),ni=(e,t)=>{},ai={fillExtrusion:(e,r)=>({u_lightpos:new t.bT(e,r.u_lightpos),u_lightpos_globe:new t.bT(e,r.u_lightpos_globe),u_lightintensity:new t.bg(e,r.u_lightintensity),u_lightcolor:new t.bT(e,r.u_lightcolor),u_vertical_gradient:new t.bg(e,r.u_vertical_gradient),u_opacity:new t.bg(e,r.u_opacity),u_fill_translate:new t.bU(e,r.u_fill_translate)}),fillExtrusionPattern:(e,r)=>({u_lightpos:new t.bT(e,r.u_lightpos),u_lightpos_globe:new t.bT(e,r.u_lightpos_globe),u_lightintensity:new t.bg(e,r.u_lightintensity),u_lightcolor:new t.bT(e,r.u_lightcolor),u_vertical_gradient:new t.bg(e,r.u_vertical_gradient),u_height_factor:new t.bg(e,r.u_height_factor),u_opacity:new t.bg(e,r.u_opacity),u_fill_translate:new t.bU(e,r.u_fill_translate),u_image:new t.bP(e,r.u_image),u_texsize:new t.bU(e,r.u_texsize),u_pixel_coord_upper:new t.bU(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.bU(e,r.u_pixel_coord_lower),u_scale:new t.bT(e,r.u_scale),u_fade:new t.bg(e,r.u_fade)}),fill:(e,r)=>({u_fill_translate:new t.bU(e,r.u_fill_translate)}),fillPattern:(e,r)=>({u_image:new t.bP(e,r.u_image),u_texsize:new t.bU(e,r.u_texsize),u_pixel_coord_upper:new t.bU(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.bU(e,r.u_pixel_coord_lower),u_scale:new t.bT(e,r.u_scale),u_fade:new t.bg(e,r.u_fade),u_fill_translate:new t.bU(e,r.u_fill_translate)}),fillOutline:(e,r)=>({u_world:new t.bU(e,r.u_world),u_fill_translate:new t.bU(e,r.u_fill_translate)}),fillOutlinePattern:(e,r)=>({u_world:new t.bU(e,r.u_world),u_image:new t.bP(e,r.u_image),u_texsize:new t.bU(e,r.u_texsize),u_pixel_coord_upper:new t.bU(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.bU(e,r.u_pixel_coord_lower),u_scale:new t.bT(e,r.u_scale),u_fade:new t.bg(e,r.u_fade),u_fill_translate:new t.bU(e,r.u_fill_translate)}),circle:(e,r)=>({u_camera_to_center_distance:new t.bg(e,r.u_camera_to_center_distance),u_scale_with_map:new t.bP(e,r.u_scale_with_map),u_pitch_with_map:new t.bP(e,r.u_pitch_with_map),u_extrude_scale:new t.bU(e,r.u_extrude_scale),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_globe_extrude_scale:new t.bg(e,r.u_globe_extrude_scale),u_translate:new t.bU(e,r.u_translate)}),collisionBox:(e,r)=>({u_pixel_extrude_scale:new t.bU(e,r.u_pixel_extrude_scale)}),collisionCircle:(e,r)=>({u_viewport_size:new t.bU(e,r.u_viewport_size)}),debug:(e,r)=>({u_color:new t.bQ(e,r.u_color),u_overlay:new t.bP(e,r.u_overlay),u_overlay_scale:new t.bg(e,r.u_overlay_scale)}),depth:ni,clippingMask:ni,heatmap:(e,r)=>({u_extrude_scale:new t.bg(e,r.u_extrude_scale),u_intensity:new t.bg(e,r.u_intensity),u_globe_extrude_scale:new t.bg(e,r.u_globe_extrude_scale)}),heatmapTexture:(e,r)=>({u_matrix:new t.bR(e,r.u_matrix),u_world:new t.bU(e,r.u_world),u_image:new t.bP(e,r.u_image),u_color_ramp:new t.bP(e,r.u_color_ramp),u_opacity:new t.bg(e,r.u_opacity)}),hillshade:(e,r)=>({u_image:new t.bP(e,r.u_image),u_latrange:new t.bU(e,r.u_latrange),u_exaggeration:new t.bg(e,r.u_exaggeration),u_altitudes:new t.b_(e,r.u_altitudes),u_azimuths:new t.b_(e,r.u_azimuths),u_accent:new t.bQ(e,r.u_accent),u_method:new t.bP(e,r.u_method),u_shadows:new t.bZ(e,r.u_shadows),u_highlights:new t.bZ(e,r.u_highlights)}),hillshadePrepare:(e,r)=>({u_matrix:new t.bR(e,r.u_matrix),u_image:new t.bP(e,r.u_image),u_dimension:new t.bU(e,r.u_dimension),u_zoom:new t.bg(e,r.u_zoom),u_unpack:new t.bS(e,r.u_unpack)}),colorRelief:(e,r)=>({u_image:new t.bP(e,r.u_image),u_unpack:new t.bS(e,r.u_unpack),u_dimension:new t.bU(e,r.u_dimension),u_elevation_stops:new t.bP(e,r.u_elevation_stops),u_color_stops:new t.bP(e,r.u_color_stops),u_color_ramp_size:new t.bP(e,r.u_color_ramp_size),u_opacity:new t.bg(e,r.u_opacity)}),line:(e,r)=>({u_translation:new t.bU(e,r.u_translation),u_ratio:new t.bg(e,r.u_ratio),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.bU(e,r.u_units_to_pixels)}),lineGradient:(e,r)=>({u_translation:new t.bU(e,r.u_translation),u_ratio:new t.bg(e,r.u_ratio),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.bU(e,r.u_units_to_pixels),u_image:new t.bP(e,r.u_image),u_image_height:new t.bg(e,r.u_image_height)}),linePattern:(e,r)=>({u_translation:new t.bU(e,r.u_translation),u_texsize:new t.bU(e,r.u_texsize),u_ratio:new t.bg(e,r.u_ratio),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_image:new t.bP(e,r.u_image),u_units_to_pixels:new t.bU(e,r.u_units_to_pixels),u_scale:new t.bT(e,r.u_scale),u_fade:new t.bg(e,r.u_fade)}),lineSDF:(e,r)=>({u_translation:new t.bU(e,r.u_translation),u_ratio:new t.bg(e,r.u_ratio),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.bU(e,r.u_units_to_pixels),u_image:new t.bP(e,r.u_image),u_mix:new t.bg(e,r.u_mix),u_tileratio:new t.bg(e,r.u_tileratio),u_crossfade_from:new t.bg(e,r.u_crossfade_from),u_crossfade_to:new t.bg(e,r.u_crossfade_to),u_lineatlas_width:new t.bg(e,r.u_lineatlas_width),u_lineatlas_height:new t.bg(e,r.u_lineatlas_height)}),raster:(e,r)=>({u_tl_parent:new t.bU(e,r.u_tl_parent),u_scale_parent:new t.bg(e,r.u_scale_parent),u_buffer_scale:new t.bg(e,r.u_buffer_scale),u_fade_t:new t.bg(e,r.u_fade_t),u_opacity:new t.bg(e,r.u_opacity),u_image0:new t.bP(e,r.u_image0),u_image1:new t.bP(e,r.u_image1),u_brightness_low:new t.bg(e,r.u_brightness_low),u_brightness_high:new t.bg(e,r.u_brightness_high),u_saturation_factor:new t.bg(e,r.u_saturation_factor),u_contrast_factor:new t.bg(e,r.u_contrast_factor),u_spin_weights:new t.bT(e,r.u_spin_weights),u_coords_top:new t.bS(e,r.u_coords_top),u_coords_bottom:new t.bS(e,r.u_coords_bottom)}),symbolIcon:(e,r)=>({u_is_size_zoom_constant:new t.bP(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.bP(e,r.u_is_size_feature_constant),u_size_t:new t.bg(e,r.u_size_t),u_size:new t.bg(e,r.u_size),u_camera_to_center_distance:new t.bg(e,r.u_camera_to_center_distance),u_pitch:new t.bg(e,r.u_pitch),u_rotate_symbol:new t.bP(e,r.u_rotate_symbol),u_aspect_ratio:new t.bg(e,r.u_aspect_ratio),u_fade_change:new t.bg(e,r.u_fade_change),u_label_plane_matrix:new t.bR(e,r.u_label_plane_matrix),u_coord_matrix:new t.bR(e,r.u_coord_matrix),u_is_text:new t.bP(e,r.u_is_text),u_pitch_with_map:new t.bP(e,r.u_pitch_with_map),u_is_along_line:new t.bP(e,r.u_is_along_line),u_is_variable_anchor:new t.bP(e,r.u_is_variable_anchor),u_texsize:new t.bU(e,r.u_texsize),u_texture:new t.bP(e,r.u_texture),u_translation:new t.bU(e,r.u_translation),u_pitched_scale:new t.bg(e,r.u_pitched_scale)}),symbolSDF:(e,r)=>({u_is_size_zoom_constant:new t.bP(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.bP(e,r.u_is_size_feature_constant),u_size_t:new t.bg(e,r.u_size_t),u_size:new t.bg(e,r.u_size),u_camera_to_center_distance:new t.bg(e,r.u_camera_to_center_distance),u_pitch:new t.bg(e,r.u_pitch),u_rotate_symbol:new t.bP(e,r.u_rotate_symbol),u_aspect_ratio:new t.bg(e,r.u_aspect_ratio),u_fade_change:new t.bg(e,r.u_fade_change),u_label_plane_matrix:new t.bR(e,r.u_label_plane_matrix),u_coord_matrix:new t.bR(e,r.u_coord_matrix),u_is_text:new t.bP(e,r.u_is_text),u_pitch_with_map:new t.bP(e,r.u_pitch_with_map),u_is_along_line:new t.bP(e,r.u_is_along_line),u_is_variable_anchor:new t.bP(e,r.u_is_variable_anchor),u_texsize:new t.bU(e,r.u_texsize),u_texture:new t.bP(e,r.u_texture),u_gamma_scale:new t.bg(e,r.u_gamma_scale),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_is_halo:new t.bP(e,r.u_is_halo),u_translation:new t.bU(e,r.u_translation),u_pitched_scale:new t.bg(e,r.u_pitched_scale)}),symbolTextAndIcon:(e,r)=>({u_is_size_zoom_constant:new t.bP(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.bP(e,r.u_is_size_feature_constant),u_size_t:new t.bg(e,r.u_size_t),u_size:new t.bg(e,r.u_size),u_camera_to_center_distance:new t.bg(e,r.u_camera_to_center_distance),u_pitch:new t.bg(e,r.u_pitch),u_rotate_symbol:new t.bP(e,r.u_rotate_symbol),u_aspect_ratio:new t.bg(e,r.u_aspect_ratio),u_fade_change:new t.bg(e,r.u_fade_change),u_label_plane_matrix:new t.bR(e,r.u_label_plane_matrix),u_coord_matrix:new t.bR(e,r.u_coord_matrix),u_is_text:new t.bP(e,r.u_is_text),u_pitch_with_map:new t.bP(e,r.u_pitch_with_map),u_is_along_line:new t.bP(e,r.u_is_along_line),u_is_variable_anchor:new t.bP(e,r.u_is_variable_anchor),u_texsize:new t.bU(e,r.u_texsize),u_texsize_icon:new t.bU(e,r.u_texsize_icon),u_texture:new t.bP(e,r.u_texture),u_texture_icon:new t.bP(e,r.u_texture_icon),u_gamma_scale:new t.bg(e,r.u_gamma_scale),u_device_pixel_ratio:new t.bg(e,r.u_device_pixel_ratio),u_is_halo:new t.bP(e,r.u_is_halo),u_translation:new t.bU(e,r.u_translation),u_pitched_scale:new t.bg(e,r.u_pitched_scale)}),background:(e,r)=>({u_opacity:new t.bg(e,r.u_opacity),u_color:new t.bQ(e,r.u_color)}),backgroundPattern:(e,r)=>({u_opacity:new t.bg(e,r.u_opacity),u_image:new t.bP(e,r.u_image),u_pattern_tl_a:new t.bU(e,r.u_pattern_tl_a),u_pattern_br_a:new t.bU(e,r.u_pattern_br_a),u_pattern_tl_b:new t.bU(e,r.u_pattern_tl_b),u_pattern_br_b:new t.bU(e,r.u_pattern_br_b),u_texsize:new t.bU(e,r.u_texsize),u_mix:new t.bg(e,r.u_mix),u_pattern_size_a:new t.bU(e,r.u_pattern_size_a),u_pattern_size_b:new t.bU(e,r.u_pattern_size_b),u_scale_a:new t.bg(e,r.u_scale_a),u_scale_b:new t.bg(e,r.u_scale_b),u_pixel_coord_upper:new t.bU(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.bU(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.bg(e,r.u_tile_units_to_pixels)}),terrain:(e,r)=>({u_texture:new t.bP(e,r.u_texture),u_ele_delta:new t.bg(e,r.u_ele_delta),u_fog_matrix:new t.bR(e,r.u_fog_matrix),u_fog_color:new t.bQ(e,r.u_fog_color),u_fog_ground_blend:new t.bg(e,r.u_fog_ground_blend),u_fog_ground_blend_opacity:new t.bg(e,r.u_fog_ground_blend_opacity),u_horizon_color:new t.bQ(e,r.u_horizon_color),u_horizon_fog_blend:new t.bg(e,r.u_horizon_fog_blend),u_is_globe_mode:new t.bg(e,r.u_is_globe_mode)}),terrainDepth:(e,r)=>({u_ele_delta:new t.bg(e,r.u_ele_delta)}),terrainCoords:(e,r)=>({u_texture:new t.bP(e,r.u_texture),u_terrain_coords_id:new t.bg(e,r.u_terrain_coords_id),u_ele_delta:new t.bg(e,r.u_ele_delta)}),projectionErrorMeasurement:(e,r)=>({u_input:new t.bg(e,r.u_input),u_output_expected:new t.bg(e,r.u_output_expected)}),atmosphere:(e,r)=>({u_sun_pos:new t.bT(e,r.u_sun_pos),u_atmosphere_blend:new t.bg(e,r.u_atmosphere_blend),u_globe_position:new t.bT(e,r.u_globe_position),u_globe_radius:new t.bg(e,r.u_globe_radius),u_inv_proj_matrix:new t.bR(e,r.u_inv_proj_matrix)}),sky:(e,r)=>({u_sky_color:new t.bQ(e,r.u_sky_color),u_horizon_color:new t.bQ(e,r.u_horizon_color),u_horizon:new t.bU(e,r.u_horizon),u_horizon_normal:new t.bU(e,r.u_horizon_normal),u_sky_horizon_blend:new t.bg(e,r.u_sky_horizon_blend),u_sky_blend:new t.bg(e,r.u_sky_blend)})};class si{constructor(e,t,r){this.context=e;let i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=!!r,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){let t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}let oi={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class li{constructor(e,t,r,i){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;let n=e.gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);let t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){let i=t.attributes[this.attributes[r].name];void 0!==i&&e.enableVertexAttribArray(i)}}setVertexAttribPointers(e,t,r){for(let i=0;i<this.attributes.length;i++){let n=this.attributes[i],a=t.attributes[n.name];void 0!==a&&e.vertexAttribPointer(a,n.components,e[oi[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class hi{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Ai extends hi{getDefault(){return t.bf.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class ui extends hi{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class ci extends hi{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class di extends hi{getDefault(){return[!0,!0,!0,!0]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class pi extends hi{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class fi extends hi{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class gi extends hi{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){let t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class mi extends hi{getDefault(){let e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class yi extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class _i extends hi{getDefault(){return[0,1]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class vi extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class wi extends hi{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class bi extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class xi extends hi{getDefault(){let e=this.gl;return[e.ONE,e.ZERO]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Bi extends hi{getDefault(){return t.bf.transparent}set(e){let t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Ci extends hi{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class Si extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class Ei extends hi{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class Ii extends hi{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class Ti extends hi{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class Fi extends hi{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Pi extends hi{getDefault(){let e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){let t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Li extends hi{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Mi extends hi{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class ki extends hi{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Ui extends hi{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Ri extends hi{getDefault(){return null}set(e){let t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Di extends hi{getDefault(){return null}set(e){var t;if(e===this.current&&!this.dirty)return;let r=this.gl;Kt(r)?r.bindVertexArray(e):null===(t=r.getExtension("OES_vertex_array_object"))||void 0===t||t.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class Ni extends hi{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class Oi extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Qi extends hi{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;let t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class zi extends hi{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class Hi extends zi{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class ji extends zi{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Vi extends zi{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);let t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}let Gi,Ki="Framebuffer is not complete";class qi{constructor(e,t,r,i,n){this.context=e,this.width=t,this.height=r;let a=e.gl,s=this.framebuffer=a.createFramebuffer();if(this.colorAttachment=new Hi(e,s),i)this.depthAttachment=n?new Vi(e,s):new ji(e,s);else if(n)throw new Error("Stencil cannot be set without depth");if(a.checkFramebufferStatus(a.FRAMEBUFFER)!==a.FRAMEBUFFER_COMPLETE)throw new Error(Ki)}destroy(){let e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){let t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class Zi{constructor(e){var t,r;if(this.gl=e,this.clearColor=new Ai(this),this.clearDepth=new ui(this),this.clearStencil=new ci(this),this.colorMask=new di(this),this.depthMask=new pi(this),this.stencilMask=new fi(this),this.stencilFunc=new gi(this),this.stencilOp=new mi(this),this.stencilTest=new yi(this),this.depthRange=new _i(this),this.depthTest=new vi(this),this.depthFunc=new wi(this),this.blend=new bi(this),this.blendFunc=new xi(this),this.blendColor=new Bi(this),this.blendEquation=new Ci(this),this.cullFace=new Si(this),this.cullFaceSide=new Ei(this),this.frontFace=new Ii(this),this.program=new Ti(this),this.activeTexture=new Fi(this),this.viewport=new Pi(this),this.bindFramebuffer=new Li(this),this.bindRenderbuffer=new Mi(this),this.bindTexture=new ki(this),this.bindVertexBuffer=new Ui(this),this.bindElementBuffer=new Ri(this),this.bindVertexArray=new Di(this),this.pixelStoreUnpack=new Ni(this),this.pixelStoreUnpackPremultiplyAlpha=new Oi(this),this.pixelStoreUnpackFlipY=new Qi(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),Kt(e)){this.HALF_FLOAT=e.HALF_FLOAT;let i=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=null!==(t=e.RGBA16F)&&void 0!==t?t:i?.RGBA16F_EXT,this.RGB16F=null!==(r=e.RGB16F)&&void 0!==r?r:i?.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");let t=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=t?.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,t){return new si(this,e,t)}createVertexBuffer(e,t,r){return new li(this,e,t,r)}createRenderbuffer(e,t,r){let i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),n}createFramebuffer(e,t,r,i){return new qi(this,e,t,r,i)}clear({color:e,depth:t,stencil:r}){let i=this.gl,n=0;e&&(n|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(n|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),void 0!==r&&(n|=i.STENCIL_BUFFER_BIT,this.clearStencil.set(r),this.stencilMask.set(255)),i.clear(n)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){t.bH(e.blendFunction,Ot.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return Kt(this.gl)?this.gl.createVertexArray():null===(e=this.gl.getExtension("OES_vertex_array_object"))||void 0===e?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var t;return Kt(this.gl)?this.gl.deleteVertexArray(e):null===(t=this.gl.getExtension("OES_vertex_array_object"))||void 0===t?void 0:t.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}function Wi(e,r,i,n,a){let s=e.context,o=e.transform,l=s.gl,h=e.useProgram("collisionBox"),A=[],u=0,c=0;for(let t=0;t<n.length;t++){let d=n[t],p=r.getTile(d).getBucket(i);if(!p)continue;let f=a?p.textCollisionBox:p.iconCollisionBox,g=p.collisionCircleArray;g.length>0&&(A.push({circleArray:g,circleOffset:c,coord:d}),u+=g.length/4,c=u),f&&h.draw(s,l.LINES,Ht.disabled,Vt.disabled,e.colorModeForRenderPass(),zt.disabled,Rr(e.transform),e.style.map.terrain&&e.style.map.terrain.getTerrainData(d),o.getProjectionData({overscaledTileID:d,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),i.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,null,e.transform.zoom,null,null,f.collisionVertexBuffer)}if(!a||!A.length)return;let d=e.useProgram("collisionCircle"),p=new t.b$;p.resize(4*u),p._trim();let f=0;for(let e of A)for(let t=0;t<e.circleArray.length/4;t++){let r=4*t,i=e.circleArray[r+0],n=e.circleArray[r+1],a=e.circleArray[r+2],s=e.circleArray[r+3];p.emplace(f++,i,n,a,s,0),p.emplace(f++,i,n,a,s,1),p.emplace(f++,i,n,a,s,2),p.emplace(f++,i,n,a,s,3)}(!Gi||Gi.length<2*u)&&(Gi=function(e){let r=2*e,i=new t.c1;i.resize(r),i._trim();for(let e=0;e<r;e++){let t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(u));let g=s.createIndexBuffer(Gi,!0),m=s.createVertexBuffer(p,t.c0.members,!0);for(let r of A){let n=Dr(e.transform);d.draw(s,l.TRIANGLES,Ht.disabled,Vt.disabled,e.colorModeForRenderPass(),zt.disabled,n,e.style.map.terrain&&e.style.map.terrain.getTerrainData(r.coord),null,i.id,m,g,t.aM.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,e.transform.zoom,null,null,null)}m.destroy(),g.destroy()}let $i=t.ag(new Float32Array(16));function Xi(e,r,i,n,a,s){let{horizontalAlign:o,verticalAlign:l}=t.aH(e);return new t.P((-(o-.5)*r/a+n[0])*s,(-(l-.5)*i/a+n[1])*s)}function Yi(e,r,i,n,a,s){let o=r.tileAnchorPoint.add(new t.P(r.translation[0],r.translation[1]));if(r.pitchWithMap){let e=n.mult(s);i||(e=e.rotate(-a));let t=o.add(e);return Te(t.x,t.y,r.pitchedLabelPlaneMatrix,r.getElevation).point}if(i){let t=Ne(r.tileAnchorPoint.x+1,r.tileAnchorPoint.y,r).point.sub(e),i=Math.atan(t.y/t.x)+(t.x<0?Math.PI:0);return e.add(n.rotate(i))}return e.add(n)}function Ji(e,r,i,n,a,s,o,l,h,A,u,c){let d=e.text.placedSymbolArray,p=e.text.dynamicLayoutVertexArray,f=e.icon.dynamicLayoutVertexArray,g={};p.clear();for(let f=0;f<d.length;f++){let m=d.get(f),y=m.hidden||!m.crossTileID||e.allowVerticalPlacement&&!m.placedOrientation?null:n[m.crossTileID];if(y){let n=new t.P(m.anchorX,m.anchorY),d={getElevation:c,width:a.width,height:a.height,pitchedLabelPlaneMatrix:s,pitchWithMap:i,transform:a,tileAnchorPoint:n,translation:A,unwrappedTileID:u},f=i?Qe(n.x,n.y,d):Ne(n.x,n.y,d),_=Fe(a.cameraToCenterDistance,f.signedDistanceFromCamera),v=t.ap(e.textSizeData,l,m)*_/t.aB;i&&(v*=e.tilePixelRatio/o);let{width:w,height:b,anchor:x,textOffset:B,textBoxScale:C}=y,S=Xi(x,w,b,B,C,v),E=a.getPitchedTextCorrection(n.x+A[0],n.y+A[1],u),I=Yi(f.point,d,r,S,-a.bearingInRadians,E),T=e.allowVerticalPlacement&&m.placedOrientation===t.ao.vertical?Math.PI/2:0;for(let e=0;e<m.numGlyphs;e++)t.av(p,I,T);h&&m.associatedIconIndex>=0&&(g[m.associatedIconIndex]={shiftedAnchor:I,angle:T})}else Ge(m.numGlyphs,p)}if(h){f.clear();let r=e.icon.placedSymbolArray;for(let e=0;e<r.length;e++){let i=r.get(e);if(i.hidden)Ge(i.numGlyphs,f);else{let r=g[e];if(r)for(let e=0;e<i.numGlyphs;e++)t.av(f,r.shiftedAnchor,r.angle);else Ge(i.numGlyphs,f)}}e.icon.dynamicLayoutVertexBuffer.updateData(f)}e.text.dynamicLayoutVertexBuffer.updateData(p)}function en(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function tn(e,r,i,n,a,s,o,l,h,A,u,c,d){let p=e.context,f=p.gl,g=e.transform,m="map"===l,y="map"===h,_="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),v=m&&!y&&!_,w=!i.layout.get("symbol-sort-key").isConstant(),b=!1,x=e.getDepthModeForSublayer(0,Ht.ReadOnly),B=i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"),C=[],S=g.getCircleRadiusCorrection();for(let l of n){let n=r.getTile(l),h=n.getBucket(i);if(!h)continue;let u=a?h.text:h.icon;if(!u||!u.segments.get().length||!u.hasVisibleVertices)continue;let c,p,x,E,I=u.programConfigurations.get(i.id),T=a||h.sdfIcons,F=a?h.textSizeData:h.iconSizeData,P=y||0!==g.pitch,L=e.useProgram(en(T,a,h),I),M=t.an(F,g.zoom),k=e.style.map.terrain&&e.style.map.terrain.getTerrainData(l),U=[0,0],R=null;if(a)p=n.glyphAtlasTexture,x=f.LINEAR,c=n.glyphAtlasTexture.size,h.iconsInText&&(U=n.imageAtlasTexture.size,R=n.imageAtlasTexture,E=P||e.options.rotating||e.options.zooming||"composite"===F.kind||"camera"===F.kind?f.LINEAR:f.NEAREST);else{let t=1!==i.layout.get("icon-size").constantOr(0)||h.iconsNeedLinear;p=n.imageAtlasTexture,x=T||e.options.rotating||e.options.zooming||t||P?f.LINEAR:f.NEAREST,c=n.imageAtlasTexture.size}let D=t.aC(n,1,e.transform.zoom),N=Se(m,e.transform,D),O=t.L();t.aq(O,N);let Q=Ee(y,m,e.transform,D),z=t.aD(g,n,s,o),H=g.getProjectionData({overscaledTileID:l,applyGlobeMatrix:!d,applyTerrainMatrix:!0}),j=B&&h.hasTextData(),V="none"!==i.layout.get("icon-text-fit")&&j&&h.hasIconData();if(_){let t=e.style.map.terrain?(t,r)=>e.style.map.terrain.getElevation(l,t,r):null,r="map"===i.layout.get("text-rotation-alignment");Le(h,e,a,N,O,y,A,r,l.toUnwrapped(),g.width,g.height,z,t)}let G,K=a&&B||V,q=_||K?$i:y?N:e.transform.clipSpaceToPixelsMatrix,Z=T&&0!==i.paint.get(a?"text-halo-width":"icon-halo-width").constantOr(1);G=T?h.iconsInText?ti(F.kind,M,v,y,_,K,e,q,Q,z,c,U,S):ei(F.kind,M,v,y,_,K,e,q,Q,z,a,c,0,S):Jr(F.kind,M,v,y,_,K,e,q,Q,z,a,c,S);let W={program:L,buffers:u,uniformValues:G,projectionData:H,atlasTexture:p,atlasTextureIcon:R,atlasInterpolation:x,atlasInterpolationIcon:E,isSDF:T,hasHalo:Z};if(w&&h.canOverlap){b=!0;let e=u.segments.get();for(let r of e)C.push({segments:new t.aM([r]),sortKey:r.sortKey,state:W,terrainData:k})}else C.push({segments:u.segments,sortKey:0,state:W,terrainData:k})}b&&C.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of C){let r=t.state;if(p.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(p.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){let n=r.uniformValues;r.hasHalo&&(n.u_is_halo=1,rn(r.buffers,t.segments,i,e,r.program,x,u,c,n,r.projectionData,t.terrainData)),n.u_is_halo=0}rn(r.buffers,t.segments,i,e,r.program,x,u,c,r.uniformValues,r.projectionData,t.terrainData)}}function rn(e,t,r,i,n,a,s,o,l,h,A){let u=i.context;n.draw(u,u.gl.TRIANGLES,a,s,o,zt.backCCW,l,A,h,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function nn(e,r,i,n,a){let s=e.context,o=s.gl,l=Vt.disabled,h=new Ot([o.ONE,o.ONE],t.bf.transparent,[!0,!0,!0,!0]),A=r.getBucket(i);if(!A)return;let u=n.key,c=i.heatmapFbos.get(u);c||(c=sn(s,r.tileSize,r.tileSize),i.heatmapFbos.set(u,c)),s.bindFramebuffer.set(c.framebuffer),s.viewport.set([0,0,r.tileSize,r.tileSize]),s.clear({color:t.bf.transparent});let d=A.programConfigurations.get(i.id),p=e.useProgram("heatmap",d,!a),f=e.transform.getProjectionData({overscaledTileID:r.tileID,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),g=e.style.map.terrain.getTerrainData(n);p.draw(s,o.TRIANGLES,Ht.disabled,l,h,zt.disabled,Or(r,e.transform.zoom,i.paint.get("heatmap-intensity"),1),g,f,i.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,i.paint,e.transform.zoom,d)}function an(e,t,r,i,n){let a=e.context,s=a.gl,o=e.transform;a.setColorMode(e.colorModeForRenderPass());let l=on(a,t),h=r.key,A=t.heatmapFbos.get(h);if(!A)return;a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,A.colorAttachment.get()),a.activeTexture.set(s.TEXTURE1),l.bind(s.LINEAR,s.CLAMP_TO_EDGE);let u=o.getProjectionData({overscaledTileID:r,applyTerrainMatrix:n,applyGlobeMatrix:!i});e.useProgram("heatmapTexture").draw(a,s.TRIANGLES,Ht.disabled,Vt.disabled,e.colorModeForRenderPass(),zt.disabled,Qr(e,t,0,1),null,u,t.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments,t.paint,o.zoom),A.destroy(),t.heatmapFbos.delete(h)}function sn(e,t,r){var i,n;let a=e.gl,s=a.createTexture();a.bindTexture(a.TEXTURE_2D,s),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.CLAMP_TO_EDGE),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR);let o=null!==(i=e.HALF_FLOAT)&&void 0!==i?i:a.UNSIGNED_BYTE,l=null!==(n=e.RGBA16F)&&void 0!==n?n:a.RGBA;a.texImage2D(a.TEXTURE_2D,0,l,t,r,0,a.RGBA,o,null);let h=e.createFramebuffer(t,r,!1,!1);return h.colorAttachment.set(s),h}function on(e,r){return r.colorRampTexture||(r.colorRampTexture=new t.T(e,r.colorRamp,e.gl.RGBA)),r.colorRampTexture}function ln(e,t,r,i,n){if(!r||!i||!i.imageAtlas)return;let a=i.imageAtlas.patternPositions,s=a[r.to.toString()],o=a[r.from.toString()];if(!s&&o&&(s=o),!o&&s&&(o=s),!s||!o){let e=n.getPaintProperty(t);s=a[e],o=a[e]}s&&o&&e.setConstantPatternPositions(s,o)}function hn(e,r,i,n,a,s,o,l){let h,A,u,c,d,p=e.context.gl,f="fill-pattern",g=i.paint.get(f),m=g&&g.constantOr(1),y=i.getCrossfadeParameters(),_=e.transform,v=i.paint.get("fill-translate"),w=i.paint.get("fill-translate-anchor");o?(A=m&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=p.LINES):(A=m?"fillPattern":"fill",h=p.TRIANGLES);let b=g.constantOr(null);for(let g of n){let n=r.getTile(g);if(m&&!n.patternsLoaded())continue;let x=n.getBucket(i);if(!x)continue;let B=x.programConfigurations.get(i.id),C=e.useProgram(A,B),S=e.style.map.terrain&&e.style.map.terrain.getTerrainData(g);m&&(e.context.activeTexture.set(p.TEXTURE0),n.imageAtlasTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),B.updatePaintBuffers(y)),ln(B,f,b,n,i);let E=_.getProjectionData({overscaledTileID:g,applyGlobeMatrix:!l,applyTerrainMatrix:!0}),I=t.aD(_,n,v,w);if(o){c=x.indexBuffer2,d=x.segments2;let t=[p.drawingBufferWidth,p.drawingBufferHeight];u="fillOutlinePattern"===A&&m?kr(e,y,n,t,I):Mr(t,I)}else c=x.indexBuffer,d=x.segments,u=m?Lr(e,y,n,I):{u_fill_translate:I};let T=e.stencilModeForClipping(g);C.draw(e.context,h,a,T,s,zt.backCCW,u,S,E,i.id,x.layoutVertexBuffer,c,d,i.paint,e.transform.zoom,B)}}function An(e,r,i,n,a,s,o,l){let h=e.context,A=h.gl,u="fill-extrusion-pattern",c=i.paint.get(u),d=c.constantOr(1),p=i.getCrossfadeParameters(),f=i.paint.get("fill-extrusion-opacity"),g=c.constantOr(null),m=e.transform;for(let c of n){let n=r.getTile(c),y=n.getBucket(i);if(!y)continue;let _=e.style.map.terrain&&e.style.map.terrain.getTerrainData(c),v=y.programConfigurations.get(i.id),w=e.useProgram(d?"fillExtrusionPattern":"fillExtrusion",v);d&&(e.context.activeTexture.set(A.TEXTURE0),n.imageAtlasTexture.bind(A.LINEAR,A.CLAMP_TO_EDGE),v.updatePaintBuffers(p));let b=m.getProjectionData({overscaledTileID:c,applyGlobeMatrix:!l,applyTerrainMatrix:!0});ln(v,u,g,n,i);let x=t.aD(m,n,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),B=i.paint.get("fill-extrusion-vertical-gradient"),C=d?Pr(e,B,f,x,c,p,n):Fr(e,B,f,x);w.draw(h,h.gl.TRIANGLES,a,s,o,zt.backCCW,C,_,b,i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,i.paint,e.transform.zoom,v,e.style.map.terrain&&y.centroidVertexBuffer)}}function un(e,t,r,i,n,a,s,o,l){var h;let A=e.style.projection,u=e.context,c=e.transform,d=u.gl,p=[`#define NUM_ILLUMINATION_SOURCES ${r.paint.get("hillshade-highlight-color").values.length}`],f=e.useProgram("hillshade",null,!1,p),g=!e.options.moving;for(let p of i){let i=t.getTile(p),m=i.fbo;if(!m)continue;let y=A.getMeshFromTileID(u,p.canonical,o,!0,"raster"),_=null===(h=e.style.map.terrain)||void 0===h?void 0:h.getTerrainData(p);u.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,m.colorAttachment.get());let v=c.getProjectionData({overscaledTileID:p,aligned:g,applyGlobeMatrix:!l,applyTerrainMatrix:!0});f.draw(u,d.TRIANGLES,a,n[p.overscaledZ],s,zt.backCCW,zr(e,i,r),_,v,r.id,y.vertexBuffer,y.indexBuffer,y.segments)}}function cn(e,r,i,n,a,s,o,l,h){var A;let u=e.style.projection,c=e.context,d=e.transform,p=c.gl,f=e.useProgram("colorRelief"),g=!e.options.moving,m=!0,y=0;for(let _ of n){let n=r.getTile(_),v=n.dem;if(m){let e=p.getParameter(p.MAX_TEXTURE_SIZE),{elevationTexture:t,colorTexture:r}=i.getColorRampTextures(c,e,v.getUnpackVector());c.activeTexture.set(p.TEXTURE1),t.bind(p.NEAREST,p.CLAMP_TO_EDGE),c.activeTexture.set(p.TEXTURE4),r.bind(p.LINEAR,p.CLAMP_TO_EDGE),m=!1,y=t.size[0]}if(!v||!v.data)continue;let w=v.stride,b=v.getPixels();if(c.activeTexture.set(p.TEXTURE0),c.pixelStoreUnpackPremultiplyAlpha.set(!1),n.demTexture=n.demTexture||e.getTileTexture(w),n.demTexture){let e=n.demTexture;e.update(b,{premultiply:!1}),e.bind(p.LINEAR,p.CLAMP_TO_EDGE)}else n.demTexture=new t.T(c,b,p.RGBA,{premultiply:!1}),n.demTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE);let x=u.getMeshFromTileID(c,_.canonical,l,!0,"raster"),B=null===(A=e.style.map.terrain)||void 0===A?void 0:A.getTerrainData(_),C=d.getProjectionData({overscaledTileID:_,aligned:g,applyGlobeMatrix:!h,applyTerrainMatrix:!0});f.draw(c,p.TRIANGLES,s,a[_.overscaledZ],o,zt.backCCW,Vr(i,n.dem,y),B,C,i.id,x.vertexBuffer,x.indexBuffer,x.segments)}}let dn=[new t.P(0,0),new t.P(t.$,0),new t.P(t.$,t.$),new t.P(0,t.$)];function pn(e,t,r,i,n,a,s,o,l=!1,h=!1){let A=i[i.length-1].overscaledZ,u=e.context,c=u.gl,d=e.useProgram("raster"),p=e.transform,f=e.style.projection,g=e.colorModeForRenderPass(),m=!e.options.moving;for(let y of i){let i=e.getDepthModeForSublayer(y.overscaledZ-A,1===r.paint.get("raster-opacity")?Ht.ReadWrite:Ht.ReadOnly,c.LESS),_=t.getTile(y);_.registerFadeDuration(r.paint.get("raster-fade-duration"));let v,w,b=t.findLoadedParent(y,0),x=t.findLoadedSibling(y),B=fn(_,b||x||null,t,r,e.transform,e.style.map.terrain),C="nearest"===r.paint.get("raster-resampling")?c.NEAREST:c.LINEAR;u.activeTexture.set(c.TEXTURE0),_.texture.bind(C,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST),u.activeTexture.set(c.TEXTURE1),b?(b.texture.bind(C,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST),v=Math.pow(2,b.tileID.overscaledZ-_.tileID.overscaledZ),w=[_.tileID.canonical.x*v%1,_.tileID.canonical.y*v%1]):_.texture.bind(C,c.CLAMP_TO_EDGE,c.LINEAR_MIPMAP_NEAREST),_.texture.useMipmap&&u.extTextureFilterAnisotropic&&e.transform.pitch>20&&c.texParameterf(c.TEXTURE_2D,u.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,u.extTextureFilterAnisotropicMax);let S=e.style.map.terrain&&e.style.map.terrain.getTerrainData(y),E=p.getProjectionData({overscaledTileID:y,aligned:m,applyGlobeMatrix:!h,applyTerrainMatrix:!0}),I=Xr(w||[0,0],v||1,B,r,o),T=f.getMeshFromTileID(u,y.canonical,a,s,"raster");d.draw(u,c.TRIANGLES,i,n?n[y.overscaledZ]:Vt.disabled,g,l?zt.frontCCW:zt.backCCW,I,S,E,r.id,T.vertexBuffer,T.indexBuffer,T.segments)}}function fn(e,r,i,n,a,o){let l=n.paint.get("raster-fade-duration");if(!o&&l>0){let n=s.now(),o=(n-e.timeAdded)/l,h=r?(n-r.timeAdded)/l:-1,A=i.getSource(),u=me(a,{tileSize:A.tileSize,roundZoom:A.roundZoom}),c=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(e.tileID.overscaledZ-u),d=c&&e.refreshedUponExpiration?1:t.ah(c?o:1-h,0,1);return e.refreshedUponExpiration&&o>=1&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-d}:{opacity:d,mix:0}}return{opacity:1,mix:0}}let gn=new t.bf(1,0,0,1),mn=new t.bf(0,1,0,1),yn=new t.bf(0,0,1,1),_n=new t.bf(1,0,1,1),vn=new t.bf(0,1,1,1);function wn(e,t,r,i){xn(e,0,t+r/2,e.transform.width,r,i)}function bn(e,t,r,i){xn(e,t-r/2,0,r,e.transform.height,i)}function xn(e,t,r,i,n,a){let s=e.context,o=s.gl;o.enable(o.SCISSOR_TEST),o.scissor(t*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio,n*e.pixelRatio),s.clear({color:a}),o.disable(o.SCISSOR_TEST)}function Bn(e,r,i){let n=e.context,a=n.gl,s=e.useProgram("debug"),o=Ht.disabled,l=Vt.disabled,h=e.colorModeForRenderPass(),A="$debug",u=e.style.map.terrain&&e.style.map.terrain.getTerrainData(i);n.activeTexture.set(a.TEXTURE0);let c=r.getTileByID(i.key).latestRawTileData,d=Math.floor((c&&c.byteLength||0)/1024),p=r.getTile(i).tileSize,f=512/Math.min(p,512)*(i.overscaledZ/e.transform.zoom)*.5,g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();let r=e.debugOverlayCanvas,i=e.context.gl,n=e.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,`${g} ${d}kB`);let m=e.transform.getProjectionData({overscaledTileID:i,applyGlobeMatrix:!0,applyTerrainMatrix:!0});s.draw(n,a.TRIANGLES,o,l,Ot.alphaBlended,zt.disabled,Nr(t.bf.transparent,f),null,m,A,e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments),s.draw(n,a.LINE_STRIP,o,l,h,zt.disabled,Nr(t.bf.red),u,m,A,e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments)}function Cn(e,t,r,i){let{isRenderingGlobe:n}=i,a=e.context,s=a.gl,o=e.transform,l=e.colorModeForRenderPass(),h=e.getDepthModeFor3D(),A=e.useProgram("terrain");a.bindFramebuffer.set(null),a.viewport.set([0,0,e.width,e.height]);for(let i of r){let r=t.getTerrainMesh(i.tileID),u=e.renderToTexture.getTexture(i),c=t.getTerrainData(i.tileID);a.activeTexture.set(s.TEXTURE0),s.bindTexture(s.TEXTURE_2D,u.texture);let d=t.getMeshFrameDelta(o.zoom),p=o.calculateFogMatrix(i.tileID.toUnwrapped()),f=Cr(d,p,e.style.sky,o.pitch,n),g=o.getProjectionData({overscaledTileID:i.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});A.draw(a,s.TRIANGLES,h,Vt.disabled,l,zt.backCCW,f,c,g,"terrain",r.vertexBuffer,r.indexBuffer,r.segments)}}function Sn(e,r){if(!r.mesh){let i=new t.aL;i.emplaceBack(-1,-1),i.emplaceBack(1,-1),i.emplaceBack(1,1),i.emplaceBack(-1,1);let n=new t.aN;n.emplaceBack(0,1,2),n.emplaceBack(0,2,3),r.mesh=new bt(e.createVertexBuffer(i,xt.members),e.createIndexBuffer(n),t.aM.simpleSegment(0,0,i.length,n.length))}return r.mesh}class En{constructor(e,r){this.context=new Zi(e),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:t.ag(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=ve.maxUnderzooming+ve.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new yt}resize(e,t,r){if(this.width=Math.floor(e*r),this.height=Math.floor(t*r),this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(let e of this.style._order)this.style._layers[e].resize()}setup(){let e=this.context,r=new t.aL;r.emplaceBack(0,0),r.emplaceBack(t.$,0),r.emplaceBack(0,t.$),r.emplaceBack(t.$,t.$),this.tileExtentBuffer=e.createVertexBuffer(r,xt.members),this.tileExtentSegments=t.aM.simpleSegment(0,0,4,2);let i=new t.aL;i.emplaceBack(0,0),i.emplaceBack(t.$,0),i.emplaceBack(0,t.$),i.emplaceBack(t.$,t.$),this.debugBuffer=e.createVertexBuffer(i,xt.members),this.debugSegments=t.aM.simpleSegment(0,0,4,5);let n=new t.c6;n.emplaceBack(0,0,0,0),n.emplaceBack(t.$,0,t.$,0),n.emplaceBack(0,t.$,0,t.$),n.emplaceBack(t.$,t.$,t.$,t.$),this.rasterBoundsBuffer=e.createVertexBuffer(n,xr.members),this.rasterBoundsSegments=t.aM.simpleSegment(0,0,4,2);let a=new t.aL;a.emplaceBack(0,0),a.emplaceBack(t.$,0),a.emplaceBack(0,t.$),a.emplaceBack(t.$,t.$),this.rasterBoundsBufferPosOnly=e.createVertexBuffer(a,xt.members),this.rasterBoundsSegmentsPosOnly=t.aM.simpleSegment(0,0,4,5);let s=new t.aL;s.emplaceBack(0,0),s.emplaceBack(1,0),s.emplaceBack(0,1),s.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(s,xt.members),this.viewportSegments=t.aM.simpleSegment(0,0,4,2);let o=new t.c7;o.emplaceBack(0),o.emplaceBack(1),o.emplaceBack(3),o.emplaceBack(2),o.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(o);let l=new t.aN;l.emplaceBack(1,0,2),l.emplaceBack(1,2,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(l);let h=this.context.gl;this.stencilClearMode=new Vt({func:h.ALWAYS,mask:0},0,255,h.ZERO,h.ZERO,h.ZERO),this.tileExtentMesh=new bt(this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}clearStencil(){let e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;let i=t.L();t.bY(i,0,this.width,this.height,0,0,1),t.N(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]);let n={mainMatrix:i,tileMercatorCoords:[0,0,1,1],clippingPlane:[0,0,0,0],projectionTransition:0,fallbackMatrix:i};this.useProgram("clippingMask",null,!0).draw(e,r.TRIANGLES,Ht.disabled,this.stencilClearMode,Ot.disabled,zt.disabled,null,null,n,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t,r){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source,this.nextStencilID+t.length>256&&this.clearStencil();let i=this.context;i.setColorMode(Ot.disabled),i.setDepthMode(Ht.disabled);let n={};for(let e of t)n[e.key]=this.nextStencilID++;this._renderTileMasks(n,t,r,!0),this._renderTileMasks(n,t,r,!1),this._tileClippingMaskIDs=n}_renderTileMasks(e,t,r,i){let n=this.context,a=n.gl,s=this.style.projection,o=this.transform,l=this.useProgram("clippingMask");for(let h of t){let t=e[h.key],A=this.style.map.terrain&&this.style.map.terrain.getTerrainData(h),u=s.getMeshFromTileID(this.context,h.canonical,i,!0,"stencil"),c=o.getProjectionData({overscaledTileID:h,applyGlobeMatrix:!r,applyTerrainMatrix:!0});l.draw(n,a.TRIANGLES,Ht.disabled,new Vt({func:a.ALWAYS,mask:0},t,255,a.KEEP,a.KEEP,a.REPLACE),Ot.disabled,r?zt.disabled:zt.backCCW,null,A,c,"$clipping",u.vertexBuffer,u.indexBuffer,u.segments)}}_renderTilesDepthBuffer(){let e=this.context,t=e.gl,r=this.style.projection,i=this.transform,n=this.useProgram("depth"),a=this.getDepthModeFor3D(),s=ye(i,{tileSize:i.tileSize});for(let o of s){let s=this.style.map.terrain&&this.style.map.terrain.getTerrainData(o),l=r.getMeshFromTileID(this.context,o.canonical,!0,!0,"raster"),h=i.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!0,applyTerrainMatrix:!0});n.draw(e,t.TRIANGLES,a,Vt.disabled,Ot.disabled,zt.backCCW,null,s,h,"$clipping",l.vertexBuffer,l.indexBuffer,l.segments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();let e=this.nextStencilID++,t=this.context.gl;return new Vt({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){let t=this.context.gl;return new Vt({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}getStencilConfigForOverlapAndUpdateStencilID(e){let t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();let e={};for(let r=0;r<n;r++)e[r+i]=new Vt({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[e,r]}return[{[i]:Vt.disabled},r]}stencilConfigForOverlapTwoPass(e){let t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(this.clearStencil(),n>1){let e={},a={};for(let r=0;r<n;r++)e[r+i]=new Vt({func:t.GREATER,mask:255},n+1+r,255,t.KEEP,t.KEEP,t.REPLACE),a[r+i]=new Vt({func:t.GREATER,mask:255},1+r,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID=2*n+1,[e,a,r]}return this.nextStencilID=3,[{[i]:new Vt({func:t.GREATER,mask:255},2,255,t.KEEP,t.KEEP,t.REPLACE)},{[i]:new Vt({func:t.GREATER,mask:255},1,255,t.KEEP,t.KEEP,t.REPLACE)},r]}colorModeForRenderPass(){let e=this.context.gl;return this._showOverdrawInspector?new Ot([e.CONSTANT_COLOR,e.ONE],new t.bf(.125,.125,.125,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?Ot.unblended:Ot.alphaBlended}getDepthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return Ht.disabled;let i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new Ht(r||this.context.gl.LEQUAL,t,[i,i])}getDepthModeFor3D(){return new Ht(this.context.gl.LEQUAL,Ht.ReadWrite,this.depthRangeFor3D)}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,r){var i,n;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(s.now()),this.imageManager.beginFrame();let a=this.style._order,o=this.style.sourceCaches,l={},h={},A={},u={isRenderingToTexture:!1,isRenderingGlobe:(null===(i=e.projection)||void 0===i?void 0:i.transitionState)>0};for(let e in o){let t=o[e];t.used&&t.prepare(this.context),l[e]=t.getVisibleCoordinates(!1),h[e]=l[e].slice().reverse(),A[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<a.length;e++)if(this.style._layers[a[e]].is3D()){this.opaquePassCutoff=e;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(let e of a){let t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;let r=h[t.source];("custom"===t.type||r.length)&&this.renderLayer(this,o[t.source],t,r,u)}if(null===(n=this.style.projection)||void 0===n||n.updateGPUdependent({context:this.context,useProgram:e=>this.useProgram(e)}),this.context.viewport.set([0,0,this.width,this.height]),this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.bf.black:t.bf.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(e,t){let r=e.context,i=r.gl,n=((e,t,r)=>{let i=Math.cos(t.rollInRadians),n=Math.sin(t.rollInRadians),a=Ae(t),s=t.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}).projectionTransition;return{u_sky_color:e.properties.get("sky-color"),u_horizon_color:e.properties.get("horizon-color"),u_horizon:[(t.width/2-a*n)*r,(t.height/2+a*i)*r],u_horizon_normal:[-n,i],u_sky_horizon_blend:e.properties.get("sky-horizon-blend")*t.height/2*r,u_sky_blend:s}})(t,e.style.map.transform,e.pixelRatio),a=new Ht(i.LEQUAL,Ht.ReadWrite,[0,1]),s=Vt.disabled,o=e.colorModeForRenderPass(),l=e.useProgram("sky"),h=Sn(r,t);l.draw(r,i.TRIANGLES,a,s,o,zt.disabled,n,null,void 0,"sky",h.vertexBuffer,h.indexBuffer,h.segments)}(this,this.style.sky),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=a.length-1;this.currentLayer>=0;this.currentLayer--){let e=this.style._layers[a[this.currentLayer]],t=o[e.source],r=l[e.source];this._renderTileClippingMasks(e,r,!1),this.renderLayer(this,t,e,r,u)}this.renderPass="translucent";let c=!1;for(this.currentLayer=0;this.currentLayer<a.length;this.currentLayer++){let e=this.style._layers[a[this.currentLayer]],t=o[e.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(e,u))continue;this.opaquePassEnabledForLayer()||c||(c=!0,u.isRenderingGlobe&&!this.style.map.terrain&&this._renderTilesDepthBuffer());let r=("symbol"===e.type?A:h)[e.source];this._renderTileClippingMasks(e,l[e.source],!!this.renderToTexture),this.renderLayer(this,t,e,r,u)}if(u.isRenderingGlobe&&function(e,r,i){let n=e.context,a=n.gl,s=e.useProgram("atmosphere"),o=new Ht(a.LEQUAL,Ht.ReadOnly,[0,1]),l=e.transform,h=function(e,r){let i=e.properties.get("position"),n=[-i.x,-i.y,-i.z],a=t.ag(new Float64Array(16));return"map"===e.properties.get("anchor")&&(t.b6(a,a,r.rollInRadians),t.b7(a,a,-r.pitchInRadians),t.b6(a,a,r.bearingInRadians),t.b7(a,a,r.center.lat*Math.PI/180),t.bz(a,a,-r.center.lng*Math.PI/180)),t.c5(n,n,a),n}(i,e.transform),A=l.getProjectionData({overscaledTileID:null,applyGlobeMatrix:!0,applyTerrainMatrix:!0}),u=r.properties.get("atmosphere-blend")*A.projectionTransition;if(0===u)return;let c=ir(l.worldSize,l.center.lat),d=l.inverseProjectionMatrix,p=new Float64Array(4);p[3]=1,t.aw(p,p,l.modelViewProjectionMatrix),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1,t.aw(p,p,d),p[0]/=p[3],p[1]/=p[3],p[2]/=p[3],p[3]=1;let f=(m=h,y=u,_=[p[0],p[1],p[2]],{u_sun_pos:m,u_atmosphere_blend:y,u_globe_position:_,u_globe_radius:c,u_inv_proj_matrix:d}),g=Sn(n,r);var m,y,_;s.draw(n,a.TRIANGLES,o,Vt.disabled,Ot.alphaBlended,zt.disabled,f,null,null,"atmosphere",g.vertexBuffer,g.indexBuffer,g.segments)}(this,this.style.sky,this.style.light),this.options.showTileBoundaries){let e=function(e,t){let r=null,i=Object.values(e._layers).flatMap((r=>r.source&&!r.isHidden(t)?[e.sourceCaches[r.source]]:[])),n=i.filter((e=>"vector"===e.getSource().type)),a=i.filter((e=>"vector"!==e.getSource().type)),s=e=>{(!r||r.getSource().maxzoom<e.getSource().maxzoom)&&(r=e)};return n.forEach((e=>s(e))),r||a.forEach((e=>s(e))),r}(this.style,this.transform.zoom);e&&function(e,t,r){for(let i=0;i<r.length;i++)Bn(e,t,r[i])}(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){let t=e.transform.padding;wn(e,e.transform.height-(t.top||0),3,gn),wn(e,t.bottom||0,3,mn),bn(e,t.left||0,3,yn),bn(e,e.transform.width-(t.right||0),3,_n);let r=e.transform.centerPoint;var i,n,a,s;i=e,n=r.x,a=e.transform.height-r.y,xn(i,n-1,a-10,2,20,s=vn),xn(i,n-10,a-1,20,2,s)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;let r=this.terrainFacilitator.matrix,i=this.transform.modelViewProjectionMatrix,n=this.terrainFacilitator.dirty;n||(n=e?!t.c8(r,i):!t.c9(r,i)),n||(n=this.style.map.terrain.sourceCache.anyTilesAfterTime(this.terrainFacilitator.renderTime)),n&&(t.ca(r,i),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(e,r){let i=e.context,n=i.gl,a=e.transform,s=Ot.unblended,o=new Ht(n.LEQUAL,Ht.ReadWrite,[0,1]),l=r.sourceCache.getRenderableTiles(),h=e.useProgram("terrainDepth");i.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.bf.transparent,depth:1});for(let e of l){let t=r.getTerrainMesh(e.tileID),l=r.getTerrainData(e.tileID),A=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0}),u={u_ele_delta:r.getMeshFrameDelta(a.zoom)};h.draw(i,n.TRIANGLES,o,Vt.disabled,s,zt.backCCW,u,l,A,"terrain",t.vertexBuffer,t.indexBuffer,t.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain),function(e,r){let i=e.context,n=i.gl,a=e.transform,s=Ot.unblended,o=new Ht(n.LEQUAL,Ht.ReadWrite,[0,1]),l=r.getCoordsTexture(),h=r.sourceCache.getRenderableTiles(),A=e.useProgram("terrainCoords");i.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,e.width/devicePixelRatio,e.height/devicePixelRatio]),i.clear({color:t.bf.transparent,depth:1}),r.coordsIndex=[];for(let e of h){let t=r.getTerrainMesh(e.tileID),h=r.getTerrainData(e.tileID);i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);let u={u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0,u_ele_delta:r.getMeshFrameDelta(a.zoom)},c=a.getProjectionData({overscaledTileID:e.tileID,applyTerrainMatrix:!1,applyGlobeMatrix:!0});A.draw(i,n.TRIANGLES,o,Vt.disabled,s,zt.backCCW,u,h,c,"terrain",t.vertexBuffer,t.indexBuffer,t.segments),r.coordsIndex.push(e.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height])}(this,this.style.map.terrain))}renderLayer(e,r,i,n,a){i.isHidden(this.transform.zoom)||("background"===i.type||"custom"===i.type||(n||[]).length)&&(this.id=i.id,t.cb(i)?function(e,r,i,n,a,s){if("translucent"!==e.renderPass)return;let{isRenderingToTexture:o}=s,l=Vt.disabled,h=e.colorModeForRenderPass();(i._unevaluatedLayout.hasValue("text-variable-anchor")||i._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(e,r,i,n,a,s,o,l,h){let A=r.transform,u=r.style.map.terrain,c="map"===a,d="map"===s;for(let a of e){let e=n.getTile(a),s=e.getBucket(i);if(!s||!s.text||!s.text.segments.get().length)continue;let p=t.an(s.textSizeData,A.zoom),f=t.aC(e,1,r.transform.zoom),g=Se(c,r.transform,f),m="none"!==i.layout.get("icon-text-fit")&&s.hasIconData();if(p){let r=Math.pow(2,A.zoom-e.tileID.overscaledZ),i=u?(e,t)=>u.getElevation(a,e,t):null;Ji(s,c,d,h,A,g,r,p,m,t.aD(A,e,o,l),a.toUnwrapped(),i)}}}(n,e,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),a),0!==i.paint.get("icon-opacity").constantOr(1)&&tn(e,r,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),l,h,o),0!==i.paint.get("text-opacity").constantOr(1)&&tn(e,r,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),l,h,o),r.map.showCollisionBoxes&&(Wi(e,r,i,n,!0),Wi(e,r,i,n,!1))}(e,r,i,n,this.style.placement.variableOffsets,a):t.cc(i)?function(e,r,i,n,a){if("translucent"!==e.renderPass)return;let{isRenderingToTexture:s}=a,o=i.paint.get("circle-opacity"),l=i.paint.get("circle-stroke-width"),h=i.paint.get("circle-stroke-opacity"),A=!i.layout.get("circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===l.constantOr(1)||0===h.constantOr(1)))return;let u=e.context,c=u.gl,d=e.transform,p=e.getDepthModeForSublayer(0,Ht.ReadOnly),f=Vt.disabled,g=e.colorModeForRenderPass(),m=[],y=d.getCircleRadiusCorrection();for(let a=0;a<n.length;a++){let o=n[a],l=r.getTile(o),h=l.getBucket(i);if(!h)continue;let u=i.paint.get("circle-translate"),c=i.paint.get("circle-translate-anchor"),p=t.aD(d,l,u,c),f=h.programConfigurations.get(i.id),g=e.useProgram("circle",f),_=h.layoutVertexBuffer,v=h.indexBuffer,w=e.style.map.terrain&&e.style.map.terrain.getTerrainData(o),b={programConfiguration:f,program:g,layoutVertexBuffer:_,indexBuffer:v,uniformValues:Ur(e,l,i,p,y),terrainData:w,projectionData:d.getProjectionData({overscaledTileID:o,applyGlobeMatrix:!s,applyTerrainMatrix:!0})};if(A){let e=h.segments.get();for(let r of e)m.push({segments:new t.aM([r]),sortKey:r.sortKey,state:b})}else m.push({segments:h.segments,sortKey:0,state:b})}A&&m.sort(((e,t)=>e.sortKey-t.sortKey));for(let t of m){let{programConfiguration:r,program:n,layoutVertexBuffer:a,indexBuffer:s,uniformValues:o,terrainData:l,projectionData:h}=t.state;n.draw(u,c.TRIANGLES,p,f,g,zt.backCCW,o,l,h,i.id,a,s,t.segments,i.paint,e.transform.zoom,r)}}(e,r,i,n,a):t.cd(i)?function(e,r,i,n,a){if(0===i.paint.get("heatmap-opacity"))return;let s=e.context,{isRenderingToTexture:o,isRenderingGlobe:l}=a;if(e.style.map.terrain){for(let t of n){let n=r.getTile(t);r.hasRenderableParent(t)||("offscreen"===e.renderPass?nn(e,n,i,t,l):"translucent"===e.renderPass&&an(e,i,t,o,l))}s.viewport.set([0,0,e.width,e.height])}else"offscreen"===e.renderPass?function(e,r,i,n){let a=e.context,s=a.gl,o=e.transform,l=Vt.disabled,h=new Ot([s.ONE,s.ONE],t.bf.transparent,[!0,!0,!0,!0]);(function(e,r,i){let n=e.gl;e.activeTexture.set(n.TEXTURE1),e.viewport.set([0,0,r.width/4,r.height/4]);let a=i.heatmapFbos.get(t.c2);a?(n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),e.bindFramebuffer.set(a.framebuffer)):(a=sn(e,r.width/4,r.height/4),i.heatmapFbos.set(t.c2,a))})(a,e,i),a.clear({color:t.bf.transparent});for(let t=0;t<n.length;t++){let A=n[t];if(r.hasRenderableParent(A))continue;let u=r.getTile(A),c=u.getBucket(i);if(!c)continue;let d=c.programConfigurations.get(i.id),p=e.useProgram("heatmap",d),f=o.getProjectionData({overscaledTileID:A,applyGlobeMatrix:!0,applyTerrainMatrix:!1}),g=o.getCircleRadiusCorrection();p.draw(a,s.TRIANGLES,Ht.disabled,l,h,zt.backCCW,Or(u,o.zoom,i.paint.get("heatmap-intensity"),g),null,f,i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,o.zoom,d)}a.viewport.set([0,0,e.width,e.height])}(e,r,i,n):"translucent"===e.renderPass&&function(e,r){let i=e.context,n=i.gl;i.setColorMode(e.colorModeForRenderPass());let a=r.heatmapFbos.get(t.c2);a&&(i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,a.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1),on(i,r).bind(n.LINEAR,n.CLAMP_TO_EDGE),e.useProgram("heatmapTexture").draw(i,n.TRIANGLES,Ht.disabled,Vt.disabled,e.colorModeForRenderPass(),zt.disabled,Qr(e,r,0,1),null,null,r.id,e.viewportBuffer,e.quadTriangleIndexBuffer,e.viewportSegments,r.paint,e.transform.zoom))}(e,i)}(e,r,i,n,a):t.ce(i)?function(e,r,i,n,a){if("translucent"!==e.renderPass)return;let{isRenderingToTexture:s}=a,o=i.paint.get("line-opacity"),l=i.paint.get("line-width");if(0===o.constantOr(1)||0===l.constantOr(1))return;let h=e.getDepthModeForSublayer(0,Ht.ReadOnly),A=e.colorModeForRenderPass(),u=i.paint.get("line-dasharray"),c=u.constantOr(1),d=i.paint.get("line-pattern"),p=d.constantOr(1),f=i.paint.get("line-gradient"),g=i.getCrossfadeParameters(),m=p?"linePattern":c?"lineSDF":f?"lineGradient":"line",y=e.context,_=y.gl,v=e.transform,w=!0;for(let a of n){let n=r.getTile(a);if(p&&!n.patternsLoaded())continue;let o=n.getBucket(i);if(!o)continue;let l=o.programConfigurations.get(i.id),b=e.context.program.get(),x=e.useProgram(m,l),B=w||x.program!==b,C=e.style.map.terrain&&e.style.map.terrain.getTerrainData(a),S=d.constantOr(null),E=u&&u.constantOr(null);if(S&&n.imageAtlas){let e=n.imageAtlas,t=e.patternPositions[S.to.toString()],r=e.patternPositions[S.from.toString()];t&&r&&l.setConstantPatternPositions(t,r)}else if(E){let t="round"===i.layout.get("line-cap"),r=e.lineAtlas.getDash(E.to,t),n=e.lineAtlas.getDash(E.from,t);l.setConstantDashPositions(r,n)}let I=v.getProjectionData({overscaledTileID:a,applyGlobeMatrix:!s,applyTerrainMatrix:!0}),T=v.getPixelScale(),F=p?qr(e,n,i,T,g):c?Zr(e,n,i,T,g):f?Kr(e,n,i,T,o.lineClipsArray.length):Gr(e,n,i,T);if(p)y.activeTexture.set(_.TEXTURE0),n.imageAtlasTexture.bind(_.LINEAR,_.CLAMP_TO_EDGE),l.updatePaintBuffers(g);else if(c)(B||e.lineAtlas.dirty)&&(y.activeTexture.set(_.TEXTURE0),e.lineAtlas.bind(y)),l.updatePaintBuffers(g);else if(f){let n=o.gradients[i.id],s=n.texture;if(i.gradientVersion!==n.version){let l=256;if(i.stepInterpolant){let i=r.getSource().maxzoom,n=a.canonical.z===i?Math.ceil(1<<e.transform.maxZoom-a.canonical.z):1;l=t.ah(t.c3(o.maxLineLength/t.$*1024*n),256,y.maxTextureSize)}n.gradient=t.c4({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:l,image:n.gradient||void 0,clips:o.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new t.T(y,n.gradient,_.RGBA),n.version=i.gradientVersion,s=n.texture}y.activeTexture.set(_.TEXTURE0),s.bind(i.stepInterpolant?_.NEAREST:_.LINEAR,_.CLAMP_TO_EDGE)}let P=e.stencilModeForClipping(a);x.draw(y,_.TRIANGLES,h,P,A,zt.disabled,F,C,I,i.id,o.layoutVertexBuffer,o.indexBuffer,o.segments,i.paint,e.transform.zoom,l,o.layoutVertexBuffer2),w=!1}}(e,r,i,n,a):t.cf(i)?function(e,r,i,n,a){let s=i.paint.get("fill-color"),o=i.paint.get("fill-opacity");if(0===o.constantOr(1))return;let{isRenderingToTexture:l}=a,h=e.colorModeForRenderPass(),A=i.paint.get("fill-pattern"),u=e.opaquePassEnabledForLayer()&&!A.constantOr(1)&&1===s.constantOr(t.bf.transparent).a&&1===o.constantOr(0)?"opaque":"translucent";if(e.renderPass===u){let t=e.getDepthModeForSublayer(1,"opaque"===e.renderPass?Ht.ReadWrite:Ht.ReadOnly);hn(e,r,i,n,t,h,!1,l)}if("translucent"===e.renderPass&&i.paint.get("fill-antialias")){let t=e.getDepthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,Ht.ReadOnly);hn(e,r,i,n,t,h,!0,l)}}(e,r,i,n,a):t.cg(i)?function(e,t,r,i,n){let a=r.paint.get("fill-extrusion-opacity");if(0===a)return;let{isRenderingToTexture:s}=n;if("translucent"===e.renderPass){let n=new Ht(e.context.gl.LEQUAL,Ht.ReadWrite,e.depthRangeFor3D);if(1!==a||r.paint.get("fill-extrusion-pattern").constantOr(1))An(e,t,r,i,n,Vt.disabled,Ot.disabled,s),An(e,t,r,i,n,e.stencilModeFor3D(),e.colorModeForRenderPass(),s);else{let a=e.colorModeForRenderPass();An(e,t,r,i,n,Vt.disabled,a,s)}}}(e,r,i,n,a):t.ch(i)?function(e,r,i,n,a){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;let{isRenderingToTexture:s}=a,o=e.context,l=e.style.projection.useSubdivision,h=e.getDepthModeForSublayer(0,Ht.ReadOnly),A=e.colorModeForRenderPass();if("offscreen"===e.renderPass)(function(e,r,i,n,a,s,o){let l=e.context,h=l.gl;for(let A of i){let i=r.getTile(A),u=i.dem;if(!u||!u.data||!i.needsHillshadePrepare)continue;let c=u.dim,d=u.stride,p=u.getPixels();if(l.activeTexture.set(h.TEXTURE1),l.pixelStoreUnpackPremultiplyAlpha.set(!1),i.demTexture=i.demTexture||e.getTileTexture(d),i.demTexture){let e=i.demTexture;e.update(p,{premultiply:!1}),e.bind(h.NEAREST,h.CLAMP_TO_EDGE)}else i.demTexture=new t.T(l,p,h.RGBA,{premultiply:!1}),i.demTexture.bind(h.NEAREST,h.CLAMP_TO_EDGE);l.activeTexture.set(h.TEXTURE0);let f=i.fbo;if(!f){let e=new t.T(l,{width:c,height:c,data:null},h.RGBA);e.bind(h.LINEAR,h.CLAMP_TO_EDGE),f=i.fbo=l.createFramebuffer(c,c,!0,!1),f.colorAttachment.set(e.texture)}l.bindFramebuffer.set(f.framebuffer),l.viewport.set([0,0,c,c]),e.useProgram("hillshadePrepare").draw(l,h.TRIANGLES,a,s,o,zt.disabled,Hr(i.tileID,u),null,null,n.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments),i.needsHillshadePrepare=!1}})(e,r,n,i,h,Vt.disabled,A),o.viewport.set([0,0,e.width,e.height]);else if("translucent"===e.renderPass)if(l){let[t,a,o]=e.stencilConfigForOverlapTwoPass(n);un(e,r,i,o,t,h,A,!1,s),un(e,r,i,o,a,h,A,!0,s)}else{let[t,a]=e.getStencilConfigForOverlapAndUpdateStencilID(n);un(e,r,i,a,t,h,A,!1,s)}}(e,r,i,n,a):t.ci(i)?function(e,t,r,i,n){if("translucent"!==e.renderPass||!i.length)return;let{isRenderingToTexture:a}=n,s=e.style.projection.useSubdivision,o=e.getDepthModeForSublayer(0,Ht.ReadOnly),l=e.colorModeForRenderPass();if(s){let[n,s,h]=e.stencilConfigForOverlapTwoPass(i);cn(e,t,r,h,n,o,l,!1,a),cn(e,t,r,h,s,o,l,!0,a)}else{let[n,s]=e.getStencilConfigForOverlapAndUpdateStencilID(i);cn(e,t,r,s,n,o,l,!1,a)}}(e,r,i,n,a):t.cj(i)?function(e,t,r,i,n){if("translucent"!==e.renderPass||0===r.paint.get("raster-opacity")||!i.length)return;let{isRenderingToTexture:a}=n,s=t.getSource(),o=e.style.projection.useSubdivision;if(s instanceof W)pn(e,t,r,i,null,!1,!1,s.tileCoords,s.flippedWindingOrder,a);else if(o){let[n,s,o]=e.stencilConfigForOverlapTwoPass(i);pn(e,t,r,o,n,!1,!0,dn,!1,a),pn(e,t,r,o,s,!0,!0,dn,!1,a)}else{let[n,s]=e.getStencilConfigForOverlapAndUpdateStencilID(i);pn(e,t,r,s,n,!1,!0,dn,!1,a)}}(e,r,i,n,a):t.ck(i)?function(e,t,r,i,n){let a=r.paint.get("background-color"),s=r.paint.get("background-opacity");if(0===s)return;let{isRenderingToTexture:o}=n,l=e.context,h=l.gl,A=e.style.projection,u=e.transform,c=u.tileSize,d=r.paint.get("background-pattern");if(e.isPatternMissing(d))return;let p=!d&&1===a.a&&1===s&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==p)return;let f=Vt.disabled,g=e.getDepthModeForSublayer(0,"opaque"===p?Ht.ReadWrite:Ht.ReadOnly),m=e.colorModeForRenderPass(),y=e.useProgram(d?"backgroundPattern":"background"),_=i||ye(u,{tileSize:c,terrain:e.style.map.terrain});d&&(l.activeTexture.set(h.TEXTURE0),e.imageManager.bind(e.context));let v=r.getCrossfadeParameters();for(let t of _){let i=u.getProjectionData({overscaledTileID:t,applyGlobeMatrix:!o,applyTerrainMatrix:!0}),n=d?ii(s,e,d,{tileID:t,tileSize:c},v):ri(s,a),p=e.style.map.terrain&&e.style.map.terrain.getTerrainData(t),_=A.getMeshFromTileID(l,t.canonical,!1,!0,"raster");y.draw(l,h.TRIANGLES,g,f,m,zt.backCCW,n,p,i,r.id,_.vertexBuffer,_.indexBuffer,_.segments)}}(e,0,i,n,a):t.cl(i)&&function(e,t,r,i){let{isRenderingGlobe:n}=i,a=e.context,s=r.implementation,o=e.style.projection,l=e.transform,h=l.getProjectionDataForCustomLayer(n),A={farZ:l.farZ,nearZ:l.nearZ,fov:l.fov*Math.PI/180,modelViewProjectionMatrix:l.modelViewProjectionMatrix,projectionMatrix:l.projectionMatrix,shaderData:{variantName:o.shaderVariantName,vertexShaderPrelude:`const float PI = 3.141592653589793;\nuniform mat4 u_projection_matrix;\n${o.shaderPreludeCode.vertexSource}`,define:o.shaderDefine},defaultProjectionData:h},u=s.renderingMode?s.renderingMode:"2d";if("offscreen"===e.renderPass){let t=s.prerender;t&&(e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),t.call(s,a.gl,A),a.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),a.setColorMode(e.colorModeForRenderPass()),a.setStencilMode(Vt.disabled);let t="3d"===u?e.getDepthModeFor3D():e.getDepthModeForSublayer(0,Ht.ReadOnly);a.setDepthMode(t),s.render(a.gl,A),a.setDirty(),e.setBaseState(),a.bindFramebuffer.set(null)}}(e,0,i,a))}saveTileTexture(e){let t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){let t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;let t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t,r=!1,i=[]){this.cache=this.cache||{};let n=!!this.style.map.terrain,a=this.style.projection,s=r?vt.projectionMercator:a.shaderPreludeCode,o=r?Bt:a.shaderDefine,l=e+(t?t.cacheKey:"")+`/${r?Ct:a.shaderVariantName}`+(this._showOverdrawInspector?"/overdraw":"")+(n?"/terrain":"")+(i?`/${i.join("/")}`:"");return this.cache[l]||(this.cache[l]=new Ir(this.context,vt[e],t,ai[e],this._showOverdrawInspector,n,s,o,i)),this.cache[l]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){let e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.T(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){let{drawingBufferWidth:e,drawingBufferHeight:t}=this.context.gl;return this.width!==e||this.height!==t}}function In(e,t){let r,i=!1,n=null,a=null,s=()=>{n=null,i&&(e.apply(a,r),n=setTimeout(s,t),i=!1)};return(...e)=>(i=!0,a=this,r=e,n||s(),n)}class Tn{constructor(e){this._getCurrentHash=()=>{let e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")},this._onHashChange=()=>{let e=this._getCurrentHash();if(!this._isValidHash(e))return!1;let t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0},this._updateHashUnthrottled=()=>{let e=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,e)},this._removeHash=()=>{let e=this._getCurrentHash();if(0===e.length)return;let t=e.join("/"),r=t;r.split("&").length>0&&(r=r.split("&")[0]),this._hashName&&(r=`${this._hashName}=${t}`);let i=window.location.hash.replace(r,"");i.startsWith("#&")?i=i.slice(0,1)+i.slice(2):"#"===i&&(i="");let n=window.location.href.replace(/(#.+)?$/,i);n=n.replace("&&","&"),window.history.replaceState(window.history.state,null,n)},this._updateHash=In(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){let t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),a=Math.round(t.lng*n)/n,s=Math.round(t.lat*n)/n,o=this._map.getBearing(),l=this._map.getPitch(),h="";if(h+=e?`/${a}/${s}/${r}`:`${r}/${s}/${a}`,(o||l)&&(h+="/"+Math.round(10*o)/10),l&&(h+=`/${Math.round(l)}`),this._hashName){let e=this._hashName,t=!1,r=window.location.hash.slice(1).split("&").map((r=>{let i=r.split("=")[0];return i===e?(t=!0,`${i}=${h}`):r})).filter((e=>e));return t||r.push(`${e}=${h}`),`#${r.join("&")}`}return`#${h}`}_isValidHash(e){if(e.length<3||e.some(isNaN))return!1;try{new t.S(+e[2],+e[1])}catch{return!1}let r=+e[0],i=+(e[3]||0),n=+(e[4]||0);return r>=this._map.getMinZoom()&&r<=this._map.getMaxZoom()&&i>=-180&&i<=180&&n>=this._map.getMinPitch()&&n<=this._map.getMaxPitch()}}let Fn={linearity:.3,easing:t.cm(0,0,.3,1)},Pn=t.e({deceleration:2500,maxSpeed:1400},Fn),Ln=t.e({deceleration:20,maxSpeed:1400},Fn),Mn=t.e({deceleration:1e3,maxSpeed:360},Fn),kn=t.e({deceleration:1e3,maxSpeed:90},Fn),Un=t.e({deceleration:1e3,maxSpeed:360},Fn);class Rn{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:s.now(),settings:e})}_drainInertiaBuffer(){let e=this._inertiaBuffer,t=s.now();for(;e.length>0&&t-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;let r={zoom:0,bearing:0,pitch:0,roll:0,pan:new t.P(0,0),pinchAround:void 0,around:void 0};for(let{settings:e}of this._inertiaBuffer)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,r.roll+=e.rollDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);let i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(r.pan.mag()){let a=Nn(r.pan.mag(),i,t.e({},Pn,e||{})),s=r.pan.mult(a.amount/r.pan.mag()),o=this._map.cameraHelper.handlePanInertia(s,this._map.transform);n.center=o.easingCenter,n.offset=o.easingOffset,Dn(n,a)}if(r.zoom){let e=Nn(r.zoom,i,Ln);n.zoom=this._map.transform.zoom+e.amount,Dn(n,e)}if(r.bearing){let e=Nn(r.bearing,i,Mn);n.bearing=this._map.transform.bearing+t.ah(e.amount,-179,179),Dn(n,e)}if(r.pitch){let e=Nn(r.pitch,i,kn);n.pitch=this._map.transform.pitch+e.amount,Dn(n,e)}if(r.roll){let e=Nn(r.roll,i,Un);n.roll=this._map.transform.roll+t.ah(e.amount,-179,179),Dn(n,e)}if(n.zoom||n.bearing){let e=void 0===r.pinchAround?r.around:r.pinchAround;n.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),t.e(n,{noMoveStart:!0})}}function Dn(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function Nn(e,r,i){let{maxSpeed:n,linearity:a,deceleration:s}=i,o=t.ah(e*a/(r/1e3),-n,n),l=Math.abs(o)/(s*a);return{easing:i.easing,duration:1e3*l,amount:o*(l/2)}}class On extends t.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,i,n={}){i=i instanceof MouseEvent?i:new MouseEvent(e,i);let a=o.mousePos(r.getCanvas(),i),s=r.unproject(a);super(e,t.e({point:a,lngLat:s,originalEvent:i},n)),this._defaultPrevented=!1,this.target=r}}class Qn extends t.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,r,i){let n="touchend"===e?i.changedTouches:i.touches,a=o.touchPos(r.getCanvasContainer(),n),s=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,i)=>e.add(t.div(i.length))),new t.P(0,0));super(e,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:i}),this._defaultPrevented=!1}}class zn extends t.l{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}}class Hn{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new zn(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new On(e.type,this._map,e))}mouseup(e){this._map.fire(new On(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new On(e.type,this._map,e))}dblclick(e){return this._firePreventable(new On(e.type,this._map,e))}mouseover(e){this._map.fire(new On(e.type,this._map,e))}mouseout(e){this._map.fire(new On(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Qn(e.type,this._map,e))}touchmove(e){this._map.fire(new Qn(e.type,this._map,e))}touchend(e){this._map.fire(new Qn(e.type,this._map,e))}touchcancel(e){this._map.fire(new Qn(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class jn{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new On(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new On("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new On(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Vn{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.screenPointToLocation(t.P.convert(e),this._map.terrain)}}class Gn{constructor(e,t){this._map=e,this._tr=new Vn(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;let r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;let i=this._startPos;this._lastPos=r,this._box||(this._box=o.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));let n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),s=Math.min(i.y,r.y),l=Math.max(i.y,r.y);o.setTransform(this._box,`translate(${n}px,${s}px)`),this._box.style.width=a-n+"px",this._box.style.height=l-s+"px"}mouseupWindow(e,r){if(!this._active||0!==e.button)return;let i=this._startPos,n=r;if(this.reset(),o.suppressClick(),i.x!==n.x||i.y!==n.y)return this._map.fire(new t.l("boxzoomend",{originalEvent:e})),{cameraAnimation:e=>e.fitScreenCoordinates(i,n,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,r){return this._map.fire(new t.l(e,{originalEvent:r}))}}function Kn(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);let r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}class qn{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){let r=new t.P(0,0);for(let t of e)r._add(t);return r.div(e.length)}(r),this.touches=Kn(i,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;let i=Kn(r,t);for(let e in this.touches){let t=i[e];(!t||t.dist(this.touches[e])>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){let e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class Zn{constructor(e){this.singleTap=new qn(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){let i=this.singleTap.touchend(e,t,r);if(i){let t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(i)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}class Wn{constructor(e){this._tr=new Vn(e),this._zoomIn=new Zn({numTouches:1,numTaps:2}),this._zoomOut=new Zn({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){let i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r),a=this._tr;return i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom+1,around:a.unproject(i)},{originalEvent:e})}):n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:a.zoom-1,around:a.unproject(n)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $n{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){let t=this._moveFunction(...e);if(t.bearingDelta||t.pitchDelta||t.rollDelta||t.around||t.panDelta)return this._active=!0,t}dragStart(e,t){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=Array.isArray(t)?t[0]:t,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,t){if(!this.isEnabled())return;let r=this._lastPoint;if(!r)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);let i=Array.isArray(t)?t[0]:t;return!this._moved&&i.dist(r)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=i,this._move(r,i))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&o.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}let Xn=0,Yn=2,Jn={[Xn]:1,[Yn]:2};class ea{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){let t=o.mouseButton(e);this._eventButton=t}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(e,t){let r=Jn[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton)}isValidEndEvent(e){return o.mouseButton(e)===this._eventButton}}class ta{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return 1===e.targetTouches.length}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}class ra{constructor(e=new ea({checkCorrectEvent:()=>!0}),t=new ta){this.mouseMoveStateManager=e,this.oneFingerTouchMoveStateManager=t}_executeRelevantHandler(e,t,r){return e instanceof MouseEvent?t(e):typeof TouchEvent<"u"&&e instanceof TouchEvent?r(e):void 0}startMove(e){this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.startMove(e)),(e=>this.oneFingerTouchMoveStateManager.startMove(e)))}endMove(e){this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.endMove(e)),(e=>this.oneFingerTouchMoveStateManager.endMove(e)))}isValidStartEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidStartEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidStartEvent(e)))}isValidMoveEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidMoveEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidMoveEvent(e)))}isValidEndEvent(e){return this._executeRelevantHandler(e,(e=>this.mouseMoveStateManager.isValidEndEvent(e)),(e=>this.oneFingerTouchMoveStateManager.isValidEndEvent(e)))}}let ia=e=>{e.mousedown=e.dragStart,e.mousemoveWindow=e.dragMove,e.mouseup=e.dragEnd,e.contextmenu=e=>{e.preventDefault()}};class na{constructor(e,t){this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new t.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._active){if(!this._shouldBePrevented(r.length))return e.preventDefault(),this._calculateTransform(e,t,r);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&this._shouldBePrevented(r.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,r,i){i.length>0&&(this._active=!0);let n=Kn(i,r),a=new t.P(0,0),s=new t.P(0,0),o=0;for(let e in n){let t=n[e],r=this._touches[e];r&&(a._add(t),s._add(t.sub(r)),o++,n[e]=t)}if(this._touches=n,this._shouldBePrevented(o)||!s.mag())return;let l=s.div(o);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:a.div(o),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class aa{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();let[i,n]=this._firstTwoTouches,a=sa(r,t,i),s=sa(r,t,n);if(!a||!s)return;let o=this._aroundCenter?null:a.add(s).div(2);return this._move([a,s],o,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;let[i,n]=this._firstTwoTouches,a=sa(r,t,i),s=sa(r,t,n);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function sa(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}function oa(e,t){return Math.log(e/t)/Math.LN2}class la extends aa{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){let r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(oa(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:oa(this._distance,r),pinchAround:t}}}function ha(e,t){return 180*e.angleWith(t)/Math.PI}class Aa extends aa{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t,r){let i=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ha(this._vector,i),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());let t=25/(Math.PI*this._minDiameter)*360,r=ha(e,this._startVector);return Math.abs(r)<t}}function ua(e){return Math.abs(e.y)>Math.abs(e.x)}class ca extends aa{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,ua(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;let i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;let i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;let a=e.y>0==t.y>0;return ua(e)&&ua(t)&&a}}let da={panStep:100,bearingStep:15,pitchStep:10};class pa{constructor(e){this._tr=new Vn(e);let t=da;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,a=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),a=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:s=>{let o=this._tr;s.easeTo({duration:300,easeId:"keyboardHandler",easing:fa,zoom:t?Math.round(o.zoom)+t*(e.shiftKey?2:1):o.zoom,bearing:o.bearing+r*this._bearingStep,pitch:o.pitch+i*this._pitchStep,offset:[-n*this._panStep,-a*this._panStep],center:o.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function fa(e){return e*(2-e)}let ga=4.000244140625,ma=1/450;class ya{constructor(e,t){this._onTimeout=e=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)},this._map=e,this._tr=new Vn(e),this._triggerRenderFrame=t,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=ma}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let t=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,r=s.now(),i=r-(this._lastWheelEventTime||0);this._lastWheelEventTime=r,0!==t&&t%ga==0?this._type="wheel":0!==t&&Math.abs(t)<4?this._type="trackpad":i>400?(this._type=null,this._lastValue=t,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(i*t)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,t+=this._lastValue)),e.shiftKey&&t&&(t/=4),this._type&&(this._lastWheelEvent=e,this._delta-=t,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);let r=o.mousePos(this._map.getCanvas(),e),i=this._tr;this._aroundPoint=this._aroundCenter?i.transform.locationToScreenPoint(t.S.convert(i.center)):r,this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;let e=this._tr.transform;if("number"==typeof this._lastExpectedZoom){let t=e.zoom-this._lastExpectedZoom;"number"==typeof this._startZoom&&(this._startZoom+=t),"number"==typeof this._targetZoom&&(this._targetZoom+=t)}if(0!==this._delta){let r="wheel"===this._type&&Math.abs(this._delta)>ga?this._wheelZoomRate:this._defaultZoomRate,i=2/(1+Math.exp(-Math.abs(this._delta*r)));this._delta<0&&0!==i&&(i=1/i);let n="number"!=typeof this._targetZoom?e.scale:t.af(this._targetZoom);this._targetZoom=e.getConstrained(e.getCameraLngLat(),t.ak(n*i)).zoom,"wheel"===this._type&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}let r,i="number"!=typeof this._targetZoom?e.zoom:this._targetZoom,n=this._startZoom,a=this._easing,o=!1;if("wheel"===this._type&&n&&a){let e=s.now()-this._lastWheelEventTime,l=Math.min((e+5)/200,1),h=a(l);r=t.C.number(n,i,h),l<1?this._frameId||(this._frameId=!0):o=!0}else r=i,o=!0;return this._active=!0,o&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._lastExpectedZoom,delete this._finishTimeout}),200)),this._lastExpectedZoom=r,{noInertia:!0,needsRenderFrame:!o,zoomDelta:r-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let r=t.co;if(this._prevEase){let e=this._prevEase,i=(s.now()-e.start)/e.duration,n=e.easing(i+.01)-e.easing(i),a=.27/Math.sqrt(n*n+1e-4)*.01,o=Math.sqrt(.0729-a*a);r=t.cm(a,o,.25,1)}return this._prevEase={start:s.now(),duration:e,easing:r},r}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,delete this._lastExpectedZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class _a{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class va{constructor(e){this._tr=new Vn(e),this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class wa{constructor(){this._tap=new Zn({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,t,r){if(!this._swipePoint)if(this._tapTime){let i=t[0],n=e.timeStamp-this._tapTime<500,a=this._tapPoint.dist(i)<30;n&&a?r.length>0&&(this._swipePoint=i,this._swipeTouch=r[0].identifier):this.reset()}else this._tap.touchstart(e,t,r)}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;let i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){if(this._tapTime)this._swipePoint&&0===r.length&&this.reset();else{let i=this._tap.touchend(e,t,r);i&&(this._tapTime=e.timeStamp,this._tapPoint=i)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ba{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class xa{constructor(e,t,r,i){this._pitchWithRotate=e.pitchWithRotate,this._rollEnabled=e.rollEnabled,this._mouseRotate=t,this._mousePitch=r,this._mouseRoll=i}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable(),this._rollEnabled&&this._mouseRoll.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable(),this._mouseRoll.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())&&(!this._rollEnabled||this._mouseRoll.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()||this._mouseRoll.isActive()}}class Ba{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class Ca{constructor(e,t){this._bypassKey=-1!==navigator.userAgent.indexOf("Mac")?"metaKey":"ctrlKey",this._map=e,this._options=t,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;let e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=o.create("div","maplibregl-cooperative-gesture-screen",e);let t=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");"metaKey"===this._bypassKey&&(t=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));let r=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),i=document.createElement("div");i.className="maplibregl-desktop-message",i.textContent=t,this._container.appendChild(i);let n=document.createElement("div");n.className="maplibregl-mobile-message",n.textContent=r,this._container.appendChild(n),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(o.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,r){this._enabled&&(this._map.fire(new t.l("cooperativegestureprevented",{gestureType:e,originalEvent:r})),this._container.classList.add("maplibregl-show"),setTimeout((()=>{this._container.classList.remove("maplibregl-show")}),100))}}let Sa=e=>e.zoom||e.drag||e.roll||e.pitch||e.rotate;class Ea extends t.l{}function Ia(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta||e.rollDelta}class Ta{constructor(e,r){this.handleWindowEvent=e=>{this.handleEvent(e,`${e.type}Window`)},this.handleEvent=(e,r)=>{if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;let i="renderFrame"===e.type?void 0:e,n={needsRenderFrame:!1},a={},s={};for(let{handlerName:l,handler:h,allowed:A}of this._handlers){if(!h.isEnabled())continue;let u;if(this._blockedByActive(s,A,l))h.reset();else if(h[r||e.type]){if(t.cp(e,r||e.type)){let t=o.mousePos(this._map.getCanvas(),e);u=h[r||e.type](e,t)}else if(t.cq(e,r||e.type)){let t=this._getMapTouches(e.touches),i=o.touchPos(this._map.getCanvas(),t);u=h[r||e.type](e,i,t)}else t.cr(r||e.type)||(u=h[r||e.type](e));this.mergeHandlerResult(n,a,u,l,i),u&&u.needsRenderFrame&&this._triggerRenderFrame()}(u||h.isActive())&&(s[l]=h)}let l={};for(let e in this._previousActiveHandlers)s[e]||(l[e]=i);this._previousActiveHandlers=s,(Object.keys(l).length||Ia(n))&&(this._changes.push([n,a,l]),this._triggerRenderFrame()),(Object.keys(s).length||Ia(n))&&this._map._stop(!0),this._updatingCamera=!1;let{cameraAnimation:h}=n;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Rn(e),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r);let i=this._el;this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[window,"blur",void 0]];for(let[e,t,r]of this._listeners)o.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(let[e,t,r]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){let r=this._map,i=r.getCanvasContainer();this._add("mapEvent",new Hn(r,e));let n=r.boxZoom=new Gn(r,e);this._add("boxZoom",n),e.interactive&&e.boxZoom&&n.enable();let a=r.cooperativeGestures=new Ca(r,e.cooperativeGestures);this._add("cooperativeGestures",a),e.cooperativeGestures&&a.enable();let s=new Wn(r),l=new va(r);r.doubleClickZoom=new _a(l,s),this._add("tapZoom",s),this._add("clickZoom",l),e.interactive&&e.doubleClickZoom&&r.doubleClickZoom.enable();let h=new wa;this._add("tapDragZoom",h);let A=r.touchPitch=new ca(r);this._add("touchPitch",A),e.interactive&&e.touchPitch&&r.touchPitch.enable(e.touchPitch);let u=()=>r.project(r.getCenter()),c=function({enable:e,clickTolerance:r,aroundCenter:i=!0,minPixelCenterThreshold:n=100,rotateDegreesPerPixelMoved:a=.8},s){let l=new ea({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)&&!e.ctrlKey});return new $n({clickTolerance:r,move:(e,r)=>{let o=s();if(i&&Math.abs(o.y-e.y)>n)return{bearingDelta:t.cn(new t.P(e.x,r.y),r,o)};let l=(r.x-e.x)*a;return i&&r.y<o.y&&(l=-l),{bearingDelta:l}},moveStateManager:l,enable:e,assignEvents:ia})}(e,u),d=function({enable:e,clickTolerance:t,pitchDegreesPerPixelMoved:r=-.5}){let i=new ea({checkCorrectEvent:e=>0===o.mouseButton(e)&&e.ctrlKey||2===o.mouseButton(e)});return new $n({clickTolerance:t,move:(e,t)=>({pitchDelta:(t.y-e.y)*r}),moveStateManager:i,enable:e,assignEvents:ia})}(e),p=function({enable:e,clickTolerance:t,rollDegreesPerPixelMoved:r=.3},i){let n=new ea({checkCorrectEvent:e=>2===o.mouseButton(e)&&e.ctrlKey});return new $n({clickTolerance:t,move:(e,t)=>{let n=i(),a=(t.x-e.x)*r;return t.y<n.y&&(a=-a),{rollDelta:a}},moveStateManager:n,enable:e,assignEvents:ia})}(e,u);r.dragRotate=new xa(e,c,d,p),this._add("mouseRotate",c,["mousePitch"]),this._add("mousePitch",d,["mouseRotate","mouseRoll"]),this._add("mouseRoll",p,["mousePitch"]),e.interactive&&e.dragRotate&&r.dragRotate.enable();let f=function({enable:e,clickTolerance:t}){let r=new ea({checkCorrectEvent:e=>0===o.mouseButton(e)&&!e.ctrlKey});return new $n({clickTolerance:t,move:(e,t)=>({around:t,panDelta:t.sub(e)}),activateOnStart:!0,moveStateManager:r,enable:e,assignEvents:ia})}(e),g=new na(e,r);r.dragPan=new ba(i,f,g),this._add("mousePan",f),this._add("touchPan",g,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&r.dragPan.enable(e.dragPan);let m=new Aa,y=new la;r.touchZoomRotate=new Ba(i,y,m,h),this._add("touchRotate",m,["touchPan","touchZoom"]),this._add("touchZoom",y,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&r.touchZoomRotate.enable(e.touchZoomRotate);let _=r.scrollZoom=new ya(r,(()=>this._triggerRenderFrame()));this._add("scrollZoom",_,["mousePan"]),e.interactive&&e.scrollZoom&&r.scrollZoom.enable(e.scrollZoom);let v=r.keyboard=new pa(r);this._add("keyboard",v),e.interactive&&e.keyboard&&r.keyboard.enable(),this._add("blockableMapEvent",new jn(r))}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(let{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(let{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Sa(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,t,r){for(let i in e)if(i!==r&&(!t||t.indexOf(i)<0))return!0;return!1}_getMapTouches(e){let t=[];for(let r of e)this._el.contains(r.target)&&t.push(r);return t}mergeHandlerResult(e,r,i,n,a){if(!i)return;t.e(e,i);let s={handlerName:n,originalEvent:i.originalEvent||a};void 0!==i.zoomDelta&&(r.zoom=s),void 0!==i.panDelta&&(r.drag=s),void 0!==i.rollDelta&&(r.roll=s),void 0!==i.pitchDelta&&(r.pitch=s),void 0!==i.bearingDelta&&(r.rotate=s)}_applyChanges(){let e={},r={},i={};for(let[n,a,s]of this._changes)n.panDelta&&(e.panDelta=(e.panDelta||new t.P(0,0))._add(n.panDelta)),n.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+n.pitchDelta),n.rollDelta&&(e.rollDelta=(e.rollDelta||0)+n.rollDelta),void 0!==n.around&&(e.around=n.around),void 0!==n.pinchAround&&(e.pinchAround=n.pinchAround),n.noInertia&&(e.noInertia=n.noInertia),t.e(r,a),t.e(i,s);this._updateMapTransform(e,r,i),this._changes=[]}_updateMapTransform(e,t,r){let i=this._map,n=i._getTransformForUpdate(),a=i.terrain;if(!(Ia(e)||a&&this._terrainMovement))return this._fireEvents(t,r,!0);i._stop(!0);let{panDelta:s,zoomDelta:o,bearingDelta:l,pitchDelta:h,rollDelta:A,around:u,pinchAround:c}=e;void 0!==c&&(u=c),u=u||i.transform.centerPoint,a&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);let d={panDelta:s,zoomDelta:o,rollDelta:A,pitchDelta:h,bearingDelta:l,around:u};this._map.cameraHelper.useGlobeControls&&!n.isPointOnMapSurface(u)&&(u=n.centerPoint);let p=u.distSqr(n.centerPoint)<.01?n.center:n.screenPointToLocation(s?u.sub(s):u);this._handleMapControls({terrain:a,tr:n,deltasForHelper:d,preZoomAroundLoc:p,combinedEventsInProgress:t,panDelta:s}),i._applyUpdatedTransform(n),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(t,r,!0)}_handleMapControls({terrain:e,tr:t,deltasForHelper:r,preZoomAroundLoc:i,combinedEventsInProgress:n,panDelta:a}){let s=this._map.cameraHelper;if(s.handleMapControlsRollPitchBearingZoom(r,t),e)return s.useGlobeControls?(this._terrainMovement||!n.drag&&!n.zoom||(this._terrainMovement=!0,this._map._elevationFreeze=!0),void s.handleMapControlsPan(r,t,i)):this._terrainMovement||!n.drag&&!n.zoom?void(n.drag&&this._terrainMovement&&a?t.setCenter(t.screenPointToLocation(t.centerPoint.sub(a))):s.handleMapControlsPan(r,t,i)):(this._terrainMovement=!0,this._map._elevationFreeze=!0,void s.handleMapControlsPan(r,t,i));s.handleMapControlsPan(r,t,i)}_fireEvents(e,r,i){let n=Sa(this._eventsInProgress),a=Sa(e),o={};for(let t in e){let{originalEvent:r}=e[t];this._eventsInProgress[t]||(o[`${t}start`]=r),this._eventsInProgress[t]=e[t]}!n&&a&&this._fireEvent("movestart",a.originalEvent);for(let e in o)this._fireEvent(e,o[e]);a&&this._fireEvent("move",a.originalEvent);for(let t in e){let{originalEvent:r}=e[t];this._fireEvent(t,r)}let l,h={};for(let e in this._eventsInProgress){let{handlerName:t,originalEvent:i}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=r[t]||i,h[`${e}end`]=l)}for(let e in h)this._fireEvent(e,h[e]);let A=Sa(this._eventsInProgress),u=(n||a)&&!A;if(u&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;let e=this._map._getTransformForUpdate();this._map.getCenterClampedToGround()&&e.recalculateZoomAndCenter(this._map.terrain),this._map._applyUpdatedTransform(e)}if(i&&u){this._updatingCamera=!0;let e=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;!e||!e.essential&&s.prefersReducedMotion?(this._map.fire(new t.l("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()):(r(e.bearing||this._map.getBearing())&&(e.bearing=0),e.freezeElevation=!0,this._map.easeTo(e,{originalEvent:l})),this._updatingCamera=!1}}_fireEvent(e,r){this._map.fire(new t.l(e,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Ea("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}class Fa extends t.E{constructor(e,t,r){super(),this._renderFrameCallback=()=>{let e=Math.min((s.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=r.bearingSnap,this.cameraHelper=t,this.on("moveend",(()=>{delete this._requestedCameraState}))}migrateProjection(e,t){e.apply(this.transform),this.transform=e,this.cameraHelper=t}getCenter(){return new t.S(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}getCenterElevation(){return this.transform.elevation}setCenterElevation(e,t){return this.jumpTo({elevation:e},t),this}getCenterClampedToGround(){return this._centerClampedToGround}setCenterClampedToGround(e){this._centerClampedToGround=e}panBy(e,r,i){return e=t.P.convert(e).mult(-1),this.panTo(this.transform.center,t.e({offset:e},r),i)}panTo(e,r,i){return this.easeTo(t.e({center:e},r),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(e,r,i){return this.easeTo(t.e({zoom:e},r),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getVerticalFieldOfView(){return this.transform.fov}setVerticalFieldOfView(e,r){return e!=this.transform.fov&&(this.transform.setFov(e),this.fire(new t.l("movestart",r)).fire(new t.l("move",r)).fire(new t.l("moveend",r))),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(e,r,i){return this.easeTo(t.e({bearing:e},r),i)}resetNorth(e,r){return this.rotateTo(0,t.e({duration:1e3},e),r),this}resetNorthPitch(e,r){return this.easeTo(t.e({bearing:0,pitch:0,roll:0,duration:1e3},e),r),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}getRoll(){return this.transform.roll}setRoll(e,t){return this.jumpTo({roll:e},t),this}cameraForBounds(e,t){e=j.convert(e).adjustAntiMeridian();let r=t&&t.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),r,t)}_cameraForBoxAndBearing(e,r,i,n){let a={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=t.e({padding:a,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){let e=n.padding;n.padding={top:e,bottom:e,right:e,left:e}}let s=t.e(a,n.padding);n.padding=s;let o=this.transform,l=new j(e,r);return this.cameraHelper.cameraForBoxAndBearing(n,s,l,i,o)}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(e,r,i,n,a){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.screenPointToLocation(t.P.convert(e)),this.transform.screenPointToLocation(t.P.convert(r)),i,n),n,a)}_fitInternal(e,r,i){return e?(delete(r=t.e(e,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this}jumpTo(e,r){this.stop();let i=this._getTransformForUpdate(),n=!1,a=!1,s=!1,o=i.zoom;this.cameraHelper.handleJumpToCenterZoom(i,e);let l=i.zoom!==o;return"elevation"in e&&i.elevation!==+e.elevation&&i.setElevation(+e.elevation),"bearing"in e&&i.bearing!==+e.bearing&&(n=!0,i.setBearing(+e.bearing)),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.setPitch(+e.pitch)),"roll"in e&&i.roll!==+e.roll&&(s=!0,i.setRoll(+e.roll)),null==e.padding||i.isPaddingEqual(e.padding)||i.setPadding(e.padding),this._applyUpdatedTransform(i),this.fire(new t.l("movestart",r)).fire(new t.l("move",r)),l&&this.fire(new t.l("zoomstart",r)).fire(new t.l("zoom",r)).fire(new t.l("zoomend",r)),n&&this.fire(new t.l("rotatestart",r)).fire(new t.l("rotate",r)).fire(new t.l("rotateend",r)),a&&this.fire(new t.l("pitchstart",r)).fire(new t.l("pitch",r)).fire(new t.l("pitchend",r)),s&&this.fire(new t.l("rollstart",r)).fire(new t.l("roll",r)).fire(new t.l("rollend",r)),this.fire(new t.l("moveend",r))}calculateCameraOptionsFromTo(e,r,i,n=0){let a=t.a1.fromLngLat(e,r),s=t.a1.fromLngLat(i,n),o=s.x-a.x,l=s.y-a.y,h=s.z-a.z,A=Math.hypot(o,l,h);if(0===A)throw new Error("Can't calculate camera options with same From and To");let u=Math.hypot(o,l),c=t.ak(this.transform.cameraToCenterDistance/A/this.transform.tileSize),d=180*Math.atan2(o,-l)/Math.PI,p=180*Math.acos(u/A)/Math.PI;return p=h<0?90-p:90+p,{center:s.toLngLat(),elevation:n,zoom:c,pitch:p,bearing:d}}calculateCameraOptionsFromCameraLngLatAltRotation(e,t,r,i,n){let a=this.transform.calculateCenterFromCameraLngLatAlt(e,t,r,i);return{center:a.center,elevation:a.elevation,zoom:a.zoom,bearing:r,pitch:i,roll:n}}easeTo(e,r){this._stop(!1,e.easeId),(!1===(e=t.e({offset:[0,0],duration:500,easing:t.co},e)).animate||!e.essential&&s.prefersReducedMotion)&&(e.duration=0);let i,n,a=this._getTransformForUpdate(),o=this.getBearing(),l=a.pitch,h=a.roll,A="bearing"in e?this._normalizeBearing(e.bearing,o):o,u="pitch"in e?+e.pitch:l,c="roll"in e?this._normalizeBearing(e.roll,h):h,d="padding"in e?e.padding:a.padding,p=t.P.convert(e.offset);e.around&&(i=t.S.convert(e.around),n=a.locationToScreenPoint(i));let f={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching,rolling:this._rolling},g=this.cameraHelper.handleEaseTo(a,{bearing:A,pitch:u,roll:c,padding:d,around:i,aroundPoint:n,offsetAsPoint:p,offset:e.offset,zoom:e.zoom,center:e.center});return this._rotating=this._rotating||o!==A,this._pitching=this._pitching||u!==l,this._rolling=this._rolling||c!==h,this._padding=!a.isPaddingEqual(d),this._zooming=this._zooming||g.isZooming,this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,f),this.terrain&&this._prepareElevation(g.elevationCenter),this._ease((t=>{g.easeFunc(t),this.terrain&&!e.freezeElevation&&this._updateElevation(t),this._applyUpdatedTransform(a),this._fireMoveEvents(r)}),(t=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r,t)}),e),this}_prepareEase(e,r,i={}){this._moving=!0,r||i.moving||this.fire(new t.l("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.l("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.l("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.l("pitchstart",e)),this._rolling&&!i.rolling&&this.fire(new t.l("rollstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){void 0!==this._elevationStart&&void 0!==this._elevationCenter||this._prepareElevation(this.transform.center),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom));let r=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&r!==this._elevationTarget){let t=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(t-(r-(t*e+this._elevationStart))/(1-e)),this._elevationTarget=r}this.transform.setElevation(t.C.number(this._elevationStart,this._elevationTarget,e))}_finalizeElevation(){this._elevationFreeze=!1,this.getCenterClampedToGround()&&this.transform.recalculateZoomAndCenter(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(e){if(!this.terrain&&e.elevation>=0&&e.pitch<=90)return{};let t=e.getCameraLngLat(),r=e.getCameraAltitude(),i=this.terrain?this.terrain.getElevationForLngLatZoom(t,e.zoom):0;if(r<i){let r=this.calculateCameraOptionsFromTo(t,i,e.center,e.elevation);return{pitch:r.pitch,zoom:r.zoom}}return{}}_applyUpdatedTransform(e){let t=[];if(t.push((e=>this._elevateCameraIfInsideTerrain(e))),this.transformCameraUpdate&&t.push((e=>this.transformCameraUpdate(e))),!t.length)return;let r=e.clone();for(let e of t){let t=r.clone(),{center:i,zoom:n,roll:a,pitch:s,bearing:o,elevation:l}=e(t);i&&t.setCenter(i),void 0!==l&&t.setElevation(l),void 0!==n&&t.setZoom(n),void 0!==a&&t.setRoll(a),void 0!==s&&t.setPitch(s),void 0!==o&&t.setBearing(o),r.apply(t)}this.transform.apply(r)}_fireMoveEvents(e){this.fire(new t.l("move",e)),this._zooming&&this.fire(new t.l("zoom",e)),this._rotating&&this.fire(new t.l("rotate",e)),this._pitching&&this.fire(new t.l("pitch",e)),this._rolling&&this.fire(new t.l("roll",e))}_afterEase(e,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId;let i=this._zooming,n=this._rotating,a=this._pitching,s=this._rolling;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._rolling=!1,this._padding=!1,i&&this.fire(new t.l("zoomend",e)),n&&this.fire(new t.l("rotateend",e)),a&&this.fire(new t.l("pitchend",e)),s&&this.fire(new t.l("rollend",e)),this.fire(new t.l("moveend",e))}flyTo(e,r){if(!e.essential&&s.prefersReducedMotion){let i=t.Q(e,["center","zoom","bearing","pitch","roll","elevation"]);return this.jumpTo(i,r)}this.stop(),e=t.e({offset:[0,0],speed:1.2,curve:1.42,easing:t.co},e);let i=this._getTransformForUpdate(),n=i.bearing,a=i.pitch,o=i.roll,l=i.padding,h="bearing"in e?this._normalizeBearing(e.bearing,n):n,A="pitch"in e?+e.pitch:a,u="roll"in e?this._normalizeBearing(e.roll,o):o,c="padding"in e?e.padding:i.padding,d=t.P.convert(e.offset),p=i.centerPoint.add(d),f=i.screenPointToLocation(p),g=this.cameraHelper.handleFlyTo(i,{bearing:h,pitch:A,roll:u,padding:c,locationAtOffset:f,offsetAsPoint:d,center:e.center,minZoom:e.minZoom,zoom:e.zoom}),m=e.curve,y=Math.max(i.width,i.height),_=y/g.scaleOfZoom,v=g.pixelPathLength;"number"==typeof g.scaleOfMinZoom&&(m=Math.sqrt(y/g.scaleOfMinZoom/v*2));let w=m*m;function b(e){let t=(_*_-y*y+(e?-1:1)*w*w*v*v)/(2*(e?_:y)*w*v);return Math.log(Math.sqrt(t*t+1)-t)}function x(e){return(Math.exp(e)-Math.exp(-e))/2}function B(e){return(Math.exp(e)+Math.exp(-e))/2}let C=b(!1),S=function(e){return B(C)/B(C+m*e)},E=function(e){return y*((B(C)*(x(t=C+m*e)/B(t))-x(C))/w)/v;var t},I=(b(!0)-C)/m;if(Math.abs(v)<2e-6||!isFinite(I)){if(Math.abs(y-_)<1e-6)return this.easeTo(e,r);let t=_<y?-1:1;I=Math.abs(Math.log(_/y))/m,E=()=>0,S=e=>Math.exp(t*m*e)}return e.duration="duration"in e?+e.duration:1e3*I/("screenSpeed"in e?+e.screenSpeed/m:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=n!==h,this._pitching=A!==a,this._rolling=u!==o,this._padding=!i.isPaddingEqual(c),this._prepareEase(r,!1),this.terrain&&this._prepareElevation(g.targetCenter),this._ease((s=>{let f=s*I,m=1/S(f),y=E(f);this._rotating&&i.setBearing(t.C.number(n,h,s)),this._pitching&&i.setPitch(t.C.number(a,A,s)),this._rolling&&i.setRoll(t.C.number(o,u,s)),this._padding&&(i.interpolatePadding(l,c,s),p=i.centerPoint.add(d)),g.easeFunc(s,m,y,p),this.terrain&&!e.freezeElevation&&this._updateElevation(s),this._applyUpdatedTransform(i),this._fireMoveEvents(r)}),(()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(r)}),e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){var r;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){let e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}return e||null===(r=this.handlers)||void 0===r||r.stop(!1),this}_ease(e,t,r){!1===r.animate||0===r.duration?(e(1),t()):(this._easeStart=s.now(),this._easeOptions=r,this._onEaseFrame=e,this._onEaseEnd=t,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,r){e=t.aO(e,-180,180);let i=Math.abs(e-r);return Math.abs(e-360-r)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(t.S.convert(e),this.transform.tileZoom):null}}let Pa={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class La{constructor(e=Pa){this._toggleAttribution=()=>{this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show")):(this._container.classList.add("maplibregl-compact-show"),this._container.removeAttribute("open")))},this._updateData=e=>{!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","maplibregl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show"))},this._updateCompactMinimize=()=>{this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show")},this.options=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){let r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){let e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}let t=this._map.style.sourceCaches;for(let r in t){let i=t[r];if(i.used||i.usedForTerrain){let t=i.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let i=r+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0}));let r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=o.sanitize(r),this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Ma{constructor(e={}){this._updateCompact=()=>{let e=this._container.children;if(e.length){let t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact"):t.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl");let t=o.create("a","maplibregl-ctrl-logo");return t.target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class ka{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){let t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){let t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(let t of r)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");let t=this._currentlyRunning=this._queue;this._queue=[];for(let r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Ua=t.aJ([{name:"a_pos3d",type:"Int16",components:3}]);class Ra extends t.E{constructor(e){super(),this._lastTilesetChange=s.now(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.deltaZoom=1,this.tileSize=e._source.tileSize*2**this.deltaZoom,e.usedForTerrain=!0,e.tileSize=this.tileSize}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,r){this.sourceCache.update(e,r),this._renderableTilesKeys=[];let i={};for(let n of ye(e,{tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r,calculateTileZoom:this.sourceCache._source.calculateTileZoom}))i[n.key]=!0,this._renderableTilesKeys.push(n.key),this._tiles[n.key]||(n.terrainRttPosMatrix32f=new Float64Array(16),t.bY(n.terrainRttPosMatrix32f,0,t.$,t.$,0,0,1),this._tiles[n.key]=new ne(n,this.tileSize),this._lastTilesetChange=s.now());for(let e in this._tiles)i[e]||delete this._tiles[e]}freeRtt(e){for(let t in this._tiles){let r=this._tiles[t];(!e||r.tileID.equals(e)||r.tileID.isChildOf(e)||e.isChildOf(r.tileID))&&(r.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e,t){return t?this._getTerrainCoordsForTileRanges(e,t):this._getTerrainCoordsForRegularTile(e)}_getTerrainCoordsForRegularTile(e){let r={};for(let i of this._renderableTilesKeys){let n=this._tiles[i].tileID,a=e.clone(),s=t.ba();if(n.canonical.equals(e.canonical))t.bY(s,0,t.$,t.$,0,0,1);else if(n.canonical.isChildOf(e.canonical)){let r=n.canonical.z-e.canonical.z,i=n.canonical.x-(n.canonical.x>>r<<r),a=n.canonical.y-(n.canonical.y>>r<<r),o=t.$>>r;t.bY(s,0,o,o,0,0,1),t.M(s,s,[-i*o,-a*o,0])}else{if(!e.canonical.isChildOf(n.canonical))continue;{let r=e.canonical.z-n.canonical.z,i=e.canonical.x-(e.canonical.x>>r<<r),a=e.canonical.y-(e.canonical.y>>r<<r),o=t.$>>r;t.bY(s,0,t.$,t.$,0,0,1),t.M(s,s,[i*o,a*o,0]),t.N(s,s,[1/2**r,1/2**r,0])}}a.terrainRttPosMatrix32f=new Float32Array(s),r[i]=a}return r}_getTerrainCoordsForTileRanges(e,r){let i={};for(let n of this._renderableTilesKeys){let a=this._tiles[n].tileID;if(!this._isWithinTileRanges(a,r))continue;let s=e.clone(),o=t.ba();if(a.canonical.z===e.canonical.z){let r=e.canonical.x-a.canonical.x,i=e.canonical.y-a.canonical.y;t.bY(o,0,t.$,t.$,0,0,1),t.M(o,o,[r*t.$,i*t.$,0])}else if(a.canonical.z>e.canonical.z){let r=a.canonical.z-e.canonical.z,i=a.canonical.x-(a.canonical.x>>r<<r),n=a.canonical.y-(a.canonical.y>>r<<r),s=e.canonical.x-(a.canonical.x>>r),l=e.canonical.y-(a.canonical.y>>r),h=t.$>>r;t.bY(o,0,h,h,0,0,1),t.M(o,o,[-i*h+s*t.$,-n*h+l*t.$,0])}else{let r=e.canonical.z-a.canonical.z,i=e.canonical.x-(e.canonical.x>>r<<r),n=e.canonical.y-(e.canonical.y>>r<<r),s=(e.canonical.x>>r)-a.canonical.x,l=(e.canonical.y>>r)-a.canonical.y,h=t.$<<r;t.bY(o,0,h,h,0,0,1),t.M(o,o,[i*t.$+s*h,n*t.$+l*h,0])}s.terrainRttPosMatrix32f=new Float32Array(o),i[n]=s}return i}getSourceTile(e,t){let r=this.sourceCache._source,i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(i).key);let n=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!n||!n.dem)&&t)for(;i>=r.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(e.scaledTo(i--).key);return n}anyTilesAfterTime(e=Date.now()){return this._lastTilesetChange>=e}_isWithinTileRanges(e,t){return t[e.canonical.z]&&e.canonical.x>=t[e.canonical.z].minTileX&&e.canonical.x<=t[e.canonical.z].maxTileX&&e.canonical.y>=t[e.canonical.z].minTileY&&e.canonical.y<=t[e.canonical.z].maxTileY}}class Da{constructor(e,t,r){this._meshCache={},this.painter=e,this.sourceCache=new Ra(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,r,i,n=t.$){var a;if(!(r>=0&&r<n&&i>=0&&i<n))return 0;let s=this.getTerrainData(e),o=null===(a=s.tile)||void 0===a?void 0:a.dem;if(!o)return 0;let l=t.cs([],[r/n*t.$,i/n*t.$],s.u_terrain_matrix),h=[l[0]*o.dim,l[1]*o.dim],A=Math.floor(h[0]),u=Math.floor(h[1]),c=h[0]-A,d=h[1]-u;return o.get(A,u)*(1-c)*(1-d)+o.get(A+1,u)*c*(1-d)+o.get(A,u+1)*(1-c)*d+o.get(A+1,u+1)*c*d}getElevationForLngLatZoom(e,r){if(!t.ct(r,e.wrap()))return 0;let{tileID:i,mercatorX:n,mercatorY:a}=this._getOverscaledTileIDFromLngLatZoom(e,r);return this.getElevation(i,n%t.$,a%t.$,t.$)}getElevation(e,r,i,n=t.$){return this.getDEMElevation(e,r,i,n)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){let e=this.painter.context,r=new t.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new t.T(e,r,e.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new t.T(e,new t.R({width:1,height:1}),e.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=t.ag([])}let r=this.sourceCache.getSourceTile(e,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){let e=this.painter.context;r.demTexture=this.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new t.T(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}let i=r&&r+r.tileID.key+e.key;if(i&&!this._demMatrixCache[i]){let i=this.sourceCache.sourceCache._source.maxzoom,n=e.canonical.z-r.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=i?n=e.canonical.z-i:t.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));let a=e.canonical.x-(e.canonical.x>>n<<n),s=e.canonical.y-(e.canonical.y>>n<<n),o=t.cu(new Float64Array(16),[1/(t.$<<n),1/(t.$<<n),0]);t.M(o,o,[a*t.$,s*t.$,0]),this._demMatrixCache[e.key]={matrix:o,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:i?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getFramebuffer(e){let r=this.painter,i=r.width/devicePixelRatio,n=r.height/devicePixelRatio;return!this._fbo||this._fbo.width===i&&this._fbo.height===n||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new t.T(r.context,{width:i,height:n,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new t.T(r.context,{width:i,height:n,data:null},r.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(r.context.gl.NEAREST,r.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=r.context.createFramebuffer(i,n,!0,!1),this._fbo.depthAttachment.set(r.context.createRenderbuffer(r.context.gl.DEPTH_COMPONENT16,i,n))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){let e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;let r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let i=0;i<this._coordsTextureSize;i++,t+=4)r[t+0]=255&i,r[t+1]=255&e,r[t+2]=i>>8<<4|e>>8,r[t+3]=0;let i=new t.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),n=new t.T(e,i,e.gl.RGBA,{premultiply:!1});return n.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);let r=new Uint8Array(4),i=this.painter.context,n=i.gl,a=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),s=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),o=Math.round(this.painter.height/devicePixelRatio);i.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),n.readPixels(a,o-s-1,1,1,n.RGBA,n.UNSIGNED_BYTE,r),i.bindFramebuffer.set(null);let l=r[0]+(r[2]>>4<<8),h=r[1]+((15&r[2])<<8),A=this.coordsIndex[255-r[3]],u=A&&this.sourceCache.getTileByID(A);if(!u)return null;let c=this._coordsTextureSize,d=(1<<u.tileID.canonical.z)*c;return new t.a1((u.tileID.canonical.x*c+l)/d+u.tileID.wrap,(u.tileID.canonical.y*c+h)/d,this.getElevation(u.tileID,l,h,c))}depthAtPoint(e){let t=new Uint8Array(4),r=this.painter.context,i=r.gl;return r.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),i.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,i.RGBA,i.UNSIGNED_BYTE,t),r.bindFramebuffer.set(null),(t[0]/16777216+t[1]/65536+t[2]/256+t[3])/256}getTerrainMesh(e){var r;let i=(null===(r=this.painter.style.projection)||void 0===r?void 0:r.transitionState)>0,n=i&&0===e.canonical.y,a=i&&e.canonical.y===(1<<e.canonical.z)-1,s=`m_${n?"n":""}_${a?"s":""}`;if(this._meshCache[s])return this._meshCache[s];let o=this.painter.context,l=new t.cv,h=new t.aN,A=this.meshSize,u=t.$/A,c=A*A;for(let e=0;e<=A;e++)for(let t=0;t<=A;t++)l.emplaceBack(t*u,e*u,0);for(let e=0;e<c;e+=A+1)for(let t=0;t<A;t++)h.emplaceBack(t+e,A+t+e+1,A+t+e+2),h.emplaceBack(t+e,A+t+e+2,t+e+1);let d=l.length,p=d+(A+1),f=(A+1)*A,g=n?t.bh:0,m=n?0:1,y=a?t.bi:t.$,_=a?0:1;for(let e=0;e<=A;e++)l.emplaceBack(e*u,g,m);for(let e=0;e<=A;e++)l.emplaceBack(e*u,y,_);for(let e=0;e<A;e++)h.emplaceBack(f+e,p+e,p+e+1),h.emplaceBack(f+e,p+e+1,f+e+1),h.emplaceBack(0+e,d+e+1,d+e),h.emplaceBack(0+e,0+e+1,d+e+1);let v=l.length,w=v+2*(A+1);for(let e of[0,1])for(let r=0;r<=A;r++)for(let i of[0,1])l.emplaceBack(e*t.$,r*u,i);for(let e=0;e<2*A;e+=2)h.emplaceBack(v+e,v+e+1,v+e+3),h.emplaceBack(v+e,v+e+3,v+e+2),h.emplaceBack(w+e,w+e+3,w+e+1),h.emplaceBack(w+e,w+e+2,w+e+3);let b=new bt(o.createVertexBuffer(l,Ua.members),o.createIndexBuffer(h),t.aM.simpleSegment(0,0,l.length,h.length));return this._meshCache[s]=b,b}getMeshFrameDelta(e){return 2*Math.PI*t.bu/Math.pow(2,Math.max(e,0))/5}getMinTileElevationForLngLatZoom(e,t){var r;let{tileID:i}=this._getOverscaledTileIDFromLngLatZoom(e,t);return null!==(r=this.getMinMaxElevation(i).minElevation)&&void 0!==r?r:0}getMinMaxElevation(e){let t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=t.dem.min*this.exaggeration,r.maxElevation=t.dem.max*this.exaggeration),r}_getOverscaledTileIDFromLngLatZoom(e,r){let i=t.a1.fromLngLat(e.wrap()),n=(1<<r)*t.$,a=i.x*n,s=i.y*n,o=Math.floor(a/t.$),l=Math.floor(s/t.$);return{tileID:new t.Z(r,0,r,o,l),mercatorX:a,mercatorY:s}}}class Na{constructor(e,t,r){this._context=e,this._size=t,this._tileSize=r,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(let e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){let r=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),i=new t.T(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return i.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),this._context.extTextureFilterAnisotropic&&this._context.gl.texParameterf(this._context.gl.TEXTURE_2D,this._context.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,this._context.extTextureFilterAnisotropicMax),r.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),r.colorAttachment.set(i.texture),{id:e,fbo:r,texture:i,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter((t=>e.id!==t)),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(let e of this._recentlyUsed)if(!this._objects[e].inUse)return this._objects[e];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");let e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(let e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&!1===this._objects.some((e=>!e.inUse))}}let Oa={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0,"color-relief":!0};class Qa{constructor(e,t){this.painter=e,this.terrain=t,this.pool=new Na(e.context,30,t.sourceCache.tileSize*t.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,t){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter((r=>!e._layers[r].isHidden(t))),this._coordsAscending={};for(let t in e.sourceCaches){this._coordsAscending[t]={};let r=e.sourceCaches[t].getVisibleCoordinates(),i=e.sourceCaches[t].getSource(),n=i instanceof W?i.terrainTileRanges:null;for(let e of r){let r=this.terrain.sourceCache.getTerrainCoords(e,n);for(let e in r)this._coordsAscending[t][e]||(this._coordsAscending[t][e]=[]),this._coordsAscending[t][e].push(r[e])}}this._coordsAscendingStr={};for(let t of e._order){let r=e._layers[t],i=r.source;if(Oa[r.type]&&!this._coordsAscendingStr[i]){this._coordsAscendingStr[i]={};for(let e in this._coordsAscending[i])this._coordsAscendingStr[i][e]=this._coordsAscending[i][e].map((e=>e.key)).sort().join()}}for(let e of this._renderableTiles)for(let t in this._coordsAscendingStr){let r=this._coordsAscendingStr[t][e.tileID.key];r&&r!==e.rttCoords[t]&&(e.rtt=[])}}renderLayer(e,r){if(e.isHidden(this.painter.transform.zoom))return!1;let i=Object.assign(Object.assign({},r),{isRenderingToTexture:!0}),n=e.type,a=this.painter,s=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(Oa[n]&&(this._prevType&&Oa[this._prevType]||this._stacks.push([]),this._prevType=n,this._stacks[this._stacks.length-1].push(e.id),!s))return!0;if(Oa[this._prevType]||Oa[n]&&s){this._prevType=n;let e=this._stacks.length-1,r=this._stacks[e]||[];for(let n of this._renderableTiles){if(this.pool.isFull()&&(Cn(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(n),n.rtt[e]){let t=this.pool.getObjectForId(n.rtt[e].id);if(t.stamp===n.rtt[e].stamp){this.pool.useObject(t);continue}}let s=this.pool.getOrCreateFreeObject();this.pool.useObject(s),this.pool.stampObject(s),n.rtt[e]={id:s.id,stamp:s.stamp},a.context.bindFramebuffer.set(s.fbo.framebuffer),a.context.clear({color:t.bf.transparent,stencil:0}),a.currentStencilSource=void 0;for(let e=0;e<r.length;e++){let t=a.style._layers[r[e]],o=t.source?this._coordsAscending[t.source][n.tileID.key]:[n.tileID];a.context.viewport.set([0,0,s.fbo.width,s.fbo.height]),a._renderTileClippingMasks(t,o,!0),a.renderLayer(a,a.style.sourceCaches[t.source],t,o,i),t.source&&(n.rttCoords[t.source]=this._coordsAscendingStr[t.source][n.tileID.key])}}return Cn(this.painter,this.terrain,this._rttTiles,i),this._rttTiles=[],this.pool.freeAllObjects(),Oa[n]}return!1}}let za,Ha={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","GlobeControl.Enable":"Enable globe","GlobeControl.Disable":"Disable globe","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},ja=r,Va={hash:!1,interactive:!0,bearingSnap:7,attributionControl:Pa,maplibreLogo:!1,refreshExpiredTiles:!0,canvasContextAttributes:{antialias:!1,preserveDrawingBuffer:!1,powerPreference:"high-performance",failIfMajorPerformanceCaveat:!1,desynchronized:!1,contextType:void 0},scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],elevation:0,zoom:0,bearing:0,pitch:0,roll:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:t.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,rollEnabled:!1,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0,centerClampedToGround:!0},Ga={showCompass:!0,showZoom:!0,visualizePitch:!1,visualizeRoll:!0};class Ka{constructor(e,r,i=!1){this.mousedown=e=>{this.startMove(e,o.mousePos(this.element,e)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=e=>{this.move(e,o.mousePos(this.element,e))},this.mouseup=e=>{this._rotatePitchHandler.dragEnd(e),this.offTemp()},this.touchstart=e=>{1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.startMove(e,this._startPos),o.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.addEventListener(window,"touchend",this.touchend))},this.touchmove=e=>{1!==e.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.move(e,this._lastPos))},this.touchend=e=>{0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this._rotatePitchHandler.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10,this.element=r;let n=new ra;this._rotatePitchHandler=new $n({clickTolerance:3,move:(e,n)=>{let a=r.getBoundingClientRect(),s=new t.P((a.bottom-a.top)/2,(a.right-a.left)/2);return{bearingDelta:t.cn(new t.P(e.x,n.y),n,s),pitchDelta:i?-.5*(n.y-e.y):void 0}},moveStateManager:n,enable:!0,assignEvents:()=>{}}),this.map=e,o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchcancel",this.reset)}startMove(e,t){this._rotatePitchHandler.dragStart(e,t),o.disableDrag()}move(e,t){let r=this.map,{bearingDelta:i,pitchDelta:n}=this._rotatePitchHandler.dragMove(e,t)||{};i&&r.setBearing(r.getBearing()+i),n&&r.setPitch(r.getPitch()+n)}off(){let e=this.element;o.removeEventListener(e,"mousedown",this.mousedown),o.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend),o.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup),o.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),o.removeEventListener(window,"touchend",this.touchend)}}function qa(e,r,i,n=!1){if(n||!i.getCoveringTilesDetailsProvider().allowWorldCopies())return e?.wrap();let a=new t.S(e.lng,e.lat);if(e=new t.S(e.lng,e.lat),r){let n=new t.S(e.lng-360,e.lat),a=new t.S(e.lng+360,e.lat),s=i.locationToScreenPoint(e).distSqr(r);i.locationToScreenPoint(n).distSqr(r)<s?e=n:i.locationToScreenPoint(a).distSqr(r)<s&&(e=a)}for(;Math.abs(e.lng-i.center.lng)>180;){let t=i.locationToScreenPoint(e);if(t.x>=0&&t.y>=0&&t.x<=i.width&&t.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e.lng!==a.lng&&i.isPointOnMapSurface(i.locationToScreenPoint(e))?e:a}let Za={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Wa(e,t,r){let i=e.classList;for(let e in Za)i.remove(`maplibregl-${r}-anchor-${e}`);i.add(`maplibregl-${r}-anchor-${t}`)}class $a extends t.E{constructor(e){if(super(),this._onKeyPress=e=>{let t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()},this._onMapClick=e=>{let t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()},this._update=e=>{if(!this._map)return;let t=this._map.loaded()&&!this._map.isMoving();("terrain"===e?.type||"render"===e?.type&&!t)&&this._map.once("render",this._update),this._lngLat=qa(this._lngLat,this._flatPos,this._map.transform),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationToScreenPoint(this._lngLat)._add(this._offset));let r="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?r=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(r=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let i="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||e&&"moveend"!==e.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${Za[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${i} ${r}`),s.frameAsync(new AbortController).then((()=>{this._updateOpacity(e&&"moveend"===e.type)})).catch((()=>{}))},this._onMove=e=>{if(!this._isDragging){let t=this._clickTolerance||this._map._clickTolerance;this._isDragging=e.point.dist(this._pointerdownPos)>=t}this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.l("dragstart"))),this.fire(new t.l("drag")))},this._onUp=()=>{this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),"active"===this._state&&this.fire(new t.l("dragend")),this._state="inactive"},this._addDragHandler=e=>{this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,this.setOpacity(e?.opacity,e?.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=t.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div");let r=o.createNS("http://www.w3.org/2000/svg","svg"),i=41,n=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${i}px`),r.setAttributeNS(null,"width",`${n}px`),r.setAttributeNS(null,"viewBox",`0 0 ${n} ${i}`);let a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");let s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");let l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");let h=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];for(let e of h){let t=o.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),l.appendChild(t)}let A=o.createNS("http://www.w3.org/2000/svg","g");A.setAttributeNS(null,"fill",this._color);let u=o.createNS("http://www.w3.org/2000/svg","path");u.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),A.appendChild(u);let c=o.createNS("http://www.w3.org/2000/svg","g");c.setAttributeNS(null,"opacity","0.25"),c.setAttributeNS(null,"fill","#000000");let d=o.createNS("http://www.w3.org/2000/svg","path");d.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),c.appendChild(d);let p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"transform","translate(6.0, 7.0)"),p.setAttributeNS(null,"fill","#FFFFFF");let f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(8.0, 8.0)");let g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#000000"),g.setAttributeNS(null,"opacity","0.25"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962");let m=o.createNS("http://www.w3.org/2000/svg","circle");m.setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),f.appendChild(g),f.appendChild(m),s.appendChild(l),s.appendChild(A),s.appendChild(c),s.appendChild(p),s.appendChild(f),r.appendChild(s),r.setAttributeNS(null,"height",i*this._scale+"px"),r.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(r),this._offset=t.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),Wa(this._element,this._anchor,"marker"),e&&e.className)for(let t of e.className.split(" "))this._element.classList.add(t);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.hasAttribute("aria-label")||this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),e.on("projectiontransition",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("terrain",this._update),this._map.off("projectiontransition",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.S.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){let t=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[t,-1*(24.6+t)],"bottom-right":[-t,-1*(24.6+t)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){let e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var r,i;let n=null===(r=this._map)||void 0===r?void 0:r.terrain,a=this._map.transform.isLocationOccluded(this._lngLat);if(!n||a){let e=a?this._opacityWhenCovered:this._opacity;return void(this._element.style.opacity!==e&&(this._element.style.opacity=e))}if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout((()=>{this._opacityTimeout=null}),100)}let s=this._map,o=s.terrain.depthAtPoint(this._pos),l=s.terrain.getElevationForLngLatZoom(this._lngLat,s.transform.tileZoom);if(s.transform.lngLatToCameraDepth(this._lngLat,l)-o<.006)return void(this._element.style.opacity=this._opacity);let h=-this._offset.y/s.transform.pixelsPerMeter,A=Math.sin(s.getPitch()*Math.PI/180)*h,u=s.terrain.depthAtPoint(new t.P(this._pos.x,this._pos.y-this._offset.y)),c=s.transform.lngLatToCameraDepth(this._lngLat,l+A)-u>.006;!(null===(i=this._popup)||void 0===i)&&i.isOpen()&&c&&this._popup.remove(),this._element.style.opacity=c?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=t.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,t){return(void 0===this._opacity||void 0===e&&void 0===t)&&(this._opacity="1",this._opacityWhenCovered="0.2"),void 0!==e&&(this._opacity=e),void 0!==t&&(this._opacityWhenCovered=t),this._map&&this._updateOpacity(!0),this}}let Xa={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Ya=0,Ja=!1,es={maxWidth:100,unit:"metric"};function ts(e,t,r){let i=r&&r.maxWidth||100,n=e._container.clientHeight/2,a=e._container.clientWidth/2,s=e.unproject([a-i/2,n]),o=e.unproject([a+i/2,n]),l=Math.round(e.project(o).x-e.project(s).x),h=Math.min(i,l,e._container.clientWidth),A=s.distanceTo(o);if(r&&"imperial"===r.unit){let r=3.2808*A;r>5280?rs(t,h,r/5280,e._getUIString("ScaleControl.Miles")):rs(t,h,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?rs(t,h,A/1852,e._getUIString("ScaleControl.NauticalMiles")):A>=1e3?rs(t,h,A/1e3,e._getUIString("ScaleControl.Kilometers")):rs(t,h,A,e._getUIString("ScaleControl.Meters"))}function rs(e,t,r,i){let n=function(e){let t=Math.pow(10,`${Math.floor(e)}`.length-1),r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){let t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(n/r)+"px",e.innerHTML=`${n}&nbsp;${i}`}let is={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1,locationOccludedOpacity:void 0},ns=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function as(e){if(e){if("number"==typeof e){let r=Math.round(Math.abs(e)/Math.SQRT2);return{center:new t.P(0,0),top:new t.P(0,e),"top-left":new t.P(r,r),"top-right":new t.P(-r,r),bottom:new t.P(0,-e),"bottom-left":new t.P(r,-r),"bottom-right":new t.P(-r,-r),left:new t.P(e,0),right:new t.P(-e,0)}}if(e instanceof t.P||Array.isArray(e)){let r=t.P.convert(e);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:t.P.convert(e.center||[0,0]),top:t.P.convert(e.top||[0,0]),"top-left":t.P.convert(e["top-left"]||[0,0]),"top-right":t.P.convert(e["top-right"]||[0,0]),bottom:t.P.convert(e.bottom||[0,0]),"bottom-left":t.P.convert(e["bottom-left"]||[0,0]),"bottom-right":t.P.convert(e["bottom-right"]||[0,0]),left:t.P.convert(e.left||[0,0]),right:t.P.convert(e.right||[0,0])}}return as(new t.P(0,0))}let ss=r;e.AJAXError=t.cz,e.Event=t.l,e.Evented=t.E,e.LngLat=t.S,e.MercatorCoordinate=t.a1,e.Point=t.P,e.addProtocol=t.cA,e.config=t.a,e.removeProtocol=t.cB,e.AttributionControl=La,e.BoxZoomHandler=Gn,e.CanvasSource=X,e.CooperativeGesturesHandler=Ca,e.DoubleClickZoomHandler=_a,e.DragPanHandler=ba,e.DragRotateHandler=xa,e.EdgeInsets=Et,e.FullscreenControl=class extends t.E{constructor(e={}){super(),this._onFullscreenChange=()=>{var e;let t=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;null!==(e=t?.shadowRoot)&&void 0!==e&&e.fullscreenElement;)t=t.shadowRoot.fullscreenElement;t===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,e&&e.container&&(e.container instanceof HTMLElement?this._container=e.container:t.w("Full screen control 'container' must be a DOM element.")),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){let e=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){let e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_handleFullscreenChange(){this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._updateTitle(),this._fullscreen?(this.fire(new t.l("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new t.l("fullscreenend")),this._prevCooperativeGesturesEnabled&&this._map.cooperativeGestures.enable())}_exitFullscreen(){window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen?window.document.webkitCancelFullScreen():this._togglePseudoFullScreen()}_requestFullscreen(){this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen?this._container.webkitRequestFullscreen():this._togglePseudoFullScreen()}_togglePseudoFullScreen(){this._container.classList.toggle("maplibregl-pseudo-fullscreen"),this._handleFullscreenChange(),this._map.resize()}},e.GeoJSONSource=Z,e.GeolocateControl=class extends t.E{constructor(e){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.l("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new t.l("geolocate",e)),this._finish()}},this._updateCamera=e=>{let r=new t.S(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy,n=this._map.getBearing(),a=t.e({bearing:n},this.options.fitBoundsOptions),s=j.fromLngLat(r,i);this._map.fitBounds(s,a,{geolocateSource:!0})},this._updateMarker=e=>{if(e){let r=new t.S(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this._updateCircleRadiusIfNeeded()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onUpdate=()=>{this._updateCircleRadiusIfNeeded()},this._onError=e=>{if(this._map){if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Ja)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new t.l("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(!1===e){t.w("Geolocation support is not available so the GeolocateControl will be disabled.");let e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}else{let e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new $a({element:this._dotElement}),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new $a({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onUpdate),this._map.on("move",this._onUpdate),this._map.on("rotate",this._onUpdate),this._map.on("pitch",this._onUpdate)),this._geolocateButton.addEventListener("click",(()=>this.trigger())),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",(e=>{let r=e?.[0]instanceof ResizeObserverEntry;e.geolocateSource||"ACTIVE_LOCK"!==this._watchState||r||this._map.isZooming()||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new t.l("trackuserlocationend")),this.fire(new t.l("userlocationlostfocus")))}))}},this.options=t.e({},Xa,e)}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return t._(this,arguments,void 0,(function*(e=!1){if(void 0!==za&&!e)return za;if(void 0===window.navigator.permissions)return za=!!window.navigator.geolocation,za;try{za="denied"!==(yield window.navigator.permissions.query({name:"geolocation"})).state}catch{za=!!window.navigator.geolocation}return za}))}().then((e=>this._finishSetupUI(e))),this._container}onRemove(){void 0!==this._geolocationWatchID&&(window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),o.remove(this._container),this._map.off("zoom",this._onUpdate),this._map.off("move",this._onUpdate),this._map.off("rotate",this._onUpdate),this._map.off("pitch",this._onUpdate),this._map=void 0,Ya=0,Ja=!1}_isOutOfMapMaxBounds(e){let t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}_setErrorState(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting");break;case"ACTIVE_ERROR":case"BACKGROUND_ERROR":case"OFF":case void 0:break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadiusIfNeeded(){let e=this._userLocationDotMarker.getLngLat();if(!(this.options.showUserLocation&&this.options.showAccuracyCircle&&this._accuracy&&e))return;let t=this._map.project(e),r=this._map.unproject([t.x+100,t.y]),i=e.distanceTo(r)/100,n=2*this._accuracy/i;this._circleElement.style.width=`${n.toFixed(2)}px`,this._circleElement.style.height=`${n.toFixed(2)}px`}trigger(){if(!this._setup)return t.w("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new t.l("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Ya--,Ja=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this.fire(new t.l("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.l("trackuserlocationstart")),this.fire(new t.l("userlocationfocus"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ya++,Ya>1?(e={maximumAge:6e5,timeout:0},Ja=!0):(e=this.options.positionOptions,Ja=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)}},e.GlobeControl=class{constructor(){this._toggleProjection=()=>{var e;let t=null===(e=this._map.getProjection())||void 0===e?void 0:e.type;this._map.setProjection("mercator"!==t&&t?{type:"mercator"}:{type:"globe"}),this._updateGlobeIcon()},this._updateGlobeIcon=()=>{var e;this._globeButton.classList.remove("maplibregl-ctrl-globe"),this._globeButton.classList.remove("maplibregl-ctrl-globe-enabled"),"globe"===(null===(e=this._map.getProjection())||void 0===e?void 0:e.type)?(this._globeButton.classList.add("maplibregl-ctrl-globe-enabled"),this._globeButton.title=this._map._getUIString("GlobeControl.Disable")):(this._globeButton.classList.add("maplibregl-ctrl-globe"),this._globeButton.title=this._map._getUIString("GlobeControl.Enable"))}}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._globeButton=o.create("button","maplibregl-ctrl-globe",this._container),o.create("span","maplibregl-ctrl-icon",this._globeButton).setAttribute("aria-hidden","true"),this._globeButton.type="button",this._globeButton.addEventListener("click",this._toggleProjection),this._updateGlobeIcon(),this._map.on("styledata",this._updateGlobeIcon),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateGlobeIcon),this._globeButton.removeEventListener("click",this._toggleProjection),this._map=void 0}},e.Hash=Tn,e.ImageSource=W,e.KeyboardHandler=pa,e.LngLatBounds=j,e.LogoControl=Ma,e.Map=class extends Fa{constructor(e){var r,i;t.cw.mark(t.cx.create);let n=Object.assign(Object.assign(Object.assign({},Va),e),{canvasContextAttributes:Object.assign(Object.assign({},Va.canvasContextAttributes),e.canvasContextAttributes)});if(null!=n.minZoom&&null!=n.maxZoom&&n.minZoom>n.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=n.minPitch&&null!=n.maxPitch&&n.minPitch>n.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=n.minPitch&&n.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=n.maxPitch&&n.maxPitch>180)throw new Error("maxPitch must be less than or equal to 180");let a=new kt,s=new Nt;if(void 0!==n.minZoom&&a.setMinZoom(n.minZoom),void 0!==n.maxZoom&&a.setMaxZoom(n.maxZoom),void 0!==n.minPitch&&a.setMinPitch(n.minPitch),void 0!==n.maxPitch&&a.setMaxPitch(n.maxPitch),void 0!==n.renderWorldCopies&&a.setRenderWorldCopies(n.renderWorldCopies),super(a,s,{bearingSnap:n.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new ka,this._controls=[],this._mapId=t.a7(),this._contextLost=e=>{e.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new t.l("webglcontextlost",{originalEvent:e}))},this._contextRestored=e=>{this._setupPainter(),this.resize(),this._update(),this.fire(new t.l("webglcontextrestored",{originalEvent:e}))},this._onMapScroll=e=>{if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=n.interactive,this._maxTileCacheSize=n.maxTileCacheSize,this._maxTileCacheZoomLevels=n.maxTileCacheZoomLevels,this._canvasContextAttributes=Object.assign({},n.canvasContextAttributes),this._trackResize=!0===n.trackResize,this._bearingSnap=n.bearingSnap,this._centerClampedToGround=n.centerClampedToGround,this._refreshExpiredTiles=!0===n.refreshExpiredTiles,this._fadeDuration=n.fadeDuration,this._crossSourceCollisions=!0===n.crossSourceCollisions,this._collectResourceTiming=!0===n.collectResourceTiming,this._locale=Object.assign(Object.assign({},Ha),n.locale),this._clickTolerance=n.clickTolerance,this._overridePixelRatio=n.pixelRatio,this._maxCanvasSize=n.maxCanvasSize,this.transformCameraUpdate=n.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=!0===n.cancelPendingTileRequestsWhileZooming,this._imageQueueHandle=p.addThrottleControl((()=>this.isMoving())),this._requestManager=new f(n.transformRequest),"string"==typeof n.container){if(this._container=document.getElementById(n.container),!this._container)throw new Error(`Container '${n.container}' not found.`)}else{if(!(n.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=n.container}if(n.maxBounds&&this.setMaxBounds(n.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),this.once("idle",(()=>{this._idleTriggered=!0})),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let e=!1,t=In((e=>{this._trackResize&&!this._removed&&(this.resize(e),this.redraw())}),50);this._resizeObserver=new ResizeObserver((r=>{e?t(r):e=!0})),this._resizeObserver.observe(this._container)}this.handlers=new Ta(this,n),this._hash=n.hash&&new Tn("string"==typeof n.hash&&n.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:n.center,elevation:n.elevation,zoom:n.zoom,bearing:n.bearing,pitch:n.pitch,roll:n.roll}),n.bounds&&(this.resize(),this.fitBounds(n.bounds,t.e({},n.fitBoundsOptions,{duration:0}))));let o="string"==typeof n.style||"globe"!==(null===(i=null===(r=n.style)||void 0===r?void 0:r.projection)||void 0===i?void 0:i.type);this.resize(null,o),this._localIdeographFontFamily=n.localIdeographFontFamily,this._validateStyle=n.validateStyle,n.style&&this.setStyle(n.style,{localIdeographFontFamily:n.localIdeographFontFamily}),n.attributionControl&&this.addControl(new La("boolean"==typeof n.attributionControl?void 0:n.attributionControl)),n.maplibreLogo&&this.addControl(new Ma,n.logoPosition),this.on("style.load",(()=>{if(o||this._resizeTransform(),this.transform.unmodified){let e=t.Q(this.style.stylesheet,["center","zoom","bearing","pitch","roll"]);this.jumpTo(e)}})),this.on("data",(e=>{this._update("style"===e.dataType),this.fire(new t.l(`${e.dataType}data`,e))})),this.on("dataloading",(e=>{this.fire(new t.l(`${e.dataType}dataloading`,e))})),this.on("dataabort",(e=>{this.fire(new t.l("sourcedataabort",e))}))}_getMapId(){return this._mapId}setGlobalStateProperty(e,t){return this.style.setGlobalStateProperty(e,t),this._update(!0)}getGlobalState(){return this.style.getGlobalState()}addControl(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.k(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));let i=e.onAdd(this);this._controls.push(e);let n=this._controlPositions[r];return-1!==r.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this}removeControl(e){if(!e||!e.onRemove)return this.fire(new t.k(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));let r=this._controls.indexOf(e);return r>-1&&this._controls.splice(r,1),e.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}coveringTiles(e){return ye(this.transform,e)}calculateCameraOptionsFromTo(e,t,r,i){return null==i&&this.terrain&&(i=this.terrain.getElevationForLngLatZoom(r,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(e,t,r,i)}resize(e,r=!0){let[i,n]=this._containerDimensions(),a=this._getClampedPixelRatio(i,n);if(this._resizeCanvas(i,n,a),this.painter.resize(i,n,a),this.painter.overLimit()){let e=this.painter.context.gl;this._maxCanvasSize=[e.drawingBufferWidth,e.drawingBufferHeight];let t=this._getClampedPixelRatio(i,n);this._resizeCanvas(i,n,t),this.painter.resize(i,n,t)}this._resizeTransform(r);let s=!this._moving;return s&&(this.stop(),this.fire(new t.l("movestart",e)).fire(new t.l("move",e))),this.fire(new t.l("resize",e)),s&&this.fire(new t.l("moveend",e)),this}_resizeTransform(e=!0){var t;let[r,i]=this._containerDimensions();this.transform.resize(r,i,e),null===(t=this._requestedCameraState)||void 0===t||t.resize(r,i,e)}_getClampedPixelRatio(e,t){let{0:r,1:i}=this._maxCanvasSize,n=this.getPixelRatio(),a=e*n,s=t*n;return Math.min(a>r?r/a:1,s>i?i/s:1)*n}getPixelRatio(){var e;return null!==(e=this._overridePixelRatio)&&void 0!==e?e:devicePixelRatio}setPixelRatio(e){this._overridePixelRatio=e,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(e){return this.transform.setMaxBounds(j.convert(e)),this._update()}setMinZoom(e){if((e=e??-2)>=-2&&e<=this.transform.maxZoom)return this.transform.setMinZoom(e),this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=e??22)>=this.transform.minZoom)return this.transform.setMaxZoom(e),this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=e??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.setMinPitch(e),this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=e??60)>180)throw new Error("maxPitch must be less than or equal to 180");if(e>=this.transform.minPitch)return this.transform.setMaxPitch(e),this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.setRenderWorldCopies(e),this._update()}project(e){return this.transform.locationToScreenPoint(t.S.convert(e),this.style&&this.terrain)}unproject(e){return this.transform.screenPointToLocation(t.P.convert(e),this.terrain)}isMoving(){var e;return this._moving||(null===(e=this.handlers)||void 0===e?void 0:e.isMoving())}isZooming(){var e;return this._zooming||(null===(e=this.handlers)||void 0===e?void 0:e.isZooming())}isRotating(){var e;return this._rotating||(null===(e=this.handlers)||void 0===e?void 0:e.isRotating())}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let i=!1;return{layers:t,listener:r,delegates:{mousemove:n=>{let a=t.filter((e=>this.getLayer(e))),s=0!==a.length?this.queryRenderedFeatures(n.point,{layers:a}):[];s.length?i||(i=!0,r.call(this,new On(e,this,n.originalEvent,{features:s}))):i=!1},mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1;return{layers:t,listener:r,delegates:{mousemove:n=>{let a=t.filter((e=>this.getLayer(e)));(0!==a.length?this.queryRenderedFeatures(n.point,{layers:a}):[]).length?i=!0:i&&(i=!1,r.call(this,new On(e,this,n.originalEvent)))},mouseout:t=>{i&&(i=!1,r.call(this,new On(e,this,t.originalEvent)))}}}}{let i=e=>{let i=t.filter((e=>this.getLayer(e))),n=0!==i.length?this.queryRenderedFeatures(e.point,{layers:i}):[];n.length&&(e.features=n,r.call(this,e),delete e.features)};return{layers:t,listener:r,delegates:{[e]:i}}}}_saveDelegatedListener(e,t){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(t)}_removeDelegatedListener(e,t,r){if(!this._delegatedListeners||!this._delegatedListeners[e])return;let i=this._delegatedListeners[e];for(let e=0;e<i.length;e++){let n=i[e];if(n.listener===r&&n.layers.length===t.length&&n.layers.every((e=>t.includes(e)))){for(let e in n.delegates)this.off(e,n.delegates[e]);return void i.splice(e,1)}}}on(e,t,r){if(void 0===r)return super.on(e,t);let i="string"==typeof t?[t]:t,n=this._createDelegatedListener(e,i,r);this._saveDelegatedListener(e,n);for(let e in n.delegates)this.on(e,n.delegates[e]);return{unsubscribe:()=>{this._removeDelegatedListener(e,i,r)}}}once(e,t,r){if(void 0===r)return super.once(e,t);let i="string"==typeof t?[t]:t,n=this._createDelegatedListener(e,i,r);for(let t in n.delegates){let a=n.delegates[t];n.delegates[t]=(...t)=>{this._removeDelegatedListener(e,i,r),a(...t)}}this._saveDelegatedListener(e,n);for(let e in n.delegates)this.once(e,n.delegates[e]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._removeDelegatedListener(e,"string"==typeof t?[t]:t,r),this)}queryRenderedFeatures(e,r){if(!this.style)return[];let i,n=e instanceof t.P||Array.isArray(e),a=n?e:[[0,0],[this.transform.width,this.transform.height]];if(r=r||(n?{}:e)||{},a instanceof t.P||"number"==typeof a[0])i=[t.P.convert(a)];else{let e=t.P.convert(a[0]),r=t.P.convert(a[1]);i=[e,new t.P(r.x,e.y),r,new t.P(e.x,r.y),e]}return this.style.queryRenderedFeatures(i,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(e,r){return!1!==(r=t.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){let t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){var r,i;if(t.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",(()=>this._updateStyle(e,t)));let n=this.style&&t.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!e)),e?(this.style=new br(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e,t,n):this.style.loadJSON(e,t,n),this):(null===(i=null===(r=this.style)||void 0===r?void 0:r.projection)||void 0===i||i.destroy(),delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new br(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(e,r){if("string"==typeof e){let i=this._requestManager.transformRequest(e,"Style");t.j(i,new AbortController).then((e=>{this._updateDiff(e.data,r)})).catch((e=>{e&&this.fire(new t.k(e))}))}else"object"==typeof e&&this._updateDiff(e,r)}_updateDiff(e,r){try{this.style.setState(e,r)&&this._update(!0)}catch(i){t.w(`Unable to perform style diff: ${i.message||i.error||i}.  Rebuilding the style from scratch.`),this._updateStyle(e,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():t.w("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(e){let r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.k(new Error(`There is no source with ID '${e}'`)))}setTerrain(e){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),e){let r=this.style.sourceCaches[e.source];if(!r)throw new Error(`cannot load terrain, because there exists no source with ID: ${e.source}`);null===this.terrain&&r.reload();for(let r in this.style._layers){let i=this.style._layers[r];"hillshade"===i.type&&i.source===e.source&&t.w("You are using the same source for a hillshade layer and for 3D terrain. Please consider using two separate sources to improve rendering quality."),"color-relief"===i.type&&i.source===e.source&&t.w("You are using the same source for a color-relief layer and for 3D terrain. Please consider using two separate sources to improve rendering quality.")}this.terrain=new Da(this.painter,r,e),this.painter.renderToTexture=new Qa(this.painter,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._terrainDataCallback=t=>{var r;"style"===t.dataType?this.terrain.sourceCache.freeRtt():"source"===t.dataType&&t.tile&&(t.sourceId!==e.source||this._elevationFreeze||(this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))),"image"===(null===(r=t.source)||void 0===r?void 0:r.type)?this.terrain.sourceCache.freeRtt():this.terrain.sourceCache.freeRtt(t.tile.tileID))},this.style.on("data",this._terrainDataCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.painter.renderToTexture&&this.painter.renderToTexture.destruct(),this.painter.renderToTexture=null,this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0);return this.fire(new t.l("terrain",{terrain:e})),this}getTerrain(){var e,t;return null!==(t=null===(e=this.terrain)||void 0===e?void 0:e.options)&&void 0!==t?t:null}areTilesLoaded(){let e=this.style&&this.style.sourceCaches;for(let t in e){let r=e[t]._tiles;for(let e in r){let t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}setSourceTileLodParams(e,t,r){if(r){let i=this.getSource(r);if(!i)throw new Error(`There is no source with ID "${r}", cannot set LOD parameters`);i.calculateTileZoom=fe(Math.max(1,e),Math.max(1,t))}else for(let r in this.style.sourceCaches)this.style.sourceCaches[r].getSource().calculateTileZoom=fe(Math.max(1,e),Math.max(1,t));return this._update(!0),this}refreshTiles(e,r){let i=this.style.sourceCaches[e];if(!i)throw new Error(`There is no source cache with ID "${e}", cannot refresh tile`);void 0===r?i.reload(!0):i.refreshTiles(r.map((e=>new t.a4(e.z,e.x,e.y))))}addImage(e,r,i={}){let{pixelRatio:n=1,sdf:a=!1,stretchX:o,stretchY:l,content:h,textFitWidth:A,textFitHeight:u}=i;if(this._lazyInitEmptyStyle(),!(r instanceof HTMLImageElement||t.b(r))){if(void 0===r.width||void 0===r.height)return this.fire(new t.k(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));{let{width:i,height:s,data:c}=r,d=r;return this.style.addImage(e,{data:new t.R({width:i,height:s},new Uint8Array(c)),pixelRatio:n,stretchX:o,stretchY:l,content:h,textFitWidth:A,textFitHeight:u,sdf:a,version:0,userImage:d}),d.onAdd&&d.onAdd(this,e),this}}{let{width:i,height:c,data:d}=s.getImageData(r);this.style.addImage(e,{data:new t.R({width:i,height:c},d),pixelRatio:n,stretchX:o,stretchY:l,content:h,textFitWidth:A,textFitHeight:u,sdf:a,version:0})}}updateImage(e,r){let i=this.style.getImage(e);if(!i)return this.fire(new t.k(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));let n=r instanceof HTMLImageElement||t.b(r)?s.getImageData(r):r,{width:a,height:o,data:l}=n;if(void 0===a||void 0===o)return this.fire(new t.k(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));if(a!==i.data.width||o!==i.data.height)return this.fire(new t.k(new Error("The width and height of the updated image must be that same as the previous version of the image")));let h=!(r instanceof HTMLImageElement||t.b(r));return i.data.replace(l,h),this.style.updateImage(e,i),this}getImage(e){return this.style.getImage(e)}hasImage(e){return e?!!this.style.getImage(e):(this.fire(new t.k(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(e){return p.getImage(this._requestManager.transformRequest(e,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setGlyphs(e,t={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(e,t),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(e,t,r={}){return this._lazyInitEmptyStyle(),this.style.addSprite(e,t,r,(e=>{e||this._update(!0)})),this}removeSprite(e){return this._lazyInitEmptyStyle(),this.style.removeSprite(e),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSprite(e,t,(e=>{e||this._update(!0)})),this}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setSky(e,t={}){return this._lazyInitEmptyStyle(),this.style.setSky(e,t),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){let e=this._container;e.classList.add("maplibregl-map");let t=this._canvasContainer=o.create("div","maplibregl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas",t),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex",this._interactive?"0":"-1"),this._canvas.setAttribute("aria-label",this._getUIString("Map.Title")),this._canvas.setAttribute("role","region");let r=this._containerDimensions(),i=this._getClampedPixelRatio(r[0],r[1]);this._resizeCanvas(r[0],r[1],i);let n=this._controlContainer=o.create("div","maplibregl-control-container",e),a=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{a[e]=o.create("div",`maplibregl-ctrl-${e} `,n)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(e,t,r){this._canvas.width=Math.floor(r*e),this._canvas.height=Math.floor(r*t),this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){let e=Object.assign(Object.assign({},this._canvasContextAttributes),{alpha:!0,depth:!0,stencil:!0,premultipliedAlpha:!0}),t=null;this._canvas.addEventListener("webglcontextcreationerror",(r=>{t={requestedAttributes:e},r&&(t.statusMessage=r.statusMessage,t.type=r.type)}),{once:!0});let r=null;if(r=this._canvasContextAttributes.contextType?this._canvas.getContext(this._canvasContextAttributes.contextType,e):this._canvas.getContext("webgl2",e)||this._canvas.getContext("webgl",e),!r){let e="Failed to initialize WebGL";throw t?(t.message=e,new Error(JSON.stringify(t))):new Error(e)}this.painter=new En(r,this.transform),A.testSupport(r)}migrateProjection(e,r){super.migrateProjection(e,r),this.painter.transform=e,this.fire(new t.l("projectiontransition",{newProjection:this.style.projection.name}))}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(e){var r,i,n,a,o;let l=this._idleTriggered?this._fadeDuration:0,h=(null===(r=this.style.projection)||void 0===r?void 0:r.transitionState)>0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),this._removed)return;let A=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;let e=this.transform.zoom,r=s.now();this.style.zoomHistory.update(e,r);let i=new t.F(e,{now:r,fadeDuration:l,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=i.crossFadingFactor();1===n&&n===this._crossFadingFactor||(A=!0,this._crossFadingFactor=n),this.style.update(i)}let u=(null===(i=this.style.projection)||void 0===i?void 0:i.transitionState)>0!==h;null===(n=this.style.projection)||void 0===n||n.setErrorQueryLatitudeDegrees(this.transform.center.lat),this.transform.setTransitionState(null===(a=this.style.projection)||void 0===a?void 0:a.transitionState,null===(o=this.style.projection)||void 0===o?void 0:o.latitudeErrorCorrectionRadians),this.style&&(this._sourcesDirty||u)&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.setMinElevationForCurrentTile(this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),!this._elevationFreeze&&this._centerClampedToGround&&this.transform.setElevation(this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.setMinElevationForCurrentTile(0),this._centerClampedToGround&&this.transform.setElevation(0)),this._placementDirty=this.style&&this.style._updatePlacement(this.transform,this.showCollisionBoxes,l,this._crossSourceCollisions,u),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:l,showPadding:this.showPadding}),this.fire(new t.l("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,t.cw.mark(t.cx.load),this.fire(new t.l("load"))),this.style&&(this.style.hasTransitions()||A)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();let c=this._sourcesDirty||this._styleDirty||this._placementDirty;return c||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.l("idle")),!this._loaded||this._fullyLoaded||c||(this._fullyLoaded=!0,t.cw.mark(t.cx.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var e;this._hash&&this._hash.remove();for(let e of this._controls)e.onRemove(this);this._controls=[],this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),typeof window<"u"&&removeEventListener("online",this._onWindowOnline,!1),p.removeThrottleControl(this._imageQueueHandle),null===(e=this._resizeObserver)||void 0===e||e.disconnect();let r=this.painter.context.gl.getExtension("WEBGL_lose_context");r?.loseContext&&r.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._container.removeEventListener("scroll",this._onMapScroll,!1),this._container.classList.remove("maplibregl-map"),t.cw.clearMetrics(),this._removed=!0,this.fire(new t.l("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,s.frame(this._frameRequest,(e=>{t.cw.frame(e),this._frameRequest=null;try{this._render(e)}catch(e){if(!t.cy(e)&&e.message!==Ki)throw e}}),(()=>{})))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}get version(){return ja}getCameraTargetElevation(){return this.transform.elevation}getProjection(){return this.style.getProjection()}setProjection(e){return this._lazyInitEmptyStyle(),this.style.setProjection(e),this._update(!0)}},e.MapMouseEvent=On,e.MapTouchEvent=Qn,e.MapWheelEvent=zn,e.Marker=$a,e.NavigationControl=class{constructor(e){this._updateZoomButtons=()=>{let e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())},this._rotateCompassArrow=()=>{this._compassIcon.style.transform=this.options.visualizePitch&&this.options.visualizeRoll?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateZ(${-this._map.transform.roll}deg) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitchInRadians),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${-this._map.transform.bearing}deg)`:this.options.visualizeRoll?`rotate(${-this._map.transform.bearing-this._map.transform.roll}deg)`:`rotate(${-this._map.transform.bearing}deg)`},this._setButtonTitle=(e,t)=>{let r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)},this.options=t.e({},Ga,e),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(e){return this._map=e,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.on("roll",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new Ka(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this.options.visualizeRoll&&this._map.off("roll",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(e,t){let r=o.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}},e.Popup=class extends t.E{constructor(e){super(),this._updateOpacity=()=>{void 0!==this.options.locationOccludedOpacity&&(this._container.style.opacity=this._map.transform.isLocationOccluded(this.getLngLat())?`${this.options.locationOccludedOpacity}`:"")},this.remove=()=>(this._content&&o.remove(this._content),this._container&&(o.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),this._map._canvasContainer.classList.remove("maplibregl-track-pointer"),delete this._map,this.fire(new t.l("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=o.create("div","maplibregl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(let e of this.options.className.split(" "))this._container.classList.add(e);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=qa(this._lngLat,this._flatPos,this._map.transform,this._trackPointer),this._trackPointer&&!e)return;let t=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationToScreenPoint(this._lngLat));let r=this.options.anchor,i=as(this.options.offset);if(!r){let e,n=this._container.offsetWidth,a=this._container.offsetHeight;e=t.y+i.bottom.y<a?["top"]:t.y>this._map.transform.height-a?["bottom"]:[],t.x<n/2?e.push("left"):t.x>this._map.transform.width-n/2&&e.push("right"),r=0===e.length?"bottom":e.join("-")}let n=t.add(i[r]);this.options.subpixelPositioning||(n=n.round()),o.setTransform(this._container,`${Za[r]} translate(${n.x}px,${n.y}px)`),Wa(this._container,r,"popup"),this._updateOpacity()},this._onClose=()=>{this.remove()},this.options=t.e(Object.create(is),e)}addTo(e){return this._map&&this.remove(),this._map=e,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")):this._map.on("move",this._update),this.fire(new t.l("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=t.S.convert(e),this._pos=null,this._flatPos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer")),this}trackPointer(){return this._trackPointer=!0,this._pos=null,this._flatPos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("maplibregl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer")),this}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){let t,r=document.createDocumentFragment(),i=document.createElement("body");for(i.innerHTML=e;t=i.firstChild,t;)r.appendChild(t);return this.setDOMContent(r)}getMaxWidth(){var e;return null===(e=this._container)||void 0===e?void 0:e.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){return this._container&&this._container.classList.add(e),this}removeClassName(e){return this._container&&this._container.classList.remove(e),this}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}setSubpixelPositioning(e){this.options.subpixelPositioning=e}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;let e=this._container.querySelector(ns);e&&e.focus()}},e.RasterDEMTileSource=q,e.RasterTileSource=K,e.ScaleControl=class{constructor(e){this._onMove=()=>{ts(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ts(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},es),e)}getDefaultPosition(){return"bottom-left"}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},e.ScrollZoomHandler=ya,e.Style=br,e.TerrainControl=class{constructor(e){this._toggleTerrain=()=>{this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()},this._updateTerrainIcon=()=>{this._terrainButton.classList.remove("maplibregl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled"),this._map.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.Disable")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.Enable"))},this.options=e}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},e.TwoFingersTouchPitchHandler=ca,e.TwoFingersTouchRotateHandler=Aa,e.TwoFingersTouchZoomHandler=la,e.TwoFingersTouchZoomRotateHandler=Ba,e.VectorTileSource=G,e.VideoSource=$,e.addSourceType=(e,r)=>t._(void 0,void 0,void 0,(function*(){if(J(e))throw new Error(`A source type called "${e}" already exists.`);var t;t=r,Y[e]=t})),e.clearPrewarmedResources=function(){let e=L;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(F),L=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},e.createTileMesh=Wt,e.getMaxParallelImageRequests=function(){return t.a.MAX_PARALLEL_IMAGE_REQUESTS},e.getRTLTextPluginStatus=function(){return ie().getRTLTextPluginStatus()},e.getVersion=function(){return ss},e.getWorkerCount=function(){return P.workerCount},e.getWorkerUrl=function(){return t.a.WORKER_URL},e.importScriptInWorkers=function(e){return D().broadcast("IS",e)},e.prewarm=function(){U().acquire(F)},e.setMaxParallelImageRequests=function(e){t.a.MAX_PARALLEL_IMAGE_REQUESTS=e},e.setRTLTextPlugin=function(e,t){return ie().setRTLTextPlugin(e,t)},e.setWorkerCount=function(e){P.workerCount=e},e.setWorkerUrl=function(e){t.a.WORKER_URL=e}})),e},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=typeof globalThis<"u"?globalThis:r||self).maplibregl=i()})),c=o(((e,t)=>{(function(){var r,i="Expected a function",n="__lodash_hash_undefined__",a="__lodash_placeholder__",s=16,o=32,l=64,h=128,A=256,u=1/0,c=9007199254740991,d=NaN,p=4294967295,f=p-1,g=p>>>1,m=[["ary",h],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",o],["partialRight",l],["rearg",A]],y="[object Arguments]",_="[object Array]",v="[object Boolean]",w="[object Date]",b="[object Error]",x="[object Function]",B="[object GeneratorFunction]",C="[object Map]",S="[object Number]",E="[object Object]",I="[object Promise]",T="[object RegExp]",F="[object Set]",P="[object String]",L="[object Symbol]",M="[object WeakMap]",k="[object ArrayBuffer]",U="[object DataView]",R="[object Float32Array]",D="[object Float64Array]",N="[object Int8Array]",O="[object Int16Array]",Q="[object Int32Array]",z="[object Uint8Array]",H="[object Uint8ClampedArray]",j="[object Uint16Array]",V="[object Uint32Array]",G=/\b__p \+= '';/g,K=/\b(__p \+=) '' \+/g,q=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Z=/&(?:amp|lt|gt|quot|#39);/g,W=/[&<>"']/g,$=RegExp(Z.source),X=RegExp(W.source),Y=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ie=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ne=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(ne.source),se=/^\s+/,oe=/\s/,le=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,he=/\{\n\/\* \[wrapped with (.+)\] \*/,Ae=/,? & /,ue=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ce=/[()=,{}\[\]\/\s]/,de=/\\(\\)?/g,pe=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,fe=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,be=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,Be="\\ud800-\\udfff",Ce="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Se="\\u2700-\\u27bf",Ee="a-z\\xdf-\\xf6\\xf8-\\xff",Ie="A-Z\\xc0-\\xd6\\xd8-\\xde",Te="\\ufe0e\\ufe0f",Fe="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Pe="['’]",Le="["+Be+"]",Me="["+Fe+"]",ke="["+Ce+"]",Ue="\\d+",Re="["+Se+"]",De="["+Ee+"]",Ne="[^"+Be+Fe+Ue+Se+Ee+Ie+"]",Oe="\\ud83c[\\udffb-\\udfff]",Qe="[^"+Be+"]",ze="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",je="["+Ie+"]",Ve="\\u200d",Ge="(?:"+De+"|"+Ne+")",Ke="(?:"+je+"|"+Ne+")",qe="(?:['’](?:d|ll|m|re|s|t|ve))?",Ze="(?:['’](?:D|LL|M|RE|S|T|VE))?",We="(?:"+ke+"|"+Oe+")"+"?",$e="["+Te+"]?",Xe=$e+We+("(?:"+Ve+"(?:"+[Qe,ze,He].join("|")+")"+$e+We+")*"),Ye="(?:"+[Re,ze,He].join("|")+")"+Xe,Je="(?:"+[Qe+ke+"?",ke,ze,He,Le].join("|")+")",et=RegExp(Pe,"g"),tt=RegExp(ke,"g"),rt=RegExp(Oe+"(?="+Oe+")|"+Je+Xe,"g"),it=RegExp([je+"?"+De+"+"+qe+"(?="+[Me,je,"$"].join("|")+")",Ke+"+"+Ze+"(?="+[Me,je+Ge,"$"].join("|")+")",je+"?"+Ge+"+"+qe,je+"+"+Ze,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ue,Ye].join("|"),"g"),nt=RegExp("["+Ve+Be+Ce+Te+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,st=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ot=-1,lt={};lt[R]=lt[D]=lt[N]=lt[O]=lt[Q]=lt[z]=lt[H]=lt[j]=lt[V]=!0,lt[y]=lt[_]=lt[k]=lt[v]=lt[U]=lt[w]=lt[b]=lt[x]=lt[C]=lt[S]=lt[E]=lt[T]=lt[F]=lt[P]=lt[M]=!1;var ht={};ht[y]=ht[_]=ht[k]=ht[U]=ht[v]=ht[w]=ht[R]=ht[D]=ht[N]=ht[O]=ht[Q]=ht[C]=ht[S]=ht[E]=ht[T]=ht[F]=ht[P]=ht[L]=ht[z]=ht[H]=ht[j]=ht[V]=!0,ht[b]=ht[x]=ht[M]=!1;var At={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},ut=parseFloat,ct=parseInt,dt="object"==typeof global&&global&&global.Object===Object&&global,pt="object"==typeof self&&self&&self.Object===Object&&self,ft=dt||pt||Function("return this")(),gt="object"==typeof e&&e&&!e.nodeType&&e,mt=gt&&"object"==typeof t&&t&&!t.nodeType&&t,yt=mt&&mt.exports===gt,_t=yt&&dt.process,vt=function(){try{return mt&&mt.require&&mt.require("util").types||_t&&_t.binding&&_t.binding("util")}catch{}}(),wt=vt&&vt.isArrayBuffer,bt=vt&&vt.isDate,xt=vt&&vt.isMap,Bt=vt&&vt.isRegExp,Ct=vt&&vt.isSet,St=vt&&vt.isTypedArray;function Et(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function It(e,t,r,i){for(var n=-1,a=null==e?0:e.length;++n<a;){var s=e[n];t(i,s,r(s),e)}return i}function Tt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i&&!1!==t(e[r],r,e););return e}function Ft(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function Pt(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(!t(e[r],r,e))return!1;return!0}function Lt(e,t){for(var r=-1,i=null==e?0:e.length,n=0,a=[];++r<i;){var s=e[r];t(s,r,e)&&(a[n++]=s)}return a}function Mt(e,t){return!!(null==e?0:e.length)&&jt(e,t,0)>-1}function kt(e,t,r){for(var i=-1,n=null==e?0:e.length;++i<n;)if(r(t,e[i]))return!0;return!1}function Ut(e,t){for(var r=-1,i=null==e?0:e.length,n=Array(i);++r<i;)n[r]=t(e[r],r,e);return n}function Rt(e,t){for(var r=-1,i=t.length,n=e.length;++r<i;)e[n+r]=t[r];return e}function Dt(e,t,r,i){var n=-1,a=null==e?0:e.length;for(i&&a&&(r=e[++n]);++n<a;)r=t(r,e[n],n,e);return r}function Nt(e,t,r,i){var n=null==e?0:e.length;for(i&&n&&(r=e[--n]);n--;)r=t(r,e[n],n,e);return r}function Ot(e,t){for(var r=-1,i=null==e?0:e.length;++r<i;)if(t(e[r],r,e))return!0;return!1}var Qt=qt("length");function zt(e,t,r){var i;return r(e,(function(e,r,n){if(t(e,r,n))return i=r,!1})),i}function Ht(e,t,r,i){for(var n=e.length,a=r+(i?1:-1);i?a--:++a<n;)if(t(e[a],a,e))return a;return-1}function jt(e,t,r){return t==t?function(e,t,r){for(var i=r-1,n=e.length;++i<n;)if(e[i]===t)return i;return-1}(e,t,r):Ht(e,Gt,r)}function Vt(e,t,r,i){for(var n=r-1,a=e.length;++n<a;)if(i(e[n],t))return n;return-1}function Gt(e){return e!=e}function Kt(e,t){var r=null==e?0:e.length;return r?$t(e,t)/r:d}function qt(e){return function(t){return null==t?r:t[e]}}function Zt(e){return function(t){return null==e?r:e[t]}}function Wt(e,t,r,i,n){return n(e,(function(e,n,a){r=i?(i=!1,e):t(r,e,n,a)})),r}function $t(e,t){for(var i,n=-1,a=e.length;++n<a;){var s=t(e[n]);s!==r&&(i=i===r?s:i+s)}return i}function Xt(e,t){for(var r=-1,i=Array(e);++r<e;)i[r]=t(r);return i}function Yt(e){return e&&e.slice(0,pr(e)+1).replace(se,"")}function Jt(e){return function(t){return e(t)}}function er(e,t){return Ut(t,(function(t){return e[t]}))}function tr(e,t){return e.has(t)}function rr(e,t){for(var r=-1,i=e.length;++r<i&&jt(t,e[r],0)>-1;);return r}function ir(e,t){for(var r=e.length;r--&&jt(t,e[r],0)>-1;);return r}var nr=Zt({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","Ĳ":"IJ","ĳ":"ij","Œ":"Oe","œ":"oe","ŉ":"'n","ſ":"s"}),ar=Zt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function sr(e){return"\\"+At[e]}function or(e){return nt.test(e)}function lr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,i){r[++t]=[i,e]})),r}function hr(e,t){return function(r){return e(t(r))}}function Ar(e,t){for(var r=-1,i=e.length,n=0,s=[];++r<i;){var o=e[r];(o===t||o===a)&&(e[r]=a,s[n++]=r)}return s}function ur(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function cr(e){return or(e)?function(e){for(var t=rt.lastIndex=0;rt.test(e);)++t;return t}(e):Qt(e)}function dr(e){return or(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.split("")}(e)}function pr(e){for(var t=e.length;t--&&oe.test(e.charAt(t)););return t}var fr=Zt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var gr=function e(t){var oe,Be=(t=null==t?ft:gr.defaults(ft.Object(),t,gr.pick(ft,st))).Array,Ce=t.Date,Se=t.Error,Ee=t.Function,Ie=t.Math,Te=t.Object,Fe=t.RegExp,Pe=t.String,Le=t.TypeError,Me=Be.prototype,ke=Ee.prototype,Ue=Te.prototype,Re=t["__core-js_shared__"],De=ke.toString,Ne=Ue.hasOwnProperty,Oe=0,Qe=(oe=/[^.]+$/.exec(Re&&Re.keys&&Re.keys.IE_PROTO||""))?"Symbol(src)_1."+oe:"",ze=Ue.toString,He=De.call(Te),je=ft._,Ve=Fe("^"+De.call(Ne).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ge=yt?t.Buffer:r,Ke=t.Symbol,qe=t.Uint8Array,Ze=Ge?Ge.allocUnsafe:r,We=hr(Te.getPrototypeOf,Te),$e=Te.create,Xe=Ue.propertyIsEnumerable,Ye=Me.splice,Je=Ke?Ke.isConcatSpreadable:r,rt=Ke?Ke.iterator:r,nt=Ke?Ke.toStringTag:r,At=function(){try{var e=da(Te,"defineProperty");return e({},"",{}),e}catch{}}(),dt=t.clearTimeout!==ft.clearTimeout&&t.clearTimeout,pt=Ce&&Ce.now!==ft.Date.now&&Ce.now,gt=t.setTimeout!==ft.setTimeout&&t.setTimeout,mt=Ie.ceil,_t=Ie.floor,vt=Te.getOwnPropertySymbols,Qt=Ge?Ge.isBuffer:r,Zt=t.isFinite,mr=Me.join,yr=hr(Te.keys,Te),_r=Ie.max,vr=Ie.min,wr=Ce.now,br=t.parseInt,xr=Ie.random,Br=Me.reverse,Cr=da(t,"DataView"),Sr=da(t,"Map"),Er=da(t,"Promise"),Ir=da(t,"Set"),Tr=da(t,"WeakMap"),Fr=da(Te,"create"),Pr=Tr&&new Tr,Lr={},Mr=Oa(Cr),kr=Oa(Sr),Ur=Oa(Er),Rr=Oa(Ir),Dr=Oa(Tr),Nr=Ke?Ke.prototype:r,Or=Nr?Nr.valueOf:r,Qr=Nr?Nr.toString:r;function zr(e){if(ro(e)&&!Gs(e)&&!(e instanceof Gr)){if(e instanceof Vr)return e;if(Ne.call(e,"__wrapped__"))return Qa(e)}return new Vr(e)}var Hr=function(){function e(){}return function(t){if(!to(t))return{};if($e)return $e(t);e.prototype=t;var i=new e;return e.prototype=r,i}}();function jr(){}function Vr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function Gr(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=p,this.__views__=[]}function Kr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function qr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var i=e[t];this.set(i[0],i[1])}}function Wr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Zr;++t<r;)this.add(e[t])}function $r(e){var t=this.__data__=new qr(e);this.size=t.size}function Xr(e,t){var r=Gs(e),i=!r&&Vs(e),n=!r&&!i&&Ws(e),a=!r&&!i&&!n&&Ao(e),s=r||i||n||a,o=s?Xt(e.length,Pe):[],l=o.length;for(var h in e)(t||Ne.call(e,h))&&(!s||!("length"==h||n&&("offset"==h||"parent"==h)||a&&("buffer"==h||"byteLength"==h||"byteOffset"==h)||va(h,l)))&&o.push(h);return o}function Yr(e){var t=e.length;return t?e[Wi(0,t-1)]:r}function Jr(e,t){return Ra(Pn(e),li(t,0,e.length))}function ei(e){return Ra(Pn(e))}function ti(e,t,i){(i!==r&&!zs(e[t],i)||i===r&&!(t in e))&&si(e,t,i)}function ri(e,t,i){var n=e[t];(!Ne.call(e,t)||!zs(n,i)||i===r&&!(t in e))&&si(e,t,i)}function ii(e,t){for(var r=e.length;r--;)if(zs(e[r][0],t))return r;return-1}function ni(e,t,r,i){return di(e,(function(e,n,a){t(i,e,r(e),a)})),i}function ai(e,t){return e&&Ln(t,Mo(t),e)}function si(e,t,r){"__proto__"==t&&At?At(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function oi(e,t){for(var i=-1,n=t.length,a=Be(n),s=null==e;++i<n;)a[i]=s?r:Io(e,t[i]);return a}function li(e,t,i){return e==e&&(i!==r&&(e=e<=i?e:i),t!==r&&(e=e>=t?e:t)),e}function hi(e,t,i,n,a,s){var o,l=1&t,h=2&t,A=4&t;if(i&&(o=a?i(e,n,a,s):i(e)),o!==r)return o;if(!to(e))return e;var u=Gs(e);if(u){if(o=function(e){var t=e.length,r=new e.constructor(t);return t&&"string"==typeof e[0]&&Ne.call(e,"index")&&(r.index=e.index,r.input=e.input),r}(e),!l)return Pn(e,o)}else{var c=ga(e),d=c==x||c==B;if(Ws(e))return Cn(e,l);if(c==E||c==y||d&&!a){if(o=h||d?{}:ya(e),!l)return h?function(e,t){return Ln(e,fa(e),t)}(e,function(e,t){return e&&Ln(t,ko(t),e)}(o,e)):function(e,t){return Ln(e,pa(e),t)}(e,ai(o,e))}else{if(!ht[c])return a?e:{};o=function(e,t,r){var i=e.constructor;switch(t){case k:return Sn(e);case v:case w:return new i(+e);case U:return function(e,t){var r=t?Sn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case R:case D:case N:case O:case Q:case z:case H:case j:case V:return En(e,r);case C:return new i;case S:case P:return new i(e);case T:return function(e){var t=new e.constructor(e.source,fe.exec(e));return t.lastIndex=e.lastIndex,t}(e);case F:return new i;case L:return function(e){return Or?Te(Or.call(e)):{}}(e)}}(e,c,l)}}s||(s=new $r);var p=s.get(e);if(p)return p;s.set(e,o),oo(e)?e.forEach((function(r){o.add(hi(r,t,i,r,e,s))})):io(e)&&e.forEach((function(r,n){o.set(n,hi(r,t,i,n,e,s))}));var f=u?r:(A?h?sa:aa:h?ko:Mo)(e);return Tt(f||e,(function(r,n){f&&(r=e[n=r]),ri(o,n,hi(r,t,i,n,e,s))})),o}function Ai(e,t,i){var n=i.length;if(null==e)return!n;for(e=Te(e);n--;){var a=i[n],s=t[a],o=e[a];if(o===r&&!(a in e)||!s(o))return!1}return!0}function ui(e,t,n){if("function"!=typeof e)throw new Le(i);return La((function(){e.apply(r,n)}),t)}function ci(e,t,r,i){var n=-1,a=Mt,s=!0,o=e.length,l=[],h=t.length;if(!o)return l;r&&(t=Ut(t,Jt(r))),i?(a=kt,s=!1):t.length>=200&&(a=tr,s=!1,t=new Wr(t));e:for(;++n<o;){var A=e[n],u=null==r?A:r(A);if(A=i||0!==A?A:0,s&&u==u){for(var c=h;c--;)if(t[c]===u)continue e;l.push(A)}else a(t,u,i)||l.push(A)}return l}zr.templateSettings={escape:Y,evaluate:J,interpolate:ee,variable:"",imports:{_:zr}},zr.prototype=jr.prototype,zr.prototype.constructor=zr,Vr.prototype=Hr(jr.prototype),Vr.prototype.constructor=Vr,Gr.prototype=Hr(jr.prototype),Gr.prototype.constructor=Gr,Kr.prototype.clear=function(){this.__data__=Fr?Fr(null):{},this.size=0},Kr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Kr.prototype.get=function(e){var t=this.__data__;if(Fr){var i=t[e];return i===n?r:i}return Ne.call(t,e)?t[e]:r},Kr.prototype.has=function(e){var t=this.__data__;return Fr?t[e]!==r:Ne.call(t,e)},Kr.prototype.set=function(e,t){var i=this.__data__;return this.size+=this.has(e)?0:1,i[e]=Fr&&t===r?n:t,this},qr.prototype.clear=function(){this.__data__=[],this.size=0},qr.prototype.delete=function(e){var t=this.__data__,r=ii(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ye.call(t,r,1),--this.size,!0)},qr.prototype.get=function(e){var t=this.__data__,i=ii(t,e);return i<0?r:t[i][1]},qr.prototype.has=function(e){return ii(this.__data__,e)>-1},qr.prototype.set=function(e,t){var r=this.__data__,i=ii(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this},Zr.prototype.clear=function(){this.size=0,this.__data__={hash:new Kr,map:new(Sr||qr),string:new Kr}},Zr.prototype.delete=function(e){var t=ua(this,e).delete(e);return this.size-=t?1:0,t},Zr.prototype.get=function(e){return ua(this,e).get(e)},Zr.prototype.has=function(e){return ua(this,e).has(e)},Zr.prototype.set=function(e,t){var r=ua(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this},Wr.prototype.add=Wr.prototype.push=function(e){return this.__data__.set(e,n),this},Wr.prototype.has=function(e){return this.__data__.has(e)},$r.prototype.clear=function(){this.__data__=new qr,this.size=0},$r.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},$r.prototype.get=function(e){return this.__data__.get(e)},$r.prototype.has=function(e){return this.__data__.has(e)},$r.prototype.set=function(e,t){var r=this.__data__;if(r instanceof qr){var i=r.__data__;if(!Sr||i.length<199)return i.push([e,t]),this.size=++r.size,this;r=this.__data__=new Zr(i)}return r.set(e,t),this.size=r.size,this};var di=Un(wi),pi=Un(bi,!0);function fi(e,t){var r=!0;return di(e,(function(e,i,n){return r=!!t(e,i,n)})),r}function gi(e,t,i){for(var n=-1,a=e.length;++n<a;){var s=e[n],o=t(s);if(null!=o&&(l===r?o==o&&!ho(o):i(o,l)))var l=o,h=s}return h}function mi(e,t){var r=[];return di(e,(function(e,i,n){t(e,i,n)&&r.push(e)})),r}function yi(e,t,r,i,n){var a=-1,s=e.length;for(r||(r=_a),n||(n=[]);++a<s;){var o=e[a];t>0&&r(o)?t>1?yi(o,t-1,r,i,n):Rt(n,o):i||(n[n.length]=o)}return n}var _i=Rn(),vi=Rn(!0);function wi(e,t){return e&&_i(e,t,Mo)}function bi(e,t){return e&&vi(e,t,Mo)}function xi(e,t){return Lt(t,(function(t){return Ys(e[t])}))}function Bi(e,t){for(var i=0,n=(t=wn(t,e)).length;null!=e&&i<n;)e=e[Na(t[i++])];return i&&i==n?e:r}function Ci(e,t,r){var i=t(e);return Gs(e)?i:Rt(i,r(e))}function Si(e){return null==e?e===r?"[object Undefined]":"[object Null]":nt&&nt in Te(e)?function(e){var t=Ne.call(e,nt),i=e[nt];try{e[nt]=r;var n=!0}catch{}var a=ze.call(e);return n&&(t?e[nt]=i:delete e[nt]),a}(e):function(e){return ze.call(e)}(e)}function Ei(e,t){return e>t}function Ii(e,t){return null!=e&&Ne.call(e,t)}function Ti(e,t){return null!=e&&t in Te(e)}function Fi(e,t,i){for(var n=i?kt:Mt,a=e[0].length,s=e.length,o=s,l=Be(s),h=1/0,A=[];o--;){var u=e[o];o&&t&&(u=Ut(u,Jt(t))),h=vr(u.length,h),l[o]=!i&&(t||a>=120&&u.length>=120)?new Wr(o&&u):r}u=e[0];var c=-1,d=l[0];e:for(;++c<a&&A.length<h;){var p=u[c],f=t?t(p):p;if(p=i||0!==p?p:0,!(d?tr(d,f):n(A,f,i))){for(o=s;--o;){var g=l[o];if(!(g?tr(g,f):n(e[o],f,i)))continue e}d&&d.push(f),A.push(p)}}return A}function Pi(e,t,i){var n=null==(e=Ta(e,t=wn(t,e)))?e:e[Na(Xa(t))];return null==n?r:Et(n,e,i)}function Li(e){return ro(e)&&Si(e)==y}function Mi(e,t,i,n,a){return e===t||(null==e||null==t||!ro(e)&&!ro(t)?e!=e&&t!=t:function(e,t,i,n,a,s){var o=Gs(e),l=Gs(t),h=o?_:ga(e),A=l?_:ga(t),u=(h=h==y?E:h)==E,c=(A=A==y?E:A)==E,d=h==A;if(d&&Ws(e)){if(!Ws(t))return!1;o=!0,u=!1}if(d&&!u)return s||(s=new $r),o||Ao(e)?ia(e,t,i,n,a,s):function(e,t,r,i,n,a,s){switch(r){case U:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case k:return!(e.byteLength!=t.byteLength||!a(new qe(e),new qe(t)));case v:case w:case S:return zs(+e,+t);case b:return e.name==t.name&&e.message==t.message;case T:case P:return e==t+"";case C:var o=lr;case F:var l=1&i;if(o||(o=ur),e.size!=t.size&&!l)return!1;var h=s.get(e);if(h)return h==t;i|=2,s.set(e,t);var A=ia(o(e),o(t),i,n,a,s);return s.delete(e),A;case L:if(Or)return Or.call(e)==Or.call(t)}return!1}(e,t,h,i,n,a,s);if(!(1&i)){var p=u&&Ne.call(e,"__wrapped__"),f=c&&Ne.call(t,"__wrapped__");if(p||f){var g=p?e.value():e,m=f?t.value():t;return s||(s=new $r),a(g,m,i,n,s)}}return!!d&&(s||(s=new $r),function(e,t,i,n,a,s){var o=1&i,l=aa(e),h=l.length,A=aa(t),u=A.length;if(h!=u&&!o)return!1;for(var c=h;c--;){var d=l[c];if(!(o?d in t:Ne.call(t,d)))return!1}var p=s.get(e),f=s.get(t);if(p&&f)return p==t&&f==e;var g=!0;s.set(e,t),s.set(t,e);for(var m=o;++c<h;){var y=e[d=l[c]],_=t[d];if(n)var v=o?n(_,y,d,t,e,s):n(y,_,d,e,t,s);if(!(v===r?y===_||a(y,_,i,n,s):v)){g=!1;break}m||(m="constructor"==d)}if(g&&!m){var w=e.constructor,b=t.constructor;w!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof w&&w instanceof w&&"function"==typeof b&&b instanceof b)&&(g=!1)}return s.delete(e),s.delete(t),g}(e,t,i,n,a,s))}(e,t,i,n,Mi,a))}function ki(e,t,i,n){var a=i.length,s=a,o=!n;if(null==e)return!s;for(e=Te(e);a--;){var l=i[a];if(o&&l[2]?l[1]!==e[l[0]]:!(l[0]in e))return!1}for(;++a<s;){var h=(l=i[a])[0],A=e[h],u=l[1];if(o&&l[2]){if(A===r&&!(h in e))return!1}else{var c=new $r;if(n)var d=n(A,u,h,e,t,c);if(!(d===r?Mi(u,A,3,n,c):d))return!1}}return!0}function Ui(e){return!(!to(e)||function(e){return!!Qe&&Qe in e}(e))&&(Ys(e)?Ve:ye).test(Oa(e))}function Ri(e){return"function"==typeof e?e:null==e?al:"object"==typeof e?Gs(e)?Hi(e[0],e[1]):zi(e):pl(e)}function Di(e){if(!Ca(e))return yr(e);var t=[];for(var r in Te(e))Ne.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Ni(e){if(!to(e))return function(e){var t=[];if(null!=e)for(var r in Te(e))t.push(r);return t}(e);var t=Ca(e),r=[];for(var i in e)"constructor"==i&&(t||!Ne.call(e,i))||r.push(i);return r}function Oi(e,t){return e<t}function Qi(e,t){var r=-1,i=qs(e)?Be(e.length):[];return di(e,(function(e,n,a){i[++r]=t(e,n,a)})),i}function zi(e){var t=ca(e);return 1==t.length&&t[0][2]?Ea(t[0][0],t[0][1]):function(r){return r===e||ki(r,e,t)}}function Hi(e,t){return ba(e)&&Sa(t)?Ea(Na(e),t):function(i){var n=Io(i,e);return n===r&&n===t?To(i,e):Mi(t,n,3)}}function ji(e,t,i,n,a){e!==t&&_i(t,(function(s,o){if(a||(a=new $r),to(s))!function(e,t,i,n,a,s,o){var l=Fa(e,i),h=Fa(t,i),A=o.get(h);if(A)return void ti(e,i,A);var u=s?s(l,h,i+"",e,t,o):r,c=u===r;if(c){var d=Gs(h),p=!d&&Ws(h),f=!d&&!p&&Ao(h);u=h,d||p||f?Gs(l)?u=l:Zs(l)?u=Pn(l):p?(c=!1,u=Cn(h,!0)):f?(c=!1,u=En(h,!0)):u=[]:ao(h)||Vs(h)?(u=l,Vs(l)?u=_o(l):(!to(l)||Ys(l))&&(u=ya(h))):c=!1}c&&(o.set(h,u),a(u,h,n,s,o),o.delete(h)),ti(e,i,u)}(e,t,o,i,ji,n,a);else{var l=n?n(Fa(e,o),s,o+"",e,t,a):r;l===r&&(l=s),ti(e,o,l)}}),ko)}function Vi(e,t){var i=e.length;if(i)return va(t+=t<0?i:0,i)?e[t]:r}function Gi(e,t,r){t=t.length?Ut(t,(function(e){return Gs(e)?function(t){return Bi(t,1===e.length?e[0]:e)}:e})):[al];var i=-1;return t=Ut(t,Jt(Aa())),function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(Qi(e,(function(e,r,n){return{criteria:Ut(t,(function(t){return t(e)})),index:++i,value:e}})),(function(e,t){return function(e,t,r){for(var i=-1,n=e.criteria,a=t.criteria,s=n.length,o=r.length;++i<s;){var l=In(n[i],a[i]);if(l)return i>=o?l:l*("desc"==r[i]?-1:1)}return e.index-t.index}(e,t,r)}))}function Ki(e,t,r){for(var i=-1,n=t.length,a={};++i<n;){var s=t[i],o=Bi(e,s);r(o,s)&&en(a,wn(s,e),o)}return a}function qi(e,t,r,i){var n=i?Vt:jt,a=-1,s=t.length,o=e;for(e===t&&(t=Pn(t)),r&&(o=Ut(e,Jt(r)));++a<s;)for(var l=0,h=t[a],A=r?r(h):h;(l=n(o,A,l,i))>-1;)o!==e&&Ye.call(o,l,1),Ye.call(e,l,1);return e}function Zi(e,t){for(var r=e?t.length:0,i=r-1;r--;){var n=t[r];if(r==i||n!==a){var a=n;va(n)?Ye.call(e,n,1):dn(e,n)}}return e}function Wi(e,t){return e+_t(xr()*(t-e+1))}function $i(e,t){var r="";if(!e||t<1||t>c)return r;do{t%2&&(r+=e),(t=_t(t/2))&&(e+=e)}while(t);return r}function Xi(e,t){return Ma(Ia(e,t,al),e+"")}function Yi(e){return Yr(Ho(e))}function Ji(e,t){var r=Ho(e);return Ra(r,li(t,0,r.length))}function en(e,t,i,n){if(!to(e))return e;for(var a=-1,s=(t=wn(t,e)).length,o=s-1,l=e;null!=l&&++a<s;){var h=Na(t[a]),A=i;if("__proto__"===h||"constructor"===h||"prototype"===h)return e;if(a!=o){var u=l[h];(A=n?n(u,h,l):r)===r&&(A=to(u)?u:va(t[a+1])?[]:{})}ri(l,h,A),l=l[h]}return e}var tn=Pr?function(e,t){return Pr.set(e,t),e}:al,rn=At?function(e,t){return At(e,"toString",{configurable:!0,enumerable:!1,value:rl(t),writable:!0})}:al;function nn(e){return Ra(Ho(e))}function an(e,t,r){var i=-1,n=e.length;t<0&&(t=-t>n?0:n+t),(r=r>n?n:r)<0&&(r+=n),n=t>r?0:r-t>>>0,t>>>=0;for(var a=Be(n);++i<n;)a[i]=e[i+t];return a}function sn(e,t){var r;return di(e,(function(e,i,n){return!(r=t(e,i,n))})),!!r}function on(e,t,r){var i=0,n=null==e?i:e.length;if("number"==typeof t&&t==t&&n<=g){for(;i<n;){var a=i+n>>>1,s=e[a];null!==s&&!ho(s)&&(r?s<=t:s<t)?i=a+1:n=a}return n}return ln(e,t,al,r)}function ln(e,t,i,n){var a=0,s=null==e?0:e.length;if(0===s)return 0;for(var o=(t=i(t))!=t,l=null===t,h=ho(t),A=t===r;a<s;){var u=_t((a+s)/2),c=i(e[u]),d=c!==r,p=null===c,g=c==c,m=ho(c);if(o)var y=n||g;else y=A?g&&(n||d):l?g&&d&&(n||!p):h?g&&d&&!p&&(n||!m):!p&&!m&&(n?c<=t:c<t);y?a=u+1:s=u}return vr(s,f)}function hn(e,t){for(var r=-1,i=e.length,n=0,a=[];++r<i;){var s=e[r],o=t?t(s):s;if(!r||!zs(o,l)){var l=o;a[n++]=0===s?0:s}}return a}function An(e){return"number"==typeof e?e:ho(e)?d:+e}function un(e){if("string"==typeof e)return e;if(Gs(e))return Ut(e,un)+"";if(ho(e))return Qr?Qr.call(e):"";var t=e+"";return"0"==t&&1/e==-u?"-0":t}function cn(e,t,r){var i=-1,n=Mt,a=e.length,s=!0,o=[],l=o;if(r)s=!1,n=kt;else if(a>=200){var h=t?null:Xn(e);if(h)return ur(h);s=!1,n=tr,l=new Wr}else l=t?[]:o;e:for(;++i<a;){var A=e[i],u=t?t(A):A;if(A=r||0!==A?A:0,s&&u==u){for(var c=l.length;c--;)if(l[c]===u)continue e;t&&l.push(u),o.push(A)}else n(l,u,r)||(l!==o&&l.push(u),o.push(A))}return o}function dn(e,t){return null==(e=Ta(e,t=wn(t,e)))||delete e[Na(Xa(t))]}function pn(e,t,r,i){return en(e,t,r(Bi(e,t)),i)}function fn(e,t,r,i){for(var n=e.length,a=i?n:-1;(i?a--:++a<n)&&t(e[a],a,e););return r?an(e,i?0:a,i?a+1:n):an(e,i?a+1:0,i?n:a)}function gn(e,t){var r=e;return r instanceof Gr&&(r=r.value()),Dt(t,(function(e,t){return t.func.apply(t.thisArg,Rt([e],t.args))}),r)}function mn(e,t,r){var i=e.length;if(i<2)return i?cn(e[0]):[];for(var n=-1,a=Be(i);++n<i;)for(var s=e[n],o=-1;++o<i;)o!=n&&(a[n]=ci(a[n]||s,e[o],t,r));return cn(yi(a,1),t,r)}function yn(e,t,i){for(var n=-1,a=e.length,s=t.length,o={};++n<a;){var l=n<s?t[n]:r;i(o,e[n],l)}return o}function _n(e){return Zs(e)?e:[]}function vn(e){return"function"==typeof e?e:al}function wn(e,t){return Gs(e)?e:ba(e,t)?[e]:Da(vo(e))}var bn=Xi;function xn(e,t,i){var n=e.length;return i=i===r?n:i,!t&&i>=n?e:an(e,t,i)}var Bn=dt||function(e){return ft.clearTimeout(e)};function Cn(e,t){if(t)return e.slice();var r=e.length,i=Ze?Ze(r):new e.constructor(r);return e.copy(i),i}function Sn(e){var t=new e.constructor(e.byteLength);return new qe(t).set(new qe(e)),t}function En(e,t){var r=t?Sn(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function In(e,t){if(e!==t){var i=e!==r,n=null===e,a=e==e,s=ho(e),o=t!==r,l=null===t,h=t==t,A=ho(t);if(!l&&!A&&!s&&e>t||s&&o&&h&&!l&&!A||n&&o&&h||!i&&h||!a)return 1;if(!n&&!s&&!A&&e<t||A&&i&&a&&!n&&!s||l&&i&&a||!o&&a||!h)return-1}return 0}function Tn(e,t,r,i){for(var n=-1,a=e.length,s=r.length,o=-1,l=t.length,h=_r(a-s,0),A=Be(l+h),u=!i;++o<l;)A[o]=t[o];for(;++n<s;)(u||n<a)&&(A[r[n]]=e[n]);for(;h--;)A[o++]=e[n++];return A}function Fn(e,t,r,i){for(var n=-1,a=e.length,s=-1,o=r.length,l=-1,h=t.length,A=_r(a-o,0),u=Be(A+h),c=!i;++n<A;)u[n]=e[n];for(var d=n;++l<h;)u[d+l]=t[l];for(;++s<o;)(c||n<a)&&(u[d+r[s]]=e[n++]);return u}function Pn(e,t){var r=-1,i=e.length;for(t||(t=Be(i));++r<i;)t[r]=e[r];return t}function Ln(e,t,i,n){var a=!i;i||(i={});for(var s=-1,o=t.length;++s<o;){var l=t[s],h=n?n(i[l],e[l],l,i,e):r;h===r&&(h=e[l]),a?si(i,l,h):ri(i,l,h)}return i}function Mn(e,t){return function(r,i){var n=Gs(r)?It:ni,a=t?t():{};return n(r,e,Aa(i,2),a)}}function kn(e){return Xi((function(t,i){var n=-1,a=i.length,s=a>1?i[a-1]:r,o=a>2?i[2]:r;for(s=e.length>3&&"function"==typeof s?(a--,s):r,o&&wa(i[0],i[1],o)&&(s=a<3?r:s,a=1),t=Te(t);++n<a;){var l=i[n];l&&e(t,l,n,s)}return t}))}function Un(e,t){return function(r,i){if(null==r)return r;if(!qs(r))return e(r,i);for(var n=r.length,a=t?n:-1,s=Te(r);(t?a--:++a<n)&&!1!==i(s[a],a,s););return r}}function Rn(e){return function(t,r,i){for(var n=-1,a=Te(t),s=i(t),o=s.length;o--;){var l=s[e?o:++n];if(!1===r(a[l],l,a))break}return t}}function Dn(e){return function(t){var i=or(t=vo(t))?dr(t):r,n=i?i[0]:t.charAt(0),a=i?xn(i,1).join(""):t.slice(1);return n[e]()+a}}function Nn(e){return function(t){return Dt(Jo(Go(t).replace(et,"")),e,"")}}function On(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=Hr(e.prototype),i=e.apply(r,t);return to(i)?i:r}}function Qn(e){return function(t,i,n){var a=Te(t);if(!qs(t)){var s=Aa(i,3);t=Mo(t),i=function(e){return s(a[e],e,a)}}var o=e(t,i,n);return o>-1?a[s?t[o]:o]:r}}function zn(e){return na((function(t){var n=t.length,a=n,s=Vr.prototype.thru;for(e&&t.reverse();a--;){var o=t[a];if("function"!=typeof o)throw new Le(i);if(s&&!l&&"wrapper"==la(o))var l=new Vr([],!0)}for(a=l?a:n;++a<n;){var h=la(o=t[a]),A="wrapper"==h?oa(o):r;l=A&&xa(A[0])&&424==A[1]&&!A[4].length&&1==A[9]?l[la(A[0])].apply(l,A[3]):1==o.length&&xa(o)?l[h]():l.thru(o)}return function(){var e=arguments,r=e[0];if(l&&1==e.length&&Gs(r))return l.plant(r).value();for(var i=0,a=n?t[i].apply(this,e):r;++i<n;)a=t[i].call(this,a);return a}}))}function Hn(e,t,i,n,a,s,o,l,A,u){var c=t&h,d=1&t,p=2&t,f=24&t,g=512&t,m=p?r:On(e);return function h(){for(var y=arguments.length,_=Be(y),v=y;v--;)_[v]=arguments[v];if(f)var w=ha(h),b=function(e,t){for(var r=e.length,i=0;r--;)e[r]===t&&++i;return i}(_,w);if(n&&(_=Tn(_,n,a,f)),s&&(_=Fn(_,s,o,f)),y-=b,f&&y<u){var x=Ar(_,w);return Wn(e,t,Hn,h.placeholder,i,_,x,l,A,u-y)}var B=d?i:this,C=p?B[e]:e;return y=_.length,l?_=function(e,t){for(var i=e.length,n=vr(t.length,i),a=Pn(e);n--;){var s=t[n];e[n]=va(s,i)?a[s]:r}return e}(_,l):g&&y>1&&_.reverse(),c&&A<y&&(_.length=A),this&&this!==ft&&this instanceof h&&(C=m||On(C)),C.apply(B,_)}}function jn(e,t){return function(r,i){return function(e,t,r,i){return wi(e,(function(e,n,a){t(i,r(e),n,a)})),i}(r,e,t(i),{})}}function Vn(e,t){return function(i,n){var a;if(i===r&&n===r)return t;if(i!==r&&(a=i),n!==r){if(a===r)return n;"string"==typeof i||"string"==typeof n?(i=un(i),n=un(n)):(i=An(i),n=An(n)),a=e(i,n)}return a}}function Gn(e){return na((function(t){return t=Ut(t,Jt(Aa())),Xi((function(r){var i=this;return e(t,(function(e){return Et(e,i,r)}))}))}))}function Kn(e,t){var i=(t=t===r?" ":un(t)).length;if(i<2)return i?$i(t,e):t;var n=$i(t,mt(e/cr(t)));return or(t)?xn(dr(n),0,e).join(""):n.slice(0,e)}function qn(e){return function(t,i,n){return n&&"number"!=typeof n&&wa(t,i,n)&&(i=n=r),t=fo(t),i===r?(i=t,t=0):i=fo(i),function(e,t,r,i){for(var n=-1,a=_r(mt((t-e)/(r||1)),0),s=Be(a);a--;)s[i?a:++n]=e,e+=r;return s}(t,i,n=n===r?t<i?1:-1:fo(n),e)}}function Zn(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=yo(t),r=yo(r)),e(t,r)}}function Wn(e,t,i,n,a,s,h,A,u,c){var d=8&t;t|=d?o:l,4&(t&=~(d?l:o))||(t&=-4);var p=[e,t,a,d?s:r,d?h:r,d?r:s,d?r:h,A,u,c],f=i.apply(r,p);return xa(e)&&Pa(f,p),f.placeholder=n,ka(f,e,t)}function $n(e){var t=Ie[e];return function(e,r){if(e=yo(e),(r=null==r?0:vr(go(r),292))&&Zt(e)){var i=(vo(e)+"e").split("e");return+((i=(vo(t(i[0]+"e"+(+i[1]+r)))+"e").split("e"))[0]+"e"+(+i[1]-r))}return t(e)}}var Xn=Ir&&1/ur(new Ir([,-0]))[1]==u?function(e){return new Ir(e)}:Al;function Yn(e){return function(t){var r=ga(t);return r==C?lr(t):r==F?function(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}(t):function(e,t){return Ut(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Jn(e,t,n,u,c,d,p,f){var g=2&t;if(!g&&"function"!=typeof e)throw new Le(i);var m=u?u.length:0;if(m||(t&=-97,u=c=r),p=p===r?p:_r(go(p),0),f=f===r?f:go(f),m-=c?c.length:0,t&l){var y=u,_=c;u=c=r}var v=g?r:oa(e),w=[e,t,n,u,c,y,_,d,p,f];if(v&&function(e,t){var r=e[1],i=t[1],n=r|i,s=n<131,o=i==h&&8==r||i==h&&r==A&&e[7].length<=t[8]||384==i&&t[7].length<=t[8]&&8==r;if(!s&&!o)return e;1&i&&(e[2]=t[2],n|=1&r?0:4);var l=t[3];if(l){var u=e[3];e[3]=u?Tn(u,l,t[4]):l,e[4]=u?Ar(e[3],a):t[4]}l=t[5],l&&(u=e[5],e[5]=u?Fn(u,l,t[6]):l,e[6]=u?Ar(e[5],a):t[6]),l=t[7],l&&(e[7]=l),i&h&&(e[8]=null==e[8]?t[8]:vr(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=n}(w,v),e=w[0],t=w[1],n=w[2],u=w[3],c=w[4],!(f=w[9]=w[9]===r?g?0:e.length:_r(w[9]-m,0))&&24&t&&(t&=-25),t&&1!=t)b=8==t||t==s?function(e,t,i){var n=On(e);return function a(){for(var s=arguments.length,o=Be(s),l=s,h=ha(a);l--;)o[l]=arguments[l];var A=s<3&&o[0]!==h&&o[s-1]!==h?[]:Ar(o,h);return(s-=A.length)<i?Wn(e,t,Hn,a.placeholder,r,o,A,r,r,i-s):Et(this&&this!==ft&&this instanceof a?n:e,this,o)}}(e,t,f):t!=o&&33!=t||c.length?Hn.apply(r,w):function(e,t,r,i){var n=1&t,a=On(e);return function t(){for(var s=-1,o=arguments.length,l=-1,h=i.length,A=Be(h+o),u=this&&this!==ft&&this instanceof t?a:e;++l<h;)A[l]=i[l];for(;o--;)A[l++]=arguments[++s];return Et(u,n?r:this,A)}}(e,t,n,u);else var b=function(e,t,r){var i=1&t,n=On(e);return function t(){return(this&&this!==ft&&this instanceof t?n:e).apply(i?r:this,arguments)}}(e,t,n);return ka((v?tn:Pa)(b,w),e,t)}function ea(e,t,i,n){return e===r||zs(e,Ue[i])&&!Ne.call(n,i)?t:e}function ta(e,t,i,n,a,s){return to(e)&&to(t)&&(s.set(t,e),ji(e,t,r,ta,s),s.delete(t)),e}function ra(e){return ao(e)?r:e}function ia(e,t,i,n,a,s){var o=1&i,l=e.length,h=t.length;if(l!=h&&!(o&&h>l))return!1;var A=s.get(e),u=s.get(t);if(A&&u)return A==t&&u==e;var c=-1,d=!0,p=2&i?new Wr:r;for(s.set(e,t),s.set(t,e);++c<l;){var f=e[c],g=t[c];if(n)var m=o?n(g,f,c,t,e,s):n(f,g,c,e,t,s);if(m!==r){if(m)continue;d=!1;break}if(p){if(!Ot(t,(function(e,t){if(!tr(p,t)&&(f===e||a(f,e,i,n,s)))return p.push(t)}))){d=!1;break}}else if(f!==g&&!a(f,g,i,n,s)){d=!1;break}}return s.delete(e),s.delete(t),d}function na(e){return Ma(Ia(e,r,Ka),e+"")}function aa(e){return Ci(e,Mo,pa)}function sa(e){return Ci(e,ko,fa)}var oa=Pr?function(e){return Pr.get(e)}:Al;function la(e){for(var t=e.name+"",r=Lr[t],i=Ne.call(Lr,t)?r.length:0;i--;){var n=r[i],a=n.func;if(null==a||a==e)return n.name}return t}function ha(e){return(Ne.call(zr,"placeholder")?zr:e).placeholder}function Aa(){var e=zr.iteratee||sl;return e=e===sl?Ri:e,arguments.length?e(arguments[0],arguments[1]):e}function ua(e,t){var r=e.__data__;return function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}(t)?r["string"==typeof t?"string":"hash"]:r.map}function ca(e){for(var t=Mo(e),r=t.length;r--;){var i=t[r],n=e[i];t[r]=[i,n,Sa(n)]}return t}function da(e,t){var i=function(e,t){return null==e?r:e[t]}(e,t);return Ui(i)?i:r}var pa=vt?function(e){return null==e?[]:(e=Te(e),Lt(vt(e),(function(t){return Xe.call(e,t)})))}:ml,fa=vt?function(e){for(var t=[];e;)Rt(t,pa(e)),e=We(e);return t}:ml,ga=Si;function ma(e,t,r){for(var i=-1,n=(t=wn(t,e)).length,a=!1;++i<n;){var s=Na(t[i]);if(!(a=null!=e&&r(e,s)))break;e=e[s]}return a||++i!=n?a:!!(n=null==e?0:e.length)&&eo(n)&&va(s,n)&&(Gs(e)||Vs(e))}function ya(e){return"function"!=typeof e.constructor||Ca(e)?{}:Hr(We(e))}function _a(e){return Gs(e)||Vs(e)||!!(Je&&e&&e[Je])}function va(e,t){var r=typeof e;return!!(t=t??c)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function wa(e,t,r){if(!to(r))return!1;var i=typeof t;return!!("number"==i?qs(r)&&va(t,r.length):"string"==i&&t in r)&&zs(r[t],e)}function ba(e,t){if(Gs(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ho(e))||(re.test(e)||!te.test(e)||null!=t&&e in Te(t))}function xa(e){var t=la(e),r=zr[t];if("function"!=typeof r||!(t in Gr.prototype))return!1;if(e===r)return!0;var i=oa(r);return!!i&&e===i[0]}(Cr&&ga(new Cr(new ArrayBuffer(1)))!=U||Sr&&ga(new Sr)!=C||Er&&ga(Er.resolve())!=I||Ir&&ga(new Ir)!=F||Tr&&ga(new Tr)!=M)&&(ga=function(e){var t=Si(e),i=t==E?e.constructor:r,n=i?Oa(i):"";if(n)switch(n){case Mr:return U;case kr:return C;case Ur:return I;case Rr:return F;case Dr:return M}return t});var Ba=Re?Ys:yl;function Ca(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Ue)}function Sa(e){return e==e&&!to(e)}function Ea(e,t){return function(i){return null!=i&&(i[e]===t&&(t!==r||e in Te(i)))}}function Ia(e,t,i){return t=_r(t===r?e.length-1:t,0),function(){for(var r=arguments,n=-1,a=_r(r.length-t,0),s=Be(a);++n<a;)s[n]=r[t+n];n=-1;for(var o=Be(t+1);++n<t;)o[n]=r[n];return o[t]=i(s),Et(e,this,o)}}function Ta(e,t){return t.length<2?e:Bi(e,an(t,0,-1))}function Fa(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Pa=Ua(tn),La=gt||function(e,t){return ft.setTimeout(e,t)},Ma=Ua(rn);function ka(e,t,r){var i=t+"";return Ma(e,function(e,t){var r=t.length;if(!r)return e;var i=r-1;return t[i]=(r>1?"& ":"")+t[i],t=t.join(r>2?", ":" "),e.replace(le,"{\n/* [wrapped with "+t+"] */\n")}(i,function(e,t){return Tt(m,(function(r){var i="_."+r[0];t&r[1]&&!Mt(e,i)&&e.push(i)})),e.sort()}(function(e){var t=e.match(he);return t?t[1].split(Ae):[]}(i),r)))}function Ua(e){var t=0,i=0;return function(){var n=wr(),a=16-(n-i);if(i=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ra(e,t){var i=-1,n=e.length,a=n-1;for(t=t===r?n:t;++i<t;){var s=Wi(i,a),o=e[s];e[s]=e[i],e[i]=o}return e.length=t,e}var Da=function(e){var t=Us(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ie,(function(e,r,i,n){t.push(i?n.replace(de,"$1"):r||e)})),t}));function Na(e){if("string"==typeof e||ho(e))return e;var t=e+"";return"0"==t&&1/e==-u?"-0":t}function Oa(e){if(null!=e){try{return De.call(e)}catch{}try{return e+""}catch{}}return""}function Qa(e){if(e instanceof Gr)return e.clone();var t=new Vr(e.__wrapped__,e.__chain__);return t.__actions__=Pn(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var za=Xi((function(e,t){return Zs(e)?ci(e,yi(t,1,Zs,!0)):[]})),Ha=Xi((function(e,t){var i=Xa(t);return Zs(i)&&(i=r),Zs(e)?ci(e,yi(t,1,Zs,!0),Aa(i,2)):[]})),ja=Xi((function(e,t){var i=Xa(t);return Zs(i)&&(i=r),Zs(e)?ci(e,yi(t,1,Zs,!0),r,i):[]}));function Va(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:go(r);return n<0&&(n=_r(i+n,0)),Ht(e,Aa(t,3),n)}function Ga(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var a=n-1;return i!==r&&(a=go(i),a=i<0?_r(n+a,0):vr(a,n-1)),Ht(e,Aa(t,3),a,!0)}function Ka(e){return(null==e?0:e.length)?yi(e,1):[]}function qa(e){return e&&e.length?e[0]:r}var Za=Xi((function(e){var t=Ut(e,_n);return t.length&&t[0]===e[0]?Fi(t):[]})),Wa=Xi((function(e){var t=Xa(e),i=Ut(e,_n);return t===Xa(i)?t=r:i.pop(),i.length&&i[0]===e[0]?Fi(i,Aa(t,2)):[]})),$a=Xi((function(e){var t=Xa(e),i=Ut(e,_n);return(t="function"==typeof t?t:r)&&i.pop(),i.length&&i[0]===e[0]?Fi(i,r,t):[]}));function Xa(e){var t=null==e?0:e.length;return t?e[t-1]:r}var Ya=Xi(Ja);function Ja(e,t){return e&&e.length&&t&&t.length?qi(e,t):e}var es=na((function(e,t){var r=null==e?0:e.length,i=oi(e,t);return Zi(e,Ut(t,(function(e){return va(e,r)?+e:e})).sort(In)),i}));function ts(e){return null==e?e:Br.call(e)}var rs=Xi((function(e){return cn(yi(e,1,Zs,!0))})),is=Xi((function(e){var t=Xa(e);return Zs(t)&&(t=r),cn(yi(e,1,Zs,!0),Aa(t,2))})),ns=Xi((function(e){var t=Xa(e);return t="function"==typeof t?t:r,cn(yi(e,1,Zs,!0),r,t)}));function as(e){if(!e||!e.length)return[];var t=0;return e=Lt(e,(function(e){if(Zs(e))return t=_r(e.length,t),!0})),Xt(t,(function(t){return Ut(e,qt(t))}))}function ss(e,t){if(!e||!e.length)return[];var i=as(e);return null==t?i:Ut(i,(function(e){return Et(t,r,e)}))}var os=Xi((function(e,t){return Zs(e)?ci(e,t):[]})),ls=Xi((function(e){return mn(Lt(e,Zs))})),hs=Xi((function(e){var t=Xa(e);return Zs(t)&&(t=r),mn(Lt(e,Zs),Aa(t,2))})),As=Xi((function(e){var t=Xa(e);return t="function"==typeof t?t:r,mn(Lt(e,Zs),r,t)})),us=Xi(as);var cs=Xi((function(e){var t=e.length,i=t>1?e[t-1]:r;return i="function"==typeof i?(e.pop(),i):r,ss(e,i)}));function ds(e){var t=zr(e);return t.__chain__=!0,t}function ps(e,t){return t(e)}var fs=na((function(e){var t=e.length,i=t?e[0]:0,n=this.__wrapped__,a=function(t){return oi(t,e)};return!(t>1||this.__actions__.length)&&n instanceof Gr&&va(i)?((n=n.slice(i,+i+(t?1:0))).__actions__.push({func:ps,args:[a],thisArg:r}),new Vr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(r),e}))):this.thru(a)}));var gs=Mn((function(e,t,r){Ne.call(e,r)?++e[r]:si(e,r,1)}));var ms=Qn(Va),ys=Qn(Ga);function _s(e,t){return(Gs(e)?Tt:di)(e,Aa(t,3))}function vs(e,t){return(Gs(e)?Ft:pi)(e,Aa(t,3))}var ws=Mn((function(e,t,r){Ne.call(e,r)?e[r].push(t):si(e,r,[t])}));var bs=Xi((function(e,t,r){var i=-1,n="function"==typeof t,a=qs(e)?Be(e.length):[];return di(e,(function(e){a[++i]=n?Et(t,e,r):Pi(e,t,r)})),a})),xs=Mn((function(e,t,r){si(e,r,t)}));function Bs(e,t){return(Gs(e)?Ut:Qi)(e,Aa(t,3))}var Cs=Mn((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Ss=Xi((function(e,t){if(null==e)return[];var r=t.length;return r>1&&wa(e,t[0],t[1])?t=[]:r>2&&wa(t[0],t[1],t[2])&&(t=[t[0]]),Gi(e,yi(t,1),[])})),Es=pt||function(){return ft.Date.now()};function Is(e,t,i){return t=i?r:t,t=e&&null==t?e.length:t,Jn(e,h,r,r,r,r,t)}function Ts(e,t){var n;if("function"!=typeof t)throw new Le(i);return e=go(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=r),n}}var Fs=Xi((function(e,t,r){var i=1;if(r.length){var n=Ar(r,ha(Fs));i|=o}return Jn(e,i,t,r,n)})),Ps=Xi((function(e,t,r){var i=3;if(r.length){var n=Ar(r,ha(Ps));i|=o}return Jn(t,i,e,r,n)}));function Ls(e,t,n){var a,s,o,l,h,A,u=0,c=!1,d=!1,p=!0;if("function"!=typeof e)throw new Le(i);function f(t){var i=a,n=s;return a=s=r,u=t,l=e.apply(n,i)}function g(e){var i=e-A;return A===r||i>=t||i<0||d&&e-u>=o}function m(){var e=Es();if(g(e))return y(e);h=La(m,function(e){var r=t-(e-A);return d?vr(r,o-(e-u)):r}(e))}function y(e){return h=r,p&&a?f(e):(a=s=r,l)}function _(){var e=Es(),i=g(e);if(a=arguments,s=this,A=e,i){if(h===r)return function(e){return u=e,h=La(m,t),c?f(e):l}(A);if(d)return Bn(h),h=La(m,t),f(A)}return h===r&&(h=La(m,t)),l}return t=yo(t)||0,to(n)&&(c=!!n.leading,o=(d="maxWait"in n)?_r(yo(n.maxWait)||0,t):o,p="trailing"in n?!!n.trailing:p),_.cancel=function(){h!==r&&Bn(h),u=0,a=A=s=h=r},_.flush=function(){return h===r?l:y(Es())},_}var Ms=Xi((function(e,t){return ui(e,1,t)})),ks=Xi((function(e,t,r){return ui(e,yo(t)||0,r)}));function Us(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Le(i);var r=function(){var i=arguments,n=t?t.apply(this,i):i[0],a=r.cache;if(a.has(n))return a.get(n);var s=e.apply(this,i);return r.cache=a.set(n,s)||a,s};return r.cache=new(Us.Cache||Zr),r}function Rs(e){if("function"!=typeof e)throw new Le(i);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Us.Cache=Zr;var Ds=bn((function(e,t){var r=(t=1==t.length&&Gs(t[0])?Ut(t[0],Jt(Aa())):Ut(yi(t,1),Jt(Aa()))).length;return Xi((function(i){for(var n=-1,a=vr(i.length,r);++n<a;)i[n]=t[n].call(this,i[n]);return Et(e,this,i)}))})),Ns=Xi((function(e,t){var i=Ar(t,ha(Ns));return Jn(e,o,r,t,i)})),Os=Xi((function(e,t){var i=Ar(t,ha(Os));return Jn(e,l,r,t,i)})),Qs=na((function(e,t){return Jn(e,A,r,r,r,t)}));function zs(e,t){return e===t||e!=e&&t!=t}var Hs=Zn(Ei),js=Zn((function(e,t){return e>=t})),Vs=Li(function(){return arguments}())?Li:function(e){return ro(e)&&Ne.call(e,"callee")&&!Xe.call(e,"callee")},Gs=Be.isArray,Ks=wt?Jt(wt):function(e){return ro(e)&&Si(e)==k};function qs(e){return null!=e&&eo(e.length)&&!Ys(e)}function Zs(e){return ro(e)&&qs(e)}var Ws=Qt||yl,$s=bt?Jt(bt):function(e){return ro(e)&&Si(e)==w};function Xs(e){if(!ro(e))return!1;var t=Si(e);return t==b||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!ao(e)}function Ys(e){if(!to(e))return!1;var t=Si(e);return t==x||t==B||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Js(e){return"number"==typeof e&&e==go(e)}function eo(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=c}function to(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function ro(e){return null!=e&&"object"==typeof e}var io=xt?Jt(xt):function(e){return ro(e)&&ga(e)==C};function no(e){return"number"==typeof e||ro(e)&&Si(e)==S}function ao(e){if(!ro(e)||Si(e)!=E)return!1;var t=We(e);if(null===t)return!0;var r=Ne.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&De.call(r)==He}var so=Bt?Jt(Bt):function(e){return ro(e)&&Si(e)==T};var oo=Ct?Jt(Ct):function(e){return ro(e)&&ga(e)==F};function lo(e){return"string"==typeof e||!Gs(e)&&ro(e)&&Si(e)==P}function ho(e){return"symbol"==typeof e||ro(e)&&Si(e)==L}var Ao=St?Jt(St):function(e){return ro(e)&&eo(e.length)&&!!lt[Si(e)]};var uo=Zn(Oi),co=Zn((function(e,t){return e<=t}));function po(e){if(!e)return[];if(qs(e))return lo(e)?dr(e):Pn(e);if(rt&&e[rt])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[rt]());var t=ga(e);return(t==C?lr:t==F?ur:Ho)(e)}function fo(e){return e?(e=yo(e))===u||e===-u?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function go(e){var t=fo(e),r=t%1;return t==t?r?t-r:t:0}function mo(e){return e?li(go(e),0,p):0}function yo(e){if("number"==typeof e)return e;if(ho(e))return d;if(to(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=to(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Yt(e);var r=me.test(e);return r||_e.test(e)?ct(e.slice(2),r?2:8):ge.test(e)?d:+e}function _o(e){return Ln(e,ko(e))}function vo(e){return null==e?"":un(e)}var wo=kn((function(e,t){if(Ca(t)||qs(t))Ln(t,Mo(t),e);else for(var r in t)Ne.call(t,r)&&ri(e,r,t[r])})),bo=kn((function(e,t){Ln(t,ko(t),e)})),xo=kn((function(e,t,r,i){Ln(t,ko(t),e,i)})),Bo=kn((function(e,t,r,i){Ln(t,Mo(t),e,i)})),Co=na(oi);var So=Xi((function(e,t){e=Te(e);var i=-1,n=t.length,a=n>2?t[2]:r;for(a&&wa(t[0],t[1],a)&&(n=1);++i<n;)for(var s=t[i],o=ko(s),l=-1,h=o.length;++l<h;){var A=o[l],u=e[A];(u===r||zs(u,Ue[A])&&!Ne.call(e,A))&&(e[A]=s[A])}return e})),Eo=Xi((function(e){return e.push(r,ta),Et(Ro,r,e)}));function Io(e,t,i){var n=null==e?r:Bi(e,t);return n===r?i:n}function To(e,t){return null!=e&&ma(e,t,Ti)}var Fo=jn((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),e[t]=r}),rl(al)),Po=jn((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=ze.call(t)),Ne.call(e,t)?e[t].push(r):e[t]=[r]}),Aa),Lo=Xi(Pi);function Mo(e){return qs(e)?Xr(e):Di(e)}function ko(e){return qs(e)?Xr(e,!0):Ni(e)}var Uo=kn((function(e,t,r){ji(e,t,r)})),Ro=kn((function(e,t,r,i){ji(e,t,r,i)})),Do=na((function(e,t){var r={};if(null==e)return r;var i=!1;t=Ut(t,(function(t){return t=wn(t,e),i||(i=t.length>1),t})),Ln(e,sa(e),r),i&&(r=hi(r,7,ra));for(var n=t.length;n--;)dn(r,t[n]);return r}));var No=na((function(e,t){return null==e?{}:function(e,t){return Ki(e,t,(function(t,r){return To(e,r)}))}(e,t)}));function Oo(e,t){if(null==e)return{};var r=Ut(sa(e),(function(e){return[e]}));return t=Aa(t),Ki(e,r,(function(e,r){return t(e,r[0])}))}var Qo=Yn(Mo),zo=Yn(ko);function Ho(e){return null==e?[]:er(e,Mo(e))}var jo=Nn((function(e,t,r){return t=t.toLowerCase(),e+(r?Vo(t):t)}));function Vo(e){return Yo(vo(e).toLowerCase())}function Go(e){return(e=vo(e))&&e.replace(we,nr).replace(tt,"")}var Ko=Nn((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),qo=Nn((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Zo=Dn("toLowerCase");var Wo=Nn((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var $o=Nn((function(e,t,r){return e+(r?" ":"")+Yo(t)}));var Xo=Nn((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Yo=Dn("toUpperCase");function Jo(e,t,i){return e=vo(e),(t=i?r:t)===r?function(e){return at.test(e)}(e)?function(e){return e.match(it)||[]}(e):function(e){return e.match(ue)||[]}(e):e.match(t)||[]}var el=Xi((function(e,t){try{return Et(e,r,t)}catch(e){return Xs(e)?e:new Se(e)}})),tl=na((function(e,t){return Tt(t,(function(t){t=Na(t),si(e,t,Fs(e[t],e))})),e}));function rl(e){return function(){return e}}var il=zn(),nl=zn(!0);function al(e){return e}function sl(e){return Ri("function"==typeof e?e:hi(e,1))}var ol=Xi((function(e,t){return function(r){return Pi(r,e,t)}})),ll=Xi((function(e,t){return function(r){return Pi(e,r,t)}}));function hl(e,t,r){var i=Mo(t),n=xi(t,i);null==r&&(!to(t)||!n.length&&i.length)&&(r=t,t=e,e=this,n=xi(t,Mo(t)));var a=!(to(r)&&"chain"in r&&!r.chain),s=Ys(e);return Tt(n,(function(r){var i=t[r];e[r]=i,s&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__);return(r.__actions__=Pn(this.__actions__)).push({func:i,args:arguments,thisArg:e}),r.__chain__=t,r}return i.apply(e,Rt([this.value()],arguments))})})),e}function Al(){}var ul=Gn(Ut),cl=Gn(Pt),dl=Gn(Ot);function pl(e){return ba(e)?qt(Na(e)):function(e){return function(t){return Bi(t,e)}}(e)}var fl=qn(),gl=qn(!0);function ml(){return[]}function yl(){return!1}var _l=Vn((function(e,t){return e+t}),0),vl=$n("ceil"),wl=Vn((function(e,t){return e/t}),1),bl=$n("floor");var xl=Vn((function(e,t){return e*t}),1),Bl=$n("round"),Cl=Vn((function(e,t){return e-t}),0);return zr.after=function(e,t){if("function"!=typeof t)throw new Le(i);return e=go(e),function(){if(--e<1)return t.apply(this,arguments)}},zr.ary=Is,zr.assign=wo,zr.assignIn=bo,zr.assignInWith=xo,zr.assignWith=Bo,zr.at=Co,zr.before=Ts,zr.bind=Fs,zr.bindAll=tl,zr.bindKey=Ps,zr.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return Gs(e)?e:[e]},zr.chain=ds,zr.chunk=function(e,t,i){t=(i?wa(e,t,i):t===r)?1:_r(go(t),0);var n=null==e?0:e.length;if(!n||t<1)return[];for(var a=0,s=0,o=Be(mt(n/t));a<n;)o[s++]=an(e,a,a+=t);return o},zr.compact=function(e){for(var t=-1,r=null==e?0:e.length,i=0,n=[];++t<r;){var a=e[t];a&&(n[i++]=a)}return n},zr.concat=function(){var e=arguments.length;if(!e)return[];for(var t=Be(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Rt(Gs(r)?Pn(r):[r],yi(t,1))},zr.cond=function(e){var t=null==e?0:e.length,r=Aa();return e=t?Ut(e,(function(e){if("function"!=typeof e[1])throw new Le(i);return[r(e[0]),e[1]]})):[],Xi((function(r){for(var i=-1;++i<t;){var n=e[i];if(Et(n[0],this,r))return Et(n[1],this,r)}}))},zr.conforms=function(e){return function(e){var t=Mo(e);return function(r){return Ai(r,e,t)}}(hi(e,1))},zr.constant=rl,zr.countBy=gs,zr.create=function(e,t){var r=Hr(e);return null==t?r:ai(r,t)},zr.curry=function e(t,i,n){var a=Jn(t,8,r,r,r,r,r,i=n?r:i);return a.placeholder=e.placeholder,a},zr.curryRight=function e(t,i,n){var a=Jn(t,s,r,r,r,r,r,i=n?r:i);return a.placeholder=e.placeholder,a},zr.debounce=Ls,zr.defaults=So,zr.defaultsDeep=Eo,zr.defer=Ms,zr.delay=ks,zr.difference=za,zr.differenceBy=Ha,zr.differenceWith=ja,zr.drop=function(e,t,i){var n=null==e?0:e.length;return n?an(e,(t=i||t===r?1:go(t))<0?0:t,n):[]},zr.dropRight=function(e,t,i){var n=null==e?0:e.length;return n?an(e,0,(t=n-(t=i||t===r?1:go(t)))<0?0:t):[]},zr.dropRightWhile=function(e,t){return e&&e.length?fn(e,Aa(t,3),!0,!0):[]},zr.dropWhile=function(e,t){return e&&e.length?fn(e,Aa(t,3),!0):[]},zr.fill=function(e,t,i,n){var a=null==e?0:e.length;return a?(i&&"number"!=typeof i&&wa(e,t,i)&&(i=0,n=a),function(e,t,i,n){var a=e.length;for((i=go(i))<0&&(i=-i>a?0:a+i),(n=n===r||n>a?a:go(n))<0&&(n+=a),n=i>n?0:mo(n);i<n;)e[i++]=t;return e}(e,t,i,n)):[]},zr.filter=function(e,t){return(Gs(e)?Lt:mi)(e,Aa(t,3))},zr.flatMap=function(e,t){return yi(Bs(e,t),1)},zr.flatMapDeep=function(e,t){return yi(Bs(e,t),u)},zr.flatMapDepth=function(e,t,i){return i=i===r?1:go(i),yi(Bs(e,t),i)},zr.flatten=Ka,zr.flattenDeep=function(e){return(null==e?0:e.length)?yi(e,u):[]},zr.flattenDepth=function(e,t){return(null==e?0:e.length)?yi(e,t=t===r?1:go(t)):[]},zr.flip=function(e){return Jn(e,512)},zr.flow=il,zr.flowRight=nl,zr.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,i={};++t<r;){var n=e[t];i[n[0]]=n[1]}return i},zr.functions=function(e){return null==e?[]:xi(e,Mo(e))},zr.functionsIn=function(e){return null==e?[]:xi(e,ko(e))},zr.groupBy=ws,zr.initial=function(e){return(null==e?0:e.length)?an(e,0,-1):[]},zr.intersection=Za,zr.intersectionBy=Wa,zr.intersectionWith=$a,zr.invert=Fo,zr.invertBy=Po,zr.invokeMap=bs,zr.iteratee=sl,zr.keyBy=xs,zr.keys=Mo,zr.keysIn=ko,zr.map=Bs,zr.mapKeys=function(e,t){var r={};return t=Aa(t,3),wi(e,(function(e,i,n){si(r,t(e,i,n),e)})),r},zr.mapValues=function(e,t){var r={};return t=Aa(t,3),wi(e,(function(e,i,n){si(r,i,t(e,i,n))})),r},zr.matches=function(e){return zi(hi(e,1))},zr.matchesProperty=function(e,t){return Hi(e,hi(t,1))},zr.memoize=Us,zr.merge=Uo,zr.mergeWith=Ro,zr.method=ol,zr.methodOf=ll,zr.mixin=hl,zr.negate=Rs,zr.nthArg=function(e){return e=go(e),Xi((function(t){return Vi(t,e)}))},zr.omit=Do,zr.omitBy=function(e,t){return Oo(e,Rs(Aa(t)))},zr.once=function(e){return Ts(2,e)},zr.orderBy=function(e,t,i,n){return null==e?[]:(Gs(t)||(t=null==t?[]:[t]),Gs(i=n?r:i)||(i=null==i?[]:[i]),Gi(e,t,i))},zr.over=ul,zr.overArgs=Ds,zr.overEvery=cl,zr.overSome=dl,zr.partial=Ns,zr.partialRight=Os,zr.partition=Cs,zr.pick=No,zr.pickBy=Oo,zr.property=pl,zr.propertyOf=function(e){return function(t){return null==e?r:Bi(e,t)}},zr.pull=Ya,zr.pullAll=Ja,zr.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?qi(e,t,Aa(r,2)):e},zr.pullAllWith=function(e,t,i){return e&&e.length&&t&&t.length?qi(e,t,r,i):e},zr.pullAt=es,zr.range=fl,zr.rangeRight=gl,zr.rearg=Qs,zr.reject=function(e,t){return(Gs(e)?Lt:mi)(e,Rs(Aa(t,3)))},zr.remove=function(e,t){var r=[];if(!e||!e.length)return r;var i=-1,n=[],a=e.length;for(t=Aa(t,3);++i<a;){var s=e[i];t(s,i,e)&&(r.push(s),n.push(i))}return Zi(e,n),r},zr.rest=function(e,t){if("function"!=typeof e)throw new Le(i);return Xi(e,t=t===r?t:go(t))},zr.reverse=ts,zr.sampleSize=function(e,t,i){return t=(i?wa(e,t,i):t===r)?1:go(t),(Gs(e)?Jr:Ji)(e,t)},zr.set=function(e,t,r){return null==e?e:en(e,t,r)},zr.setWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:en(e,t,i,n)},zr.shuffle=function(e){return(Gs(e)?ei:nn)(e)},zr.slice=function(e,t,i){var n=null==e?0:e.length;return n?(i&&"number"!=typeof i&&wa(e,t,i)?(t=0,i=n):(t=null==t?0:go(t),i=i===r?n:go(i)),an(e,t,i)):[]},zr.sortBy=Ss,zr.sortedUniq=function(e){return e&&e.length?hn(e):[]},zr.sortedUniqBy=function(e,t){return e&&e.length?hn(e,Aa(t,2)):[]},zr.split=function(e,t,i){return i&&"number"!=typeof i&&wa(e,t,i)&&(t=i=r),(i=i===r?p:i>>>0)?(e=vo(e))&&("string"==typeof t||null!=t&&!so(t))&&(!(t=un(t))&&or(e))?xn(dr(e),0,i):e.split(t,i):[]},zr.spread=function(e,t){if("function"!=typeof e)throw new Le(i);return t=null==t?0:_r(go(t),0),Xi((function(r){var i=r[t],n=xn(r,0,t);return i&&Rt(n,i),Et(e,this,n)}))},zr.tail=function(e){var t=null==e?0:e.length;return t?an(e,1,t):[]},zr.take=function(e,t,i){return e&&e.length?an(e,0,(t=i||t===r?1:go(t))<0?0:t):[]},zr.takeRight=function(e,t,i){var n=null==e?0:e.length;return n?an(e,(t=n-(t=i||t===r?1:go(t)))<0?0:t,n):[]},zr.takeRightWhile=function(e,t){return e&&e.length?fn(e,Aa(t,3),!1,!0):[]},zr.takeWhile=function(e,t){return e&&e.length?fn(e,Aa(t,3)):[]},zr.tap=function(e,t){return t(e),e},zr.throttle=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw new Le(i);return to(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),Ls(e,t,{leading:n,maxWait:t,trailing:a})},zr.thru=ps,zr.toArray=po,zr.toPairs=Qo,zr.toPairsIn=zo,zr.toPath=function(e){return Gs(e)?Ut(e,Na):ho(e)?[e]:Pn(Da(vo(e)))},zr.toPlainObject=_o,zr.transform=function(e,t,r){var i=Gs(e),n=i||Ws(e)||Ao(e);if(t=Aa(t,4),null==r){var a=e&&e.constructor;r=n?i?new a:[]:to(e)&&Ys(a)?Hr(We(e)):{}}return(n?Tt:wi)(e,(function(e,i,n){return t(r,e,i,n)})),r},zr.unary=function(e){return Is(e,1)},zr.union=rs,zr.unionBy=is,zr.unionWith=ns,zr.uniq=function(e){return e&&e.length?cn(e):[]},zr.uniqBy=function(e,t){return e&&e.length?cn(e,Aa(t,2)):[]},zr.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?cn(e,r,t):[]},zr.unset=function(e,t){return null==e||dn(e,t)},zr.unzip=as,zr.unzipWith=ss,zr.update=function(e,t,r){return null==e?e:pn(e,t,vn(r))},zr.updateWith=function(e,t,i,n){return n="function"==typeof n?n:r,null==e?e:pn(e,t,vn(i),n)},zr.values=Ho,zr.valuesIn=function(e){return null==e?[]:er(e,ko(e))},zr.without=os,zr.words=Jo,zr.wrap=function(e,t){return Ns(vn(t),e)},zr.xor=ls,zr.xorBy=hs,zr.xorWith=As,zr.zip=us,zr.zipObject=function(e,t){return yn(e||[],t||[],ri)},zr.zipObjectDeep=function(e,t){return yn(e||[],t||[],en)},zr.zipWith=cs,zr.entries=Qo,zr.entriesIn=zo,zr.extend=bo,zr.extendWith=xo,hl(zr,zr),zr.add=_l,zr.attempt=el,zr.camelCase=jo,zr.capitalize=Vo,zr.ceil=vl,zr.clamp=function(e,t,i){return i===r&&(i=t,t=r),i!==r&&(i=(i=yo(i))==i?i:0),t!==r&&(t=(t=yo(t))==t?t:0),li(yo(e),t,i)},zr.clone=function(e){return hi(e,4)},zr.cloneDeep=function(e){return hi(e,5)},zr.cloneDeepWith=function(e,t){return hi(e,5,t="function"==typeof t?t:r)},zr.cloneWith=function(e,t){return hi(e,4,t="function"==typeof t?t:r)},zr.conformsTo=function(e,t){return null==t||Ai(e,t,Mo(t))},zr.deburr=Go,zr.defaultTo=function(e,t){return null==e||e!=e?t:e},zr.divide=wl,zr.endsWith=function(e,t,i){e=vo(e),t=un(t);var n=e.length,a=i=i===r?n:li(go(i),0,n);return(i-=t.length)>=0&&e.slice(i,a)==t},zr.eq=zs,zr.escape=function(e){return(e=vo(e))&&X.test(e)?e.replace(W,ar):e},zr.escapeRegExp=function(e){return(e=vo(e))&&ae.test(e)?e.replace(ne,"\\$&"):e},zr.every=function(e,t,i){var n=Gs(e)?Pt:fi;return i&&wa(e,t,i)&&(t=r),n(e,Aa(t,3))},zr.find=ms,zr.findIndex=Va,zr.findKey=function(e,t){return zt(e,Aa(t,3),wi)},zr.findLast=ys,zr.findLastIndex=Ga,zr.findLastKey=function(e,t){return zt(e,Aa(t,3),bi)},zr.floor=bl,zr.forEach=_s,zr.forEachRight=vs,zr.forIn=function(e,t){return null==e?e:_i(e,Aa(t,3),ko)},zr.forInRight=function(e,t){return null==e?e:vi(e,Aa(t,3),ko)},zr.forOwn=function(e,t){return e&&wi(e,Aa(t,3))},zr.forOwnRight=function(e,t){return e&&bi(e,Aa(t,3))},zr.get=Io,zr.gt=Hs,zr.gte=js,zr.has=function(e,t){return null!=e&&ma(e,t,Ii)},zr.hasIn=To,zr.head=qa,zr.identity=al,zr.includes=function(e,t,r,i){e=qs(e)?e:Ho(e),r=r&&!i?go(r):0;var n=e.length;return r<0&&(r=_r(n+r,0)),lo(e)?r<=n&&e.indexOf(t,r)>-1:!!n&&jt(e,t,r)>-1},zr.indexOf=function(e,t,r){var i=null==e?0:e.length;if(!i)return-1;var n=null==r?0:go(r);return n<0&&(n=_r(i+n,0)),jt(e,t,n)},zr.inRange=function(e,t,i){return t=fo(t),i===r?(i=t,t=0):i=fo(i),function(e,t,r){return e>=vr(t,r)&&e<_r(t,r)}(e=yo(e),t,i)},zr.invoke=Lo,zr.isArguments=Vs,zr.isArray=Gs,zr.isArrayBuffer=Ks,zr.isArrayLike=qs,zr.isArrayLikeObject=Zs,zr.isBoolean=function(e){return!0===e||!1===e||ro(e)&&Si(e)==v},zr.isBuffer=Ws,zr.isDate=$s,zr.isElement=function(e){return ro(e)&&1===e.nodeType&&!ao(e)},zr.isEmpty=function(e){if(null==e)return!0;if(qs(e)&&(Gs(e)||"string"==typeof e||"function"==typeof e.splice||Ws(e)||Ao(e)||Vs(e)))return!e.length;var t=ga(e);if(t==C||t==F)return!e.size;if(Ca(e))return!Di(e).length;for(var r in e)if(Ne.call(e,r))return!1;return!0},zr.isEqual=function(e,t){return Mi(e,t)},zr.isEqualWith=function(e,t,i){var n=(i="function"==typeof i?i:r)?i(e,t):r;return n===r?Mi(e,t,r,i):!!n},zr.isError=Xs,zr.isFinite=function(e){return"number"==typeof e&&Zt(e)},zr.isFunction=Ys,zr.isInteger=Js,zr.isLength=eo,zr.isMap=io,zr.isMatch=function(e,t){return e===t||ki(e,t,ca(t))},zr.isMatchWith=function(e,t,i){return i="function"==typeof i?i:r,ki(e,t,ca(t),i)},zr.isNaN=function(e){return no(e)&&e!=+e},zr.isNative=function(e){if(Ba(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Ui(e)},zr.isNil=function(e){return null==e},zr.isNull=function(e){return null===e},zr.isNumber=no,zr.isObject=to,zr.isObjectLike=ro,zr.isPlainObject=ao,zr.isRegExp=so,zr.isSafeInteger=function(e){return Js(e)&&e>=-c&&e<=c},zr.isSet=oo,zr.isString=lo,zr.isSymbol=ho,zr.isTypedArray=Ao,zr.isUndefined=function(e){return e===r},zr.isWeakMap=function(e){return ro(e)&&ga(e)==M},zr.isWeakSet=function(e){return ro(e)&&"[object WeakSet]"==Si(e)},zr.join=function(e,t){return null==e?"":mr.call(e,t)},zr.kebabCase=Ko,zr.last=Xa,zr.lastIndexOf=function(e,t,i){var n=null==e?0:e.length;if(!n)return-1;var a=n;return i!==r&&(a=(a=go(i))<0?_r(n+a,0):vr(a,n-1)),t==t?function(e,t,r){for(var i=r+1;i--;)if(e[i]===t)return i;return i}(e,t,a):Ht(e,Gt,a,!0)},zr.lowerCase=qo,zr.lowerFirst=Zo,zr.lt=uo,zr.lte=co,zr.max=function(e){return e&&e.length?gi(e,al,Ei):r},zr.maxBy=function(e,t){return e&&e.length?gi(e,Aa(t,2),Ei):r},zr.mean=function(e){return Kt(e,al)},zr.meanBy=function(e,t){return Kt(e,Aa(t,2))},zr.min=function(e){return e&&e.length?gi(e,al,Oi):r},zr.minBy=function(e,t){return e&&e.length?gi(e,Aa(t,2),Oi):r},zr.stubArray=ml,zr.stubFalse=yl,zr.stubObject=function(){return{}},zr.stubString=function(){return""},zr.stubTrue=function(){return!0},zr.multiply=xl,zr.nth=function(e,t){return e&&e.length?Vi(e,go(t)):r},zr.noConflict=function(){return ft._===this&&(ft._=je),this},zr.noop=Al,zr.now=Es,zr.pad=function(e,t,r){e=vo(e);var i=(t=go(t))?cr(e):0;if(!t||i>=t)return e;var n=(t-i)/2;return Kn(_t(n),r)+e+Kn(mt(n),r)},zr.padEnd=function(e,t,r){e=vo(e);var i=(t=go(t))?cr(e):0;return t&&i<t?e+Kn(t-i,r):e},zr.padStart=function(e,t,r){e=vo(e);var i=(t=go(t))?cr(e):0;return t&&i<t?Kn(t-i,r)+e:e},zr.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),br(vo(e).replace(se,""),t||0)},zr.random=function(e,t,i){if(i&&"boolean"!=typeof i&&wa(e,t,i)&&(t=i=r),i===r&&("boolean"==typeof t?(i=t,t=r):"boolean"==typeof e&&(i=e,e=r)),e===r&&t===r?(e=0,t=1):(e=fo(e),t===r?(t=e,e=0):t=fo(t)),e>t){var n=e;e=t,t=n}if(i||e%1||t%1){var a=xr();return vr(e+a*(t-e+ut("1e-"+((a+"").length-1))),t)}return Wi(e,t)},zr.reduce=function(e,t,r){var i=Gs(e)?Dt:Wt,n=arguments.length<3;return i(e,Aa(t,4),r,n,di)},zr.reduceRight=function(e,t,r){var i=Gs(e)?Nt:Wt,n=arguments.length<3;return i(e,Aa(t,4),r,n,pi)},zr.repeat=function(e,t,i){return t=(i?wa(e,t,i):t===r)?1:go(t),$i(vo(e),t)},zr.replace=function(){var e=arguments,t=vo(e[0]);return e.length<3?t:t.replace(e[1],e[2])},zr.result=function(e,t,i){var n=-1,a=(t=wn(t,e)).length;for(a||(a=1,e=r);++n<a;){var s=null==e?r:e[Na(t[n])];s===r&&(n=a,s=i),e=Ys(s)?s.call(e):s}return e},zr.round=Bl,zr.runInContext=e,zr.sample=function(e){return(Gs(e)?Yr:Yi)(e)},zr.size=function(e){if(null==e)return 0;if(qs(e))return lo(e)?cr(e):e.length;var t=ga(e);return t==C||t==F?e.size:Di(e).length},zr.snakeCase=Wo,zr.some=function(e,t,i){var n=Gs(e)?Ot:sn;return i&&wa(e,t,i)&&(t=r),n(e,Aa(t,3))},zr.sortedIndex=function(e,t){return on(e,t)},zr.sortedIndexBy=function(e,t,r){return ln(e,t,Aa(r,2))},zr.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var i=on(e,t);if(i<r&&zs(e[i],t))return i}return-1},zr.sortedLastIndex=function(e,t){return on(e,t,!0)},zr.sortedLastIndexBy=function(e,t,r){return ln(e,t,Aa(r,2),!0)},zr.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=on(e,t,!0)-1;if(zs(e[r],t))return r}return-1},zr.startCase=$o,zr.startsWith=function(e,t,r){return e=vo(e),r=null==r?0:li(go(r),0,e.length),t=un(t),e.slice(r,r+t.length)==t},zr.subtract=Cl,zr.sum=function(e){return e&&e.length?$t(e,al):0},zr.sumBy=function(e,t){return e&&e.length?$t(e,Aa(t,2)):0},zr.template=function(e,t,i){var n=zr.templateSettings;i&&wa(e,t,i)&&(t=r),e=vo(e),t=xo({},t,n,ea);var a,s,o=xo({},t.imports,n.imports,ea),l=Mo(o),h=er(o,l),A=0,u=t.interpolate||be,c="__p += '",d=Fe((t.escape||be).source+"|"+u.source+"|"+(u===ee?pe:be).source+"|"+(t.evaluate||be).source+"|$","g"),p="//# sourceURL="+(Ne.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ot+"]")+"\n";e.replace(d,(function(t,r,i,n,o,l){return i||(i=n),c+=e.slice(A,l).replace(xe,sr),r&&(a=!0,c+="' +\n__e("+r+") +\n'"),o&&(s=!0,c+="';\n"+o+";\n__p += '"),i&&(c+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),A=l+t.length,t})),c+="';\n";var f=Ne.call(t,"variable")&&t.variable;if(f){if(ce.test(f))throw new Se("Invalid `variable` option passed into `_.template`")}else c="with (obj) {\n"+c+"\n}\n";c=(s?c.replace(G,""):c).replace(K,"$1").replace(q,"$1;"),c="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+c+"return __p\n}";var g=el((function(){return Ee(l,p+"return "+c).apply(r,h)}));if(g.source=c,Xs(g))throw g;return g},zr.times=function(e,t){if((e=go(e))<1||e>c)return[];var r=p,i=vr(e,p);t=Aa(t),e-=p;for(var n=Xt(i,t);++r<e;)t(r);return n},zr.toFinite=fo,zr.toInteger=go,zr.toLength=mo,zr.toLower=function(e){return vo(e).toLowerCase()},zr.toNumber=yo,zr.toSafeInteger=function(e){return e?li(go(e),-c,c):0===e?e:0},zr.toString=vo,zr.toUpper=function(e){return vo(e).toUpperCase()},zr.trim=function(e,t,i){if((e=vo(e))&&(i||t===r))return Yt(e);if(!e||!(t=un(t)))return e;var n=dr(e),a=dr(t);return xn(n,rr(n,a),ir(n,a)+1).join("")},zr.trimEnd=function(e,t,i){if((e=vo(e))&&(i||t===r))return e.slice(0,pr(e)+1);if(!e||!(t=un(t)))return e;var n=dr(e);return xn(n,0,ir(n,dr(t))+1).join("")},zr.trimStart=function(e,t,i){if((e=vo(e))&&(i||t===r))return e.replace(se,"");if(!e||!(t=un(t)))return e;var n=dr(e);return xn(n,rr(n,dr(t))).join("")},zr.truncate=function(e,t){var i=30,n="...";if(to(t)){var a="separator"in t?t.separator:a;i="length"in t?go(t.length):i,n="omission"in t?un(t.omission):n}var s=(e=vo(e)).length;if(or(e)){var o=dr(e);s=o.length}if(i>=s)return e;var l=i-cr(n);if(l<1)return n;var h=o?xn(o,0,l).join(""):e.slice(0,l);if(a===r)return h+n;if(o&&(l+=h.length-l),so(a)){if(e.slice(l).search(a)){var A,u=h;for(a.global||(a=Fe(a.source,vo(fe.exec(a))+"g")),a.lastIndex=0;A=a.exec(u);)var c=A.index;h=h.slice(0,c===r?l:c)}}else if(e.indexOf(un(a),l)!=l){var d=h.lastIndexOf(a);d>-1&&(h=h.slice(0,d))}return h+n},zr.unescape=function(e){return(e=vo(e))&&$.test(e)?e.replace(Z,fr):e},zr.uniqueId=function(e){var t=++Oe;return vo(e)+t},zr.upperCase=Xo,zr.upperFirst=Yo,zr.each=_s,zr.eachRight=vs,zr.first=qa,hl(zr,function(){var e={};return wi(zr,(function(t,r){Ne.call(zr.prototype,r)||(e[r]=t)})),e}(),{chain:!1}),zr.VERSION="4.17.21",Tt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){zr[e].placeholder=zr})),Tt(["drop","take"],(function(e,t){Gr.prototype[e]=function(i){i=i===r?1:_r(go(i),0);var n=this.__filtered__&&!t?new Gr(this):this.clone();return n.__filtered__?n.__takeCount__=vr(i,n.__takeCount__):n.__views__.push({size:vr(i,p),type:e+(n.__dir__<0?"Right":"")}),n},Gr.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Tt(["filter","map","takeWhile"],(function(e,t){var r=t+1,i=1==r||3==r;Gr.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Aa(e,3),type:r}),t.__filtered__=t.__filtered__||i,t}})),Tt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");Gr.prototype[e]=function(){return this[r](1).value()[0]}})),Tt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");Gr.prototype[e]=function(){return this.__filtered__?new Gr(this):this[r](1)}})),Gr.prototype.compact=function(){return this.filter(al)},Gr.prototype.find=function(e){return this.filter(e).head()},Gr.prototype.findLast=function(e){return this.reverse().find(e)},Gr.prototype.invokeMap=Xi((function(e,t){return"function"==typeof e?new Gr(this):this.map((function(r){return Pi(r,e,t)}))})),Gr.prototype.reject=function(e){return this.filter(Rs(Aa(e)))},Gr.prototype.slice=function(e,t){e=go(e);var i=this;return i.__filtered__&&(e>0||t<0)?new Gr(i):(e<0?i=i.takeRight(-e):e&&(i=i.drop(e)),t!==r&&(i=(t=go(t))<0?i.dropRight(-t):i.take(t-e)),i)},Gr.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},Gr.prototype.toArray=function(){return this.take(p)},wi(Gr.prototype,(function(e,t){var i=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=zr[n?"take"+("last"==t?"Right":""):t],s=n||/^find/.test(t);a&&(zr.prototype[t]=function(){var t=this.__wrapped__,o=n?[1]:arguments,l=t instanceof Gr,h=o[0],A=l||Gs(t),u=function(e){var t=a.apply(zr,Rt([e],o));return n&&c?t[0]:t};A&&i&&"function"==typeof h&&1!=h.length&&(l=A=!1);var c=this.__chain__,d=!!this.__actions__.length,p=s&&!c,f=l&&!d;if(!s&&A){t=f?t:new Gr(this);var g=e.apply(t,o);return g.__actions__.push({func:ps,args:[u],thisArg:r}),new Vr(g,c)}return p&&f?e.apply(this,o):(g=this.thru(u),p?n?g.value()[0]:g.value():g)})})),Tt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=Me[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);zr.prototype[e]=function(){var e=arguments;if(i&&!this.__chain__){var n=this.value();return t.apply(Gs(n)?n:[],e)}return this[r]((function(r){return t.apply(Gs(r)?r:[],e)}))}})),wi(Gr.prototype,(function(e,t){var r=zr[t];if(r){var i=r.name+"";Ne.call(Lr,i)||(Lr[i]=[]),Lr[i].push({name:t,func:r})}})),Lr[Hn(r,2).name]=[{name:"wrapper",func:r}],Gr.prototype.clone=function(){var e=new Gr(this.__wrapped__);return e.__actions__=Pn(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Pn(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Pn(this.__views__),e},Gr.prototype.reverse=function(){if(this.__filtered__){var e=new Gr(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},Gr.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=Gs(e),i=t<0,n=r?e.length:0,a=function(e,t,r){for(var i=-1,n=r.length;++i<n;){var a=r[i],s=a.size;switch(a.type){case"drop":e+=s;break;case"dropRight":t-=s;break;case"take":t=vr(t,e+s);break;case"takeRight":e=_r(e,t-s)}}return{start:e,end:t}}(0,n,this.__views__),s=a.start,o=a.end,l=o-s,h=i?o:s-1,A=this.__iteratees__,u=A.length,c=0,d=vr(l,this.__takeCount__);if(!r||!i&&n==l&&d==l)return gn(e,this.__actions__);var p=[];e:for(;l--&&c<d;){for(var f=-1,g=e[h+=t];++f<u;){var m=A[f],y=m.iteratee,_=m.type,v=y(g);if(2==_)g=v;else if(!v){if(1==_)continue e;break e}}p[c++]=g}return p},zr.prototype.at=fs,zr.prototype.chain=function(){return ds(this)},zr.prototype.commit=function(){return new Vr(this.value(),this.__chain__)},zr.prototype.next=function(){this.__values__===r&&(this.__values__=po(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?r:this.__values__[this.__index__++]}},zr.prototype.plant=function(e){for(var t,i=this;i instanceof jr;){var n=Qa(i);n.__index__=0,n.__values__=r,t?a.__wrapped__=n:t=n;var a=n;i=i.__wrapped__}return a.__wrapped__=e,t},zr.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof Gr){var t=e;return this.__actions__.length&&(t=new Gr(this)),(t=t.reverse()).__actions__.push({func:ps,args:[ts],thisArg:r}),new Vr(t,this.__chain__)}return this.thru(ts)},zr.prototype.toJSON=zr.prototype.valueOf=zr.prototype.value=function(){return gn(this.__wrapped__,this.__actions__)},zr.prototype.first=zr.prototype.head,rt&&(zr.prototype[rt]=function(){return this}),zr}();"function"==typeof define&&"object"==typeof define.amd&&define.amd?(ft._=gr,define((function(){return gr}))):mt?((mt.exports=gr)._=gr,gt._=gr):ft._=gr}).call(e)})),d=o(((e,t)=>{var r="Expected a function",i=/^\s+|\s+$/g,n=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,s=/^0o[0-7]+$/i,o=parseInt,l="object"==typeof global&&global&&global.Object===Object&&global,h="object"==typeof self&&self&&self.Object===Object&&self,A=l||h||Function("return this")(),u=Object.prototype.toString,c=Math.max,d=Math.min,p=function(){return A.Date.now()};function f(e,t,i){var n,a,s,o,l,h,A=0,u=!1,f=!1,y=!0;if("function"!=typeof e)throw new TypeError(r);function _(t){var r=n,i=a;return n=a=void 0,A=t,o=e.apply(i,r)}function v(e){var r=e-h;return void 0===h||r>=t||r<0||f&&e-A>=s}function w(){var e=p();if(v(e))return b(e);l=setTimeout(w,function(e){var r=t-(e-h);return f?d(r,s-(e-A)):r}(e))}function b(e){return l=void 0,y&&n?_(e):(n=a=void 0,o)}function x(){var e=p(),r=v(e);if(n=arguments,a=this,h=e,r){if(void 0===l)return function(e){return A=e,l=setTimeout(w,t),u?_(e):o}(h);if(f)return l=setTimeout(w,t),_(h)}return void 0===l&&(l=setTimeout(w,t)),o}return t=m(t)||0,g(i)&&(u=!!i.leading,s=(f="maxWait"in i)?c(m(i.maxWait)||0,t):s,y="trailing"in i?!!i.trailing:y),x.cancel=function(){void 0!==l&&clearTimeout(l),A=0,n=h=a=l=void 0},x.flush=function(){return void 0===l?o:b(p())},x}function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==u.call(e)}(e))return NaN;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(i,"");var r=a.test(e);return r||s.test(e)?o(e.slice(2),r?2:8):n.test(e)?NaN:+e}t.exports=function(e,t,i){var n=!0,a=!0;if("function"!=typeof e)throw new TypeError(r);return g(i)&&(n="leading"in i?!!i.leading:n,a="trailing"in i?!!i.trailing:a),f(e,t,{leading:n,maxWait:t,trailing:a})}}));function p(e){let t=e.length;for(;--t>=0;)e[t]=0}function f(e,t,r,i,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=e&&e.length}function g(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function m(e,t,r,i,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=i,this.func=n}function y(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=je,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*qe),this.dyn_dtree=new Uint16Array(2*(2*Ge+1)),this.bl_tree=new Uint16Array(2*(2*Ke+1)),rt(this.dyn_ltree),rt(this.dyn_dtree),rt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(Ze+1),this.heap=new Uint16Array(2*Ve+1),rt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*Ve+1),rt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function _(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function v(e){this.options=Ct.assign({level:Nt,method:Qt,chunkSize:16384,windowBits:15,memLevel:8,strategy:Ot},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ft,this.strm.avail_out=0;let r=xt.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Rt)throw new Error(_e[r]);if(t.header&&xt.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Tt.string2buf(t.dictionary):"[object ArrayBuffer]"===Pt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=xt.deflateSetDictionary(this.strm,e),r!==Rt)throw new Error(_e[r]);this._dict_set=!0}}function w(e,t){let r=new v(t);if(r.push(e,!0),r.err)throw r.msg||_e[r.err];return r.result}function b(e,t){return(t=t||{}).raw=!0,w(e,t)}function x(e,t){return(t=t||{}).gzip=!0,w(e,t)}function B(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}function S(e){this.options=Ct.assign({chunkSize:65536,windowBits:15,to:""},e||{});let t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&!(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ft,this.strm.avail_out=0;let r=Er.inflateInit2(this.strm,t.windowBits);if(r!==Lr)throw new Error(_e[r]);if(this.header=new Ir,Er.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Tt.string2buf(t.dictionary):"[object ArrayBuffer]"===Tr.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Er.inflateSetDictionary(this.strm,t.dictionary),r!==Lr)))throw new Error(_e[r])}function E(e,t){let r=new S(t);if(r.push(e),r.err)throw r.msg||_e[r.err];return r.result}function I(e,t){return(t=t||{}).raw=!0,E(e,t)}var T,F,P,L,M,k,U,R,D,N,O,Q,z,H,j,V,G,K,q,Z,W,$,X,Y,J,ee,te,re,ie,ne,ae,se,oe,le,he,Ae,ue,ce,de,pe,fe,ge,me,ye,_e,ve,we,be,xe,Be,Ce,Se,Ee,Ie,Te,Fe,Pe,Le,Me,ke,Ue,Re,De,Ne,Oe,Qe,ze,He,je,Ve,Ge,Ke,qe,Ze,We,$e,Xe,Ye,Je,et,tt,rt,it,nt,at,st,ot,lt,ht,At,ut,ct,dt,pt,ft,gt,mt,yt,_t,vt,wt,bt,xt,Bt,Ct,St,Et,It,Tt,Ft,Pt,Lt,Mt,kt,Ut,Rt,Dt,Nt,Ot,Qt,zt,Ht,jt,Vt,Gt,Kt,qt,Zt,Wt,$t,Xt,Yt,Jt,er,tr,rr,ir,nr,ar,sr,or,lr,hr,Ar,ur,cr,dr,pr,fr,gr,mr,yr,_r,vr,wr,br,xr,Br,Cr,Sr,Er,Ir,Tr,Fr,Pr,Lr,Mr,kr,Ur,Rr,Dr,Nr,Or,Qr,zr,Hr,jr,Vr,Gr,Kr,qr,Zr,Wr=s((()=>{T=256,F=286,P=30,L=15,M=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),k=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),U=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),R=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),p(D=new Array(576)),p(N=new Array(60)),p(O=new Array(512)),p(Q=new Array(256)),p(z=new Array(29)),p(H=new Array(P)),K=e=>e<256?O[e]:O[256+(e>>>7)],q=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Z=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,q(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},W=(e,t,r)=>{Z(e,r[2*t],r[2*t+1])},$=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},X=e=>{16===e.bi_valid?(q(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)},Y=(e,t)=>{let r,i,n,a,s,o,l=t.dyn_tree,h=t.max_code,A=t.stat_desc.static_tree,u=t.stat_desc.has_stree,c=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,f=0;for(a=0;a<=L;a++)e.bl_count[a]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)i=e.heap[r],a=l[2*l[2*i+1]+1]+1,a>p&&(a=p,f++),l[2*i+1]=a,!(i>h)&&(e.bl_count[a]++,s=0,i>=d&&(s=c[i-d]),o=l[2*i],e.opt_len+=o*(a+s),u&&(e.static_len+=o*(A[2*i+1]+s)));if(0!==f){do{for(a=p-1;0===e.bl_count[a];)a--;e.bl_count[a]--,e.bl_count[a+1]+=2,e.bl_count[p]--,f-=2}while(f>0);for(a=p;0!==a;a--)for(i=e.bl_count[a];0!==i;)n=e.heap[--r],!(n>h)&&(l[2*n+1]!==a&&(e.opt_len+=(a-l[2*n+1])*l[2*n],l[2*n+1]=a),i--)}},J=(e,t,r)=>{let i,n,a=new Array(16),s=0;for(i=1;i<=L;i++)s=s+r[i-1]<<1,a[i]=s;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=$(a[t]++,t))}},ee=()=>{let e,t,r,i,n,a=new Array(16);for(r=0,i=0;i<28;i++)for(z[i]=r,e=0;e<1<<M[i];e++)Q[r++]=i;for(Q[r-1]=i,n=0,i=0;i<16;i++)for(H[i]=n,e=0;e<1<<k[i];e++)O[n++]=i;for(n>>=7;i<P;i++)for(H[i]=n<<7,e=0;e<1<<k[i]-7;e++)O[256+n++]=i;for(t=0;t<=L;t++)a[t]=0;for(e=0;e<=143;)D[2*e+1]=8,e++,a[8]++;for(;e<=255;)D[2*e+1]=9,e++,a[9]++;for(;e<=279;)D[2*e+1]=7,e++,a[7]++;for(;e<=287;)D[2*e+1]=8,e++,a[8]++;for(J(D,287,a),e=0;e<P;e++)N[2*e+1]=5,N[2*e]=$(e,5);j=new f(D,M,257,F,L),V=new f(N,k,0,P,L),G=new f(new Array(0),U,0,19,7)},te=e=>{let t;for(t=0;t<F;t++)e.dyn_ltree[2*t]=0;for(t=0;t<P;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},re=e=>{e.bi_valid>8?q(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ie=(e,t,r,i)=>{let n=2*t,a=2*r;return e[n]<e[a]||e[n]===e[a]&&i[t]<=i[r]},ne=(e,t,r)=>{let i=e.heap[r],n=r<<1;for(;n<=e.heap_len&&(n<e.heap_len&&ie(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!ie(t,i,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=i},ae=(e,t,r)=>{let i,n,a,s,o=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+o++],i+=(255&e.pending_buf[e.sym_buf+o++])<<8,n=e.pending_buf[e.sym_buf+o++],0===i?W(e,n,t):(a=Q[n],W(e,a+T+1,t),s=M[a],0!==s&&(n-=z[a],Z(e,n,s)),i--,a=K(i),W(e,a,r),s=k[a],0!==s&&(i-=H[a],Z(e,i,s)))}while(o<e.sym_next);W(e,256,t)},se=(e,t)=>{let r,i,n,a=t.dyn_tree,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems,h=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<l;r++)0!==a[2*r]?(e.heap[++e.heap_len]=h=r,e.depth[r]=0):a[2*r+1]=0;for(;e.heap_len<2;)n=e.heap[++e.heap_len]=h<2?++h:0,a[2*n]=1,e.depth[n]=0,e.opt_len--,o&&(e.static_len-=s[2*n+1]);for(t.max_code=h,r=e.heap_len>>1;r>=1;r--)ne(e,a,r);n=l;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],ne(e,a,1),i=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=i,a[2*n]=a[2*r]+a[2*i],e.depth[n]=(e.depth[r]>=e.depth[i]?e.depth[r]:e.depth[i])+1,a[2*r+1]=a[2*i+1]=n,e.heap[1]=n++,ne(e,a,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],Y(e,t),J(a,h,e.bl_count)},oe=(e,t,r)=>{let i,n,a=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),t[2*(r+1)+1]=65535,i=0;i<=r;i++)n=s,s=t[2*(i+1)+1],!(++o<l&&n===s)&&(o<h?e.bl_tree[2*n]+=o:0!==n?(n!==a&&e.bl_tree[2*n]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,a=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4))},le=(e,t,r)=>{let i,n,a=-1,s=t[1],o=0,l=7,h=4;for(0===s&&(l=138,h=3),i=0;i<=r;i++)if(n=s,s=t[2*(i+1)+1],!(++o<l&&n===s)){if(o<h)do{W(e,n,e.bl_tree)}while(0!=--o);else 0!==n?(n!==a&&(W(e,n,e.bl_tree),o--),W(e,16,e.bl_tree),Z(e,o-3,2)):o<=10?(W(e,17,e.bl_tree),Z(e,o-3,3)):(W(e,18,e.bl_tree),Z(e,o-11,7));o=0,a=n,0===s?(l=138,h=3):n===s?(l=6,h=3):(l=7,h=4)}},he=e=>{let t;for(oe(e,e.dyn_ltree,e.l_desc.max_code),oe(e,e.dyn_dtree,e.d_desc.max_code),se(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*R[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t},Ae=(e,t,r,i)=>{let n;for(Z(e,t-257,5),Z(e,r-1,5),Z(e,i-4,4),n=0;n<i;n++)Z(e,e.bl_tree[2*R[n]+1],3);le(e,e.dyn_ltree,t-1),le(e,e.dyn_dtree,r-1)},ue=e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<T;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0},ce=!1,pe=(e,t,r,i)=>{let n,a,s=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=ue(e)),se(e,e.l_desc),se(e,e.d_desc),s=he(e),n=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=n&&(n=a)):n=a=r+5,r+4<=n&&-1!==t?de(e,t,r,i):4===e.strategy||a===n?(Z(e,2+(i?1:0),3),ae(e,D,N)):(Z(e,4+(i?1:0),3),Ae(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),ae(e,e.dyn_ltree,e.dyn_dtree)),te(e),i&&re(e)},fe={_tr_init:e=>{ce||(ee(),ce=!0),e.l_desc=new g(e.dyn_ltree,j),e.d_desc=new g(e.dyn_dtree,V),e.bl_desc=new g(e.bl_tree,G),e.bi_buf=0,e.bi_valid=0,te(e)},_tr_stored_block:de=(e,t,r,i)=>{Z(e,0+(i?1:0),3),re(e),q(e,r),q(e,~r),r&&e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r},_tr_flush_block:pe,_tr_tally:(e,t,r)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=r,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(Q[r]+T+1)]++,e.dyn_dtree[2*K(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Z(e,2,3),W(e,256,D),X(e)}},ge=(e,t,r,i)=>{let n=65535&e,a=e>>>16&65535,s=0;for(;0!==r;){s=r>2e3?2e3:r,r-=s;do{n=n+t[i++]|0,a=a+n|0}while(--s);n%=65521,a%=65521}return n|a<<16},me=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})()),ye=(e,t,r,i)=>{let n=me,a=i+r;e^=-1;for(let r=i;r<a;r++)e=e>>>8^n[255&(e^t[r])];return~e},_e={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},ve={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},({_tr_init:we,_tr_stored_block:be,_tr_flush_block:xe,_tr_tally:Be,_tr_align:Ce}=fe),({Z_NO_FLUSH:Se,Z_PARTIAL_FLUSH:Ee,Z_FULL_FLUSH:Ie,Z_FINISH:Te,Z_BLOCK:Fe,Z_OK:Pe,Z_STREAM_END:Le,Z_STREAM_ERROR:Me,Z_DATA_ERROR:ke,Z_BUF_ERROR:Ue,Z_DEFAULT_COMPRESSION:Re,Z_FILTERED:De,Z_HUFFMAN_ONLY:Ne,Z_RLE:Oe,Z_FIXED:Qe,Z_DEFAULT_STRATEGY:ze,Z_UNKNOWN:He,Z_DEFLATED:je}=ve),Ge=30,Ke=19,qe=2*(Ve=286)+1,Ze=15,We=258,$e=262,Xe=42,Ye=113,Je=666,et=(e,t)=>(e.msg=_e[t],t),tt=e=>2*e-(e>4?9:0),rt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},it=e=>{let t,r,i,n=e.w_size;t=e.hash_size,i=t;do{r=e.head[--i],e.head[i]=r>=n?r-n:0}while(--t);t=n,i=t;do{r=e.prev[--i],e.prev[i]=r>=n?r-n:0}while(--t)},nt=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask,at=e=>{let t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},st=(e,t)=>{xe(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,at(e.strm)},ot=(e,t)=>{e.pending_buf[e.pending++]=t},lt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ht=(e,t,r,i)=>{let n=e.avail_in;return n>i&&(n=i),0===n?0:(e.avail_in-=n,t.set(e.input.subarray(e.next_in,e.next_in+n),r),1===e.state.wrap?e.adler=ge(e.adler,t,n,r):2===e.state.wrap&&(e.adler=ye(e.adler,t,n,r)),e.next_in+=n,e.total_in+=n,n)},At=(e,t)=>{let r,i,n=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-$e?e.strstart-(e.w_size-$e):0,h=e.window,A=e.w_mask,u=e.prev,c=e.strstart+We,d=h[a+s-1],p=h[a+s];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do{if(r=t,h[r+s]===p&&h[r+s-1]===d&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&a<c);if(i=We-(c-a),a=c-We,i>s){if(e.match_start=t,s=i,i>=o)break;d=h[a+s-1],p=h[a+s]}}}while((t=u[t&A])>l&&0!=--n);return s<=e.lookahead?s:e.lookahead},ut=e=>{let t,r,i,n=e.w_size;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-$e)&&(e.window.set(e.window.subarray(n,n+n-r),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,e.insert>e.strstart&&(e.insert=e.strstart),it(e),r+=n),0===e.strm.avail_in)break;if(t=ht(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=t,e.lookahead+e.insert>=3)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=nt(e,e.ins_h,e.window[i+1]);e.insert&&(e.ins_h=nt(e,e.ins_h,e.window[i+3-1]),e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<$e&&0!==e.strm.avail_in)},dt=(e,t)=>{let r,i;for(;;){if(e.lookahead<$e){if(ut(e),e.lookahead<$e&&t===Se)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=nt(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-$e&&(e.match_length=At(e,r)),e.match_length>=3)if(i=Be(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=nt(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=nt(e,e.ins_h,e.window[e.strstart+1]);else i=Be(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(st(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Te?(st(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(st(e,!1),0===e.strm.avail_out)?1:2},pt=(e,t)=>{let r,i,n;for(;;){if(e.lookahead<$e){if(ut(e),e.lookahead<$e&&t===Se)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=nt(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-$e&&(e.match_length=At(e,r),e.match_length<=5&&(e.strategy===De||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){n=e.strstart+e.lookahead-3,i=Be(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=n&&(e.ins_h=nt(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(st(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=Be(e,0,e.window[e.strstart-1]),i&&st(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Be(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Te?(st(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(st(e,!1),0===e.strm.avail_out)?1:2},ft=(e,t)=>{let r,i,n,a,s=e.window;for(;;){if(e.lookahead<=We){if(ut(e),e.lookahead<=We&&t===Se)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(n=e.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){a=e.strstart+We;do{}while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<a);e.match_length=We-(a-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Be(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Be(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(st(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Te?(st(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(st(e,!1),0===e.strm.avail_out)?1:2},gt=(e,t)=>{let r;for(;;){if(0===e.lookahead&&(ut(e),0===e.lookahead)){if(t===Se)return 1;break}if(e.match_length=0,r=Be(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(st(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Te?(st(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(st(e,!1),0===e.strm.avail_out)?1:2},mt=[new m(0,0,0,0,ct=(e,t)=>{let r,i,n,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,s=0,o=e.strm.avail_in;do{if(r=65535,n=e.bi_valid+42>>3,e.strm.avail_out<n||(n=e.strm.avail_out-n,i=e.strstart-e.block_start,r>i+e.strm.avail_in&&(r=i+e.strm.avail_in),r>n&&(r=n),r<a&&(0===r&&t!==Te||t===Se||r!==i+e.strm.avail_in)))break;s=t===Te&&r===i+e.strm.avail_in?1:0,be(e,0,0,s),e.pending_buf[e.pending-4]=r,e.pending_buf[e.pending-3]=r>>8,e.pending_buf[e.pending-2]=~r,e.pending_buf[e.pending-1]=~r>>8,at(e.strm),i&&(i>r&&(i=r),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,r-=i),r&&(ht(e.strm,e.strm.output,e.strm.next_out,r),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r)}while(0===s);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),s?4:t!==Se&&t!==Te&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(n=e.window_size-e.strstart,e.strm.avail_in>n&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,n+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),n>e.strm.avail_in&&(n=e.strm.avail_in),n&&(ht(e.strm,e.window,e.strstart,n),e.strstart+=n,e.insert+=n>e.w_size-e.insert?e.w_size-e.insert:n),e.high_water<e.strstart&&(e.high_water=e.strstart),n=e.bi_valid+42>>3,n=e.pending_buf_size-n>65535?65535:e.pending_buf_size-n,a=n>e.w_size?e.w_size:n,i=e.strstart-e.block_start,(i>=a||(i||t===Te)&&t!==Se&&0===e.strm.avail_in&&i<=n)&&(r=i>n?n:i,s=t===Te&&0===e.strm.avail_in&&r===i?1:0,be(e,e.block_start,r,s),e.block_start+=r,at(e.strm)),s?3:1)}),new m(4,4,8,4,dt),new m(4,5,16,8,dt),new m(4,6,32,32,dt),new m(4,4,16,16,pt),new m(8,16,32,32,pt),new m(8,16,128,128,pt),new m(8,32,128,256,pt),new m(32,128,258,1024,pt),new m(32,258,258,4096,pt)],yt=e=>{e.window_size=2*e.w_size,rt(e.head),e.max_lazy_match=mt[e.level].max_lazy,e.good_match=mt[e.level].good_length,e.nice_match=mt[e.level].nice_length,e.max_chain_length=mt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0},_t=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.status!==Xe&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Ye&&t.status!==Je?1:0},xt={deflateInit:(e,t)=>bt(e,t,je,15,8,ze),deflateInit2:bt=(e,t,r,i,n,a)=>{if(!e)return Me;let s=1;if(t===Re&&(t=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>9||r!==je||i<8||i>15||t<0||t>9||a<0||a>Qe||8===i&&1!==s)return et(e,Me);8===i&&(i=9);let o=new y;return e.state=o,o.strm=e,o.status=Xe,o.wrap=s,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=n+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<n+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=a,o.method=r,wt(e)},deflateReset:wt=e=>{let t=vt(e);return t===Pe&&yt(e.state),t},deflateResetKeep:vt=e=>{if(_t(e))return et(e,Me);e.total_in=e.total_out=0,e.data_type=He;let t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Xe:Ye,e.adler=2===t.wrap?0:1,t.last_flush=-2,we(t),Pe},deflateSetHeader:(e,t)=>_t(e)||2!==e.state.wrap?Me:(e.state.gzhead=t,Pe),deflate:(e,t)=>{if(_t(e)||t>Fe||t<0)return e?et(e,Me):Me;let r=e.state;if(!e.output||0!==e.avail_in&&!e.input||r.status===Je&&t!==Te)return et(e,0===e.avail_out?Ue:Me);let i=r.last_flush;if(r.last_flush=t,0!==r.pending){if(at(e),0===e.avail_out)return r.last_flush=-1,Pe}else if(0===e.avail_in&&tt(t)<=tt(i)&&t!==Te)return et(e,Ue);if(r.status===Je&&0!==e.avail_in)return et(e,Ue);if(r.status===Xe&&0===r.wrap&&(r.status=Ye),r.status===Xe){let t=je+(r.w_bits-8<<4)<<8,i=-1;if(i=r.strategy>=Ne||r.level<2?0:r.level<6?1:6===r.level?2:3,t|=i<<6,0!==r.strstart&&(t|=32),t+=31-t%31,lt(r,t),0!==r.strstart&&(lt(r,e.adler>>>16),lt(r,65535&e.adler)),e.adler=1,r.status=Ye,at(e),0!==r.pending)return r.last_flush=-1,Pe}if(57===r.status)if(e.adler=0,ot(r,31),ot(r,139),ot(r,8),r.gzhead)ot(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),ot(r,255&r.gzhead.time),ot(r,r.gzhead.time>>8&255),ot(r,r.gzhead.time>>16&255),ot(r,r.gzhead.time>>24&255),ot(r,9===r.level?2:r.strategy>=Ne||r.level<2?4:0),ot(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(ot(r,255&r.gzhead.extra.length),ot(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=ye(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(ot(r,0),ot(r,0),ot(r,0),ot(r,0),ot(r,0),ot(r,9===r.level?2:r.strategy>=Ne||r.level<2?4:0),ot(r,3),r.status=Ye,at(e),0!==r.pending)return r.last_flush=-1,Pe;if(69===r.status){if(r.gzhead.extra){let t=r.pending,i=(65535&r.gzhead.extra.length)-r.gzindex;for(;r.pending+i>r.pending_buf_size;){let n=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+n),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>t&&(e.adler=ye(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex+=n,at(e),0!==r.pending)return r.last_flush=-1,Pe;t=0,i-=n}let n=new Uint8Array(r.gzhead.extra);r.pending_buf.set(n.subarray(r.gzindex,r.gzindex+i),r.pending),r.pending+=i,r.gzhead.hcrc&&r.pending>t&&(e.adler=ye(e.adler,r.pending_buf,r.pending-t,t)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=ye(e.adler,r.pending_buf,r.pending-i,i)),at(e),0!==r.pending)return r.last_flush=-1,Pe;i=0}t=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,ot(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=ye(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){let t,i=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>i&&(e.adler=ye(e.adler,r.pending_buf,r.pending-i,i)),at(e),0!==r.pending)return r.last_flush=-1,Pe;i=0}t=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,ot(r,t)}while(0!==t);r.gzhead.hcrc&&r.pending>i&&(e.adler=ye(e.adler,r.pending_buf,r.pending-i,i))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(at(e),0!==r.pending))return r.last_flush=-1,Pe;ot(r,255&e.adler),ot(r,e.adler>>8&255),e.adler=0}if(r.status=Ye,at(e),0!==r.pending)return r.last_flush=-1,Pe}if(0!==e.avail_in||0!==r.lookahead||t!==Se&&r.status!==Je){let i=0===r.level?ct(r,t):r.strategy===Ne?gt(r,t):r.strategy===Oe?ft(r,t):mt[r.level].func(r,t);if((3===i||4===i)&&(r.status=Je),1===i||3===i)return 0===e.avail_out&&(r.last_flush=-1),Pe;if(2===i&&(t===Ee?Ce(r):t!==Fe&&(be(r,0,0,!1),t===Ie&&(rt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),at(e),0===e.avail_out))return r.last_flush=-1,Pe}return t!==Te?Pe:r.wrap<=0?Le:(2===r.wrap?(ot(r,255&e.adler),ot(r,e.adler>>8&255),ot(r,e.adler>>16&255),ot(r,e.adler>>24&255),ot(r,255&e.total_in),ot(r,e.total_in>>8&255),ot(r,e.total_in>>16&255),ot(r,e.total_in>>24&255)):(lt(r,e.adler>>>16),lt(r,65535&e.adler)),at(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Pe:Le)},deflateEnd:e=>{if(_t(e))return Me;let t=e.state.status;return e.state=null,t===Ye?et(e,ke):Pe},deflateSetDictionary:(e,t)=>{let r=t.length;if(_t(e))return Me;let i=e.state,n=i.wrap;if(2===n||1===n&&i.status!==Xe||i.lookahead)return Me;if(1===n&&(e.adler=ge(e.adler,t,r,0)),i.wrap=0,r>=i.w_size){0===n&&(rt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(r-i.w_size,r),0),t=e,r=i.w_size}let a=e.avail_in,s=e.next_in,o=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,ut(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=nt(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,ut(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=s,e.input=o,e.avail_in=a,i.wrap=n,Pe},deflateInfo:"pako deflate (from Nodeca project)"},Bt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ct={assign:function(e){let t=Array.prototype.slice.call(arguments,1);for(;t.length;){let r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(let t in r)Bt(r,t)&&(e[t]=r[t])}}return e},flattenChunks:e=>{let t=0;for(let r=0,i=e.length;r<i;r++)t+=e[r].length;let r=new Uint8Array(t);for(let t=0,i=0,n=e.length;t<n;t++){let n=e[t];r.set(n,i),i+=n.length}return r}},St=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{St=!1}Et=new Uint8Array(256);for(let e=0;e<256;e++)Et[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Et[254]=Et[254]=1,It=(e,t)=>{if(t<65534&&e.subarray&&St)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r},Tt={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,i,n,a,s=e.length,o=0;for(n=0;n<s;n++)r=e.charCodeAt(n),55296==(64512&r)&&n+1<s&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),o+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(o),a=0,n=0;a<o;n++)r=e.charCodeAt(n),55296==(64512&r)&&n+1<s&&(i=e.charCodeAt(n+1),56320==(64512&i)&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?t[a++]=r:r<2048?(t[a++]=192|r>>>6,t[a++]=128|63&r):r<65536?(t[a++]=224|r>>>12,t[a++]=128|r>>>6&63,t[a++]=128|63&r):(t[a++]=240|r>>>18,t[a++]=128|r>>>12&63,t[a++]=128|r>>>6&63,t[a++]=128|63&r);return t},buf2string:(e,t)=>{let r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,n,a=new Array(2*r);for(n=0,i=0;i<r;){let t=e[i++];if(t<128){a[n++]=t;continue}let s=Et[t];if(s>4)a[n++]=65533,i+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&i<r;)t=t<<6|63&e[i++],s--;s>1?a[n++]=65533:t<65536?a[n++]=t:(t-=65536,a[n++]=55296|t>>10&1023,a[n++]=56320|1023&t)}}return It(a,n)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Et[e[r]]>t?r:t}},Ft=_,Pt=Object.prototype.toString,({Z_NO_FLUSH:Lt,Z_SYNC_FLUSH:Mt,Z_FULL_FLUSH:kt,Z_FINISH:Ut,Z_OK:Rt,Z_STREAM_END:Dt,Z_DEFAULT_COMPRESSION:Nt,Z_DEFAULT_STRATEGY:Ot,Z_DEFLATED:Qt}=ve),v.prototype.push=function(e,t){let r,i,n=this.strm,a=this.options.chunkSize;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Ut:Lt,"string"==typeof e?n.input=Tt.string2buf(e):"[object ArrayBuffer]"===Pt.call(e)?n.input=new Uint8Array(e):n.input=e,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(a),n.next_out=0,n.avail_out=a),(i===Mt||i===kt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=xt.deflate(n,i),r===Dt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=xt.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Rt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},v.prototype.onData=function(e){this.chunks.push(e)},v.prototype.onEnd=function(e){e===Rt&&(this.result=Ct.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},zt={Deflate:v,deflate:w,deflateRaw:b,gzip:x,constants:ve},Ht=16209,jt=function(e,t){let r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S=e.state;r=e.next_in,B=e.input,i=r+(e.avail_in-5),n=e.next_out,C=e.output,a=n-(t-e.avail_out),s=n+(e.avail_out-257),o=S.dmax,l=S.wsize,h=S.whave,A=S.wnext,u=S.window,c=S.hold,d=S.bits,p=S.lencode,f=S.distcode,g=(1<<S.lenbits)-1,m=(1<<S.distbits)-1;e:do{d<15&&(c+=B[r++]<<d,d+=8,c+=B[r++]<<d,d+=8),y=p[c&g];t:for(;;){if(_=y>>>24,c>>>=_,d-=_,_=y>>>16&255,0===_)C[n++]=65535&y;else{if(!(16&_)){if(64&_){if(32&_){S.mode=16191;break e}e.msg="invalid literal/length code",S.mode=Ht;break e}y=p[(65535&y)+(c&(1<<_)-1)];continue t}for(v=65535&y,_&=15,_&&(d<_&&(c+=B[r++]<<d,d+=8),v+=c&(1<<_)-1,c>>>=_,d-=_),d<15&&(c+=B[r++]<<d,d+=8,c+=B[r++]<<d,d+=8),y=f[c&m];;){if(_=y>>>24,c>>>=_,d-=_,_=y>>>16&255,16&_){if(w=65535&y,_&=15,d<_&&(c+=B[r++]<<d,d+=8,d<_&&(c+=B[r++]<<d,d+=8)),w+=c&(1<<_)-1,w>o){e.msg="invalid distance too far back",S.mode=Ht;break e}if(c>>>=_,d-=_,_=n-a,w>_){if(_=w-_,_>h&&S.sane){e.msg="invalid distance too far back",S.mode=Ht;break e}if(b=0,x=u,0===A){if(b+=l-_,_<v){v-=_;do{C[n++]=u[b++]}while(--_);b=n-w,x=C}}else if(A<_){if(b+=l+A-_,_-=A,_<v){v-=_;do{C[n++]=u[b++]}while(--_);if(b=0,A<v){_=A,v-=_;do{C[n++]=u[b++]}while(--_);b=n-w,x=C}}}else if(b+=A-_,_<v){v-=_;do{C[n++]=u[b++]}while(--_);b=n-w,x=C}for(;v>2;)C[n++]=x[b++],C[n++]=x[b++],C[n++]=x[b++],v-=3;v&&(C[n++]=x[b++],v>1&&(C[n++]=x[b++]))}else{b=n-w;do{C[n++]=C[b++],C[n++]=C[b++],C[n++]=C[b++],v-=3}while(v>2);v&&(C[n++]=C[b++],v>1&&(C[n++]=C[b++]))}break}if(64&_){e.msg="invalid distance code",S.mode=Ht;break e}y=f[(65535&y)+(c&(1<<_)-1)]}}break}}while(r<i&&n<s);v=d>>3,r-=v,d-=v<<3,c&=(1<<d)-1,e.next_in=r,e.next_out=n,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=n<s?s-n+257:257-(n-s),S.hold=c,S.bits=d},Vt=15,Gt=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Kt=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),qt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Zt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),Wt=(e,t,r,i,n,a,s,o)=>{let l,h,A,u,c,d,p,f,g,m=o.bits,y=0,_=0,v=0,w=0,b=0,x=0,B=0,C=0,S=0,E=0,I=null,T=new Uint16Array(16),F=new Uint16Array(16),P=null;for(y=0;y<=Vt;y++)T[y]=0;for(_=0;_<i;_++)T[t[r+_]]++;for(b=m,w=Vt;w>=1&&0===T[w];w--);if(b>w&&(b=w),0===w)return n[a++]=20971520,n[a++]=20971520,o.bits=1,0;for(v=1;v<w&&0===T[v];v++);for(b<v&&(b=v),C=1,y=1;y<=Vt;y++)if(C<<=1,C-=T[y],C<0)return-1;if(C>0&&(0===e||1!==w))return-1;for(F[1]=0,y=1;y<Vt;y++)F[y+1]=F[y]+T[y];for(_=0;_<i;_++)0!==t[r+_]&&(s[F[t[r+_]]++]=_);if(0===e?(I=P=s,d=20):1===e?(I=Gt,P=Kt,d=257):(I=qt,P=Zt,d=0),E=0,_=0,y=v,c=a,x=b,B=0,A=-1,S=1<<b,u=S-1,1===e&&S>852||2===e&&S>592)return 1;for(;;){p=y-B,s[_]+1<d?(f=0,g=s[_]):s[_]>=d?(f=P[s[_]-d],g=I[s[_]-d]):(f=96,g=0),l=1<<y-B,h=1<<x,v=h;do{h-=l,n[c+(E>>B)+h]=p<<24|f<<16|g}while(0!==h);for(l=1<<y-1;E&l;)l>>=1;if(0!==l?(E&=l-1,E+=l):E=0,_++,0==--T[y]){if(y===w)break;y=t[r+s[_]]}if(y>b&&(E&u)!==A){for(0===B&&(B=b),c+=v,x=y-B,C=1<<x;x+B<w&&(C-=T[x+B],!(C<=0));)x++,C<<=1;if(S+=1<<x,1===e&&S>852||2===e&&S>592)return 1;A=E&u,n[A]=b<<24|x<<16|c-a}}return 0!==E&&(n[c+E]=y-B<<24|64<<16),o.bits=b,0},({Z_FINISH:$t,Z_BLOCK:Xt,Z_TREES:Yt,Z_OK:Jt,Z_STREAM_END:er,Z_NEED_DICT:tr,Z_STREAM_ERROR:rr,Z_DATA_ERROR:ir,Z_MEM_ERROR:nr,Z_BUF_ERROR:ar,Z_DEFLATED:sr}=ve),or=16180,lr=16190,hr=16191,Ar=16192,ur=16194,cr=16199,dr=16200,pr=16206,fr=16209,gr=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24),mr=e=>{if(!e)return 1;let t=e.state;return!t||t.strm!==e||t.mode<or||t.mode>16211?1:0},vr=(e,t)=>{let r;if(mr(e))return rr;let i=e.state;return t<0?(r=0,t=-t):(r=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?rr:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=r,i.wbits=t,_r(e))},wr=(e,t)=>{if(!e)return rr;let r=new B;e.state=r,r.strm=e,r.window=null,r.mode=or;let i=vr(e,t);return i!==Jt&&(e.state=null),i},br=!0,Cr=e=>{if(br){xr=new Int32Array(512),Br=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Wt(1,e.lens,0,288,xr,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Wt(2,e.lens,0,32,Br,0,e.work,{bits:5}),br=!1}e.lencode=xr,e.lenbits=9,e.distcode=Br,e.distbits=5},Sr=(e,t,r,i)=>{let n,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(r-a.wsize,r),0),a.wnext=0,a.whave=a.wsize):(n=a.wsize-a.wnext,n>i&&(n=i),a.window.set(t.subarray(r-i,r-i+n),a.wnext),(i-=n)?(a.window.set(t.subarray(r-i,r),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=n,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=n))),0},Er={inflateReset:_r=e=>{if(mr(e))return rr;let t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,yr(e)},inflateReset2:vr,inflateResetKeep:yr=e=>{if(mr(e))return rr;let t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=or,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Jt},inflateInit:e=>wr(e,15),inflateInit2:wr,inflate:(e,t)=>{let r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S=0,E=new Uint8Array(4),I=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(mr(e)||!e.output||!e.input&&0!==e.avail_in)return rr;r=e.state,r.mode===hr&&(r.mode=Ar),s=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,h=r.hold,A=r.bits,u=o,c=l,x=Jt;e:for(;;)switch(r.mode){case or:if(0===r.wrap){r.mode=Ar;break}for(;A<16;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(2&r.wrap&&35615===h){0===r.wbits&&(r.wbits=15),r.check=0,E[0]=255&h,E[1]=h>>>8&255,r.check=ye(r.check,E,2,0),h=0,A=0,r.mode=16181;break}if(r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&h)<<8)+(h>>8))%31){e.msg="incorrect header check",r.mode=fr;break}if((15&h)!==sr){e.msg="unknown compression method",r.mode=fr;break}if(h>>>=4,A-=4,b=8+(15&h),0===r.wbits&&(r.wbits=b),b>15||b>r.wbits){e.msg="invalid window size",r.mode=fr;break}r.dmax=1<<r.wbits,r.flags=0,e.adler=r.check=1,r.mode=512&h?16189:hr,h=0,A=0;break;case 16181:for(;A<16;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(r.flags=h,(255&r.flags)!==sr){e.msg="unknown compression method",r.mode=fr;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=fr;break}r.head&&(r.head.text=h>>8&1),512&r.flags&&4&r.wrap&&(E[0]=255&h,E[1]=h>>>8&255,r.check=ye(r.check,E,2,0)),h=0,A=0,r.mode=16182;case 16182:for(;A<32;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.head&&(r.head.time=h),512&r.flags&&4&r.wrap&&(E[0]=255&h,E[1]=h>>>8&255,E[2]=h>>>16&255,E[3]=h>>>24&255,r.check=ye(r.check,E,4,0)),h=0,A=0,r.mode=16183;case 16183:for(;A<16;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.head&&(r.head.xflags=255&h,r.head.os=h>>8),512&r.flags&&4&r.wrap&&(E[0]=255&h,E[1]=h>>>8&255,r.check=ye(r.check,E,2,0)),h=0,A=0,r.mode=16184;case 16184:if(1024&r.flags){for(;A<16;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.length=h,r.head&&(r.head.extra_len=h),512&r.flags&&4&r.wrap&&(E[0]=255&h,E[1]=h>>>8&255,r.check=ye(r.check,E,2,0)),h=0,A=0}else r.head&&(r.head.extra=null);r.mode=16185;case 16185:if(1024&r.flags&&(d=r.length,d>o&&(d=o),d&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(i.subarray(a,a+d),b)),512&r.flags&&4&r.wrap&&(r.check=ye(r.check,i,d,a)),o-=d,a+=d,r.length-=d),r.length))break e;r.length=0,r.mode=16186;case 16186:if(2048&r.flags){if(0===o)break e;d=0;do{b=i[a+d++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b))}while(b&&d<o);if(512&r.flags&&4&r.wrap&&(r.check=ye(r.check,i,d,a)),o-=d,a+=d,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=16187;case 16187:if(4096&r.flags){if(0===o)break e;d=0;do{b=i[a+d++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b))}while(b&&d<o);if(512&r.flags&&4&r.wrap&&(r.check=ye(r.check,i,d,a)),o-=d,a+=d,b)break e}else r.head&&(r.head.comment=null);r.mode=16188;case 16188:if(512&r.flags){for(;A<16;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(4&r.wrap&&h!==(65535&r.check)){e.msg="header crc mismatch",r.mode=fr;break}h=0,A=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=hr;break;case 16189:for(;A<32;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}e.adler=r.check=gr(h),h=0,A=0,r.mode=lr;case lr:if(0===r.havedict)return e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=o,r.hold=h,r.bits=A,tr;e.adler=r.check=1,r.mode=hr;case hr:if(t===Xt||t===Yt)break e;case Ar:if(r.last){h>>>=7&A,A-=7&A,r.mode=pr;break}for(;A<3;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}switch(r.last=1&h,h>>>=1,A-=1,3&h){case 0:r.mode=16193;break;case 1:if(Cr(r),r.mode=cr,t===Yt){h>>>=2,A-=2;break e}break;case 2:r.mode=16196;break;case 3:e.msg="invalid block type",r.mode=fr}h>>>=2,A-=2;break;case 16193:for(h>>>=7&A,A-=7&A;A<32;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if((65535&h)!=(h>>>16^65535)){e.msg="invalid stored block lengths",r.mode=fr;break}if(r.length=65535&h,h=0,A=0,r.mode=ur,t===Yt)break e;case ur:r.mode=16195;case 16195:if(d=r.length,d){if(d>o&&(d=o),d>l&&(d=l),0===d)break e;n.set(i.subarray(a,a+d),s),o-=d,a+=d,l-=d,s+=d,r.length-=d;break}r.mode=hr;break;case 16196:for(;A<14;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(r.nlen=257+(31&h),h>>>=5,A-=5,r.ndist=1+(31&h),h>>>=5,A-=5,r.ncode=4+(15&h),h>>>=4,A-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=fr;break}r.have=0,r.mode=16197;case 16197:for(;r.have<r.ncode;){for(;A<3;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.lens[I[r.have++]]=7&h,h>>>=3,A-=3}for(;r.have<19;)r.lens[I[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,B={bits:r.lenbits},x=Wt(0,r.lens,0,19,r.lencode,0,r.work,B),r.lenbits=B.bits,x){e.msg="invalid code lengths set",r.mode=fr;break}r.have=0,r.mode=16198;case 16198:for(;r.have<r.nlen+r.ndist;){for(;S=r.lencode[h&(1<<r.lenbits)-1],g=S>>>24,m=S>>>16&255,y=65535&S,!(g<=A);){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(y<16)h>>>=g,A-=g,r.lens[r.have++]=y;else{if(16===y){for(C=g+2;A<C;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(h>>>=g,A-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=fr;break}b=r.lens[r.have-1],d=3+(3&h),h>>>=2,A-=2}else if(17===y){for(C=g+3;A<C;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}h>>>=g,A-=g,b=0,d=3+(7&h),h>>>=3,A-=3}else{for(C=g+7;A<C;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}h>>>=g,A-=g,b=0,d=11+(127&h),h>>>=7,A-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=fr;break}for(;d--;)r.lens[r.have++]=b}}if(r.mode===fr)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=fr;break}if(r.lenbits=9,B={bits:r.lenbits},x=Wt(1,r.lens,0,r.nlen,r.lencode,0,r.work,B),r.lenbits=B.bits,x){e.msg="invalid literal/lengths set",r.mode=fr;break}if(r.distbits=6,r.distcode=r.distdyn,B={bits:r.distbits},x=Wt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,B),r.distbits=B.bits,x){e.msg="invalid distances set",r.mode=fr;break}if(r.mode=cr,t===Yt)break e;case cr:r.mode=dr;case dr:if(o>=6&&l>=258){e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=o,r.hold=h,r.bits=A,jt(e,c),s=e.next_out,n=e.output,l=e.avail_out,a=e.next_in,i=e.input,o=e.avail_in,h=r.hold,A=r.bits,r.mode===hr&&(r.back=-1);break}for(r.back=0;S=r.lencode[h&(1<<r.lenbits)-1],g=S>>>24,m=S>>>16&255,y=65535&S,!(g<=A);){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(m&&!(240&m)){for(_=g,v=m,w=y;S=r.lencode[w+((h&(1<<_+v)-1)>>_)],g=S>>>24,m=S>>>16&255,y=65535&S,!(_+g<=A);){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}h>>>=_,A-=_,r.back+=_}if(h>>>=g,A-=g,r.back+=g,r.length=y,0===m){r.mode=16205;break}if(32&m){r.back=-1,r.mode=hr;break}if(64&m){e.msg="invalid literal/length code",r.mode=fr;break}r.extra=15&m,r.mode=16201;case 16201:if(r.extra){for(C=r.extra;A<C;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.length+=h&(1<<r.extra)-1,h>>>=r.extra,A-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=16202;case 16202:for(;S=r.distcode[h&(1<<r.distbits)-1],g=S>>>24,m=S>>>16&255,y=65535&S,!(g<=A);){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(!(240&m)){for(_=g,v=m,w=y;S=r.distcode[w+((h&(1<<_+v)-1)>>_)],g=S>>>24,m=S>>>16&255,y=65535&S,!(_+g<=A);){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}h>>>=_,A-=_,r.back+=_}if(h>>>=g,A-=g,r.back+=g,64&m){e.msg="invalid distance code",r.mode=fr;break}r.offset=y,r.extra=15&m,r.mode=16203;case 16203:if(r.extra){for(C=r.extra;A<C;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}r.offset+=h&(1<<r.extra)-1,h>>>=r.extra,A-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=fr;break}r.mode=16204;case 16204:if(0===l)break e;if(d=c-l,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=fr;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),f=r.window}else f=n,p=s-r.offset,d=r.length;d>l&&(d=l),l-=d,r.length-=d;do{n[s++]=f[p++]}while(--d);0===r.length&&(r.mode=dr);break;case 16205:if(0===l)break e;n[s++]=r.length,l--,r.mode=dr;break;case pr:if(r.wrap){for(;A<32;){if(0===o)break e;o--,h|=i[a++]<<A,A+=8}if(c-=l,e.total_out+=c,r.total+=c,4&r.wrap&&c&&(e.adler=r.check=r.flags?ye(r.check,n,c,s-c):ge(r.check,n,c,s-c)),c=l,4&r.wrap&&(r.flags?h:gr(h))!==r.check){e.msg="incorrect data check",r.mode=fr;break}h=0,A=0}r.mode=16207;case 16207:if(r.wrap&&r.flags){for(;A<32;){if(0===o)break e;o--,h+=i[a++]<<A,A+=8}if(4&r.wrap&&h!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=fr;break}h=0,A=0}r.mode=16208;case 16208:x=er;break e;case fr:x=ir;break e;case 16210:return nr;default:return rr}return e.next_out=s,e.avail_out=l,e.next_in=a,e.avail_in=o,r.hold=h,r.bits=A,(r.wsize||c!==e.avail_out&&r.mode<fr&&(r.mode<pr||t!==$t))&&Sr(e,e.output,e.next_out,c-e.avail_out),u-=e.avail_in,c-=e.avail_out,e.total_in+=u,e.total_out+=c,r.total+=c,4&r.wrap&&c&&(e.adler=r.check=r.flags?ye(r.check,n,c,e.next_out-c):ge(r.check,n,c,e.next_out-c)),e.data_type=r.bits+(r.last?64:0)+(r.mode===hr?128:0)+(r.mode===cr||r.mode===ur?256:0),(0===u&&0===c||t===$t)&&x===Jt&&(x=ar),x},inflateEnd:e=>{if(mr(e))return rr;let t=e.state;return t.window&&(t.window=null),e.state=null,Jt},inflateGetHeader:(e,t)=>{if(mr(e))return rr;let r=e.state;return 2&r.wrap?(r.head=t,t.done=!1,Jt):rr},inflateSetDictionary:(e,t)=>{let r,i,n,a=t.length;return mr(e)||(r=e.state,0!==r.wrap&&r.mode!==lr)?rr:r.mode===lr&&(i=1,i=ge(i,t,a,0),i!==r.check)?ir:(n=Sr(e,t,a,a),n?(r.mode=16210,nr):(r.havedict=1,Jt))},inflateInfo:"pako inflate (from Nodeca project)"},Ir=C,Tr=Object.prototype.toString,({Z_NO_FLUSH:Fr,Z_FINISH:Pr,Z_OK:Lr,Z_STREAM_END:Mr,Z_NEED_DICT:kr,Z_STREAM_ERROR:Ur,Z_DATA_ERROR:Rr,Z_MEM_ERROR:Dr}=ve),S.prototype.push=function(e,t){let r,i,n,a=this.strm,s=this.options.chunkSize,o=this.options.dictionary;if(this.ended)return!1;for(i=t===~~t?t:!0===t?Pr:Fr,"[object ArrayBuffer]"===Tr.call(e)?a.input=new Uint8Array(e):a.input=e,a.next_in=0,a.avail_in=a.input.length;;){for(0===a.avail_out&&(a.output=new Uint8Array(s),a.next_out=0,a.avail_out=s),r=Er.inflate(a,i),r===kr&&o&&(r=Er.inflateSetDictionary(a,o),r===Lr?r=Er.inflate(a,i):r===Rr&&(r=kr));a.avail_in>0&&r===Mr&&a.state.wrap>0&&0!==e[a.next_in];)Er.inflateReset(a),r=Er.inflate(a,i);switch(r){case Ur:case Rr:case kr:case Dr:return this.onEnd(r),this.ended=!0,!1}if(n=a.avail_out,a.next_out&&(0===a.avail_out||r===Mr))if("string"===this.options.to){let e=Tt.utf8border(a.output,a.next_out),t=a.next_out-e,r=Tt.buf2string(a.output,e);a.next_out=t,a.avail_out=s-t,t&&a.output.set(a.output.subarray(e,e+t),0),this.onData(r)}else this.onData(a.output.length===a.next_out?a.output:a.output.subarray(0,a.next_out));if(r!==Lr||0!==n){if(r===Mr)return r=Er.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(0===a.avail_in)break}}return!0},S.prototype.onData=function(e){this.chunks.push(e)},S.prototype.onEnd=function(e){e===Lr&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ct.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},Nr={Inflate:S,inflate:E,inflateRaw:I,ungzip:E,constants:ve},({Deflate:Or,deflate:Qr,deflateRaw:zr,gzip:Hr}=zt),({Inflate:jr,inflate:Vr,inflateRaw:Gr,ungzip:Kr}=Nr),qr=jr,Zr=Vr})),$r=o(((e,t)=>{var r,i;r=e,i=function(){"use strict";var e=function(t,r){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(t,r)};function t(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var r=function(){return r=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},r.apply(this,arguments)};function i(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))}function n(e,t){var r,i,n,a,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return a={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function o(a){return function(o){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,i&&(n=2&a[0]?i.return:a[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,a[1])).done)return n;switch(i=0,n&&(a=[2&a[0],n.value]),a[0]){case 0:case 1:n=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,i=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(n=(n=s.trys).length>0&&n[n.length-1])&&(6===a[0]||2===a[0])){s=0;continue}if(3===a[0]&&(!n||a[1]>n[0]&&a[1]<n[3])){s.label=a[1];break}if(6===a[0]&&s.label<n[1]){s.label=n[1],n=a;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(a);break}n[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],i=0}finally{r=n=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,o])}}}function a(e,t,r){if(r||2===arguments.length)for(var i,n=0,a=t.length;n<a;n++)(i||!(n in t))&&(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||t)}for(var s=function(){function e(e,t,r,i){this.left=e,this.top=t,this.width=r,this.height=i}return e.prototype.add=function(t,r,i,n){return new e(this.left+t,this.top+r,this.width+i,this.height+n)},e.fromClientRect=function(t,r){return new e(r.left+t.windowBounds.left,r.top+t.windowBounds.top,r.width,r.height)},e.fromDOMRectList=function(t,r){var i=Array.from(r).find((function(e){return 0!==e.width}));return i?new e(i.left+t.windowBounds.left,i.top+t.windowBounds.top,i.width,i.height):e.EMPTY},e.EMPTY=new e(0,0,0,0),e}(),o=function(e,t){return s.fromClientRect(e,t.getBoundingClientRect())},l=function(e){for(var t=[],r=0,i=e.length;r<i;){var n=e.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&n)<<10)+(1023&a)+65536):(t.push(n),r--)}else t.push(n)}return t},h=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var i=[],n=-1,a="";++n<r;){var s=e[n];s<=65535?i.push(s):(s-=65536,i.push(55296+(s>>10),s%1024+56320)),(n+1===r||i.length>16384)&&(a+=String.fromCharCode.apply(String,i),i.length=0)}return a},A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=typeof Uint8Array>"u"?[]:new Uint8Array(256),c=0;c<64;c++)u[A.charCodeAt(c)]=c;for(var d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=typeof Uint8Array>"u"?[]:new Uint8Array(256),f=0;f<64;f++)p[d.charCodeAt(f)]=f;for(var g=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},m=function(){function e(e,t,r,i,n,a){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=n,this.data=a}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_=typeof Uint8Array>"u"?[]:new Uint8Array(256),v=0;v<64;v++)_[y.charCodeAt(v)]=v;var w,b,x,B,C,S=10,E=13,I=15,T=17,F=18,P=19,L=20,M=21,k=22,U=24,R=25,D=26,N=27,O=28,Q=30,z=32,H=33,j=34,V=35,G=37,K=38,q=39,Z=40,W=42,$=[9001,65288],X="×",Y="÷",J=(w=function(e){var t,r,i,n,a,s=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(s):new Array(s),A=Array.isArray(h)?h:new Uint8Array(h);for(t=0;t<o;t+=4)r=p[e.charCodeAt(t)],i=p[e.charCodeAt(t+1)],n=p[e.charCodeAt(t+2)],a=p[e.charCodeAt(t+3)],A[l++]=r<<2|i>>4,A[l++]=(15&i)<<4|n>>2,A[l++]=(3&n)<<6|63&a;return h}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),b=Array.isArray(w)?function(e){for(var t=e.length,r=[],i=0;i<t;i+=4)r.push(e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i]);return r}(w):new Uint32Array(w),x=Array.isArray(w)?function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r.push(e[i+1]<<8|e[i]);return r}(w):new Uint16Array(w),B=g(x,12,b[4]/2),C=2===b[5]?g(x,(24+b[4])/2):function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))}(b,Math.ceil((24+b[4])/4)),new m(b[0],b[1],b[2],b[3],B,C)),ee=[Q,36],te=[1,2,3,5],re=[S,8],ie=[N,D],ne=te.concat(re),ae=[K,q,Z,j,V],se=[I,E],oe=function(e,t,r,i){var n=i[r];if(Array.isArray(e)?-1!==e.indexOf(n):e===n)for(var a=r;a<=i.length;){if((l=i[++a])===t)return!0;if(l!==S)break}if(n===S)for(a=r;a>0;){var s=i[--a];if(Array.isArray(e)?-1!==e.indexOf(s):e===s)for(var o=r;o<=i.length;){var l;if((l=i[++o])===t)return!0;if(l!==S)break}if(s!==S)break}return!1},le=function(e,t){for(var r=e;r>=0;){var i=t[r];if(i!==S)return i;r--}return 0},he=function(e,t,r,i,n){if(0===r[i])return X;var a=i-1;if(Array.isArray(n)&&!0===n[a])return X;var s=a-1,o=a+1,l=t[a],h=s>=0?t[s]:0,A=t[o];if(2===l&&3===A)return X;if(-1!==te.indexOf(l))return"!";if(-1!==te.indexOf(A)||-1!==re.indexOf(A))return X;if(8===le(a,t))return Y;if(11===J.get(e[a])||(l===z||l===H)&&11===J.get(e[o])||7===l||7===A||9===l||-1===[S,E,I].indexOf(l)&&9===A||-1!==[T,F,P,U,O].indexOf(A)||le(a,t)===k||oe(23,k,a,t)||oe([T,F],M,a,t)||oe(12,12,a,t))return X;if(l===S)return Y;if(23===l||23===A)return X;if(16===A||16===l)return Y;if(-1!==[E,I,M].indexOf(A)||14===l||36===h&&-1!==se.indexOf(l)||l===O&&36===A||A===L||-1!==ee.indexOf(A)&&l===R||-1!==ee.indexOf(l)&&A===R||l===N&&-1!==[G,z,H].indexOf(A)||-1!==[G,z,H].indexOf(l)&&A===D||-1!==ee.indexOf(l)&&-1!==ie.indexOf(A)||-1!==ie.indexOf(l)&&-1!==ee.indexOf(A)||-1!==[N,D].indexOf(l)&&(A===R||-1!==[k,I].indexOf(A)&&t[o+1]===R)||-1!==[k,I].indexOf(l)&&A===R||l===R&&-1!==[R,O,U].indexOf(A))return X;if(-1!==[R,O,U,T,F].indexOf(A))for(var u=a;u>=0;){if((c=t[u])===R)return X;if(-1===[O,U].indexOf(c))break;u--}if(-1!==[N,D].indexOf(A))for(u=-1!==[T,F].indexOf(l)?s:a;u>=0;){var c;if((c=t[u])===R)return X;if(-1===[O,U].indexOf(c))break;u--}if(K===l&&-1!==[K,q,j,V].indexOf(A)||-1!==[q,j].indexOf(l)&&-1!==[q,Z].indexOf(A)||-1!==[Z,V].indexOf(l)&&A===Z||-1!==ae.indexOf(l)&&-1!==[L,D].indexOf(A)||-1!==ae.indexOf(A)&&l===N||-1!==ee.indexOf(l)&&-1!==ee.indexOf(A)||l===U&&-1!==ee.indexOf(A)||-1!==ee.concat(R).indexOf(l)&&A===k&&-1===$.indexOf(e[o])||-1!==ee.concat(R).indexOf(A)&&l===F)return X;if(41===l&&41===A){for(var d=r[a],p=1;d>0&&41===t[--d];)p++;if(p%2!=0)return X}return l===z&&A===H?X:Y},Ae=function(e,t){t||(t={lineBreak:"normal",wordBreak:"normal"});var r=function(e,t){void 0===t&&(t="strict");var r=[],i=[],n=[];return e.forEach((function(e,a){var s=J.get(e);if(s>50?(n.push(!0),s-=50):n.push(!1),-1!==["normal","auto","loose"].indexOf(t)&&-1!==[8208,8211,12316,12448].indexOf(e))return i.push(a),r.push(16);if(4===s||11===s){if(0===a)return i.push(a),r.push(Q);var o=r[a-1];return-1===ne.indexOf(o)?(i.push(i[a-1]),r.push(o)):(i.push(a),r.push(Q))}return i.push(a),31===s?r.push("strict"===t?M:G):s===W||29===s?r.push(Q):43===s?e>=131072&&e<=196605||e>=196608&&e<=262141?r.push(G):r.push(Q):void r.push(s)})),[i,r,n]}(e,t.lineBreak),i=r[0],n=r[1],a=r[2];("break-all"===t.wordBreak||"break-word"===t.wordBreak)&&(n=n.map((function(e){return-1!==[R,Q,W].indexOf(e)?G:e})));var s="keep-all"===t.wordBreak?a.map((function(t,r){return t&&e[r]>=19968&&e[r]<=40959})):void 0;return[i,n,s]},ue=function(){function e(e,t,r,i){this.codePoints=e,this.required="!"===t,this.start=r,this.end=i}return e.prototype.slice=function(){return h.apply(void 0,this.codePoints.slice(this.start,this.end))},e}(),ce=45,de=43,pe=-1,fe=function(e){return e>=48&&e<=57},ge=function(e){return fe(e)||e>=65&&e<=70||e>=97&&e<=102},me=function(e){return 10===e||9===e||32===e},ye=function(e){return function(e){return function(e){return e>=97&&e<=122}(e)||function(e){return e>=65&&e<=90}(e)}(e)||function(e){return e>=128}(e)||95===e},_e=function(e){return ye(e)||fe(e)||e===ce},ve=function(e){return e>=0&&e<=8||11===e||e>=14&&e<=31||127===e},we=function(e,t){return 92===e&&10!==t},be=function(e,t,r){return e===ce?ye(t)||we(t,r):!!ye(e)||!(92!==e||!we(e,t))},xe=function(e,t,r){return e===de||e===ce?!!fe(t)||46===t&&fe(r):fe(46===e?t:e)},Be=function(e){var t=0,r=1;(e[t]===de||e[t]===ce)&&(e[t]===ce&&(r=-1),t++);for(var i=[];fe(e[t]);)i.push(e[t++]);var n=i.length?parseInt(h.apply(void 0,i),10):0;46===e[t]&&t++;for(var a=[];fe(e[t]);)a.push(e[t++]);var s=a.length,o=s?parseInt(h.apply(void 0,a),10):0;(69===e[t]||101===e[t])&&t++;var l=1;(e[t]===de||e[t]===ce)&&(e[t]===ce&&(l=-1),t++);for(var A=[];fe(e[t]);)A.push(e[t++]);var u=A.length?parseInt(h.apply(void 0,A),10):0;return r*(n+o*Math.pow(10,-s))*Math.pow(10,l*u)},Ce={type:2},Se={type:3},Ee={type:4},Ie={type:13},Te={type:8},Fe={type:21},Pe={type:9},Le={type:10},Me={type:11},ke={type:12},Ue={type:14},Re={type:23},De={type:1},Ne={type:25},Oe={type:24},Qe={type:26},ze={type:27},He={type:28},je={type:29},Ve={type:31},Ge={type:32},Ke=function(){function e(){this._value=[]}return e.prototype.write=function(e){this._value=this._value.concat(l(e))},e.prototype.read=function(){for(var e=[],t=this.consumeToken();t!==Ge;)e.push(t),t=this.consumeToken();return e},e.prototype.consumeToken=function(){var e=this.consumeCodePoint();switch(e){case 34:return this.consumeStringToken(34);case 35:var t=this.peekCodePoint(0),r=this.peekCodePoint(1),i=this.peekCodePoint(2);if(_e(t)||we(r,i)){var n=be(t,r,i)?2:1;return{type:5,value:this.consumeName(),flags:n}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ie;break;case 39:return this.consumeStringToken(39);case 40:return Ce;case 41:return Se;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Ue;break;case de:if(xe(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 44:return Ee;case ce:var a=e,s=this.peekCodePoint(0),o=this.peekCodePoint(1);if(xe(a,s,o))return this.reconsumeCodePoint(e),this.consumeNumericToken();if(be(a,s,o))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();if(s===ce&&62===o)return this.consumeCodePoint(),this.consumeCodePoint(),Oe;break;case 46:if(xe(e,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(e),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var l=this.consumeCodePoint();if(42===l&&47===(l=this.consumeCodePoint()))return this.consumeToken();if(l===pe)return this.consumeToken()}break;case 58:return Qe;case 59:return ze;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===ce&&this.peekCodePoint(2)===ce)return this.consumeCodePoint(),this.consumeCodePoint(),Ne;break;case 64:var A=this.peekCodePoint(0),u=this.peekCodePoint(1),c=this.peekCodePoint(2);if(be(A,u,c))return{type:7,value:this.consumeName()};break;case 91:return He;case 92:if(we(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),this.consumeIdentLikeToken();break;case 93:return je;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Te;break;case 123:return Me;case 125:return ke;case 117:case 85:var d=this.peekCodePoint(0),p=this.peekCodePoint(1);return d===de&&(ge(p)||63===p)&&(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(e),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Pe;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),Fe;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),Le;break;case pe:return Ge}return me(e)?(this.consumeWhiteSpace(),Ve):fe(e)?(this.reconsumeCodePoint(e),this.consumeNumericToken()):ye(e)?(this.reconsumeCodePoint(e),this.consumeIdentLikeToken()):{type:6,value:h(e)}},e.prototype.consumeCodePoint=function(){var e=this._value.shift();return typeof e>"u"?-1:e},e.prototype.reconsumeCodePoint=function(e){this._value.unshift(e)},e.prototype.peekCodePoint=function(e){return e>=this._value.length?-1:this._value[e]},e.prototype.consumeUnicodeRangeToken=function(){for(var e=[],t=this.consumeCodePoint();ge(t)&&e.length<6;)e.push(t),t=this.consumeCodePoint();for(var r=!1;63===t&&e.length<6;)e.push(t),t=this.consumeCodePoint(),r=!0;if(r)return{type:30,start:parseInt(h.apply(void 0,e.map((function(e){return 63===e?48:e}))),16),end:parseInt(h.apply(void 0,e.map((function(e){return 63===e?70:e}))),16)};var i=parseInt(h.apply(void 0,e),16);if(this.peekCodePoint(0)===ce&&ge(this.peekCodePoint(1))){this.consumeCodePoint(),t=this.consumeCodePoint();for(var n=[];ge(t)&&n.length<6;)n.push(t),t=this.consumeCodePoint();return{type:30,start:i,end:parseInt(h.apply(void 0,n),16)}}return{type:30,start:i,end:i}},e.prototype.consumeIdentLikeToken=function(){var e=this.consumeName();return"url"===e.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:e}):{type:20,value:e}},e.prototype.consumeUrlToken=function(){var e=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===pe)return{type:22,value:""};var t=this.peekCodePoint(0);if(39===t||34===t){var r=this.consumeStringToken(this.consumeCodePoint());return 0===r.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===pe||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:r.value}):(this.consumeBadUrlRemnants(),Re)}for(;;){var i=this.consumeCodePoint();if(i===pe||41===i)return{type:22,value:h.apply(void 0,e)};if(me(i))return this.consumeWhiteSpace(),this.peekCodePoint(0)===pe||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:h.apply(void 0,e)}):(this.consumeBadUrlRemnants(),Re);if(34===i||39===i||40===i||ve(i))return this.consumeBadUrlRemnants(),Re;if(92===i){if(!we(i,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),Re;e.push(this.consumeEscapedCodePoint())}else e.push(i)}},e.prototype.consumeWhiteSpace=function(){for(;me(this.peekCodePoint(0));)this.consumeCodePoint()},e.prototype.consumeBadUrlRemnants=function(){for(;;){var e=this.consumeCodePoint();if(41===e||e===pe)return;we(e,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},e.prototype.consumeStringSlice=function(e){for(var t="";e>0;){var r=Math.min(5e4,e);t+=h.apply(void 0,this._value.splice(0,r)),e-=r}return this._value.shift(),t},e.prototype.consumeStringToken=function(e){for(var t="",r=0;;){var i=this._value[r];if(i===pe||void 0===i||i===e)return{type:0,value:t+=this.consumeStringSlice(r)};if(10===i)return this._value.splice(0,r),De;if(92===i){var n=this._value[r+1];n!==pe&&void 0!==n&&(10===n?(t+=this.consumeStringSlice(r),r=-1,this._value.shift()):we(i,n)&&(t+=this.consumeStringSlice(r),t+=h(this.consumeEscapedCodePoint()),r=-1))}r++}},e.prototype.consumeNumber=function(){var e=[],t=4,r=this.peekCodePoint(0);for((r===de||r===ce)&&e.push(this.consumeCodePoint());fe(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0);var i=this.peekCodePoint(1);if(46===r&&fe(i))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;fe(this.peekCodePoint(0));)e.push(this.consumeCodePoint());r=this.peekCodePoint(0),i=this.peekCodePoint(1);var n=this.peekCodePoint(2);if((69===r||101===r)&&((i===de||i===ce)&&fe(n)||fe(i)))for(e.push(this.consumeCodePoint(),this.consumeCodePoint()),t=8;fe(this.peekCodePoint(0));)e.push(this.consumeCodePoint());return[Be(e),t]},e.prototype.consumeNumericToken=function(){var e=this.consumeNumber(),t=e[0],r=e[1],i=this.peekCodePoint(0),n=this.peekCodePoint(1),a=this.peekCodePoint(2);return be(i,n,a)?{type:15,number:t,flags:r,unit:this.consumeName()}:37===i?(this.consumeCodePoint(),{type:16,number:t,flags:r}):{type:17,number:t,flags:r}},e.prototype.consumeEscapedCodePoint=function(){var e=this.consumeCodePoint();if(ge(e)){for(var t=h(e);ge(this.peekCodePoint(0))&&t.length<6;)t+=h(this.consumeCodePoint());me(this.peekCodePoint(0))&&this.consumeCodePoint();var r=parseInt(t,16);return 0===r||function(e){return e>=55296&&e<=57343}(r)||r>1114111?65533:r}return e===pe?65533:e},e.prototype.consumeName=function(){for(var e="";;){var t=this.consumeCodePoint();if(_e(t))e+=h(t);else{if(!we(t,this.peekCodePoint(0)))return this.reconsumeCodePoint(t),e;e+=h(this.consumeEscapedCodePoint())}}},e}(),qe=function(){function e(e){this._tokens=e}return e.create=function(t){var r=new Ke;return r.write(t),new e(r.read())},e.parseValue=function(t){return e.create(t).parseComponentValue()},e.parseValues=function(t){return e.create(t).parseComponentValues()},e.prototype.parseComponentValue=function(){for(var e=this.consumeToken();31===e.type;)e=this.consumeToken();if(32===e.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(e);var t=this.consumeComponentValue();do{e=this.consumeToken()}while(31===e.type);if(32===e.type)return t;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},e.prototype.parseComponentValues=function(){for(var e=[];;){var t=this.consumeComponentValue();if(32===t.type)return e;e.push(t),e.push()}},e.prototype.consumeComponentValue=function(){var e=this.consumeToken();switch(e.type){case 11:case 28:case 2:return this.consumeSimpleBlock(e.type);case 19:return this.consumeFunction(e)}return e},e.prototype.consumeSimpleBlock=function(e){for(var t={type:e,values:[]},r=this.consumeToken();;){if(32===r.type||rt(r,e))return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue()),r=this.consumeToken()}},e.prototype.consumeFunction=function(e){for(var t={name:e.value,values:[],type:18};;){var r=this.consumeToken();if(32===r.type||3===r.type)return t;this.reconsumeToken(r),t.values.push(this.consumeComponentValue())}},e.prototype.consumeToken=function(){var e=this._tokens.shift();return typeof e>"u"?Ge:e},e.prototype.reconsumeToken=function(e){this._tokens.unshift(e)},e}(),Ze=function(e){return 15===e.type},We=function(e){return 17===e.type},$e=function(e){return 20===e.type},Xe=function(e){return 0===e.type},Ye=function(e,t){return $e(e)&&e.value===t},Je=function(e){return 31!==e.type},et=function(e){return 31!==e.type&&4!==e.type},tt=function(e){var t=[],r=[];return e.forEach((function(e){if(4===e.type){if(0===r.length)throw new Error("Error parsing function args, zero tokens for arg");return t.push(r),void(r=[])}31!==e.type&&r.push(e)})),r.length&&t.push(r),t},rt=function(e,t){return 11===t&&12===e.type||28===t&&29===e.type||2===t&&3===e.type},it=function(e){return 17===e.type||15===e.type},nt=function(e){return 16===e.type||it(e)},at=function(e){return e.length>1?[e[0],e[1]]:[e[0]]},st={type:17,number:0,flags:4},ot={type:16,number:50,flags:4},lt={type:16,number:100,flags:4},ht=function(e,t,r){var i=e[0],n=e[1];return[At(i,t),At(typeof n<"u"?n:i,r)]},At=function(e,t){if(16===e.type)return e.number/100*t;if(Ze(e))switch(e.unit){case"rem":case"em":return 16*e.number;default:return e.number}return e.number},ut="grad",ct="turn",dt=function(e,t){if(15===t.type)switch(t.unit){case"deg":return Math.PI*t.number/180;case ut:return Math.PI/200*t.number;case"rad":return t.number;case ct:return 2*Math.PI*t.number}throw new Error("Unsupported angle type")},pt=function(e){return 15===e.type&&("deg"===e.unit||e.unit===ut||"rad"===e.unit||e.unit===ct)},ft=function(e){var t=e.filter($e).map((function(e){return e.value})).join(" ");switch(t){case"to bottom right":case"to right bottom":case"left top":case"top left":return[st,st];case"to top":case"bottom":return gt(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[st,lt];case"to right":case"left":return gt(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[lt,lt];case"to bottom":case"top":return gt(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[lt,st];case"to left":case"right":return gt(270)}return 0},gt=function(e){return Math.PI*e/180},mt=function(e,t){if(18===t.type){var r=St[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported color function "'+t.name+'"');return r(e,t.values)}if(5===t.type){if(3===t.value.length){var i=t.value.substring(0,1),n=t.value.substring(1,2),a=t.value.substring(2,3);return vt(parseInt(i+i,16),parseInt(n+n,16),parseInt(a+a,16),1)}if(4===t.value.length){i=t.value.substring(0,1),n=t.value.substring(1,2),a=t.value.substring(2,3);var s=t.value.substring(3,4);return vt(parseInt(i+i,16),parseInt(n+n,16),parseInt(a+a,16),parseInt(s+s,16)/255)}if(6===t.value.length)return i=t.value.substring(0,2),n=t.value.substring(2,4),a=t.value.substring(4,6),vt(parseInt(i,16),parseInt(n,16),parseInt(a,16),1);if(8===t.value.length)return i=t.value.substring(0,2),n=t.value.substring(2,4),a=t.value.substring(4,6),s=t.value.substring(6,8),vt(parseInt(i,16),parseInt(n,16),parseInt(a,16),parseInt(s,16)/255)}if(20===t.type){var o=It[t.value.toUpperCase()];if(typeof o<"u")return o}return It.TRANSPARENT},yt=function(e){return!(255&e)},_t=function(e){var t=255&e,r=255&e>>8,i=255&e>>16,n=255&e>>24;return t<255?"rgba("+n+","+i+","+r+","+t/255+")":"rgb("+n+","+i+","+r+")"},vt=function(e,t,r,i){return(e<<24|t<<16|r<<8|Math.round(255*i))>>>0},wt=function(e,t){if(17===e.type)return e.number;if(16===e.type){var r=3===t?1:255;return 3===t?e.number/100*r:Math.round(e.number/100*r)}return 0},bt=function(e,t){var r=t.filter(et);if(3===r.length){var i=r.map(wt),n=i[0],a=i[1],s=i[2];return vt(n,a,s,1)}if(4===r.length){var o=r.map(wt),l=(n=o[0],a=o[1],s=o[2],o[3]);return vt(n,a,s,l)}return 0};function xt(e,t,r){return r<0&&(r+=1),r>=1&&(r-=1),r<1/6?(t-e)*r*6+e:r<.5?t:r<2/3?6*(t-e)*(2/3-r)+e:e}var Bt,Ct=function(e,t){var r=t.filter(et),i=r[0],n=r[1],a=r[2],s=r[3],o=(17===i.type?gt(i.number):dt(e,i))/(2*Math.PI),l=nt(n)?n.number/100:0,h=nt(a)?a.number/100:0,A=typeof s<"u"&&nt(s)?At(s,1):1;if(0===l)return vt(255*h,255*h,255*h,1);var u=h<=.5?h*(l+1):h+l-h*l,c=2*h-u,d=xt(c,u,o+1/3),p=xt(c,u,o),f=xt(c,u,o-1/3);return vt(255*d,255*p,255*f,A)},St={hsl:Ct,hsla:Ct,rgb:bt,rgba:bt},Et=function(e,t){return mt(e,qe.create(t).parseComponentValue())},It={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},Tt={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if($e(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},Ft={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Pt=function(e,t){var r=mt(e,t[0]),i=t[1];return i&&nt(i)?{color:r,stop:i}:{color:r,stop:null}},Lt=function(e,t){var r=e[0],i=e[e.length-1];null===r.stop&&(r.stop=st),null===i.stop&&(i.stop=lt);for(var n=[],a=0,s=0;s<e.length;s++){var o=e[s].stop;if(null!==o){var l=At(o,t);l>a?n.push(l):n.push(a),a=l}else n.push(null)}var h=null;for(s=0;s<n.length;s++){var A=n[s];if(null===A)null===h&&(h=s);else if(null!==h){for(var u=s-h,c=(A-n[h-1])/(u+1),d=1;d<=u;d++)n[h+d-1]=c*d;h=null}}return e.map((function(e,r){return{color:e.color,stop:Math.max(Math.min(1,n[r]/t),0)}}))},Mt=function(e,t,r){var i="number"==typeof e?e:function(e,t,r){var i=t/2,n=r/2,a=At(e[0],t)-i,s=n-At(e[1],r);return(Math.atan2(s,a)+2*Math.PI)%(2*Math.PI)}(e,t,r),n=Math.abs(t*Math.sin(i))+Math.abs(r*Math.cos(i)),a=t/2,s=r/2,o=n/2,l=Math.sin(i-Math.PI/2)*o,h=Math.cos(i-Math.PI/2)*o;return[n,a-h,a+h,s-l,s+l]},kt=function(e,t){return Math.sqrt(e*e+t*t)},Ut=function(e,t,r,i,n){return[[0,0],[0,t],[e,0],[e,t]].reduce((function(e,t){var a=t[0],s=t[1],o=kt(r-a,i-s);return(n?o<e.optimumDistance:o>e.optimumDistance)?{optimumCorner:t,optimumDistance:o}:e}),{optimumDistance:n?1/0:-1/0,optimumCorner:null}).optimumCorner},Rt=function(e,t){var r=gt(180),i=[];return tt(t).forEach((function(t,n){if(0===n){var a=t[0];if(20===a.type&&-1!==["top","left","right","bottom"].indexOf(a.value))return void(r=ft(t));if(pt(a))return void(r=(dt(e,a)+gt(270))%gt(360))}var s=Pt(e,t);i.push(s)})),{angle:r,stops:i,type:1}},Dt="closest-side",Nt="farthest-side",Ot="closest-corner",Qt="farthest-corner",zt="circle",Ht="ellipse",jt="cover",Vt="contain",Gt=function(e,t){var r=0,i=3,n=[],a=[];return tt(t).forEach((function(t,s){var o=!0;if(0===s?o=t.reduce((function(e,t){if($e(t))switch(t.value){case"center":return a.push(ot),!1;case"top":case"left":return a.push(st),!1;case"right":case"bottom":return a.push(lt),!1}else if(nt(t)||it(t))return a.push(t),!1;return e}),o):1===s&&(o=t.reduce((function(e,t){if($e(t))switch(t.value){case zt:return r=0,!1;case Ht:return r=1,!1;case Vt:case Dt:return i=0,!1;case Nt:return i=1,!1;case Ot:return i=2,!1;case jt:case Qt:return i=3,!1}else if(it(t)||nt(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return e}),o)),o){var l=Pt(e,t);n.push(l)}})),{size:i,shape:r,stops:n,position:a,type:2}},Kt=function(e,t){if(22===t.type){var r={url:t.value,type:0};return e.cache.addImage(t.value),r}if(18===t.type){var i=qt[t.name];if(typeof i>"u")throw new Error('Attempting to parse an unsupported image function "'+t.name+'"');return i(e,t.values)}throw new Error("Unsupported image type "+t.type)},qt={"linear-gradient":function(e,t){var r=gt(180),i=[];return tt(t).forEach((function(t,n){if(0===n){var a=t[0];if(20===a.type&&"to"===a.value)return void(r=ft(t));if(pt(a))return void(r=dt(e,a))}var s=Pt(e,t);i.push(s)})),{angle:r,stops:i,type:1}},"-moz-linear-gradient":Rt,"-ms-linear-gradient":Rt,"-o-linear-gradient":Rt,"-webkit-linear-gradient":Rt,"radial-gradient":function(e,t){var r=0,i=3,n=[],a=[];return tt(t).forEach((function(t,s){var o=!0;if(0===s){var l=!1;o=t.reduce((function(e,t){if(l)if($e(t))switch(t.value){case"center":return a.push(ot),e;case"top":case"left":return a.push(st),e;case"right":case"bottom":return a.push(lt),e}else(nt(t)||it(t))&&a.push(t);else if($e(t))switch(t.value){case zt:return r=0,!1;case Ht:return r=1,!1;case"at":return l=!0,!1;case Dt:return i=0,!1;case jt:case Nt:return i=1,!1;case Vt:case Ot:return i=2,!1;case Qt:return i=3,!1}else if(it(t)||nt(t))return Array.isArray(i)||(i=[]),i.push(t),!1;return e}),o)}if(o){var h=Pt(e,t);n.push(h)}})),{size:i,shape:r,stops:n,position:a,type:2}},"-moz-radial-gradient":Gt,"-ms-radial-gradient":Gt,"-o-radial-gradient":Gt,"-webkit-radial-gradient":Gt,"-webkit-gradient":function(e,t){var r=gt(180),i=[],n=1;return tt(t).forEach((function(t,r){var a=t[0];if(0===r){if($e(a)&&"linear"===a.value)return void(n=1);if($e(a)&&"radial"===a.value)return void(n=2)}if(18===a.type)if("from"===a.name){var s=mt(e,a.values[0]);i.push({stop:st,color:s})}else if("to"===a.name)s=mt(e,a.values[0]),i.push({stop:lt,color:s});else if("color-stop"===a.name){var o=a.values.filter(et);if(2===o.length){s=mt(e,o[1]);var l=o[0];We(l)&&i.push({stop:{type:16,number:100*l.number,flags:l.flags},color:s})}}})),1===n?{angle:(r+gt(180))%gt(360),stops:i,type:n}:{size:3,shape:0,stops:i,position:[],type:n}}},Zt={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var r=t[0];return 20===r.type&&"none"===r.value?[]:t.filter((function(e){return et(e)&&function(e){return!(20===e.type&&"none"===e.value||18===e.type&&!qt[e.name])}(e)})).map((function(t){return Kt(e,t)}))}},Wt={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(e,t){return t.map((function(e){if($e(e))switch(e.value){case"padding-box":return 1;case"content-box":return 2}return 0}))}},$t={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(e,t){return tt(t).map((function(e){return e.filter(nt)})).map(at)}},Xt={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(e,t){return tt(t).map((function(e){return e.filter($e).map((function(e){return e.value})).join(" ")})).map(Yt)}},Yt=function(e){switch(e){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(e){e.AUTO="auto",e.CONTAIN="contain",e.COVER="cover"}(Bt||(Bt={}));var Jt,er={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(e,t){return tt(t).map((function(e){return e.filter(tr)}))}},tr=function(e){return $e(e)||nt(e)},rr=function(e){return{name:"border-"+e+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},ir=rr("top"),nr=rr("right"),ar=rr("bottom"),sr=rr("left"),or=function(e){return{name:"border-radius-"+e,initialValue:"0 0",prefix:!1,type:1,parse:function(e,t){return at(t.filter(nt))}}},lr=or("top-left"),hr=or("top-right"),Ar=or("bottom-right"),ur=or("bottom-left"),cr=function(e){return{name:"border-"+e+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(e,t){switch(t){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},dr=cr("top"),pr=cr("right"),fr=cr("bottom"),gr=cr("left"),mr=function(e){return{name:"border-"+e+"-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Ze(t)?t.number:0}}},yr=mr("top"),_r=mr("right"),vr=mr("bottom"),wr=mr("left"),br={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},xr={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(e,t){return"rtl"===t?1:0}},Br={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(e,t){return t.filter($e).reduce((function(e,t){return e|Cr(t.value)}),0)}},Cr=function(e){switch(e){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Sr={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},Er={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(e,t){return 20===t.type&&"normal"===t.value?0:17===t.type||15===t.type?t.number:0}};!function(e){e.NORMAL="normal",e.STRICT="strict"}(Jt||(Jt={}));var Ir,Tr={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"strict"===t?Jt.STRICT:Jt.NORMAL}},Fr={name:"line-height",initialValue:"normal",prefix:!1,type:4},Pr=function(e,t){return $e(e)&&"normal"===e.value?1.2*t:17===e.type?t*e.number:nt(e)?At(e,t):t},Lr={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(e,t){return 20===t.type&&"none"===t.value?null:Kt(e,t)}},Mr={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(e,t){return"inside"===t?0:1}},kr={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Ur=function(e){return{name:"margin-"+e,initialValue:"0",prefix:!1,type:4}},Rr=Ur("top"),Dr=Ur("right"),Nr=Ur("bottom"),Or=Ur("left"),Qr={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(e,t){return t.filter($e).map((function(e){switch(e.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}}))}},zr={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){return"break-word"===t?"break-word":"normal"}},Hr=function(e){return{name:"padding-"+e,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},jr=Hr("top"),Vr=Hr("right"),Gr=Hr("bottom"),Kr=Hr("left"),qr={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(e,t){switch(t){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Zr={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(e,t){switch(t){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Wr={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Ye(t[0],"none")?[]:tt(t).map((function(t){for(var r={color:It.TRANSPARENT,offsetX:st,offsetY:st,blur:st},i=0,n=0;n<t.length;n++){var a=t[n];it(a)?(0===i?r.offsetX=a:1===i?r.offsetY=a:r.blur=a,i++):r.color=mt(e,a)}return r}))}},$r={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},Xr={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(e,t){if(20===t.type&&"none"===t.value)return null;if(18===t.type){var r=Yr[t.name];if(typeof r>"u")throw new Error('Attempting to parse an unsupported transform function "'+t.name+'"');return r(t.values)}return null}},Yr={matrix:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number}));return 6===t.length?t:null},matrix3d:function(e){var t=e.filter((function(e){return 17===e.type})).map((function(e){return e.number})),r=t[0],i=t[1];t[2],t[3];var n=t[4],a=t[5];t[6],t[7],t[8],t[9],t[10],t[11];var s=t[12],o=t[13];return t[14],t[15],16===t.length?[r,i,n,a,s,o]:null}},Jr={type:16,number:50,flags:4},ei=[Jr,Jr],ti={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(e,t){var r=t.filter(nt);return 2!==r.length?ei:[r[0],r[1]]}},ri={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(e,t){switch(t){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(e){e.NORMAL="normal",e.BREAK_ALL="break-all",e.KEEP_ALL="keep-all"}(Ir||(Ir={}));for(var ii={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"break-all":return Ir.BREAK_ALL;case"keep-all":return Ir.KEEP_ALL;default:return Ir.NORMAL}}},ni={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(e,t){if(20===t.type)return{auto:!0,order:0};if(We(t))return{auto:!1,order:t.number};throw new Error("Invalid z-index number parsed")}},ai={name:"time",parse:function(e,t){if(15===t.type)switch(t.unit.toLowerCase()){case"s":return 1e3*t.number;case"ms":return t.number}throw new Error("Unsupported time type")}},si={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(e,t){return We(t)?t.number:1}},oi={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},li={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(e,t){return t.filter($e).map((function(e){switch(e.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0})).filter((function(e){return 0!==e}))}},hi={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(e,t){var r=[],i=[];return t.forEach((function(e){switch(e.type){case 20:case 0:r.push(e.value);break;case 17:r.push(e.number.toString());break;case 4:i.push(r.join(" ")),r.length=0}})),r.length&&i.push(r.join(" ")),i.map((function(e){return-1===e.indexOf(" ")?e:"'"+e+"'"}))}},Ai={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},ui={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(e,t){return We(t)?t.number:$e(t)&&"bold"===t.value?700:400}},ci={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return t.filter($e).map((function(e){return e.value}))}},di={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(e,t){switch(t){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},pi=function(e,t){return!!(e&t)},fi={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(e,t){if(0===t.length)return[];var r=t[0];return 20===r.type&&"none"===r.value?[]:t}},gi={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var r=t[0];if(20===r.type&&"none"===r.value)return null;for(var i=[],n=t.filter(Je),a=0;a<n.length;a++){var s=n[a],o=n[a+1];if(20===s.type){var l=o&&We(o)?o.number:1;i.push({counter:s.value,increment:l})}}return i}},mi={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return[];for(var r=[],i=t.filter(Je),n=0;n<i.length;n++){var a=i[n],s=i[n+1];if($e(a)&&"none"!==a.value){var o=s&&We(s)?s.number:0;r.push({counter:a.value,reset:o})}}return r}},yi={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(e,t){return t.filter(Ze).map((function(t){return ai.parse(e,t)}))}},_i={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(e,t){if(0===t.length)return null;var r=t[0];if(20===r.type&&"none"===r.value)return null;var i=[],n=t.filter(Xe);if(n.length%2!=0)return null;for(var a=0;a<n.length;a+=2){var s=n[a].value,o=n[a+1].value;i.push({open:s,close:o})}return i}},vi=function(e,t,r){if(!e)return"";var i=e[Math.min(t,e.length-1)];return i?r?i.open:i.close:""},wi={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(e,t){return 1===t.length&&Ye(t[0],"none")?[]:tt(t).map((function(t){for(var r={color:255,offsetX:st,offsetY:st,blur:st,spread:st,inset:!1},i=0,n=0;n<t.length;n++){var a=t[n];Ye(a,"inset")?r.inset=!0:it(a)?(0===i?r.offsetX=a:1===i?r.offsetY=a:2===i?r.blur=a:r.spread=a,i++):r.color=mt(e,a)}return r}))}},bi={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(e,t){var r=[];return t.filter($e).forEach((function(e){switch(e.value){case"stroke":r.push(1);break;case"fill":r.push(0);break;case"markers":r.push(2)}})),[0,1,2].forEach((function(e){-1===r.indexOf(e)&&r.push(e)})),r}},xi={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},Bi={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(e,t){return Ze(t)?t.number:0}},Ci=function(){function e(e,t){var r,i;this.animationDuration=Ii(e,yi,t.animationDuration),this.backgroundClip=Ii(e,Tt,t.backgroundClip),this.backgroundColor=Ii(e,Ft,t.backgroundColor),this.backgroundImage=Ii(e,Zt,t.backgroundImage),this.backgroundOrigin=Ii(e,Wt,t.backgroundOrigin),this.backgroundPosition=Ii(e,$t,t.backgroundPosition),this.backgroundRepeat=Ii(e,Xt,t.backgroundRepeat),this.backgroundSize=Ii(e,er,t.backgroundSize),this.borderTopColor=Ii(e,ir,t.borderTopColor),this.borderRightColor=Ii(e,nr,t.borderRightColor),this.borderBottomColor=Ii(e,ar,t.borderBottomColor),this.borderLeftColor=Ii(e,sr,t.borderLeftColor),this.borderTopLeftRadius=Ii(e,lr,t.borderTopLeftRadius),this.borderTopRightRadius=Ii(e,hr,t.borderTopRightRadius),this.borderBottomRightRadius=Ii(e,Ar,t.borderBottomRightRadius),this.borderBottomLeftRadius=Ii(e,ur,t.borderBottomLeftRadius),this.borderTopStyle=Ii(e,dr,t.borderTopStyle),this.borderRightStyle=Ii(e,pr,t.borderRightStyle),this.borderBottomStyle=Ii(e,fr,t.borderBottomStyle),this.borderLeftStyle=Ii(e,gr,t.borderLeftStyle),this.borderTopWidth=Ii(e,yr,t.borderTopWidth),this.borderRightWidth=Ii(e,_r,t.borderRightWidth),this.borderBottomWidth=Ii(e,vr,t.borderBottomWidth),this.borderLeftWidth=Ii(e,wr,t.borderLeftWidth),this.boxShadow=Ii(e,wi,t.boxShadow),this.color=Ii(e,br,t.color),this.direction=Ii(e,xr,t.direction),this.display=Ii(e,Br,t.display),this.float=Ii(e,Sr,t.cssFloat),this.fontFamily=Ii(e,hi,t.fontFamily),this.fontSize=Ii(e,Ai,t.fontSize),this.fontStyle=Ii(e,di,t.fontStyle),this.fontVariant=Ii(e,ci,t.fontVariant),this.fontWeight=Ii(e,ui,t.fontWeight),this.letterSpacing=Ii(e,Er,t.letterSpacing),this.lineBreak=Ii(e,Tr,t.lineBreak),this.lineHeight=Ii(e,Fr,t.lineHeight),this.listStyleImage=Ii(e,Lr,t.listStyleImage),this.listStylePosition=Ii(e,Mr,t.listStylePosition),this.listStyleType=Ii(e,kr,t.listStyleType),this.marginTop=Ii(e,Rr,t.marginTop),this.marginRight=Ii(e,Dr,t.marginRight),this.marginBottom=Ii(e,Nr,t.marginBottom),this.marginLeft=Ii(e,Or,t.marginLeft),this.opacity=Ii(e,si,t.opacity);var n=Ii(e,Qr,t.overflow);this.overflowX=n[0],this.overflowY=n[n.length>1?1:0],this.overflowWrap=Ii(e,zr,t.overflowWrap),this.paddingTop=Ii(e,jr,t.paddingTop),this.paddingRight=Ii(e,Vr,t.paddingRight),this.paddingBottom=Ii(e,Gr,t.paddingBottom),this.paddingLeft=Ii(e,Kr,t.paddingLeft),this.paintOrder=Ii(e,bi,t.paintOrder),this.position=Ii(e,Zr,t.position),this.textAlign=Ii(e,qr,t.textAlign),this.textDecorationColor=Ii(e,oi,null!==(r=t.textDecorationColor)&&void 0!==r?r:t.color),this.textDecorationLine=Ii(e,li,null!==(i=t.textDecorationLine)&&void 0!==i?i:t.textDecoration),this.textShadow=Ii(e,Wr,t.textShadow),this.textTransform=Ii(e,$r,t.textTransform),this.transform=Ii(e,Xr,t.transform),this.transformOrigin=Ii(e,ti,t.transformOrigin),this.visibility=Ii(e,ri,t.visibility),this.webkitTextStrokeColor=Ii(e,xi,t.webkitTextStrokeColor),this.webkitTextStrokeWidth=Ii(e,Bi,t.webkitTextStrokeWidth),this.wordBreak=Ii(e,ii,t.wordBreak),this.zIndex=Ii(e,ni,t.zIndex)}return e.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},e.prototype.isTransparent=function(){return yt(this.backgroundColor)},e.prototype.isTransformed=function(){return null!==this.transform},e.prototype.isPositioned=function(){return 0!==this.position},e.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},e.prototype.isFloating=function(){return 0!==this.float},e.prototype.isInlineLevel=function(){return pi(this.display,4)||pi(this.display,33554432)||pi(this.display,268435456)||pi(this.display,536870912)||pi(this.display,67108864)||pi(this.display,134217728)},e}(),Si=function(e,t){this.content=Ii(e,fi,t.content),this.quotes=Ii(e,_i,t.quotes)},Ei=function(e,t){this.counterIncrement=Ii(e,gi,t.counterIncrement),this.counterReset=Ii(e,mi,t.counterReset)},Ii=function(e,t,r){var i=new Ke,n=null!==r&&typeof r<"u"?r.toString():t.initialValue;i.write(n);var a=new qe(i.read());switch(t.type){case 2:var s=a.parseComponentValue();return t.parse(e,$e(s)?s.value:t.initialValue);case 0:return t.parse(e,a.parseComponentValue());case 1:return t.parse(e,a.parseComponentValues());case 4:return a.parseComponentValue();case 3:switch(t.format){case"angle":return dt(e,a.parseComponentValue());case"color":return mt(e,a.parseComponentValue());case"image":return Kt(e,a.parseComponentValue());case"length":var o=a.parseComponentValue();return it(o)?o:st;case"length-percentage":var l=a.parseComponentValue();return nt(l)?l:st;case"time":return ai.parse(e,a.parseComponentValue())}}},Ti=function(e,t){var r=function(e){switch(e.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(e);return 1===r||t===r},Fi=function(e,t){this.context=e,this.textNodes=[],this.elements=[],this.flags=0,Ti(t,3),this.styles=new Ci(e,window.getComputedStyle(t,null)),Un(t)&&(this.styles.animationDuration.some((function(e){return e>0}))&&(t.style.animationDuration="0s"),null!==this.styles.transform&&(t.style.transform="none")),this.bounds=o(this.context,t),Ti(t,4)&&(this.flags|=16)},Pi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Li=typeof Uint8Array>"u"?[]:new Uint8Array(256),Mi=0;Mi<64;Mi++)Li[Pi.charCodeAt(Mi)]=Mi;for(var ki=function(e,t,r){return e.slice?e.slice(t,r):new Uint16Array(Array.prototype.slice.call(e,t,r))},Ui=function(){function e(e,t,r,i,n,a){this.initialValue=e,this.errorValue=t,this.highStart=r,this.highValueIndex=i,this.index=n,this.data=a}return e.prototype.get=function(e){var t;if(e>=0){if(e<55296||e>56319&&e<=65535)return t=((t=this.index[e>>5])<<2)+(31&e),this.data[t];if(e<=65535)return t=((t=this.index[2048+(e-55296>>5)])<<2)+(31&e),this.data[t];if(e<this.highStart)return t=2080+(e>>11),t=this.index[t],t+=e>>5&63,t=((t=this.index[t])<<2)+(31&e),this.data[t];if(e<=1114111)return this.data[this.highValueIndex]}return this.errorValue},e}(),Ri="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Di=typeof Uint8Array>"u"?[]:new Uint8Array(256),Ni=0;Ni<64;Ni++)Di[Ri.charCodeAt(Ni)]=Ni;var Oi,Qi=8,zi=9,Hi=11,ji=12,Vi=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(String.fromCodePoint)return String.fromCodePoint.apply(String,e);var r=e.length;if(!r)return"";for(var i=[],n=-1,a="";++n<r;){var s=e[n];s<=65535?i.push(s):(s-=65536,i.push(55296+(s>>10),s%1024+56320)),(n+1===r||i.length>16384)&&(a+=String.fromCharCode.apply(String,i),i.length=0)}return a},Gi=function(e){var t=function(e){var t,r,i,n,a,s=.75*e.length,o=e.length,l=0;"="===e[e.length-1]&&(s--,"="===e[e.length-2]&&s--);var h=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&typeof Uint8Array.prototype.slice<"u"?new ArrayBuffer(s):new Array(s),A=Array.isArray(h)?h:new Uint8Array(h);for(t=0;t<o;t+=4)r=Li[e.charCodeAt(t)],i=Li[e.charCodeAt(t+1)],n=Li[e.charCodeAt(t+2)],a=Li[e.charCodeAt(t+3)],A[l++]=r<<2|i>>4,A[l++]=(15&i)<<4|n>>2,A[l++]=(3&n)<<6|63&a;return h}(e),r=Array.isArray(t)?function(e){for(var t=e.length,r=[],i=0;i<t;i+=4)r.push(e[i+3]<<24|e[i+2]<<16|e[i+1]<<8|e[i]);return r}(t):new Uint32Array(t),i=Array.isArray(t)?function(e){for(var t=e.length,r=[],i=0;i<t;i+=2)r.push(e[i+1]<<8|e[i]);return r}(t):new Uint16Array(t),n=ki(i,12,r[4]/2),a=2===r[5]?ki(i,(24+r[4])/2):function(e,t,r){return e.slice?e.slice(t,r):new Uint32Array(Array.prototype.slice.call(e,t,r))}(r,Math.ceil((24+r[4])/4));return new Ui(r[0],r[1],r[2],r[3],n,a)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),Ki="×",qi=function(e){return Gi.get(e)},Zi=function(e,t,r){var i=r-2,n=t[i],a=t[r-1],s=t[r];if(2===a&&3===s)return Ki;if(2===a||3===a||4===a||2===s||3===s||4===s)return"÷";if(a===Qi&&-1!==[Qi,zi,Hi,ji].indexOf(s)||(a===Hi||a===zi)&&(s===zi||10===s)||(a===ji||10===a)&&10===s||13===s||5===s||7===s||1===a)return Ki;if(13===a&&14===s){for(;5===n;)n=t[--i];if(14===n)return Ki}if(15===a&&15===s){for(var o=0;15===n;)o++,n=t[--i];if(o%2==0)return Ki}return"÷"},Wi=function(e){var t=function(e){for(var t=[],r=0,i=e.length;r<i;){var n=e.charCodeAt(r++);if(n>=55296&&n<=56319&&r<i){var a=e.charCodeAt(r++);56320==(64512&a)?t.push(((1023&n)<<10)+(1023&a)+65536):(t.push(n),r--)}else t.push(n)}return t}(e),r=t.length,i=0,n=0,a=t.map(qi);return{next:function(){if(i>=r)return{done:!0,value:null};for(var e=Ki;i<r&&(e=Zi(0,a,++i))===Ki;);if(e!==Ki||i===r){var s=Vi.apply(null,t.slice(n,i));return n=i,{value:s,done:!1}}return{done:!0,value:null}}}},$i=function(e){return 0===e[0]&&255===e[1]&&0===e[2]&&255===e[3]},Xi=function(e,t,r,i,n){var a="http://www.w3.org/2000/svg",s=document.createElementNS(a,"svg"),o=document.createElementNS(a,"foreignObject");return s.setAttributeNS(null,"width",e.toString()),s.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"width","100%"),o.setAttributeNS(null,"height","100%"),o.setAttributeNS(null,"x",r.toString()),o.setAttributeNS(null,"y",i.toString()),o.setAttributeNS(null,"externalResourcesRequired","true"),s.appendChild(o),o.appendChild(n),s},Yi=function(e){return new Promise((function(t,r){var i=new Image;i.onload=function(){return t(i)},i.onerror=r,i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Ji={get SUPPORT_RANGE_BOUNDS(){var e=function(e){if(e.createRange){var t=e.createRange();if(t.getBoundingClientRect){var r=e.createElement("boundtest");r.style.height="123px",r.style.display="block",e.body.appendChild(r),t.selectNode(r);var i=t.getBoundingClientRect(),n=Math.round(i.height);if(e.body.removeChild(r),123===n)return!0}}return!1}(document);return Object.defineProperty(Ji,"SUPPORT_RANGE_BOUNDS",{value:e}),e},get SUPPORT_WORD_BREAKING(){var e=Ji.SUPPORT_RANGE_BOUNDS&&function(e){var t=e.createElement("boundtest");t.style.width="50px",t.style.display="block",t.style.fontSize="12px",t.style.letterSpacing="0px",t.style.wordSpacing="0px",e.body.appendChild(t);var r=e.createRange();t.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var i=t.firstChild,n=l(i.data).map((function(e){return h(e)})),a=0,s={},o=n.every((function(e,t){r.setStart(i,a),r.setEnd(i,a+e.length);var n=r.getBoundingClientRect();a+=e.length;var o=n.x>s.x||n.y>s.y;return s=n,0===t||o}));return e.body.removeChild(t),o}(document);return Object.defineProperty(Ji,"SUPPORT_WORD_BREAKING",{value:e}),e},get SUPPORT_SVG_DRAWING(){var e=function(e){var t=new Image,r=e.createElement("canvas"),i=r.getContext("2d");if(!i)return!1;t.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{i.drawImage(t,0,0),r.toDataURL()}catch{return!1}return!0}(document);return Object.defineProperty(Ji,"SUPPORT_SVG_DRAWING",{value:e}),e},get SUPPORT_FOREIGNOBJECT_DRAWING(){var e="function"==typeof Array.from&&"function"==typeof window.fetch?function(e){var t=e.createElement("canvas"),r=100;t.width=r,t.height=r;var i=t.getContext("2d");if(!i)return Promise.reject(!1);i.fillStyle="rgb(0, 255, 0)",i.fillRect(0,0,r,r);var n=new Image,a=t.toDataURL();n.src=a;var s=Xi(r,r,0,0,n);return i.fillStyle="red",i.fillRect(0,0,r,r),Yi(s).then((function(t){i.drawImage(t,0,0);var n=i.getImageData(0,0,r,r).data;i.fillStyle="red",i.fillRect(0,0,r,r);var s=e.createElement("div");return s.style.backgroundImage="url("+a+")",s.style.height=r+"px",$i(n)?Yi(Xi(r,r,0,0,s)):Promise.reject(!1)})).then((function(e){return i.drawImage(e,0,0),$i(i.getImageData(0,0,r,r).data)})).catch((function(){return!1}))}(document):Promise.resolve(!1);return Object.defineProperty(Ji,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:e}),e},get SUPPORT_CORS_IMAGES(){var e=typeof(new Image).crossOrigin<"u";return Object.defineProperty(Ji,"SUPPORT_CORS_IMAGES",{value:e}),e},get SUPPORT_RESPONSE_TYPE(){var e="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Ji,"SUPPORT_RESPONSE_TYPE",{value:e}),e},get SUPPORT_CORS_XHR(){var e="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Ji,"SUPPORT_CORS_XHR",{value:e}),e},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var e=!!(typeof Intl<"u"&&Intl.Segmenter);return Object.defineProperty(Ji,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:e}),e}},en=function(e,t){this.text=e,this.bounds=t},tn=function(e,t){var r=t.ownerDocument;if(r){var i=r.createElement("html2canvaswrapper");i.appendChild(t.cloneNode(!0));var n=t.parentNode;if(n){n.replaceChild(i,t);var a=o(e,i);return i.firstChild&&n.replaceChild(i.firstChild,i),a}}return s.EMPTY},rn=function(e,t,r){var i=e.ownerDocument;if(!i)throw new Error("Node has no owner document");var n=i.createRange();return n.setStart(e,t),n.setEnd(e,t+r),n},nn=function(e){if(Ji.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(t.segment(e)).map((function(e){return e.segment}))}return function(e){for(var t,r=Wi(e),i=[];!(t=r.next()).done;)t.value&&i.push(t.value.slice());return i}(e)},an=function(e,t){return 0!==t.letterSpacing?nn(e):function(e,t){if(Ji.SUPPORT_NATIVE_TEXT_SEGMENTATION){var r=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(r.segment(e)).map((function(e){return e.segment}))}return on(e,t)}(e,t)},sn=[32,160,4961,65792,65793,4153,4241],on=function(e,t){for(var r,i=function(e,t){var r=l(e),i=Ae(r,t),n=i[0],a=i[1],s=i[2],o=r.length,h=0,A=0;return{next:function(){if(A>=o)return{done:!0,value:null};for(var e=X;A<o&&(e=he(r,a,n,++A,s))===X;);if(e!==X||A===o){var t=new ue(r,e,h,A);return h=A,{value:t,done:!1}}return{done:!0,value:null}}}}(e,{lineBreak:t.lineBreak,wordBreak:"break-word"===t.overflowWrap?"break-word":t.wordBreak}),n=[],a=function(){if(r.value){var e=r.value.slice(),t=l(e),i="";t.forEach((function(e){-1===sn.indexOf(e)?i+=h(e):(i.length&&n.push(i),n.push(h(e)),i="")})),i.length&&n.push(i)}};!(r=i.next()).done;)a();return n},ln=function(e,t,r){this.text=hn(t.data,r.textTransform),this.textBounds=function(e,t,r,i){var n=an(t,r),a=[],o=0;return n.forEach((function(t){if(r.textDecorationLine.length||t.trim().length>0)if(Ji.SUPPORT_RANGE_BOUNDS){var n=rn(i,o,t.length).getClientRects();if(n.length>1){var l=nn(t),h=0;l.forEach((function(t){a.push(new en(t,s.fromDOMRectList(e,rn(i,h+o,t.length).getClientRects()))),h+=t.length}))}else a.push(new en(t,s.fromDOMRectList(e,n)))}else{var A=i.splitText(t.length);a.push(new en(t,tn(e,i))),i=A}else Ji.SUPPORT_RANGE_BOUNDS||(i=i.splitText(t.length));o+=t.length})),a}(e,this.text,r,t)},hn=function(e,t){switch(t){case 1:return e.toLowerCase();case 3:return e.replace(An,un);case 2:return e.toUpperCase();default:return e}},An=/(^|\s|:|-|\(|\))([a-z])/g,un=function(e,t,r){return e.length>0?t+r.toUpperCase():e},cn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.src=r.currentSrc||r.src,i.intrinsicWidth=r.naturalWidth,i.intrinsicHeight=r.naturalHeight,i.context.cache.addImage(i.src),i}return t(r,e),r}(Fi),dn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.canvas=r,i.intrinsicWidth=r.width,i.intrinsicHeight=r.height,i}return t(r,e),r}(Fi),pn=function(e){function r(t,r){var i=e.call(this,t,r)||this,n=new XMLSerializer,a=o(t,r);return r.setAttribute("width",a.width+"px"),r.setAttribute("height",a.height+"px"),i.svg="data:image/svg+xml,"+encodeURIComponent(n.serializeToString(r)),i.intrinsicWidth=r.width.baseVal.value,i.intrinsicHeight=r.height.baseVal.value,i.context.cache.addImage(i.svg),i}return t(r,e),r}(Fi),fn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.value=r.value,i}return t(r,e),r}(Fi),gn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.start=r.start,i.reversed="boolean"==typeof r.reversed&&!0===r.reversed,i}return t(r,e),r}(Fi),mn=[{type:15,flags:0,unit:"px",number:3}],yn=[{type:16,flags:0,number:50}],_n="checkbox",vn="radio",wn="password",bn=707406591,xn=function(e){function r(t,r){var i=e.call(this,t,r)||this;switch(i.type=r.type.toLowerCase(),i.checked=r.checked,i.value=function(e){var t=e.type===wn?new Array(e.value.length+1).join("•"):e.value;return 0===t.length?e.placeholder||"":t}(r),(i.type===_n||i.type===vn)&&(i.styles.backgroundColor=3739148031,i.styles.borderTopColor=i.styles.borderRightColor=i.styles.borderBottomColor=i.styles.borderLeftColor=2779096575,i.styles.borderTopWidth=i.styles.borderRightWidth=i.styles.borderBottomWidth=i.styles.borderLeftWidth=1,i.styles.borderTopStyle=i.styles.borderRightStyle=i.styles.borderBottomStyle=i.styles.borderLeftStyle=1,i.styles.backgroundClip=[0],i.styles.backgroundOrigin=[0],i.bounds=function(e){return e.width>e.height?new s(e.left+(e.width-e.height)/2,e.top,e.height,e.height):e.width<e.height?new s(e.left,e.top+(e.height-e.width)/2,e.width,e.width):e}(i.bounds)),i.type){case _n:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=mn;break;case vn:i.styles.borderTopRightRadius=i.styles.borderTopLeftRadius=i.styles.borderBottomRightRadius=i.styles.borderBottomLeftRadius=yn}return i}return t(r,e),r}(Fi),Bn=function(e){function r(t,r){var i=e.call(this,t,r)||this,n=r.options[r.selectedIndex||0];return i.value=n&&n.text||"",i}return t(r,e),r}(Fi),Cn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.value=r.value,i}return t(r,e),r}(Fi),Sn=function(e){function r(t,r){var i=e.call(this,t,r)||this;i.src=r.src,i.width=parseInt(r.width,10)||0,i.height=parseInt(r.height,10)||0,i.backgroundColor=i.styles.backgroundColor;try{if(r.contentWindow&&r.contentWindow.document&&r.contentWindow.document.documentElement){i.tree=Fn(t,r.contentWindow.document.documentElement);var n=r.contentWindow.document.documentElement?Et(t,getComputedStyle(r.contentWindow.document.documentElement).backgroundColor):It.TRANSPARENT,a=r.contentWindow.document.body?Et(t,getComputedStyle(r.contentWindow.document.body).backgroundColor):It.TRANSPARENT;i.backgroundColor=yt(n)?yt(a)?i.styles.backgroundColor:a:n}}catch{}return i}return t(r,e),r}(Fi),En=["OL","UL","MENU"],In=function(e,t,r,i){for(var n=t.firstChild,a=void 0;n;n=a)if(a=n.nextSibling,Mn(n)&&n.data.trim().length>0)r.textNodes.push(new ln(e,n,r.styles));else if(kn(n))if(Wn(n)&&n.assignedNodes)n.assignedNodes().forEach((function(t){return In(e,t,r,i)}));else{var s=Tn(e,n);s.styles.isVisible()&&(Pn(n,s,i)?s.flags|=4:Ln(s.styles)&&(s.flags|=2),-1!==En.indexOf(n.tagName)&&(s.flags|=8),r.elements.push(s),n.slot,n.shadowRoot?In(e,n.shadowRoot,s,i):!qn(n)&&!Qn(n)&&!Zn(n)&&In(e,n,s,i))}},Tn=function(e,t){return Vn(t)?new cn(e,t):Hn(t)?new dn(e,t):Qn(t)?new pn(e,t):Dn(t)?new fn(e,t):Nn(t)?new gn(e,t):On(t)?new xn(e,t):Zn(t)?new Bn(e,t):qn(t)?new Cn(e,t):Gn(t)?new Sn(e,t):new Fi(e,t)},Fn=function(e,t){var r=Tn(e,t);return r.flags|=4,In(e,t,r,r),r},Pn=function(e,t,r){return t.styles.isPositionedWithZIndex()||t.styles.opacity<1||t.styles.isTransformed()||zn(e)&&r.styles.isTransparent()},Ln=function(e){return e.isPositioned()||e.isFloating()},Mn=function(e){return e.nodeType===Node.TEXT_NODE},kn=function(e){return e.nodeType===Node.ELEMENT_NODE},Un=function(e){return kn(e)&&typeof e.style<"u"&&!Rn(e)},Rn=function(e){return"object"==typeof e.className},Dn=function(e){return"LI"===e.tagName},Nn=function(e){return"OL"===e.tagName},On=function(e){return"INPUT"===e.tagName},Qn=function(e){return"svg"===e.tagName},zn=function(e){return"BODY"===e.tagName},Hn=function(e){return"CANVAS"===e.tagName},jn=function(e){return"VIDEO"===e.tagName},Vn=function(e){return"IMG"===e.tagName},Gn=function(e){return"IFRAME"===e.tagName},Kn=function(e){return"STYLE"===e.tagName},qn=function(e){return"TEXTAREA"===e.tagName},Zn=function(e){return"SELECT"===e.tagName},Wn=function(e){return"SLOT"===e.tagName},$n=function(e){return e.tagName.indexOf("-")>0},Xn=function(){function e(){this.counters={}}return e.prototype.getCounterValue=function(e){var t=this.counters[e];return t&&t.length?t[t.length-1]:1},e.prototype.getCounterValues=function(e){return this.counters[e]||[]},e.prototype.pop=function(e){var t=this;e.forEach((function(e){return t.counters[e].pop()}))},e.prototype.parse=function(e){var t=this,r=e.counterIncrement,i=e.counterReset,n=!0;null!==r&&r.forEach((function(e){var r=t.counters[e.counter];r&&0!==e.increment&&(n=!1,r.length||r.push(1),r[Math.max(0,r.length-1)]+=e.increment)}));var a=[];return n&&i.forEach((function(e){var r=t.counters[e.counter];a.push(e.counter),r||(r=t.counters[e.counter]=[]),r.push(e.reset)})),a},e}(),Yn={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jn={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},ea={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},ta={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},ra=function(e,t,r,i,n,a){return e<t||e>r?ua(e,n,a.length>0):i.integers.reduce((function(t,r,n){for(;e>=r;)e-=r,t+=i.values[n];return t}),"")+a},ia=function(e,t,r,i){var n="";do{r||e--,n=i(e)+n,e/=t}while(e*t>=t);return n},na=function(e,t,r,i,n){var a=r-t+1;return(e<0?"-":"")+(ia(Math.abs(e),a,i,(function(e){return h(Math.floor(e%a)+t)}))+n)},aa=function(e,t,r){void 0===r&&(r=". ");var i=t.length;return ia(Math.abs(e),i,!1,(function(e){return t[Math.floor(e%i)]}))+r},sa=function(e,t,r,i,n,a){if(e<-9999||e>9999)return ua(e,4,n.length>0);var s=Math.abs(e),o=n;if(0===s)return t[0]+o;for(var l=0;s>0&&l<=4;l++){var h=s%10;0===h&&pi(a,1)&&""!==o?o=t[h]+o:h>1||1===h&&0===l||1===h&&1===l&&pi(a,2)||1===h&&1===l&&pi(a,4)&&e>100||1===h&&l>1&&pi(a,8)?o=t[h]+(l>0?r[l-1]:"")+o:1===h&&l>0&&(o=r[l-1]+o),s=Math.floor(s/10)}return(e<0?i:"")+o},oa="十百千萬",la="拾佰仟萬",ha="マイナス",Aa="마이너스",ua=function(e,t,r){var i=r?". ":"",n=r?"、":"",a=r?", ":"",s=r?" ":"";switch(t){case 0:return"•"+s;case 1:return"◦"+s;case 2:return"◾"+s;case 5:var o=na(e,48,57,!0,i);return o.length<4?"0"+o:o;case 4:return aa(e,"〇一二三四五六七八九",n);case 6:return ra(e,1,3999,Yn,3,i).toLowerCase();case 7:return ra(e,1,3999,Yn,3,i);case 8:return na(e,945,969,!1,i);case 9:return na(e,97,122,!1,i);case 10:return na(e,65,90,!1,i);case 11:return na(e,1632,1641,!0,i);case 12:case 49:return ra(e,1,9999,Jn,3,i);case 35:return ra(e,1,9999,Jn,3,i).toLowerCase();case 13:return na(e,2534,2543,!0,i);case 14:case 30:return na(e,6112,6121,!0,i);case 15:return aa(e,"子丑寅卯辰巳午未申酉戌亥",n);case 16:return aa(e,"甲乙丙丁戊己庚辛壬癸",n);case 17:case 48:return sa(e,"零一二三四五六七八九",oa,"負",n,14);case 47:return sa(e,"零壹貳參肆伍陸柒捌玖",la,"負",n,15);case 42:return sa(e,"零一二三四五六七八九",oa,"负",n,14);case 41:return sa(e,"零壹贰叁肆伍陆柒捌玖",la,"负",n,15);case 26:return sa(e,"〇一二三四五六七八九","十百千万",ha,n,0);case 25:return sa(e,"零壱弐参四伍六七八九","拾百千万",ha,n,7);case 31:return sa(e,"영일이삼사오육칠팔구","십백천만",Aa,a,7);case 33:return sa(e,"零一二三四五六七八九","十百千萬",Aa,a,0);case 32:return sa(e,"零壹貳參四五六七八九","拾百千",Aa,a,7);case 18:return na(e,2406,2415,!0,i);case 20:return ra(e,1,19999,ta,3,i);case 21:return na(e,2790,2799,!0,i);case 22:return na(e,2662,2671,!0,i);case 22:return ra(e,1,10999,ea,3,i);case 23:return aa(e,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return aa(e,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return na(e,3302,3311,!0,i);case 28:return aa(e,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",n);case 29:return aa(e,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",n);case 34:return na(e,3792,3801,!0,i);case 37:return na(e,6160,6169,!0,i);case 38:return na(e,4160,4169,!0,i);case 39:return na(e,2918,2927,!0,i);case 40:return na(e,1776,1785,!0,i);case 43:return na(e,3046,3055,!0,i);case 44:return na(e,3174,3183,!0,i);case 45:return na(e,3664,3673,!0,i);case 46:return na(e,3872,3881,!0,i);default:return na(e,48,57,!0,i)}},ca="data-html2canvas-ignore",da=function(){function e(e,t,r){if(this.context=e,this.options=r,this.scrolledElements=[],this.referenceElement=t,this.counters=new Xn,this.quoteDepth=0,!t.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(t.ownerDocument.documentElement,!1)}return e.prototype.toIFrame=function(e,t){var r=this,a=fa(e,t);if(!a.contentWindow)return Promise.reject("Unable to find iframe window");var s=e.defaultView.pageXOffset,o=e.defaultView.pageYOffset,l=a.contentWindow,h=l.document,A=ya(a).then((function(){return i(r,void 0,void 0,(function(){var e,r;return n(this,(function(i){switch(i.label){case 0:return this.scrolledElements.forEach(xa),l&&(l.scrollTo(t.left,t.top),/(iPad|iPhone|iPod)/g.test(navigator.userAgent)&&(l.scrollY!==t.top||l.scrollX!==t.left)&&(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(l.scrollX-t.left,l.scrollY-t.top,0,0))),e=this.options.onclone,typeof(r=this.clonedReferenceElement)>"u"?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:h.fonts&&h.fonts.ready?[4,h.fonts.ready]:[3,2];case 1:i.sent(),i.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,ma(h)]:[3,4];case 3:i.sent(),i.label=4;case 4:return"function"==typeof e?[2,Promise.resolve().then((function(){return e(h,r)})).then((function(){return a}))]:[2,a]}}))}))}));return h.open(),h.write(wa(document.doctype)+"<html></html>"),ba(this.referenceElement.ownerDocument,s,o),h.replaceChild(h.adoptNode(this.documentElement),h.documentElement),h.close(),A},e.prototype.createElementClone=function(e){if(Ti(e,2),Hn(e))return this.createCanvasClone(e);if(jn(e))return this.createVideoClone(e);if(Kn(e))return this.createStyleClone(e);var t=e.cloneNode(!1);return Vn(t)&&(Vn(e)&&e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),"lazy"===t.loading&&(t.loading="eager")),$n(t)?this.createCustomElementClone(t):t},e.prototype.createCustomElementClone=function(e){var t=document.createElement("html2canvascustomelement");return va(e.style,t),t},e.prototype.createStyleClone=function(e){try{var t=e.sheet;if(t&&t.cssRules){var r=[].slice.call(t.cssRules,0).reduce((function(e,t){return t&&"string"==typeof t.cssText?e+t.cssText:e}),""),i=e.cloneNode(!1);return i.textContent=r,i}}catch(e){if(this.context.logger.error("Unable to access cssRules property",e),"SecurityError"!==e.name)throw e}return e.cloneNode(!1)},e.prototype.createCanvasClone=function(e){var t;if(this.options.inlineImages&&e.ownerDocument){var r=e.ownerDocument.createElement("img");try{return r.src=e.toDataURL(),r}catch{this.context.logger.info("Unable to inline canvas contents, canvas is tainted",e)}}var i=e.cloneNode(!1);try{i.width=e.width,i.height=e.height;var n=e.getContext("2d"),a=i.getContext("2d");if(a)if(!this.options.allowTaint&&n)a.putImageData(n.getImageData(0,0,e.width,e.height),0,0);else{var s=null!==(t=e.getContext("webgl2"))&&void 0!==t?t:e.getContext("webgl");if(s){var o=s.getContextAttributes();!1===o?.preserveDrawingBuffer&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",e)}a.drawImage(e,0,0)}return i}catch{this.context.logger.info("Unable to clone canvas as it is tainted",e)}return i},e.prototype.createVideoClone=function(e){var t=e.ownerDocument.createElement("canvas");t.width=e.offsetWidth,t.height=e.offsetHeight;var r=t.getContext("2d");try{return r&&(r.drawImage(e,0,0,t.width,t.height),this.options.allowTaint||r.getImageData(0,0,t.width,t.height)),t}catch{this.context.logger.info("Unable to clone video as it is tainted",e)}var i=e.ownerDocument.createElement("canvas");return i.width=e.offsetWidth,i.height=e.offsetHeight,i},e.prototype.appendChildNode=function(e,t,r){(!kn(t)||!function(e){return"SCRIPT"===e.tagName}(t)&&!t.hasAttribute(ca)&&("function"!=typeof this.options.ignoreElements||!this.options.ignoreElements(t)))&&(!this.options.copyStyles||!kn(t)||!Kn(t))&&e.appendChild(this.cloneNode(t,r))},e.prototype.cloneChildNodes=function(e,t,r){for(var i=this,n=e.shadowRoot?e.shadowRoot.firstChild:e.firstChild;n;n=n.nextSibling)if(kn(n)&&Wn(n)&&"function"==typeof n.assignedNodes){var a=n.assignedNodes();a.length&&a.forEach((function(e){return i.appendChildNode(t,e,r)}))}else this.appendChildNode(t,n,r)},e.prototype.cloneNode=function(e,t){if(Mn(e))return document.createTextNode(e.data);if(!e.ownerDocument)return e.cloneNode(!1);var r=e.ownerDocument.defaultView;if(r&&kn(e)&&(Un(e)||Rn(e))){var i=this.createElementClone(e);i.style.transitionProperty="none";var n=r.getComputedStyle(e),a=r.getComputedStyle(e,":before"),s=r.getComputedStyle(e,":after");this.referenceElement===e&&Un(i)&&(this.clonedReferenceElement=i),zn(i)&&Ea(i);var o=this.counters.parse(new Ei(this.context,n)),l=this.resolvePseudoContent(e,i,a,Oi.BEFORE);$n(e)&&(t=!0),jn(e)||this.cloneChildNodes(e,i,t),l&&i.insertBefore(l,i.firstChild);var h=this.resolvePseudoContent(e,i,s,Oi.AFTER);return h&&i.appendChild(h),this.counters.pop(o),(n&&(this.options.copyStyles||Rn(e))&&!Gn(e)||t)&&va(n,i),(0!==e.scrollTop||0!==e.scrollLeft)&&this.scrolledElements.push([i,e.scrollLeft,e.scrollTop]),(qn(e)||Zn(e))&&(qn(i)||Zn(i))&&(i.value=e.value),i}return e.cloneNode(!1)},e.prototype.resolvePseudoContent=function(e,t,r,i){var n=this;if(r){var a=r.content,s=t.ownerDocument;if(s&&a&&"none"!==a&&"-moz-alt-content"!==a&&"none"!==r.display){this.counters.parse(new Ei(this.context,r));var o=new Si(this.context,r),l=s.createElement("html2canvaspseudoelement");va(r,l),o.content.forEach((function(t){if(0===t.type)l.appendChild(s.createTextNode(t.value));else if(22===t.type){var r=s.createElement("img");r.src=t.value,r.style.opacity="1",l.appendChild(r)}else if(18===t.type){if("attr"===t.name){var i=t.values.filter($e);i.length&&l.appendChild(s.createTextNode(e.getAttribute(i[0].value)||""))}else if("counter"===t.name){var a=t.values.filter(et),h=a[0],A=a[1];if(h&&$e(h)){var u=n.counters.getCounterValue(h.value),c=A&&$e(A)?kr.parse(n.context,A.value):3;l.appendChild(s.createTextNode(ua(u,c,!1)))}}else if("counters"===t.name){var d=t.values.filter(et),p=(h=d[0],d[1]);if(A=d[2],h&&$e(h)){var f=n.counters.getCounterValues(h.value),g=A&&$e(A)?kr.parse(n.context,A.value):3,m=p&&0===p.type?p.value:"",y=f.map((function(e){return ua(e,g,!1)})).join(m);l.appendChild(s.createTextNode(y))}}}else if(20===t.type)switch(t.value){case"open-quote":l.appendChild(s.createTextNode(vi(o.quotes,n.quoteDepth++,!0)));break;case"close-quote":l.appendChild(s.createTextNode(vi(o.quotes,--n.quoteDepth,!1)));break;default:l.appendChild(s.createTextNode(t.value))}})),l.className=Ba+" "+Ca;var h=i===Oi.BEFORE?" "+Ba:" "+Ca;return Rn(t)?t.className.baseValue+=h:t.className+=h,l}}},e.destroy=function(e){return!!e.parentNode&&(e.parentNode.removeChild(e),!0)},e}();!function(e){e[e.BEFORE=0]="BEFORE",e[e.AFTER=1]="AFTER"}(Oi||(Oi={}));var pa,fa=function(e,t){var r=e.createElement("iframe");return r.className="html2canvas-container",r.style.visibility="hidden",r.style.position="fixed",r.style.left="-10000px",r.style.top="0px",r.style.border="0",r.width=t.width.toString(),r.height=t.height.toString(),r.scrolling="no",r.setAttribute(ca,"true"),e.body.appendChild(r),r},ga=function(e){return new Promise((function(t){e.complete?t():e.src?(e.onload=t,e.onerror=t):t()}))},ma=function(e){return Promise.all([].slice.call(e.images,0).map(ga))},ya=function(e){return new Promise((function(t,r){var i=e.contentWindow;if(!i)return r("No window assigned for iframe");var n=i.document;i.onload=e.onload=function(){i.onload=e.onload=null;var r=setInterval((function(){n.body.childNodes.length>0&&"complete"===n.readyState&&(clearInterval(r),t(e))}),50)}}))},_a=["all","d","content"],va=function(e,t){for(var r=e.length-1;r>=0;r--){var i=e.item(r);-1===_a.indexOf(i)&&t.style.setProperty(i,e.getPropertyValue(i))}return t},wa=function(e){var t="";return e&&(t+="<!DOCTYPE ",e.name&&(t+=e.name),e.internalSubset&&(t+=e.internalSubset),e.publicId&&(t+='"'+e.publicId+'"'),e.systemId&&(t+='"'+e.systemId+'"'),t+=">"),t},ba=function(e,t,r){e&&e.defaultView&&(t!==e.defaultView.pageXOffset||r!==e.defaultView.pageYOffset)&&e.defaultView.scrollTo(t,r)},xa=function(e){var t=e[0],r=e[1],i=e[2];t.scrollLeft=r,t.scrollTop=i},Ba="___html2canvas___pseudoelement_before",Ca="___html2canvas___pseudoelement_after",Sa='{\n    content: "" !important;\n    display: none !important;\n}',Ea=function(e){Ia(e,"."+Ba+":before"+Sa+"\n         ."+Ca+":after"+Sa)},Ia=function(e,t){var r=e.ownerDocument;if(r){var i=r.createElement("style");i.textContent=t,e.appendChild(i)}},Ta=function(){function e(){}return e.getOrigin=function(t){var r=e._link;return r?(r.href=t,r.href=r.href,r.protocol+r.hostname+r.port):"about:blank"},e.isSameOrigin=function(t){return e.getOrigin(t)===e._origin},e.setContext=function(t){e._link=t.document.createElement("a"),e._origin=e.getOrigin(t.location.href)},e._origin="about:blank",e}(),Fa=function(){function e(e,t){this.context=e,this._options=t,this._cache={}}return e.prototype.addImage=function(e){var t=Promise.resolve();return this.has(e)||(Da(e)||ka(e))&&(this._cache[e]=this.loadImage(e)).catch((function(){})),t},e.prototype.match=function(e){return this._cache[e]},e.prototype.loadImage=function(e){return i(this,void 0,void 0,(function(){var t,r,i,a,s=this;return n(this,(function(n){switch(n.label){case 0:return t=Ta.isSameOrigin(e),r=!Ua(e)&&!0===this._options.useCORS&&Ji.SUPPORT_CORS_IMAGES&&!t,i=!Ua(e)&&!t&&!Da(e)&&"string"==typeof this._options.proxy&&Ji.SUPPORT_CORS_XHR&&!r,t||!1!==this._options.allowTaint||Ua(e)||Da(e)||i||r?(a=e,i?[4,this.proxy(a)]:[3,2]):[2];case 1:a=n.sent(),n.label=2;case 2:return this.context.logger.debug("Added image "+e.substring(0,256)),[4,new Promise((function(e,t){var i=new Image;i.onload=function(){return e(i)},i.onerror=t,(Ra(a)||r)&&(i.crossOrigin="anonymous"),i.src=a,!0===i.complete&&setTimeout((function(){return e(i)}),500),s._options.imageTimeout>0&&setTimeout((function(){return t("Timed out ("+s._options.imageTimeout+"ms) loading image")}),s._options.imageTimeout)}))];case 3:return[2,n.sent()]}}))}))},e.prototype.has=function(e){return typeof this._cache[e]<"u"},e.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},e.prototype.proxy=function(e){var t=this,r=this._options.proxy;if(!r)throw new Error("No proxy defined");var i=e.substring(0,256);return new Promise((function(n,a){var s=Ji.SUPPORT_RESPONSE_TYPE?"blob":"text",o=new XMLHttpRequest;o.onload=function(){if(200===o.status)if("text"===s)n(o.response);else{var e=new FileReader;e.addEventListener("load",(function(){return n(e.result)}),!1),e.addEventListener("error",(function(e){return a(e)}),!1),e.readAsDataURL(o.response)}else a("Failed to proxy resource "+i+" with status code "+o.status)},o.onerror=a;var l=r.indexOf("?")>-1?"&":"?";if(o.open("GET",""+r+l+"url="+encodeURIComponent(e)+"&responseType="+s),"text"!==s&&o instanceof XMLHttpRequest&&(o.responseType=s),t._options.imageTimeout){var h=t._options.imageTimeout;o.timeout=h,o.ontimeout=function(){return a("Timed out ("+h+"ms) proxying "+i)}}o.send()}))},e}(),Pa=/^data:image\/svg\+xml/i,La=/^data:image\/.*;base64,/i,Ma=/^data:image\/.*/i,ka=function(e){return Ji.SUPPORT_SVG_DRAWING||!Na(e)},Ua=function(e){return Ma.test(e)},Ra=function(e){return La.test(e)},Da=function(e){return"blob"===e.substr(0,4)},Na=function(e){return"svg"===e.substr(-3).toLowerCase()||Pa.test(e)},Oa=function(){function e(e,t){this.type=0,this.x=e,this.y=t}return e.prototype.add=function(t,r){return new e(this.x+t,this.y+r)},e}(),Qa=function(e,t,r){return new Oa(e.x+(t.x-e.x)*r,e.y+(t.y-e.y)*r)},za=function(){function e(e,t,r,i){this.type=1,this.start=e,this.startControl=t,this.endControl=r,this.end=i}return e.prototype.subdivide=function(t,r){var i=Qa(this.start,this.startControl,t),n=Qa(this.startControl,this.endControl,t),a=Qa(this.endControl,this.end,t),s=Qa(i,n,t),o=Qa(n,a,t),l=Qa(s,o,t);return r?new e(this.start,i,s,l):new e(l,o,a,this.end)},e.prototype.add=function(t,r){return new e(this.start.add(t,r),this.startControl.add(t,r),this.endControl.add(t,r),this.end.add(t,r))},e.prototype.reverse=function(){return new e(this.end,this.endControl,this.startControl,this.start)},e}(),Ha=function(e){return 1===e.type},ja=function(e){var t=e.styles,r=e.bounds,i=ht(t.borderTopLeftRadius,r.width,r.height),n=i[0],a=i[1],s=ht(t.borderTopRightRadius,r.width,r.height),o=s[0],l=s[1],h=ht(t.borderBottomRightRadius,r.width,r.height),A=h[0],u=h[1],c=ht(t.borderBottomLeftRadius,r.width,r.height),d=c[0],p=c[1],f=[];f.push((n+o)/r.width),f.push((d+A)/r.width),f.push((a+p)/r.height),f.push((l+u)/r.height);var g=Math.max.apply(Math,f);g>1&&(n/=g,a/=g,o/=g,l/=g,A/=g,u/=g,d/=g,p/=g);var m=r.width-o,y=r.height-u,_=r.width-A,v=r.height-p,w=t.borderTopWidth,b=t.borderRightWidth,x=t.borderBottomWidth,B=t.borderLeftWidth,C=At(t.paddingTop,e.bounds.width),S=At(t.paddingRight,e.bounds.width),E=At(t.paddingBottom,e.bounds.width),I=At(t.paddingLeft,e.bounds.width);this.topLeftBorderDoubleOuterBox=n>0||a>0?Va(r.left+B/3,r.top+w/3,n-B/3,a-w/3,pa.TOP_LEFT):new Oa(r.left+B/3,r.top+w/3),this.topRightBorderDoubleOuterBox=n>0||a>0?Va(r.left+m,r.top+w/3,o-b/3,l-w/3,pa.TOP_RIGHT):new Oa(r.left+r.width-b/3,r.top+w/3),this.bottomRightBorderDoubleOuterBox=A>0||u>0?Va(r.left+_,r.top+y,A-b/3,u-x/3,pa.BOTTOM_RIGHT):new Oa(r.left+r.width-b/3,r.top+r.height-x/3),this.bottomLeftBorderDoubleOuterBox=d>0||p>0?Va(r.left+B/3,r.top+v,d-B/3,p-x/3,pa.BOTTOM_LEFT):new Oa(r.left+B/3,r.top+r.height-x/3),this.topLeftBorderDoubleInnerBox=n>0||a>0?Va(r.left+2*B/3,r.top+2*w/3,n-2*B/3,a-2*w/3,pa.TOP_LEFT):new Oa(r.left+2*B/3,r.top+2*w/3),this.topRightBorderDoubleInnerBox=n>0||a>0?Va(r.left+m,r.top+2*w/3,o-2*b/3,l-2*w/3,pa.TOP_RIGHT):new Oa(r.left+r.width-2*b/3,r.top+2*w/3),this.bottomRightBorderDoubleInnerBox=A>0||u>0?Va(r.left+_,r.top+y,A-2*b/3,u-2*x/3,pa.BOTTOM_RIGHT):new Oa(r.left+r.width-2*b/3,r.top+r.height-2*x/3),this.bottomLeftBorderDoubleInnerBox=d>0||p>0?Va(r.left+2*B/3,r.top+v,d-2*B/3,p-2*x/3,pa.BOTTOM_LEFT):new Oa(r.left+2*B/3,r.top+r.height-2*x/3),this.topLeftBorderStroke=n>0||a>0?Va(r.left+B/2,r.top+w/2,n-B/2,a-w/2,pa.TOP_LEFT):new Oa(r.left+B/2,r.top+w/2),this.topRightBorderStroke=n>0||a>0?Va(r.left+m,r.top+w/2,o-b/2,l-w/2,pa.TOP_RIGHT):new Oa(r.left+r.width-b/2,r.top+w/2),this.bottomRightBorderStroke=A>0||u>0?Va(r.left+_,r.top+y,A-b/2,u-x/2,pa.BOTTOM_RIGHT):new Oa(r.left+r.width-b/2,r.top+r.height-x/2),this.bottomLeftBorderStroke=d>0||p>0?Va(r.left+B/2,r.top+v,d-B/2,p-x/2,pa.BOTTOM_LEFT):new Oa(r.left+B/2,r.top+r.height-x/2),this.topLeftBorderBox=n>0||a>0?Va(r.left,r.top,n,a,pa.TOP_LEFT):new Oa(r.left,r.top),this.topRightBorderBox=o>0||l>0?Va(r.left+m,r.top,o,l,pa.TOP_RIGHT):new Oa(r.left+r.width,r.top),this.bottomRightBorderBox=A>0||u>0?Va(r.left+_,r.top+y,A,u,pa.BOTTOM_RIGHT):new Oa(r.left+r.width,r.top+r.height),this.bottomLeftBorderBox=d>0||p>0?Va(r.left,r.top+v,d,p,pa.BOTTOM_LEFT):new Oa(r.left,r.top+r.height),this.topLeftPaddingBox=n>0||a>0?Va(r.left+B,r.top+w,Math.max(0,n-B),Math.max(0,a-w),pa.TOP_LEFT):new Oa(r.left+B,r.top+w),this.topRightPaddingBox=o>0||l>0?Va(r.left+Math.min(m,r.width-b),r.top+w,m>r.width+b?0:Math.max(0,o-b),Math.max(0,l-w),pa.TOP_RIGHT):new Oa(r.left+r.width-b,r.top+w),this.bottomRightPaddingBox=A>0||u>0?Va(r.left+Math.min(_,r.width-B),r.top+Math.min(y,r.height-x),Math.max(0,A-b),Math.max(0,u-x),pa.BOTTOM_RIGHT):new Oa(r.left+r.width-b,r.top+r.height-x),this.bottomLeftPaddingBox=d>0||p>0?Va(r.left+B,r.top+Math.min(v,r.height-x),Math.max(0,d-B),Math.max(0,p-x),pa.BOTTOM_LEFT):new Oa(r.left+B,r.top+r.height-x),this.topLeftContentBox=n>0||a>0?Va(r.left+B+I,r.top+w+C,Math.max(0,n-(B+I)),Math.max(0,a-(w+C)),pa.TOP_LEFT):new Oa(r.left+B+I,r.top+w+C),this.topRightContentBox=o>0||l>0?Va(r.left+Math.min(m,r.width+B+I),r.top+w+C,m>r.width+B+I?0:o-B+I,l-(w+C),pa.TOP_RIGHT):new Oa(r.left+r.width-(b+S),r.top+w+C),this.bottomRightContentBox=A>0||u>0?Va(r.left+Math.min(_,r.width-(B+I)),r.top+Math.min(y,r.height+w+C),Math.max(0,A-(b+S)),u-(x+E),pa.BOTTOM_RIGHT):new Oa(r.left+r.width-(b+S),r.top+r.height-(x+E)),this.bottomLeftContentBox=d>0||p>0?Va(r.left+B+I,r.top+v,Math.max(0,d-(B+I)),p-(x+E),pa.BOTTOM_LEFT):new Oa(r.left+B+I,r.top+r.height-(x+E))};!function(e){e[e.TOP_LEFT=0]="TOP_LEFT",e[e.TOP_RIGHT=1]="TOP_RIGHT",e[e.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",e[e.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(pa||(pa={}));var Va=function(e,t,r,i,n){var a=(Math.sqrt(2)-1)/3*4,s=r*a,o=i*a,l=e+r,h=t+i;switch(n){case pa.TOP_LEFT:return new za(new Oa(e,h),new Oa(e,h-o),new Oa(l-s,t),new Oa(l,t));case pa.TOP_RIGHT:return new za(new Oa(e,t),new Oa(e+s,t),new Oa(l,h-o),new Oa(l,h));case pa.BOTTOM_RIGHT:return new za(new Oa(l,t),new Oa(l,t+o),new Oa(e+s,h),new Oa(e,h));case pa.BOTTOM_LEFT:default:return new za(new Oa(l,h),new Oa(l-s,h),new Oa(e,t+o),new Oa(e,t))}},Ga=function(e){return[e.topLeftBorderBox,e.topRightBorderBox,e.bottomRightBorderBox,e.bottomLeftBorderBox]},Ka=function(e){return[e.topLeftPaddingBox,e.topRightPaddingBox,e.bottomRightPaddingBox,e.bottomLeftPaddingBox]},qa=function(e,t,r){this.offsetX=e,this.offsetY=t,this.matrix=r,this.type=0,this.target=6},Za=function(e,t){this.path=e,this.target=t,this.type=1},Wa=function(e){this.opacity=e,this.type=2,this.target=6},$a=function(e){return 1===e.type},Xa=function(e,t){return e.length===t.length&&e.some((function(e,r){return e===t[r]}))},Ya=function(e){this.element=e,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Ja=function(){function e(e,t){if(this.container=e,this.parent=t,this.effects=[],this.curves=new ja(this.container),this.container.styles.opacity<1&&this.effects.push(new Wa(this.container.styles.opacity)),null!==this.container.styles.transform){var r=this.container.bounds.left+this.container.styles.transformOrigin[0].number,i=this.container.bounds.top+this.container.styles.transformOrigin[1].number,n=this.container.styles.transform;this.effects.push(new qa(r,i,n))}if(0!==this.container.styles.overflowX){var a=Ga(this.curves),s=Ka(this.curves);Xa(a,s)?this.effects.push(new Za(a,6)):(this.effects.push(new Za(a,2)),this.effects.push(new Za(s,4)))}}return e.prototype.getEffects=function(e){for(var t=-1===[2,3].indexOf(this.container.styles.position),r=this.parent,i=this.effects.slice(0);r;){var n=r.effects.filter((function(e){return!$a(e)}));if(t||0!==r.container.styles.position||!r.parent){if(i.unshift.apply(i,n),t=-1===[2,3].indexOf(r.container.styles.position),0!==r.container.styles.overflowX){var a=Ga(r.curves),s=Ka(r.curves);Xa(a,s)||i.unshift(new Za(s,6))}}else i.unshift.apply(i,n);r=r.parent}return i.filter((function(t){return pi(t.target,e)}))},e}(),es=function(e,t,r,i){e.container.elements.forEach((function(n){var a=pi(n.flags,4),s=pi(n.flags,2),o=new Ja(n,e);pi(n.styles.display,2048)&&i.push(o);var l=pi(n.flags,8)?[]:i;if(a||s){var h=a||n.styles.isPositioned()?r:t,A=new Ya(o);if(n.styles.isPositioned()||n.styles.opacity<1||n.styles.isTransformed()){var u=n.styles.zIndex.order;if(u<0){var c=0;h.negativeZIndex.some((function(e,t){return u>e.element.container.styles.zIndex.order?(c=t,!1):c>0})),h.negativeZIndex.splice(c,0,A)}else if(u>0){var d=0;h.positiveZIndex.some((function(e,t){return u>=e.element.container.styles.zIndex.order?(d=t+1,!1):d>0})),h.positiveZIndex.splice(d,0,A)}else h.zeroOrAutoZIndexOrTransformedOrOpacity.push(A)}else n.styles.isFloating()?h.nonPositionedFloats.push(A):h.nonPositionedInlineLevel.push(A);es(o,A,a?A:r,l)}else n.styles.isInlineLevel()?t.inlineLevel.push(o):t.nonInlineLevel.push(o),es(o,t,r,l);pi(n.flags,8)&&ts(n,l)}))},ts=function(e,t){for(var r=e instanceof gn?e.start:1,i=e instanceof gn&&e.reversed,n=0;n<t.length;n++){var a=t[n];a.container instanceof fn&&"number"==typeof a.container.value&&0!==a.container.value&&(r=a.container.value),a.listValue=ua(r,a.container.styles.listStyleType,!0),r+=i?-1:1}},rs=function(e,t){switch(t){case 0:return ns(e.topLeftBorderBox,e.topLeftPaddingBox,e.topRightBorderBox,e.topRightPaddingBox);case 1:return ns(e.topRightBorderBox,e.topRightPaddingBox,e.bottomRightBorderBox,e.bottomRightPaddingBox);case 2:return ns(e.bottomRightBorderBox,e.bottomRightPaddingBox,e.bottomLeftBorderBox,e.bottomLeftPaddingBox);default:return ns(e.bottomLeftBorderBox,e.bottomLeftPaddingBox,e.topLeftBorderBox,e.topLeftPaddingBox)}},is=function(e,t){var r=[];return Ha(e)?r.push(e.subdivide(.5,!1)):r.push(e),Ha(t)?r.push(t.subdivide(.5,!0)):r.push(t),r},ns=function(e,t,r,i){var n=[];return Ha(e)?n.push(e.subdivide(.5,!1)):n.push(e),Ha(r)?n.push(r.subdivide(.5,!0)):n.push(r),Ha(i)?n.push(i.subdivide(.5,!0).reverse()):n.push(i),Ha(t)?n.push(t.subdivide(.5,!1).reverse()):n.push(t),n},as=function(e){var t=e.bounds,r=e.styles;return t.add(r.borderLeftWidth,r.borderTopWidth,-(r.borderRightWidth+r.borderLeftWidth),-(r.borderTopWidth+r.borderBottomWidth))},ss=function(e){var t=e.styles,r=e.bounds,i=At(t.paddingLeft,r.width),n=At(t.paddingRight,r.width),a=At(t.paddingTop,r.width),s=At(t.paddingBottom,r.width);return r.add(i+t.borderLeftWidth,a+t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth+i+n),-(t.borderTopWidth+t.borderBottomWidth+a+s))},os=function(e,t,r){var i=function(e,t){return 0===e?t.bounds:2===e?ss(t):as(t)}(us(e.styles.backgroundOrigin,t),e),n=function(e,t){return 0===e?t.bounds:2===e?ss(t):as(t)}(us(e.styles.backgroundClip,t),e),a=As(us(e.styles.backgroundSize,t),r,i),s=a[0],o=a[1],l=ht(us(e.styles.backgroundPosition,t),i.width-s,i.height-o);return[cs(us(e.styles.backgroundRepeat,t),l,a,i,n),Math.round(i.left+l[0]),Math.round(i.top+l[1]),s,o]},ls=function(e){return $e(e)&&e.value===Bt.AUTO},hs=function(e){return"number"==typeof e},As=function(e,t,r){var i=t[0],n=t[1],a=t[2],s=e[0],o=e[1];if(!s)return[0,0];if(nt(s)&&o&&nt(o))return[At(s,r.width),At(o,r.height)];var l=hs(a);if($e(s)&&(s.value===Bt.CONTAIN||s.value===Bt.COVER))return hs(a)?r.width/r.height<a!=(s.value===Bt.COVER)?[r.width,r.width/a]:[r.height*a,r.height]:[r.width,r.height];var h=hs(i),A=hs(n),u=h||A;if(ls(s)&&(!o||ls(o)))return h&&A?[i,n]:l||u?u&&l?[h?i:n*a,A?n:i/a]:[h?i:r.width,A?n:r.height]:[r.width,r.height];if(l){var c=0,d=0;return nt(s)?c=At(s,r.width):nt(o)&&(d=At(o,r.height)),ls(s)?c=d*a:(!o||ls(o))&&(d=c/a),[c,d]}var p=null,f=null;if(nt(s)?p=At(s,r.width):o&&nt(o)&&(f=At(o,r.height)),null!==p&&(!o||ls(o))&&(f=h&&A?p/i*n:r.height),null!==f&&ls(s)&&(p=h&&A?f/n*i:r.width),null!==p&&null!==f)return[p,f];throw new Error("Unable to calculate background-size for element")},us=function(e,t){var r=e[t];return typeof r>"u"?e[0]:r},cs=function(e,t,r,i,n){var a=t[0],s=t[1],o=r[0],l=r[1];switch(e){case 2:return[new Oa(Math.round(i.left),Math.round(i.top+s)),new Oa(Math.round(i.left+i.width),Math.round(i.top+s)),new Oa(Math.round(i.left+i.width),Math.round(l+i.top+s)),new Oa(Math.round(i.left),Math.round(l+i.top+s))];case 3:return[new Oa(Math.round(i.left+a),Math.round(i.top)),new Oa(Math.round(i.left+a+o),Math.round(i.top)),new Oa(Math.round(i.left+a+o),Math.round(i.height+i.top)),new Oa(Math.round(i.left+a),Math.round(i.height+i.top))];case 1:return[new Oa(Math.round(i.left+a),Math.round(i.top+s)),new Oa(Math.round(i.left+a+o),Math.round(i.top+s)),new Oa(Math.round(i.left+a+o),Math.round(i.top+s+l)),new Oa(Math.round(i.left+a),Math.round(i.top+s+l))];default:return[new Oa(Math.round(n.left),Math.round(n.top)),new Oa(Math.round(n.left+n.width),Math.round(n.top)),new Oa(Math.round(n.left+n.width),Math.round(n.height+n.top)),new Oa(Math.round(n.left),Math.round(n.height+n.top))]}},ds="Hidden Text",ps=function(){function e(e){this._data={},this._document=e}return e.prototype.parseMetrics=function(e,t){var r=this._document.createElement("div"),i=this._document.createElement("img"),n=this._document.createElement("span"),a=this._document.body;r.style.visibility="hidden",r.style.fontFamily=e,r.style.fontSize=t,r.style.margin="0",r.style.padding="0",r.style.whiteSpace="nowrap",a.appendChild(r),i.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",i.width=1,i.height=1,i.style.margin="0",i.style.padding="0",i.style.verticalAlign="baseline",n.style.fontFamily=e,n.style.fontSize=t,n.style.margin="0",n.style.padding="0",n.appendChild(this._document.createTextNode(ds)),r.appendChild(n),r.appendChild(i);var s=i.offsetTop-n.offsetTop+2;r.removeChild(n),r.appendChild(this._document.createTextNode(ds)),r.style.lineHeight="normal",i.style.verticalAlign="super";var o=i.offsetTop-r.offsetTop+2;return a.removeChild(r),{baseline:s,middle:o}},e.prototype.getMetrics=function(e,t){var r=e+" "+t;return typeof this._data[r]>"u"&&(this._data[r]=this.parseMetrics(e,t)),this._data[r]},e}(),fs=function(e,t){this.context=e,this.options=t},gs=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i._activeEffects=[],i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),r.canvas||(i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px"),i.fontMetrics=new ps(document),i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.ctx.textBaseline="bottom",i._activeEffects=[],i.context.logger.debug("Canvas renderer initialized ("+r.width+"x"+r.height+") with scale "+r.scale),i}return t(r,e),r.prototype.applyEffects=function(e){for(var t=this;this._activeEffects.length;)this.popEffect();e.forEach((function(e){return t.applyEffect(e)}))},r.prototype.applyEffect=function(e){this.ctx.save(),function(e){return 2===e.type}(e)&&(this.ctx.globalAlpha=e.opacity),function(e){return 0===e.type}(e)&&(this.ctx.translate(e.offsetX,e.offsetY),this.ctx.transform(e.matrix[0],e.matrix[1],e.matrix[2],e.matrix[3],e.matrix[4],e.matrix[5]),this.ctx.translate(-e.offsetX,-e.offsetY)),$a(e)&&(this.path(e.path),this.ctx.clip()),this._activeEffects.push(e)},r.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},r.prototype.renderStack=function(e){return i(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e.element.container.styles.isVisible()?[4,this.renderStackContent(e)]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))},r.prototype.renderNode=function(e){return i(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return pi(e.container.flags,16),e.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(e)]:[3,3];case 1:return t.sent(),[4,this.renderNodeContent(e)];case 2:t.sent(),t.label=3;case 3:return[2]}}))}))},r.prototype.renderTextWithLetterSpacing=function(e,t,r){var i=this;0===t?this.ctx.fillText(e.text,e.bounds.left,e.bounds.top+r):nn(e.text).reduce((function(t,n){return i.ctx.fillText(n,t,e.bounds.top+r),t+i.ctx.measureText(n).width}),e.bounds.left)},r.prototype.createFontStyle=function(e){var t=e.fontVariant.filter((function(e){return"normal"===e||"small-caps"===e})).join(""),r=ws(e.fontFamily).join(", "),i=Ze(e.fontSize)?""+e.fontSize.number+e.fontSize.unit:e.fontSize.number+"px";return[[e.fontStyle,t,e.fontWeight,i,r].join(" "),r,i]},r.prototype.renderTextNode=function(e,t){return i(this,void 0,void 0,(function(){var r,i,a,s,o,l,h,A,u=this;return n(this,(function(n){return r=this.createFontStyle(t),i=r[0],a=r[1],s=r[2],this.ctx.font=i,this.ctx.direction=1===t.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",o=this.fontMetrics.getMetrics(a,s),l=o.baseline,h=o.middle,A=t.paintOrder,e.textBounds.forEach((function(e){A.forEach((function(r){switch(r){case 0:u.ctx.fillStyle=_t(t.color),u.renderTextWithLetterSpacing(e,t.letterSpacing,l);var i=t.textShadow;i.length&&e.text.trim().length&&(i.slice(0).reverse().forEach((function(r){u.ctx.shadowColor=_t(r.color),u.ctx.shadowOffsetX=r.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=r.offsetY.number*u.options.scale,u.ctx.shadowBlur=r.blur.number,u.renderTextWithLetterSpacing(e,t.letterSpacing,l)})),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),t.textDecorationLine.length&&(u.ctx.fillStyle=_t(t.textDecorationColor||t.color),t.textDecorationLine.forEach((function(t){switch(t){case 1:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top+l),e.bounds.width,1);break;case 2:u.ctx.fillRect(e.bounds.left,Math.round(e.bounds.top),e.bounds.width,1);break;case 3:u.ctx.fillRect(e.bounds.left,Math.ceil(e.bounds.top+h),e.bounds.width,1)}})));break;case 1:t.webkitTextStrokeWidth&&e.text.trim().length&&(u.ctx.strokeStyle=_t(t.webkitTextStrokeColor),u.ctx.lineWidth=t.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(e.text,e.bounds.left,e.bounds.top+l)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}}))})),[2]}))}))},r.prototype.renderReplacedElement=function(e,t,r){if(r&&e.intrinsicWidth>0&&e.intrinsicHeight>0){var i=ss(e),n=Ka(t);this.path(n),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(r,0,0,e.intrinsicWidth,e.intrinsicHeight,i.left,i.top,i.width,i.height),this.ctx.restore()}},r.prototype.renderNodeContent=function(e){return i(this,void 0,void 0,(function(){var t,i,a,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w;return n(this,(function(n){switch(n.label){case 0:this.applyEffects(e.getEffects(4)),t=e.container,i=e.curves,a=t.styles,o=0,l=t.textNodes,n.label=1;case 1:return o<l.length?(h=l[o],[4,this.renderTextNode(h,a)]):[3,4];case 2:n.sent(),n.label=3;case 3:return o++,[3,1];case 4:if(!(t instanceof cn))return[3,8];n.label=5;case 5:return n.trys.push([5,7,,8]),[4,this.context.cache.match(t.src)];case 6:return y=n.sent(),this.renderReplacedElement(t,i,y),[3,8];case 7:return n.sent(),this.context.logger.error("Error loading image "+t.src),[3,8];case 8:if(t instanceof dn&&this.renderReplacedElement(t,i,t.canvas),!(t instanceof pn))return[3,12];n.label=9;case 9:return n.trys.push([9,11,,12]),[4,this.context.cache.match(t.svg)];case 10:return y=n.sent(),this.renderReplacedElement(t,i,y),[3,12];case 11:return n.sent(),this.context.logger.error("Error loading svg "+t.svg.substring(0,255)),[3,12];case 12:return t instanceof Sn&&t.tree?[4,new r(this.context,{scale:this.options.scale,backgroundColor:t.backgroundColor,x:0,y:0,width:t.width,height:t.height}).render(t.tree)]:[3,14];case 13:A=n.sent(),t.width&&t.height&&this.ctx.drawImage(A,0,0,t.width,t.height,t.bounds.left,t.bounds.top,t.bounds.width,t.bounds.height),n.label=14;case 14:if(t instanceof xn&&(u=Math.min(t.bounds.width,t.bounds.height),t.type===_n?t.checked&&(this.ctx.save(),this.path([new Oa(t.bounds.left+.39363*u,t.bounds.top+.79*u),new Oa(t.bounds.left+.16*u,t.bounds.top+.5549*u),new Oa(t.bounds.left+.27347*u,t.bounds.top+.44071*u),new Oa(t.bounds.left+.39694*u,t.bounds.top+.5649*u),new Oa(t.bounds.left+.72983*u,t.bounds.top+.23*u),new Oa(t.bounds.left+.84*u,t.bounds.top+.34085*u),new Oa(t.bounds.left+.39363*u,t.bounds.top+.79*u)]),this.ctx.fillStyle=_t(bn),this.ctx.fill(),this.ctx.restore()):t.type===vn&&t.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(t.bounds.left+u/2,t.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=_t(bn),this.ctx.fill(),this.ctx.restore())),ms(t)&&t.value.length){switch(c=this.createFontStyle(a),v=c[0],d=c[1],p=this.fontMetrics.getMetrics(v,d).baseline,this.ctx.font=v,this.ctx.fillStyle=_t(a.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=_s(t.styles.textAlign),w=ss(t),f=0,t.styles.textAlign){case 1:f+=w.width/2;break;case 2:f+=w.width}g=w.add(f,0,0,-w.height/2+1),this.ctx.save(),this.path([new Oa(w.left,w.top),new Oa(w.left+w.width,w.top),new Oa(w.left+w.width,w.top+w.height),new Oa(w.left,w.top+w.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new en(t.value,g),a.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!pi(t.styles.display,2048))return[3,20];if(null===t.styles.listStyleImage)return[3,19];if(0!==(m=t.styles.listStyleImage).type)return[3,18];y=void 0,_=m.url,n.label=15;case 15:return n.trys.push([15,17,,18]),[4,this.context.cache.match(_)];case 16:return y=n.sent(),this.ctx.drawImage(y,t.bounds.left-(y.width+10),t.bounds.top),[3,18];case 17:return n.sent(),this.context.logger.error("Error loading list-style-image "+_),[3,18];case 18:return[3,20];case 19:e.listValue&&-1!==t.styles.listStyleType&&(v=this.createFontStyle(a)[0],this.ctx.font=v,this.ctx.fillStyle=_t(a.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",w=new s(t.bounds.left,t.bounds.top+At(t.styles.paddingTop,t.bounds.width),t.bounds.width,Pr(a.lineHeight,a.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new en(e.listValue,w),a.letterSpacing,Pr(a.lineHeight,a.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),n.label=20;case 20:return[2]}}))}))},r.prototype.renderStackContent=function(e){return i(this,void 0,void 0,(function(){var t,r,i,a,s,o,l,h,A,u,c,d,p,f,g;return n(this,(function(n){switch(n.label){case 0:return pi(e.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(e.element)];case 1:n.sent(),t=0,r=e.negativeZIndex,n.label=2;case 2:return t<r.length?(g=r[t],[4,this.renderStack(g)]):[3,5];case 3:n.sent(),n.label=4;case 4:return t++,[3,2];case 5:return[4,this.renderNodeContent(e.element)];case 6:n.sent(),i=0,a=e.nonInlineLevel,n.label=7;case 7:return i<a.length?(g=a[i],[4,this.renderNode(g)]):[3,10];case 8:n.sent(),n.label=9;case 9:return i++,[3,7];case 10:s=0,o=e.nonPositionedFloats,n.label=11;case 11:return s<o.length?(g=o[s],[4,this.renderStack(g)]):[3,14];case 12:n.sent(),n.label=13;case 13:return s++,[3,11];case 14:l=0,h=e.nonPositionedInlineLevel,n.label=15;case 15:return l<h.length?(g=h[l],[4,this.renderStack(g)]):[3,18];case 16:n.sent(),n.label=17;case 17:return l++,[3,15];case 18:A=0,u=e.inlineLevel,n.label=19;case 19:return A<u.length?(g=u[A],[4,this.renderNode(g)]):[3,22];case 20:n.sent(),n.label=21;case 21:return A++,[3,19];case 22:c=0,d=e.zeroOrAutoZIndexOrTransformedOrOpacity,n.label=23;case 23:return c<d.length?(g=d[c],[4,this.renderStack(g)]):[3,26];case 24:n.sent(),n.label=25;case 25:return c++,[3,23];case 26:p=0,f=e.positiveZIndex,n.label=27;case 27:return p<f.length?(g=f[p],[4,this.renderStack(g)]):[3,30];case 28:n.sent(),n.label=29;case 29:return p++,[3,27];case 30:return[2]}}))}))},r.prototype.mask=function(e){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(e.slice(0).reverse()),this.ctx.closePath()},r.prototype.path=function(e){this.ctx.beginPath(),this.formatPath(e),this.ctx.closePath()},r.prototype.formatPath=function(e){var t=this;e.forEach((function(e,r){var i=Ha(e)?e.start:e;0===r?t.ctx.moveTo(i.x,i.y):t.ctx.lineTo(i.x,i.y),Ha(e)&&t.ctx.bezierCurveTo(e.startControl.x,e.startControl.y,e.endControl.x,e.endControl.y,e.end.x,e.end.y)}))},r.prototype.renderRepeat=function(e,t,r,i){this.path(e),this.ctx.fillStyle=t,this.ctx.translate(r,i),this.ctx.fill(),this.ctx.translate(-r,-i)},r.prototype.resizeImage=function(e,t,r){var i;if(e.width===t&&e.height===r)return e;var n=(null!==(i=this.canvas.ownerDocument)&&void 0!==i?i:document).createElement("canvas");return n.width=Math.max(1,t),n.height=Math.max(1,r),n.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t,r),n},r.prototype.renderBackgroundImage=function(e){return i(this,void 0,void 0,(function(){var t,r,i,a,s,o;return n(this,(function(l){switch(l.label){case 0:t=e.styles.backgroundImage.length-1,r=function(r){var a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E,I,T,F,P,L,M,k,U;return n(this,(function(n){switch(n.label){case 0:if(0!==r.type)return[3,5];a=void 0,s=r.url,n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i.context.cache.match(s)];case 2:return a=n.sent(),[3,4];case 3:return n.sent(),i.context.logger.error("Error loading background-image "+s),[3,4];case 4:return a&&(o=os(e,t,[a.width,a.height,a.width/a.height]),v=o[0],S=o[1],E=o[2],x=o[3],B=o[4],y=i.ctx.createPattern(i.resizeImage(a,x,B),"repeat"),i.renderRepeat(v,y,S,E)),[3,6];case 5:!function(e){return 1===e.type}(r)?function(e){return 2===e.type}(r)&&(_=os(e,t,[null,null,null]),v=_[0],w=_[1],b=_[2],x=_[3],B=_[4],C=0===r.position.length?[ot]:r.position,S=At(C[0],x),E=At(C[C.length-1],B),I=function(e,t,r,i,n){var a=0,s=0;switch(e.size){case 0:0===e.shape?a=s=Math.min(Math.abs(t),Math.abs(t-i),Math.abs(r),Math.abs(r-n)):1===e.shape&&(a=Math.min(Math.abs(t),Math.abs(t-i)),s=Math.min(Math.abs(r),Math.abs(r-n)));break;case 2:if(0===e.shape)a=s=Math.min(kt(t,r),kt(t,r-n),kt(t-i,r),kt(t-i,r-n));else if(1===e.shape){var o=Math.min(Math.abs(r),Math.abs(r-n))/Math.min(Math.abs(t),Math.abs(t-i)),l=Ut(i,n,t,r,!0),h=l[0],A=l[1];s=o*(a=kt(h-t,(A-r)/o))}break;case 1:0===e.shape?a=s=Math.max(Math.abs(t),Math.abs(t-i),Math.abs(r),Math.abs(r-n)):1===e.shape&&(a=Math.max(Math.abs(t),Math.abs(t-i)),s=Math.max(Math.abs(r),Math.abs(r-n)));break;case 3:if(0===e.shape)a=s=Math.max(kt(t,r),kt(t,r-n),kt(t-i,r),kt(t-i,r-n));else if(1===e.shape){o=Math.max(Math.abs(r),Math.abs(r-n))/Math.max(Math.abs(t),Math.abs(t-i));var u=Ut(i,n,t,r,!1);h=u[0],A=u[1],s=o*(a=kt(h-t,(A-r)/o))}}return Array.isArray(e.size)&&(a=At(e.size[0],i),s=2===e.size.length?At(e.size[1],n):a),[a,s]}(r,S,E,x,B),T=I[0],F=I[1],T>0&&F>0&&(P=i.ctx.createRadialGradient(w+S,b+E,0,w+S,b+E,T),Lt(r.stops,2*T).forEach((function(e){return P.addColorStop(e.stop,_t(e.color))})),i.path(v),i.ctx.fillStyle=P,T!==F?(L=e.bounds.left+.5*e.bounds.width,M=e.bounds.top+.5*e.bounds.height,U=1/(k=F/T),i.ctx.save(),i.ctx.translate(L,M),i.ctx.transform(1,0,0,k,0,0),i.ctx.translate(-L,-M),i.ctx.fillRect(w,U*(b-M)+M,x,B*U),i.ctx.restore()):i.ctx.fill())):(l=os(e,t,[null,null,null]),v=l[0],S=l[1],E=l[2],x=l[3],B=l[4],h=Mt(r.angle,x,B),A=h[0],u=h[1],c=h[2],d=h[3],p=h[4],(f=document.createElement("canvas")).width=x,f.height=B,g=f.getContext("2d"),m=g.createLinearGradient(u,d,c,p),Lt(r.stops,A).forEach((function(e){return m.addColorStop(e.stop,_t(e.color))})),g.fillStyle=m,g.fillRect(0,0,x,B),x>0&&B>0&&(y=i.ctx.createPattern(f,"repeat"),i.renderRepeat(v,y,S,E))),n.label=6;case 6:return t--,[2]}}))},i=this,a=0,s=e.styles.backgroundImage.slice(0).reverse(),l.label=1;case 1:return a<s.length?(o=s[a],[5,r(o)]):[3,4];case 2:l.sent(),l.label=3;case 3:return a++,[3,1];case 4:return[2]}}))}))},r.prototype.renderSolidBorder=function(e,t,r){return i(this,void 0,void 0,(function(){return n(this,(function(i){return this.path(rs(r,t)),this.ctx.fillStyle=_t(e),this.ctx.fill(),[2]}))}))},r.prototype.renderDoubleBorder=function(e,t,r,a){return i(this,void 0,void 0,(function(){var i,s;return n(this,(function(n){switch(n.label){case 0:return t<3?[4,this.renderSolidBorder(e,r,a)]:[3,2];case 1:return n.sent(),[2];case 2:return i=function(e,t){switch(t){case 0:return ns(e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox,e.topRightBorderBox,e.topRightBorderDoubleOuterBox);case 1:return ns(e.topRightBorderBox,e.topRightBorderDoubleOuterBox,e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox);case 2:return ns(e.bottomRightBorderBox,e.bottomRightBorderDoubleOuterBox,e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox);default:return ns(e.bottomLeftBorderBox,e.bottomLeftBorderDoubleOuterBox,e.topLeftBorderBox,e.topLeftBorderDoubleOuterBox)}}(a,r),this.path(i),this.ctx.fillStyle=_t(e),this.ctx.fill(),s=function(e,t){switch(t){case 0:return ns(e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox,e.topRightBorderDoubleInnerBox,e.topRightPaddingBox);case 1:return ns(e.topRightBorderDoubleInnerBox,e.topRightPaddingBox,e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox);case 2:return ns(e.bottomRightBorderDoubleInnerBox,e.bottomRightPaddingBox,e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox);default:return ns(e.bottomLeftBorderDoubleInnerBox,e.bottomLeftPaddingBox,e.topLeftBorderDoubleInnerBox,e.topLeftPaddingBox)}}(a,r),this.path(s),this.ctx.fill(),[2]}}))}))},r.prototype.renderNodeBackgroundAndBorders=function(e){return i(this,void 0,void 0,(function(){var t,r,i,a,s,o,l,h,A=this;return n(this,(function(n){switch(n.label){case 0:return this.applyEffects(e.getEffects(2)),t=e.container.styles,r=!yt(t.backgroundColor)||t.backgroundImage.length,i=[{style:t.borderTopStyle,color:t.borderTopColor,width:t.borderTopWidth},{style:t.borderRightStyle,color:t.borderRightColor,width:t.borderRightWidth},{style:t.borderBottomStyle,color:t.borderBottomColor,width:t.borderBottomWidth},{style:t.borderLeftStyle,color:t.borderLeftColor,width:t.borderLeftWidth}],a=ys(us(t.backgroundClip,0),e.curves),r||t.boxShadow.length?(this.ctx.save(),this.path(a),this.ctx.clip(),yt(t.backgroundColor)||(this.ctx.fillStyle=_t(t.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(e.container)]):[3,2];case 1:n.sent(),this.ctx.restore(),t.boxShadow.slice(0).reverse().forEach((function(t){A.ctx.save();var r=Ga(e.curves),i=t.inset?0:1e4,n=function(e,t,r,i,n){return e.map((function(e,a){switch(a){case 0:return e.add(t,r);case 1:return e.add(t+i,r);case 2:return e.add(t+i,r+n);case 3:return e.add(t,r+n)}return e}))}(r,-i+(t.inset?1:-1)*t.spread.number,(t.inset?1:-1)*t.spread.number,t.spread.number*(t.inset?-2:2),t.spread.number*(t.inset?-2:2));t.inset?(A.path(r),A.ctx.clip(),A.mask(n)):(A.mask(r),A.ctx.clip(),A.path(n)),A.ctx.shadowOffsetX=t.offsetX.number+i,A.ctx.shadowOffsetY=t.offsetY.number,A.ctx.shadowColor=_t(t.color),A.ctx.shadowBlur=t.blur.number,A.ctx.fillStyle=t.inset?_t(t.color):"rgba(0,0,0,1)",A.ctx.fill(),A.ctx.restore()})),n.label=2;case 2:s=0,o=0,l=i,n.label=3;case 3:return o<l.length?0!==(h=l[o]).style&&!yt(h.color)&&h.width>0?2!==h.style?[3,5]:[4,this.renderDashedDottedBorder(h.color,h.width,s,e.curves,2)]:[3,11]:[3,13];case 4:return n.sent(),[3,11];case 5:return 3!==h.style?[3,7]:[4,this.renderDashedDottedBorder(h.color,h.width,s,e.curves,3)];case 6:return n.sent(),[3,11];case 7:return 4!==h.style?[3,9]:[4,this.renderDoubleBorder(h.color,h.width,s,e.curves)];case 8:return n.sent(),[3,11];case 9:return[4,this.renderSolidBorder(h.color,s,e.curves)];case 10:n.sent(),n.label=11;case 11:s++,n.label=12;case 12:return o++,[3,3];case 13:return[2]}}))}))},r.prototype.renderDashedDottedBorder=function(e,t,r,a,s){return i(this,void 0,void 0,(function(){var i,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w;return n(this,(function(n){return this.ctx.save(),i=function(e,t){switch(t){case 0:return is(e.topLeftBorderStroke,e.topRightBorderStroke);case 1:return is(e.topRightBorderStroke,e.bottomRightBorderStroke);case 2:return is(e.bottomRightBorderStroke,e.bottomLeftBorderStroke);default:return is(e.bottomLeftBorderStroke,e.topLeftBorderStroke)}}(a,r),o=rs(a,r),2===s&&(this.path(o),this.ctx.clip()),Ha(o[0])?(l=o[0].start.x,h=o[0].start.y):(l=o[0].x,h=o[0].y),Ha(o[1])?(A=o[1].end.x,u=o[1].end.y):(A=o[1].x,u=o[1].y),c=0===r||2===r?Math.abs(l-A):Math.abs(h-u),this.ctx.beginPath(),3===s?this.formatPath(i):this.formatPath(o.slice(0,2)),d=t<3?3*t:2*t,p=t<3?2*t:t,3===s&&(d=t,p=t),f=!0,c<=2*d?f=!1:c<=2*d+p?(d*=g=c/(2*d+p),p*=g):(m=Math.floor((c+p)/(d+p)),y=(c-m*d)/(m-1),p=(_=(c-(m+1)*d)/m)<=0||Math.abs(p-y)<Math.abs(p-_)?y:_),f&&(3===s?this.ctx.setLineDash([0,d+p]):this.ctx.setLineDash([d,p])),3===s?(this.ctx.lineCap="round",this.ctx.lineWidth=t):this.ctx.lineWidth=2*t+1.1,this.ctx.strokeStyle=_t(e),this.ctx.stroke(),this.ctx.setLineDash([]),2===s&&(Ha(o[0])&&(v=o[3],w=o[0],this.ctx.beginPath(),this.formatPath([new Oa(v.end.x,v.end.y),new Oa(w.start.x,w.start.y)]),this.ctx.stroke()),Ha(o[1])&&(v=o[1],w=o[2],this.ctx.beginPath(),this.formatPath([new Oa(v.end.x,v.end.y),new Oa(w.start.x,w.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]}))}))},r.prototype.render=function(e){return i(this,void 0,void 0,(function(){var t;return n(this,(function(r){switch(r.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=_t(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),t=function(e){var t=new Ja(e,null),r=new Ya(t),i=[];return es(t,r,r,i),ts(t.container,i),r}(e),[4,this.renderStack(t)];case 1:return r.sent(),this.applyEffects([]),[2,this.canvas]}}))}))},r}(fs),ms=function(e){return e instanceof Cn||e instanceof Bn||e instanceof xn&&e.type!==vn&&e.type!==_n},ys=function(e,t){switch(e){case 0:return Ga(t);case 2:return function(e){return[e.topLeftContentBox,e.topRightContentBox,e.bottomRightContentBox,e.bottomLeftContentBox]}(t);default:return Ka(t)}},_s=function(e){switch(e){case 1:return"center";case 2:return"right";default:return"left"}},vs=["-apple-system","system-ui"],ws=function(e){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?e.filter((function(e){return-1===vs.indexOf(e)})):e},bs=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.canvas=r.canvas?r.canvas:document.createElement("canvas"),i.ctx=i.canvas.getContext("2d"),i.options=r,i.canvas.width=Math.floor(r.width*r.scale),i.canvas.height=Math.floor(r.height*r.scale),i.canvas.style.width=r.width+"px",i.canvas.style.height=r.height+"px",i.ctx.scale(i.options.scale,i.options.scale),i.ctx.translate(-r.x,-r.y),i.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+r.width+"x"+r.height+" at "+r.x+","+r.y+") with scale "+r.scale),i}return t(r,e),r.prototype.render=function(e){return i(this,void 0,void 0,(function(){var t,r;return n(this,(function(i){switch(i.label){case 0:return t=Xi(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,e),[4,xs(t)];case 1:return r=i.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=_t(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(r,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}}))}))},r}(fs),xs=function(e){return new Promise((function(t,r){var i=new Image;i.onload=function(){t(i)},i.onerror=r,i.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(e))}))},Bs=function(){function e(e){var t=e.id,r=e.enabled;this.id=t,this.enabled=r,this.start=Date.now()}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&"function"==typeof console.debug?console.debug.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.getTime=function(){return Date.now()-this.start},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&typeof window<"u"&&window.console&&"function"==typeof console.info&&console.info.apply(console,a([this.id,this.getTime()+"ms"],e))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&"function"==typeof console.warn?console.warn.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.enabled&&(typeof window<"u"&&window.console&&"function"==typeof console.error?console.error.apply(console,a([this.id,this.getTime()+"ms"],e)):this.info.apply(this,e))},e.instances={},e}(),Cs=function(){function e(t,r){var i;this.windowBounds=r,this.instanceName="#"+e.instanceCount++,this.logger=new Bs({id:this.instanceName,enabled:t.logging}),this.cache=null!==(i=t.cache)&&void 0!==i?i:new Fa(this,t)}return e.instanceCount=1,e}();typeof window<"u"&&Ta.setContext(window);var Ss=function(e,t){return i(void 0,void 0,void 0,(function(){var i,a,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E,I,T,F,P,L,M,k,U,R,D,N,O,Q,z,H,j;return n(this,(function(n){switch(n.label){case 0:if(!e||"object"!=typeof e)return[2,Promise.reject("Invalid element provided as first argument")];if(!(i=e.ownerDocument))throw new Error("Element is not attached to a Document");if(!(a=i.defaultView))throw new Error("Document is not attached to a Window");return l={allowTaint:null!==(E=t.allowTaint)&&void 0!==E&&E,imageTimeout:null!==(I=t.imageTimeout)&&void 0!==I?I:15e3,proxy:t.proxy,useCORS:null!==(T=t.useCORS)&&void 0!==T&&T},h=r({logging:null===(F=t.logging)||void 0===F||F,cache:t.cache},l),A={windowWidth:null!==(P=t.windowWidth)&&void 0!==P?P:a.innerWidth,windowHeight:null!==(L=t.windowHeight)&&void 0!==L?L:a.innerHeight,scrollX:null!==(M=t.scrollX)&&void 0!==M?M:a.pageXOffset,scrollY:null!==(k=t.scrollY)&&void 0!==k?k:a.pageYOffset},u=new s(A.scrollX,A.scrollY,A.windowWidth,A.windowHeight),c=new Cs(h,u),d=null!==(U=t.foreignObjectRendering)&&void 0!==U&&U,p={allowTaint:null!==(R=t.allowTaint)&&void 0!==R&&R,onclone:t.onclone,ignoreElements:t.ignoreElements,inlineImages:d,copyStyles:d},c.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),f=new da(c,e,p),(g=f.clonedReferenceElement)?[4,f.toIFrame(i,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=n.sent(),y=zn(g)||function(e){return"HTML"===e.tagName}(g)?function(e){var t=e.body,r=e.documentElement;if(!t||!r)throw new Error("Unable to get document size");var i=Math.max(Math.max(t.scrollWidth,r.scrollWidth),Math.max(t.offsetWidth,r.offsetWidth),Math.max(t.clientWidth,r.clientWidth)),n=Math.max(Math.max(t.scrollHeight,r.scrollHeight),Math.max(t.offsetHeight,r.offsetHeight),Math.max(t.clientHeight,r.clientHeight));return new s(0,0,i,n)}(g.ownerDocument):o(c,g),_=y.width,v=y.height,w=y.left,b=y.top,x=Es(c,g,t.backgroundColor),B={canvas:t.canvas,backgroundColor:x,scale:null!==(N=null!==(D=t.scale)&&void 0!==D?D:a.devicePixelRatio)&&void 0!==N?N:1,x:(null!==(O=t.x)&&void 0!==O?O:0)+w,y:(null!==(Q=t.y)&&void 0!==Q?Q:0)+b,width:null!==(z=t.width)&&void 0!==z?z:Math.ceil(_),height:null!==(H=t.height)&&void 0!==H?H:Math.ceil(v)},d?(c.logger.debug("Document cloned, using foreign object rendering"),[4,new bs(c,B).render(g)]):[3,3];case 2:return C=n.sent(),[3,5];case 3:return c.logger.debug("Document cloned, element located at "+w+","+b+" with size "+_+"x"+v+" using computed rendering"),c.logger.debug("Starting DOM parsing"),S=Fn(c,g),x===S.styles.backgroundColor&&(S.styles.backgroundColor=It.TRANSPARENT),c.logger.debug("Starting renderer for element at "+B.x+","+B.y+" with size "+B.width+"x"+B.height),[4,new gs(c,B).render(S)];case 4:C=n.sent(),n.label=5;case 5:return(!(null!==(j=t.removeContainer)&&void 0!==j)||j)&&(da.destroy(m)||c.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),c.logger.debug("Finished rendering"),[2,C]}}))}))},Es=function(e,t,r){var i=t.ownerDocument,n=i.documentElement?Et(e,getComputedStyle(i.documentElement).backgroundColor):It.TRANSPARENT,a=i.body?Et(e,getComputedStyle(i.body).backgroundColor):It.TRANSPARENT,s="string"==typeof r?Et(e,r):null===r?It.TRANSPARENT:4294967295;return t===i.documentElement?yt(n)?yt(a)?s:a:n:s};return function(e,t){return void 0===t&&(t={}),Ss(e,t)}},"object"==typeof e&&typeof t<"u"?t.exports=i():"function"==typeof define&&define.amd?define(i):(r=typeof globalThis<"u"?globalThis:r||self).html2canvas=i()})),Xr={};function Yr(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var r=arguments.length,i=new Array(r>1?r-1:0),n=1;n<r;n++)i[n-1]=arguments[n];return ci(e,t,i)}}function Jr(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_i;ai&&ai(e,null);let i=t.length;for(;i--;){let n=t[i];if("string"==typeof n){let e=r(n);e!==n&&(si(t)||(t[i]=e),n=e)}e[n]=!0}return e}function ei(e){for(let t=0;t<e.length;t++)Ci(e,t)||(e[t]=null);return e}function ti(e){let t=ui(null);for(let[r,i]of ni(e))Ci(e,r)&&(Array.isArray(i)?t[r]=ei(i):i&&"object"==typeof i&&i.constructor===Object?t[r]=ti(i):t[r]=i);return t}function ri(e,t){for(;null!==e;){let r=li(e,t);if(r){if(r.get)return Yr(r.get);if("function"==typeof r.value)return Yr(r.value)}e=oi(e)}return function(){return null}}function ii(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Xi(),t=e=>ii(e);if(t.version="3.2.7",t.removed=[],!e||!e.document||e.document.nodeType!==$i.document||!e.Element)return t.isSupported=!1,t;let{document:r}=e,i=r,n=i.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:o,Element:l,NodeFilter:h,NamedNodeMap:A=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:u,DOMParser:c,trustedTypes:d}=e,p=l.prototype,f=ri(p,"cloneNode"),g=ri(p,"remove"),m=ri(p,"nextSibling"),y=ri(p,"childNodes"),_=ri(p,"parentNode");if("function"==typeof s){let e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let v,w="",{implementation:b,createNodeIterator:x,createDocumentFragment:B,getElementsByTagName:C}=r,{importNode:S}=i,E=Ji();t.isSupported="function"==typeof ni&&"function"==typeof _&&b&&void 0!==b.createHTMLDocument;let{MUSTACHE_EXPR:I,ERB_EXPR:T,TMPLIT_EXPR:F,DATA_ATTR:P,ARIA_ATTR:L,IS_SCRIPT_OR_DATA:M,ATTR_WHITESPACE:k,CUSTOM_ELEMENT:U}=Wi,{IS_ALLOWED_URI:R}=Wi,D=null,N=Jr({},[...Ii,...Ti,...Fi,...Li,...ki]),O=null,Q=Jr({},[...Ui,...Ri,...Di,...Ni]),z=Object.seal(ui(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),H=null,j=null,V=!0,G=!0,K=!1,q=!0,Z=!1,W=!0,$=!1,X=!1,Y=!1,J=!1,ee=!1,te=!1,re=!0,ie=!1,ne=!0,ae=!1,se={},oe=null,le=Jr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),he=null,Ae=Jr({},["audio","video","img","source","image","track"]),ue=null,ce=Jr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),de="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml",ge=fe,me=!1,ye=null,_e=Jr({},[de,pe,fe],vi),ve=Jr({},["mi","mo","mn","ms","mtext"]),we=Jr({},["annotation-xml"]),be=Jr({},["title","style","font","a","script"]),xe=null,Be=["application/xhtml+xml","text/html"],Ce=null,Se=null,Ee=r.createElement("form"),Ie=function(e){return e instanceof RegExp||e instanceof Function},Te=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Se||Se!==e){if((!e||"object"!=typeof e)&&(e={}),e=ti(e),xe=-1===Be.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,Ce="application/xhtml+xml"===xe?vi:_i,D=Ci(e,"ALLOWED_TAGS")?Jr({},e.ALLOWED_TAGS,Ce):N,O=Ci(e,"ALLOWED_ATTR")?Jr({},e.ALLOWED_ATTR,Ce):Q,ye=Ci(e,"ALLOWED_NAMESPACES")?Jr({},e.ALLOWED_NAMESPACES,vi):_e,ue=Ci(e,"ADD_URI_SAFE_ATTR")?Jr(ti(ce),e.ADD_URI_SAFE_ATTR,Ce):ce,he=Ci(e,"ADD_DATA_URI_TAGS")?Jr(ti(Ae),e.ADD_DATA_URI_TAGS,Ce):Ae,oe=Ci(e,"FORBID_CONTENTS")?Jr({},e.FORBID_CONTENTS,Ce):le,H=Ci(e,"FORBID_TAGS")?Jr({},e.FORBID_TAGS,Ce):ti({}),j=Ci(e,"FORBID_ATTR")?Jr({},e.FORBID_ATTR,Ce):ti({}),se=!!Ci(e,"USE_PROFILES")&&e.USE_PROFILES,V=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,q=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Z=e.SAFE_FOR_TEMPLATES||!1,W=!1!==e.SAFE_FOR_XML,$=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,Y=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,ie=e.SANITIZE_NAMED_PROPS||!1,ne=!1!==e.KEEP_CONTENT,ae=e.IN_PLACE||!1,R=e.ALLOWED_URI_REGEXP||Vi,ge=e.NAMESPACE||fe,ve=e.MATHML_TEXT_INTEGRATION_POINTS||ve,we=e.HTML_INTEGRATION_POINTS||we,z=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(z.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ie(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(z.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(z.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Z&&(G=!1),ee&&(J=!0),se&&(D=Jr({},ki),O=[],!0===se.html&&(Jr(D,Ii),Jr(O,Ui)),!0===se.svg&&(Jr(D,Ti),Jr(O,Ri),Jr(O,Ni)),!0===se.svgFilters&&(Jr(D,Fi),Jr(O,Ri),Jr(O,Ni)),!0===se.mathMl&&(Jr(D,Li),Jr(O,Di),Jr(O,Ni))),e.ADD_TAGS&&(D===N&&(D=ti(D)),Jr(D,e.ADD_TAGS,Ce)),e.ADD_ATTR&&(O===Q&&(O=ti(O)),Jr(O,e.ADD_ATTR,Ce)),e.ADD_URI_SAFE_ATTR&&Jr(ue,e.ADD_URI_SAFE_ATTR,Ce),e.FORBID_CONTENTS&&(oe===le&&(oe=ti(oe)),Jr(oe,e.FORBID_CONTENTS,Ce)),ne&&(D["#text"]=!0),$&&Jr(D,["html","head","body"]),D.table&&(Jr(D,["tbody"]),delete H.tbody),e.TRUSTED_TYPES_POLICY){if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Ei('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Ei('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');v=e.TRUSTED_TYPES_POLICY,w=v.createHTML("")}else void 0===v&&(v=Yi(d,n)),null!==v&&"string"==typeof w&&(w=v.createHTML(""));hi&&hi(e),Se=e}},Fe=Jr({},[...Ti,...Fi,...Pi]),Pe=Jr({},[...Li,...Mi]),Le=function(e){mi(t.removed,{element:e});try{_(e).removeChild(e)}catch{g(e)}},Me=function(e,r){try{mi(t.removed,{attribute:r.getAttributeNode(e),from:r})}catch{mi(t.removed,{attribute:null,from:r})}if(r.removeAttribute(e),"is"===e)if(J||ee)try{Le(r)}catch{}else try{r.setAttribute(e,"")}catch{}},ke=function(e){let t=null,i=null;if(Y)e="<remove></remove>"+e;else{let t=wi(e,/^[\r\n\t ]+/);i=t&&t[0]}"application/xhtml+xml"===xe&&ge===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");let n=v?v.createHTML(e):e;if(ge===fe)try{t=(new c).parseFromString(n,xe)}catch{}if(!t||!t.documentElement){t=b.createDocument(ge,"template",null);try{t.documentElement.innerHTML=me?w:n}catch{}}let a=t.body||t.documentElement;return e&&i&&a.insertBefore(r.createTextNode(i),a.childNodes[0]||null),ge===fe?C.call(t,$?"html":"body")[0]:$?t.documentElement:a},Ue=function(e){return x.call(e.ownerDocument||e,e,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Re=function(e){return e instanceof u&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof A)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore||"function"!=typeof e.hasChildNodes)},De=function(e){return"function"==typeof o&&e instanceof o};function Ne(e,r,i){pi(e,(e=>{e.call(t,r,i,Se)}))}let Oe=function(e){let r=null;if(Ne(E.beforeSanitizeElements,e,null),Re(e))return Le(e),!0;let i=Ce(e.nodeName);if(Ne(E.uponSanitizeElement,e,{tagName:i,allowedTags:D}),W&&e.hasChildNodes()&&!De(e.firstElementChild)&&Si(/<[/\w!]/g,e.innerHTML)&&Si(/<[/\w!]/g,e.textContent)||e.nodeType===$i.progressingInstruction||W&&e.nodeType===$i.comment&&Si(/<[/\w]/g,e.data))return Le(e),!0;if(!D[i]||H[i]){if(!H[i]&&ze(i)&&(z.tagNameCheck instanceof RegExp&&Si(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i)))return!1;if(ne&&!oe[i]){let t=_(e)||e.parentNode,r=y(e)||e.childNodes;if(r&&t){for(let i=r.length-1;i>=0;--i){let n=f(r[i],!0);n.__removalCount=(e.__removalCount||0)+1,t.insertBefore(n,m(e))}}}return Le(e),!0}return e instanceof l&&!function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:ge,tagName:"template"});let r=_i(e.tagName),i=_i(t.tagName);return!!ye[e.namespaceURI]&&(e.namespaceURI===pe?t.namespaceURI===fe?"svg"===r:t.namespaceURI===de?"svg"===r&&("annotation-xml"===i||ve[i]):!!Fe[r]:e.namespaceURI===de?t.namespaceURI===fe?"math"===r:t.namespaceURI===pe?"math"===r&&we[i]:!!Pe[r]:e.namespaceURI===fe?!(t.namespaceURI===pe&&!we[i]||t.namespaceURI===de&&!ve[i])&&!Pe[r]&&(be[r]||!Fe[r]):!("application/xhtml+xml"!==xe||!ye[e.namespaceURI]))}(e)||("noscript"===i||"noembed"===i||"noframes"===i)&&Si(/<\/no(script|embed|frames)/i,e.innerHTML)?(Le(e),!0):(Z&&e.nodeType===$i.text&&(r=e.textContent,pi([I,T,F],(e=>{r=bi(r,e," ")})),e.textContent!==r&&(mi(t.removed,{element:e.cloneNode()}),e.textContent=r)),Ne(E.afterSanitizeElements,e,null),!1)},Qe=function(e,t,i){if(re&&("id"===t||"name"===t)&&(i in r||i in Ee))return!1;if((!G||j[t]||!Si(P,t))&&(!V||!Si(L,t)))if(!O[t]||j[t]){if(!(ze(e)&&(z.tagNameCheck instanceof RegExp&&Si(z.tagNameCheck,e)||z.tagNameCheck instanceof Function&&z.tagNameCheck(e))&&(z.attributeNameCheck instanceof RegExp&&Si(z.attributeNameCheck,t)||z.attributeNameCheck instanceof Function&&z.attributeNameCheck(t,e))||"is"===t&&z.allowCustomizedBuiltInElements&&(z.tagNameCheck instanceof RegExp&&Si(z.tagNameCheck,i)||z.tagNameCheck instanceof Function&&z.tagNameCheck(i))))return!1}else if(!ue[t]&&!Si(R,bi(i,k,""))&&("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==xi(i,"data:")||!he[e])&&(!K||Si(M,bi(i,k,"")))&&i)return!1;return!0},ze=function(e){return"annotation-xml"!==e&&wi(e,U)},He=function(e){Ne(E.beforeSanitizeAttributes,e,null);let{attributes:r}=e;if(!r||Re(e))return;let i={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0},n=r.length;for(;n--;){let a=r[n],{name:s,namespaceURI:o,value:l}=a,h=Ce(s),A=l,u="value"===s?A:Bi(A);if(i.attrName=h,i.attrValue=u,i.keepAttr=!0,i.forceKeepAttr=void 0,Ne(E.uponSanitizeAttribute,e,i),u=i.attrValue,ie&&("id"===h||"name"===h)&&(Me(s,e),u="user-content-"+u),W&&Si(/((--!?|])>)|<\/(style|title|textarea)/i,u)){Me(s,e);continue}if("attributename"===h&&wi(u,"href")){Me(s,e);continue}if(i.forceKeepAttr)continue;if(!i.keepAttr){Me(s,e);continue}if(!q&&Si(/\/>/i,u)){Me(s,e);continue}Z&&pi([I,T,F],(e=>{u=bi(u,e," ")}));let c=Ce(e.nodeName);if(Qe(c,h,u)){if(v&&"object"==typeof d&&"function"==typeof d.getAttributeType&&!o)switch(d.getAttributeType(c,h)){case"TrustedHTML":u=v.createHTML(u);break;case"TrustedScriptURL":u=v.createScriptURL(u)}if(u!==A)try{o?e.setAttributeNS(o,s,u):e.setAttribute(s,u),Re(e)?Le(e):gi(t.removed)}catch{Me(s,e)}}else Me(s,e)}Ne(E.afterSanitizeAttributes,e,null)},je=function e(t){let r=null,i=Ue(t);for(Ne(E.beforeSanitizeShadowDOM,t,null);r=i.nextNode();)Ne(E.uponSanitizeShadowNode,r,null),Oe(r),He(r),r.content instanceof a&&e(r.content);Ne(E.afterSanitizeShadowDOM,t,null)};return t.sanitize=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=null,s=null,l=null,h=null;if(me=!e,me&&(e="\x3c!--\x3e"),"string"!=typeof e&&!De(e)){if("function"!=typeof e.toString)throw Ei("toString is not a function");if("string"!=typeof(e=e.toString()))throw Ei("dirty is not a string, aborting")}if(!t.isSupported)return e;if(X||Te(r),t.removed=[],"string"==typeof e&&(ae=!1),ae){if(e.nodeName){let t=Ce(e.nodeName);if(!D[t]||H[t])throw Ei("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof o)n=ke("\x3c!----\x3e"),s=n.ownerDocument.importNode(e,!0),s.nodeType===$i.element&&"BODY"===s.nodeName||"HTML"===s.nodeName?n=s:n.appendChild(s);else{if(!J&&!Z&&!$&&-1===e.indexOf("<"))return v&&te?v.createHTML(e):e;if(n=ke(e),!n)return J?null:te?w:""}n&&Y&&Le(n.firstChild);let A=Ue(ae?e:n);for(;l=A.nextNode();)Oe(l),He(l),l.content instanceof a&&je(l.content);if(ae)return e;if(J){if(ee)for(h=B.call(n.ownerDocument);n.firstChild;)h.appendChild(n.firstChild);else h=n;return(O.shadowroot||O.shadowrootmode)&&(h=S.call(i,h,!0)),h}let u=$?n.outerHTML:n.innerHTML;return $&&D["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&Si(qi,n.ownerDocument.doctype.name)&&(u="<!DOCTYPE "+n.ownerDocument.doctype.name+">\n"+u),Z&&pi([I,T,F],(e=>{u=bi(u,e," ")})),v&&te?v.createHTML(u):u},t.setConfig=function(){Te(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),X=!0},t.clearConfig=function(){Se=null,X=!1},t.isValidAttribute=function(e,t,r){Se||Te({});let i=Ce(e),n=Ce(t);return Qe(i,n,r)},t.addHook=function(e,t){"function"==typeof t&&mi(E[e],t)},t.removeHook=function(e,t){if(void 0!==t){let r=fi(E[e],t);return-1===r?void 0:yi(E[e],r,1)[0]}return gi(E[e])},t.removeHooks=function(e){E[e]=[]},t.removeAllHooks=function(){E=Ji()},t}l(Xr,{default:()=>en});var ni,ai,si,oi,li,hi,Ai,ui,ci,di,pi,fi,gi,mi,yi,_i,vi,wi,bi,xi,Bi,Ci,Si,Ei,Ii,Ti,Fi,Pi,Li,Mi,ki,Ui,Ri,Di,Ni,Oi,Qi,zi,Hi,ji,Vi,Gi,Ki,qi,Zi,Wi,$i,Xi,Yi,Ji,en,tn=s((()=>{var e;({entries:ni,setPrototypeOf:ai,isFrozen:si,getPrototypeOf:oi,getOwnPropertyDescriptor:li}=Object),({freeze:hi,seal:Ai,create:ui}=Object),({apply:ci,construct:di}=typeof Reflect<"u"&&Reflect),hi||(hi=function(e){return e}),Ai||(Ai=function(e){return e}),ci||(ci=function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];return e.apply(t,i)}),di||(di=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];return new e(...r)}),pi=Yr(Array.prototype.forEach),fi=Yr(Array.prototype.lastIndexOf),gi=Yr(Array.prototype.pop),mi=Yr(Array.prototype.push),yi=Yr(Array.prototype.splice),_i=Yr(String.prototype.toLowerCase),vi=Yr(String.prototype.toString),wi=Yr(String.prototype.match),bi=Yr(String.prototype.replace),xi=Yr(String.prototype.indexOf),Bi=Yr(String.prototype.trim),Ci=Yr(Object.prototype.hasOwnProperty),Si=Yr(RegExp.prototype.test),e=TypeError,Ei=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return di(e,r)},Ii=hi(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ti=hi(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","slot","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Fi=hi(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Pi=hi(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Li=hi(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Mi=hi(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ki=hi(["#text"]),Ui=hi(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ri=hi(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Di=hi(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ni=hi(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Oi=Ai(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Qi=Ai(/<%[\w\W]*|[\w\W]*%>/gm),zi=Ai(/\$\{[\w\W]*/gm),Hi=Ai(/^data-[\-\w.\u00B7-\uFFFF]+$/),ji=Ai(/^aria-[\-\w]+$/),Vi=Ai(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gi=Ai(/^(?:\w+script|data):/i),Ki=Ai(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qi=Ai(/^html$/i),Zi=Ai(/^[a-z][.\w]*(-[.\w]+)+$/i),Wi=Object.freeze({__proto__:null,ARIA_ATTR:ji,ATTR_WHITESPACE:Ki,CUSTOM_ELEMENT:Zi,DATA_ATTR:Hi,DOCTYPE_NAME:qi,ERB_EXPR:Qi,IS_ALLOWED_URI:Vi,IS_SCRIPT_OR_DATA:Gi,MUSTACHE_EXPR:Oi,TMPLIT_EXPR:zi}),$i={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xi=function(){return typeof window>"u"?null:window},Yi=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let r=null,i="data-tt-policy-suffix";t&&t.hasAttribute(i)&&(r=t.getAttribute(i));let n="dompurify"+(r?"#"+r:"");try{return e.createPolicy(n,{createHTML:e=>e,createScriptURL:e=>e})}catch{return console.warn("TrustedTypes policy "+n+" could not be created."),null}},Ji=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},en=ii()})),rn=o(((e,t)=>{"use strict";var r=function(e){return e&&e.Math===Math&&e};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof global&&global)||r("object"==typeof e&&e)||function(){return this}()||Function("return this")()})),nn=o(((e,t)=>{"use strict";t.exports=function(e){try{return!!e()}catch{return!0}}})),an=o(((e,t)=>{"use strict";var r=nn();t.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))})),sn=o(((e,t)=>{"use strict";var r=nn();t.exports=!r((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))})),on=o(((e,t)=>{"use strict";var r=sn(),i=Function.prototype.call;t.exports=r?i.bind(i):function(){return i.apply(i,arguments)}})),ln=o((e=>{"use strict";var t={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,i=r&&!t.call({1:2},1);e.f=i?function(e){var t=r(this,e);return!!t&&t.enumerable}:t})),hn=o(((e,t)=>{"use strict";t.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}})),An=o(((e,t)=>{"use strict";var r=sn(),i=Function.prototype,n=i.call,a=r&&i.bind.bind(n,n);t.exports=r?a:function(e){return function(){return n.apply(e,arguments)}}})),un=o(((e,t)=>{"use strict";var r=An(),i=r({}.toString),n=r("".slice);t.exports=function(e){return n(i(e),8,-1)}})),cn=o(((e,t)=>{"use strict";var r=An(),i=nn(),n=un(),a=Object,s=r("".split);t.exports=i((function(){return!a("z").propertyIsEnumerable(0)}))?function(e){return"String"===n(e)?s(e,""):a(e)}:a})),dn=o(((e,t)=>{"use strict";t.exports=function(e){return null==e}})),pn=o(((e,t)=>{"use strict";var r=dn(),i=TypeError;t.exports=function(e){if(r(e))throw new i("Can't call method on "+e);return e}})),fn=o(((e,t)=>{"use strict";var r=cn(),i=pn();t.exports=function(e){return r(i(e))}})),gn=o(((e,t)=>{"use strict";var r="object"==typeof document&&document.all;t.exports=typeof r>"u"&&void 0!==r?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}})),mn=o(((e,t)=>{"use strict";var r=gn();t.exports=function(e){return"object"==typeof e?null!==e:r(e)}})),yn=o(((e,t)=>{"use strict";var r=rn(),i=gn();t.exports=function(e,t){return arguments.length<2?function(e){return i(e)?e:void 0}(r[e]):r[e]&&r[e][t]}})),_n=o(((e,t)=>{"use strict";var r=An();t.exports=r({}.isPrototypeOf)})),vn=o(((e,t)=>{"use strict";var r=rn().navigator,i=r&&r.userAgent;t.exports=i?String(i):""})),wn=o(((e,t)=>{"use strict";var r,i,n=rn(),a=vn(),s=n.process,o=n.Deno,l=s&&s.versions||o&&o.version,h=l&&l.v8;h&&(i=(r=h.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&a&&((!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&((r=a.match(/Chrome\/(\d+)/))&&(i=+r[1]))),t.exports=i})),bn=o(((e,t)=>{"use strict";var r=wn(),i=nn(),n=rn().String;t.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!n(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41}))})),xn=o(((e,t)=>{"use strict";var r=bn();t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator})),Bn=o(((e,t)=>{"use strict";var r=yn(),i=gn(),n=_n(),a=xn(),s=Object;t.exports=a?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return i(t)&&n(t.prototype,s(e))}})),Cn=o(((e,t)=>{"use strict";var r=String;t.exports=function(e){try{return r(e)}catch{return"Object"}}})),Sn=o(((e,t)=>{"use strict";var r=gn(),i=Cn(),n=TypeError;t.exports=function(e){if(r(e))return e;throw new n(i(e)+" is not a function")}})),En=o(((e,t)=>{"use strict";var r=Sn(),i=dn();t.exports=function(e,t){var n=e[t];return i(n)?void 0:r(n)}})),In=o(((e,t)=>{"use strict";var r=on(),i=gn(),n=mn(),a=TypeError;t.exports=function(e,t){var s,o;if("string"===t&&i(s=e.toString)&&!n(o=r(s,e))||i(s=e.valueOf)&&!n(o=r(s,e))||"string"!==t&&i(s=e.toString)&&!n(o=r(s,e)))return o;throw new a("Can't convert object to primitive value")}})),Tn=o(((e,t)=>{"use strict";t.exports=!1})),Fn=o(((e,t)=>{"use strict";var r=rn(),i=Object.defineProperty;t.exports=function(e,t){try{i(r,e,{value:t,configurable:!0,writable:!0})}catch{r[e]=t}return t}})),Pn=o(((e,t)=>{"use strict";var r=Tn(),i=rn(),n=Fn(),a="__core-js_shared__",s=t.exports=i[a]||n(a,{});(s.versions||(s.versions=[])).push({version:"3.45.1",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.45.1/LICENSE",source:"https://github.com/zloirock/core-js"})})),Ln=o(((e,t)=>{"use strict";var r=Pn();t.exports=function(e,t){return r[e]||(r[e]=t||{})}})),Mn=o(((e,t)=>{"use strict";var r=pn(),i=Object;t.exports=function(e){return i(r(e))}})),kn=o(((e,t)=>{"use strict";var r=An(),i=Mn(),n=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(e,t){return n(i(e),t)}})),Un=o(((e,t)=>{"use strict";var r=An(),i=0,n=Math.random(),a=r(1.1.toString);t.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+a(++i+n,36)}})),Rn=o(((e,t)=>{"use strict";var r=rn(),i=Ln(),n=kn(),a=Un(),s=bn(),o=xn(),l=r.Symbol,h=i("wks"),A=o?l.for||l:l&&l.withoutSetter||a;t.exports=function(e){return n(h,e)||(h[e]=s&&n(l,e)?l[e]:A("Symbol."+e)),h[e]}})),Dn=o(((e,t)=>{"use strict";var r=on(),i=mn(),n=Bn(),a=En(),s=In(),o=Rn(),l=TypeError,h=o("toPrimitive");t.exports=function(e,t){if(!i(e)||n(e))return e;var o,A=a(e,h);if(A){if(void 0===t&&(t="default"),o=r(A,e,t),!i(o)||n(o))return o;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}})),Nn=o(((e,t)=>{"use strict";var r=Dn(),i=Bn();t.exports=function(e){var t=r(e,"string");return i(t)?t:t+""}})),On=o(((e,t)=>{"use strict";var r=rn(),i=mn(),n=r.document,a=i(n)&&i(n.createElement);t.exports=function(e){return a?n.createElement(e):{}}})),Qn=o(((e,t)=>{"use strict";var r=an(),i=nn(),n=On();t.exports=!r&&!i((function(){return 7!==Object.defineProperty(n("div"),"a",{get:function(){return 7}}).a}))})),zn=o((e=>{"use strict";var t=an(),r=on(),i=ln(),n=hn(),a=fn(),s=Nn(),o=kn(),l=Qn(),h=Object.getOwnPropertyDescriptor;e.f=t?h:function(e,t){if(e=a(e),t=s(t),l)try{return h(e,t)}catch{}if(o(e,t))return n(!r(i.f,e,t),e[t])}})),Hn=o(((e,t)=>{"use strict";var r=an(),i=nn();t.exports=r&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))})),jn=o(((e,t)=>{"use strict";var r=mn(),i=String,n=TypeError;t.exports=function(e){if(r(e))return e;throw new n(i(e)+" is not an object")}})),Vn=o((e=>{"use strict";var t=an(),r=Qn(),i=Hn(),n=jn(),a=Nn(),s=TypeError,o=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",A="configurable",u="writable";e.f=t?i?function(e,t,r){if(n(e),t=a(t),n(r),"function"==typeof e&&"prototype"===t&&"value"in r&&u in r&&!r[u]){var i=l(e,t);i&&i[u]&&(e[t]=r.value,r={configurable:A in r?r[A]:i[A],enumerable:h in r?r[h]:i[h],writable:!1})}return o(e,t,r)}:o:function(e,t,i){if(n(e),t=a(t),n(i),r)try{return o(e,t,i)}catch{}if("get"in i||"set"in i)throw new s("Accessors not supported");return"value"in i&&(e[t]=i.value),e}})),Gn=o(((e,t)=>{"use strict";var r=an(),i=Vn(),n=hn();t.exports=r?function(e,t,r){return i.f(e,t,n(1,r))}:function(e,t,r){return e[t]=r,e}})),Kn=o(((e,t)=>{"use strict";var r=an(),i=kn(),n=Function.prototype,a=r&&Object.getOwnPropertyDescriptor,s=i(n,"name"),o=s&&"something"===function(){}.name,l=s&&(!r||r&&a(n,"name").configurable);t.exports={EXISTS:s,PROPER:o,CONFIGURABLE:l}})),qn=o(((e,t)=>{"use strict";var r=An(),i=gn(),n=Pn(),a=r(Function.toString);i(n.inspectSource)||(n.inspectSource=function(e){return a(e)}),t.exports=n.inspectSource})),Zn=o(((e,t)=>{"use strict";var r=rn(),i=gn(),n=r.WeakMap;t.exports=i(n)&&/native code/.test(String(n))})),Wn=o(((e,t)=>{"use strict";var r=Ln(),i=Un(),n=r("keys");t.exports=function(e){return n[e]||(n[e]=i(e))}})),$n=o(((e,t)=>{"use strict";t.exports={}})),Xn=o(((e,t)=>{"use strict";var r,i,n,a,s,o=Zn(),l=rn(),h=mn(),A=Gn(),u=kn(),c=Pn(),d=Wn(),p=$n(),f="Object already initialized",g=l.TypeError,m=l.WeakMap;o||c.state?((a=c.state||(c.state=new m)).get=a.get,a.has=a.has,a.set=a.set,r=function(e,t){if(a.has(e))throw new g(f);return t.facade=e,a.set(e,t),t},i=function(e){return a.get(e)||{}},n=function(e){return a.has(e)}):(p[s=d("state")]=!0,r=function(e,t){if(u(e,s))throw new g(f);return t.facade=e,A(e,s,t),t},i=function(e){return u(e,s)?e[s]:{}},n=function(e){return u(e,s)}),t.exports={set:r,get:i,has:n,enforce:function(e){return n(e)?i(e):r(e,{})},getterFor:function(e){return function(t){var r;if(!h(t)||(r=i(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return r}}}})),Yn=o(((e,t)=>{"use strict";var r=An(),i=nn(),n=gn(),a=kn(),s=an(),o=Kn().CONFIGURABLE,l=qn(),h=Xn(),A=h.enforce,u=h.get,c=String,d=Object.defineProperty,p=r("".slice),f=r("".replace),g=r([].join),m=s&&!i((function(){return 8!==d((function(){}),"length",{value:8}).length})),y=String(String).split("String"),_=t.exports=function(e,t,r){"Symbol("===p(c(t),0,7)&&(t="["+f(c(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!a(e,"name")||o&&e.name!==t)&&(s?d(e,"name",{value:t,configurable:!0}):e.name=t),m&&r&&a(r,"arity")&&e.length!==r.arity&&d(e,"length",{value:r.arity});try{r&&a(r,"constructor")&&r.constructor?s&&d(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch{}var i=A(e);return a(i,"source")||(i.source=g(y,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return n(this)&&u(this).source||l(this)}),"toString")})),Jn=o(((e,t)=>{"use strict";var r=gn(),i=Vn(),n=Yn(),a=Fn();t.exports=function(e,t,s,o){o||(o={});var l=o.enumerable,h=void 0!==o.name?o.name:t;if(r(s)&&n(s,h,o),o.global)l?e[t]=s:a(t,s);else{try{o.unsafe?e[t]&&(l=!0):delete e[t]}catch{}l?e[t]=s:i.f(e,t,{value:s,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return e}})),ea=o(((e,t)=>{"use strict";var r=Math.ceil,i=Math.floor;t.exports=Math.trunc||function(e){var t=+e;return(t>0?i:r)(t)}})),ta=o(((e,t)=>{"use strict";var r=ea();t.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}})),ra=o(((e,t)=>{"use strict";var r=ta(),i=Math.max,n=Math.min;t.exports=function(e,t){var a=r(e);return a<0?i(a+t,0):n(a,t)}})),ia=o(((e,t)=>{"use strict";var r=ta(),i=Math.min;t.exports=function(e){var t=r(e);return t>0?i(t,9007199254740991):0}})),na=o(((e,t)=>{"use strict";var r=ia();t.exports=function(e){return r(e.length)}})),aa=o(((e,t)=>{"use strict";var r=fn(),i=ra(),n=na(),a=function(e){return function(t,a,s){var o=r(t),l=n(o);if(0===l)return!e&&-1;var h,A=i(s,l);if(e&&a!=a){for(;l>A;)if((h=o[A++])!=h)return!0}else for(;l>A;A++)if((e||A in o)&&o[A]===a)return e||A||0;return!e&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}})),sa=o(((e,t)=>{"use strict";var r=An(),i=kn(),n=fn(),a=aa().indexOf,s=$n(),o=r([].push);t.exports=function(e,t){var r,l=n(e),h=0,A=[];for(r in l)!i(s,r)&&i(l,r)&&o(A,r);for(;t.length>h;)i(l,r=t[h++])&&(~a(A,r)||o(A,r));return A}})),oa=o(((e,t)=>{"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]})),la=o((e=>{"use strict";var t=sa(),r=oa().concat("length","prototype");e.f=Object.getOwnPropertyNames||function(e){return t(e,r)}})),ha=o((e=>{"use strict";e.f=Object.getOwnPropertySymbols})),Aa=o(((e,t)=>{"use strict";var r=yn(),i=An(),n=la(),a=ha(),s=jn(),o=i([].concat);t.exports=r("Reflect","ownKeys")||function(e){var t=n.f(s(e)),r=a.f;return r?o(t,r(e)):t}})),ua=o(((e,t)=>{"use strict";var r=kn(),i=Aa(),n=zn(),a=Vn();t.exports=function(e,t,s){for(var o=i(t),l=a.f,h=n.f,A=0;A<o.length;A++){var u=o[A];!r(e,u)&&(!s||!r(s,u))&&l(e,u,h(t,u))}}})),ca=o(((e,t)=>{"use strict";var r=nn(),i=gn(),n=/#|\.prototype\./,a=function(e,t){var n=o[s(e)];return n===h||n!==l&&(i(t)?r(t):!!t)},s=a.normalize=function(e){return String(e).replace(n,".").toLowerCase()},o=a.data={},l=a.NATIVE="N",h=a.POLYFILL="P";t.exports=a})),da=o(((e,t)=>{"use strict";var r=rn(),i=zn().f,n=Gn(),a=Jn(),s=Fn(),o=ua(),l=ca();t.exports=function(e,t){var h,A,u,c,d,p=e.target,f=e.global,g=e.stat;if(h=f?r:g?r[p]||s(p,{}):r[p]&&r[p].prototype)for(A in t){if(c=t[A],e.dontCallGetSet?u=(d=i(h,A))&&d.value:u=h[A],!l(f?A:p+(g?".":"#")+A,e.forced)&&void 0!==u){if(typeof c==typeof u)continue;o(c,u)}(e.sham||u&&u.sham)&&n(c,"sham",!0),a(h,A,c,e)}}})),pa=o(((e,t)=>{"use strict";var r=rn(),i=vn(),n=un(),a=function(e){return i.slice(0,e.length)===e};t.exports=a("Bun/")?"BUN":a("Cloudflare-Workers")?"CLOUDFLARE":a("Deno/")?"DENO":a("Node.js/")?"NODE":r.Bun&&"string"==typeof Bun.version?"BUN":r.Deno&&"object"==typeof Deno.version?"DENO":"process"===n(r.process)?"NODE":r.window&&r.document?"BROWSER":"REST"})),fa=o(((e,t)=>{"use strict";var r=pa();t.exports="NODE"===r})),ga=o(((e,t)=>{"use strict";var r=rn();t.exports=r})),ma=o(((e,t)=>{"use strict";var r=An(),i=Sn();t.exports=function(e,t,n){try{return r(i(Object.getOwnPropertyDescriptor(e,t)[n]))}catch{}}})),ya=o(((e,t)=>{"use strict";var r=mn();t.exports=function(e){return r(e)||null===e}})),_a=o(((e,t)=>{"use strict";var r=ya(),i=String,n=TypeError;t.exports=function(e){if(r(e))return e;throw new n("Can't set "+i(e)+" as a prototype")}})),va=o(((e,t)=>{"use strict";var r=ma(),i=mn(),n=pn(),a=_a();t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,s={};try{(e=r(Object.prototype,"__proto__","set"))(s,[]),t=s instanceof Array}catch{}return function(r,s){return n(r),a(s),i(r)&&(t?e(r,s):r.__proto__=s),r}}():void 0)})),wa=o(((e,t)=>{"use strict";var r=Vn().f,i=kn(),n=Rn()("toStringTag");t.exports=function(e,t,a){e&&!a&&(e=e.prototype),e&&!i(e,n)&&r(e,n,{configurable:!0,value:t})}})),ba=o(((e,t)=>{"use strict";var r=Yn(),i=Vn();t.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),i.f(e,t,n)}})),xa=o(((e,t)=>{"use strict";var r=yn(),i=ba(),n=Rn(),a=an(),s=n("species");t.exports=function(e){var t=r(e);a&&t&&!t[s]&&i(t,s,{configurable:!0,get:function(){return this}})}})),Ba=o(((e,t)=>{"use strict";var r=_n(),i=TypeError;t.exports=function(e,t){if(r(t,e))return e;throw new i("Incorrect invocation")}})),Ca=o(((e,t)=>{"use strict";var r={};r[Rn()("toStringTag")]="z",t.exports="[object z]"===String(r)})),Sa=o(((e,t)=>{"use strict";var r=Ca(),i=gn(),n=un(),a=Rn()("toStringTag"),s=Object,o="Arguments"===n(function(){return arguments}());t.exports=r?n:function(e){var t,r,l;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=function(e,t){try{return e[t]}catch{}}(t=s(e),a))?r:o?n(t):"Object"===(l=n(t))&&i(t.callee)?"Arguments":l}})),Ea=o(((e,t)=>{"use strict";var r=An(),i=nn(),n=gn(),a=Sa(),s=yn(),o=qn(),l=function(){},h=s("Reflect","construct"),A=/^\s*(?:class|function)\b/,u=r(A.exec),c=!A.test(l),d=function(e){if(!n(e))return!1;try{return h(l,[],e),!0}catch{return!1}},p=function(e){if(!n(e))return!1;switch(a(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return c||!!u(A,o(e))}catch{return!0}};p.sham=!0,t.exports=!h||i((function(){var e;return d(d.call)||!d(Object)||!d((function(){e=!0}))||e}))?p:d})),Ia=o(((e,t)=>{"use strict";var r=Ea(),i=Cn(),n=TypeError;t.exports=function(e){if(r(e))return e;throw new n(i(e)+" is not a constructor")}})),Ta=o(((e,t)=>{"use strict";var r=jn(),i=Ia(),n=dn(),a=Rn()("species");t.exports=function(e,t){var s,o=r(e).constructor;return void 0===o||n(s=r(o)[a])?t:i(s)}})),Fa=o(((e,t)=>{"use strict";var r=sn(),i=Function.prototype,n=i.apply,a=i.call;t.exports="object"==typeof Reflect&&Reflect.apply||(r?a.bind(n):function(){return a.apply(n,arguments)})})),Pa=o(((e,t)=>{"use strict";var r=un(),i=An();t.exports=function(e){if("Function"===r(e))return i(e)}})),La=o(((e,t)=>{"use strict";var r=Pa(),i=Sn(),n=sn(),a=r(r.bind);t.exports=function(e,t){return i(e),void 0===t?e:n?a(e,t):function(){return e.apply(t,arguments)}}})),Ma=o(((e,t)=>{"use strict";var r=yn();t.exports=r("document","documentElement")})),ka=o(((e,t)=>{"use strict";var r=An();t.exports=r([].slice)})),Ua=o(((e,t)=>{"use strict";var r=TypeError;t.exports=function(e,t){if(e<t)throw new r("Not enough arguments");return e}})),Ra=o(((e,t)=>{"use strict";var r=vn();t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)})),Da=o(((e,t)=>{"use strict";var r,i,n,a,s=rn(),o=Fa(),l=La(),h=gn(),A=kn(),u=nn(),c=Ma(),d=ka(),p=On(),f=Ua(),g=Ra(),m=fa(),y=s.setImmediate,_=s.clearImmediate,v=s.process,w=s.Dispatch,b=s.Function,x=s.MessageChannel,B=s.String,C=0,S={},E="onreadystatechange";u((function(){r=s.location}));var I=function(e){if(A(S,e)){var t=S[e];delete S[e],t()}},T=function(e){return function(){I(e)}},F=function(e){I(e.data)},P=function(e){s.postMessage(B(e),r.protocol+"//"+r.host)};(!y||!_)&&(y=function(e){f(arguments.length,1);var t=h(e)?e:b(e),r=d(arguments,1);return S[++C]=function(){o(t,void 0,r)},i(C),C},_=function(e){delete S[e]},m?i=function(e){v.nextTick(T(e))}:w&&w.now?i=function(e){w.now(T(e))}:x&&!g?(a=(n=new x).port2,n.port1.onmessage=F,i=l(a.postMessage,a)):s.addEventListener&&h(s.postMessage)&&!s.importScripts&&r&&"file:"!==r.protocol&&!u(P)?(i=P,s.addEventListener("message",F,!1)):i=E in p("script")?function(e){c.appendChild(p("script"))[E]=function(){c.removeChild(this),I(e)}}:function(e){setTimeout(T(e),0)}),t.exports={set:y,clear:_}})),Na=o(((e,t)=>{"use strict";var r=rn(),i=an(),n=Object.getOwnPropertyDescriptor;t.exports=function(e){if(!i)return r[e];var t=n(r,e);return t&&t.value}})),Oa=o(((e,t)=>{"use strict";var r=function(){this.head=null,this.tail=null};r.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}},t.exports=r})),Qa=o(((e,t)=>{"use strict";var r=vn();t.exports=/ipad|iphone|ipod/i.test(r)&&typeof Pebble<"u"})),za=o(((e,t)=>{"use strict";var r=vn();t.exports=/web0s(?!.*chrome)/i.test(r)})),Ha=o(((e,t)=>{"use strict";var r,i,n,a,s,o,l,h=rn(),A=Na(),u=La(),c=Da().set,d=Oa(),p=Ra(),f=Qa(),g=za(),m=fa(),y=h.MutationObserver||h.WebKitMutationObserver,_=h.document,v=h.process,w=h.Promise,b=A("queueMicrotask");b||(o=new d,l=function(){var e,t;for(m&&(e=v.domain)&&e.exit();t=o.get();)try{t()}catch(e){throw o.head&&r(),e}e&&e.enter()},p||m||g||!y||!_?!f&&w&&w.resolve?((a=w.resolve(void 0)).constructor=w,s=u(a.then,a),r=function(){s(l)}):m?r=function(){v.nextTick(l)}:(c=u(c,h),r=function(){c(l)}):(i=!0,n=_.createTextNode(""),new y(l).observe(n,{characterData:!0}),r=function(){n.data=i=!i}),b=function(e){o.head||r(),o.add(e)}),t.exports=b})),ja=o(((e,t)=>{"use strict";t.exports=function(e,t){try{1===arguments.length?console.error(e):console.error(e,t)}catch{}}})),Va=o(((e,t)=>{"use strict";t.exports=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}}})),Ga=o(((e,t)=>{"use strict";var r=rn();t.exports=r.Promise})),Ka=o(((e,t)=>{"use strict";var r=rn(),i=Ga(),n=gn(),a=ca(),s=qn(),o=Rn(),l=pa(),h=Tn(),A=wn(),u=i&&i.prototype,c=o("species"),d=!1,p=n(r.PromiseRejectionEvent),f=a("Promise",(function(){var e=s(i),t=e!==String(i);if(!t&&66===A||h&&(!u.catch||!u.finally))return!0;if(!A||A<51||!/native code/.test(e)){var r=new i((function(e){e(1)})),n=function(e){e((function(){}),(function(){}))};if((r.constructor={})[c]=n,!(d=r.then((function(){}))instanceof n))return!0}return!(t||"BROWSER"!==l&&"DENO"!==l||p)}));t.exports={CONSTRUCTOR:f,REJECTION_EVENT:p,SUBCLASSING:d}})),qa=o(((e,t)=>{"use strict";var r=Sn(),i=TypeError,n=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw new i("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};t.exports.f=function(e){return new n(e)}})),Za=o((()=>{"use strict";var e,t,r,i,n=da(),a=Tn(),s=fa(),o=rn(),l=ga(),h=on(),A=Jn(),u=va(),c=wa(),d=xa(),p=Sn(),f=gn(),g=mn(),m=Ba(),y=Ta(),_=Da().set,v=Ha(),w=ja(),b=Va(),x=Oa(),B=Xn(),C=Ga(),S=Ka(),E=qa(),I="Promise",T=S.CONSTRUCTOR,F=S.REJECTION_EVENT,P=S.SUBCLASSING,L=B.getterFor(I),M=B.set,k=C&&C.prototype,U=C,R=k,D=o.TypeError,N=o.document,O=o.process,Q=E.f,z=Q,H=!!(N&&N.createEvent&&o.dispatchEvent),j="unhandledrejection",V=function(e){var t;return!(!g(e)||!f(t=e.then))&&t},G=function(e,t){var r,i,n,a=t.value,s=1===t.state,o=s?e.ok:e.fail,l=e.resolve,A=e.reject,u=e.domain;try{o?(s||(2===t.rejection&&$(t),t.rejection=1),!0===o?r=a:(u&&u.enter(),r=o(a),u&&(u.exit(),n=!0)),r===e.promise?A(new D("Promise-chain cycle")):(i=V(r))?h(i,r,l,A):l(r)):A(a)}catch(e){u&&!n&&u.exit(),A(e)}},K=function(e,t){e.notified||(e.notified=!0,v((function(){for(var r,i=e.reactions;r=i.get();)G(r,e);e.notified=!1,t&&!e.rejection&&Z(e)})))},q=function(e,t,r){var i,n;H?((i=N.createEvent("Event")).promise=t,i.reason=r,i.initEvent(e,!1,!0),o.dispatchEvent(i)):i={promise:t,reason:r},!F&&(n=o["on"+e])?n(i):e===j&&w("Unhandled promise rejection",r)},Z=function(e){h(_,o,(function(){var t,r=e.facade,i=e.value;if(W(e)&&(t=b((function(){s?O.emit("unhandledRejection",i,r):q(j,r,i)})),e.rejection=s||W(e)?2:1,t.error))throw t.value}))},W=function(e){return 1!==e.rejection&&!e.parent},$=function(e){h(_,o,(function(){var t=e.facade;s?O.emit("rejectionHandled",t):q("rejectionhandled",t,e.value)}))},X=function(e,t,r){return function(i){e(t,i,r)}},Y=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=2,K(e,!0))},J=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new D("Promise can't be resolved itself");var i=V(t);i?v((function(){var r={done:!1};try{h(i,t,X(J,r,e),X(Y,r,e))}catch(t){Y(r,t,e)}})):(e.value=t,e.state=1,K(e,!1))}catch(t){Y({done:!1},t,e)}}};if(T&&(R=(U=function(t){m(this,R),p(t),h(e,this);var r=L(this);try{t(X(J,r),X(Y,r))}catch(e){Y(r,e)}}).prototype,(e=function(e){M(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new x,rejection:!1,state:0,value:null})}).prototype=A(R,"then",(function(e,t){var r=L(this),i=Q(y(this,U));return r.parent=!0,i.ok=!f(e)||e,i.fail=f(t)&&t,i.domain=s?O.domain:void 0,0===r.state?r.reactions.add(i):v((function(){G(i,r)})),i.promise})),t=function(){var t=new e,r=L(t);this.promise=t,this.resolve=X(J,r),this.reject=X(Y,r)},E.f=Q=function(e){return e===U||e===r?new t(e):z(e)},!a&&f(C)&&k!==Object.prototype)){i=k.then,P||A(k,"then",(function(e,t){var r=this;return new U((function(e,t){h(i,r,e,t)})).then(e,t)}),{unsafe:!0});try{delete k.constructor}catch{}u&&u(k,R)}n({global:!0,constructor:!0,wrap:!0,forced:T},{Promise:U}),r=l.Promise,c(U,I,!1,!0),d(I)})),Wa=o(((e,t)=>{"use strict";t.exports={}})),$a=o(((e,t)=>{"use strict";var r=Rn(),i=Wa(),n=r("iterator"),a=Array.prototype;t.exports=function(e){return void 0!==e&&(i.Array===e||a[n]===e)}})),Xa=o(((e,t)=>{"use strict";var r=Sa(),i=En(),n=dn(),a=Wa(),s=Rn()("iterator");t.exports=function(e){if(!n(e))return i(e,s)||i(e,"@@iterator")||a[r(e)]}})),Ya=o(((e,t)=>{"use strict";var r=on(),i=Sn(),n=jn(),a=Cn(),s=Xa(),o=TypeError;t.exports=function(e,t){var l=arguments.length<2?s(e):t;if(i(l))return n(r(l,e));throw new o(a(e)+" is not iterable")}})),Ja=o(((e,t)=>{"use strict";var r=on(),i=jn(),n=En();t.exports=function(e,t,a){var s,o;i(e);try{if(!(s=n(e,"return"))){if("throw"===t)throw a;return a}s=r(s,e)}catch(e){o=!0,s=e}if("throw"===t)throw a;if(o)throw s;return i(s),a}})),es=o(((e,t)=>{"use strict";var r=La(),i=on(),n=jn(),a=Cn(),s=$a(),o=na(),l=_n(),h=Ya(),A=Xa(),u=Ja(),c=TypeError,d=function(e,t){this.stopped=e,this.result=t},p=d.prototype;t.exports=function(e,t,f){var g,m,y,_,v,w,b,x=f&&f.that,B=!(!f||!f.AS_ENTRIES),C=!(!f||!f.IS_RECORD),S=!(!f||!f.IS_ITERATOR),E=!(!f||!f.INTERRUPTED),I=r(t,x),T=function(e){return g&&u(g,"normal"),new d(!0,e)},F=function(e){return B?(n(e),E?I(e[0],e[1],T):I(e[0],e[1])):E?I(e,T):I(e)};if(C)g=e.iterator;else if(S)g=e;else{if(!(m=A(e)))throw new c(a(e)+" is not iterable");if(s(m)){for(y=0,_=o(e);_>y;y++)if((v=F(e[y]))&&l(p,v))return v;return new d(!1)}g=h(e,m)}for(w=C?e.next:g.next;!(b=i(w,g)).done;){try{v=F(b.value)}catch(e){u(g,"throw",e)}if("object"==typeof v&&v&&l(p,v))return v}return new d(!1)}})),ts=o(((e,t)=>{"use strict";var r,i,n=Rn()("iterator"),a=!1;try{r=0,(i={next:function(){return{done:!!r++}},return:function(){a=!0}})[n]=function(){return this},Array.from(i,(function(){throw 2}))}catch{}t.exports=function(e,t){try{if(!t&&!a)return!1}catch{return!1}var r=!1;try{var i={};i[n]=function(){return{next:function(){return{done:r=!0}}}},e(i)}catch{}return r}})),rs=o(((e,t)=>{"use strict";var r=Ga(),i=ts(),n=Ka().CONSTRUCTOR;t.exports=n||!i((function(e){r.all(e).then(void 0,(function(){}))}))})),is=o((()=>{"use strict";var e=da(),t=on(),r=Sn(),i=qa(),n=Va(),a=es();e({target:"Promise",stat:!0,forced:rs()},{all:function(e){var s=this,o=i.f(s),l=o.resolve,h=o.reject,A=n((function(){var i=r(s.resolve),n=[],o=0,A=1;a(e,(function(e){var r=o++,a=!1;A++,t(i,s,e).then((function(e){a||(a=!0,n[r]=e,--A||l(n))}),h)})),--A||l(n)}));return A.error&&h(A.value),o.promise}})})),ns=o((()=>{"use strict";var e,t=da(),r=Tn(),i=Ka().CONSTRUCTOR,n=Ga(),a=yn(),s=gn(),o=Jn(),l=n&&n.prototype;t({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(e){return this.then(void 0,e)}}),!r&&s(n)&&(e=a("Promise").prototype.catch,l.catch!==e&&o(l,"catch",e,{unsafe:!0}))})),as=o((()=>{"use strict";var e=da(),t=on(),r=Sn(),i=qa(),n=Va(),a=es();e({target:"Promise",stat:!0,forced:rs()},{race:function(e){var s=this,o=i.f(s),l=o.reject,h=n((function(){var i=r(s.resolve);a(e,(function(e){t(i,s,e).then(o.resolve,l)}))}));return h.error&&l(h.value),o.promise}})})),ss=o((()=>{"use strict";var e=da(),t=qa();e({target:"Promise",stat:!0,forced:Ka().CONSTRUCTOR},{reject:function(e){var r=t.f(this);return(0,r.reject)(e),r.promise}})})),os=o(((e,t)=>{"use strict";var r=jn(),i=mn(),n=qa();t.exports=function(e,t){if(r(e),i(t)&&t.constructor===e)return t;var a=n.f(e);return(0,a.resolve)(t),a.promise}})),ls=o((()=>{"use strict";var e=da(),t=yn(),r=Tn(),i=Ga(),n=Ka().CONSTRUCTOR,a=os(),s=t("Promise"),o=r&&!n;e({target:"Promise",stat:!0,forced:r||n},{resolve:function(e){return a(o&&this===s?i:this,e)}})})),hs=o((()=>{"use strict";Za(),is(),ns(),as(),ss(),ls()}));function As(e,t,r,i,n,a,s){try{var o=e[a](s),l=o.value}catch(e){return void r(e)}o.done?t(l):Promise.resolve(l).then(i,n)}function us(e){return function(){var t=this,r=arguments;return new Promise((function(i,n){var a=e.apply(t,r);function s(e){As(a,i,n,s,o,"next",e)}function o(e){As(a,i,n,s,o,"throw",e)}s(void 0)}))}}var cs=s((()=>{})),ds=o(((e,t)=>{"use strict";var r=Sa(),i=String;t.exports=function(e){if("Symbol"===r(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}})),ps=o(((e,t)=>{"use strict";var r=jn();t.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}})),fs=o(((e,t)=>{"use strict";var r=nn(),i=rn().RegExp,n=r((function(){var e=i("a","y");return e.lastIndex=2,null!==e.exec("abcd")})),a=n||r((function(){return!i("a","y").sticky})),s=n||r((function(){var e=i("^r","gy");return e.lastIndex=2,null!==e.exec("str")}));t.exports={BROKEN_CARET:s,MISSED_STICKY:a,UNSUPPORTED_Y:n}})),gs=o(((e,t)=>{"use strict";var r=sa(),i=oa();t.exports=Object.keys||function(e){return r(e,i)}})),ms=o((e=>{"use strict";var t=an(),r=Hn(),i=Vn(),n=jn(),a=fn(),s=gs();e.f=t&&!r?Object.defineProperties:function(e,t){n(e);for(var r,o=a(t),l=s(t),h=l.length,A=0;h>A;)i.f(e,r=l[A++],o[r]);return e}})),ys=o(((e,t)=>{"use strict";var r,i=jn(),n=ms(),a=oa(),s=$n(),o=Ma(),l=On(),h=Wn(),A="prototype",u="script",c=h("IE_PROTO"),d=function(){},p=function(e){return"<"+u+">"+e+"</"+u+">"},f=function(e){e.write(p("")),e.close();var t=e.parentWindow.Object;return e=null,t},g=function(){try{r=new ActiveXObject("htmlfile")}catch{}g=typeof document<"u"?document.domain&&r?f(r):function(){var e,t=l("iframe"),r="java"+u+":";return t.style.display="none",o.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(p("document.F=Object")),e.close(),e.F}():f(r);for(var e=a.length;e--;)delete g[A][a[e]];return g()};s[c]=!0,t.exports=Object.create||function(e,t){var r;return null!==e?(d[A]=i(e),r=new d,d[A]=null,r[c]=e):r=g(),void 0===t?r:n.f(r,t)}})),_s=o(((e,t)=>{"use strict";var r=nn(),i=rn().RegExp;t.exports=r((function(){var e=i(".","s");return!(e.dotAll&&e.test("\n")&&"s"===e.flags)}))})),vs=o(((e,t)=>{"use strict";var r=nn(),i=rn().RegExp;t.exports=r((function(){var e=i("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")}))})),ws=o(((e,t)=>{"use strict";var r,i,n=on(),a=An(),s=ds(),o=ps(),l=fs(),h=Ln(),A=ys(),u=Xn().get,c=_s(),d=vs(),p=h("native-string-replace",String.prototype.replace),f=RegExp.prototype.exec,g=f,m=a("".charAt),y=a("".indexOf),_=a("".replace),v=a("".slice),w=(i=/b*/g,n(f,r=/a/,"a"),n(f,i,"a"),0!==r.lastIndex||0!==i.lastIndex),b=l.BROKEN_CARET,x=void 0!==/()??/.exec("")[1];(w||x||b||c||d)&&(g=function(e){var t,r,i,a,l,h,c,d=this,B=u(d),C=s(e),S=B.raw;if(S)return S.lastIndex=d.lastIndex,t=n(g,S,C),d.lastIndex=S.lastIndex,t;var E=B.groups,I=b&&d.sticky,T=n(o,d),F=d.source,P=0,L=C;if(I&&(T=_(T,"y",""),-1===y(T,"g")&&(T+="g"),L=v(C,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&"\n"!==m(C,d.lastIndex-1))&&(F="(?: "+F+")",L=" "+L,P++),r=new RegExp("^(?:"+F+")",T)),x&&(r=new RegExp("^"+F+"$(?!\\s)",T)),w&&(i=d.lastIndex),a=n(f,I?r:d,L),I?a?(a.input=v(a.input,P),a[0]=v(a[0],P),a.index=d.lastIndex,d.lastIndex+=a[0].length):d.lastIndex=0:w&&a&&(d.lastIndex=d.global?a.index+a[0].length:i),x&&a&&a.length>1&&n(p,a[0],r,(function(){for(l=1;l<arguments.length-2;l++)void 0===arguments[l]&&(a[l]=void 0)})),a&&E)for(a.groups=h=A(null),l=0;l<E.length;l++)h[(c=E[l])[0]]=a[c[1]];return a}),t.exports=g})),bs=o((()=>{"use strict";var e=da(),t=ws();e({target:"RegExp",proto:!0,forced:/./.exec!==t},{exec:t})})),xs=o(((e,t)=>{"use strict";bs();var r=on(),i=Jn(),n=ws(),a=nn(),s=Rn(),o=Gn(),l=s("species"),h=RegExp.prototype;t.exports=function(e,t,A,u){var c=s(e),d=!a((function(){var t={};return t[c]=function(){return 7},7!==""[e](t)})),p=d&&!a((function(){var t=!1,r=/a/;return"split"===e&&((r={}).constructor={},r.constructor[l]=function(){return r},r.flags="",r[c]=/./[c]),r.exec=function(){return t=!0,null},r[c](""),!t}));if(!d||!p||A){var f=/./[c],g=t(c,""[e],(function(e,t,i,a,s){var o=t.exec;return o===n||o===h.exec?d&&!s?{done:!0,value:r(f,t,i,a)}:{done:!0,value:r(e,i,t,a)}:{done:!1}}));i(String.prototype,e,g[0]),i(h,c,g[1])}u&&o(h[c],"sham",!0)}})),Bs=o(((e,t)=>{"use strict";var r=An(),i=ta(),n=ds(),a=pn(),s=r("".charAt),o=r("".charCodeAt),l=r("".slice),h=function(e){return function(t,r){var h,A,u=n(a(t)),c=i(r),d=u.length;return c<0||c>=d?e?"":void 0:(h=o(u,c))<55296||h>56319||c+1===d||(A=o(u,c+1))<56320||A>57343?e?s(u,c):h:e?l(u,c,c+2):A-56320+(h-55296<<10)+65536}};t.exports={codeAt:h(!1),charAt:h(!0)}})),Cs=o(((e,t)=>{"use strict";var r=Bs().charAt;t.exports=function(e,t,i){return t+(i?r(e,t).length:1)}})),Ss=o(((e,t)=>{"use strict";var r=rn(),i=nn(),n=r.RegExp,a=!i((function(){var e=!0;try{n(".","d")}catch{e=!1}var t={},r="",i=e?"dgimsy":"gimsy",a=function(e,i){Object.defineProperty(t,e,{get:function(){return r+=i,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var o in e&&(s.hasIndices="d"),s)a(o,s[o]);return Object.getOwnPropertyDescriptor(n.prototype,"flags").get.call(t)!==i||r!==i}));t.exports={correct:a}})),Es=o(((e,t)=>{"use strict";var r=on(),i=kn(),n=_n(),a=Ss(),s=ps(),o=RegExp.prototype;t.exports=a.correct?function(e){return e.flags}:function(e){return a.correct||!n(o,e)||i(e,"flags")?e.flags:r(s,e)}})),Is=o(((e,t)=>{"use strict";var r=on(),i=jn(),n=gn(),a=un(),s=ws(),o=TypeError;t.exports=function(e,t){var l=e.exec;if(n(l)){var h=r(l,e,t);return null!==h&&i(h),h}if("RegExp"===a(e))return r(s,e,t);throw new o("RegExp#exec called on incompatible receiver")}})),Ts=o((()=>{"use strict";var e=on(),t=An(),r=xs(),i=jn(),n=mn(),a=ia(),s=ds(),o=pn(),l=En(),h=Cs(),A=Es(),u=Is(),c=t("".indexOf);r("match",(function(t,r,d){return[function(r){var i=o(this),a=n(r)?l(r,t):void 0;return a?e(a,r,i):new RegExp(r)[t](s(i))},function(e){var t=i(this),n=s(e),o=d(r,t,n);if(o.done)return o.value;var l=s(A(t));if(-1===c(l,"g"))return u(t,n);var p=-1!==c(l,"u");t.lastIndex=0;for(var f,g=[],m=0;null!==(f=u(t,n));){var y=s(f[0]);g[m]=y,""===y&&(t.lastIndex=h(n,a(t.lastIndex),p)),m++}return 0===m?null:g}]}))})),Fs=o(((e,t)=>{"use strict";var r=An(),i=Mn(),n=Math.floor,a=r("".charAt),s=r("".replace),o=r("".slice),l=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,h=/\$([$&'`]|\d{1,2})/g;t.exports=function(e,t,r,A,u,c){var d=r+e.length,p=A.length,f=h;return void 0!==u&&(u=i(u),f=l),s(c,f,(function(i,s){var l;switch(a(s,0)){case"$":return"$";case"&":return e;case"`":return o(t,0,r);case"'":return o(t,d);case"<":l=u[o(s,1,-1)];break;default:var h=+s;if(0===h)return i;if(h>p){var c=n(h/10);return 0===c?i:c<=p?void 0===A[c-1]?a(s,1):A[c-1]+a(s,1):i}l=A[h-1]}return void 0===l?"":l}))}})),Ps=o((()=>{"use strict";var e=Fa(),t=on(),r=An(),i=xs(),n=nn(),a=jn(),s=gn(),o=mn(),l=ta(),h=ia(),A=ds(),u=pn(),c=Cs(),d=En(),p=Fs(),f=Es(),g=Is(),m=Rn()("replace"),y=Math.max,_=Math.min,v=r([].concat),w=r([].push),b=r("".indexOf),x=r("".slice),B=function(e){return void 0===e?e:String(e)},C="$0"==="a".replace(/./,"$0"),S=!!/./[m]&&""===/./[m]("a","$0");i("replace",(function(r,i,n){var C=S?"$":"$0";return[function(e,r){var n=u(this),a=o(e)?d(e,m):void 0;return a?t(a,e,n,r):t(i,A(n),e,r)},function(t,r){var o=a(this),u=A(t);if("string"==typeof r&&-1===b(r,C)&&-1===b(r,"$<")){var d=n(i,o,u,r);if(d.done)return d.value}var m=s(r);m||(r=A(r));var S,E=A(f(o)),I=-1!==b(E,"g");I&&(S=-1!==b(E,"u"),o.lastIndex=0);for(var T,F=[];null!==(T=g(o,u))&&(w(F,T),I);){""===A(T[0])&&(o.lastIndex=c(u,h(o.lastIndex),S))}for(var P="",L=0,M=0;M<F.length;M++){for(var k,U=A((T=F[M])[0]),R=y(_(l(T.index),u.length),0),D=[],N=1;N<T.length;N++)w(D,B(T[N]));var O=T.groups;if(m){var Q=v([U],D,R,u);void 0!==O&&w(Q,O),k=A(e(r,void 0,Q))}else k=p(U,u,R,D,O,r);R>=L&&(P+=x(u,L,R)+k,L=R+U.length)}return P+x(u,L)}]}),!!n((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!C||S)})),Ls=o(((e,t)=>{"use strict";var r=mn(),i=un(),n=Rn()("match");t.exports=function(e){var t;return r(e)&&(void 0!==(t=e[n])?!!t:"RegExp"===i(e))}})),Ms=o(((e,t)=>{"use strict";var r=Ls(),i=TypeError;t.exports=function(e){if(r(e))throw new i("The method doesn't accept regular expressions");return e}})),ks=o(((e,t)=>{"use strict";var r=Rn()("match");t.exports=function(e){var t=/./;try{"/./"[e](t)}catch{try{return t[r]=!1,"/./"[e](t)}catch{}}return!1}})),Us=o((()=>{"use strict";var e,t=da(),r=Pa(),i=zn().f,n=ia(),a=ds(),s=Ms(),o=pn(),l=ks(),h=Tn(),A=r("".slice),u=Math.min,c=l("startsWith");t({target:"String",proto:!0,forced:!!(h||c||(e=i(String.prototype,"startsWith"),!e||e.writable))&&!c},{startsWith:function(e){var t=a(o(this));s(e);var r=n(u(arguments.length>1?arguments[1]:void 0,t.length)),i=a(e);return A(t,r,r+i.length)===i}})})),Rs=o(((e,t)=>{"use strict";var r=Rn(),i=ys(),n=Vn().f,a=r("unscopables"),s=Array.prototype;void 0===s[a]&&n(s,a,{configurable:!0,value:i(null)}),t.exports=function(e){s[a][e]=!0}})),Ds=o(((e,t)=>{"use strict";var r=nn();t.exports=!r((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))})),Ns=o(((e,t)=>{"use strict";var r=kn(),i=gn(),n=Mn(),a=Wn(),s=Ds(),o=a("IE_PROTO"),l=Object,h=l.prototype;t.exports=s?l.getPrototypeOf:function(e){var t=n(e);if(r(t,o))return t[o];var a=t.constructor;return i(a)&&t instanceof a?a.prototype:t instanceof l?h:null}})),Os=o(((e,t)=>{"use strict";var r,i,n,a=nn(),s=gn(),o=mn(),l=ys(),h=Ns(),A=Jn(),u=Rn(),c=Tn(),d=u("iterator"),p=!1;[].keys&&("next"in(n=[].keys())?(i=h(h(n)))!==Object.prototype&&(r=i):p=!0),!o(r)||a((function(){var e={};return r[d].call(e)!==e}))?r={}:c&&(r=l(r)),s(r[d])||A(r,d,(function(){return this})),t.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:p}})),Qs=o(((e,t)=>{"use strict";var r=Os().IteratorPrototype,i=ys(),n=hn(),a=wa(),s=Wa(),o=function(){return this};t.exports=function(e,t,l,h){var A=t+" Iterator";return e.prototype=i(r,{next:n(+!h,l)}),a(e,A,!1,!0),s[A]=o,e}})),zs=o(((e,t)=>{"use strict";var r=da(),i=on(),n=Tn(),a=Kn(),s=gn(),o=Qs(),l=Ns(),h=va(),A=wa(),u=Gn(),c=Jn(),d=Rn(),p=Wa(),f=Os(),g=a.PROPER,m=a.CONFIGURABLE,y=f.IteratorPrototype,_=f.BUGGY_SAFARI_ITERATORS,v=d("iterator"),w="keys",b="values",x="entries",B=function(){return this};t.exports=function(e,t,a,d,f,C,S){o(a,t,d);var E,I,T,F=function(e){if(e===f&&U)return U;if(!_&&e&&e in M)return M[e];switch(e){case w:case b:case x:return function(){return new a(this,e)}}return function(){return new a(this)}},P=t+" Iterator",L=!1,M=e.prototype,k=M[v]||M["@@iterator"]||f&&M[f],U=!_&&k||F(f),R="Array"===t&&M.entries||k;if(R&&((E=l(R.call(new e)))!==Object.prototype&&E.next&&(!n&&l(E)!==y&&(h?h(E,y):s(E[v])||c(E,v,B)),A(E,P,!0,!0),n&&(p[P]=B))),g&&f===b&&k&&k.name!==b&&(!n&&m?u(M,"name",b):(L=!0,U=function(){return i(k,this)})),f)if(I={values:F(b),keys:C?U:F(w),entries:F(x)},S)for(T in I)(_||L||!(T in M))&&c(M,T,I[T]);else r({target:t,proto:!0,forced:_||L},I);return(!n||S)&&M[v]!==U&&c(M,v,U,{name:f}),p[t]=U,I}})),Hs=o(((e,t)=>{"use strict";t.exports=function(e,t){return{value:e,done:t}}})),js=o(((e,t)=>{"use strict";var r=fn(),i=Rs(),n=Wa(),a=Xn(),s=Vn().f,o=zs(),l=Hs(),h=Tn(),A=an(),u="Array Iterator",c=a.set,d=a.getterFor(u);t.exports=o(Array,"Array",(function(e,t){c(this,{type:u,target:r(e),index:0,kind:t})}),(function(){var e=d(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,l(void 0,!0);switch(e.kind){case"keys":return l(r,!1);case"values":return l(t[r],!1)}return l([r,t[r]],!1)}),"values");var p=n.Arguments=n.Array;if(i("keys"),i("values"),i("entries"),!h&&A&&"values"!==p.name)try{s(p,"name",{value:"values"})}catch{}})),Vs=o(((e,t)=>{"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}})),Gs=o(((e,t)=>{"use strict";var r=On()("span").classList,i=r&&r.constructor&&r.constructor.prototype;t.exports=i===Object.prototype?void 0:i})),Ks=o((()=>{"use strict";var e,t=rn(),r=Vs(),i=Gs(),n=js(),a=Gn(),s=wa(),o=Rn()("iterator"),l=n.values,h=function(e,t){if(e){if(e[o]!==l)try{a(e,o,l)}catch{e[o]=l}if(s(e,t,!0),r[t])for(var i in n)if(e[i]!==n[i])try{a(e,i,n[i])}catch{e[i]=n[i]}}};for(e in r)h(t[e]&&t[e].prototype,e);h(i,"DOMTokenList")}));function qs(e){return(qs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Zs=s((()=>{}));var Ws=s((()=>{Zs()}));function $s(e){var t=function(e,t){if("object"!==qs(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==qs(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===qs(t)?t:String(t)}var Xs=s((()=>{Zs(),Ws()}));function Ys(e,t,r){return(t=$s(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Js=s((()=>{Xs()})),eo=o(((e,t)=>{"use strict";var r=Sn(),i=Mn(),n=cn(),a=na(),s=TypeError,o="Reduce of empty array with no initial value",l=function(e){return function(t,l,h,A){var u=i(t),c=n(u),d=a(u);if(r(l),0===d&&h<2)throw new s(o);var p=e?d-1:0,f=e?-1:1;if(h<2)for(;;){if(p in c){A=c[p],p+=f;break}if(p+=f,e?p<0:d<=p)throw new s(o)}for(;e?p>=0:d>p;p+=f)p in c&&(A=l(A,c[p],p,u));return A}};t.exports={left:l(!1),right:l(!0)}})),to=o(((e,t)=>{"use strict";var r=nn();t.exports=function(e,t){var i=[][e];return!!i&&r((function(){i.call(null,t||function(){return 1},1)}))}})),ro=o((()=>{"use strict";var e=da(),t=eo().left,r=to(),i=wn();e({target:"Array",proto:!0,forced:!fa()&&i>79&&i<83||!r("reduce")},{reduce:function(e){var r=arguments.length;return t(this,e,r,r>1?arguments[1]:void 0)}})})),io=o((()=>{"use strict";var e,t=da(),r=Pa(),i=zn().f,n=ia(),a=ds(),s=Ms(),o=pn(),l=ks(),h=Tn(),A=r("".slice),u=Math.min,c=l("endsWith");t({target:"String",proto:!0,forced:!!(h||c||(e=i(String.prototype,"endsWith"),!e||e.writable))&&!c},{endsWith:function(e){var t=a(o(this));s(e);var r=arguments.length>1?arguments[1]:void 0,i=t.length,l=void 0===r?i:u(n(r),i),h=a(e);return A(t,l-h.length,l)===h}})})),no=o((()=>{"use strict";var e=on(),t=An(),r=xs(),i=jn(),n=mn(),a=pn(),s=Ta(),o=Cs(),l=ia(),h=ds(),A=En(),u=Is(),c=fs(),d=nn(),p=c.UNSUPPORTED_Y,f=Math.min,g=t([].push),m=t("".slice),y=!d((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var r="ab".split(e);return 2!==r.length||"a"!==r[0]||"b"!==r[1]})),_="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;r("split",(function(t,r,c){var d="0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:e(r,this,t,i)}:r;return[function(r,i){var s=a(this),o=n(r)?A(r,t):void 0;return o?e(o,r,s,i):e(d,h(s),r,i)},function(e,t){var n=i(this),a=h(e);if(!_){var A=c(d,n,a,t,d!==r);if(A.done)return A.value}var y=s(n,RegExp),v=n.unicode,w=(n.ignoreCase?"i":"")+(n.multiline?"m":"")+(n.unicode?"u":"")+(p?"g":"y"),b=new y(p?"^(?:"+n.source+")":n,w),x=void 0===t?4294967295:t>>>0;if(0===x)return[];if(0===a.length)return null===u(b,a)?[a]:[];for(var B=0,C=0,S=[];C<a.length;){b.lastIndex=p?0:C;var E,I=u(b,p?m(a,C):a);if(null===I||(E=f(l(b.lastIndex+(p?C:0)),a.length))===B)C=o(a,C,v);else{if(g(S,m(a,B,C)),S.length===x)return S;for(var T=1;T<=I.length-1;T++)if(g(S,I[T]),S.length===x)return S;C=B=E}}return g(S,m(a,B)),S}]}),_||!y,p)})),ao=o(((e,t)=>{(function(){var e,r,i,n,a,s;typeof performance<"u"&&null!==performance&&performance.now?t.exports=function(){return performance.now()}:typeof process<"u"&&null!==process&&process.hrtime?(t.exports=function(){return(e()-a)/1e6},r=process.hrtime,n=(e=function(){var e;return 1e9*(e=r())[0]+e[1]})(),s=1e9*process.uptime(),a=n-s):Date.now?(t.exports=function(){return Date.now()-i},i=Date.now()):(t.exports=function(){return(new Date).getTime()-i},i=(new Date).getTime())}).call(e)})),so=o(((e,t)=>{var r,i,n,a,s,o=ao(),l=typeof window>"u"?global:window,h=["moz","webkit"],A="AnimationFrame",u=l["request"+A],c=l["cancel"+A]||l["cancelRequest"+A];for(r=0;!u&&r<h.length;r++)u=l[h[r]+"Request"+A],c=l[h[r]+"Cancel"+A]||l[h[r]+"CancelRequest"+A];(!u||!c)&&(i=0,n=0,a=[],s=1e3/60,u=function(e){if(0===a.length){var t=o(),r=Math.max(0,s-(t-i));i=r+t,setTimeout((function(){var e=a.slice(0);a.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(i)}catch(e){setTimeout((function(){throw e}),0)}}),Math.round(r))}return a.push({handle:++n,callback:e,cancelled:!1}),n},c=function(e){for(var t=0;t<a.length;t++)a[t].handle===e&&(a[t].cancelled=!0)}),t.exports=function(e){return u.call(l,e)},t.exports.cancel=function(){c.apply(l,arguments)},t.exports.polyfill=function(e){e||(e=l),e.requestAnimationFrame=u,e.cancelAnimationFrame=c}})),oo=o(((e,t)=>{"use strict";t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"})),lo=o(((e,t)=>{"use strict";var r=An(),i=pn(),n=ds(),a=oo(),s=r("".replace),o=RegExp("^["+a+"]+"),l=RegExp("(^|[^"+a+"])["+a+"]+$"),h=function(e){return function(t){var r=n(i(t));return 1&e&&(r=s(r,o,"")),2&e&&(r=s(r,l,"$1")),r}};t.exports={start:h(1),end:h(2),trim:h(3)}})),ho=o(((e,t)=>{"use strict";var r=Kn().PROPER,i=nn(),n=oo();t.exports=function(e){return i((function(){return!!n[e]()||"​᠎"!=="​᠎"[e]()||r&&n[e].name!==e}))}})),Ao=o((()=>{"use strict";var e=da(),t=lo().trim;e({target:"String",proto:!0,forced:ho()("trim")},{trim:function(){return t(this)}})})),uo=o(((e,t)=>{t.exports=function(e){this.ok=!1,this.alpha=1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e=(e=e.replace(/ /g,"")).toLowerCase();var t={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"};e=t[e]||e;for(var r=[{re:/^rgba\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3}),\s*((?:\d?\.)?\d)\)$/,example:["rgba(123, 234, 45, 0.8)","rgba(255,234,245,1.0)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3]),parseFloat(e[4])]}},{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],i=0;i<r.length;i++){var n=r[i].re,a=r[i].process,s=n.exec(e);if(s){var o=a(s);this.r=o[0],this.g=o[1],this.b=o[2],o.length>3&&(this.alpha=o[3]),this.ok=!0}}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.alpha=this.alpha<0?0:this.alpha>1||isNaN(this.alpha)?1:this.alpha,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toRGBA=function(){return"rgba("+this.r+", "+this.g+", "+this.b+", "+this.alpha+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),r=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),"#"+e+t+r},this.getHelpXML=function(){for(var e=new Array,i=0;i<r.length;i++)for(var n=r[i].example,a=0;a<n.length;a++)e[e.length]=n[a];for(var s in t)e[e.length]=s;var o=document.createElement("ul");o.setAttribute("id","rgbcolor-examples");for(i=0;i<e.length;i++)try{var l=document.createElement("li"),h=new RGBColor(e[i]),A=document.createElement("div");A.style.cssText="margin: 3px; border: 1px solid black; background:"+h.toHex()+"; color:"+h.toHex(),A.appendChild(document.createTextNode("test"));var u=document.createTextNode(" "+e[i]+" -> "+h.toRGB()+" -> "+h.toHex());l.appendChild(A),l.appendChild(u),o.appendChild(l)}catch{}return o}}})),co=o((()=>{"use strict";var e=da(),t=Pa(),r=aa().indexOf,i=to(),n=t([].indexOf),a=!!n&&1/n([1],1,-0)<0;e({target:"Array",proto:!0,forced:a||!i("indexOf")},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return a?n(this,e,t)||0:r(this,e,t)}})})),po=o((()=>{"use strict";var e=da(),t=An(),r=Ms(),i=pn(),n=ds(),a=ks(),s=t("".indexOf);e({target:"String",proto:!0,forced:!a("includes")},{includes:function(e){return!!~s(n(i(this)),n(r(e)),arguments.length>1?arguments[1]:void 0)}})})),fo=o(((e,t)=>{"use strict";var r=un();t.exports=Array.isArray||function(e){return"Array"===r(e)}})),go=o((()=>{"use strict";var e=da(),t=An(),r=fo(),i=t([].reverse),n=[1,2];e({target:"Array",proto:!0,forced:String(n)===String(n.reverse())},{reverse:function(){return r(this)&&(this.length=this.length),i(this)}})}));function mo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}So(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function yo(e,t){var r=e[0],i=e[1];return[r*Math.cos(t)-i*Math.sin(t),r*Math.sin(t)+i*Math.cos(t)]}function _o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r=0;r<e.length;r++)if("number"!=typeof e[r])throw new Error("assertNumbers arguments["+r+"] is not a number. "+typeof e[r]+" == typeof "+e[r]);return!0}function vo(e,t,r){e.lArcFlag=0===e.lArcFlag?0:1,e.sweepFlag=0===e.sweepFlag?0:1;var i=e.rX,n=e.rY,a=e.x,s=e.y;i=Math.abs(e.rX),n=Math.abs(e.rY);var o=yo([(t-a)/2,(r-s)/2],-e.xRot/180*Eo),l=o[0],h=o[1],A=Math.pow(l,2)/Math.pow(i,2)+Math.pow(h,2)/Math.pow(n,2);1<A&&(i*=Math.sqrt(A),n*=Math.sqrt(A)),e.rX=i,e.rY=n;var u=Math.pow(i,2)*Math.pow(h,2)+Math.pow(n,2)*Math.pow(l,2),c=(e.lArcFlag!==e.sweepFlag?1:-1)*Math.sqrt(Math.max(0,(Math.pow(i,2)*Math.pow(n,2)-u)/u)),d=i*h/n*c,p=-n*l/i*c,f=yo([d,p],e.xRot/180*Eo);e.cX=f[0]+(t+a)/2,e.cY=f[1]+(r+s)/2,e.phi1=Math.atan2((h-p)/n,(l-d)/i),e.phi2=Math.atan2((-h-p)/n,(-l-d)/i),0===e.sweepFlag&&e.phi2>e.phi1&&(e.phi2-=2*Eo),1===e.sweepFlag&&e.phi2<e.phi1&&(e.phi2+=2*Eo),e.phi1*=180/Eo,e.phi2*=180/Eo}function wo(e,t,r){_o(e,t,r);var i=e*e+t*t-r*r;if(0>i)return[];if(0===i)return[[e*r/(e*e+t*t),t*r/(e*e+t*t)]];var n=Math.sqrt(i);return[[(e*r+t*n)/(e*e+t*t),(t*r-e*n)/(e*e+t*t)],[(e*r-t*n)/(e*e+t*t),(t*r+e*n)/(e*e+t*t)]]}function bo(e,t,r){return(1-r)*e+r*t}function xo(e,t,r,i){return e+Math.cos(i/180*Eo)*t+Math.sin(i/180*Eo)*r}function Bo(e,t,r,i){var n=1e-6,a=t-e,s=r-t,o=3*a+3*(i-r)-6*s,l=6*(s-a),h=3*a;return Math.abs(o)<n?[-h/l]:function(e,t,r){void 0===r&&(r=1e-6);var i=e*e/4-t;if(i<-r)return[];if(i<=r)return[-e/2];var n=Math.sqrt(i);return[-e/2-n,-e/2+n]}(l/o,h/o,n)}function Co(e,t,r,i,n){var a=1-n;return e*(a*a*a)+t*(3*a*a*n)+r*(3*a*n*n)+i*(n*n*n)}var So,Eo,Io,To,Fo,Po,Lo,Mo,ko,Uo,Ro,Do=s((()=>{So=function(e,t){return(So=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},Eo=Math.PI,To=Math.PI/180,function(e){function t(){return n((function(e,t,r){return e.relative&&(void 0!==e.x1&&(e.x1+=t),void 0!==e.y1&&(e.y1+=r),void 0!==e.x2&&(e.x2+=t),void 0!==e.y2&&(e.y2+=r),void 0!==e.x&&(e.x+=t),void 0!==e.y&&(e.y+=r),e.relative=!1),e}))}function r(){var e=NaN,t=NaN,r=NaN,i=NaN;return n((function(n,a,s){return n.type&Uo.SMOOTH_CURVE_TO&&(n.type=Uo.CURVE_TO,e=isNaN(e)?a:e,t=isNaN(t)?s:t,n.x1=n.relative?a-e:2*a-e,n.y1=n.relative?s-t:2*s-t),n.type&Uo.CURVE_TO?(e=n.relative?a+n.x2:n.x2,t=n.relative?s+n.y2:n.y2):(e=NaN,t=NaN),n.type&Uo.SMOOTH_QUAD_TO&&(n.type=Uo.QUAD_TO,r=isNaN(r)?a:r,i=isNaN(i)?s:i,n.x1=n.relative?a-r:2*a-r,n.y1=n.relative?s-i:2*s-i),n.type&Uo.QUAD_TO?(r=n.relative?a+n.x1:n.x1,i=n.relative?s+n.y1:n.y1):(r=NaN,i=NaN),n}))}function i(){var e=NaN,t=NaN;return n((function(r,i,n){if(r.type&Uo.SMOOTH_QUAD_TO&&(r.type=Uo.QUAD_TO,e=isNaN(e)?i:e,t=isNaN(t)?n:t,r.x1=r.relative?i-e:2*i-e,r.y1=r.relative?n-t:2*n-t),r.type&Uo.QUAD_TO){e=r.relative?i+r.x1:r.x1,t=r.relative?n+r.y1:r.y1;var a=r.x1,s=r.y1;r.type=Uo.CURVE_TO,r.x1=((r.relative?0:i)+2*a)/3,r.y1=((r.relative?0:n)+2*s)/3,r.x2=(r.x+2*a)/3,r.y2=(r.y+2*s)/3}else e=NaN,t=NaN;return r}))}function n(e){var t=0,r=0,i=NaN,n=NaN;return function(a){if(isNaN(i)&&!(a.type&Uo.MOVE_TO))throw new Error("path must start with moveto");var s=e(a,t,r,i,n);return a.type&Uo.CLOSE_PATH&&(t=i,r=n),void 0!==a.x&&(t=a.relative?t+a.x:a.x),void 0!==a.y&&(r=a.relative?r+a.y:a.y),a.type&Uo.MOVE_TO&&(i=t,n=r),s}}function a(e,t,r,i,a,s){return _o(e,t,r,i,a,s),n((function(n,o,l,h){var A=n.x1,u=n.x2,c=n.relative&&!isNaN(h),d=void 0!==n.x?n.x:c?0:o,p=void 0!==n.y?n.y:c?0:l;function f(e){return e*e}n.type&Uo.HORIZ_LINE_TO&&0!==t&&(n.type=Uo.LINE_TO,n.y=n.relative?0:l),n.type&Uo.VERT_LINE_TO&&0!==r&&(n.type=Uo.LINE_TO,n.x=n.relative?0:o),void 0!==n.x&&(n.x=n.x*e+p*r+(c?0:a)),void 0!==n.y&&(n.y=d*t+n.y*i+(c?0:s)),void 0!==n.x1&&(n.x1=n.x1*e+n.y1*r+(c?0:a)),void 0!==n.y1&&(n.y1=A*t+n.y1*i+(c?0:s)),void 0!==n.x2&&(n.x2=n.x2*e+n.y2*r+(c?0:a)),void 0!==n.y2&&(n.y2=u*t+n.y2*i+(c?0:s));var g=e*i-t*r;if(void 0!==n.xRot&&(1!==e||0!==t||0!==r||1!==i))if(0===g)delete n.rX,delete n.rY,delete n.xRot,delete n.lArcFlag,delete n.sweepFlag,n.type=Uo.LINE_TO;else{var m=n.xRot*Math.PI/180,y=Math.sin(m),_=Math.cos(m),v=1/f(n.rX),w=1/f(n.rY),b=f(_)*v+f(y)*w,x=2*y*_*(v-w),B=f(y)*v+f(_)*w,C=b*i*i-x*t*i+B*t*t,S=x*(e*i+t*r)-2*(b*r*i+B*e*t),E=b*r*r-x*e*r+B*e*e,I=(Math.atan2(S,C-E)+Math.PI)%Math.PI/2,T=Math.sin(I),F=Math.cos(I);n.rX=Math.abs(g)/Math.sqrt(C*f(F)+S*T*F+E*f(T)),n.rY=Math.abs(g)/Math.sqrt(C*f(T)-S*T*F+E*f(F)),n.xRot=180*I/Math.PI}return void 0!==n.sweepFlag&&0>g&&(n.sweepFlag=+!n.sweepFlag),n}))}e.ROUND=function(e){function t(t){return Math.round(t*e)/e}return void 0===e&&(e=1e13),_o(e),function(e){return void 0!==e.x1&&(e.x1=t(e.x1)),void 0!==e.y1&&(e.y1=t(e.y1)),void 0!==e.x2&&(e.x2=t(e.x2)),void 0!==e.y2&&(e.y2=t(e.y2)),void 0!==e.x&&(e.x=t(e.x)),void 0!==e.y&&(e.y=t(e.y)),void 0!==e.rX&&(e.rX=t(e.rX)),void 0!==e.rY&&(e.rY=t(e.rY)),e}},e.TO_ABS=t,e.TO_REL=function(){return n((function(e,t,r){return e.relative||(void 0!==e.x1&&(e.x1-=t),void 0!==e.y1&&(e.y1-=r),void 0!==e.x2&&(e.x2-=t),void 0!==e.y2&&(e.y2-=r),void 0!==e.x&&(e.x-=t),void 0!==e.y&&(e.y-=r),e.relative=!0),e}))},e.NORMALIZE_HVZ=function(e,t,r){return void 0===e&&(e=!0),void 0===t&&(t=!0),void 0===r&&(r=!0),n((function(i,n,a,s,o){if(isNaN(s)&&!(i.type&Uo.MOVE_TO))throw new Error("path must start with moveto");return t&&i.type&Uo.HORIZ_LINE_TO&&(i.type=Uo.LINE_TO,i.y=i.relative?0:a),r&&i.type&Uo.VERT_LINE_TO&&(i.type=Uo.LINE_TO,i.x=i.relative?0:n),e&&i.type&Uo.CLOSE_PATH&&(i.type=Uo.LINE_TO,i.x=i.relative?s-n:s,i.y=i.relative?o-a:o),i.type&Uo.ARC&&(0===i.rX||0===i.rY)&&(i.type=Uo.LINE_TO,delete i.rX,delete i.rY,delete i.xRot,delete i.lArcFlag,delete i.sweepFlag),i}))},e.NORMALIZE_ST=r,e.QT_TO_C=i,e.INFO=n,e.SANITIZE=function(e){void 0===e&&(e=0),_o(e);var t=NaN,r=NaN,i=NaN,a=NaN;return n((function(n,s,o,l,h){var A=Math.abs,u=!1,c=0,d=0;if(n.type&Uo.SMOOTH_CURVE_TO&&(c=isNaN(t)?0:s-t,d=isNaN(r)?0:o-r),n.type&(Uo.CURVE_TO|Uo.SMOOTH_CURVE_TO)?(t=n.relative?s+n.x2:n.x2,r=n.relative?o+n.y2:n.y2):(t=NaN,r=NaN),n.type&Uo.SMOOTH_QUAD_TO?(i=isNaN(i)?s:2*s-i,a=isNaN(a)?o:2*o-a):n.type&Uo.QUAD_TO?(i=n.relative?s+n.x1:n.x1,a=n.relative?o+n.y1:n.y2):(i=NaN,a=NaN),n.type&Uo.LINE_COMMANDS||n.type&Uo.ARC&&(0===n.rX||0===n.rY||!n.lArcFlag)||n.type&Uo.CURVE_TO||n.type&Uo.SMOOTH_CURVE_TO||n.type&Uo.QUAD_TO||n.type&Uo.SMOOTH_QUAD_TO){var p=void 0===n.x?0:n.relative?n.x:n.x-s,f=void 0===n.y?0:n.relative?n.y:n.y-o;c=isNaN(i)?void 0===n.x1?c:n.relative?n.x:n.x1-s:i-s,d=isNaN(a)?void 0===n.y1?d:n.relative?n.y:n.y1-o:a-o;var g=void 0===n.x2?0:n.relative?n.x:n.x2-s,m=void 0===n.y2?0:n.relative?n.y:n.y2-o;A(p)<=e&&A(f)<=e&&A(c)<=e&&A(d)<=e&&A(g)<=e&&A(m)<=e&&(u=!0)}return n.type&Uo.CLOSE_PATH&&A(s-l)<=e&&A(o-h)<=e&&(u=!0),u?[]:n}))},e.MATRIX=a,e.ROTATE=function(e,t,r){void 0===t&&(t=0),void 0===r&&(r=0),_o(e,t,r);var i=Math.sin(e),n=Math.cos(e);return a(n,i,-i,n,t-t*n+r*i,r-t*i-r*n)},e.TRANSLATE=function(e,t){return void 0===t&&(t=0),_o(e,t),a(1,0,0,1,e,t)},e.SCALE=function(e,t){return void 0===t&&(t=e),_o(e,t),a(e,0,0,t,0,0)},e.SKEW_X=function(e){return _o(e),a(1,0,Math.atan(e),1,0,0)},e.SKEW_Y=function(e){return _o(e),a(1,Math.atan(e),0,1,0,0)},e.X_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),_o(e),a(-1,0,0,1,e,0)},e.Y_AXIS_SYMMETRY=function(e){return void 0===e&&(e=0),_o(e),a(1,0,0,-1,0,e)},e.A_TO_C=function(){return n((function(e,t,r){return Uo.ARC===e.type?function(e,t,r){var i,n,a,s;e.cX||vo(e,t,r);for(var o=Math.min(e.phi1,e.phi2),l=Math.max(e.phi1,e.phi2)-o,h=Math.ceil(l/90),A=new Array(h),u=t,c=r,d=0;d<h;d++){var p=bo(e.phi1,e.phi2,d/h),f=bo(e.phi1,e.phi2,(d+1)/h),g=f-p,m=4/3*Math.tan(g*To/4),y=[Math.cos(p*To)-m*Math.sin(p*To),Math.sin(p*To)+m*Math.cos(p*To)],_=y[0],v=y[1],w=[Math.cos(f*To),Math.sin(f*To)],b=w[0],x=w[1],B=[b+m*Math.sin(f*To),x-m*Math.cos(f*To)],C=B[0],S=B[1];A[d]={relative:e.relative,type:Uo.CURVE_TO};var E=function(t,r){var i=yo([t*e.rX,r*e.rY],e.xRot),n=i[0],a=i[1];return[e.cX+n,e.cY+a]};i=E(_,v),A[d].x1=i[0],A[d].y1=i[1],n=E(C,S),A[d].x2=n[0],A[d].y2=n[1],a=E(b,x),A[d].x=a[0],A[d].y=a[1],e.relative&&(A[d].x1-=u,A[d].y1-=c,A[d].x2-=u,A[d].y2-=c,A[d].x-=u,A[d].y-=c),u=(s=[A[d].x,A[d].y])[0],c=s[1]}return A}(e,e.relative?0:t,e.relative?0:r):e}))},e.ANNOTATE_ARCS=function(){return n((function(e,t,r){return e.relative&&(t=0,r=0),Uo.ARC===e.type&&vo(e,t,r),e}))},e.CLONE=function(){return function(e){var t={};for(var r in e)t[r]=e[r];return t}},e.CALCULATE_BOUNDS=function(){var e=t(),a=i(),s=r(),o=n((function(t,r,i){var n=s(a(e(function(e){var t={};for(var r in e)t[r]=e[r];return t}(t))));function l(e){e>o.maxX&&(o.maxX=e),e<o.minX&&(o.minX=e)}function h(e){e>o.maxY&&(o.maxY=e),e<o.minY&&(o.minY=e)}if(n.type&Uo.DRAWING_COMMANDS&&(l(r),h(i)),n.type&Uo.HORIZ_LINE_TO&&l(n.x),n.type&Uo.VERT_LINE_TO&&h(n.y),n.type&Uo.LINE_TO&&(l(n.x),h(n.y)),n.type&Uo.CURVE_TO){l(n.x),h(n.y);for(var A=0,u=Bo(r,n.x1,n.x2,n.x);A<u.length;A++)0<(E=u[A])&&1>E&&l(Co(r,n.x1,n.x2,n.x,E));for(var c=0,d=Bo(i,n.y1,n.y2,n.y);c<d.length;c++)0<(E=d[c])&&1>E&&h(Co(i,n.y1,n.y2,n.y,E))}if(n.type&Uo.ARC){l(n.x),h(n.y),vo(n,r,i);for(var p=n.xRot/180*Math.PI,f=Math.cos(p)*n.rX,g=Math.sin(p)*n.rX,m=-Math.sin(p)*n.rY,y=Math.cos(p)*n.rY,_=n.phi1<n.phi2?[n.phi1,n.phi2]:-180>n.phi2?[n.phi2+360,n.phi1+360]:[n.phi2,n.phi1],v=_[0],w=_[1],b=function(e){var t=e[0],r=e[1],i=180*Math.atan2(r,t)/Math.PI;return i<v?i+360:i},x=0,B=wo(m,-f,0).map(b);x<B.length;x++)(E=B[x])>v&&E<w&&l(xo(n.cX,f,m,E));for(var C=0,S=wo(y,-g,0).map(b);C<S.length;C++){var E;(E=S[C])>v&&E<w&&h(xo(n.cY,g,y,E))}}return t}));return o.minX=1/0,o.maxX=-1/0,o.minY=1/0,o.maxY=-1/0,o}}(Io||(Io={})),Po=function(){function e(){}return e.prototype.round=function(e){return this.transform(Io.ROUND(e))},e.prototype.toAbs=function(){return this.transform(Io.TO_ABS())},e.prototype.toRel=function(){return this.transform(Io.TO_REL())},e.prototype.normalizeHVZ=function(e,t,r){return this.transform(Io.NORMALIZE_HVZ(e,t,r))},e.prototype.normalizeST=function(){return this.transform(Io.NORMALIZE_ST())},e.prototype.qtToC=function(){return this.transform(Io.QT_TO_C())},e.prototype.aToC=function(){return this.transform(Io.A_TO_C())},e.prototype.sanitize=function(e){return this.transform(Io.SANITIZE(e))},e.prototype.translate=function(e,t){return this.transform(Io.TRANSLATE(e,t))},e.prototype.scale=function(e,t){return this.transform(Io.SCALE(e,t))},e.prototype.rotate=function(e,t,r){return this.transform(Io.ROTATE(e,t,r))},e.prototype.matrix=function(e,t,r,i,n,a){return this.transform(Io.MATRIX(e,t,r,i,n,a))},e.prototype.skewX=function(e){return this.transform(Io.SKEW_X(e))},e.prototype.skewY=function(e){return this.transform(Io.SKEW_Y(e))},e.prototype.xSymmetry=function(e){return this.transform(Io.X_AXIS_SYMMETRY(e))},e.prototype.ySymmetry=function(e){return this.transform(Io.Y_AXIS_SYMMETRY(e))},e.prototype.annotateArcs=function(){return this.transform(Io.ANNOTATE_ARCS())},e}(),Lo=function(e){return" "===e||"\t"===e||"\r"===e||"\n"===e},Mo=function(e){return 48<=e.charCodeAt(0)&&e.charCodeAt(0)<=57},ko=function(e){function t(){var t=e.call(this)||this;return t.curNumber="",t.curCommandType=-1,t.curCommandRelative=!1,t.canParseCommandOrComma=!0,t.curNumberHasExp=!1,t.curNumberHasExpDigits=!1,t.curNumberHasDecimal=!1,t.curArgs=[],t}return mo(t,e),t.prototype.finish=function(e){if(void 0===e&&(e=[]),this.parse(" ",e),0!==this.curArgs.length||!this.canParseCommandOrComma)throw new SyntaxError("Unterminated command at the path end.");return e},t.prototype.parse=function(e,t){var r=this;void 0===t&&(t=[]);for(var i=function(e){t.push(e),r.curArgs.length=0,r.canParseCommandOrComma=!0},n=0;n<e.length;n++){var a=e[n],s=!(this.curCommandType!==Uo.ARC||3!==this.curArgs.length&&4!==this.curArgs.length||1!==this.curNumber.length||"0"!==this.curNumber&&"1"!==this.curNumber),o=Mo(a)&&("0"===this.curNumber&&"0"===a||s);if(!Mo(a)||o)if("e"!==a&&"E"!==a)if("-"!==a&&"+"!==a||!this.curNumberHasExp||this.curNumberHasExpDigits)if("."!==a||this.curNumberHasExp||this.curNumberHasDecimal||s){if(this.curNumber&&-1!==this.curCommandType){var l=Number(this.curNumber);if(isNaN(l))throw new SyntaxError("Invalid number ending at "+n);if(this.curCommandType===Uo.ARC)if(0===this.curArgs.length||1===this.curArgs.length){if(0>l)throw new SyntaxError('Expected positive number, got "'+l+'" at index "'+n+'"')}else if((3===this.curArgs.length||4===this.curArgs.length)&&"0"!==this.curNumber&&"1"!==this.curNumber)throw new SyntaxError('Expected a flag, got "'+this.curNumber+'" at index "'+n+'"');this.curArgs.push(l),this.curArgs.length===Ro[this.curCommandType]&&(Uo.HORIZ_LINE_TO===this.curCommandType?i({type:Uo.HORIZ_LINE_TO,relative:this.curCommandRelative,x:l}):Uo.VERT_LINE_TO===this.curCommandType?i({type:Uo.VERT_LINE_TO,relative:this.curCommandRelative,y:l}):this.curCommandType===Uo.MOVE_TO||this.curCommandType===Uo.LINE_TO||this.curCommandType===Uo.SMOOTH_QUAD_TO?(i({type:this.curCommandType,relative:this.curCommandRelative,x:this.curArgs[0],y:this.curArgs[1]}),Uo.MOVE_TO===this.curCommandType&&(this.curCommandType=Uo.LINE_TO)):this.curCommandType===Uo.CURVE_TO?i({type:Uo.CURVE_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x2:this.curArgs[2],y2:this.curArgs[3],x:this.curArgs[4],y:this.curArgs[5]}):this.curCommandType===Uo.SMOOTH_CURVE_TO?i({type:Uo.SMOOTH_CURVE_TO,relative:this.curCommandRelative,x2:this.curArgs[0],y2:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Uo.QUAD_TO?i({type:Uo.QUAD_TO,relative:this.curCommandRelative,x1:this.curArgs[0],y1:this.curArgs[1],x:this.curArgs[2],y:this.curArgs[3]}):this.curCommandType===Uo.ARC&&i({type:Uo.ARC,relative:this.curCommandRelative,rX:this.curArgs[0],rY:this.curArgs[1],xRot:this.curArgs[2],lArcFlag:this.curArgs[3],sweepFlag:this.curArgs[4],x:this.curArgs[5],y:this.curArgs[6]})),this.curNumber="",this.curNumberHasExpDigits=!1,this.curNumberHasExp=!1,this.curNumberHasDecimal=!1,this.canParseCommandOrComma=!0}if(!Lo(a))if(","===a&&this.canParseCommandOrComma)this.canParseCommandOrComma=!1;else if("+"!==a&&"-"!==a&&"."!==a)if(o)this.curNumber=a,this.curNumberHasDecimal=!1;else{if(0!==this.curArgs.length)throw new SyntaxError("Unterminated command at index "+n+".");if(!this.canParseCommandOrComma)throw new SyntaxError('Unexpected character "'+a+'" at index '+n+". Command cannot follow comma");if(this.canParseCommandOrComma=!1,"z"!==a&&"Z"!==a)if("h"===a||"H"===a)this.curCommandType=Uo.HORIZ_LINE_TO,this.curCommandRelative="h"===a;else if("v"===a||"V"===a)this.curCommandType=Uo.VERT_LINE_TO,this.curCommandRelative="v"===a;else if("m"===a||"M"===a)this.curCommandType=Uo.MOVE_TO,this.curCommandRelative="m"===a;else if("l"===a||"L"===a)this.curCommandType=Uo.LINE_TO,this.curCommandRelative="l"===a;else if("c"===a||"C"===a)this.curCommandType=Uo.CURVE_TO,this.curCommandRelative="c"===a;else if("s"===a||"S"===a)this.curCommandType=Uo.SMOOTH_CURVE_TO,this.curCommandRelative="s"===a;else if("q"===a||"Q"===a)this.curCommandType=Uo.QUAD_TO,this.curCommandRelative="q"===a;else if("t"===a||"T"===a)this.curCommandType=Uo.SMOOTH_QUAD_TO,this.curCommandRelative="t"===a;else{if("a"!==a&&"A"!==a)throw new SyntaxError('Unexpected character "'+a+'" at index '+n+".");this.curCommandType=Uo.ARC,this.curCommandRelative="a"===a}else t.push({type:Uo.CLOSE_PATH}),this.canParseCommandOrComma=!0,this.curCommandType=-1}else this.curNumber=a,this.curNumberHasDecimal="."===a}else this.curNumber+=a,this.curNumberHasDecimal=!0;else this.curNumber+=a;else this.curNumber+=a,this.curNumberHasExp=!0;else this.curNumber+=a,this.curNumberHasExpDigits=this.curNumberHasExp}return t},t.prototype.transform=function(e){return Object.create(this,{parse:{value:function(t,r){void 0===r&&(r=[]);for(var i=0,n=Object.getPrototypeOf(this).parse.call(this,t);i<n.length;i++){var a=n[i],s=e(a);Array.isArray(s)?r.push.apply(r,s):r.push(s)}return r}}})},t}(Po),Uo=function(e){function t(r){var i=e.call(this)||this;return i.commands="string"==typeof r?t.parse(r):r,i}return mo(t,e),t.prototype.encode=function(){return t.encode(this.commands)},t.prototype.getBounds=function(){var e=Io.CALCULATE_BOUNDS();return this.transform(e),e},t.prototype.transform=function(e){for(var t=[],r=0,i=this.commands;r<i.length;r++){var n=e(i[r]);Array.isArray(n)?t.push.apply(t,n):t.push(n)}return this.commands=t,this},t.encode=function(e){return function(e){var t="";Array.isArray(e)||(e=[e]);for(var r=0;r<e.length;r++){var i=e[r];if(i.type===Uo.CLOSE_PATH)t+="z";else if(i.type===Uo.HORIZ_LINE_TO)t+=(i.relative?"h":"H")+i.x;else if(i.type===Uo.VERT_LINE_TO)t+=(i.relative?"v":"V")+i.y;else if(i.type===Uo.MOVE_TO)t+=(i.relative?"m":"M")+i.x+" "+i.y;else if(i.type===Uo.LINE_TO)t+=(i.relative?"l":"L")+i.x+" "+i.y;else if(i.type===Uo.CURVE_TO)t+=(i.relative?"c":"C")+i.x1+" "+i.y1+" "+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===Uo.SMOOTH_CURVE_TO)t+=(i.relative?"s":"S")+i.x2+" "+i.y2+" "+i.x+" "+i.y;else if(i.type===Uo.QUAD_TO)t+=(i.relative?"q":"Q")+i.x1+" "+i.y1+" "+i.x+" "+i.y;else if(i.type===Uo.SMOOTH_QUAD_TO)t+=(i.relative?"t":"T")+i.x+" "+i.y;else{if(i.type!==Uo.ARC)throw new Error('Unexpected command type "'+i.type+'" at index '+r+".");t+=(i.relative?"a":"A")+i.rX+" "+i.rY+" "+i.xRot+" "+ +i.lArcFlag+" "+ +i.sweepFlag+" "+i.x+" "+i.y}}return t}(e)},t.parse=function(e){var t=new ko,r=[];return t.parse(e,r),t.finish(r),r},t.CLOSE_PATH=1,t.MOVE_TO=2,t.HORIZ_LINE_TO=4,t.VERT_LINE_TO=8,t.LINE_TO=16,t.CURVE_TO=32,t.SMOOTH_CURVE_TO=64,t.QUAD_TO=128,t.SMOOTH_QUAD_TO=256,t.ARC=512,t.LINE_COMMANDS=t.LINE_TO|t.HORIZ_LINE_TO|t.VERT_LINE_TO,t.DRAWING_COMMANDS=t.HORIZ_LINE_TO|t.VERT_LINE_TO|t.LINE_TO|t.CURVE_TO|t.SMOOTH_CURVE_TO|t.QUAD_TO|t.SMOOTH_QUAD_TO|t.ARC,t}(Po),(Fo={})[Uo.MOVE_TO]=2,Fo[Uo.LINE_TO]=2,Fo[Uo.HORIZ_LINE_TO]=1,Fo[Uo.VERT_LINE_TO]=1,Fo[Uo.CLOSE_PATH]=0,Fo[Uo.QUAD_TO]=4,Fo[Uo.SMOOTH_QUAD_TO]=2,Fo[Uo.CURVE_TO]=6,Fo[Uo.SMOOTH_CURVE_TO]=4,Fo[Uo.ARC]=7,Ro=Fo})),No=o((()=>{"use strict";var e=Kn().PROPER,t=Jn(),r=jn(),i=ds(),n=nn(),a=Es(),s="toString",o=RegExp.prototype,l=o[s],h=n((function(){return"/a/b"!==l.call({source:"a",flags:"b"})})),A=e&&l.name!==s;(h||A)&&t(o,s,(function(){var e=r(this);return"/"+i(e.source)+"/"+i(a(e))}),{unsafe:!0})}));function Oo(e){return(Oo="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Qo(e,t,r,i,n,a){if(!(isNaN(a)||a<1)){a|=0;var s=function(e,t,r,i,n){if("string"==typeof e&&(e=document.getElementById(e)),!e||"object"!==Oo(e)||!("getContext"in e))throw new TypeError("Expecting canvas with `getContext` method in processCanvasRGB(A) calls!");var a=e.getContext("2d");try{return a.getImageData(t,r,i,n)}catch(e){throw new Error("unable to access image data: "+e)}}(e,t,r,i,n);s=function(e,t,r,i,n,a){for(var s,o=e.data,l=2*a+1,h=i-1,A=n-1,u=a+1,c=u*(u+1)/2,d=new jo,p=d,f=1;f<l;f++)p=p.next=new jo,f===u&&(s=p);p.next=d;for(var g=null,m=null,y=0,_=0,v=zo[a],w=Ho[a],b=0;b<n;b++){p=d;for(var x=o[_],B=o[_+1],C=o[_+2],S=o[_+3],E=0;E<u;E++)p.r=x,p.g=B,p.b=C,p.a=S,p=p.next;for(var I=0,T=0,F=0,P=0,L=u*x,M=u*B,k=u*C,U=u*S,R=c*x,D=c*B,N=c*C,O=c*S,Q=1;Q<u;Q++){var z=_+((h<Q?h:Q)<<2),H=o[z],j=o[z+1],V=o[z+2],G=o[z+3],K=u-Q;R+=(p.r=H)*K,D+=(p.g=j)*K,N+=(p.b=V)*K,O+=(p.a=G)*K,I+=H,T+=j,F+=V,P+=G,p=p.next}g=d,m=s;for(var q=0;q<i;q++){var Z=O*v>>>w;if(o[_+3]=Z,0!==Z){var W=255/Z;o[_]=(R*v>>>w)*W,o[_+1]=(D*v>>>w)*W,o[_+2]=(N*v>>>w)*W}else o[_]=o[_+1]=o[_+2]=0;R-=L,D-=M,N-=k,O-=U,L-=g.r,M-=g.g,k-=g.b,U-=g.a;var $=q+a+1;$=y+($<h?$:h)<<2,R+=I+=g.r=o[$],D+=T+=g.g=o[$+1],N+=F+=g.b=o[$+2],O+=P+=g.a=o[$+3],g=g.next;var X=m,Y=X.r,J=X.g,ee=X.b,te=X.a;L+=Y,M+=J,k+=ee,U+=te,I-=Y,T-=J,F-=ee,P-=te,m=m.next,_+=4}y+=i}for(var re=0;re<i;re++){var ie=o[_=re<<2],ne=o[_+1],ae=o[_+2],se=o[_+3],oe=u*ie,le=u*ne,he=u*ae,Ae=u*se,ue=c*ie,ce=c*ne,de=c*ae,pe=c*se;p=d;for(var fe=0;fe<u;fe++)p.r=ie,p.g=ne,p.b=ae,p.a=se,p=p.next;for(var ge=i,me=0,ye=0,_e=0,ve=0,we=1;we<=a;we++){_=ge+re<<2;var be=u-we;ue+=(p.r=ie=o[_])*be,ce+=(p.g=ne=o[_+1])*be,de+=(p.b=ae=o[_+2])*be,pe+=(p.a=se=o[_+3])*be,ve+=ie,me+=ne,ye+=ae,_e+=se,p=p.next,we<A&&(ge+=i)}_=re,g=d,m=s;for(var xe=0;xe<n;xe++){var Be=_<<2;o[Be+3]=se=pe*v>>>w,se>0?(se=255/se,o[Be]=(ue*v>>>w)*se,o[Be+1]=(ce*v>>>w)*se,o[Be+2]=(de*v>>>w)*se):o[Be]=o[Be+1]=o[Be+2]=0,ue-=oe,ce-=le,de-=he,pe-=Ae,oe-=g.r,le-=g.g,he-=g.b,Ae-=g.a,Be=re+((Be=xe+u)<A?Be:A)*i<<2,ue+=ve+=g.r=o[Be],ce+=me+=g.g=o[Be+1],de+=ye+=g.b=o[Be+2],pe+=_e+=g.a=o[Be+3],g=g.next,oe+=ie=m.r,le+=ne=m.g,he+=ae=m.b,Ae+=se=m.a,ve-=ie,me-=ne,ye-=ae,_e-=se,m=m.next,_+=i}}return e}(s,0,0,i,n,a),e.getContext("2d").putImageData(s,t,r)}}var zo,Ho,jo,Vo=s((()=>{zo=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Ho=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24],jo=function e(){(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")})(this,e),this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}})),Go={};function Ko(){var{DOMParser:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t={window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:e,createCanvas:(e,t)=>new OffscreenCanvas(e,t),createImage:e=>us((function*(){var t=yield fetch(e),r=yield t.blob();return yield createImageBitmap(r)}))()};return(typeof DOMParser<"u"||typeof e>"u")&&Reflect.deleteProperty(t,"DOMParser"),t}function qo(e){var{DOMParser:t,canvas:r,fetch:i}=e;return{window:null,ignoreAnimation:!0,ignoreMouse:!0,DOMParser:t,fetch:i,createCanvas:r.createCanvas,createImage:r.loadImage}}function Zo(e){return e.replace(/(?!\u3000)\s+/gm," ")}function Wo(e){return e.replace(/^[\n \t]+/,"")}function $o(e){return e.replace(/[\n \t]+$/,"")}function Xo(e){return((e||"").match(/-?(\d+(?:\.\d*(?:[eE][+-]?\d+)?)?|\.\d+)(?=\D|$)/gm)||[]).map(parseFloat)}function Yo(e){return Ll.test(e)?e.toLowerCase():e}function Jo(e){var t=/url\(('([^']+)'|"([^"]+)"|([^'")]+))\)/.exec(e)||[];return t[2]||t[3]||t[4]}function el(e){if(!e.startsWith("rgb"))return e;var t=3;return e.replace(/\d+(\.\d+)?/g,((e,r)=>t--&&r?String(Math.round(parseFloat(e))):e))}function tl(e,t){var r=t.exec(e);return r?[e.replace(t," "),r.length]:[e,0]}function rl(e){var t=[0,0,0],r=e.replace(/:not\(([^)]*)\)/g,"     $1 ").replace(/{[\s\S]*/gm," "),i=0;return[r,i]=tl(r,Ml),t[1]+=i,[r,i]=tl(r,kl),t[0]+=i,[r,i]=tl(r,Ul),t[1]+=i,[r,i]=tl(r,Rl),t[2]+=i,[r,i]=tl(r,Dl),t[1]+=i,[r,i]=tl(r,Nl),t[1]+=i,r=r.replace(/[*\s+>~]/g," ").replace(/[#.]/g," "),[r,i]=tl(r,Ol),t[2]+=i,t.join("")}function il(e){return Math.sqrt(Math.pow(e[0],2)+Math.pow(e[1],2))}function nl(e,t){return(e[0]*t[0]+e[1]*t[1])/(il(e)*il(t))}function al(e,t){return(e[0]*t[1]<e[1]*t[0]?-1:1)*Math.acos(nl(e,t))}function sl(e){return e*e*e}function ol(e){return 3*e*e*(1-e)}function ll(e){return 3*e*(1-e)*(1-e)}function hl(e){return(1-e)*(1-e)*(1-e)}function Al(e){return e*e}function ul(e){return 2*e*(1-e)}function cl(e){return(1-e)*(1-e)}function dl(e){var t=e.trim();return/^('|")/.test(t)?t:'"'.concat(t,'"')}function pl(e){return typeof process>"u"?e:e.trim().split(",").map(dl).join(",")}function fl(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"italic":case"oblique":case"inherit":case"initial":case"unset":return t;default:return/^oblique\s+(-|)\d+deg$/.test(t)?t:""}}function gl(e){if(!e)return"";var t=e.trim().toLowerCase();switch(t){case"normal":case"bold":case"lighter":case"bolder":case"inherit":case"initial":case"unset":return t;default:return/^[\d.]+$/.test(t)?t:""}}function ml(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function yl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ml(Object(r),!0).forEach((function(t){Ys(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ml(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _l(e,t,r,i,n,a){return e[r*i*4+4*t+a]}function vl(e,t,r,i,n,a,s){e[r*i*4+4*t+a]=s}function wl(e,t,r){return e[t]*r}function bl(e,t,r,i){return t+Math.cos(e)*r+Math.sin(e)*i}function xl(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Bl(e,t){var r=document.createElement("canvas");return r.width=e,r.height=t,r}function Cl(e){return Sl.apply(this,arguments)}function Sl(){return Sl=us((function*(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.createElement("img");return t&&(r.crossOrigin="Anonymous"),new Promise(((t,i)=>{r.onload=()=>{t(r)},r.onerror=(e,t,r,n,a)=>{i(a)},r.src=e}))})),Sl.apply(this,arguments)}function El(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function Il(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?El(Object(r),!0).forEach((function(t){Ys(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):El(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}l(Go,{AElement:()=>Nh,AnimateColorElement:()=>Lh,AnimateElement:()=>Ph,AnimateTransformElement:()=>Mh,BoundingBox:()=>lh,CB1:()=>sl,CB2:()=>ol,CB3:()=>ll,CB4:()=>hl,Canvg:()=>aA,CircleElement:()=>yh,ClipPathElement:()=>Wh,DefsElement:()=>Ch,DescElement:()=>rA,Document:()=>nA,Element:()=>ah,EllipseElement:()=>_h,FeColorMatrixElement:()=>Kh,FeCompositeElement:()=>Jh,FeDropShadowElement:()=>Xh,FeGaussianBlurElement:()=>eA,FeMorphologyElement:()=>Yh,FilterElement:()=>$h,Font:()=>oh,FontElement:()=>kh,FontFaceElement:()=>Uh,GElement:()=>Sh,GlyphElement:()=>ch,GradientElement:()=>Eh,ImageElement:()=>zh,LineElement:()=>vh,LinearGradientElement:()=>Ih,MarkerElement:()=>Bh,MaskElement:()=>qh,Matrix:()=>eh,MissingGlyphElement:()=>Rh,Mouse:()=>Vl,PSEUDO_ZERO:()=>Ql,Parser:()=>$l,PathElement:()=>uh,PathParser:()=>hh,PatternElement:()=>xh,Point:()=>jl,PolygonElement:()=>bh,PolylineElement:()=>wh,Property:()=>zl,QB1:()=>Al,QB2:()=>ul,QB3:()=>cl,RadialGradientElement:()=>Th,RectElement:()=>mh,RenderedElement:()=>Ah,Rotate:()=>Yl,SVGElement:()=>gh,SVGFontLoader:()=>jh,Scale:()=>Jl,Screen:()=>ql,Skew:()=>th,SkewX:()=>rh,SkewY:()=>ih,StopElement:()=>Fh,StyleElement:()=>Vh,SymbolElement:()=>Hh,TRefElement:()=>Dh,TSpanElement:()=>ph,TextElement:()=>dh,TextPathElement:()=>Oh,TitleElement:()=>tA,Transform:()=>nh,Translate:()=>Xl,UnknownElement:()=>sh,UseElement:()=>Gh,ViewPort:()=>Hl,compressSpaces:()=>Zo,default:()=>aA,getSelectorSpecificity:()=>rl,normalizeAttributeName:()=>Yo,normalizeColor:()=>el,parseExternalUrl:()=>Jo,presets:()=>Pl,toNumbers:()=>Xo,trimLeft:()=>Wo,trimRight:()=>$o,vectorMagnitude:()=>il,vectorsAngle:()=>al,vectorsRatio:()=>nl});var Tl,Fl,Pl,Ll,Ml,kl,Ul,Rl,Dl,Nl,Ol,Ql,zl,Hl,jl,Vl,Gl,Kl,ql,Zl,Wl,$l,Xl,Yl,Jl,eh,th,rh,ih,nh,ah,sh,oh,lh,hh,Ah,uh,ch,dh,ph,fh,gh,mh,yh,_h,vh,wh,bh,xh,Bh,Ch,Sh,Eh,Ih,Th,Fh,Ph,Lh,Mh,kh,Uh,Rh,Dh,Nh,Oh,Qh,zh,Hh,jh,Vh,Gh,Kh,qh,Zh,Wh,$h,Xh,Yh,Jh,eA,tA,rA,iA,nA,aA,sA,oA,lA,hA,AA,uA,cA,dA,pA,fA,gA,mA,yA=s((()=>{h(hs(),1),cs(),h(Ts(),1),h(Ps(),1),h(Us(),1),h(js(),1),h(Ks(),1),Js(),h(ro(),1),h(io(),1),h(no(),1),Tl=h(so(),1),h(Ao(),1),Fl=h(uo(),1),h(co(),1),h(po(),1),h(go(),1),Do(),h(No(),1),Vo(),Pl=Object.freeze({__proto__:null,offscreen:Ko,node:qo}),Ll=/^[A-Z-]+$/,Ml=/(\[[^\]]+\])/g,kl=/(#[^\s+>~.[:]+)/g,Ul=/(\.[^\s+>~.[:]+)/g,Rl=/(::[^\s+>~.[:]+|:first-line|:first-letter|:before|:after)/gi,Dl=/(:[\w-]+\([^)]*\))/gi,Nl=/(:[^\s+>~.[:]+)/g,Ol=/([^\s+>~.[:]+)/g,Ql=1e-8,(zl=class e{constructor(e,t,r){this.document=e,this.name=t,this.value=r,this.isNormalizedColor=!1}static empty(t){return new e(t,"EMPTY","")}split(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:" ",{document:r,name:i}=this;return Zo(this.getString()).trim().split(t).map((t=>new e(r,i,t)))}hasValue(e){var{value:t}=this;return null!==t&&""!==t&&(e||0!==t)&&typeof t<"u"}isString(e){var{value:t}=this,r="string"==typeof t;return r&&e?e.test(t):r}isUrlDefinition(){return this.isString(/^url\(/)}isPixels(){if(!this.hasValue())return!1;var e=this.getString();switch(!0){case e.endsWith("px"):case/^[0-9]+$/.test(e):return!0;default:return!1}}setValue(e){return this.value=e,this}getValue(e){return typeof e>"u"||this.hasValue()?this.value:e}getNumber(e){if(!this.hasValue())return typeof e>"u"?0:parseFloat(e);var{value:t}=this,r=parseFloat(t);return this.isString(/%$/)&&(r/=100),r}getString(e){return typeof e>"u"||this.hasValue()?typeof this.value>"u"?"":String(this.value):String(e)}getColor(e){var t=this.getString(e);return this.isNormalizedColor||(this.isNormalizedColor=!0,t=el(t),this.value=t),t}getDpi(){return 96}getRem(){return this.document.rootEmSize}getEm(){return this.document.emSize}getUnits(){return this.getString().replace(/[0-9.-]/g,"")}getPixels(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.hasValue())return 0;var[r,i]="boolean"==typeof e?[void 0,e]:[e],{viewPort:n}=this.document.screen;switch(!0){case this.isString(/vmin$/):return this.getNumber()/100*Math.min(n.computeSize("x"),n.computeSize("y"));case this.isString(/vmax$/):return this.getNumber()/100*Math.max(n.computeSize("x"),n.computeSize("y"));case this.isString(/vw$/):return this.getNumber()/100*n.computeSize("x");case this.isString(/vh$/):return this.getNumber()/100*n.computeSize("y");case this.isString(/rem$/):return this.getNumber()*this.getRem();case this.isString(/em$/):return this.getNumber()*this.getEm();case this.isString(/ex$/):return this.getNumber()*this.getEm()/2;case this.isString(/px$/):return this.getNumber();case this.isString(/pt$/):return this.getNumber()*this.getDpi()*(1/72);case this.isString(/pc$/):return 15*this.getNumber();case this.isString(/cm$/):return this.getNumber()*this.getDpi()/2.54;case this.isString(/mm$/):return this.getNumber()*this.getDpi()/25.4;case this.isString(/in$/):return this.getNumber()*this.getDpi();case this.isString(/%$/)&&i:return this.getNumber()*this.getEm();case this.isString(/%$/):return this.getNumber()*n.computeSize(r);default:var a=this.getNumber();return t&&a<1?a*n.computeSize(r):a}}getMilliseconds(){return this.hasValue()?this.isString(/ms$/)?this.getNumber():1e3*this.getNumber():0}getRadians(){if(!this.hasValue())return 0;switch(!0){case this.isString(/deg$/):return this.getNumber()*(Math.PI/180);case this.isString(/grad$/):return this.getNumber()*(Math.PI/200);case this.isString(/rad$/):return this.getNumber();default:return this.getNumber()*(Math.PI/180)}}getDefinition(){var e=this.getString(),t=/#([^)'"]+)/.exec(e);return t&&(t=t[1]),t||(t=e),this.document.definitions[t]}getFillStyleDefinition(e,t){var r=this.getDefinition();if(!r)return null;if("function"==typeof r.createGradient)return r.createGradient(this.document.ctx,e,t);if("function"==typeof r.createPattern){if(r.getHrefAttribute().hasValue()){var i=r.getAttribute("patternTransform");r=r.getHrefAttribute().getDefinition(),i.hasValue()&&r.getAttribute("patternTransform",!0).setValue(i.value)}return r.createPattern(this.document.ctx,e,t)}return null}getTextBaseline(){return this.hasValue()?e.textBaselineMapping[this.getString()]:null}addOpacity(t){for(var r=this.getColor(),i=r.length,n=0,a=0;a<i&&(","===r[a]&&n++,3!==n);a++);if(t.hasValue()&&this.isString()&&3!==n){var s=new Fl.default(r);s.ok&&(s.alpha=t.getNumber(),r=s.toRGBA())}return new e(this.document,this.name,r)}}).textBaselineMapping={baseline:"alphabetic","before-edge":"top","text-before-edge":"top",middle:"middle",central:"middle","after-edge":"bottom","text-after-edge":"bottom",ideographic:"ideographic",alphabetic:"alphabetic",hanging:"hanging",mathematical:"alphabetic"},Hl=class{constructor(){this.viewPorts=[]}clear(){this.viewPorts=[]}setCurrent(e,t){this.viewPorts.push({width:e,height:t})}removeCurrent(){this.viewPorts.pop()}getCurrent(){var{viewPorts:e}=this;return e[e.length-1]}get width(){return this.getCurrent().width}get height(){return this.getCurrent().height}computeSize(e){return"number"==typeof e?e:"x"===e?this.width:"y"===e?this.height:Math.sqrt(Math.pow(this.width,2)+Math.pow(this.height,2))/Math.sqrt(2)}},jl=class e{constructor(e,t){this.x=e,this.y=t}static parse(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,[i=r,n=r]=Xo(t);return new e(i,n)}static parseScale(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,[i=r,n=i]=Xo(t);return new e(i,n)}static parsePath(t){for(var r=Xo(t),i=r.length,n=[],a=0;a<i;a+=2)n.push(new e(r[a],r[a+1]));return n}angleTo(e){return Math.atan2(e.y-this.y,e.x-this.x)}applyTransform(e){var{x:t,y:r}=this,i=t*e[0]+r*e[2]+e[4],n=t*e[1]+r*e[3]+e[5];this.x=i,this.y=n}},Vl=class{constructor(e){this.screen=e,this.working=!1,this.events=[],this.eventElements=[],this.onClick=this.onClick.bind(this),this.onMouseMove=this.onMouseMove.bind(this)}isWorking(){return this.working}start(){if(!this.working){var{screen:e,onClick:t,onMouseMove:r}=this,i=e.ctx.canvas;i.onclick=t,i.onmousemove=r,this.working=!0}}stop(){if(this.working){var e=this.screen.ctx.canvas;this.working=!1,e.onclick=null,e.onmousemove=null}}hasEvents(){return this.working&&this.events.length>0}runEvents(){if(this.working){var{screen:e,events:t,eventElements:r}=this,{style:i}=e.ctx.canvas;i&&(i.cursor=""),t.forEach(((e,t)=>{for(var{run:i}=e,n=r[t];n;)i(n),n=n.parent})),this.events=[],this.eventElements=[]}}checkPath(e,t){if(this.working&&t){var{events:r,eventElements:i}=this;r.forEach(((r,n)=>{var{x:a,y:s}=r;!i[n]&&t.isPointInPath&&t.isPointInPath(a,s)&&(i[n]=e)}))}}checkBoundingBox(e,t){if(this.working&&t){var{events:r,eventElements:i}=this;r.forEach(((r,n)=>{var{x:a,y:s}=r;!i[n]&&t.isPointInBox(a,s)&&(i[n]=e)}))}}mapXY(e,t){for(var{window:r,ctx:i}=this.screen,n=new jl(e,t),a=i.canvas;a;)n.x-=a.offsetLeft,n.y-=a.offsetTop,a=a.offsetParent;return r.scrollX&&(n.x+=r.scrollX),r.scrollY&&(n.y+=r.scrollY),n}onClick(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onclick",x:t,y:r,run(e){e.onClick&&e.onClick()}})}onMouseMove(e){var{x:t,y:r}=this.mapXY(e.clientX,e.clientY);this.events.push({type:"onmousemove",x:t,y:r,run(e){e.onMouseMove&&e.onMouseMove()}})}},Gl=typeof window<"u"?window:null,Kl=typeof fetch<"u"?fetch.bind(void 0):null,(ql=class{constructor(e){var{fetch:t=Kl,window:r=Gl}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.ctx=e,this.FRAMERATE=30,this.MAX_VIRTUAL_PIXELS=3e4,this.CLIENT_WIDTH=800,this.CLIENT_HEIGHT=600,this.viewPort=new Hl,this.mouse=new Vl(this),this.animations=[],this.waits=[],this.frameDuration=0,this.isReadyLock=!1,this.isFirstRender=!0,this.intervalId=null,this.window=r,this.fetch=t}wait(e){this.waits.push(e)}ready(){return this.readyPromise?this.readyPromise:Promise.resolve()}isReady(){if(this.isReadyLock)return!0;var e=this.waits.every((e=>e()));return e&&(this.waits=[],this.resolveReady&&this.resolveReady()),this.isReadyLock=e,e}setDefaults(e){e.strokeStyle="rgba(0,0,0,0)",e.lineCap="butt",e.lineJoin="miter",e.miterLimit=4}setViewBox(e){var{document:t,ctx:r,aspectRatio:i,width:n,desiredWidth:a,height:s,desiredHeight:o,minX:l=0,minY:h=0,refX:A,refY:u,clip:c=!1,clipX:d=0,clipY:p=0}=e,f=Zo(i).replace(/^defer\s/,""),[g,m]=f.split(" "),y=g||"xMidYMid",_=m||"meet",v=n/a,w=s/o,b=Math.min(v,w),x=Math.max(v,w),B=a,C=o;"meet"===_&&(B*=b,C*=b),"slice"===_&&(B*=x,C*=x);var S=new zl(t,"refX",A),E=new zl(t,"refY",u),I=S.hasValue()&&E.hasValue();if(I&&r.translate(-b*S.getPixels("x"),-b*E.getPixels("y")),c){var T=b*d,F=b*p;r.beginPath(),r.moveTo(T,F),r.lineTo(n,F),r.lineTo(n,s),r.lineTo(T,s),r.closePath(),r.clip()}if(!I){var P="meet"===_&&b===w,L="slice"===_&&x===w,M="meet"===_&&b===v,k="slice"===_&&x===v;y.startsWith("xMid")&&(P||L)&&r.translate(n/2-B/2,0),y.endsWith("YMid")&&(M||k)&&r.translate(0,s/2-C/2),y.startsWith("xMax")&&(P||L)&&r.translate(n-B,0),y.endsWith("YMax")&&(M||k)&&r.translate(0,s-C)}switch(!0){case"none"===y:r.scale(v,w);break;case"meet"===_:r.scale(b,b);break;case"slice"===_:r.scale(x,x)}r.translate(-l,-h)}start(e){var{enableRedraw:t=!1,ignoreMouse:r=!1,ignoreAnimation:i=!1,ignoreDimensions:n=!1,ignoreClear:a=!1,forceRedraw:s,scaleWidth:o,scaleHeight:l,offsetX:h,offsetY:A}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{FRAMERATE:u,mouse:c}=this,d=1e3/u;if(this.frameDuration=d,this.readyPromise=new Promise((e=>{this.resolveReady=e})),this.isReady()&&this.render(e,n,a,o,l,h,A),t){var p=Date.now(),f=p,g=0,m=()=>{p=Date.now(),(g=p-f)>=d&&(f=p-g%d,this.shouldUpdate(i,s)&&(this.render(e,n,a,o,l,h,A),c.runEvents())),this.intervalId=(0,Tl.default)(m)};r||c.start(),this.intervalId=(0,Tl.default)(m)}}stop(){this.intervalId&&(Tl.default.cancel(this.intervalId),this.intervalId=null),this.mouse.stop()}shouldUpdate(e,t){if(!e){var{frameDuration:r}=this;if(this.animations.reduce(((e,t)=>t.update(r)||e),!1))return!0}return!!("function"==typeof t&&t()||!this.isReadyLock&&this.isReady()||this.mouse.hasEvents())}render(e,t,r,i,n,a,s){var{CLIENT_WIDTH:o,CLIENT_HEIGHT:l,viewPort:h,ctx:A,isFirstRender:u}=this,c=A.canvas;h.clear(),c.width&&c.height?h.setCurrent(c.width,c.height):h.setCurrent(o,l);var d=e.getStyle("width"),p=e.getStyle("height");!t&&(u||"number"!=typeof i&&"number"!=typeof n)&&(d.hasValue()&&(c.width=d.getPixels("x"),c.style&&(c.style.width="".concat(c.width,"px"))),p.hasValue()&&(c.height=p.getPixels("y"),c.style&&(c.style.height="".concat(c.height,"px"))));var f=c.clientWidth||c.width,g=c.clientHeight||c.height;if(t&&d.hasValue()&&p.hasValue()&&(f=d.getPixels("x"),g=p.getPixels("y")),h.setCurrent(f,g),"number"==typeof a&&e.getAttribute("x",!0).setValue(a),"number"==typeof s&&e.getAttribute("y",!0).setValue(s),"number"==typeof i||"number"==typeof n){var m=Xo(e.getAttribute("viewBox").getString()),y=0,_=0;if("number"==typeof i){var v=e.getStyle("width");v.hasValue()?y=v.getPixels("x")/i:isNaN(m[2])||(y=m[2]/i)}if("number"==typeof n){var w=e.getStyle("height");w.hasValue()?_=w.getPixels("y")/n:isNaN(m[3])||(_=m[3]/n)}y||(y=_),_||(_=y),e.getAttribute("width",!0).setValue(i),e.getAttribute("height",!0).setValue(n);var b=e.getStyle("transform",!0,!0);b.setValue("".concat(b.getString()," scale(").concat(1/y,", ").concat(1/_,")"))}r||A.clearRect(0,0,f,g),e.render(A),u&&(this.isFirstRender=!1)}}).defaultWindow=Gl,ql.defaultFetch=Kl,({defaultFetch:Zl}=ql),Wl=typeof DOMParser<"u"?DOMParser:null,$l=class{constructor(){var{fetch:e=Zl,DOMParser:t=Wl}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.fetch=e,this.DOMParser=t}parse(e){var t=this;return us((function*(){return e.startsWith("<")?t.parseFromString(e):t.load(e)}))()}parseFromString(e){var t=new this.DOMParser;try{return this.checkDocument(t.parseFromString(e,"image/svg+xml"))}catch{return this.checkDocument(t.parseFromString(e,"text/xml"))}}checkDocument(e){var t=e.getElementsByTagName("parsererror")[0];if(t)throw new Error(t.textContent);return e}load(e){var t=this;return us((function*(){var r=yield t.fetch(e),i=yield r.text();return t.parseFromString(i)}))()}},Xl=class{constructor(e,t){this.type="translate",this.point=null,this.point=jl.parse(t)}apply(e){var{x:t,y:r}=this.point;e.translate(t||0,r||0)}unapply(e){var{x:t,y:r}=this.point;e.translate(-1*t||0,-1*r||0)}applyToPoint(e){var{x:t,y:r}=this.point;e.applyTransform([1,0,0,1,t||0,r||0])}},Yl=class{constructor(e,t,r){this.type="rotate",this.angle=null,this.originX=null,this.originY=null,this.cx=0,this.cy=0;var i=Xo(t);this.angle=new zl(e,"angle",i[0]),this.originX=r[0],this.originY=r[1],this.cx=i[1]||0,this.cy=i[2]||0}apply(e){var{cx:t,cy:r,originX:i,originY:n,angle:a}=this,s=t+i.getPixels("x"),o=r+n.getPixels("y");e.translate(s,o),e.rotate(a.getRadians()),e.translate(-s,-o)}unapply(e){var{cx:t,cy:r,originX:i,originY:n,angle:a}=this,s=t+i.getPixels("x"),o=r+n.getPixels("y");e.translate(s,o),e.rotate(-1*a.getRadians()),e.translate(-s,-o)}applyToPoint(e){var{cx:t,cy:r,angle:i}=this,n=i.getRadians();e.applyTransform([1,0,0,1,t||0,r||0]),e.applyTransform([Math.cos(n),Math.sin(n),-Math.sin(n),Math.cos(n),0,0]),e.applyTransform([1,0,0,1,-t||0,-r||0])}},Jl=class{constructor(e,t,r){this.type="scale",this.scale=null,this.originX=null,this.originY=null;var i=jl.parseScale(t);(0===i.x||0===i.y)&&(i.x=Ql,i.y=Ql),this.scale=i,this.originX=r[0],this.originY=r[1]}apply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,a=i.getPixels("x"),s=n.getPixels("y");e.translate(a,s),e.scale(t,r||t),e.translate(-a,-s)}unapply(e){var{scale:{x:t,y:r},originX:i,originY:n}=this,a=i.getPixels("x"),s=n.getPixels("y");e.translate(a,s),e.scale(1/t,1/r||t),e.translate(-a,-s)}applyToPoint(e){var{x:t,y:r}=this.scale;e.applyTransform([t||0,0,0,r||0,0,0])}},eh=class{constructor(e,t,r){this.type="matrix",this.matrix=[],this.originX=null,this.originY=null,this.matrix=Xo(t),this.originX=r[0],this.originY=r[1]}apply(e){var{originX:t,originY:r,matrix:i}=this,n=t.getPixels("x"),a=r.getPixels("y");e.translate(n,a),e.transform(i[0],i[1],i[2],i[3],i[4],i[5]),e.translate(-n,-a)}unapply(e){var{originX:t,originY:r,matrix:i}=this,n=i[0],a=i[2],s=i[4],o=i[1],l=i[3],h=i[5],A=1/(n*(1*l-0*h)-a*(1*o-0*h)+s*(0*o-0*l)),u=t.getPixels("x"),c=r.getPixels("y");e.translate(u,c),e.transform(A*(1*l-0*h),A*(0*h-1*o),A*(0*s-1*a),A*(1*n-0*s),A*(a*h-s*l),A*(s*o-n*h)),e.translate(-u,-c)}applyToPoint(e){e.applyTransform(this.matrix)}},th=class extends eh{constructor(e,t,r){super(e,t,r),this.type="skew",this.angle=null,this.angle=new zl(e,"angle",t)}},rh=class extends th{constructor(e,t,r){super(e,t,r),this.type="skewX",this.matrix=[1,0,Math.tan(this.angle.getRadians()),1,0,0]}},ih=class extends th{constructor(e,t,r){super(e,t,r),this.type="skewY",this.matrix=[1,Math.tan(this.angle.getRadians()),0,1,0,0]}},(nh=class e{constructor(t,r,i){this.document=t,this.transforms=[];var n=function(e){return Zo(e).trim().replace(/\)([a-zA-Z])/g,") $1").replace(/\)(\s?,\s?)/g,") ").split(/\s(?=[a-z])/)}(r);n.forEach((t=>{if("none"!==t){var[r,n]=function(e){var[t,r]=e.split("(");return[t.trim(),r.trim().replace(")","")]}(t),a=e.transformTypes[r];typeof a<"u"&&this.transforms.push(new a(this.document,n,i))}}))}static fromElement(t,r){var i=r.getStyle("transform",!1,!0),[n,a=n]=r.getStyle("transform-origin",!1,!0).split(),s=[n,a];return i.hasValue()?new e(t,i.getString(),s):null}apply(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].apply(e)}unapply(e){for(var{transforms:t}=this,r=t.length-1;r>=0;r--)t[r].unapply(e)}applyToPoint(e){for(var{transforms:t}=this,r=t.length,i=0;i<r;i++)t[i].applyToPoint(e)}}).transformTypes={translate:Xl,rotate:Yl,scale:Jl,matrix:eh,skewX:rh,skewY:ih},(ah=class e{constructor(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(this.document=e,this.node=t,this.captureTextNodes=r,this.attributes=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.animationFrozen=!1,this.animationFrozenValue="",this.parent=null,this.children=[],t&&1===t.nodeType){if(Array.from(t.attributes).forEach((t=>{var r=Yo(t.nodeName);this.attributes[r]=new zl(e,r,t.value)})),this.addStylesFromStyleDefinition(),this.getAttribute("style").hasValue())this.getAttribute("style").getString().split(";").map((e=>e.trim())).forEach((t=>{if(t){var[r,i]=t.split(":").map((e=>e.trim()));this.styles[r]=new zl(e,r,i)}}));var{definitions:i}=e,n=this.getAttribute("id");n.hasValue()&&(i[n.getString()]||(i[n.getString()]=this)),Array.from(t.childNodes).forEach((t=>{if(1===t.nodeType)this.addChild(t);else if(r&&(3===t.nodeType||4===t.nodeType)){var i=e.createTextNode(t);i.getText().length>0&&this.addChild(i)}}))}}getAttribute(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=this.attributes[e];if(!r&&t){var i=new zl(this.document,e,"");return this.attributes[e]=i,i}return r||zl.empty(this.document)}getHrefAttribute(){for(var e in this.attributes)if("href"===e||e.endsWith(":href"))return this.attributes[e];return zl.empty(this.document)}getStyle(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.styles[e];if(i)return i;var n=this.getAttribute(e);if(null!=n&&n.hasValue())return this.styles[e]=n,n;if(!r){var{parent:a}=this;if(a){var s=a.getStyle(e);if(null!=s&&s.hasValue())return s}}if(t){var o=new zl(this.document,e,"");return this.styles[e]=o,o}return i||zl.empty(this.document)}render(e){if("none"!==this.getStyle("display").getString()&&"hidden"!==this.getStyle("visibility").getString()){if(e.save(),this.getStyle("mask").hasValue()){var t=this.getStyle("mask").getDefinition();t&&(this.applyEffects(e),t.apply(e,this))}else if("none"!==this.getStyle("filter").getValue("none")){var r=this.getStyle("filter").getDefinition();r&&(this.applyEffects(e),r.apply(e,this))}else this.setContext(e),this.renderChildren(e),this.clearContext(e);e.restore()}}setContext(e){}applyEffects(e){var t=nh.fromElement(this.document,this);t&&t.apply(e);var r=this.getStyle("clip-path",!1,!0);if(r.hasValue()){var i=r.getDefinition();i&&i.apply(e)}}clearContext(e){}renderChildren(e){this.children.forEach((t=>{t.render(e)}))}addChild(t){var r=t instanceof e?t:this.document.createElement(t);r.parent=this,e.ignoreChildTypes.includes(r.type)||this.children.push(r)}matchesSelector(e){var t,{node:r}=this;if("function"==typeof r.matches)return r.matches(e);var i=null===(t=r.getAttribute)||void 0===t?void 0:t.call(r,"class");return!(!i||""===i)&&i.split(" ").some((t=>".".concat(t)===e))}addStylesFromStyleDefinition(){var{styles:e,stylesSpecificity:t}=this.document;for(var r in e)if(!r.startsWith("@")&&this.matchesSelector(r)){var i=e[r],n=t[r];if(i)for(var a in i){var s=this.stylesSpecificity[a];typeof s>"u"&&(s="000"),n>=s&&(this.styles[a]=i[a],this.stylesSpecificity[a]=n)}}}removeStyles(e,t){return t.reduce(((t,r)=>{var i=e.getStyle(r);if(!i.hasValue())return t;var n=i.getString();return i.setValue(""),[...t,[r,n]]}),[])}restoreStyles(e,t){t.forEach((t=>{var[r,i]=t;e.getStyle(r,!0).setValue(i)}))}isFirstChild(){var e;return 0===(null===(e=this.parent)||void 0===e?void 0:e.children.indexOf(this))}}).ignoreChildTypes=["title"],sh=class extends ah{constructor(e,t,r){super(e,t,r)}},(oh=class e{constructor(t,r,i,n,a,s){var o=s?"string"==typeof s?e.parse(s):s:{};this.fontFamily=a||o.fontFamily,this.fontSize=n||o.fontSize,this.fontStyle=t||o.fontStyle,this.fontWeight=i||o.fontWeight,this.fontVariant=r||o.fontVariant}static parse(){var t=arguments.length>1?arguments[1]:void 0,r="",i="",n="",a="",s="",o=Zo(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split(" "),l={fontSize:!1,fontStyle:!1,fontWeight:!1,fontVariant:!1};return o.forEach((t=>{switch(!0){case!l.fontStyle&&e.styles.includes(t):"inherit"!==t&&(r=t),l.fontStyle=!0;break;case!l.fontVariant&&e.variants.includes(t):"inherit"!==t&&(i=t),l.fontStyle=!0,l.fontVariant=!0;break;case!l.fontWeight&&e.weights.includes(t):"inherit"!==t&&(n=t),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0;break;case!l.fontSize:"inherit"!==t&&([a]=t.split("/")),l.fontStyle=!0,l.fontVariant=!0,l.fontWeight=!0,l.fontSize=!0;break;default:"inherit"!==t&&(s+=t)}})),new e(r,i,n,a,s,t)}toString(){return[fl(this.fontStyle),this.fontVariant,gl(this.fontWeight),this.fontSize,pl(this.fontFamily)].join(" ").trim()}}).styles="normal|italic|oblique|inherit",oh.variants="normal|small-caps|inherit",oh.weights="normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900|inherit",lh=class{constructor(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Number.NaN,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Number.NaN,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Number.NaN,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Number.NaN;this.x1=e,this.y1=t,this.x2=r,this.y2=i,this.addPoint(e,t),this.addPoint(r,i)}get x(){return this.x1}get y(){return this.y1}get width(){return this.x2-this.x1}get height(){return this.y2-this.y1}addPoint(e,t){typeof e<"u"&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=e,this.x2=e),e<this.x1&&(this.x1=e),e>this.x2&&(this.x2=e)),typeof t<"u"&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=t,this.y2=t),t<this.y1&&(this.y1=t),t>this.y2&&(this.y2=t))}addX(e){this.addPoint(e,null)}addY(e){this.addPoint(null,e)}addBoundingBox(e){if(e){var{x1:t,y1:r,x2:i,y2:n}=e;this.addPoint(t,r),this.addPoint(i,n)}}sumCubic(e,t,r,i,n){return Math.pow(1-e,3)*t+3*Math.pow(1-e,2)*e*r+3*(1-e)*Math.pow(e,2)*i+Math.pow(e,3)*n}bezierCurveAdd(e,t,r,i,n){var a=6*t-12*r+6*i,s=-3*t+9*r-9*i+3*n,o=3*r-3*t;if(0!==s){var l=Math.pow(a,2)-4*o*s;if(!(l<0)){var h=(-a+Math.sqrt(l))/(2*s);0<h&&h<1&&(e?this.addX(this.sumCubic(h,t,r,i,n)):this.addY(this.sumCubic(h,t,r,i,n)));var A=(-a-Math.sqrt(l))/(2*s);0<A&&A<1&&(e?this.addX(this.sumCubic(A,t,r,i,n)):this.addY(this.sumCubic(A,t,r,i,n)))}}else{if(0===a)return;var u=-o/a;0<u&&u<1&&(e?this.addX(this.sumCubic(u,t,r,i,n)):this.addY(this.sumCubic(u,t,r,i,n)))}}addBezierCurve(e,t,r,i,n,a,s,o){this.addPoint(e,t),this.addPoint(s,o),this.bezierCurveAdd(!0,e,r,n,s),this.bezierCurveAdd(!1,t,i,a,o)}addQuadraticCurve(e,t,r,i,n,a){var s=e+.6666666666666666*(r-e),o=t+2/3*(i-t),l=s+1/3*(n-e),h=o+1/3*(a-t);this.addBezierCurve(e,t,s,l,o,h,n,a)}isPointInBox(e,t){var{x1:r,y1:i,x2:n,y2:a}=this;return r<=e&&e<=n&&i<=t&&t<=a}},hh=class extends Uo{constructor(e){super(e.replace(/([+\-.])\s+/gm,"$1").replace(/[^MmZzLlHhVvCcSsQqTtAae\d\s.,+-].*/g,"")),this.control=null,this.start=null,this.current=null,this.command=null,this.commands=this.commands,this.i=-1,this.previousCommand=null,this.points=[],this.angles=[]}reset(){this.i=-1,this.command=null,this.previousCommand=null,this.start=new jl(0,0),this.control=new jl(0,0),this.current=new jl(0,0),this.points=[],this.angles=[]}isEnd(){var{i:e,commands:t}=this;return e>=t.length-1}next(){var e=this.commands[++this.i];return this.previousCommand=this.command,this.command=e,e}getPoint(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"x",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"y",r=new jl(this.command[e],this.command[t]);return this.makeAbsolute(r)}getAsControlPoint(e,t){var r=this.getPoint(e,t);return this.control=r,r}getAsCurrentPoint(e,t){var r=this.getPoint(e,t);return this.current=r,r}getReflectedControlPoint(){var e=this.previousCommand.type;if(e!==Uo.CURVE_TO&&e!==Uo.SMOOTH_CURVE_TO&&e!==Uo.QUAD_TO&&e!==Uo.SMOOTH_QUAD_TO)return this.current;var{current:{x:t,y:r},control:{x:i,y:n}}=this;return new jl(2*t-i,2*r-n)}makeAbsolute(e){if(this.command.relative){var{x:t,y:r}=this.current;e.x+=t,e.y+=r}return e}addMarker(e,t,r){var{points:i,angles:n}=this;r&&n.length>0&&!n[n.length-1]&&(n[n.length-1]=i[i.length-1].angleTo(r)),this.addMarkerAngle(e,t?t.angleTo(e):null)}addMarkerAngle(e,t){this.points.push(e),this.angles.push(t)}getMarkerPoints(){return this.points}getMarkerAngles(){for(var{angles:e}=this,t=e.length,r=0;r<t;r++)if(!e[r])for(var i=r+1;i<t;i++)if(e[i]){e[r]=e[i];break}return e}},Ah=class extends ah{constructor(){super(...arguments),this.modifiedEmSizeStack=!1}calculateOpacity(){for(var e=1,t=this;t;){var r=t.getStyle("opacity",!1,!0);r.hasValue(!0)&&(e*=r.getNumber()),t=t.parent}return e}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!t){var r=this.getStyle("fill"),i=this.getStyle("fill-opacity"),n=this.getStyle("stroke"),a=this.getStyle("stroke-opacity");if(r.isUrlDefinition()){var s=r.getFillStyleDefinition(this,i);s&&(e.fillStyle=s)}else if(r.hasValue()){"currentColor"===r.getString()&&r.setValue(this.getStyle("color").getColor());var o=r.getColor();"inherit"!==o&&(e.fillStyle="none"===o?"rgba(0,0,0,0)":o)}if(i.hasValue()){var l=new zl(this.document,"fill",e.fillStyle).addOpacity(i).getColor();e.fillStyle=l}if(n.isUrlDefinition()){var h=n.getFillStyleDefinition(this,a);h&&(e.strokeStyle=h)}else if(n.hasValue()){"currentColor"===n.getString()&&n.setValue(this.getStyle("color").getColor());var A=n.getString();"inherit"!==A&&(e.strokeStyle="none"===A?"rgba(0,0,0,0)":A)}if(a.hasValue()){var u=new zl(this.document,"stroke",e.strokeStyle).addOpacity(a).getString();e.strokeStyle=u}var c=this.getStyle("stroke-width");if(c.hasValue()){var d=c.getPixels();e.lineWidth=d||Ql}var p=this.getStyle("stroke-linecap"),f=this.getStyle("stroke-linejoin"),g=this.getStyle("stroke-miterlimit"),m=this.getStyle("stroke-dasharray"),y=this.getStyle("stroke-dashoffset");if(p.hasValue()&&(e.lineCap=p.getString()),f.hasValue()&&(e.lineJoin=f.getString()),g.hasValue()&&(e.miterLimit=g.getNumber()),m.hasValue()&&"none"!==m.getString()){var _=Xo(m.getString());typeof e.setLineDash<"u"?e.setLineDash(_):typeof e.webkitLineDash<"u"?e.webkitLineDash=_:typeof e.mozDash<"u"&&(1!==_.length||0!==_[0])&&(e.mozDash=_);var v=y.getPixels();typeof e.lineDashOffset<"u"?e.lineDashOffset=v:typeof e.webkitLineDashOffset<"u"?e.webkitLineDashOffset=v:typeof e.mozDashOffset<"u"&&(e.mozDashOffset=v)}}if(this.modifiedEmSizeStack=!1,typeof e.font<"u"){var w=this.getStyle("font"),b=this.getStyle("font-style"),x=this.getStyle("font-variant"),B=this.getStyle("font-weight"),C=this.getStyle("font-size"),S=this.getStyle("font-family"),E=new oh(b.getString(),x.getString(),B.getString(),C.hasValue()?"".concat(C.getPixels(!0),"px"):"",S.getString(),oh.parse(w.getString(),e.font));b.setValue(E.fontStyle),x.setValue(E.fontVariant),B.setValue(E.fontWeight),C.setValue(E.fontSize),S.setValue(E.fontFamily),e.font=E.toString(),C.isPixels()&&(this.document.emSize=C.getPixels(),this.modifiedEmSizeStack=!0)}t||(this.applyEffects(e),e.globalAlpha=this.calculateOpacity())}clearContext(e){super.clearContext(e),this.modifiedEmSizeStack&&this.document.popEmSize()}},uh=class e extends Ah{constructor(e,t,r){super(e,t,r),this.type="path",this.pathParser=null,this.pathParser=new hh(this.getAttribute("d").getString())}path(e){var{pathParser:t}=this,r=new lh;for(t.reset(),e&&e.beginPath();!t.isEnd();)switch(t.next().type){case hh.MOVE_TO:this.pathM(e,r);break;case hh.LINE_TO:this.pathL(e,r);break;case hh.HORIZ_LINE_TO:this.pathH(e,r);break;case hh.VERT_LINE_TO:this.pathV(e,r);break;case hh.CURVE_TO:this.pathC(e,r);break;case hh.SMOOTH_CURVE_TO:this.pathS(e,r);break;case hh.QUAD_TO:this.pathQ(e,r);break;case hh.SMOOTH_QUAD_TO:this.pathT(e,r);break;case hh.ARC:this.pathA(e,r);break;case hh.CLOSE_PATH:this.pathZ(e,r)}return r}getBoundingBox(e){return this.path()}getMarkers(){var{pathParser:e}=this,t=e.getMarkerPoints(),r=e.getMarkerAngles();return t.map(((e,t)=>[e,r[t]]))}renderChildren(e){this.path(e),this.document.screen.mouse.checkPath(this,e);var t=this.getStyle("fill-rule");""!==e.fillStyle&&("inherit"!==t.getString("inherit")?e.fill(t.getString()):e.fill()),""!==e.strokeStyle&&("non-scaling-stroke"===this.getAttribute("vector-effect").getString()?(e.save(),e.setTransform(1,0,0,1,0,0),e.stroke(),e.restore()):e.stroke());var r=this.getMarkers();if(r){var i=r.length-1,n=this.getStyle("marker-start"),a=this.getStyle("marker-mid"),s=this.getStyle("marker-end");if(n.isUrlDefinition()){var o=n.getDefinition(),[l,h]=r[0];o.render(e,l,h)}if(a.isUrlDefinition())for(var A=a.getDefinition(),u=1;u<i;u++){var[c,d]=r[u];A.render(e,c,d)}if(s.isUrlDefinition()){var p=s.getDefinition(),[f,g]=r[i];p.render(e,f,g)}}}static pathM(e){var t=e.getAsCurrentPoint();return e.start=e.current,{point:t}}pathM(t,r){var{pathParser:i}=this,{point:n}=e.pathM(i),{x:a,y:s}=n;i.addMarker(n),r.addPoint(a,s),t&&t.moveTo(a,s)}static pathL(e){var{current:t}=e;return{current:t,point:e.getAsCurrentPoint()}}pathL(t,r){var{pathParser:i}=this,{current:n,point:a}=e.pathL(i),{x:s,y:o}=a;i.addMarker(a,n),r.addPoint(s,o),t&&t.lineTo(s,o)}static pathH(e){var{current:t,command:r}=e,i=new jl((r.relative?t.x:0)+r.x,t.y);return e.current=i,{current:t,point:i}}pathH(t,r){var{pathParser:i}=this,{current:n,point:a}=e.pathH(i),{x:s,y:o}=a;i.addMarker(a,n),r.addPoint(s,o),t&&t.lineTo(s,o)}static pathV(e){var{current:t,command:r}=e,i=new jl(t.x,(r.relative?t.y:0)+r.y);return e.current=i,{current:t,point:i}}pathV(t,r){var{pathParser:i}=this,{current:n,point:a}=e.pathV(i),{x:s,y:o}=a;i.addMarker(a,n),r.addPoint(s,o),t&&t.lineTo(s,o)}static pathC(e){var{current:t}=e;return{current:t,point:e.getPoint("x1","y1"),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathC(t,r){var{pathParser:i}=this,{current:n,point:a,controlPoint:s,currentPoint:o}=e.pathC(i);i.addMarker(o,s,a),r.addBezierCurve(n.x,n.y,a.x,a.y,s.x,s.y,o.x,o.y),t&&t.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathS(e){var{current:t}=e;return{current:t,point:e.getReflectedControlPoint(),controlPoint:e.getAsControlPoint("x2","y2"),currentPoint:e.getAsCurrentPoint()}}pathS(t,r){var{pathParser:i}=this,{current:n,point:a,controlPoint:s,currentPoint:o}=e.pathS(i);i.addMarker(o,s,a),r.addBezierCurve(n.x,n.y,a.x,a.y,s.x,s.y,o.x,o.y),t&&t.bezierCurveTo(a.x,a.y,s.x,s.y,o.x,o.y)}static pathQ(e){var{current:t}=e;return{current:t,controlPoint:e.getAsControlPoint("x1","y1"),currentPoint:e.getAsCurrentPoint()}}pathQ(t,r){var{pathParser:i}=this,{current:n,controlPoint:a,currentPoint:s}=e.pathQ(i);i.addMarker(s,a,a),r.addQuadraticCurve(n.x,n.y,a.x,a.y,s.x,s.y),t&&t.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathT(e){var{current:t}=e,r=e.getReflectedControlPoint();return e.control=r,{current:t,controlPoint:r,currentPoint:e.getAsCurrentPoint()}}pathT(t,r){var{pathParser:i}=this,{current:n,controlPoint:a,currentPoint:s}=e.pathT(i);i.addMarker(s,a,a),r.addQuadraticCurve(n.x,n.y,a.x,a.y,s.x,s.y),t&&t.quadraticCurveTo(a.x,a.y,s.x,s.y)}static pathA(e){var{current:t,command:r}=e,{rX:i,rY:n,xRot:a,lArcFlag:s,sweepFlag:o}=r,l=a*(Math.PI/180),h=e.getAsCurrentPoint(),A=new jl(Math.cos(l)*(t.x-h.x)/2+Math.sin(l)*(t.y-h.y)/2,-Math.sin(l)*(t.x-h.x)/2+Math.cos(l)*(t.y-h.y)/2),u=Math.pow(A.x,2)/Math.pow(i,2)+Math.pow(A.y,2)/Math.pow(n,2);u>1&&(i*=Math.sqrt(u),n*=Math.sqrt(u));var c=(s===o?-1:1)*Math.sqrt((Math.pow(i,2)*Math.pow(n,2)-Math.pow(i,2)*Math.pow(A.y,2)-Math.pow(n,2)*Math.pow(A.x,2))/(Math.pow(i,2)*Math.pow(A.y,2)+Math.pow(n,2)*Math.pow(A.x,2)));isNaN(c)&&(c=0);var d=new jl(c*i*A.y/n,c*-n*A.x/i),p=new jl((t.x+h.x)/2+Math.cos(l)*d.x-Math.sin(l)*d.y,(t.y+h.y)/2+Math.sin(l)*d.x+Math.cos(l)*d.y),f=al([1,0],[(A.x-d.x)/i,(A.y-d.y)/n]),g=[(A.x-d.x)/i,(A.y-d.y)/n],m=[(-A.x-d.x)/i,(-A.y-d.y)/n],y=al(g,m);return nl(g,m)<=-1&&(y=Math.PI),nl(g,m)>=1&&(y=0),{currentPoint:h,rX:i,rY:n,sweepFlag:o,xAxisRotation:l,centp:p,a1:f,ad:y}}pathA(t,r){var{pathParser:i}=this,{currentPoint:n,rX:a,rY:s,sweepFlag:o,xAxisRotation:l,centp:h,a1:A,ad:u}=e.pathA(i),c=1-o?1:-1,d=A+c*(u/2),p=new jl(h.x+a*Math.cos(d),h.y+s*Math.sin(d));if(i.addMarkerAngle(p,d-c*Math.PI/2),i.addMarkerAngle(n,d-c*Math.PI),r.addPoint(n.x,n.y),t&&!isNaN(A)&&!isNaN(u)){var f=a>s?a:s,g=a>s?1:a/s,m=a>s?s/a:1;t.translate(h.x,h.y),t.rotate(l),t.scale(g,m),t.arc(0,0,f,A,A+u,!!(1-o)),t.scale(1/g,1/m),t.rotate(-l),t.translate(-h.x,-h.y)}}static pathZ(e){e.current=e.start}pathZ(t,r){e.pathZ(this.pathParser),t&&r.x1!==r.x2&&r.y1!==r.y2&&t.closePath()}},ch=class extends uh{constructor(e,t,r){super(e,t,r),this.type="glyph",this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber(),this.unicode=this.getAttribute("unicode").getString(),this.arabicForm=this.getAttribute("arabic-form").getString()}},dh=class e extends Ah{constructor(t,r,i){super(t,r,new.target===e||i),this.type="text",this.x=0,this.y=0,this.measureCache=-1}setContext(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];super.setContext(e,t);var r=this.getStyle("dominant-baseline").getTextBaseline()||this.getStyle("alignment-baseline").getTextBaseline();r&&(e.textBaseline=r)}initializeCoordinates(){this.x=0,this.y=0,this.leafTexts=[],this.textChunkStart=0,this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY}getBoundingBox(e){if("text"!==this.type)return this.getTElementBoundingBox(e);this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e);var t=null;return this.children.forEach(((r,i)=>{var n=this.getChildBoundingBox(e,this,this,i);t?t.addBoundingBox(n):t=n})),t}getFontSize(){var{document:e,parent:t}=this,r=oh.parse(e.ctx.font).fontSize;return t.getStyle("font-size").getNumber(r)}getTElementBoundingBox(e){var t=this.getFontSize();return new lh(this.x,this.y-t,this.x+this.measureText(e),this.y)}getGlyph(e,t,r){var i=t[r],n=null;if(e.isArabic){var a=t.length,s=t[r-1],o=t[r+1],l="isolated";if((0===r||" "===s)&&r<a-1&&" "!==o&&(l="terminal"),r>0&&" "!==s&&r<a-1&&" "!==o&&(l="medial"),r>0&&" "!==s&&(r===a-1||" "===o)&&(l="initial"),typeof e.glyphs[i]<"u"){var h=e.glyphs[i];n=h instanceof ch?h:h[l]}}else n=e.glyphs[i];return n||(n=e.missingGlyph),n}getText(){return""}getTextFromNode(e){var t=e||this.node,r=Array.from(t.parentNode.childNodes),i=r.indexOf(t),n=r.length-1,a=Zo(t.textContent||"");return 0===i&&(a=Wo(a)),i===n&&(a=$o(a)),a}renderChildren(e){if("text"===this.type){this.initializeCoordinates(),this.adjustChildCoordinatesRecursive(e),this.children.forEach(((t,r)=>{this.renderChild(e,this,this,r)}));var{mouse:t}=this.document.screen;t.isWorking()&&t.checkBoundingBox(this,this.getBoundingBox(e))}else this.renderTElementChildren(e)}renderTElementChildren(e){var{document:t,parent:r}=this,i=this.getText(),n=r.getStyle("font-family").getDefinition();if(n)for(var{unitsPerEm:a}=n.fontFace,s=oh.parse(t.ctx.font),o=r.getStyle("font-size").getNumber(s.fontSize),l=r.getStyle("font-style").getString(s.fontStyle),h=o/a,A=n.isRTL?i.split("").reverse().join(""):i,u=Xo(r.getAttribute("dx").getString()),c=A.length,d=0;d<c;d++){var p=this.getGlyph(n,A,d);e.translate(this.x,this.y),e.scale(h,-h);var f=e.lineWidth;e.lineWidth=e.lineWidth*a/o,"italic"===l&&e.transform(1,0,.4,1,0,0),p.render(e),"italic"===l&&e.transform(1,0,-.4,1,0,0),e.lineWidth=f,e.scale(1/h,-1/h),e.translate(-this.x,-this.y),this.x+=o*(p.horizAdvX||n.horizAdvX)/a,typeof u[d]<"u"&&!isNaN(u[d])&&(this.x+=u[d])}else{var{x:g,y:m}=this;e.fillStyle&&e.fillText(i,g,m),e.strokeStyle&&e.strokeText(i,g,m)}}applyAnchoring(){if(!(this.textChunkStart>=this.leafTexts.length)){var e=this.leafTexts[this.textChunkStart],t=e.getStyle("text-anchor").getString("start"),r=0;r="start"===t?e.x-this.minX:"end"===t?e.x-this.maxX:e.x-(this.minX+this.maxX)/2;for(var i=this.textChunkStart;i<this.leafTexts.length;i++)this.leafTexts[i].x+=r;this.minX=Number.POSITIVE_INFINITY,this.maxX=Number.NEGATIVE_INFINITY,this.textChunkStart=this.leafTexts.length}}adjustChildCoordinatesRecursive(e){this.children.forEach(((t,r)=>{this.adjustChildCoordinatesRecursiveCore(e,this,this,r)})),this.applyAnchoring()}adjustChildCoordinatesRecursiveCore(e,t,r,i){var n=r.children[i];n.children.length>0?n.children.forEach(((r,i)=>{t.adjustChildCoordinatesRecursiveCore(e,t,n,i)})):this.adjustChildCoordinates(e,t,r,i)}adjustChildCoordinates(e,t,r,i){var n=r.children[i];if("function"!=typeof n.measureText)return n;e.save(),n.setContext(e,!0);var a=n.getAttribute("x"),s=n.getAttribute("y"),o=n.getAttribute("dx"),l=n.getAttribute("dy"),h=n.getStyle("font-family").getDefinition(),A=!!h&&h.isRTL;0===i&&(a.hasValue()||a.setValue(n.getInheritedAttribute("x")),s.hasValue()||s.setValue(n.getInheritedAttribute("y")),o.hasValue()||o.setValue(n.getInheritedAttribute("dx")),l.hasValue()||l.setValue(n.getInheritedAttribute("dy")));var u=n.measureText(e);return A&&(t.x-=u),a.hasValue()?(t.applyAnchoring(),n.x=a.getPixels("x"),o.hasValue()&&(n.x+=o.getPixels("x"))):(o.hasValue()&&(t.x+=o.getPixels("x")),n.x=t.x),t.x=n.x,A||(t.x+=u),s.hasValue()?(n.y=s.getPixels("y"),l.hasValue()&&(n.y+=l.getPixels("y"))):(l.hasValue()&&(t.y+=l.getPixels("y")),n.y=t.y),t.y=n.y,t.leafTexts.push(n),t.minX=Math.min(t.minX,n.x,n.x+u),t.maxX=Math.max(t.maxX,n.x,n.x+u),n.clearContext(e),e.restore(),n}getChildBoundingBox(e,t,r,i){var n=r.children[i];if("function"!=typeof n.getBoundingBox)return null;var a=n.getBoundingBox(e);return a?(n.children.forEach(((r,i)=>{var s=t.getChildBoundingBox(e,t,n,i);a.addBoundingBox(s)})),a):null}renderChild(e,t,r,i){var n=r.children[i];n.render(e),n.children.forEach(((r,i)=>{t.renderChild(e,t,n,i)}))}measureText(e){var{measureCache:t}=this;if(~t)return t;var r=this.getText(),i=this.measureTargetText(e,r);return this.measureCache=i,i}measureTargetText(e,t){if(!t.length)return 0;var{parent:r}=this,i=r.getStyle("font-family").getDefinition();if(i){for(var n=this.getFontSize(),a=i.isRTL?t.split("").reverse().join(""):t,s=Xo(r.getAttribute("dx").getString()),o=a.length,l=0,h=0;h<o;h++){l+=(this.getGlyph(i,a,h).horizAdvX||i.horizAdvX)*n/i.fontFace.unitsPerEm,typeof s[h]<"u"&&!isNaN(s[h])&&(l+=s[h])}return l}if(!e.measureText)return 10*t.length;e.save(),this.setContext(e,!0);var{width:A}=e.measureText(t);return this.clearContext(e),e.restore(),A}getInheritedAttribute(t){for(var r=this;r instanceof e&&r.isFirstChild();){var i=r.parent.getAttribute(t);if(i.hasValue(!0))return i.getValue("0");r=r.parent}return null}},ph=class e extends dh{constructor(t,r,i){super(t,r,new.target===e||i),this.type="tspan",this.text=this.children.length>0?"":this.getTextFromNode()}getText(){return this.text}},fh=class extends ph{constructor(){super(...arguments),this.type="textNode"}},gh=class extends Ah{constructor(){super(...arguments),this.type="svg",this.root=!1}setContext(e){var t,{document:r}=this,{screen:i,window:n}=r,a=e.canvas;if(i.setDefaults(e),a.style&&typeof e.font<"u"&&n&&typeof n.getComputedStyle<"u"){e.font=n.getComputedStyle(a).getPropertyValue("font");var s=new zl(r,"fontSize",oh.parse(e.font).fontSize);s.hasValue()&&(r.rootEmSize=s.getPixels("y"),r.emSize=r.rootEmSize)}this.getAttribute("x").hasValue()||this.getAttribute("x",!0).setValue(0),this.getAttribute("y").hasValue()||this.getAttribute("y",!0).setValue(0);var{width:o,height:l}=i.viewPort;this.getStyle("width").hasValue()||this.getStyle("width",!0).setValue("100%"),this.getStyle("height").hasValue()||this.getStyle("height",!0).setValue("100%"),this.getStyle("color").hasValue()||this.getStyle("color",!0).setValue("black");var h=this.getAttribute("refX"),A=this.getAttribute("refY"),u=this.getAttribute("viewBox"),c=u.hasValue()?Xo(u.getString()):null,d=!this.root&&"visible"!==this.getStyle("overflow").getValue("hidden"),p=0,f=0,g=0,m=0;c&&(p=c[0],f=c[1]),this.root||(o=this.getStyle("width").getPixels("x"),l=this.getStyle("height").getPixels("y"),"marker"===this.type&&(g=p,m=f,p=0,f=0)),i.viewPort.setCurrent(o,l),this.node&&(!this.parent||"foreignObject"===(null===(t=this.node.parentNode)||void 0===t?void 0:t.nodeName))&&this.getStyle("transform",!1,!0).hasValue()&&!this.getStyle("transform-origin",!1,!0).hasValue()&&this.getStyle("transform-origin",!0,!0).setValue("50% 50%"),super.setContext(e),e.translate(this.getAttribute("x").getPixels("x"),this.getAttribute("y").getPixels("y")),c&&(o=c[2],l=c[3]),r.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:i.viewPort.width,desiredWidth:o,height:i.viewPort.height,desiredHeight:l,minX:p,minY:f,refX:h.getValue(),refY:A.getValue(),clip:d,clipX:g,clipY:m}),c&&(i.viewPort.removeCurrent(),i.viewPort.setCurrent(o,l))}clearContext(e){super.clearContext(e),this.document.screen.viewPort.removeCurrent()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=this.getAttribute("width",!0),n=this.getAttribute("height",!0),a=this.getAttribute("viewBox"),s=this.getAttribute("style"),o=i.getNumber(0),l=n.getNumber(0);if(r)if("string"==typeof r)this.getAttribute("preserveAspectRatio",!0).setValue(r);else{var h=this.getAttribute("preserveAspectRatio");h.hasValue()&&h.setValue(h.getString().replace(/^\s*(\S.*\S)\s*$/,"$1"))}if(i.setValue(e),n.setValue(t),a.hasValue()||a.setValue("0 0 ".concat(o||e," ").concat(l||t)),s.hasValue()){var A=this.getStyle("width"),u=this.getStyle("height");A.hasValue()&&A.setValue("".concat(e,"px")),u.hasValue()&&u.setValue("".concat(t,"px"))}}},mh=class extends uh{constructor(){super(...arguments),this.type="rect"}path(e){var t=this.getAttribute("x").getPixels("x"),r=this.getAttribute("y").getPixels("y"),i=this.getStyle("width",!1,!0).getPixels("x"),n=this.getStyle("height",!1,!0).getPixels("y"),a=this.getAttribute("rx"),s=this.getAttribute("ry"),o=a.getPixels("x"),l=s.getPixels("y");if(a.hasValue()&&!s.hasValue()&&(l=o),s.hasValue()&&!a.hasValue()&&(o=l),o=Math.min(o,i/2),l=Math.min(l,n/2),e){var h=(Math.sqrt(2)-1)/3*4;e.beginPath(),n>0&&i>0&&(e.moveTo(t+o,r),e.lineTo(t+i-o,r),e.bezierCurveTo(t+i-o+h*o,r,t+i,r+l-h*l,t+i,r+l),e.lineTo(t+i,r+n-l),e.bezierCurveTo(t+i,r+n-l+h*l,t+i-o+h*o,r+n,t+i-o,r+n),e.lineTo(t+o,r+n),e.bezierCurveTo(t+o-h*o,r+n,t,r+n-l+h*l,t,r+n-l),e.lineTo(t,r+l),e.bezierCurveTo(t,r+l-h*l,t+o-h*o,r,t+o,r),e.closePath())}return new lh(t,r,t+i,r+n)}getMarkers(){return null}},yh=class extends uh{constructor(){super(...arguments),this.type="circle"}path(e){var t=this.getAttribute("cx").getPixels("x"),r=this.getAttribute("cy").getPixels("y"),i=this.getAttribute("r").getPixels();return e&&i>0&&(e.beginPath(),e.arc(t,r,i,0,2*Math.PI,!1),e.closePath()),new lh(t-i,r-i,t+i,r+i)}getMarkers(){return null}},_h=class extends uh{constructor(){super(...arguments),this.type="ellipse"}path(e){var t=(Math.sqrt(2)-1)/3*4,r=this.getAttribute("rx").getPixels("x"),i=this.getAttribute("ry").getPixels("y"),n=this.getAttribute("cx").getPixels("x"),a=this.getAttribute("cy").getPixels("y");return e&&r>0&&i>0&&(e.beginPath(),e.moveTo(n+r,a),e.bezierCurveTo(n+r,a+t*i,n+t*r,a+i,n,a+i),e.bezierCurveTo(n-t*r,a+i,n-r,a+t*i,n-r,a),e.bezierCurveTo(n-r,a-t*i,n-t*r,a-i,n,a-i),e.bezierCurveTo(n+t*r,a-i,n+r,a-t*i,n+r,a),e.closePath()),new lh(n-r,a-i,n+r,a+i)}getMarkers(){return null}},vh=class extends uh{constructor(){super(...arguments),this.type="line"}getPoints(){return[new jl(this.getAttribute("x1").getPixels("x"),this.getAttribute("y1").getPixels("y")),new jl(this.getAttribute("x2").getPixels("x"),this.getAttribute("y2").getPixels("y"))]}path(e){var[{x:t,y:r},{x:i,y:n}]=this.getPoints();return e&&(e.beginPath(),e.moveTo(t,r),e.lineTo(i,n)),new lh(t,r,i,n)}getMarkers(){var[e,t]=this.getPoints(),r=e.angleTo(t);return[[e,r],[t,r]]}},wh=class extends uh{constructor(e,t,r){super(e,t,r),this.type="polyline",this.points=[],this.points=jl.parsePath(this.getAttribute("points").getString())}path(e){var{points:t}=this,[{x:r,y:i}]=t,n=new lh(r,i);return e&&(e.beginPath(),e.moveTo(r,i)),t.forEach((t=>{var{x:r,y:i}=t;n.addPoint(r,i),e&&e.lineTo(r,i)})),n}getMarkers(){var{points:e}=this,t=e.length-1,r=[];return e.forEach(((i,n)=>{n!==t&&r.push([i,i.angleTo(e[n+1])])})),r.length>0&&r.push([e[e.length-1],r[r.length-1][1]]),r}},bh=class extends wh{constructor(){super(...arguments),this.type="polygon"}path(e){var t=super.path(e),[{x:r,y:i}]=this.points;return e&&(e.lineTo(r,i),e.closePath()),t}},xh=class extends ah{constructor(){super(...arguments),this.type="pattern"}createPattern(e,t,r){var i=this.getStyle("width").getPixels("x",!0),n=this.getStyle("height").getPixels("y",!0),a=new gh(this.document,null);a.attributes.viewBox=new zl(this.document,"viewBox",this.getAttribute("viewBox").getValue()),a.attributes.width=new zl(this.document,"width","".concat(i,"px")),a.attributes.height=new zl(this.document,"height","".concat(n,"px")),a.attributes.transform=new zl(this.document,"transform",this.getAttribute("patternTransform").getValue()),a.children=this.children;var s=this.document.createCanvas(i,n),o=s.getContext("2d"),l=this.getAttribute("x"),h=this.getAttribute("y");l.hasValue()&&h.hasValue()&&o.translate(l.getPixels("x",!0),h.getPixels("y",!0)),r.hasValue()?this.styles["fill-opacity"]=r:Reflect.deleteProperty(this.styles,"fill-opacity");for(var A=-1;A<=1;A++)for(var u=-1;u<=1;u++)o.save(),a.attributes.x=new zl(this.document,"x",A*s.width),a.attributes.y=new zl(this.document,"y",u*s.height),a.render(o),o.restore();return e.createPattern(s,"repeat")}},Bh=class extends ah{constructor(){super(...arguments),this.type="marker"}render(e,t,r){if(t){var{x:i,y:n}=t,a=this.getAttribute("orient").getString("auto"),s=this.getAttribute("markerUnits").getString("strokeWidth");e.translate(i,n),"auto"===a&&e.rotate(r),"strokeWidth"===s&&e.scale(e.lineWidth,e.lineWidth),e.save();var o=new gh(this.document,null);o.type=this.type,o.attributes.viewBox=new zl(this.document,"viewBox",this.getAttribute("viewBox").getValue()),o.attributes.refX=new zl(this.document,"refX",this.getAttribute("refX").getValue()),o.attributes.refY=new zl(this.document,"refY",this.getAttribute("refY").getValue()),o.attributes.width=new zl(this.document,"width",this.getAttribute("markerWidth").getValue()),o.attributes.height=new zl(this.document,"height",this.getAttribute("markerHeight").getValue()),o.attributes.overflow=new zl(this.document,"overflow",this.getAttribute("overflow").getValue()),o.attributes.fill=new zl(this.document,"fill",this.getAttribute("fill").getColor("black")),o.attributes.stroke=new zl(this.document,"stroke",this.getAttribute("stroke").getValue("none")),o.children=this.children,o.render(e),e.restore(),"strokeWidth"===s&&e.scale(1/e.lineWidth,1/e.lineWidth),"auto"===a&&e.rotate(-r),e.translate(-i,-n)}}},Ch=class extends ah{constructor(){super(...arguments),this.type="defs"}render(){}},Sh=class extends Ah{constructor(){super(...arguments),this.type="g"}getBoundingBox(e){var t=new lh;return this.children.forEach((r=>{t.addBoundingBox(r.getBoundingBox(e))})),t}},Eh=class extends ah{constructor(e,t,r){super(e,t,r),this.attributesToInherit=["gradientUnits"],this.stops=[];var{stops:i,children:n}=this;n.forEach((e=>{"stop"===e.type&&i.push(e)}))}getGradientUnits(){return this.getAttribute("gradientUnits").getString("objectBoundingBox")}createGradient(e,t,r){var i=this;this.getHrefAttribute().hasValue()&&(i=this.getHrefAttribute().getDefinition(),this.inheritStopContainer(i));var{stops:n}=i,a=this.getGradient(e,t);if(!a)return this.addParentOpacity(r,n[n.length-1].color);if(n.forEach((e=>{a.addColorStop(e.offset,this.addParentOpacity(r,e.color))})),this.getAttribute("gradientTransform").hasValue()){var{document:s}=this,{MAX_VIRTUAL_PIXELS:o,viewPort:l}=s.screen,[h]=l.viewPorts,A=new mh(s,null);A.attributes.x=new zl(s,"x",-o/3),A.attributes.y=new zl(s,"y",-o/3),A.attributes.width=new zl(s,"width",o),A.attributes.height=new zl(s,"height",o);var u=new Sh(s,null);u.attributes.transform=new zl(s,"transform",this.getAttribute("gradientTransform").getValue()),u.children=[A];var c=new gh(s,null);c.attributes.x=new zl(s,"x",0),c.attributes.y=new zl(s,"y",0),c.attributes.width=new zl(s,"width",h.width),c.attributes.height=new zl(s,"height",h.height),c.children=[u];var d=s.createCanvas(h.width,h.height),p=d.getContext("2d");return p.fillStyle=a,c.render(p),p.createPattern(d,"no-repeat")}return a}inheritStopContainer(e){this.attributesToInherit.forEach((t=>{!this.getAttribute(t).hasValue()&&e.getAttribute(t).hasValue()&&this.getAttribute(t,!0).setValue(e.getAttribute(t).getValue())}))}addParentOpacity(e,t){return e.hasValue()?new zl(this.document,"color",t).addOpacity(e).getColor():t}},Ih=class extends Eh{constructor(e,t,r){super(e,t,r),this.type="linearGradient",this.attributesToInherit.push("x1","y1","x2","y2")}getGradient(e,t){var r="objectBoundingBox"===this.getGradientUnits(),i=r?t.getBoundingBox(e):null;if(r&&!i)return null;!this.getAttribute("x1").hasValue()&&!this.getAttribute("y1").hasValue()&&!this.getAttribute("x2").hasValue()&&!this.getAttribute("y2").hasValue()&&(this.getAttribute("x1",!0).setValue(0),this.getAttribute("y1",!0).setValue(0),this.getAttribute("x2",!0).setValue(1),this.getAttribute("y2",!0).setValue(0));var n=r?i.x+i.width*this.getAttribute("x1").getNumber():this.getAttribute("x1").getPixels("x"),a=r?i.y+i.height*this.getAttribute("y1").getNumber():this.getAttribute("y1").getPixels("y"),s=r?i.x+i.width*this.getAttribute("x2").getNumber():this.getAttribute("x2").getPixels("x"),o=r?i.y+i.height*this.getAttribute("y2").getNumber():this.getAttribute("y2").getPixels("y");return n===s&&a===o?null:e.createLinearGradient(n,a,s,o)}},Th=class extends Eh{constructor(e,t,r){super(e,t,r),this.type="radialGradient",this.attributesToInherit.push("cx","cy","r","fx","fy","fr")}getGradient(e,t){var r="objectBoundingBox"===this.getGradientUnits(),i=t.getBoundingBox(e);if(r&&!i)return null;this.getAttribute("cx").hasValue()||this.getAttribute("cx",!0).setValue("50%"),this.getAttribute("cy").hasValue()||this.getAttribute("cy",!0).setValue("50%"),this.getAttribute("r").hasValue()||this.getAttribute("r",!0).setValue("50%");var n=r?i.x+i.width*this.getAttribute("cx").getNumber():this.getAttribute("cx").getPixels("x"),a=r?i.y+i.height*this.getAttribute("cy").getNumber():this.getAttribute("cy").getPixels("y"),s=n,o=a;this.getAttribute("fx").hasValue()&&(s=r?i.x+i.width*this.getAttribute("fx").getNumber():this.getAttribute("fx").getPixels("x")),this.getAttribute("fy").hasValue()&&(o=r?i.y+i.height*this.getAttribute("fy").getNumber():this.getAttribute("fy").getPixels("y"));var l=r?(i.width+i.height)/2*this.getAttribute("r").getNumber():this.getAttribute("r").getPixels(),h=this.getAttribute("fr").getPixels();return e.createRadialGradient(s,o,h,n,a,l)}},Fh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="stop";var i=Math.max(0,Math.min(1,this.getAttribute("offset").getNumber())),n=this.getStyle("stop-opacity"),a=this.getStyle("stop-color",!0);""===a.getString()&&a.setValue("#000"),n.hasValue()&&(a=a.addOpacity(n)),this.offset=i,this.color=a.getColor()}},Ph=class extends ah{constructor(e,t,r){super(e,t,r),this.type="animate",this.duration=0,this.initialValue=null,this.initialUnits="",this.removed=!1,this.frozen=!1,e.screen.animations.push(this),this.begin=this.getAttribute("begin").getMilliseconds(),this.maxDuration=this.begin+this.getAttribute("dur").getMilliseconds(),this.from=this.getAttribute("from"),this.to=this.getAttribute("to"),this.values=new zl(e,"values",null);var i=this.getAttribute("values");i.hasValue()&&this.values.setValue(i.getString().split(";"))}getProperty(){var e=this.getAttribute("attributeType").getString(),t=this.getAttribute("attributeName").getString();return"CSS"===e?this.parent.getStyle(t,!0):this.parent.getAttribute(t,!0)}calcValue(){var{initialUnits:e}=this,{progress:t,from:r,to:i}=this.getProgress(),n=r.getNumber()+(i.getNumber()-r.getNumber())*t;return"%"===e&&(n*=100),"".concat(n).concat(e)}update(e){var{parent:t}=this,r=this.getProperty();if(this.initialValue||(this.initialValue=r.getString(),this.initialUnits=r.getUnits()),this.duration>this.maxDuration){var i=this.getAttribute("fill").getString("remove");if("indefinite"===this.getAttribute("repeatCount").getString()||"indefinite"===this.getAttribute("repeatDur").getString())this.duration=0;else if("freeze"!==i||this.frozen){if("remove"===i&&!this.removed)return this.removed=!0,r.setValue(t.animationFrozen?t.animationFrozenValue:this.initialValue),!0}else this.frozen=!0,t.animationFrozen=!0,t.animationFrozenValue=r.getString();return!1}this.duration+=e;var n=!1;if(this.begin<this.duration){var a=this.calcValue(),s=this.getAttribute("type");if(s.hasValue()){var o=s.getString();a="".concat(o,"(").concat(a,")")}r.setValue(a),n=!0}return n}getProgress(){var{document:e,values:t}=this,r={progress:(this.duration-this.begin)/(this.maxDuration-this.begin)};if(t.hasValue()){var i=r.progress*(t.getValue().length-1),n=Math.floor(i),a=Math.ceil(i);r.from=new zl(e,"from",parseFloat(t.getValue()[n])),r.to=new zl(e,"to",parseFloat(t.getValue()[a])),r.progress=(i-n)/(a-n)}else r.from=this.from,r.to=this.to;return r}},Lh=class extends Ph{constructor(){super(...arguments),this.type="animateColor"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=new Fl.default(t.getColor()),n=new Fl.default(r.getColor());if(i.ok&&n.ok){var a=i.r+(n.r-i.r)*e,s=i.g+(n.g-i.g)*e,o=i.b+(n.b-i.b)*e;return"rgb(".concat(Math.floor(a),", ").concat(Math.floor(s),", ").concat(Math.floor(o),")")}return this.getAttribute("from").getColor()}},Mh=class extends Ph{constructor(){super(...arguments),this.type="animateTransform"}calcValue(){var{progress:e,from:t,to:r}=this.getProgress(),i=Xo(t.getString()),n=Xo(r.getString());return i.map(((t,r)=>t+(n[r]-t)*e)).join(" ")}},kh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="font",this.glyphs=Object.create(null),this.horizAdvX=this.getAttribute("horiz-adv-x").getNumber();var{definitions:i}=e,{children:n}=this;for(var a of n)switch(a.type){case"font-face":this.fontFace=a;var s=a.getStyle("font-family");s.hasValue()&&(i[s.getString()]=this);break;case"missing-glyph":this.missingGlyph=a;break;case"glyph":var o=a;o.arabicForm?(this.isRTL=!0,this.isArabic=!0,typeof this.glyphs[o.unicode]>"u"&&(this.glyphs[o.unicode]=Object.create(null)),this.glyphs[o.unicode][o.arabicForm]=o):this.glyphs[o.unicode]=o}}render(){}},Uh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="font-face",this.ascent=this.getAttribute("ascent").getNumber(),this.descent=this.getAttribute("descent").getNumber(),this.unitsPerEm=this.getAttribute("units-per-em").getNumber()}},Rh=class extends uh{constructor(){super(...arguments),this.type="missing-glyph",this.horizAdvX=0}},Dh=class extends dh{constructor(){super(...arguments),this.type="tref"}getText(){var e=this.getHrefAttribute().getDefinition();if(e){var t=e.children[0];if(t)return t.getText()}return""}},Nh=class extends dh{constructor(e,t,r){super(e,t,r),this.type="a";var{childNodes:i}=t,n=i[0],a=i.length>0&&Array.from(i).every((e=>3===e.nodeType));this.hasText=a,this.text=a?this.getTextFromNode(n):""}getText(){return this.text}renderChildren(e){if(this.hasText){super.renderChildren(e);var{document:t,x:r,y:i}=this,{mouse:n}=t.screen,a=new zl(t,"fontSize",oh.parse(t.ctx.font).fontSize);n.isWorking()&&n.checkBoundingBox(this,new lh(r,i-a.getPixels("y"),r+this.measureText(e),i))}else if(this.children.length>0){var s=new Sh(this.document,null);s.children=this.children,s.parent=this,s.render(e)}}onClick(){var{window:e}=this.document;e&&e.open(this.getHrefAttribute().getString())}onMouseMove(){this.document.ctx.canvas.style.cursor="pointer"}},Oh=class extends dh{constructor(e,t,r){super(e,t,r),this.type="textPath",this.textWidth=0,this.textHeight=0,this.pathLength=-1,this.glyphInfo=null,this.letterSpacingCache=[],this.measuresCache=new Map([["",0]]);var i=this.getHrefAttribute().getDefinition();this.text=this.getTextFromNode(),this.dataArray=this.parsePathData(i)}getText(){return this.text}path(e){var{dataArray:t}=this;e&&e.beginPath(),t.forEach((t=>{var{type:r,points:i}=t;switch(r){case hh.LINE_TO:e&&e.lineTo(i[0],i[1]);break;case hh.MOVE_TO:e&&e.moveTo(i[0],i[1]);break;case hh.CURVE_TO:e&&e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]);break;case hh.QUAD_TO:e&&e.quadraticCurveTo(i[0],i[1],i[2],i[3]);break;case hh.ARC:var[n,a,s,o,l,h,A,u]=i,c=s>o?s:o,d=s>o?1:s/o,p=s>o?o/s:1;e&&(e.translate(n,a),e.rotate(A),e.scale(d,p),e.arc(0,0,c,l,l+h,!!(1-u)),e.scale(1/d,1/p),e.rotate(-A),e.translate(-n,-a));break;case hh.CLOSE_PATH:e&&e.closePath()}}))}renderChildren(e){this.setTextData(e),e.save();var t=this.parent.getStyle("text-decoration").getString(),r=this.getFontSize(),{glyphInfo:i}=this,n=e.fillStyle;"underline"===t&&e.beginPath(),i.forEach(((i,n)=>{var{p0:a,p1:s,rotation:o,text:l}=i;e.save(),e.translate(a.x,a.y),e.rotate(o),e.fillStyle&&e.fillText(l,0,0),e.strokeStyle&&e.strokeText(l,0,0),e.restore(),"underline"===t&&(0===n&&e.moveTo(a.x,a.y+r/8),e.lineTo(s.x,s.y+r/5))})),"underline"===t&&(e.lineWidth=r/20,e.strokeStyle=n,e.stroke(),e.closePath()),e.restore()}getLetterSpacingAt(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return this.letterSpacingCache[e]||0}findSegmentToFitChar(e,t,r,i,n,a,s,o,l){var h=a,A=this.measureText(e,o);" "===o&&"justify"===t&&r<i&&(A+=(i-r)/n),l>-1&&(h+=this.getLetterSpacingAt(l));var u=this.textHeight/20,c=this.getEquidistantPointOnPath(h,u,0),d=this.getEquidistantPointOnPath(h+A,u,0),p={p0:c,p1:d},f=c&&d?Math.atan2(d.y-c.y,d.x-c.x):0;if(s){var g=Math.cos(Math.PI/2+f)*s,m=Math.cos(-f)*s;p.p0=yl(yl({},c),{},{x:c.x+g,y:c.y+m}),p.p1=yl(yl({},d),{},{x:d.x+g,y:d.y+m})}return{offset:h+=A,segment:p,rotation:f}}measureText(e,t){var{measuresCache:r}=this,i=t||this.getText();if(r.has(i))return r.get(i);var n=this.measureTargetText(e,i);return r.set(i,n),n}setTextData(e){if(!this.glyphInfo){var t=this.getText(),r=t.split(""),i=t.split(" ").length-1,n=this.parent.getAttribute("dx").split().map((e=>e.getPixels("x"))),a=this.parent.getAttribute("dy").getPixels("y"),s=this.parent.getStyle("text-anchor").getString("start"),o=this.getStyle("letter-spacing"),l=this.parent.getStyle("letter-spacing"),h=0;o.hasValue()&&"inherit"!==o.getValue()?o.hasValue()&&"initial"!==o.getValue()&&"unset"!==o.getValue()&&(h=o.getPixels()):h=l.getPixels();var A=[],u=t.length;this.letterSpacingCache=A;for(var c=0;c<u;c++)A.push(typeof n[c]<"u"?n[c]:h);var d=A.reduce(((e,t,r)=>0===r?0:e+t||0),0),p=this.measureText(e),f=Math.max(p+d,0);this.textWidth=p,this.textHeight=this.getFontSize(),this.glyphInfo=[];var g=this.getPathLength(),m=this.getStyle("startOffset").getNumber(0)*g,y=0;("middle"===s||"center"===s)&&(y=-f/2),("end"===s||"right"===s)&&(y=-f),y+=m,r.forEach(((t,n)=>{var{offset:o,segment:l,rotation:h}=this.findSegmentToFitChar(e,s,f,g,i,y,a,t,n);y=o,l.p0&&l.p1&&this.glyphInfo.push({text:r[n],p0:l.p0,p1:l.p1,rotation:h})}))}}parsePathData(e){if(this.pathLength=-1,!e)return[];var t=[],{pathParser:r}=e;for(r.reset();!r.isEnd();){var{current:i}=r,n=i?i.x:0,a=i?i.y:0,s=r.next(),o=s.type,l=[];switch(s.type){case hh.MOVE_TO:this.pathM(r,l);break;case hh.LINE_TO:o=this.pathL(r,l);break;case hh.HORIZ_LINE_TO:o=this.pathH(r,l);break;case hh.VERT_LINE_TO:o=this.pathV(r,l);break;case hh.CURVE_TO:this.pathC(r,l);break;case hh.SMOOTH_CURVE_TO:o=this.pathS(r,l);break;case hh.QUAD_TO:this.pathQ(r,l);break;case hh.SMOOTH_QUAD_TO:o=this.pathT(r,l);break;case hh.ARC:l=this.pathA(r);break;case hh.CLOSE_PATH:uh.pathZ(r)}s.type!==hh.CLOSE_PATH?t.push({type:o,points:l,start:{x:n,y:a},pathLength:this.calcLength(n,a,o,l)}):t.push({type:hh.CLOSE_PATH,points:[],pathLength:0})}return t}pathM(e,t){var{x:r,y:i}=uh.pathM(e).point;t.push(r,i)}pathL(e,t){var{x:r,y:i}=uh.pathL(e).point;return t.push(r,i),hh.LINE_TO}pathH(e,t){var{x:r,y:i}=uh.pathH(e).point;return t.push(r,i),hh.LINE_TO}pathV(e,t){var{x:r,y:i}=uh.pathV(e).point;return t.push(r,i),hh.LINE_TO}pathC(e,t){var{point:r,controlPoint:i,currentPoint:n}=uh.pathC(e);t.push(r.x,r.y,i.x,i.y,n.x,n.y)}pathS(e,t){var{point:r,controlPoint:i,currentPoint:n}=uh.pathS(e);return t.push(r.x,r.y,i.x,i.y,n.x,n.y),hh.CURVE_TO}pathQ(e,t){var{controlPoint:r,currentPoint:i}=uh.pathQ(e);t.push(r.x,r.y,i.x,i.y)}pathT(e,t){var{controlPoint:r,currentPoint:i}=uh.pathT(e);return t.push(r.x,r.y,i.x,i.y),hh.QUAD_TO}pathA(e){var{rX:t,rY:r,sweepFlag:i,xAxisRotation:n,centp:a,a1:s,ad:o}=uh.pathA(e);return 0===i&&o>0&&(o-=2*Math.PI),1===i&&o<0&&(o+=2*Math.PI),[a.x,a.y,t,r,s,o,n,i]}calcLength(e,t,r,i){var n=0,a=null,s=null,o=0;switch(r){case hh.LINE_TO:return this.getLineLength(e,t,i[0],i[1]);case hh.CURVE_TO:for(n=0,a=this.getPointOnCubicBezier(0,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),o=.01;o<=1;o+=.01)s=this.getPointOnCubicBezier(o,e,t,i[0],i[1],i[2],i[3],i[4],i[5]),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case hh.QUAD_TO:for(n=0,a=this.getPointOnQuadraticBezier(0,e,t,i[0],i[1],i[2],i[3]),o=.01;o<=1;o+=.01)s=this.getPointOnQuadraticBezier(o,e,t,i[0],i[1],i[2],i[3]),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return n;case hh.ARC:n=0;var l=i[4],h=i[5],A=i[4]+h,u=Math.PI/180;if(Math.abs(l-A)<u&&(u=Math.abs(l-A)),a=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],l,0),h<0)for(o=l-u;o>A;o-=u)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;else for(o=l+u;o<A;o+=u)s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],o,0),n+=this.getLineLength(a.x,a.y,s.x,s.y),a=s;return s=this.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],A,0),n+=this.getLineLength(a.x,a.y,s.x,s.y)}return 0}getPointOnLine(e,t,r,i,n){var a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:t,s=arguments.length>6&&void 0!==arguments[6]?arguments[6]:r,o=(n-r)/(i-t+Ql),l=Math.sqrt(e*e/(1+o*o));i<t&&(l*=-1);var h=o*l,A=null;if(i===t)A={x:a,y:s+h};else if((s-r)/(a-t+Ql)===o)A={x:a+l,y:s+h};else{var u,c,d=this.getLineLength(t,r,i,n);if(d<Ql)return null;var p=(a-t)*(i-t)+(s-r)*(n-r);u=t+(p/=d*d)*(i-t),c=r+p*(n-r);var f=this.getLineLength(a,s,u,c),g=Math.sqrt(e*e-f*f);l=Math.sqrt(g*g/(1+o*o)),i<t&&(l*=-1),A={x:u+l,y:c+(h=o*l)}}return A}getPointOnPath(e){var t=this.getPathLength(),r=0,i=null;if(e<-5e-5||e-5e-5>t)return null;var{dataArray:n}=this;for(var a of n){if(!a||!(a.pathLength<5e-5||r+a.pathLength+5e-5<e)){var s=e-r,o=0;switch(a.type){case hh.LINE_TO:i=this.getPointOnLine(s,a.start.x,a.start.y,a.points[0],a.points[1],a.start.x,a.start.y);break;case hh.ARC:var l=a.points[4],h=a.points[5],A=a.points[4]+h;if(o=l+s/a.pathLength*h,h<0&&o<A||h>=0&&o>A)break;i=this.getPointOnEllipticalArc(a.points[0],a.points[1],a.points[2],a.points[3],o,a.points[6]);break;case hh.CURVE_TO:(o=s/a.pathLength)>1&&(o=1),i=this.getPointOnCubicBezier(o,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3],a.points[4],a.points[5]);break;case hh.QUAD_TO:(o=s/a.pathLength)>1&&(o=1),i=this.getPointOnQuadraticBezier(o,a.start.x,a.start.y,a.points[0],a.points[1],a.points[2],a.points[3])}if(i)return i;break}r+=a.pathLength}return null}getLineLength(e,t,r,i){return Math.sqrt((r-e)*(r-e)+(i-t)*(i-t))}getPathLength(){return-1===this.pathLength&&(this.pathLength=this.dataArray.reduce(((e,t)=>t.pathLength>0?e+t.pathLength:e),0)),this.pathLength}getPointOnCubicBezier(e,t,r,i,n,a,s,o,l){return{x:o*sl(e)+a*ol(e)+i*ll(e)+t*hl(e),y:l*sl(e)+s*ol(e)+n*ll(e)+r*hl(e)}}getPointOnQuadraticBezier(e,t,r,i,n,a,s){return{x:a*Al(e)+i*ul(e)+t*cl(e),y:s*Al(e)+n*ul(e)+r*cl(e)}}getPointOnEllipticalArc(e,t,r,i,n,a){var s=Math.cos(a),o=Math.sin(a),l=r*Math.cos(n),h=i*Math.sin(n);return{x:e+(l*s-h*o),y:t+(l*o+h*s)}}buildEquidistantCache(e,t){var r=this.getPathLength(),i=t||.25,n=e||r/100;if(!this.equidistantCache||this.equidistantCache.step!==n||this.equidistantCache.precision!==i){this.equidistantCache={step:n,precision:i,points:[]};for(var a=0,s=0;s<=r;s+=i){var o=this.getPointOnPath(s),l=this.getPointOnPath(s+i);!o||!l||(a+=this.getLineLength(o.x,o.y,l.x,l.y))>=n&&(this.equidistantCache.points.push({x:o.x,y:o.y,distance:s}),a-=n)}}}getEquidistantPointOnPath(e,t,r){if(this.buildEquidistantCache(t,r),e<0||e-this.getPathLength()>5e-5)return null;var i=Math.round(e/this.getPathLength()*(this.equidistantCache.points.length-1));return this.equidistantCache.points[i]||null}},Qh=/^\s*data:(([^/,;]+\/[^/,;]+)(?:;([^,;=]+=[^,;=]+))?)?(?:;(base64))?,(.*)$/i,zh=class extends Ah{constructor(e,t,r){super(e,t,r),this.type="image",this.loaded=!1;var i=this.getHrefAttribute().getString();if(i){var n=i.endsWith(".svg")||/^\s*data:image\/svg\+xml/i.test(i);e.images.push(this),n?this.loadSvg(i):this.loadImage(i),this.isSvg=n}}loadImage(e){var t=this;return us((function*(){try{var r=yield t.document.createImage(e);t.image=r}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0}))()}loadSvg(e){var t=this;return us((function*(){var r=Qh.exec(e);if(r){var i=r[5];"base64"===r[4]?t.image=atob(i):t.image=decodeURIComponent(i)}else try{var n=yield t.document.fetch(e),a=yield n.text();t.image=a}catch(t){console.error('Error while loading image "'.concat(e,'":'),t)}t.loaded=!0}))()}renderChildren(e){var{document:t,image:r,loaded:i}=this,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(i&&r&&s&&o){if(e.save(),e.translate(n,a),this.isSvg){var l=t.canvg.forkString(e,this.image,{ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0,ignoreClear:!0,offsetX:0,offsetY:0,scaleWidth:s,scaleHeight:o});l.document.documentElement.parent=this,l.render()}else{var h=this.image;t.setViewBox({ctx:e,aspectRatio:this.getAttribute("preserveAspectRatio").getString(),width:s,desiredWidth:h.width,height:o,desiredHeight:h.height}),this.loaded&&(typeof h.complete>"u"||h.complete)&&e.drawImage(h,0,0)}e.restore()}}getBoundingBox(){var e=this.getAttribute("x").getPixels("x"),t=this.getAttribute("y").getPixels("y"),r=this.getStyle("width").getPixels("x"),i=this.getStyle("height").getPixels("y");return new lh(e,t,e+r,t+i)}},Hh=class extends Ah{constructor(){super(...arguments),this.type="symbol"}render(e){}},jh=class{constructor(e){this.document=e,this.loaded=!1,e.fonts.push(this)}load(e,t){var r=this;return us((function*(){try{var{document:i}=r,n=(yield i.canvg.parser.load(t)).getElementsByTagName("font");Array.from(n).forEach((t=>{var r=i.createElement(t);i.definitions[e]=r}))}catch(e){console.error('Error while loading font "'.concat(t,'":'),e)}r.loaded=!0}))()}},(Vh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="style",Zo(Array.from(t.childNodes).map((e=>e.textContent)).join("").replace(/(\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*+\/)|(^[\s]*\/\/.*)/gm,"").replace(/@import.*;/g,"")).split("}").forEach((t=>{var r=t.trim();if(r){var i=r.split("{"),n=i[0].split(","),a=i[1].split(";");n.forEach((t=>{var r=t.trim();if(r){var i=e.styles[r]||{};if(a.forEach((t=>{var r=t.indexOf(":"),n=t.substr(0,r).trim(),a=t.substr(r+1,t.length-r).trim();n&&a&&(i[n]=new zl(e,n,a))})),e.styles[r]=i,e.stylesSpecificity[r]=rl(r),"@font-face"===r){var n=i["font-family"].getString().replace(/"|'/g,"");i.src.getString().split(",").forEach((t=>{if(t.indexOf('format("svg")')>0){var r=Jo(t);r&&new jh(e).load(n,r)}}))}}}))}}))}}).parseExternalUrl=Jo,Gh=class extends Ah{constructor(){super(...arguments),this.type="use"}setContext(e){super.setContext(e);var t=this.getAttribute("x"),r=this.getAttribute("y");t.hasValue()&&e.translate(t.getPixels("x"),0),r.hasValue()&&e.translate(0,r.getPixels("y"))}path(e){var{element:t}=this;t&&t.path(e)}renderChildren(e){var{document:t,element:r}=this;if(r){var i=r;if("symbol"===r.type&&((i=new gh(t,null)).attributes.viewBox=new zl(t,"viewBox",r.getAttribute("viewBox").getString()),i.attributes.preserveAspectRatio=new zl(t,"preserveAspectRatio",r.getAttribute("preserveAspectRatio").getString()),i.attributes.overflow=new zl(t,"overflow",r.getAttribute("overflow").getString()),i.children=r.children,r.styles.opacity=new zl(t,"opacity",this.calculateOpacity())),"svg"===i.type){var n=this.getStyle("width",!1,!0),a=this.getStyle("height",!1,!0);n.hasValue()&&(i.attributes.width=new zl(t,"width",n.getString())),a.hasValue()&&(i.attributes.height=new zl(t,"height",a.getString()))}var s=i.parent;i.parent=this,i.render(e),i.parent=s}}getBoundingBox(e){var{element:t}=this;return t?t.getBoundingBox(e):null}elementTransform(){var{document:e,element:t}=this;return nh.fromElement(e,t)}get element(){return this.cachedElement||(this.cachedElement=this.getHrefAttribute().getDefinition()),this.cachedElement}},Kh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="feColorMatrix";var i=Xo(this.getAttribute("values").getString());switch(this.getAttribute("type").getString("matrix")){case"saturate":var n=i[0];i=[.213+.787*n,.715-.715*n,.072-.072*n,0,0,.213-.213*n,.715+.285*n,.072-.072*n,0,0,.213-.213*n,.715-.715*n,.072+.928*n,0,0,0,0,0,1,0,0,0,0,0,1];break;case"hueRotate":var a=i[0]*Math.PI/180;i=[bl(a,.213,.787,-.213),bl(a,.715,-.715,-.715),bl(a,.072,-.072,.928),0,0,bl(a,.213,-.213,.143),bl(a,.715,.285,.14),bl(a,.072,-.072,-.283),0,0,bl(a,.213,-.213,-.787),bl(a,.715,-.715,.715),bl(a,.072,.928,.072),0,0,0,0,0,1,0,0,0,0,0,1];break;case"luminanceToAlpha":i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0,0,0,0,0,0,1]}this.matrix=i,this.includeOpacity=this.getAttribute("includeOpacity").hasValue()}apply(e,t,r,i,n){for(var{includeOpacity:a,matrix:s}=this,o=e.getImageData(0,0,i,n),l=0;l<n;l++)for(var h=0;h<i;h++){var A=_l(o.data,h,l,i,0,0),u=_l(o.data,h,l,i,0,1),c=_l(o.data,h,l,i,0,2),d=_l(o.data,h,l,i,0,3),p=wl(s,0,A)+wl(s,1,u)+wl(s,2,c)+wl(s,3,d)+wl(s,4,1),f=wl(s,5,A)+wl(s,6,u)+wl(s,7,c)+wl(s,8,d)+wl(s,9,1),g=wl(s,10,A)+wl(s,11,u)+wl(s,12,c)+wl(s,13,d)+wl(s,14,1),m=wl(s,15,A)+wl(s,16,u)+wl(s,17,c)+wl(s,18,d)+wl(s,19,1);a&&(p=0,f=0,g=0,m*=d/255),vl(o.data,h,l,i,0,0,p),vl(o.data,h,l,i,0,1,f),vl(o.data,h,l,i,0,2,g),vl(o.data,h,l,i,0,3,m)}e.clearRect(0,0,i,n),e.putImageData(o,0,0)}},(qh=class e extends ah{constructor(){super(...arguments),this.type="mask"}apply(t,r){var{document:i}=this,n=this.getAttribute("x").getPixels("x"),a=this.getAttribute("y").getPixels("y"),s=this.getStyle("width").getPixels("x"),o=this.getStyle("height").getPixels("y");if(!s&&!o){var l=new lh;this.children.forEach((e=>{l.addBoundingBox(e.getBoundingBox(t))})),n=Math.floor(l.x1),a=Math.floor(l.y1),s=Math.floor(l.width),o=Math.floor(l.height)}var h=this.removeStyles(r,e.ignoreStyles),A=i.createCanvas(n+s,a+o),u=A.getContext("2d");i.screen.setDefaults(u),this.renderChildren(u),new Kh(i,{nodeType:1,childNodes:[],attributes:[{nodeName:"type",value:"luminanceToAlpha"},{nodeName:"includeOpacity",value:"true"}]}).apply(u,0,0,n+s,a+o);var c=i.createCanvas(n+s,a+o),d=c.getContext("2d");i.screen.setDefaults(d),r.render(d),d.globalCompositeOperation="destination-in",d.fillStyle=u.createPattern(A,"no-repeat"),d.fillRect(0,0,n+s,a+o),t.fillStyle=d.createPattern(c,"no-repeat"),t.fillRect(0,0,n+s,a+o),this.restoreStyles(r,h)}render(e){}}).ignoreStyles=["mask","transform","clip-path"],Zh=()=>{},Wh=class extends ah{constructor(){super(...arguments),this.type="clipPath"}apply(e){var{document:t}=this,r=Reflect.getPrototypeOf(e),{beginPath:i,closePath:n}=e;r&&(r.beginPath=Zh,r.closePath=Zh),Reflect.apply(i,e,[]),this.children.forEach((i=>{if(!(typeof i.path>"u")){var a=typeof i.elementTransform<"u"?i.elementTransform():null;a||(a=nh.fromElement(t,i)),a&&a.apply(e),i.path(e),r&&(r.closePath=n),a&&a.unapply(e)}})),Reflect.apply(n,e,[]),e.clip(),r&&(r.beginPath=i,r.closePath=n)}render(e){}},($h=class e extends ah{constructor(){super(...arguments),this.type="filter"}apply(t,r){var{document:i,children:n}=this,a=r.getBoundingBox(t);if(a){var s=0,o=0;n.forEach((e=>{var t=e.extraFilterDistance||0;s=Math.max(s,t),o=Math.max(o,t)}));var l=Math.floor(a.width),h=Math.floor(a.height),A=l+2*s,u=h+2*o;if(!(A<1||u<1)){var c=Math.floor(a.x),d=Math.floor(a.y),p=this.removeStyles(r,e.ignoreStyles),f=i.createCanvas(A,u),g=f.getContext("2d");i.screen.setDefaults(g),g.translate(-c+s,-d+o),r.render(g),n.forEach((e=>{"function"==typeof e.apply&&e.apply(g,0,0,A,u)})),t.drawImage(f,0,0,A,u,c-s,d-o,A,u),this.restoreStyles(r,p)}}}render(e){}}).ignoreStyles=["filter","transform","clip-path"],iA={svg:gh,rect:mh,circle:yh,ellipse:_h,line:vh,polyline:wh,polygon:bh,path:uh,pattern:xh,marker:Bh,defs:Ch,linearGradient:Ih,radialGradient:Th,stop:Fh,animate:Ph,animateColor:Lh,animateTransform:Mh,font:kh,"font-face":Uh,"missing-glyph":Rh,glyph:ch,text:dh,tspan:ph,tref:Dh,a:Nh,textPath:Oh,image:zh,g:Sh,symbol:Hh,style:Vh,use:Gh,mask:qh,clipPath:Wh,filter:$h,feDropShadow:Xh=class extends ah{constructor(e,t,r){super(e,t,r),this.type="feDropShadow",this.addStylesFromStyleDefinition()}apply(e,t,r,i,n){}},feMorphology:Yh=class extends ah{constructor(){super(...arguments),this.type="feMorphology"}apply(e,t,r,i,n){}},feComposite:Jh=class extends ah{constructor(){super(...arguments),this.type="feComposite"}apply(e,t,r,i,n){}},feColorMatrix:Kh,feGaussianBlur:eA=class extends ah{constructor(e,t,r){super(e,t,r),this.type="feGaussianBlur",this.blurRadius=Math.floor(this.getAttribute("stdDeviation").getNumber()),this.extraFilterDistance=this.blurRadius}apply(e,t,r,i,n){var{document:a,blurRadius:s}=this,o=a.window?a.window.document.body:null,l=e.canvas;l.id=a.getUniqueId(),o&&(l.style.display="none",o.appendChild(l)),Qo(l,t,r,i,n,s),o&&o.removeChild(l)}},title:tA=class extends ah{constructor(){super(...arguments),this.type="title"}},desc:rA=class extends ah{constructor(){super(...arguments),this.type="desc"}}},(nA=class e{constructor(t){var{rootEmSize:r=12,emSize:i=12,createCanvas:n=e.createCanvas,createImage:a=e.createImage,anonymousCrossOrigin:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.canvg=t,this.definitions=Object.create(null),this.styles=Object.create(null),this.stylesSpecificity=Object.create(null),this.images=[],this.fonts=[],this.emSizeStack=[],this.uniqueId=0,this.screen=t.screen,this.rootEmSize=r,this.emSize=i,this.createCanvas=n,this.createImage=this.bindCreateImage(a,s),this.screen.wait(this.isImagesLoaded.bind(this)),this.screen.wait(this.isFontsLoaded.bind(this))}bindCreateImage(e,t){return"boolean"==typeof t?(r,i)=>e(r,"boolean"==typeof i?i:t):e}get window(){return this.screen.window}get fetch(){return this.screen.fetch}get ctx(){return this.screen.ctx}get emSize(){var{emSizeStack:e}=this;return e[e.length-1]}set emSize(e){var{emSizeStack:t}=this;t.push(e)}popEmSize(){var{emSizeStack:e}=this;e.pop()}getUniqueId(){return"canvg".concat(++this.uniqueId)}isImagesLoaded(){return this.images.every((e=>e.loaded))}isFontsLoaded(){return this.fonts.every((e=>e.loaded))}createDocumentElement(e){var t=this.createElement(e.documentElement);return t.root=!0,t.addStylesFromStyleDefinition(),this.documentElement=t,t}createElement(t){var r=t.nodeName.replace(/^[^:]+:/,""),i=e.elementTypes[r];return typeof i<"u"?new i(this,t):new sh(this,t)}createTextNode(e){return new fh(this,e)}setViewBox(e){this.screen.setViewBox(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?xl(Object(r),!0).forEach((function(t){Ys(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xl(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({document:this},e))}}).createCanvas=Bl,nA.createImage=Cl,nA.elementTypes=iA,aA=class e{constructor(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.parser=new $l(r),this.screen=new ql(e,r),this.options=r;var i=new nA(this,r),n=i.createDocumentElement(t);this.document=i,this.documentElement=n}static from(t,r){var i=arguments;return us((function*(){var n=i.length>2&&void 0!==i[2]?i[2]:{},a=new $l(n),s=yield a.parse(r);return new e(t,s,n)}))()}static fromString(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=new $l(i).parseFromString(r);return new e(t,n,i)}fork(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.from(t,r,Il(Il({},this.options),i))}forkString(t,r){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.fromString(t,r,Il(Il({},this.options),i))}ready(){return this.screen.ready()}isReady(){return this.screen.isReady()}render(){var e=arguments,t=this;return us((function*(){var r=e.length>0&&void 0!==e[0]?e[0]:{};t.start(Il({enableRedraw:!0,ignoreAnimation:!0,ignoreMouse:!0},r)),yield t.ready(),t.stop()}))()}start(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{documentElement:t,screen:r,options:i}=this;r.start(t,Il(Il({enableRedraw:!0},i),e))}stop(){this.screen.stop()}resize(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];this.documentElement.resize(e,t,r)}}})),_A=o(((e,t)=>{"use strict";t.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"})),vA=o(((e,t)=>{"use strict";var r=_A();function i(){}function n(){}n.resetWarningCache=i,t.exports=function(){function e(e,t,i,n,a,s){if(s!==r){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}function t(){return e}e.isRequired=e;var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:n,resetWarningCache:i};return a.PropTypes=a,a}})),wA=o(((e,t)=>{t.exports=vA()()})),bA=o(((e,t)=>{var r;r=e,"object"==typeof e&&typeof t<"u"?t.exports=function(e,t,r,i,n){for(t=t.split?t.split("."):t,i=0;i<t.length;i++)e=e?e[t[i]]:n;return e===n?r:e}:"function"==typeof define&&define.amd?define((function(){return function(e,t,r,i,n){for(t=t.split?t.split("."):t,i=0;i<t.length;i++)e=e?e[t[i]]:n;return e===n?r:e}})):r.dlv=function(e,t,r,i,n){for(t=t.split?t.split("."):t,i=0;i<t.length;i++)e=e?e[t[i]]:n;return e===n?r:e}})),xA={},BA=[],CA=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,SA=Array.isArray;function EA(e,t){for(var r in t)e[r]=t[r];return e}function IA(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function TA(e,t,r){var i,n,a,s={};for(a in t)"key"==a?i=t[a]:"ref"==a?n=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?sA.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return FA(e,s,i,n,null)}function FA(e,t,r,i,n){var a={type:e,props:t,key:r,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++lA,__i:-1,__u:0};return null==n&&null!=oA.vnode&&oA.vnode(a),a}function PA(e){return e.children}function LA(e,t){this.props=e,this.context=t}function MA(e,t){if(null==t)return e.__?MA(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e)return r.__e;return"function"==typeof e.type?MA(e):null}function kA(e){var t,r;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(r=e.__k[t])&&null!=r.__e){e.__e=e.__c.base=r.__e;break}return kA(e)}}function UA(e){(!e.__d&&(e.__d=!0)&&hA.push(e)&&!RA.__r++||AA!=oA.debounceRendering)&&((AA=oA.debounceRendering)||uA)(RA)}function RA(){for(var e,t,r,i,n,a,s,o=1;hA.length;)hA.length>o&&hA.sort(cA),e=hA.shift(),o=hA.length,e.__d&&(r=void 0,i=void 0,n=(i=(t=e).__v).__e,a=[],s=[],t.__P&&((r=EA({},i)).__v=i.__v+1,oA.vnode&&oA.vnode(r),VA(t.__P,r,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,a,n??MA(i),!!(32&i.__u),s),r.__v=i.__v,r.__.__k[r.__i]=r,KA(a,r,s),i.__e=i.__=null,r.__e!=n&&kA(r)));RA.__r=0}function DA(e,t,r,i,n,a,s,o,l,h,A){var u,c,d,p,f,g,m,y=i&&i.__k||BA,_=t.length;for(l=function(e,t,r,i,n){var a,s,o,l,h,A=r.length,u=A,c=0;for(e.__k=new Array(n),a=0;a<n;a++)null!=(s=t[a])&&"boolean"!=typeof s&&"function"!=typeof s?(l=a+c,(s=e.__k[a]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?FA(null,s,null,null,null):SA(s)?FA(PA,{children:s},null,null,null):null==s.constructor&&s.__b>0?FA(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,o=null,-1!=(h=s.__i=QA(s,r,l,u))&&(u--,(o=r[h])&&(o.__u|=2)),null==o||null==o.__v?(-1==h&&(n>A?c--:n<A&&c++),"function"!=typeof s.type&&(s.__u|=4)):h!=l&&(h==l-1?c--:h==l+1?c++:(h>l?c--:c++,s.__u|=4))):e.__k[a]=null;if(u)for(a=0;a<A;a++)null!=(o=r[a])&&!(2&o.__u)&&(o.__e==i&&(i=MA(o)),WA(o,o));return i}(r,t,y,l,_),u=0;u<_;u++)null!=(d=r.__k[u])&&(c=-1==d.__i?xA:y[d.__i]||xA,d.__i=u,g=VA(e,d,c,n,a,s,o,l,h,A),p=d.__e,d.ref&&c.ref!=d.ref&&(c.ref&&ZA(c.ref,null,d),A.push(d.ref,d.__c||p,d)),null==f&&null!=p&&(f=p),(m=!!(4&d.__u))||c.__k===d.__k?l=NA(d,l,e,m):"function"==typeof d.type&&void 0!==g?l=g:p&&(l=p.nextSibling),d.__u&=-7);return r.__e=f,l}function NA(e,t,r,i){var n,a;if("function"==typeof e.type){for(n=e.__k,a=0;n&&a<n.length;a++)n[a]&&(n[a].__=e,t=NA(n[a],t,r,i));return t}e.__e!=t&&(i&&(t&&e.type&&!t.parentNode&&(t=MA(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function OA(e,t){return t=t||[],null==e||"boolean"==typeof e||(SA(e)?e.some((function(e){OA(e,t)})):t.push(e)),t}function QA(e,t,r,i){var n,a,s,o=e.key,l=e.type,h=t[r],A=null!=h&&!(2&h.__u);if(null===h&&null==e.key||A&&o==h.key&&l==h.type)return r;if(i>(A?1:0))for(n=r-1,a=r+1;n>=0||a<t.length;)if(null!=(h=t[s=n>=0?n--:a++])&&!(2&h.__u)&&o==h.key&&l==h.type)return s;return-1}function zA(e,t,r){"-"==t[0]?e.setProperty(t,r??""):e[t]=null==r?"":"number"!=typeof r||CA.test(t)?r:r+"px"}function HA(e,t,r,i,n){var a,s;e:if("style"==t)if("string"==typeof r)e.style.cssText=r;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)r&&t in r||zA(e.style,t,"");if(r)for(t in r)i&&r[t]==i[t]||zA(e.style,t,r[t])}else if("o"==t[0]&&"n"==t[1])a=t!=(t=t.replace(dA,"$1")),s=t.toLowerCase(),t=s in e||"onFocusOut"==t||"onFocusIn"==t?s.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?i?r.u=i.u:(r.u=pA,e.addEventListener(t,a?gA:fA,a)):e.removeEventListener(t,a?gA:fA,a);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=r??"";break e}catch{}"function"==typeof r||(null==r||!1===r&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==r?"":r))}}function jA(e){return function(t){if(this.l){var r=this.l[t.type+e];if(null==t.t)t.t=pA++;else if(t.t<r.u)return;return r(oA.event?oA.event(t):t)}}}function VA(e,t,r,i,n,a,s,o,l,h){var A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E=t.type;if(null!=t.constructor)return null;128&r.__u&&(l=!!(32&r.__u),a=[o=t.__e=r.__e]),(A=oA.__b)&&A(t);e:if("function"==typeof E)try{if(m=t.props,y="prototype"in E&&E.prototype.render,_=(A=E.contextType)&&i[A.__c],v=A?_?_.props.value:A.__:i,r.__c?g=(u=t.__c=r.__c).__=u.__E:(y?t.__c=u=new E(m,v):(t.__c=u=new LA(m,v),u.constructor=E,u.render=$A),_&&_.sub(u),u.props=m,u.state||(u.state={}),u.context=v,u.__n=i,c=u.__d=!0,u.__h=[],u._sb=[]),y&&null==u.__s&&(u.__s=u.state),y&&null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=EA({},u.__s)),EA(u.__s,E.getDerivedStateFromProps(m,u.__s))),d=u.props,p=u.state,u.__v=t,c)y&&null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),y&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(y&&null==E.getDerivedStateFromProps&&m!==d&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(m,v),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(m,u.__s,v)||t.__v==r.__v){for(t.__v!=r.__v&&(u.props=m,u.state=u.__s,u.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some((function(e){e&&(e.__=t)})),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(m,u.__s,v),y&&null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(d,p,f)}))}if(u.context=v,u.props=m,u.__P=e,u.__e=!1,b=oA.__r,x=0,y){for(u.state=u.__s,u.__d=!1,b&&b(t),A=u.render(u.props,u.state,u.context),B=0;B<u._sb.length;B++)u.__h.push(u._sb[B]);u._sb=[]}else do{u.__d=!1,b&&b(t),A=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++x<25);u.state=u.__s,null!=u.getChildContext&&(i=EA(EA({},i),u.getChildContext())),y&&!c&&null!=u.getSnapshotBeforeUpdate&&(f=u.getSnapshotBeforeUpdate(d,p)),C=A,null!=A&&A.type===PA&&null==A.key&&(C=qA(A.props.children)),o=DA(e,SA(C)?C:[C],t,r,i,n,a,s,o,l,h),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),g&&(u.__E=u.__=null)}catch(e){if(t.__v=null,l||null!=a)if(e.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;a[a.indexOf(o)]=null,t.__e=o}else{for(S=a.length;S--;)IA(a[S]);GA(t)}else t.__e=r.__e,t.__k=r.__k,e.then||GA(t);oA.__e(e,t,r)}else null==a&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):o=t.__e=function(e,t,r,i,n,a,s,o,l){var h,A,u,c,d,p,f,g=r.props,m=t.props,y=t.type;if("svg"==y?n="http://www.w3.org/2000/svg":"math"==y?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=a)for(h=0;h<a.length;h++)if((d=a[h])&&"setAttribute"in d==!!y&&(y?d.localName==y:3==d.nodeType)){e=d,a[h]=null;break}if(null==e){if(null==y)return document.createTextNode(m);e=document.createElementNS(n,y,m.is&&m),o&&(oA.__m&&oA.__m(t,a),o=!1),a=null}if(null==y)g===m||o&&e.data==m||(e.data=m);else{if(a=a&&sA.call(e.childNodes),g=r.props||xA,!o&&null!=a)for(g={},h=0;h<e.attributes.length;h++)g[(d=e.attributes[h]).name]=d.value;for(h in g)if(d=g[h],"children"!=h)if("dangerouslySetInnerHTML"==h)u=d;else if(!(h in m)){if("value"==h&&"defaultValue"in m||"checked"==h&&"defaultChecked"in m)continue;HA(e,h,null,d,n)}for(h in m)d=m[h],"children"==h?c=d:"dangerouslySetInnerHTML"==h?A=d:"value"==h?p=d:"checked"==h?f=d:o&&"function"!=typeof d||g[h]===d||HA(e,h,d,g[h],n);if(A)o||u&&(A.__html==u.__html||A.__html==e.innerHTML)||(e.innerHTML=A.__html),t.__k=[];else if(u&&(e.innerHTML=""),DA("template"==t.type?e.content:e,SA(c)?c:[c],t,r,i,"foreignObject"==y?"http://www.w3.org/1999/xhtml":n,a,s,a?a[0]:r.__k&&MA(r,0),o,l),null!=a)for(h=a.length;h--;)IA(a[h]);o||(h="value","progress"==y&&null==p?e.removeAttribute("value"):null!=p&&(p!==e[h]||"progress"==y&&!p||"option"==y&&p!=g[h])&&HA(e,h,p,g[h],n),h="checked",null!=f&&f!=e[h]&&HA(e,h,f,g[h],n))}return e}(r.__e,t,r,i,n,a,s,l,h);return(A=oA.diffed)&&A(t),128&t.__u?void 0:o}function GA(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(GA)}function KA(e,t,r){for(var i=0;i<r.length;i++)ZA(r[i],r[++i],r[++i]);oA.__c&&oA.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){oA.__e(e,t.__v)}}))}function qA(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:SA(e)?e.map(qA):EA({},e)}function ZA(e,t,r){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){oA.__e(e,r)}}function WA(e,t,r){var i,n;if(oA.unmount&&oA.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||ZA(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){oA.__e(e,t)}i.base=i.__P=null}if(i=e.__k)for(n=0;n<i.length;n++)i[n]&&WA(i[n],t,r||"function"!=typeof e.type);r||IA(e.__e),e.__c=e.__=e.__e=void 0}function $A(e,t,r){return this.constructor(e,r)}function XA(e,t,r){var i,n,a,s;t==document&&(t=document.documentElement),oA.__&&oA.__(e,t),n=(i="function"==typeof r)?null:r&&r.__k||t.__k,a=[],s=[],VA(t,e=(!i&&r||t).__k=TA(PA,null,[e]),n||xA,xA,t.namespaceURI,!i&&r?[r]:n?null:t.firstChild?sA.call(t.childNodes):null,a,!i&&r?r:n?n.__e:t.firstChild,i,s),KA(a,e,s)}function YA(e,t){XA(e,t,YA)}function JA(e,t,r){var i,n,a,s,o=EA({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)"key"==a?i=t[a]:"ref"==a?n=t[a]:o[a]=void 0===t[a]&&null!=s?s[a]:t[a];return arguments.length>2&&(o.children=arguments.length>3?sA.call(arguments,2):r),FA(e.type,o,i||e.key,n||e.ref,null)}function eu(e){function t(e){var r,i;return this.getChildContext||(r=new Set,(i={})[t.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&r.forEach((function(e){e.__e=!0,UA(e)}))},this.sub=function(e){r.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+mA++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}function tu(){return tu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},tu.apply(this,arguments)}function ru(e,t){if(null==e)return{};var r,i,n={},a=Object.keys(e);for(i=0;i<a.length;i++)t.indexOf(r=a[i])>=0||(n[r]=e[r]);return n}sA=BA.slice,oA={__e:function(e,t,r,i){for(var n,a,s;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&null!=a.getDerivedStateFromError&&(n.setState(a.getDerivedStateFromError(e)),s=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,i||{}),s=n.__d),s)return n.__E=n}catch(t){e=t}throw e}},lA=0,LA.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=EA({},this.state),"function"==typeof e&&(e=e(EA({},r),this.props)),e&&EA(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),UA(this))},LA.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),UA(this))},LA.prototype.render=PA,hA=[],uA="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,cA=function(e,t){return e.__v.__b-t.__v.__b},RA.__r=0,dA=/(PointerCapture)$|Capture$/i,pA=0,fA=jA(!1),gA=jA(!0),mA=0;var iu=["context","children"],nu=["useFragment"];function au(e,t,r,i){function n(){var t=Reflect.construct(HTMLElement,[],n);return t._vdomComponent=e,t._root=i&&i.shadow?t.attachShadow({mode:i.mode||"open"}):t,i&&i.adoptedStyleSheets&&(t._root.adoptedStyleSheets=i.adoptedStyleSheets),t}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=function(){ou.call(this,i)},n.prototype.attributeChangedCallback=hu,n.prototype.disconnectedCallback=Au,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=r,e.formAssociated&&(n.formAssociated=!0),r.forEach((function(e){Object.defineProperty(n.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||(this._props={}),this._props[e]=t);var r=typeof t;null!=t&&"string"!==r&&"boolean"!==r&&"number"!==r||this.setAttribute(e,t)}})})),customElements.define(t||e.tagName||e.displayName||e.name,n),n}function su(e){return this.getChildContext=function(){return e.context},JA(e.children,ru(e,iu))}function ou(e){var t=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=TA(su,tu({},this._props,{context:t.detail.context}),cu(this,this._vdomComponent,e)),(this.hasAttribute("hydrate")?YA:XA)(this._vdom,this._root)}function lu(e){return e.replace(/-(\w)/g,(function(e,t){return t?t.toUpperCase():""}))}function hu(e,t,r){if(this._vdom){var i={};i[e]=r=r??void 0,i[lu(e)]=r,this._vdom=JA(this._vdom,i),XA(this._vdom,this._root)}}function Au(){XA(this._vdom=null,this._root)}function uu(e,t){var r=this;return TA(e.useFragment?PA:"slot",tu({},ru(e,nu),{ref:function(e){e?(r.ref=e,r._listener||(r._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function cu(e,t,r){if(3===e.nodeType)return e.data;if(1!==e.nodeType)return null;var i=[],n={},a=0,s=e.attributes,o=e.childNodes;for(a=s.length;a--;)"slot"!==s[a].name&&(n[s[a].name]=s[a].value,n[lu(s[a].name)]=s[a].value);for(a=o.length;a--;){var l=cu(o[a],null,r),h=o[a].slot;h?n[h]=TA(uu,{name:h},l):i[a]=l}var A=!(!r||!r.shadow),u=t?TA(uu,{useFragment:!A},i):i;return!A&&t&&(e.innerHTML=""),TA(t||e.nodeName.toLowerCase(),n,u)}var du,pu,fu,gu,mu=0,yu=[],_u=oA,vu=_u.__b,wu=_u.__r,bu=_u.diffed,xu=_u.__c,Bu=_u.unmount,Cu=_u.__;function Su(e,t){_u.__h&&_u.__h(pu,e,mu||t),mu=0;var r=pu.__H||(pu.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Eu(e){return mu=1,Iu(Vu,e)}function Iu(e,t,r){var i=Su(du++,2);if(i.t=e,!i.__c&&(i.__=[r?r(t):Vu(void 0,t),function(e){var t=i.__N?i.__N[0]:i.__[0],r=i.t(t,e);t!==r&&(i.__N=[r,i.__[1]],i.__c.setState({}))}],i.__c=pu,!pu.__f)){var n=function(e,t,r){if(!i.__c.__H)return!0;var n=i.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!a||a.call(this,e,t,r);var s=i.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),a&&a.call(this,e,t,r)||s};pu.__f=!0;var a=pu.shouldComponentUpdate,s=pu.componentWillUpdate;pu.componentWillUpdate=function(e,t,r){if(this.__e){var i=a;a=void 0,n(e,t,r),a=i}s&&s.call(this,e,t,r)},pu.shouldComponentUpdate=n}return i.__N||i.__}function Tu(e,t){var r=Su(du++,3);!_u.__s&&ju(r.__H,t)&&(r.__=e,r.u=t,pu.__H.__h.push(r))}function Fu(e,t){var r=Su(du++,4);!_u.__s&&ju(r.__H,t)&&(r.__=e,r.u=t,pu.__h.push(r))}function Pu(e){return mu=5,Mu((function(){return{current:e}}),[])}function Lu(e,t,r){mu=6,Fu((function(){if("function"==typeof e){var r=e(t());return function(){e(null),r&&"function"==typeof r&&r()}}if(e)return e.current=t(),function(){return e.current=null}}),null==r?r:r.concat(e))}function Mu(e,t){var r=Su(du++,7);return ju(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function ku(e,t){return mu=8,Mu((function(){return e}),t)}function Uu(e){var t=pu.context[e.__c],r=Su(du++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(pu)),t.props.value):e.__}function Ru(e,t){_u.useDebugValue&&_u.useDebugValue(t?t(e):e)}function Du(){var e=Su(du++,11);if(!e.__){for(var t=pu.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function Nu(){for(var e;e=yu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(zu),e.__H.__h.forEach(Hu),e.__H.__h=[]}catch(t){e.__H.__h=[],_u.__e(t,e.__v)}}_u.__b=function(e){pu=null,vu&&vu(e)},_u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cu&&Cu(e,t)},_u.__r=function(e){wu&&wu(e),du=0;var t=(pu=e.__c).__H;t&&(fu===pu?(t.__h=[],pu.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(zu),t.__h.forEach(Hu),t.__h=[],du=0)),fu=pu},_u.diffed=function(e){bu&&bu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==yu.push(t)&&gu===_u.requestAnimationFrame||((gu=_u.requestAnimationFrame)||Qu)(Nu)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),fu=pu=null},_u.__c=function(e,t){t.some((function(e){try{e.__h.forEach(zu),e.__h=e.__h.filter((function(e){return!e.__||Hu(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],_u.__e(r,e.__v)}})),xu&&xu(e,t)},_u.unmount=function(e){Bu&&Bu(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{zu(e)}catch(e){t=e}})),r.__H=void 0,t&&_u.__e(t,r.__v))};var Ou="function"==typeof requestAnimationFrame;function Qu(e){var t,r=function(){clearTimeout(i),Ou&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);Ou&&(t=requestAnimationFrame(r))}function zu(e){var t=pu,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),pu=t}function Hu(e){var t=pu;e.__c=e.__(),pu=t}function ju(e,t){return!e||e.length!==t.length||t.some((function(t,r){return t!==e[r]}))}function Vu(e,t){return"function"==typeof t?t(e):t}function Gu(e,t){for(var r in t)e[r]=t[r];return e}function Ku(e,t){for(var r in e)if("__source"!==r&&!(r in t))return!0;for(var i in t)if("__source"!==i&&e[i]!==t[i])return!0;return!1}function qu(e,t){var r=t(),i=Eu({t:{__:r,u:t}}),n=i[0].t,a=i[1];return Fu((function(){n.__=r,n.u=t,Zu(n)&&a({t:n})}),[e,r,t]),Tu((function(){return Zu(n)&&a({t:n}),e((function(){Zu(n)&&a({t:n})}))}),[e]),r}function Zu(e){var t,r,i=e.u,n=e.__;try{var a=i();return!((t=n)===(r=a)&&(0!==t||1/t==1/r)||t!=t&&r!=r)}catch{return!0}}function Wu(e){e()}function $u(e){return e}function Xu(){return[!1,Wu]}var Yu=Fu;function Ju(e,t){this.props=e,this.context=t}function ec(e,t){function r(e){var r=this.props.ref,i=r==e.ref;return!i&&r&&(r.call?r(null):r.current=null),t?!t(this.props,e)||!i:Ku(this.props,e)}function i(t){return this.shouldComponentUpdate=r,TA(e,t)}return i.displayName="Memo("+(e.displayName||e.name)+")",i.prototype.isReactComponent=!0,i.__f=!0,i.type=e,i}(Ju.prototype=new LA).isPureReactComponent=!0,Ju.prototype.shouldComponentUpdate=function(e,t){return Ku(this.props,e)||Ku(this.state,t)};var tc=oA.__b;oA.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),tc&&tc(e)};var rc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var ic=function(e,t){return null==e?null:OA(OA(e).map(t))},nc={map:ic,forEach:ic,count:function(e){return e?OA(e).length:0},only:function(e){var t=OA(e);if(1!==t.length)throw"Children.only";return t[0]},toArray:OA},ac=oA.__e;oA.__e=function(e,t,r,i){if(e.then)for(var n,a=t;a=a.__;)if((n=a.__c)&&n.__c)return null==t.__e&&(t.__e=r.__e,t.__k=r.__k),n.__c(e,t);ac(e,t,r,i)};var sc=oA.unmount;function oc(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=Gu({},e)).__c&&(e.__c.__P===r&&(e.__c.__P=t),e.__c.__e=!0,e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return oc(e,t,r)}))),e}function lc(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return lc(e,t,r)})),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function hc(){this.__u=0,this.o=null,this.__b=null}function Ac(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function uc(){this.i=null,this.l=null}oA.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),sc&&sc(e)},(hc.prototype=new LA).__c=function(e,t){var r=t.__c,i=this;null==i.o&&(i.o=[]),i.o.push(r);var n=Ac(i.__v),a=!1,s=function(){a||(a=!0,r.__R=null,n?n(o):o())};r.__R=s;var o=function(){if(! --i.__u){if(i.state.__a){var e=i.state.__a;i.__v.__k[0]=lc(e,e.__c.__P,e.__c.__O)}var t;for(i.setState({__a:i.__b=null});t=i.o.pop();)t.forceUpdate()}};i.__u++||32&t.__u||i.setState({__a:i.__b=i.__v.__k[0]}),e.then(s,s)},hc.prototype.componentWillUnmount=function(){this.o=[]},hc.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),i=this.__v.__k[0].__c;this.__v.__k[0]=oc(this.__b,r,i.__O=i.__P)}this.__b=null}var n=t.__a&&TA(PA,null,e.fallback);return n&&(n.__u&=-33),[TA(PA,null,t.__a?null:e.children),n]};var cc=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};function dc(e){return this.getChildContext=function(){return e.context},e.children}function pc(e){var t=this,r=e.h;if(t.componentWillUnmount=function(){XA(null,t.v),t.v=null,t.h=null},t.h&&t.h!==r&&t.componentWillUnmount(),!t.v){for(var i=t.__v;null!==i&&!i.__m&&null!==i.__;)i=i.__;t.h=r,t.v={nodeType:1,parentNode:r,childNodes:[],__k:{__m:i.__m},contains:function(){return!0},insertBefore:function(e,r){this.childNodes.push(e),t.h.insertBefore(e,r)},removeChild:function(e){this.childNodes.splice(this.childNodes.indexOf(e)>>>1,1),t.h.removeChild(e)}}}XA(TA(dc,{context:t.context},e.__v),t.v)}(uc.prototype=new LA).__a=function(e){var t=this,r=Ac(t.__v),i=t.l.get(e);return i[0]++,function(n){var a=function(){t.props.revealOrder?(i.push(n),cc(t,e,i)):n()};r?r(a):a()}},uc.prototype.render=function(e){this.i=null,this.l=new Map;var t=OA(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},uc.prototype.componentDidUpdate=uc.prototype.componentDidMount=function(){var e=this;this.l.forEach((function(t,r){cc(e,r,t)}))};var fc=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,gc=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,mc=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yc=/[A-Z0-9]/g,_c=typeof document<"u",vc=function(e){return(typeof Symbol<"u"&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};LA.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(LA.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var wc=oA.event;function bc(){}function xc(){return this.cancelBubble}function Bc(){return this.defaultPrevented}oA.event=function(e){return wc&&(e=wc(e)),e.persist=bc,e.isPropagationStopped=xc,e.isDefaultPrevented=Bc,e.nativeEvent=e};var Cc,Sc={enumerable:!1,configurable:!0,get:function(){return this.class}},Ec=oA.vnode;oA.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,r=e.type,i={},n=-1===r.indexOf("-");for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||_c&&"children"===a&&"noscript"===r||"class"===a||"className"===a)){var o=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"translate"===o&&"no"===s?s=!1:"o"===o[0]&&"n"===o[1]?"ondoubleclick"===o?a="ondblclick":"onchange"!==o||"input"!==r&&"textarea"!==r||vc(t.type)?"onfocus"===o?a="onfocusin":"onblur"===o?a="onfocusout":mc.test(a)&&(a=o):o=a="oninput":n&&gc.test(a)?a=a.replace(yc,"-$&").toLowerCase():null===s&&(s=void 0),"oninput"===o&&i[a=o]&&(a="oninputCapture"),i[a]=s}}"select"==r&&i.multiple&&Array.isArray(i.value)&&(i.value=OA(t.children).forEach((function(e){e.props.selected=-1!=i.value.indexOf(e.props.value)}))),"select"==r&&null!=i.defaultValue&&(i.value=OA(t.children).forEach((function(e){e.props.selected=i.multiple?-1!=i.defaultValue.indexOf(e.props.value):i.defaultValue==e.props.value}))),t.class&&!t.className?(i.class=t.class,Object.defineProperty(i,"className",Sc)):(t.className&&!t.class||t.class&&t.className)&&(i.class=i.className=t.className),e.props=i}(e),e.$$typeof=fc,Ec&&Ec(e)};var Ic=oA.__r;oA.__r=function(e){Ic&&Ic(e),Cc=e.__c};var Tc=oA.diffed;oA.diffed=function(e){Tc&&Tc(e);var t=e.props,r=e.__e;null!=r&&"textarea"===e.type&&"value"in t&&t.value!==r.value&&(r.value=null==t.value?"":t.value),Cc=null};var Fc={ReactCurrentDispatcher:{current:{readContext:function(e){return Cc.__n[e.__c].props.value},useCallback:ku,useContext:Uu,useDebugValue:Ru,useDeferredValue:$u,useEffect:Tu,useId:Du,useImperativeHandle:Lu,useInsertionEffect:Yu,useLayoutEffect:Fu,useMemo:Mu,useReducer:Iu,useRef:Pu,useState:Eu,useSyncExternalStore:qu,useTransition:Xu}}};function Pc(e){return!!e&&e.$$typeof===fc}var Lc={useState:Eu,useId:Du,useReducer:Iu,useEffect:Tu,useLayoutEffect:Fu,useInsertionEffect:Yu,useTransition:Xu,useDeferredValue:$u,useSyncExternalStore:qu,startTransition:Wu,useRef:Pu,useImperativeHandle:Lu,useMemo:Mu,useCallback:ku,useContext:Uu,useDebugValue:Ru,version:"18.3.1",Children:nc,render:function(e,t,r){return null==t.__k&&(t.textContent=""),XA(e,t),"function"==typeof r&&r(),e?e.__c:null},hydrate:function(e,t,r){return YA(e,t),"function"==typeof r&&r(),e?e.__c:null},unmountComponentAtNode:function(e){return!!e.__k&&(XA(null,e),!0)},createPortal:function(e,t){var r=TA(pc,{__v:e,h:t});return r.containerInfo=t,r},createElement:TA,createContext:eu,createFactory:function(e){return TA.bind(null,e)},cloneElement:function(e){return Pc(e)?JA.apply(null,arguments):e},createRef:function(){return{current:null}},Fragment:PA,isValidElement:Pc,isElement:Pc,isFragment:function(e){return Pc(e)&&e.type===PA},isMemo:function(e){return!!e&&!!e.displayName&&("string"==typeof e.displayName||e.displayName instanceof String)&&e.displayName.startsWith("Memo(")},findDOMNode:function(e){return e&&(e.base||1===e.nodeType&&e)||null},Component:LA,PureComponent:Ju,memo:ec,forwardRef:function(e){function t(t){var r=Gu({},t);return delete r.ref,e(r,t.ref||null)}return t.$$typeof=rc,t.render=e,t.prototype.isReactComponent=t.__f=!0,t.displayName="ForwardRef("+(e.displayName||e.name)+")",t},flushSync:function(e,t){return e(t)},unstable_batchedUpdates:function(e,t){return e(t)},StrictMode:PA,Suspense:hc,SuspenseList:uc,lazy:function(e){var t,r,i;function n(n){if(t||(t=e()).then((function(e){r=e.default||e}),(function(e){i=e})),i)throw i;if(!r)throw t;return TA(r,n)}return n.displayName="Lazy",n.__f=!0,n},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:Fc},Mc=(e,t)=>{let r=new URL(e);return Object.entries(t||{}).forEach((([e,t])=>{null!=t&&r.searchParams.set(e,t)})),r},kc=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},Uc=class{constructor(e){this.url=e.url,this.apiKey=e.apiKey}fetch(e,t,r){return kc(this,void 0,void 0,(function*(){if(!this.url)throw new Error(`No url defined for request to ${this.url}/${e}`);if(!(this.url||this.apiKey&&"public"!==this.apiKey||this.url.includes("key=")))throw new Error(`No apiKey defined for request to ${this.url}`);let i=Mc(`${this.url}${e||""}`,Object.assign({key:this.apiKey&&"public"!==this.apiKey?this.apiKey:void 0},t||{})),n=yield(yield fetch(i.toString(),r)).json();if(n.error)throw new Error(n.error);return n}))}},Rc=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},Dc=class extends Uc{constructor(e){var t,r,i,n;super(Object.assign({url:null!==(t=e.url)&&void 0!==t?t:"https://editor.mapset.io/api/v1"},e)),this.bbox=[],this.tags=[],this.tenants=[],this.timestamp=void 0,this.tags=null!==(r=e.tags)&&void 0!==r?r:[],this.bbox=e.bbox,this.zoom=e.zoom,this.tenants=null!==(i=e.tenants)&&void 0!==i?i:[],this.timestamp=e.timestamp,this.apiKey=null!==(n=e.apiKey)&&void 0!==n?n:""}getPlanById(e){return Rc(this,arguments,void 0,(function*(e,t={}){return yield this.fetch(`/meta/kml/${e}`,{},Object.assign({method:"GET"},t))}))}getPlans(){return Rc(this,arguments,void 0,(function*(e={},t={}){var r,i,n;let a=Object.assign({},e),s={};if(s=yield this.fetch("/export/kml",Object.assign({bbox:null===(r=this.bbox)||void 0===r?void 0:r.toString(),key:this.apiKey,tags:null===(i=this.tags)||void 0===i?void 0:i.toString(),tenants:null===(n=this.tenants)||void 0===n?void 0:n.toString(),timestamp:this.timestamp,zoom:this.zoom&&Math.floor(this.zoom)},a),t),s?.detail)throw console.error("Error fetching mapset plans:",s.detail),new Error(s.detail);return s?.results||[]}))}},Nc=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},Oc=class extends Uc{constructor(e){super(Object.assign(Object.assign({},e),{url:e.url||"https://moco.geops.io/api/v2/"})),this.tenant="geopstest",e.tenant&&(this.tenant=e.tenant)}export(){return Nc(this,arguments,void 0,(function*(e={},t={}){return yield this.fetch(`${this.tenant}/export/`,Object.assign({},e),t)}))}exportById(e){return Nc(this,arguments,void 0,(function*(e,t={},r={}){var i,n;let a=yield this.fetch(`${this.tenant}/export/${e}/`,t,r);return null===(n=null===(i=a?.paginatedSituations)||void 0===i?void 0:i.results)||void 0===n?void 0:n[0]}))}},Qc=(e,t,r=100)=>{let i={},n={},a=[];return s=>{let{content:o,source:l}=s;i[l]&&window.clearTimeout(i[l]),t?n[t(o)]=o:a.push(o),i[l]=window.setTimeout((()=>{let r=t?Object.values(n):a;e(r)}),r)}},zc=(e,t)=>e===t.SCHEMATIC?"_schematic":"",Hc=class e{constructor(){this.defineProperties()}static getRequestString(e,t={}){let r=`${e} ${t.channel}`;return r+=t.args?` ${t.args}`:"",r+=t.id?` ${t.id}`:"",r.trim()}addEvents(e,t){this.websocket&&(this.websocket.addEventListener("message",e),t&&(this.websocket.addEventListener("error",t),this.websocket.addEventListener("close",t)))}close(){this.websocket&&(this.open||this.connecting)&&(this.websocket.onclose=()=>{},this.websocket.close(),this.messagesOnOpen=[])}connect(e,t=()=>{}){var r;if(e){if(this.websocket){if(this.websocket.url===e&&(this.open||this.connecting))return;this.websocket.url!==e&&(this.open||this.connecting)&&this.websocket.close()}this.websocket=new WebSocket(e),this.open?(t(),this.subscribePreviousSubscriptions()):this.websocket.addEventListener("open",(()=>{t(),this.subscribePreviousSubscriptions()}))}else null===(r=this.websocket)||void 0===r||r.close()}defineProperties(){Object.defineProperties(this,{closed:{get:()=>!this.websocket||this.websocket.readyState===this.websocket.CLOSED},closing:{get:()=>!(!this.websocket||this.websocket.readyState!==this.websocket.CLOSING)},connecting:{get:()=>!(!this.websocket||this.websocket.readyState!==this.websocket.CONNECTING)},messagesOnOpen:{value:[],writable:!0},open:{get:()=>!(!this.websocket||this.websocket.readyState!==this.websocket.OPEN)},subscribed:{value:{},writable:!0},subscriptions:{value:[],writable:!0}})}get(t,r,i){let n=e.getRequestString("GET",t);this.send(n);let a=e=>(...t)=>{e(...t);let i=this.requests.findIndex((e=>n===e.requestString&&r===e.cb)),{onErrorCb:a,onMessageCb:s}=this.requests[i];this.removeEvents(s,a),this.requests.splice(i,1)},{onErrorCb:s,onMessageCb:o}=this.listen(t,a(r),i&&a(i));this.requests||(this.requests=[]);let l=this.requests.findIndex((e=>n===e.requestString&&r===e.cb)),h={cb:r,errorCb:i,onErrorCb:s,onMessageCb:o,params:t,requestString:n};l>-1?this.requests[l]=h:this.requests.push(h)}listen(e,t,r){this.unlisten(e,t);let i=r=>{let i;try{i=JSON.parse(r.data)}catch(e){return void console.error("WebSocket: unable to parse JSON data",e,r.data)}let n,a=e.channel;a+=e.args?` ${e.args}`:"",n="buffer"===i.source?i.content:[i],n.forEach((r=>{r?.source===a&&(!e.id||e.id===i.client_reference)&&t(r)}))};return this.addEvents(i,r),{onErrorCb:r,onMessageCb:i}}removeEvents(e,t){this.websocket&&(this.websocket.removeEventListener("message",e),t&&(this.websocket.removeEventListener("error",t),this.websocket.removeEventListener("close",t)))}send(e){if(!this.websocket||this.closed||this.closing)return;let t=()=>{var t;null===(t=this.websocket)||void 0===t||t.send(e)};this.open?this.messagesOnOpen.includes(e)||t():this.messagesOnOpen.includes(e)||(this.messagesOnOpen.push(e),this.websocket.addEventListener("open",(()=>{this.messagesOnOpen=[],t()})),this.websocket.addEventListener("close",(()=>{this.messagesOnOpen=[]})))}subscribe(t,r,i,n=!1){let{onErrorCb:a,onMessageCb:s}=this.listen(t,r,i),o=e.getRequestString("",t),l=this.subscriptions.findIndex((e=>t.channel===e.params.channel&&r===e.cb)),h={cb:r,errorCb:i,onErrorCb:a,onMessageCb:s,params:t,quiet:n};l>-1?this.subscriptions[l]=h:this.subscriptions.push(h),this.subscribed[o]||(h.quiet||(this.send(`GET ${o}`),this.send(`SUB ${o}`)),this.subscribed[o]=!0)}subscribePreviousSubscriptions(){Object.keys(this.subscribed).forEach((e=>{this.subscribed[e]=!1})),[...this.subscriptions].forEach((e=>{this.subscribe(e.params,e.cb,e.errorCb,e.quiet)}))}unlisten(e,t){[...this.subscriptions||[],...this.requests||[]].filter((r=>r.params.channel===e.channel&&(!t||r.cb===t))).forEach((({onErrorCb:e,onMessageCb:t})=>{this.removeEvents(t,e)}))}unsubscribe(e,t){let r=this.subscriptions.filter((r=>r.params.channel===e&&(!t||r.cb===t)));r.forEach((({onErrorCb:e,onMessageCb:t})=>{this.removeEvents(t,e)})),this.subscriptions=this.subscriptions.filter((r=>r.params.channel!==e||t&&r.cb!==t)),e&&this.subscribed[e]&&!this.subscriptions.find((t=>t.params.channel===e))&&r.find((e=>!e.quiet))&&(this.send(`DEL ${e}`),this.subscribed[e]=!1)}},jc={RAW:"raw",SCHEMATIC:"schematic",TOPOGRAPHIC:"topographic"},Vc=class{get bbox(){return this._bbox}set bbox(e){JSON.stringify(e)!==JSON.stringify(this._bbox)&&(this._bbox=e,this.wsApi&&this._bbox&&this.wsApi.send(`BBOX ${this._bbox.join(" ")}`))}get buffer(){return this._buffer}set buffer(e){JSON.stringify(e)!==JSON.stringify(this._buffer)&&(this._buffer=e,this.wsApi&&this._buffer&&this.wsApi.send(`BUFFER ${this._buffer.join(" ")}`))}get url(){return this._url}set url(e){this._url!==e&&(this._url=e,(this.wsApi.open||this.wsApi.connecting)&&this.open())}constructor(e={}){this.version="2";let t=e;"string"==typeof e&&(t={url:e});let{apiKey:r}=t,{url:i}=t,n=new Hc,a="";r&&!i?.includes("key=")&&(a=`?key=${r}`),this._url=(i||"wss://api.geops.io/tracker-ws/v1/")+a,this._buffer=t.buffer||[100,100],this._bbox=t.bbox,this.version=t.version||"2",this.pingIntervalMs=t.pingIntervalMs||1e4,this.reconnectTimeoutMs=t.reconnectTimeoutMs||100,this.wsApi=n}close(){this.wsApi.close()}get(e){let t=e;return"string"==typeof e&&(t={channel:e}),new Promise(((e,r)=>{this.wsApi.get(t,e,r)}))}getFullTrajectory(e,t,r){let i="";"1"===this.version&&(i=zc(t,jc));let n=[`full_trajectory${i}`];return e&&n.push(e),(!t||t===jc.TOPOGRAPHIC)&&r&&n.push(`gen${r}`),this.get(n.join("_"))}getStation(e,t){let r={args:e,channel:`station${zc(t,jc)}`};return this.get(r)}getStations(e,t=100){return new Promise(((r,i)=>{this.get(`station${zc(e,jc)}`).then(Qc(r,void 0,t)).catch(i)}))}getStopSequence(e){return this.get(`stopsequence_${e}`)}getTrajectory(e,t){return this.get(`partial_trajectory${zc(t,jc)}_${e}`)}onClose(){window.clearTimeout(this.pingInterval),window.clearTimeout(this.reconnectTimeout),this.reconnectTimeoutMs&&(this.reconnectTimeout=window.setTimeout((()=>this.open()),this.reconnectTimeoutMs))}onOpen(){this.bbox&&this.wsApi.send(`BBOX ${this.bbox.join(" ")}`),this.buffer&&this.wsApi.send(`BUFFER ${this.buffer.join(" ")}`),this.pingIntervalMs&&(window.clearInterval(this.pingInterval),this.pingInterval=window.setInterval((()=>{this.wsApi.send("PING")}),this.pingIntervalMs))}open(){this.wsApi.connect(this.url,this.onOpen.bind(this)),this.wsApi.websocket&&(this.wsApi.websocket.onclose=()=>{this.onClose()})}reset(){this.wsApi.send("RESET")}subscribe(e,t,r=()=>{},i=!1){!e||!t||this.wsApi.subscribe({channel:e},t,r,i)}subscribeDeletedVehicles(e,t,r=()=>{},i=!1){this.unsubscribeDeletedVehicles(t);let n="";"1"===this.version&&(n=zc(e,jc)),this.subscribe(`deleted_vehicles${n}`,t,r,i)}subscribeDepartures(e,t,r=()=>{},i=!1){this.subscribeTimetable(e,t,r,i)}subscribeDisruptions(e,t,r=()=>{},i=!1){this.subscribeNewsticker(e,t,r,i)}subscribeExtraGeoms(e,t=()=>{},r=!1){this.subscribe("extra_geoms",e,t,r)}subscribeFullTrajectory(e,t,r,i=()=>{},n=!1){let a="";"1"===this.version&&(a=zc(t,jc)),this.subscribe(`full_trajectory${a}_${e}`,r,i,n)}subscribeHealthCheck(e,t=()=>{},r=!1){this.subscribe("healthcheck",e,t,r)}subscribeNewsticker(e,t,r=()=>{},i=!1){this.subscribe(`${e}_newsticker`,t,r,i)}subscribeStations(e,t,r=()=>{},i=!1){this.subscribe(`station${zc(e,jc)}`,t,r,i)}subscribeStopSequence(e,t,r=()=>{},i=!1){this.subscribe(`stopsequence_${e}`,t,r,i)}subscribeTimetable(e,t,r=()=>{},i=!1){this.subscribe(`timetable_${e}`,t,r,i)}subscribeTrajectory(e,t,r=()=>{},i=!1){this.unsubscribeTrajectory(t);let n="";"1"===this.version&&(n=zc(e,jc)),this.subscribe(`trajectory${n}`,t,r,i)}unsubscribe(e,t="",r){let i=zc(jc.SCHEMATIC,jc),n=zc(jc.TOPOGRAPHIC,jc);this.wsApi.unsubscribe(`${e}${i}${t||""}`,r),this.wsApi.unsubscribe(`${e}${n}${t||""}`,r)}unsubscribeDeletedVehicles(e){this.unsubscribe("deleted_vehicles","",e)}unsubscribeDepartures(e,t){this.unsubscribeTimetable(e,t)}unsubscribeDisruptions(e,t){this.unsubscribeNewsticker(e,t)}unsubscribeExtraGeoms(e){this.unsubscribe("extra_geoms","",e)}unsubscribeFullTrajectory(e,t){this.unsubscribe("full_trajectory",`_${e}`,t)}unsubscribeHealthCheck(e){this.unsubscribe("healthcheck","",e)}unsubscribeNewsticker(e,t){this.unsubscribe(`${e}_newsticker`,"",t)}unsubscribeStations(e){this.unsubscribe("station","",e)}unsubscribeStopSequence(e,t){this.unsubscribe("stopsequence",`_${e}`,t)}unsubscribeTimetable(e,t){this.unsubscribe(`timetable_${e}`,"",t)}unsubscribeTrajectory(e){this.unsubscribe("trajectory","",e)}},Gc=class extends Uc{constructor(e={}){super(Object.assign(Object.assign({},e),{url:e.url||"https://api.geops.io/stops/v1/"}))}search(e,t){return this.fetch("",e,t)}},Kc=(e,t)=>{let r=null;return typeof window>"u"?null:(typeof document<"u"&&document?.createElement?(r=document.createElement("canvas"),r.width=e,r.height=t):OffscreenCanvas?r=new OffscreenCanvas(e,t):console.error("We didn't find a way to create a canvas element, document.createElement('canvas') and new OffscrenCanvas() are not supported"),r)},qc={},Zc={},Wc={},$c={},Xc={},Yc=(e,t,r)=>{let{delayDisplay:i=3e5,delayOutlineColor:n="#000",getBgColor:a=()=>"#000",getDelayColor:s=()=>"#000",getDelayFont:o=e=>`bold ${e}px arial, sans-serif`,getDelayText:l=()=>null,getMaxRadiusForStrokeAndDelay:h=()=>7,getMaxRadiusForText:A=()=>10,getRadius:u=()=>0,getText:c=e=>e,getTextColor:d=()=>"#000",getTextFont:p=e=>`bold ${e}px arial, sans-serif`,getTextSize:f=()=>14,hoverVehicleId:g,selectedVehicleId:m,useDelayStyle:y}=r,{pixelRatio:_=1,zoom:v}=t,{type:w}=e.properties,{delay:b,line:x,operator_provides_realtime_journey:B,state:C,train_id:S}=e.properties,{color:E,name:I,text_color:T}=x||{};I=c(I);let F="JOURNEY_CANCELLED"===C;w||(w="rail"),I||(I="I"),E&&!E.startsWith("#")&&(E=`#${E}`),T&&!T.startsWith("#")&&(T=`#${T}`);let P=!(!g||g!==S),L=!(!m||m!==S),M=u(w,Math.min(Math.floor(v||1),16))*_,k=M>=h()*_;(P||L)&&(M=k?M+5*_:14*_);let U=M>A()*_,R=`${M}${P||L}`;if(y?R+=`${B}${b}${F}`:(E=E||a(w,x),R+=`${E}`,k&&(R+=`${F}${b}`)),U&&(T=y?"#000000":T||d(w,x),R+=`${I}${T}`),!Xc[R]){if(0===M)return null;let e=1*_,t=M+2*_,r=2*M,a=2*t+2*e,h=a/2,A=null;k&&null!==b&&(A=((e,t,r)=>{let i=`${e}, ${t}, ${r}`;if(!qc[i]){let n=Kc(2*e,2*e);if(n){let a=n.getContext("2d");if(!a)return null;a.beginPath(),a.arc(e,e,t,0,2*Math.PI,!1),a.fillStyle=r,a.filter="blur(1px)",a.fill(),qc[i]=n}}return qc[i]})(h,t,s(b,F)));let u=null,c=0;if(k&&(P||(b||0)>=i||F)){c=Math.max(F?19:14,Math.min(F?19:17,1.2*M))*_;let e=l(b,F);e&&(u=((e,t,r,i,n="#000",a=1)=>{let s=`${e}, ${r}, ${i}, ${n}, ${a}`;if(!Zc[s]){let o=Kc(Math.ceil(e.length*t),Math.ceil(t+8*a));if(o){let l=o.getContext("2d");if(!l)return null;l.font=r,l.textAlign="left",l.textBaseline="middle",l.font=r,l.fillStyle=i,l.strokeStyle=n,l.lineWidth=1.5*a,l.strokeText(e,0,t),l.fillText(e,0,t),Zc[s]=o}}return Zc[s]})(e,c,o(c,e),s(b,F,!0),n,_))}let d=k||P||L,g=!!k&&!!y&&null===b&&"yes"===B,m=E||"#fff";y&&(m=s(b,F));let v=((e,t,r,i,n,a)=>{let s=`${e}, ${t}, ${r}, ${i},  ${n}, ${a}`;if(!Wc[s]){let o=Kc(2*e,2*e);if(o){let l=o.getContext("2d");if(!l)return null;l.fillStyle=r,i&&(l.lineWidth=1*a,l.strokeStyle="#000000"),l.beginPath(),l.arc(e,e,t,0,2*Math.PI,!1),l.fill(),n&&l.setLineDash([5,3]),i&&l.stroke(),Wc[s]=o}}return Wc[s]})(h,M,m,d,g,_),w=Kc(a+2*(u?.width||0),a);if(w){let i=w.getContext("2d");if(!i)return null;let n=u?.width||0;A&&i.drawImage(A,n,0),v&&i.drawImage(v,n,0);let a=null;if(U){a=((e,t,r,i,n,a,s,o)=>{let l=`${e}, ${t}, ${r}, ${i},${n}, ${a}, ${s}`;if(!$c[l]){let s=Kc(2*t,2*t);if(s){let h=s.getContext("2d");if(!h)return null;a&&(h.save(),h.textBaseline="middle",h.textAlign="center",h.font=o(r+2,e),h.strokeStyle=n,h.strokeText(e,t,t),h.restore()),h.textBaseline="middle",h.textAlign="center",h.fillStyle=i,h.font=o(r,e),h.strokeStyle=n,h.strokeText(e,t,t),h.fillText(e,t,t),$c[l]=s}}return $c[l]})(I,h,f(i,r,I,Math.max(M,10),p),T||"#000",m,!!y&&null===b&&"yes"===B,_,p)}a&&i.drawImage(a,n,0),u&&i.drawImage(u,n+Math.ceil(h+t)+e,Math.ceil(h-c)),Xc[R]=w}}return Xc[R]},Jc=(e,t,r=!1)=>{let i=["HIDDEN","LEAVING","BOARDING"],n=e.has_fzo&&i.includes(e.state),a=t.has_fzo&&i.includes(t.state);if(n||a){if(n!==a)return n?-1:1;if(e.state!==t.state)return i.indexOf(e.state)-i.indexOf(t.state)}let s=null,o=null,l=Date.now();return r?(s=new Date(e.min_arrival_time||e.time).getTime()-l,o=new Date(t.min_arrival_time||t.time).getTime()-l):(s=new Date(e.time).getTime()-l,o=new Date(t.time).getTime()-l),s-o},ed="vectorTileFeature",td=(e,t=!1,r=30)=>{let i=Object.keys(e).map((t=>e[t]));i.sort(((e,r)=>Jc(e,r,t)));let n=new Date;n.setMinutes(n.getMinutes()+r);let a=n.getTime(),s=new Date;s.setMinutes(s.getMinutes()-r);let o=s.getTime(),l=[],h=[],A=null;for(let e=i.length-1;e>=0;e-=1){let t=Object.assign({},i[e]),r=new Date(t.time).getTime();r>o&&r<a&&("BOARDING"===t.state&&(h.includes(t.platform)?t.state="HIDDEN":h.push(t.platform)),A&&t.to[0]===A.to[0]&&Math.abs(r-A.time)<1e3&&t.line.name===A.line.name&&(t.state="HIDDEN"),/(STOP_CANCELLED|JOURNEY_CANCELLED)/.test(t.state)&&(t.cancelled=!0),A=t,A.time=r,l.unshift(t))}return l},rd=(e,t=!1,r=30,i=100)=>{let n={},a={};return s=>{let{content:o,source:l}=s;n[l]&&window.clearTimeout(n[l]),o&&(a[o.call_id]=o,n[l]=window.setTimeout((()=>{let i=td(a,t||!1,r);e(i)}),i))}},id=e=>{let t=e;Array.isArray(t)||(t=[e]);let r=[];return t.forEach((e=>{var t,i,n;r.push(e);let a=e.children||e.get("children")||(null===(n=null===(i=(t=e).getLayers)||void 0===i?void 0:i.call(t))||void 0===n?void 0:n.getArray());r=r.concat(id(a||[]))})),r},nd=id;var ad=function(e){let t=e.filter((e=>{var t;return null===(t=e?.trim)||void 0===t?void 0:t.call(e)})),r=t.map((e=>e.toLowerCase()));return[...new Set(r)].map((e=>t.find((t=>t.toLowerCase()===e))))},sd=0,od=1,ld=2,hd=4,Ad=8,ud=16;function cd(e,t,r){return r?(r[0]=e[0]-t,r[1]=e[1]-t,r[2]=e[2]+t,r[3]=e[3]+t,r):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function dd(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function pd(e,t,r){let i,n;return i=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,n=r<e[1]?e[1]-r:e[3]<r?r-e[3]:0,i*i+n*n}function fd(e,t){return md(e,t[0],t[1])}function gd(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function md(e,t,r){return e[0]<=t&&t<=e[2]&&e[1]<=r&&r<=e[3]}function yd(e,t){let r=e[0],i=e[1],n=e[2],a=e[3],s=t[0],o=t[1],l=sd;return s<r?l|=ud:s>n&&(l|=hd),o<i?l|=Ad:o>a&&(l|=ld),l===sd&&(l=od),l}function _d(e,t,r,i,n){return n?(n[0]=e,n[1]=t,n[2]=r,n[3]=i,n):[e,t,r,i]}function vd(e){return _d(1/0,1/0,-1/0,-1/0,e)}function wd(e,t){let r=e[0],i=e[1];return _d(r,i,r,i,t)}function bd(e,t,r,i,n){return Cd(vd(n),e,t,r,i)}function xd(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function Bd(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Cd(e,t,r,i,n){for(;r<i;r+=n)Sd(e,t[r],t[r+1]);return e}function Sd(e,t,r){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],r),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],r)}function Ed(e,t){let r;return r=t(Id(e)),!!(r||(r=t(Td(e)),r)||(r=t(Ud(e)),r)||(r=t(kd(e)),r))&&r}function Id(e){return[e[0],e[1]]}function Td(e){return[e[2],e[1]]}function Fd(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function Pd(e,t,r,i,n){let[a,s,o,l,h,A,u,c]=function(e,t,r,i){let n=t*i[0]/2,a=t*i[1]/2,s=Math.cos(r),o=Math.sin(r),l=n*s,h=n*o,A=a*s,u=a*o,c=e[0],d=e[1];return[c-l+u,d-h-A,c-l-u,d-h+A,c+l-u,d+h+A,c+l+u,d+h-A,c-l+u,d-h-A]}(e,t,r,i);return _d(Math.min(a,o,h,u),Math.min(s,l,A,c),Math.max(a,o,h,u),Math.max(s,l,A,c),n)}function Ld(e){return e[3]-e[1]}function Md(e,t,r){let i=r||[1/0,1/0,-1/0,-1/0];return Dd(e,t)?(e[0]>t[0]?i[0]=e[0]:i[0]=t[0],e[1]>t[1]?i[1]=e[1]:i[1]=t[1],e[2]<t[2]?i[2]=e[2]:i[2]=t[2],e[3]<t[3]?i[3]=e[3]:i[3]=t[3]):vd(i),i}function kd(e){return[e[0],e[3]]}function Ud(e){return[e[2],e[3]]}function Rd(e){return e[2]-e[0]}function Dd(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Nd(e){return e[2]<e[0]||e[3]<e[1]}function Od(e,t){let r=t.getExtent(),i=Fd(e);if(t.canWrapX()&&(i[0]<r[0]||i[0]>=r[2])){let t=Rd(r),n=Math.floor((i[0]-r[0])/t)*t;e[0]-=n,e[2]-=n}return e}function Qd(){throw new Error("Unimplemented abstract method.")}var zd=0;function Hd(e){return e.ol_uid||(e.ol_uid=String(++zd))}var jd="propertychange",Vd="change",Gd="contextmenu",Kd="click",qd="dblclick",Zd="keydown",Wd="keypress",$d="touchmove",Xd="wheel",Yd=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function Jd(e,t){return e>t?1:e<t?-1:0}function ep(e,t){return e<t?1:e>t?-1:0}function tp(e,t,r){if(e[0]<=t)return 0;let i=e.length;if(t<=e[i-1])return i-1;if("function"==typeof r){for(let n=1;n<i;++n){let i=e[n];if(i===t)return n;if(i<t)return r(t,e[n-1],i)>0?n-1:n}return i-1}if(r>0){for(let r=1;r<i;++r)if(e[r]<t)return r-1;return i-1}if(r<0){for(let r=1;r<i;++r)if(e[r]<=t)return r;return i-1}for(let r=1;r<i;++r){if(e[r]==t)return r;if(e[r]<t)return e[r-1]-t<t-e[r]?r-1:r}return i-1}function rp(e,t,r){for(;t<r;){let i=e[t];e[t]=e[r],e[r]=i,++t,--r}}function ip(e,t){let r=Array.isArray(t)?t:[t],i=r.length;for(let t=0;t<i;t++)e[e.length]=r[t]}function np(e,t){let r=e.length;if(r!==t.length)return!1;for(let i=0;i<r;i++)if(e[i]!==t[i])return!1;return!0}function ap(){return!0}function sp(){return!1}function op(){}function lp(e){let t,r,i;return function(){let n=Array.prototype.slice.call(arguments);return(!r||this!==i||!np(n,r))&&(i=this,r=n,t=e.apply(this,arguments)),t}}function hp(e){for(let t in e)delete e[t]}function Ap(e){let t;for(t in e)return!1;return!t}var up=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},cp=class extends Yd{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let r=this.listeners_||(this.listeners_={}),i=r[e]||(r[e]=[]);i.includes(t)||i.push(t)}dispatchEvent(e){let t="string"==typeof e,r=t?e:e.type,i=this.listeners_&&this.listeners_[r];if(!i)return;let n=t?new up(e):e;n.target||(n.target=this.eventTarget_||this);let a,s=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});r in s||(s[r]=0,o[r]=0),++s[r];for(let e=0,t=i.length;e<t;++e)if(a="handleEvent"in i[e]?i[e].handleEvent(n):i[e].call(this,n),!1===a||n.propagationStopped){a=!1;break}if(0==--s[r]){let e=o[r];for(delete o[r];e--;)this.removeEventListener(r,op);delete s[r]}return a}disposeInternal(){this.listeners_&&hp(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return!!this.listeners_&&(e?e in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(e,t){if(!this.listeners_)return;let r=this.listeners_[e];if(!r)return;let i=r.indexOf(t);-1!==i&&(this.pendingRemovals_&&e in this.pendingRemovals_?(r[i]=op,++this.pendingRemovals_[e]):(r.splice(i,1),0===r.length&&delete this.listeners_[e]))}};function dp(e,t,r,i,n){if(n){let n=r;r=function(a){return e.removeEventListener(t,r),n.call(i??this,a)}}else i&&i!==e&&(r=r.bind(i));let a={target:e,type:t,listener:r};return e.addEventListener(t,r),a}function pp(e,t,r,i){return dp(e,t,r,i,!0)}function fp(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),hp(e))}var gp=class extends cp{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Vd)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let r=e.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=dp(this,e[n],t);return i}return dp(this,e,t)}onceInternal(e,t){let r;if(Array.isArray(e)){let i=e.length;r=new Array(i);for(let n=0;n<i;++n)r[n]=pp(this,e[n],t)}else r=pp(this,e,t);return t.ol_key=r,r}unInternal(e,t){let r=t.ol_key;if(r)mp(r);else if(Array.isArray(e))for(let r=0,i=e.length;r<i;++r)this.removeEventListener(e[r],t);else this.removeEventListener(e,t)}};function mp(e){if(Array.isArray(e))for(let t=0,r=e.length;t<r;++t)fp(e[t]);else fp(e)}gp.prototype.on,gp.prototype.once,gp.prototype.un;var yp=gp,_p=class extends up{constructor(e,t,r){super(e),this.key=t,this.oldValue=r}},vp=class extends yp{constructor(e){super(),this.on,this.once,this.un,Hd(this),this.values_=null,void 0!==e&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let r;r=`change:${e}`,this.hasListener(r)&&this.dispatchEvent(new _p(r,e,t)),r=jd,this.hasListener(r)&&this.dispatchEvent(new _p(r,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,r){let i=this.values_||(this.values_={});if(r)i[e]=t;else{let r=i[e];i[e]=t,r!==t&&this.notify(e,r)}}setProperties(e,t){for(let r in e)this.set(r,e[r],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){let r=this.values_[e];delete this.values_[e],Ap(this.values_)&&(this.values_=null),t||this.notify(e,r)}}},wp=2,bp=1;function xp(...e){bp>wp||console.warn(...e)}function Bp(e,t,r){return Math.min(Math.max(e,t),r)}function Cp(e,t,r,i,n,a){let s=n-r,o=a-i;if(0!==s||0!==o){let l=((e-r)*s+(t-i)*o)/(s*s+o*o);l>1?(r=n,i=a):l>0&&(r+=s*l,i+=o*l)}return Sp(e,t,r,i)}function Sp(e,t,r,i){let n=r-e,a=i-t;return n*n+a*a}function Ep(e){return 180*e/Math.PI}function Ip(e){return e*Math.PI/180}function Tp(e,t){let r=e%t;return r*t<0?r+t:r}function Fp(e,t,r){return e+r*(t-e)}function Pp(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}function Lp(e,t,r){if(e>=t&&e<r)return e;let i=r-t;return((e-t)%i+i)%i+t}function Mp(e,t){let r=!0;for(let i=e.length-1;i>=0;--i)if(e[i]!=t[i]){r=!1;break}return r}function kp(e,t){let r=Math.cos(t),i=Math.sin(t),n=e[0]*r-e[1]*i,a=e[1]*r+e[0]*i;return e[0]=n,e[1]=a,e}function Up(e,t){if(t.canWrapX()){let r=Rd(t.getExtent()),i=function(e,t,r){let i=t.getExtent(),n=0;return t.canWrapX()&&(e[0]<i[0]||e[0]>i[2])&&(r=r||Rd(i),n=Math.floor((e[0]-i[0])/r)),n}(e,t,r);i&&(e[0]-=i*r)}return e}var Rp={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Dp=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=void 0!==e.extent?e.extent:null,this.worldExtent_=void 0!==e.worldExtent?e.worldExtent:null,this.axisOrientation_=void 0!==e.axisOrientation?e.axisOrientation:"enu",this.global_=void 0!==e.global&&e.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Rp[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!(!e||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!(!this.global_||!e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Np=6378137,Op=Math.PI*Np,Qp=[-Op,-Op,Op,Op],zp=[-180,-85,180,85],Hp=Np*Math.log(Math.tan(Math.PI/2)),jp=class extends Dp{constructor(e){super({code:e,units:"m",extent:Qp,global:!0,worldExtent:zp,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Np)}})}},Vp=[new jp("EPSG:3857"),new jp("EPSG:102100"),new jp("EPSG:102113"),new jp("EPSG:900913"),new jp("http://www.opengis.net/def/crs/EPSG/0/3857"),new jp("http://www.opengis.net/gml/srs/epsg.xml#3857")];function Gp(e,t,r,i){let n=e.length;r=r>1?r:2,i=i??r,void 0===t&&(t=r>2?e.slice():new Array(n));for(let r=0;r<n;r+=i){t[r]=Op*e[r]/180;let i=Np*Math.log(Math.tan(Math.PI*(+e[r+1]+90)/360));i>Hp?i=Hp:i<-Hp&&(i=-Hp),t[r+1]=i}return t}function Kp(e,t,r,i){let n=e.length;r=r>1?r:2,i=i??r,void 0===t&&(t=r>2?e.slice():new Array(n));for(let r=0;r<n;r+=i)t[r]=180*e[r]/Op,t[r+1]=360*Math.atan(Math.exp(e[r+1]/Np))/Math.PI-90;return t}var qp=[-180,-90,180,90],Zp=6378137*Math.PI/180,Wp=class extends Dp{constructor(e,t){super({code:e,units:"degrees",extent:qp,axisOrientation:t,global:!0,metersPerUnit:Zp,worldExtent:qp})}},$p=[new Wp("CRS:84"),new Wp("EPSG:4326","neu"),new Wp("urn:ogc:def:crs:OGC:1.3:CRS84"),new Wp("urn:ogc:def:crs:OGC:2:84"),new Wp("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Wp("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Wp("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],Xp={};var Yp={};function Jp(e,t,r){let i=e.getCode(),n=t.getCode();i in Yp||(Yp[i]={}),Yp[i][n]=r}function ef(e,t){return e in Yp&&t in Yp[e]?Yp[e][t]:null}var tf=.9996,rf=.00669438,nf=rf*rf,af=nf*rf,sf=rf/(1-rf),of=Math.sqrt(1-rf),lf=(1-of)/(1+of),hf=lf*lf,Af=hf*lf,uf=Af*lf,cf=uf*lf,df=.9983242984503243,pf=15*nf/256+45*af/1024,ff=35*af/3072,gf=1.5*lf-27/32*Af+269/512*cf,mf=21/16*hf-55/32*uf,yf=151/96*Af-417/128*cf,_f=1097/512*uf,vf=6378137;function wf(e,t,r){let i=e-5e5,n=(r.north?t:t-1e7)/tf/(vf*df),a=n+gf*Math.sin(2*n)+mf*Math.sin(4*n)+yf*Math.sin(6*n)+_f*Math.sin(8*n),s=Math.sin(a),o=s*s,l=Math.cos(a),h=s/l,A=h*h,u=A*A,c=1-rf*o,d=Math.sqrt(1-rf*o),p=sf*l**2,f=p*p,g=i/(vf/d*tf),m=g*g,y=m*g,_=y*g,v=_*g,w=a-h/((1-rf)/c)*(m/2-_/24*(5+3*A+10*p-4*f-9*sf))+v*g/720*(61+90*A+298*p+45*u-252*sf-3*f),b=(g-y/6*(1+2*A+p)+v/120*(5-2*p+28*A-3*f+8*sf+24*u))/l;return b=Lp(b+Ip(xf(r.number)),-Math.PI,Math.PI),[Ep(b),Ep(w)]}function bf(e,t,r){e=Lp(e,-180,180),t<-80?t=-80:t>84&&(t=84);let i=Ip(t),n=Math.sin(i),a=Math.cos(i),s=n/a,o=s*s,l=o*o,h=Ip(e),A=Ip(xf(r.number)),u=vf/Math.sqrt(1-rf*n**2),c=sf*a**2,d=a*Lp(h-A,-Math.PI,Math.PI),p=d*d,f=p*d,g=f*d,m=g*d,y=m*d,_=vf*(df*i-.002514607064228144*Math.sin(2*i)+pf*Math.sin(4*i)-ff*Math.sin(6*i)),v=tf*u*(d+f/6*(1-o+c)+m/120*(5-18*o+l+72*c-58*sf))+5e5,w=tf*(_+u*s*(p/2+g/24*(5-o+9*c+4*c**2)+y/720*(61-58*o+l+600*c-330*sf)));return r.north||(w+=1e7),[v,w]}function xf(e){return 6*(e-1)-180+3}var Bf=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Cf(e){let t=0;for(let r of Bf){let i=e.match(r);if(i){t=parseInt(i[1]);break}}if(!t)return null;let r=0,i=!1;return t>32700&&t<32761?r=t-32700:t>32600&&t<32661&&(i=!0,r=t-32600),r?{number:r,north:i}:null}function Sf(e,t){return function(r,i,n,a){let s=r.length;n=n>1?n:2,a=a??n,i||(i=n>2?r.slice():new Array(s));for(let n=0;n<s;n+=a){let a=r[n],s=r[n+1],o=e(a,s,t);i[n]=o[0],i[n+1]=o[1]}return i}}var Ef=6371008.8;function If(e,t,r){r=r||Ef;let i=Ip(e[1]),n=Ip(t[1]),a=(n-i)/2,s=Ip(t[0]-e[0])/2,o=Math.sin(a)*Math.sin(a)+Math.sin(s)*Math.sin(s)*Math.cos(i)*Math.cos(n);return 2*r*Math.atan2(Math.sqrt(o),Math.sqrt(1-o))}function Tf(e,t,r,i){i=i||Ef;let n=Ip(e[1]),a=Ip(e[0]),s=t/i,o=Math.asin(Math.sin(n)*Math.cos(s)+Math.cos(n)*Math.sin(s)*Math.cos(r));return[Ep(a+Math.atan2(Math.sin(r)*Math.sin(s)*Math.cos(n),Math.cos(s)-Math.sin(n)*Math.sin(o))),Ep(o)]}var Ff=[function(e){let t=Cf(e.getCode());return t?{forward:Sf(bf,t),inverse:Sf(wf,t)}:null}],Pf=[function(e){return Cf(e)?new Dp({code:e,units:"m"}):null}],Lf=!0;function Mf(e){Lf=!(void 0===e||e)}function kf(e,t){if(void 0!==t)for(let r=0,i=e.length;r<i;++r)t[r]=e[r];else t=e.slice();return t}function Uf(e,t){if(void 0!==t&&e!==t){for(let r=0,i=e.length;r<i;++r)t[r]=e[r];e=t}return e}function Rf(e){(function(e,t){Xp[e]=t})(e.getCode(),e),Jp(e,e,kf)}function Df(e){if("string"!=typeof e)return e;let t=function(e){return Xp[e]||Xp[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}(e);if(t)return t;for(let t of Pf){let r=t(e);if(r)return r}return null}function Nf(e,t,r,i){let n,a=(e=Df(e)).getPointResolutionFunc();if(a){if(n=a(t,r),i&&i!==e.getUnits()){let t=e.getMetersPerUnit();t&&(n=n*t/Rp[i])}}else{let a=e.getUnits();if("degrees"==a&&!i||"degrees"==i)n=t;else{let s=jf(e,Df("EPSG:4326"));if(s||"degrees"===a){let e=[r[0]-t/2,r[1],r[0]+t/2,r[1],r[0],r[1]-t/2,r[0],r[1]+t/2];e=s(e,e,2),n=(If(e.slice(0,2),e.slice(2,4))+If(e.slice(4,6),e.slice(6,8)))/2}else n=t*e.getMetersPerUnit();let o=i?Rp[i]:e.getMetersPerUnit();void 0!==o&&(n/=o)}}return n}function Of(e){(function(e){e.forEach(Rf)})(e),e.forEach((function(t){e.forEach((function(e){t!==e&&Jp(t,e,kf)}))}))}function Qf(e,t){return e?"string"==typeof e?Df(e):e:Df(t)}function zf(e,t){return Mf(),Kf(e,"EPSG:4326",void 0!==t?t:"EPSG:3857")}function Hf(e,t){let r=Kf(e,void 0!==t?t:"EPSG:3857","EPSG:4326"),i=r[0];return(i<-180||i>180)&&(r[0]=Tp(i+180,360)-180),r}function jf(e,t){let r=e.getCode(),i=t.getCode(),n=ef(r,i);if(n)return n;let a=null,s=null;for(let r of Ff)a||(a=r(e)),s||(s=r(t));if(!a&&!s)return null;let o="EPSG:4326";if(s)if(a)n=Vf(a.inverse,s.forward);else{let e=ef(r,o);e&&(n=Vf(e,s.forward))}else{let e=ef(o,i);e&&(n=Vf(a.inverse,e))}return n&&(Rf(e),Rf(t),Jp(e,t,n)),n}function Vf(e,t){return function(r,i,n,a){return i=e(r,i,n,a),t(i,i,n,a)}}function Gf(e,t){return jf(Df(e),Df(t))}function Kf(e,t,r){let i=Gf(t,r);if(!i){let e=Df(t).getCode(),i=Df(r).getCode();throw new Error(`No transform available between ${e} and ${i}`)}return i(e,void 0,e.length)}var qf,Zf,Wf,$f=null;function Xf(){return $f}function Yf(e,t){return e}function Jf(e,t){return Lf&&!Mp(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Lf=!1,xp("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),e}function eg(e,t){return e}function tg(e,t){return e}function rg(e,t){if(!e)throw new Error(t)}Of(Vp),Of($p),qf=Vp,Zf=Gp,Wf=Kp,$p.forEach((function(e){qf.forEach((function(t){Jp(e,t,Zf),Jp(t,e,Wf)}))}));new Array(6);function ig(e,t){let r=t[0],i=t[1];return t[0]=e[0]*r+e[2]*i+e[4],t[1]=e[1]*r+e[3]*i+e[5],t}function ng(e,t,r,i,n,a,s,o){let l=Math.sin(a),h=Math.cos(a);return e[0]=i*h,e[1]=n*l,e[2]=-i*l,e[3]=n*h,e[4]=s*i*h-o*i*l+t,e[5]=s*n*l+o*n*h+r,e}function ag(e,t){let r=function(e){return e[0]*e[3]-e[1]*e[2]}(t);rg(0!==r,"Transformation matrix cannot be inverted");let i=t[0],n=t[1],a=t[2],s=t[3],o=t[4],l=t[5];return e[0]=s/r,e[1]=-n/r,e[2]=-a/r,e[3]=i/r,e[4]=(a*l-s*o)/r,e[5]=-(i*l-n*o)/r,e}var sg=[1e5,1e5,1e5,1e5,2,2];function og(e){return"matrix("+e.join(", ")+")"}function lg(e){return e.substring(7,e.length-1).split(",").map(parseFloat)}function hg(e,t,r,i,n,a,s){a=a||[],s=s||2;let o=0;for(let l=t;l<r;l+=i){let t=e[l],r=e[l+1];a[o++]=n[0]*t+n[2]*r+n[4],a[o++]=n[1]*t+n[3]*r+n[5];for(let t=2;t<s;t++)a[o++]=e[l+t]}return a&&a.length!=o&&(a.length=o),a}function Ag(e,t,r,i,n,a,s){s=s||[];let o=Math.cos(n),l=Math.sin(n),h=a[0],A=a[1],u=0;for(let n=t;n<r;n+=i){let t=e[n]-h,r=e[n+1]-A;s[u++]=h+t*o-r*l,s[u++]=A+t*l+r*o;for(let t=n+2;t<n+i;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}var ug=[1,0,0,1,0,0],cg=[NaN,NaN],dg=class extends vp{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=lp(((e,t,r)=>{if(!r)return this.getSimplifiedGeometry(t);let i=this.clone();return i.applyTransform(r),i.getSimplifiedGeometry(t)}))}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return Qd()}closestPointXY(e,t,r,i){return Qd()}containsXY(e,t){return 0===this.closestPointXY(e,t,cg,Number.MIN_VALUE)}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return Qd()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&vd(e),this.extentRevision_=this.getRevision()}return function(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}(this.extent_,e)}rotate(e,t){Qd()}scale(e,t,r){Qd()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return Qd()}getType(){return Qd()}applyTransform(e){Qd()}intersectsExtent(e){return Qd()}translate(e,t){Qd()}transform(e,t){let r=Df(e),i="tile-pixels"==r.getUnits()?function(e,i,n){let a=r.getExtent(),s=r.getWorldExtent(),o=Ld(s)/Ld(a);ng(ug,s[0],s[3],o,-o,0,0,0);let l=hg(e,0,e.length,n,ug,i),h=Gf(r,t);return h?h(l,l,n):l}:Gf(r,t);return this.applyTransform(i),this}};function pg(e){let t;return 2==e?t="XY":3==e?t="XYZ":4==e&&(t="XYZM"),t}function fg(e){let t;return"XY"==e?t=2:"XYZ"==e||"XYM"==e?t=3:"XYZM"==e&&(t=4),t}var gg=class extends dg{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(e){return bd(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return Qd()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=fg(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){Qd()}setLayout(e,t,r){let i;if(e)i=fg(e);else{for(let e=0;e<r;++e){if(0===t.length)return this.layout="XY",void(this.stride=2);t=t[0]}i=t.length,e=pg(i)}this.layout=e,this.stride=i}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(e,t){let r=this.getFlatCoordinates();if(r){let i=this.getStride();Ag(r,0,r.length,i,e,t,r),this.changed()}}scale(e,t,r){void 0===t&&(t=e),r||(r=Fd(this.getExtent()));let i=this.getFlatCoordinates();if(i){let n=this.getStride();(function(e,t,r,i,n,a,s,o){o=o||[];let l=s[0],h=s[1],A=0;for(let s=t;s<r;s+=i){let t=e[s]-l,r=e[s+1]-h;o[A++]=l+n*t,o[A++]=h+a*r;for(let t=s+2;t<s+i;++t)o[A++]=e[t]}o&&o.length!=A&&(o.length=A)})(i,0,i.length,n,e,t,r,i),this.changed()}}translate(e,t){let r=this.getFlatCoordinates();if(r){let i=this.getStride();(function(e,t,r,i,n,a,s){s=s||[];let o=0;for(let l=t;l<r;l+=i){s[o++]=e[l]+n,s[o++]=e[l+1]+a;for(let t=l+2;t<l+i;++t)s[o++]=e[t]}s&&s.length!=o&&(s.length=o)})(r,0,r.length,i,e,t,r),this.changed()}}};function mg(e,t,r,i){for(let i=0,n=r.length;i<n;++i)e[t++]=r[i];return t}function yg(e,t,r,i){for(let n=0,a=r.length;n<a;++n){let a=r[n];for(let r=0;r<i;++r)e[t++]=a[r]}return t}function _g(e,t,r,i,n){n=n||[];let a=0;for(let s=0,o=r.length;s<o;++s){let o=yg(e,t,r[s],i);n[a++]=o,t=o}return n.length=a,n}function vg(e,t,r,i,n){n=n||[];let a=0;for(let s=0,o=r.length;s<o;++s){let o=_g(e,t,r[s],i,n[a]);0===o.length&&(o[0]=t),n[a++]=o,t=o[o.length-1]}return n.length=a,n}var wg=class e extends gg{constructor(e,t,r){super(),void 0!==r&&void 0===t?this.setFlatCoordinates(r,e):(t=t||0,this.setCenterAndRadius(e,t,r))}clone(){let t=new e(this.flatCoordinates.slice(),void 0,this.layout);return t.applyProperties(this),t}closestPointXY(e,t,r,i){let n=this.flatCoordinates,a=e-n[0],s=t-n[1],o=a*a+s*s;if(o<i){if(0===o)for(let e=0;e<this.stride;++e)r[e]=n[e];else{let e=this.getRadius()/Math.sqrt(o);r[0]=n[0]+e*a,r[1]=n[1]+e*s;for(let e=2;e<this.stride;++e)r[e]=n[e]}return r.length=this.stride,o}return i}containsXY(e,t){let r=this.flatCoordinates,i=e-r[0],n=t-r[1];return i*i+n*n<=this.getRadiusSquared_()}getCenter(){return this.flatCoordinates.slice(0,this.stride)}computeExtent(e){let t=this.flatCoordinates,r=t[this.stride]-t[0];return _d(t[0]-r,t[1]-r,t[0]+r,t[1]+r,e)}getRadius(){return Math.sqrt(this.getRadiusSquared_())}getRadiusSquared_(){let e=this.flatCoordinates[this.stride]-this.flatCoordinates[0],t=this.flatCoordinates[this.stride+1]-this.flatCoordinates[1];return e*e+t*t}getType(){return"Circle"}intersectsExtent(e){if(Dd(e,this.getExtent())){let t=this.getCenter();return e[0]<=t[0]&&e[2]>=t[0]||e[1]<=t[1]&&e[3]>=t[1]||Ed(e,this.intersectsCoordinate.bind(this))}return!1}setCenter(e){let t=this.stride,r=this.flatCoordinates[t]-this.flatCoordinates[0],i=e.slice();i[t]=i[0]+r;for(let r=1;r<t;++r)i[t+r]=e[r];this.setFlatCoordinates(this.layout,i),this.changed()}setCenterAndRadius(e,t,r){this.setLayout(r,e,0),this.flatCoordinates||(this.flatCoordinates=[]);let i=this.flatCoordinates,n=mg(i,0,e,this.stride);i[n++]=i[0]+t;for(let e=1,t=this.stride;e<t;++e)i[n++]=i[e];i.length=n,this.changed()}getCoordinates(){return null}setCoordinates(e,t){}setRadius(e){this.flatCoordinates[this.stride]=this.flatCoordinates[0]+e,this.changed()}rotate(e,t){let r=this.getCenter(),i=this.getStride();this.setCenter(Ag(r,0,r.length,i,e,t,r)),this.changed()}};wg.prototype.transform;var bg=wg;function xg(e){return e.map((e=>e.clone()))}var Bg=class e extends dg{constructor(e){super(),this.geometries_=e,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(fp),this.changeEventsKeys_.length=0}listenGeometriesChange_(){let e=this.geometries_;for(let t=0,r=e.length;t<r;++t)this.changeEventsKeys_.push(dp(e[t],Vd,this.changed,this))}clone(){let t=new e(xg(this.geometries_));return t.applyProperties(this),t}closestPointXY(e,t,r,i){if(i<pd(this.getExtent(),e,t))return i;let n=this.geometries_;for(let a=0,s=n.length;a<s;++a)i=n[a].closestPointXY(e,t,r,i);return i}containsXY(e,t){let r=this.geometries_;for(let i=0,n=r.length;i<n;++i)if(r[i].containsXY(e,t))return!0;return!1}computeExtent(e){vd(e);let t=this.geometries_;for(let r=0,i=t.length;r<i;++r)Bd(e,t[r].getExtent());return e}getGeometries(){return xg(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let e=[],t=this.geometries_;for(let r=0,i=t.length;r<i;++r)t[r].getType()===this.getType()?e=e.concat(t[r].getGeometriesArrayRecursive()):e.push(t[r]);return e}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;let r=[],i=this.geometries_,n=!1;for(let e=0,a=i.length;e<a;++e){let a=i[e],s=a.getSimplifiedGeometry(t);r.push(s),s!==a&&(n=!0)}return n?new e(r):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(e){let t=this.geometries_;for(let r=0,i=t.length;r<i;++r)if(t[r].intersectsExtent(e))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(e,t){let r=this.geometries_;for(let i=0,n=r.length;i<n;++i)r[i].rotate(e,t);this.changed()}scale(e,t,r){r||(r=Fd(this.getExtent()));let i=this.geometries_;for(let n=0,a=i.length;n<a;++n)i[n].scale(e,t,r);this.changed()}setGeometries(e){this.setGeometriesArray(xg(e))}setGeometriesArray(e){this.unlistenGeometriesChange_(),this.geometries_=e,this.listenGeometriesChange_(),this.changed()}applyTransform(e){let t=this.geometries_;for(let r=0,i=t.length;r<i;++r)t[r].applyTransform(e);this.changed()}translate(e,t){let r=this.geometries_;for(let i=0,n=r.length;i<n;++i)r[i].translate(e,t);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}};function Cg(e,t,r,i){let n=0,a=e[r-i],s=e[r-i+1],o=0,l=0;for(;t<r;t+=i){let r=e[t]-a,i=e[t+1]-s;n+=l*r-o*i,o=r,l=i}return n/2}function Sg(e,t,r,i){let n=0;for(let a=0,s=r.length;a<s;++a){let s=r[a];n+=Cg(e,t,s,i),t=s}return n}function Eg(e,t,r,i,n,a,s){let o,l=e[t],h=e[t+1],A=e[r]-l,u=e[r+1]-h;if(0===A&&0===u)o=t;else{let c=((n-l)*A+(a-h)*u)/(A*A+u*u);if(c>1)o=r;else{if(c>0){for(let n=0;n<i;++n)s[n]=Fp(e[t+n],e[r+n],c);return void(s.length=i)}o=t}}for(let t=0;t<i;++t)s[t]=e[o+t];s.length=i}function Ig(e,t,r,i,n){let a=e[t],s=e[t+1];for(t+=i;t<r;t+=i){let r=e[t],i=e[t+1],o=Sp(a,s,r,i);o>n&&(n=o),a=r,s=i}return n}function Tg(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){let s=r[a];n=Ig(e,t,s,i,n),t=s}return n}function Fg(e,t,r,i,n,a,s,o,l,h,A){if(t==r)return h;let u,c;if(0===n){if(c=Sp(s,o,e[t],e[t+1]),c<h){for(u=0;u<i;++u)l[u]=e[t+u];return l.length=i,c}return h}A=A||[NaN,NaN];let d=t+i;for(;d<r;)if(Eg(e,d-i,d,i,s,o,A),c=Sp(s,o,A[0],A[1]),c<h){for(h=c,u=0;u<i;++u)l[u]=A[u];l.length=i,d+=i}else d+=i*Math.max((Math.sqrt(c)-Math.sqrt(h))/n|0,1);if(a&&(Eg(e,r-i,t,i,s,o,A),c=Sp(s,o,A[0],A[1]),c<h)){for(h=c,u=0;u<i;++u)l[u]=A[u];l.length=i}return h}function Pg(e,t,r,i,n,a,s,o,l,h,A){A=A||[NaN,NaN];for(let u=0,c=r.length;u<c;++u){let c=r[u];h=Fg(e,t,c,i,n,a,s,o,l,h,A),t=c}return h}function Lg(e,t,r,i,n){n=void 0!==n?n:[];let a=0;for(let s=t;s<r;s+=i)n[a++]=e.slice(s,s+i);return n.length=a,n}function Mg(e,t,r,i,n){n=void 0!==n?n:[];let a=0;for(let s=0,o=r.length;s<o;++s){let o=r[s];n[a++]=Lg(e,t,o,i,n[a]),t=o}return n.length=a,n}function kg(e,t,r,i,n){n=void 0!==n?n:[];let a=0;for(let s=0,o=r.length;s<o;++s){let o=r[s];n[a++]=1===o.length&&o[0]===t?[]:Mg(e,t,o,i,n[a]),t=o[o.length-1]}return n.length=a,n}function Ug(e,t,r,i,n,a,s){let o=(r-t)/i;if(o<3){for(;t<r;t+=i)a[s++]=e[t],a[s++]=e[t+1];return s}let l=new Array(o);l[0]=1,l[o-1]=1;let h=[t,r-i],A=0;for(;h.length>0;){let r=h.pop(),a=h.pop(),s=0,o=e[a],u=e[a+1],c=e[r],d=e[r+1];for(let t=a+i;t<r;t+=i){let r=Cp(e[t],e[t+1],o,u,c,d);r>s&&(A=t,s=r)}s>n&&(l[(A-t)/i]=1,a+i<A&&h.push(a,A),A+i<r&&h.push(A,r))}for(let r=0;r<o;++r)l[r]&&(a[s++]=e[t+r*i],a[s++]=e[t+r*i+1]);return s}function Rg(e,t,r,i,n,a,s,o){for(let l=0,h=r.length;l<h;++l){let h=r[l];s=Ug(e,t,h,i,n,a,s),o.push(s),t=h}return s}function Dg(e,t){return t*Math.round(e/t)}function Ng(e,t,r,i,n,a,s){if(t==r)return s;let o,l,h=Dg(e[t],n),A=Dg(e[t+1],n);t+=i,a[s++]=h,a[s++]=A;do{if(o=Dg(e[t],n),l=Dg(e[t+1],n),(t+=i)==r)return a[s++]=o,a[s++]=l,s}while(o==h&&l==A);for(;t<r;){let r=Dg(e[t],n),u=Dg(e[t+1],n);if(t+=i,r==o&&u==l)continue;let c=o-h,d=l-A,p=r-h,f=u-A;c*f==d*p&&(c<0&&p<c||c==p||c>0&&p>c)&&(d<0&&f<d||d==f||d>0&&f>d)?(o=r,l=u):(a[s++]=o,a[s++]=l,h=o,A=l,o=r,l=u)}return a[s++]=o,a[s++]=l,s}function Og(e,t,r,i,n,a,s,o){for(let l=0,h=r.length;l<h;++l){let h=r[l];s=Ng(e,t,h,i,n,a,s),o.push(s),t=h}return s}var Qg=class e extends gg{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===t||Array.isArray(e[0])?this.setCoordinates(e,t):this.setFlatCoordinates(t,e)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,r,i){return i<pd(this.getExtent(),e,t)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ig(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,r,i))}getArea(){return Cg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Lg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let r=[];return r.length=Ug(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,"XY")}getType(){return"LinearRing"}intersectsExtent(e){return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=yg(this.flatCoordinates,0,e,this.stride),this.changed()}};function zg(e,t,r,i,n,a,s){let o,l,h=(r-t)/i;if(1===h)o=t;else if(2===h)o=t,l=n;else if(0!==h){let a=e[t],s=e[t+1],h=0,A=[0];for(let n=t+i;n<r;n+=i){let t=e[n],r=e[n+1];h+=Math.sqrt((t-a)*(t-a)+(r-s)*(r-s)),A.push(h),a=t,s=r}let u=n*h,c=function(e,t,r){let i,n;r=r||Jd;let a=0,s=e.length,o=!1;for(;a<s;)i=a+(s-a>>1),n=+r(e[i],t),n<0?a=i+1:(s=i,o=!n);return o?a:~a}(A,u);c<0?(l=(u-A[-c-2])/(A[-c-1]-A[-c-2]),o=t+(-c-2)*i):o=t+c*i}s=s>1?s:2,a=a||new Array(s);for(let t=0;t<s;++t)a[t]=void 0===o?NaN:void 0===l?e[o+t]:Fp(e[o+t],e[o+i+t],l);return a}function Hg(e,t,r,i,n,a){if(r==t)return null;let s;if(n<e[t+i-1])return a?(s=e.slice(t,t+i),s[i-1]=n,s):null;if(e[r-1]<n)return a?(s=e.slice(r-i,r),s[i-1]=n,s):null;if(n==e[t+i-1])return e.slice(t,t+i);let o=t/i,l=r/i;for(;o<l;){let t=o+l>>1;n<e[(t+1)*i-1]?l=t:o=t+1}let h=e[o*i-1];if(n==h)return e.slice((o-1)*i,(o-1)*i+i);let A=(n-h)/(e[(o+1)*i-1]-h);s=[];for(let t=0;t<i-1;++t)s.push(Fp(e[(o-1)*i+t],e[o*i+t],A));return s.push(n),s}function jg(e,t,r,i,n){return!Ed(n,(function(n){return!Vg(e,t,r,i,n[0],n[1])}))}function Vg(e,t,r,i,n,a){let s=0,o=e[r-i],l=e[r-i+1];for(;t<r;t+=i){let r=e[t],i=e[t+1];l<=a?i>a&&(r-o)*(a-l)-(n-o)*(i-l)>0&&s++:i<=a&&(r-o)*(a-l)-(n-o)*(i-l)<0&&s--,o=r,l=i}return 0!==s}function Gg(e,t,r,i,n,a){if(0===r.length||!Vg(e,t,r[0],i,n,a))return!1;for(let t=1,s=r.length;t<s;++t)if(Vg(e,r[t-1],r[t],i,n,a))return!1;return!0}function Kg(e,t,r,i,n){let a;for(t+=i;t<r;t+=i)if(a=n(e.slice(t-i,t),e.slice(t,t+i)),a)return a;return!1}function qg(e,t,r,i,n,a){return a=a??Cd([1/0,1/0,-1/0,-1/0],e,t,r,i),!!Dd(n,a)&&(a[0]>=n[0]&&a[2]<=n[2]||a[1]>=n[1]&&a[3]<=n[3]||Kg(e,t,r,i,(function(e,t){return function(e,t,r){let i=!1,n=yd(e,t),a=yd(e,r);if(n===od||a===od)i=!0;else{let s,o,l=e[0],h=e[1],A=e[2],u=e[3],c=t[0],d=t[1],p=r[0],f=r[1],g=(f-d)/(p-c);a&ld&&!(n&ld)&&(s=p-(f-u)/g,i=s>=l&&s<=A),!i&&a&hd&&!(n&hd)&&(o=f-(p-A)*g,i=o>=h&&o<=u),!i&&a&Ad&&!(n&Ad)&&(s=p-(f-h)/g,i=s>=l&&s<=A),!i&&a&ud&&!(n&ud)&&(o=f-(p-l)*g,i=o>=h&&o<=u)}return i}(n,e,t)})))}function Zg(e,t,r,i,n){if(!function(e,t,r,i,n){return!!(qg(e,t,r,i,n)||Vg(e,t,r,i,n[0],n[1])||Vg(e,t,r,i,n[0],n[3])||Vg(e,t,r,i,n[2],n[1])||Vg(e,t,r,i,n[2],n[3]))}(e,t,r[0],i,n))return!1;if(1===r.length)return!0;for(let t=1,a=r.length;t<a;++t)if(jg(e,r[t-1],r[t],i,n)&&!qg(e,r[t-1],r[t],i,n))return!1;return!0}function Wg(e,t,r,i){let n=e[t],a=e[t+1],s=0;for(let o=t+i;o<r;o+=i){let t=e[o],r=e[o+1];s+=Math.sqrt((t-n)*(t-n)+(r-a)*(r-a)),n=t,a=r}return s}var $g=class e extends gg{constructor(e,t){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===t||Array.isArray(e[0])?this.setCoordinates(e,t):this.setFlatCoordinates(t,e)}appendCoordinate(e){ip(this.flatCoordinates,e),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,r,i){return i<pd(this.getExtent(),e,t)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Ig(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Fg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,e,t,r,i))}forEachSegment(e){return Kg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinateAtM(e,t){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(t=void 0!==t&&t,Hg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t))}getCoordinates(){return Lg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(e,t){return zg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,t,this.stride)}getLength(){return Wg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){let r=[];return r.length=Ug(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,r,0),new e(r,"XY")}getType(){return"LineString"}intersectsExtent(e){return qg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e,this.getExtent())}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=yg(this.flatCoordinates,0,e,this.stride),this.changed()}},Xg=class e extends gg{constructor(e,t,r){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(e[0]))this.setCoordinates(e,t);else if(void 0!==t&&r)this.setFlatCoordinates(t,e),this.ends_=r;else{let t=e,r=[],i=[];for(let e=0,n=t.length;e<n;++e){ip(r,t[e].getFlatCoordinates()),i.push(r.length)}let n=0===t.length?this.getLayout():t[0].getLayout();this.setFlatCoordinates(n,r),this.ends_=i}}appendLineString(e){ip(this.flatCoordinates,e.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,r,i){return i<pd(this.getExtent(),e,t)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tg(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pg(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,e,t,r,i))}getCoordinateAtM(e,t,r){return"XYM"!=this.layout&&"XYZM"!=this.layout||0===this.flatCoordinates.length?null:(t=void 0!==t&&t,r=void 0!==r&&r,function(e,t,r,i,n,a,s){if(s)return Hg(e,t,r[r.length-1],i,n,a);let o;if(n<e[i-1])return a?(o=e.slice(0,i),o[i-1]=n,o):null;if(e[e.length-1]<n)return a?(o=e.slice(e.length-i),o[i-1]=n,o):null;for(let a=0,s=r.length;a<s;++a){let s=r[a];if(t!=s){if(n<e[t+i-1])return null;if(n<=e[s-1])return Hg(e,t,s,i,n,!1);t=s}}return null}(this.flatCoordinates,0,this.ends_,this.stride,e,t,r))}getCoordinates(){return Mg(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(e){return e<0||this.ends_.length<=e?null:new $g(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLineStrings(){let e=this.flatCoordinates,t=this.ends_,r=this.layout,i=[],n=0;for(let a=0,s=t.length;a<s;++a){let s=t[a],o=new $g(e.slice(n,s),r);i.push(o),n=s}return i}getLength(){let e=this.ends_,t=0,r=0;for(let i=0,n=e.length;i<n;++i)r+=Wg(this.flatCoordinates,t,e[i],this.stride),t=e[i];return r}getFlatMidpoints(){let e=[],t=this.flatCoordinates,r=0,i=this.ends_,n=this.stride;for(let a=0,s=i.length;a<s;++a){let s=i[a];ip(e,zg(t,r,s,n,.5)),r=s}return e}getSimplifiedGeometryInternal(t){let r=[],i=[];return r.length=Rg(this.flatCoordinates,0,this.ends_,this.stride,t,r,0,i),new e(r,"XY",i)}getType(){return"MultiLineString"}intersectsExtent(e){return function(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){if(qg(e,t,r[a],i,n))return!0;t=r[a]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);let r=_g(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()}},Yg=class e extends gg{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,r,i){let n=this.flatCoordinates,a=Sp(e,t,n[0],n[1]);if(a<i){let e=this.stride;for(let t=0;t<e;++t)r[t]=n[t];return r.length=e,a}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return wd(this.flatCoordinates,e)}getType(){return"Point"}intersectsExtent(e){return md(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=mg(this.flatCoordinates,0,e,this.stride),this.changed()}},Jg=class e extends gg{constructor(e,t){super(),t&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}appendPoint(e){ip(this.flatCoordinates,e.getFlatCoordinates()),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,r,i){if(i<pd(this.getExtent(),e,t))return i;let n=this.flatCoordinates,a=this.stride;for(let s=0,o=n.length;s<o;s+=a){let o=Sp(e,t,n[s],n[s+1]);if(o<i){i=o;for(let e=0;e<a;++e)r[e]=n[s+e];r.length=a}}return i}getCoordinates(){return Lg(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(e){let t=this.flatCoordinates.length/this.stride;return e<0||t<=e?null:new Yg(this.flatCoordinates.slice(e*this.stride,(e+1)*this.stride),this.layout)}getPoints(){let e=this.flatCoordinates,t=this.layout,r=this.stride,i=[];for(let n=0,a=e.length;n<a;n+=r){let a=new Yg(e.slice(n,n+r),t);i.push(a)}return i}getType(){return"MultiPoint"}intersectsExtent(e){let t=this.flatCoordinates,r=this.stride;for(let i=0,n=t.length;i<n;i+=r){if(md(e,t[i],t[i+1]))return!0}return!1}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=yg(this.flatCoordinates,0,e,this.stride),this.changed()}};function em(e,t,r,i,n,a,s){let o,l,h,A,u,c,d,p=n[a+1],f=[];for(let n=0,a=r.length;n<a;++n){let a=r[n];for(A=e[a-i],c=e[a-i+1],o=t;o<a;o+=i)u=e[o],d=e[o+1],(p<=c&&d<=p||c<=p&&p<=d)&&(h=(p-c)/(d-c)*(u-A)+A,f.push(h)),A=u,c=d}let g=NaN,m=-1/0;for(f.sort(Jd),A=f[0],o=1,l=f.length;o<l;++o){u=f[o];let n=Math.abs(u-A);n>m&&(h=(A+u)/2,Gg(e,t,r,i,h,p)&&(g=h,m=n)),A=u}return isNaN(g)&&(g=n[a]),s?(s.push(g,p,m),s):[g,p,m]}function tm(e,t,r,i,n){let a=[];for(let s=0,o=r.length;s<o;++s){let o=r[s];a=em(e,t,o,i,n,2*s,a),t=o[o.length-1]}return a}function rm(e,t,r,i){for(;t<r-i;){for(let n=0;n<i;++n){let a=e[t+n];e[t+n]=e[r-i+n],e[r-i+n]=a}t+=i,r-=i}}function im(e,t,r,i){let n=0,a=e[r-i],s=e[r-i+1];for(;t<r;t+=i){let r=e[t],i=e[t+1];n+=(r-a)*(i+s),a=r,s=i}return 0===n?void 0:n>0}function nm(e,t,r,i,n){n=void 0!==n&&n;for(let a=0,s=r.length;a<s;++a){let s=r[a],o=im(e,t,s,i);if(0===a){if(n&&o||!n&&!o)return!1}else if(n&&!o||!n&&o)return!1;t=s}return!0}function am(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){let s=r[a];if(!nm(e,t,s,i,n))return!1;s.length&&(t=s[s.length-1])}return!0}function sm(e,t,r,i,n){n=void 0!==n&&n;for(let a=0,s=r.length;a<s;++a){let s=r[a],o=im(e,t,s,i);(0===a?n&&o||!n&&!o:n&&!o||!n&&o)&&rm(e,t,s,i),t=s}return t}function om(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a)t=sm(e,t,r[a],i,n);return t}var lm=class e extends gg{constructor(e,t,r){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==t&&r?(this.setFlatCoordinates(t,e),this.ends_=r):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?ip(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,r,i){return i<pd(this.getExtent(),e,t)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Tg(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Pg(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,r,i))}containsXY(e,t){return Gg(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Sg(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return void 0!==e?(t=this.getOrientedFlatCoordinates().slice(),sm(t,0,this.ends_,this.stride,e)):t=this.flatCoordinates,Mg(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=Fd(this.getExtent());this.flatInteriorPoint_=em(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new Yg(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new Qg(this.flatCoordinates.slice(0===e?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,r=this.ends_,i=[],n=0;for(let a=0,s=r.length;a<s;++a){let s=r[a],o=new Qg(t.slice(n,s),e);i.push(o),n=s}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;nm(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=sm(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let r=[],i=[];return r.length=Og(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),r,0,i),new e(r,"XY",i)}getType(){return"Polygon"}intersectsExtent(e){return Zg(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);let r=_g(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=0===r.length?0:r[r.length-1],this.changed()}},hm=lm;function Am(e){if(Nd(e))throw new Error("Cannot create polygon from empty extent");let t=e[0],r=e[1],i=e[2],n=e[3],a=[t,r,t,n,i,n,i,r,t,r];return new lm(a,"XY",[a.length])}function um(e,t,r){t=t||32;let i=e.getStride(),n=e.getLayout(),a=e.getCenter(),s=i*(t+1),o=new Array(s);for(let e=0;e<s;e+=i){o[e]=0,o[e+1]=0;for(let t=2;t<i;t++)o[e+t]=a[t]}let l=[o.length],h=new lm(o,n,l);return function(e,t,r,i){let n=e.getFlatCoordinates(),a=e.getStride(),s=n.length/a-1,o=i||0;for(let e=0;e<=s;++e){let i=e*a,l=o+2*Tp(e,s)*Math.PI/s;n[i]=t[0]+r*Math.cos(l),n[i+1]=t[1]+r*Math.sin(l)}e.changed()}(h,a,e.getRadius(),r),h}function cm(e,t,r,i){let n=[],a=[1/0,1/0,-1/0,-1/0];for(let s=0,o=r.length;s<o;++s){let o=r[s];a=bd(e,t,o[0],i),n.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=o[o.length-1]}return n}var dm=class e extends gg{constructor(e,t,r){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!r&&!Array.isArray(e[0])){let i=e,n=[],a=[];for(let e=0,t=i.length;e<t;++e){let t=i[e],r=n.length,s=t.getEnds();for(let e=0,t=s.length;e<t;++e)s[e]+=r;ip(n,t.getFlatCoordinates()),a.push(s)}t=0===i.length?this.getLayout():i[0].getLayout(),e=n,r=a}void 0!==t&&r?(this.setFlatCoordinates(t,e),this.endss_=r):this.setCoordinates(e,t)}appendPolygon(e){let t;if(this.flatCoordinates){let r=this.flatCoordinates.length;ip(this.flatCoordinates,e.getFlatCoordinates()),t=e.getEnds().slice();for(let e=0,i=t.length;e<i;++e)t[e]+=r}else this.flatCoordinates=e.getFlatCoordinates().slice(),t=e.getEnds().slice(),this.endss_.push();this.endss_.push(t),this.changed()}clone(){let t=this.endss_.length,r=new Array(t);for(let e=0;e<t;++e)r[e]=this.endss_[e].slice();let i=new e(this.flatCoordinates.slice(),this.layout,r);return i.applyProperties(this),i}closestPointXY(e,t,r,i){return i<pd(this.getExtent(),e,t)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){let s=r[a];n=Tg(e,t,s,i,n),t=s[s.length-1]}return n}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(e,t,r,i,n,a,s,o,l,h,A){A=A||[NaN,NaN];for(let u=0,c=r.length;u<c;++u){let c=r[u];h=Pg(e,t,c,i,n,a,s,o,l,h,A),t=c[c.length-1]}return h}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,!0,e,t,r,i))}containsXY(e,t){return function(e,t,r,i,n,a){if(0===r.length)return!1;for(let s=0,o=r.length;s<o;++s){let o=r[s];if(Gg(e,t,o,i,n,a))return!0;t=o[o.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e,t)}getArea(){return function(e,t,r,i){let n=0;for(let a=0,s=r.length;a<s;++a){let s=r[a];n+=Sg(e,t,s,i),t=s[s.length-1]}return n}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(e){let t;return void 0!==e?(t=this.getOrientedFlatCoordinates().slice(),om(t,0,this.endss_,this.stride,e)):t=this.flatCoordinates,kg(t,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){let e=cm(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=tm(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new Jg(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;am(e,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=om(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let r=[],i=[];return r.length=function(e,t,r,i,n,a,s,o){for(let l=0,h=r.length;l<h;++l){let h=r[l],A=[];s=Og(e,t,h,i,n,a,s,A),o.push(A),t=h[h.length-1]}return s}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),r,0,i),new e(r,"XY",i)}getPolygon(e){if(e<0||this.endss_.length<=e)return null;let t;if(0===e)t=0;else{let r=this.endss_[e-1];t=r[r.length-1]}let r=this.endss_[e].slice(),i=r[r.length-1];if(0!==t)for(let e=0,i=r.length;e<i;++e)r[e]-=t;return new hm(this.flatCoordinates.slice(t,i),this.layout,r)}getPolygons(){let e=this.layout,t=this.flatCoordinates,r=this.endss_,i=[],n=0;for(let a=0,s=r.length;a<s;++a){let s=r[a].slice(),o=s[s.length-1];if(0!==n)for(let e=0,t=s.length;e<t;++e)s[e]-=n;let l=new hm(t.slice(n,o),e,s);i.push(l),n=o}return i}getType(){return"MultiPolygon"}intersectsExtent(e){return function(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){let s=r[a];if(Zg(e,t,s,i,n))return!0;t=s[s.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,3),this.flatCoordinates||(this.flatCoordinates=[]);let r=vg(this.flatCoordinates,0,e,this.stride,this.endss_);if(0===r.length)this.flatCoordinates.length=0;else{let e=r[r.length-1];this.flatCoordinates.length=0===e.length?0:e[e.length-1]}this.changed()}},pm=(e,t,r)=>{var i;let n,a,{coordinate:s,olGeometry:o,time_intervals:l}=t.properties,{coordinates:h,type:A}=t.geometry,u=o;if(u&&(A=u.getType(),h=null!==(i=u.getCoordinates())&&void 0!==i?i:[]),r&&s)n=s;else if("Point"===A)n=h;else if("LineString"===A){u||(u=new $g(h));let t=l||[[]],r=t[0],i=t[t.length-1];if(e<r[0])[,,a]=r,n=u.getFirstCoordinate();else if(e>i[0])[,,a]=i,n=u.getLastCoordinate();else for(let r=0;r<t.length-1;r+=1){let[i,s]=t[r],[o,l]=t[r+1];if(i<=e&&e<=o){let h=Math.min((e-i)/(o-i),1)*(l-s)+s;n=u?.getCoordinateAt(h),[,,a]=t[r];break}}}else console.error("This geometry type is not supported. Only Point or LineString are. Current geometry: ",u);return{coord:n,rotation:a}};var fm=class e extends vp{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e)if("function"==typeof e.getSimplifiedGeometry){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}clone(){let t=new e(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());let r=this.getGeometry();r&&t.setGeometry(r.clone());let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(fp(this.geometryChangeKey_),this.geometryChangeKey_=null);let e=this.getGeometry();e&&(this.geometryChangeKey_=dp(e,Vd,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?function(e){if("function"==typeof e)return e;let t;return Array.isArray(e)?t=e:(rg("function"==typeof e.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}},gm=[1,0,0,1,0,0],mm=class e{constructor(e,t,r,i,n,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=r||null,this.properties_=n,this.squaredTolerance_,this.stride_=i,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?wd(this.flatCoordinates_):bd(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=Fd(this.getExtent());this.flatInteriorPoints_=em(this.flatCoordinates_,0,this.ends_,2,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=function(e,t){let r,i=[],n=0,a=0;for(let s=0,o=t.length;s<o;++s){let o=t[s],l=im(e,n,o,2);if(void 0===r&&(r=l),l===r)i.push(t.slice(a,s+1));else{if(0===i.length)continue;i[i.length-1].push(t[a])}a=s+1,n=o}return i}(this.flatCoordinates_,this.ends_),t=cm(this.flatCoordinates_,0,e,2);this.flatInteriorPoints_=tm(this.flatCoordinates_,0,e,2,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=zg(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,r=this.ends_;for(let i=0,n=r.length;i<n;++i){let n=r[i],a=zg(e,t,n,2,.5);ip(this.flatMidpoints_,a),t=n}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){let t=(e=Df(e)).getExtent(),r=e.getWorldExtent();if(t&&r){let e=Ld(r)/Ld(t);ng(gm,r[0],r[3],e,-e,0,0,0),hg(this.flatCoordinates_,0,this.flatCoordinates_.length,2,gm,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new e(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=lp(((t,r)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),r&&this.simplifiedGeometry_.applyTransform(r);let i,n=this.simplifiedGeometry_.getFlatCoordinates();switch(this.type_){case"LineString":n.length=Ug(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=Rg(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=Og(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i)}return i&&(this.simplifiedGeometry_=new e(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_})),this}};mm.prototype.getFlatCoordinates=mm.prototype.getOrientedFlatCoordinates;var ym=mm,_m=class{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=fm,this.supportedMediaTypes=null}getReadOptions(e,t){if(t){let r=t.dataProjection?Df(t.dataProjection):this.readProjection(e);t.extent&&r&&"tile-pixels"===r.getUnits()&&(r=Df(r),r.setWorldExtent(t.extent)),t={dataProjection:r,featureProjection:t.featureProjection}}return this.adaptOptions(t)}adaptOptions(e){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},e)}getType(){return Qd()}readFeature(e,t){return Qd()}readFeatures(e,t){return Qd()}readGeometry(e,t){return Qd()}readProjection(e){return Qd()}writeFeature(e,t){return Qd()}writeFeatures(e,t){return Qd()}writeGeometry(e,t){return Qd()}};function vm(e,t,r){let i=r?Df(r.featureProjection):null,n=r?Df(r.dataProjection):null,a=e;if(i&&n&&!function(e,t){if(e===t)return!0;let r=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||jf(e,t)===kf)&&r}(i,n)){t&&(a=e.clone());let r=t?i:n,s=t?n:i;"tile-pixels"===r.getUnits()?a.transform(r,s):a.applyTransform(Gf(r,s))}if(t&&r&&void 0!==r.decimals){let t=Math.pow(10,r.decimals),i=function(e){for(let r=0,i=e.length;r<i;++r)e[r]=Math.round(e[r]*t)/t;return e};a===e&&(a=e.clone()),a.applyTransform(i)}return a}var wm={Point:Yg,LineString:$g,Polygon:hm,MultiPoint:Jg,MultiLineString:Xg,MultiPolygon:dm};function bm(e,t){let r=e.geometry;if(!r)return[];if(Array.isArray(r))return r.map((t=>bm({...e,geometry:t}))).flat();let i="MultiPolygon"===r.type?"Polygon":r.type;if("GeometryCollection"===i||"Circle"===i)throw new Error("Unsupported geometry type: "+i);let n=r.layout.length;return vm(new ym(i,"Polygon"===i?function(e,t,r){return Array.isArray(t[0])?(am(e,0,t,r)||om(e=e.slice(),0,t,r),e):(nm(e,0,t,r)||sm(e=e.slice(),0,t,r),e)}(r.flatCoordinates,r.ends,n):r.flatCoordinates,r.ends?.flat(),n,e.properties||{},e.id).enableSimplifyTransformed(),!1,t)}function xm(e,t){if(!e)return null;if(Array.isArray(e)){let r=e.map((e=>xm(e,t)));return new Bg(r)}return vm(new(0,wm[e.type])(e.flatCoordinates,e.layout||"XY",e.ends),!1,t)}function Bm(e){if("string"==typeof e){return JSON.parse(e)||null}return null!==e?e:null}var Cm=class extends _m{constructor(){super()}getType(){return"json"}readFeature(e,t){return this.readFeatureFromObject(Bm(e),this.getReadOptions(e,t))}readFeatures(e,t){return this.readFeaturesFromObject(Bm(e),this.getReadOptions(e,t))}readFeatureFromObject(e,t){return Qd()}readFeaturesFromObject(e,t){return Qd()}readGeometry(e,t){return this.readGeometryFromObject(Bm(e),this.getReadOptions(e,t))}readGeometryFromObject(e,t){return Qd()}readProjection(e){return this.readProjectionFromObject(Bm(e))}readProjectionFromObject(e){return Qd()}writeFeature(e,t){return JSON.stringify(this.writeFeatureObject(e,t))}writeFeatureObject(e,t){return Qd()}writeFeatures(e,t){return JSON.stringify(this.writeFeaturesObject(e,t))}writeFeaturesObject(e,t){return Qd()}writeGeometry(e,t){return JSON.stringify(this.writeGeometryObject(e,t))}writeGeometryObject(e,t){return Qd()}};function Sm(e,t){if(!e)return null;let r;switch(e.type){case"Point":r=function(e){let t=e.coordinates;return{type:"Point",flatCoordinates:t,layout:pg(t.length)}}(e);break;case"LineString":r=function(e){let t=e.coordinates,r=t.flat();return{type:"LineString",flatCoordinates:r,ends:[r.length],layout:pg(t[0]?.length||2)}}(e);break;case"Polygon":r=function(e){let t=e.coordinates,r=[],i=t[0]?.[0]?.length,n=_g(r,0,t,i);return{type:"Polygon",flatCoordinates:r,ends:n,layout:pg(i)}}(e);break;case"MultiPoint":r=function(e){let t=e.coordinates;return{type:"MultiPoint",flatCoordinates:t.flat(),layout:pg(t[0]?.length||2)}}(e);break;case"MultiLineString":r=function(e){let t=e.coordinates,r=t[0]?.[0]?.length||2,i=[],n=_g(i,0,t,r);return{type:"MultiLineString",flatCoordinates:i,ends:n,layout:pg(r)}}(e);break;case"MultiPolygon":r=function(e){let t=e.coordinates,r=[],i=t[0]?.[0]?.[0].length||2,n=vg(r,0,t,i);return{type:"MultiPolygon",flatCoordinates:r,ends:n,layout:pg(i)}}(e);break;case"GeometryCollection":r=function(e,t){return e.geometries.map((function(e){return Sm(e,t)}))}(e);break;default:throw new Error("Unsupported GeoJSON type: "+e.type)}return r}function Em(e,t){let r,i=(e=vm(e,!0,t)).getType();switch(i){case"Point":r=function(e){return{type:"Point",coordinates:e.getCoordinates()}}(e);break;case"LineString":r=function(e){return{type:"LineString",coordinates:e.getCoordinates()}}(e);break;case"Polygon":r=function(e,t){let r;return t&&(r=t.rightHanded),{type:"Polygon",coordinates:e.getCoordinates(r)}}(e,t);break;case"MultiPoint":r=function(e){return{type:"MultiPoint",coordinates:e.getCoordinates()}}(e);break;case"MultiLineString":r=function(e){return{type:"MultiLineString",coordinates:e.getCoordinates()}}(e);break;case"MultiPolygon":r=function(e,t){let r;return t&&(r=t.rightHanded),{type:"MultiPolygon",coordinates:e.getCoordinates(r)}}(e,t);break;case"GeometryCollection":r=function(e,t){return t=Object.assign({},t),delete t.featureProjection,{type:"GeometryCollection",geometries:e.getGeometriesArray().map((function(e){return Em(e,t)}))}}(e,t);break;case"Circle":r={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+i)}return r}var Im=class extends Cm{constructor(e){e=e||{},super(),this.dataProjection=Df(e.dataProjection?e.dataProjection:"EPSG:4326"),e.featureProjection&&(this.defaultFeatureProjection=Df(e.featureProjection)),e.featureClass&&(this.featureClass=e.featureClass),this.geometryName_=e.geometryName,this.extractGeometryName_=e.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(e,t){let r=null;r="Feature"===e.type?e:{type:"Feature",geometry:e,properties:null};let i=Sm(r.geometry,t);if(this.featureClass===ym)return bm({geometry:i,id:r.id,properties:r.properties},t);let n=new fm;return this.geometryName_?n.setGeometryName(this.geometryName_):this.extractGeometryName_&&r.geometry_name&&n.setGeometryName(r.geometry_name),n.setGeometry(xm(i,t)),"id"in r&&n.setId(r.id),r.properties&&n.setProperties(r.properties,!0),n}readFeaturesFromObject(e,t){let r=null;if("FeatureCollection"===e.type){r=[];let i=e.features;for(let e=0,n=i.length;e<n;++e){let n=this.readFeatureFromObject(i[e],t);n&&r.push(n)}}else r=[this.readFeatureFromObject(e,t)];return r.flat()}readGeometryFromObject(e,t){return function(e,t){let r=Sm(e,t);return xm(r,t)}(e,t)}readProjectionFromObject(e){let t,r=e.crs;if(r)if("name"==r.type)t=Df(r.properties.name);else{if("EPSG"!==r.type)throw new Error("Unknown SRS type");t=Df("EPSG:"+r.properties.code)}else t=this.dataProjection;return t}writeFeatureObject(e,t){t=this.adaptOptions(t);let r={type:"Feature",geometry:null,properties:null},i=e.getId();if(void 0!==i&&(r.id=i),!e.hasProperties())return r;let n=e.getProperties(),a=e.getGeometry();return a&&(r.geometry=Em(a,t),delete n[e.getGeometryName()]),Ap(n)||(r.properties=n),r}writeFeaturesObject(e,t){t=this.adaptOptions(t);let r=[];for(let i=0,n=e.length;i<n;++i)r.push(this.writeFeatureObject(e[i],t));return{type:"FeatureCollection",features:r}}writeGeometryObject(e,t){return Em(e,this.adaptOptions(t))}},Tm=[];for(let e=0;e<256;++e)Tm.push((e+256).toString(16).slice(1));var Fm,Pm=new Uint8Array(16);var Lm={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Mm(e,t,r){let i=(e=e||{}).random??e.rng?.()??function(){if(!Fm){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");Fm=crypto.getRandomValues.bind(crypto)}return Fm(Pm)}();if(i.length<16)throw new Error("Random bytes length must be >= 16");if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=i[e];return t}return function(e,t=0){return(Tm[e[t+0]]+Tm[e[t+1]]+Tm[e[t+2]]+Tm[e[t+3]]+"-"+Tm[e[t+4]]+Tm[e[t+5]]+"-"+Tm[e[t+6]]+Tm[e[t+7]]+"-"+Tm[e[t+8]]+Tm[e[t+9]]+"-"+Tm[e[t+10]]+Tm[e[t+11]]+Tm[e[t+12]]+Tm[e[t+13]]+Tm[e[t+14]]+Tm[e[t+15]]).toLowerCase()}(i)}var km=function(e,t,r){return!Lm.randomUUID||t||e?Mm(e,t,r):Lm.randomUUID()},Um=e=>parseInt(e?.substr(0,8).replace(/:/g,""),10),Rm=new Im,Dm=(e,t=new Date)=>{var r;return!(null===(r=e.affectedTimeIntervals)||void 0===r||!r.some((e=>{let{dailyEndTime:r="",dailyStartTime:i="",endTime:n,startTime:a}=e,s=Um(t.toTimeString()),o=Um(i),l=Um(r),h=new Date(a)<=t&&t<=new Date(n);return o&&l?h&&o<=s&&s<=l:h})))},Nm=e=>Rm.writeGeometryObject(Rm.readGeometry(e,{dataProjection:"EPSG:3857",featureProjection:"EPSG:4326"})),Om=(e,t=new Date)=>{var r,i,n;let a=[],s=((e="undefiniert")=>e.toLowerCase().replace(/\s/g,"_").replace(/ü/g,"ue").replace(/ä/g,"ae").replace(/ö/g,"oe").replace(/ß/g,"ss"))(null===(i=null===(r=e.reasons)||void 0===r?void 0:r[0])||void 0===i?void 0:i.categoryName),o={reasonCategoryImageName:s,reasons:e.reasons,reasons_category:s};return null===(n=e?.publications)||void 0===n||n.forEach((r=>{var i,n,s;let l=Dm(e,t),h=((e,t=new Date)=>{var r,i,n;let a=null!==(n=null!==(r=e.publicationWindows)&&void 0!==r?r:null===(i=e.publications)||void 0===i?void 0:i.flatMap((e=>{var t;return null!==(t=e.publicationWindows)&&void 0!==t?t:[]})))&&void 0!==n?n:[];return a.length?!!a.some((({endTime:e,startTime:r})=>new Date(r)<=t&&t<=new Date(e))):!!Dm(e,t)})(e,t),A={condition_group:r.serviceConditionGroup.toLowerCase(),isActive:l,isAffected:l,isPublished:h,serviceConditionGroup:r.serviceConditionGroup,severity_group:null===(i=r.severityGroup)||void 0===i?void 0:i.toLocaleLowerCase(),severityGroup:r.severityGroup};null===(n=r.publicationLines)||void 0===n||n.forEach((t=>{t.lines.forEach((i=>{i.geometry.forEach((({geom:n,graph:s})=>{let l={geometry:Nm(n),id:km(),properties:Object.assign(Object.assign(Object.assign(Object.assign({graph:s,hasIcon:t.hasIcon,line:i,publication:r,publicationLine:t,situation:e},r),o),A),{geometry:void 0}),type:"Feature"};if(a.push(l),t.hasIcon){let t=(e=>{let t=Rm.readGeometry(e.geometry),r=Fd(t.getExtent());return{geometry:{coordinates:t.getClosestPoint(r),type:"Point"},id:km(),properties:Object.assign(Object.assign({},e.properties),{geometry:void 0}),type:"Feature"}})(l);t.properties.situation=e,a.push(t)}}))}))})),null===(s=r.publicationStops)||void 0===s||s.forEach((t=>{t.geometry.forEach((({geom:i,graph:n})=>{let s={geometry:Nm(i),id:km(),properties:Object.assign(Object.assign(Object.assign({graph:n,name:t.name,publication:r,publicationStop:t,situation:e},o),A),{geometry:void 0}),type:"Feature"};a.push(s)}))}))})),{features:a,type:"FeatureCollection"}},Qm={};l(Qm,{MOTS_ALL:()=>Gm,MOTS_ONLY_RAIL:()=>Hm,MOTS_WITHOUT_CABLE:()=>Vm,MOTS_WITH_CABLE:()=>jm,bgColors:()=>qm,getBgColor:()=>Xm,getDelayColor:()=>ey,getDelayText:()=>ty,getRadius:()=>$m,getTextColor:()=>Ym,getTextSize:()=>Jm,getTypeIndex:()=>Wm,textColors:()=>Zm,types:()=>Km});var zm=[[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,7,7,7,7,7,7,7,7,7,7,7,7],[0,0,0,0,0,2,2,3,7,7,7,12,15,15,15,15,15]],Hm=["rail"],jm=["cablecar","gondola","funicular","coach"],Vm=["tram","subway","rail","bus"],Gm=["tram","subway","rail","bus","ferry","cablecar","gondola","funicular","coach"],Km=[/^Tram/i,/^Subway( \/ Metro \/ S-Bahn)?/i,/^Train/i,/^Bus/i,/^Ferry/i,/^Cable ?Car/i,/^Gondola/i,/^Funicular/i,/^(Long distance bus|coach)/i,/^Rail/i],qm=["#ffb400","#ff5400","#ff8080","#ea0000","#3000ff","#ffb400","#41a27b","#00d237","#b5b5b5","#ff8080"],Zm=["#000000","#ffffff","#000000","#ffffff","#ffffff","#000000","#ffffff","#000000","#000000","#000000"],Wm=e=>"string"==typeof e?Km.findIndex((t=>t.test(e))):e,$m=(e,t)=>{try{let r=Wm(e||0);return zm[r][t]}catch{return 1}},Xm=(e,t)=>{try{let t=Wm(e);return qm[t]}catch{return"#ffffff"}},Ym=e=>{try{let t=Wm(e);return Zm[t]}catch{return"#ffffff"}},Jm=(e,t,r,i,n)=>{if(!e)return 0;e.font=n(i,r);let a=e.measureText(r),s=0;for(;a.width>t-6&&s<25;)i-=.5,e.font=n(i,r),a=e.measureText(r),s+=1;return i},ey=(e,t,r)=>t?r?"#ff0000":"#a0a0a0":null===e?"#a0a0a0":e>=36e5?"#ed004c":e>=5e5?"#e80000":e>=3e5?"#ff4a00":e>=18e4?"#f7bf00":"#00a00c",ty=(e,t)=>t?String.fromCodePoint(215):e>=36e5?`+${Math.round(e/36e5)}h`:e>=6e4?`+${Math.round(e/6e4)}m`:e>=1e3?`+${Math.round(e/1e3)}s`:e>0?`+${e}ms`:"",ry=(e,t,r,i,n)=>{if(!e)return{renderedTrajectories:[]};let{center:a,pixelRatio:s=1,resolution:o,rotation:l=0,size:h=[],time:A=Date.now()}=i;if(!o||!a)return{renderedTrajectories:[]};let{filter:u,getScreenPixel:c=(e,t)=>(t.zoom||0)<12?e.map((e=>Math.floor(e))):e,hoverVehicleId:d,noInterpolate:p=!1,selectedVehicleId:f}=n,g=e.getContext("2d");g?.clearRect(0,0,e.width,e.height);let[m,y]=h;m&&y&&(e.width!==m*s||e.height!==y*s)&&([e.width,e.height]=[m*s,y*s]);let _=ng([1,0,0,1,0,0],h[0]/2,h[1]/2,1/o,-1/o,-l,-a[0],-a[1]);e.style&&(e.style.width=e.width/s+"px",e.style.height=e.height/s+"px");let v,w,b,x,B=[];for(let a=t.length-1;a>=0;a-=1){let o=t[a];if(u&&!u(o))continue;let{timeOffset:l,train_id:h}=o.properties,{coord:m,rotation:y}=pm(A-(l||0),o,p);if(t[a].properties.coordinate=m,t[a].properties.rotation=y,!m)continue;let C=ig(_,[...m]);if(!C||(C=C.map((e=>e*s)),C[0]<0||C[0]>e.width||C[1]<0||C[1]>e.height))continue;let S=r(o,i,n);if(S){if(d!==h&&f!==h){let[e,t]=c([C[0]-S.width/2,C[1]-S.height/2],i);g?.drawImage(S,e,t)}d&&d===h&&(v=S,w=C),f&&f===h&&(b=S,x=C),B.push(o)}}return b&&x&&g?.drawImage(b,Math.floor(x[0]-b.width/2),Math.floor(x[1]-b.height/2)),v&&w&&g?.drawImage(v,Math.floor(w[0]-v.width/2),Math.floor(w[1]-v.height/2)),{renderedTrajectories:B}},iy="postrender",ny="movestart",ay="moveend",sy="loadstart",oy="loadend",ly=class extends vp{constructor(e){super();let t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents="auto"),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){this.map_&&this.element?.remove();for(let e=0,t=this.listenerKeys.length;e<t;++e)fp(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=e,e){let t=this.target_??e.getOverlayContainerStopEvent();this.element&&t.appendChild(this.element),this.render!==op&&this.listenerKeys.push(dp(e,iy,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_="string"==typeof e?document.getElementById(e):e}},hy=0,Ay=1,uy={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function cy(e,t,r){return function(i,n,a,s,o){if(!i)return;if(!n&&!t)return i;let l=t?0:a[0]*n,h=t?0:a[1]*n,A=o?o[0]:0,u=o?o[1]:0,c=e[0]+l/2+A,d=e[2]-l/2+A,p=e[1]+h/2+u,f=e[3]-h/2+u;c>d&&(c=(d+c)/2,d=c),p>f&&(p=(f+p)/2,f=p);let g=Bp(i[0],c,d),m=Bp(i[1],p,f);if(s&&r&&n){let e=30*n;g+=-e*Math.log(1+Math.max(0,c-i[0])/e)+e*Math.log(1+Math.max(0,i[0]-d)/e),m+=-e*Math.log(1+Math.max(0,p-i[1])/e)+e*Math.log(1+Math.max(0,i[1]-f)/e)}return[g,m]}}function dy(e){return e}function py(e){return 1-function(e){return Math.pow(e,3)}(1-e)}function fy(e){return 3*e*e-2*e*e*e}function gy(e){return e}function my(e,t,r,i){let n=Rd(t)/r[0],a=Ld(t)/r[1];return i?Math.min(e,Math.max(n,a)):Math.min(e,Math.min(n,a))}function yy(e,t,r){let i=Math.min(e,t);return i*=Math.log(1+50*Math.max(0,e/t-1))/50+1,r&&(i=Math.max(i,r),i/=Math.log(1+50*Math.max(0,r/e-1))/50+1),Bp(i,r/2,2*t)}function _y(e,t,r,i,n){return r=void 0===r||r,function(a,s,o,l){if(void 0!==a){let s=i?my(e,i,o,n):e;return r&&l?yy(a,s,t):Bp(a,t,s)}}}function vy(e){if(void 0!==e)return 0}function wy(e){if(void 0!==e)return e}function by(e,t){setTimeout((function(){e(t)}),0)}function xy(e,t,r,i,n){let a=Math.cos(-n),s=Math.sin(-n),o=e[0]*a-e[1]*s,l=e[1]*a+e[0]*s;return o+=(t[0]/2-r[0])*i,l+=(r[1]-t[1]/2)*i,s=-s,[o*a-l*s,l*a+o*s]}var By=class extends vp{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=Qf(e.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&Mf(),e.center&&(e.center=Jf(e.center,this.projection_)),e.extent&&(e.extent=tg(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){let t=Object.assign({},e);for(let e in uy)delete t[e];this.setProperties(t,!0);let r=function(e){let t,r,i,n=void 0!==e.minZoom?e.minZoom:0,a=void 0!==e.maxZoom?e.maxZoom:28,s=void 0!==e.zoomFactor?e.zoomFactor:2,o=void 0!==e.multiWorld&&e.multiWorld,l=void 0===e.smoothResolutionConstraint||e.smoothResolutionConstraint,h=void 0!==e.showFullExtent&&e.showFullExtent,A=Qf(e.projection,"EPSG:3857"),u=A.getExtent(),c=e.constrainOnlyCenter,d=e.extent;if(!o&&!d&&A.isGlobal()&&(c=!1,d=u),void 0!==e.resolutions){let s=e.resolutions;r=s[n],i=void 0!==s[a]?s[a]:s[s.length-1],t=e.constrainResolution?function(e,t,r,i){return t=void 0===t||t,function(n,a,s,o){if(void 0!==n){let l=e[0],h=e[e.length-1],A=r?my(l,r,s,i):l;if(o)return t?yy(n,A,h):Bp(n,h,A);let u=Math.min(A,n),c=Math.floor(tp(e,u,a));return e[c]>A&&c<e.length-1?e[c+1]:e[c]}}}(s,l,!c&&d,h):_y(r,i,l,!c&&d,h)}else{let o=(u?Math.max(Rd(u),Ld(u)):360*Rp.degrees/A.getMetersPerUnit())/256/Math.pow(2,0),p=o/Math.pow(2,28);r=e.maxResolution,void 0!==r?n=0:r=o/Math.pow(s,n),i=e.minResolution,void 0===i&&(i=void 0!==e.maxZoom?void 0!==e.maxResolution?r/Math.pow(s,a):o/Math.pow(s,a):p),a=n+Math.floor(Math.log(r/i)/Math.log(s)),i=r/Math.pow(s,a-n),t=e.constrainResolution?function(e,t,r,i,n,a){return i=void 0===i||i,r=void 0!==r?r:0,function(s,o,l,h){if(void 0!==s){let A=n?my(t,n,l,a):t;if(h)return i?yy(s,A,r):Bp(s,r,A);let u=1e-9,c=Math.ceil(Math.log(t/A)/Math.log(e)-u),d=-o*(.5-u)+.5,p=Math.min(A,s),f=Math.floor(Math.log(t/p)/Math.log(e)+d),g=Math.max(c,f);return Bp(t/Math.pow(e,g),r,A)}}}(s,r,i,l,!c&&d,h):_y(r,i,l,!c&&d,h)}return{constraint:t,maxResolution:r,minResolution:i,minZoom:n,zoomFactor:s}}(e);this.maxResolution_=r.maxResolution,this.minResolution_=r.minResolution,this.zoomFactor_=r.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=r.minZoom;let i=function(e){if(void 0!==e.extent){let t=void 0===e.smoothExtentConstraint||e.smoothExtentConstraint;return cy(e.extent,e.constrainOnlyCenter,t)}let t=Qf(e.projection,"EPSG:3857");if(!0!==e.multiWorld&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,cy(e,!1,!1)}return dy}(e),n=r.constraint,a=function(e){if(void 0===e.enableRotation||e.enableRotation){let t=e.constrainRotation;return void 0===t||!0===t?function(e){let t=void 0===e?Ip(5):e;return function(e,r){return r||void 0===e?e:Math.abs(e)<=t?0:e}}():!1===t?wy:"number"==typeof t?function(e){let t=2*Math.PI/e;return function(e,r){return r?e:void 0!==e?e=Math.floor(e/t+.5)*t:void 0}}(t):wy}return vy}(e);this.constraints_={center:i,resolution:n,rotation:a},this.setRotation(void 0!==e.rotation?e.rotation:0),this.setCenterInternal(void 0!==e.center?e.center:null),void 0!==e.resolution?this.setResolution(e.resolution):void 0!==e.zoom&&this.setZoom(e.zoom)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let r=this.getCenterInternal();if(r){let i=e||[0,0,0,0];t=t||[0,0,0,0];let n=this.getResolution(),a=n/2*(i[3]-t[3]+t[1]-i[1]),s=n/2*(i[0]-t[0]+t[2]-i[2]);this.setCenterInternal([r[0]+a,r[1]-s])}}getUpdatedOptions_(e){let t=this.getProperties();return void 0!==t.resolution?t.resolution=this.getResolution():t.zoom=this.getZoom(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=new Array(arguments.length);for(let e=0;e<t.length;++e){let r=arguments[e];r.center&&(r=Object.assign({},r),r.center=Jf(r.center,this.getProjection())),r.anchor&&(r=Object.assign({},r),r.anchor=Jf(r.anchor,this.getProjection())),t[e]=r}this.animateInternal.apply(this,t)}animateInternal(e){let t,r=arguments.length;r>1&&"function"==typeof arguments[r-1]&&(t=arguments[r-1],--r);let i=0;for(;i<r&&!this.isDef();++i){let e=arguments[i];e.center&&this.setCenterInternal(e.center),void 0!==e.zoom?this.setZoom(e.zoom):e.resolution&&this.setResolution(e.resolution),void 0!==e.rotation&&this.setRotation(e.rotation)}if(i===r)return void(t&&by(t,!0));let n=Date.now(),a=this.targetCenter_.slice(),s=this.targetResolution_,o=this.targetRotation_,l=[];for(;i<r;++i){let e=arguments[i],r={start:n,complete:!1,anchor:e.anchor,duration:void 0!==e.duration?e.duration:1e3,easing:e.easing||fy,callback:t};if(e.center&&(r.sourceCenter=a,r.targetCenter=e.center.slice(),a=r.targetCenter),void 0!==e.zoom?(r.sourceResolution=s,r.targetResolution=this.getResolutionForZoom(e.zoom),s=r.targetResolution):e.resolution&&(r.sourceResolution=s,r.targetResolution=e.resolution,s=r.targetResolution),void 0!==e.rotation){r.sourceRotation=o;let t=Tp(e.rotation-o+Math.PI,2*Math.PI)-Math.PI;r.targetRotation=o+t,o=r.targetRotation}(h=r).sourceCenter&&h.targetCenter&&!Mp(h.sourceCenter,h.targetCenter)||h.sourceResolution!==h.targetResolution||h.sourceRotation!==h.targetRotation?n+=r.duration:r.complete=!0,l.push(r)}var h;this.animations_.push(l),this.setHint(hy,1),this.updateAnimations_()}getAnimating(){return this.hints_[hy]>0}getInteracting(){return this.hints_[Ay]>0}cancelAnimations(){let e;this.setHint(hy,-this.hints_[hy]);for(let t=0,r=this.animations_.length;t<r;++t){let r=this.animations_[t];if(r[0].callback&&by(r[0].callback,!1),!e)for(let t=0,i=r.length;t<i;++t){let i=r[t];if(!i.complete){e=i.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let e=Date.now(),t=!1;for(let r=this.animations_.length-1;r>=0;--r){let i=this.animations_[r],n=!0;for(let r=0,a=i.length;r<a;++r){let a=i[r];if(a.complete)continue;let s=e-a.start,o=a.duration>0?s/a.duration:1;o>=1?(a.complete=!0,o=1):n=!1;let l=a.easing(o);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],r=a.targetCenter[0],i=a.targetCenter[1];this.nextCenter_=a.targetCenter;let n=e+l*(r-e),s=t+l*(i-t);this.targetCenter_=[n,s]}if(a.sourceResolution&&a.targetResolution){let e=1===l?a.targetResolution:a.sourceResolution+l*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(r,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(void 0!==a.sourceRotation&&void 0!==a.targetRotation){let e=1===l?Tp(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+l*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(n){this.animations_[r]=null,this.setHint(hy,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=i[0].callback;e&&by(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let r,i=this.getCenterInternal();return void 0!==i&&(r=[i[0]-t[0],i[1]-t[1]],kp(r,e-this.getRotation()),function(e,t){e[0]+=+t[0],e[1]+=+t[1]}(r,t)),r}calculateCenterZoom(e,t){let r,i=this.getCenterInternal(),n=this.getResolution();if(void 0!==i&&void 0!==n){r=[t[0]-e*(t[0]-i[0])/n,t[1]-e*(t[1]-i[1])/n]}return r}getViewportSize_(e){let t=this.viewportSize_;if(e){let r=t[0],i=t[1];return[Math.abs(r*Math.cos(e))+Math.abs(i*Math.sin(e)),Math.abs(r*Math.sin(e))+Math.abs(i*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let e=this.getCenterInternal();return e&&Yf(e,this.getProjection())}getCenterInternal(){return this.get(uy.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(e){return void 0!==e?(e[0]=this.hints_[0],e[1]=this.hints_[1],e):this.hints_.slice()}calculateExtent(e){return eg(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();rg(t,"The view center is not defined");let r=this.getResolution();rg(void 0!==r,"The view resolution is not defined");let i=this.getRotation();return rg(void 0!==i,"The view rotation is not defined"),Pd(t,r,i,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(uy.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(tg(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();let r=Rd(e)/t[0],i=Ld(e)/t[1];return Math.max(r,i)}getResolutionForValueFunction(e){e=e||2;let t=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(t/r)/Math.log(e);return function(r){return t/Math.pow(e,r*i)}}getRotation(){return this.get(uy.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),r=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,n=Math.log(r/i)/t;return function(e){return Math.log(r/e)/t/n}}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),r=this.padding_;return r&&(t=[t[0]-r[1]-r[3],t[1]-r[0]-r[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),r=this.getRotation(),i=this.getCenterInternal(),n=this.padding_;if(n){let e=this.getViewportSizeMinusPadding_();i=xy(i,this.getViewportSize_(),[e[0]/2+n[3],e[1]/2+n[0]],t,r)}return{center:i.slice(0),projection:void 0!==e?e:null,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:r,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return void 0!==t&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t,r,i=this.minZoom_||0;if(this.resolutions_){let n=tp(this.resolutions_,e,1);i=n,t=this.resolutions_[n],r=n==this.resolutions_.length-1?2:t/this.resolutions_[n+1]}else t=this.maxResolution_,r=this.zoomFactor_;return i+Math.log(t/e)/Math.log(r)}getResolutionForZoom(e){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];let t=Bp(Math.floor(e),0,this.resolutions_.length-2),r=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/Math.pow(r,Bp(e-t,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,e-this.minZoom_)}fit(e,t){let r;if(rg(Array.isArray(e)||"function"==typeof e.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e)){rg(!Nd(e),"Cannot fit empty extent provided as `geometry`"),r=Am(tg(e,this.getProjection()))}else if("Circle"===e.getType()){let t=tg(e.getExtent(),this.getProjection());r=Am(t),r.rotate(this.getRotation(),Fd(t))}else{let t=Xf();r=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(r,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),r=Math.cos(t),i=Math.sin(-t),n=e.getFlatCoordinates(),a=e.getStride(),s=1/0,o=1/0,l=-1/0,h=-1/0;for(let e=0,t=n.length;e<t;e+=a){let t=n[e]*r-n[e+1]*i,a=n[e]*i+n[e+1]*r;s=Math.min(s,t),o=Math.min(o,a),l=Math.max(l,t),h=Math.max(h,a)}return[s,o,l,h]}fitInternal(e,t){let r=(t=t||{}).size;r||(r=this.getViewportSizeMinusPadding_());let i,n=void 0!==t.padding?t.padding:[0,0,0,0],a=void 0!==t.nearest&&t.nearest;i=void 0!==t.minResolution?t.minResolution:void 0!==t.maxZoom?this.getResolutionForZoom(t.maxZoom):0;let s=this.rotatedExtentForGeometry(e),o=this.getResolutionForExtentInternal(s,[r[0]-n[1]-n[3],r[1]-n[0]-n[2]]);o=isNaN(o)?i:Math.max(o,i),o=this.getConstrainedResolution(o,a?0:1);let l=this.getRotation(),h=Math.sin(l),A=Math.cos(l),u=Fd(s);u[0]+=(n[1]-n[3])/2*o,u[1]+=(n[0]-n[2])/2*o;let c=u[0]*A-u[1]*h,d=u[1]*A+u[0]*h,p=this.getConstrainedCenter([c,d],o),f=t.callback?t.callback:op;void 0!==t.duration?this.animateInternal({resolution:o,center:p,duration:t.duration,easing:t.easing},f):(this.targetResolution_=o,this.targetCenter_=p,this.applyTargetState_(!1,!0),by(f,!0))}centerOn(e,t,r){this.centerOnInternal(Jf(e,this.getProjection()),t,r)}centerOnInternal(e,t,r){this.setCenterInternal(xy(e,t,r,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,r,i){let n,a=this.padding_;if(a&&e){let s=this.getViewportSizeMinusPadding_(-r),o=xy(e,i,[s[0]/2+a[3],s[1]/2+a[0]],t,r);n=[e[0]-o[0],e[1]-o[1]]}return n}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(e){let t=Yf(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&Jf(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let r=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(this.targetResolution_*e,0,i,r);t&&(this.targetCenter_=this.calculateCenterZoom(n,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(Math.pow(this.zoomFactor_,-e),t)}adjustRotation(e,t){t&&(t=Jf(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let r=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+e,r);t&&(this.targetCenter_=this.calculateCenterRotate(i,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&Jf(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){let r=this.getAnimating()||this.getInteracting()||t,i=this.constraints_.rotation(this.targetRotation_,r),n=this.getViewportSize_(i),a=this.constraints_.resolution(this.targetResolution_,0,n,r),s=this.constraints_.center(this.targetCenter_,a,n,r,this.calculateCenterShift(this.targetCenter_,a,i,n));this.get(uy.ROTATION)!==i&&this.set(uy.ROTATION,i),this.get(uy.RESOLUTION)!==a&&(this.set(uy.RESOLUTION,a),this.set("zoom",this.getZoom(),!0)),(!s||!this.get(uy.CENTER)||!Mp(this.get(uy.CENTER),s))&&this.set(uy.CENTER,s),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,r){e=void 0!==e?e:200;let i=t||0,n=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,i,a),o=this.constraints_.center(this.targetCenter_,s,a,!1,this.calculateCenterShift(this.targetCenter_,s,n,a));if(0===e&&!this.cancelAnchor_)return this.targetResolution_=s,this.targetRotation_=n,this.targetCenter_=o,void this.applyTargetState_();r=r||(0===e?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==s||this.getRotation()!==n||!this.getCenterInternal()||!Mp(this.getCenterInternal(),o))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:n,center:o,resolution:s,duration:e,easing:py,anchor:r}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Ay,1)}endInteraction(e,t,r){r=r&&Jf(r,this.getProjection()),this.endInteractionInternal(e,t,r)}endInteractionInternal(e,t,r){this.getInteracting()&&(this.setHint(Ay,-1),this.resolveConstraints(e,t,r))}getConstrainedCenter(e,t){let r=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),r)}getConstrainedZoom(e,t){let r=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(r,t))}getConstrainedResolution(e,t){t=t||0;let r=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,r)}},Cy="prerender",Sy="postrender",Ey="precompose",Iy="postcompose",Ty="rendercomplete",Fy="opacity",Py="visible",Ly="extent",My="zIndex",ky="maxResolution",Uy="minResolution",Ry="maxZoom",Dy="minZoom",Ny="source",Oy="map",Qy=class extends vp{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);"object"==typeof e.properties&&(delete t.properties,Object.assign(t,e.properties)),t[Fy]=void 0!==e.opacity?e.opacity:1,rg("number"==typeof t[Fy],"Layer opacity must be a number"),t[Py]=void 0===e.visible||e.visible,t[My]=e.zIndex,t[ky]=void 0!==e.maxResolution?e.maxResolution:1/0,t[Uy]=void 0!==e.minResolution?e.minResolution:0,t[Dy]=void 0!==e.minZoom?e.minZoom:-1/0,t[Ry]=void 0!==e.maxZoom?e.maxZoom:1/0,this.className_=void 0!==t.className?t.className:"ol-layer",delete t.className,this.setProperties(t),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:void 0===e||e},r=this.getZIndex();return t.opacity=Bp(Math.round(100*this.getOpacity())/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=void 0!==r||t.managed?r:1/0,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return Qd()}getLayerStatesArray(e){return Qd()}getExtent(){return this.get(Ly)}getMaxResolution(){return this.get(ky)}getMinResolution(){return this.get(Uy)}getMinZoom(){return this.get(Dy)}getMaxZoom(){return this.get(Ry)}getOpacity(){return this.get(Fy)}getSourceState(){return Qd()}getVisible(){return this.get(Py)}getZIndex(){return this.get(My)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(Ly,e)}setMaxResolution(e){this.set(ky,e)}setMinResolution(e){this.set(Uy,e)}setMaxZoom(e){this.set(Ry,e)}setMinZoom(e){this.set(Dy,e)}setOpacity(e){rg("number"==typeof e,"Layer opacity must be a number"),this.set(Fy,e)}setVisible(e){this.set(Py,e)}setZIndex(e){this.set(My,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}};function zy(e,t){if(!e.visible)return!1;let r=t.resolution;if(r<e.minResolution||r>=e.maxResolution)return!1;let i=t.zoom;return i>e.minZoom&&i<=e.maxZoom}var Hy,jy=class extends Qy{constructor(e){let t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(Ny,this.handleSourcePropertyChange_);let r=e.source?e.source:null;this.setSource(r)}getLayersArray(e){return(e=e||[]).push(this),e}getLayerStatesArray(e){return(e=e||[]).push(this.getLayerState()),e}getSource(){return this.get(Ny)||null}getRenderSource(){return this.getSource()}getSourceState(){let e=this.getSource();return e?e.getState():"undefined"}handleSourceChange_(){this.changed(),!this.sourceReady_&&"ready"===this.getSource().getState()&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(fp(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=dp(e,Vd,this.handleSourceChange_,this),"ready"===e.getState()&&(this.sourceReady_=!0,setTimeout((()=>{this.dispatchEvent("sourceready")}),0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return this.renderer_&&this.rendered?this.renderer_.getData(e):null}isVisible(e){let t,r,i=this.getMapInternal();if(!e&&i&&(e=i.getView()),t=e instanceof By?{viewState:e.getState(),extent:e.calculateExtent()}:e,!t.layerStatesArray&&i&&(t.layerStatesArray=i.getLayerGroup().getLayerStatesArray()),t.layerStatesArray){if(r=t.layerStatesArray.find((e=>e.layer===this)),!r)return!1}else r=this.getLayerState();let n=this.getExtent();return zy(r,t.viewState)&&(!n||Dd(n,t.extent))}getAttributions(e){if(!this.isVisible(e))return[];let t=this.getSource()?.getAttributions();if(!t)return[];let r=t(e instanceof By?e.getViewStateAndExtent():e);return Array.isArray(r)||(r=[r]),r}render(e,t){let r=this.getRenderer();return r.prepareFrame(e)?(this.rendered=!0,r.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(Oy,e)}getMapInternal(){return this.get(Oy)}setMap(e){this.mapPrecomposeKey_&&(fp(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(fp(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=dp(e,Ey,this.handlePrecompose_,this),this.mapRenderKey_=dp(this,Vd,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState.layerStatesArray,r=this.getLayerState(!1);rg(!t.some((e=>e.layer===r.layer)),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(r)}setSource(e){this.set(Ny,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}},Vy=()=>{let e=document.createElement("div");return Object.assign(e.style,{bottom:0,fontSize:".8rem",padding:"0 10px",position:"absolute",right:0}),e},Gy=class extends ly{constructor(e={}){let t=Vy();t.className=e.className||"mbt-copyright",super(Object.assign({element:t},e)),this.format=e.format||(e=>e?.join(" | "))}render({frameState:e}){if(!e)return void(this.element.innerHTML="");let t=[];e?.layerStatesArray.forEach((r=>{var i;let{layer:n}=r;if(e&&zy(r,e.viewState)){let r=null===(i=n?.getSource())||void 0===i?void 0:i.getAttributions();if(r&&(t=t.concat(r(e))),n?.get("copyrights")){let e=n.get("copyrights");e=Array.isArray(e)?e:[e],e?.length&&t.push(...e)}}}));let r=ad(t)||[];this.element.innerHTML=this.format(r)}},Ky="add",qy="remove",Zy="length",Wy=class extends up{constructor(e,t,r){super(e),this.element=t,this.index=r}},$y=class extends vp{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e||[],this.unique_)for(let e=0,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,r=e.length;t<r;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let r=0,i=t.length;r<i;++r)e(t[r],r,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(Zy)}insertAt(e,t){if(e<0||e>this.getLength())throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new Wy(Ky,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){this.unique_&&this.assertUnique_(e);let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let r=0,i=t.length;r<i;++r)if(t[r]===e)return this.removeAt(r)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new Wy(qy,t,e)),t}setAt(e,t){if(e>=this.getLength())return void this.insertAt(e,t);if(e<0)throw new Error("Index out of bounds: "+e);this.unique_&&this.assertUnique_(t,e);let r=this.array_[e];this.array_[e]=t,this.dispatchEvent(new Wy(qy,r,e)),this.dispatchEvent(new Wy(Ky,t,e))}updateLength_(){this.set(Zy,this.array_.length)}assertUnique_(e,t){for(let r=0,i=this.array_.length;r<i;++r)if(this.array_[r]===e&&r!==t)throw new Error("Duplicate item added to a unique collection")}},Xy="accuracy",Yy="accuracyGeometry",Jy="altitude",e_="altitudeAccuracy",t_="heading",r_="position",i_="projection",n_="speed",a_="tracking",s_="trackingOptions",o_="error",l_=class extends up{constructor(e){super(o_),this.code=e.code,this.message=e.message}},h_=class extends vp{constructor(e){super(),this.on,this.once,this.un,e=e||{},this.position_=null,this.transform_=Uf,this.watchId_=void 0,this.addChangeListener(i_,this.handleProjectionChanged_),this.addChangeListener(a_,this.handleTrackingChanged_),void 0!==e.projection&&this.setProjection(e.projection),void 0!==e.trackingOptions&&this.setTrackingOptions(e.trackingOptions),this.setTracking(void 0!==e.tracking&&e.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){let e=this.getProjection();e&&(this.transform_=jf(Df("EPSG:4326"),e),this.position_&&this.set(r_,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){let e=this.getTracking();e&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):!e&&void 0!==this.watchId_&&(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(e){let t=e.coords;this.set(Xy,t.accuracy),this.set(Jy,null===t.altitude?void 0:t.altitude),this.set(e_,null===t.altitudeAccuracy?void 0:t.altitudeAccuracy),this.set(t_,null===t.heading?void 0:Ip(t.heading)),this.position_?(this.position_[0]=t.longitude,this.position_[1]=t.latitude):this.position_=[t.longitude,t.latitude];let r=this.transform_(this.position_);this.set(r_,r.slice()),this.set(n_,null===t.speed?void 0:t.speed);let i=function(e,t,r,i){r=r||32;let n=[];for(let a=0;a<r;++a)ip(n,Tf(e,t,2*Math.PI*a/r,i));return n.push(n[0],n[1]),new lm(n,"XY",[n.length])}(this.position_,t.accuracy);i.applyTransform(this.transform_),this.set(Yy,i),this.changed()}positionError_(e){this.dispatchEvent(new l_(e))}getAccuracy(){return this.get(Xy)}getAccuracyGeometry(){return this.get(Yy)||null}getAltitude(){return this.get(Jy)}getAltitudeAccuracy(){return this.get(e_)}getHeading(){return this.get(t_)}getPosition(){return this.get(r_)}getProjection(){return this.get(i_)}getSpeed(){return this.get(n_)}getTracking(){return this.get(a_)}getTrackingOptions(){return this.get(s_)}setProjection(e){this.set(i_,Df(e))}setTracking(e){this.set(a_,e)}setTrackingOptions(e){this.set(s_,e)}},A_=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",u_=(A_.includes("safari")&&!A_.includes("chrom")&&(A_.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(A_)),A_.includes("webkit")&&!A_.includes("edge")),c_=A_.includes("macintosh"),d_=typeof devicePixelRatio<"u"?devicePixelRatio:1,p_=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,f_=typeof Image<"u"&&Image.prototype.decode,g_=function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return e}(),m_=0,y_=1,__=2,v_=3;function w_(e,t,r,i){let n;return n=r&&r.length?r.shift():p_?new OffscreenCanvas(e||300,t||300):document.createElement("canvas"),e&&(n.width=e),t&&(n.height=t),n.getContext("2d",i)}function b_(){return Hy||(Hy=w_(1,1)),Hy}function x_(e,t){let r=t.parentNode;r&&r.replaceChild(e,t)}var B_,C_=[NaN,NaN,NaN,0];var S_=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,E_=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,I_=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,T_=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function F_(e,t){return e.endsWith("%")?Number(e.substring(0,e.length-1))/t:Number(e)}function P_(e){throw new Error('failed to parse "'+e+'" as color')}function L_(e){if(e.toLowerCase().startsWith("rgb")){let t=e.match(E_)||e.match(S_)||e.match(I_);if(t){let e=t[4],r=100/255;return[Bp(F_(t[1],r)+.5|0,0,255),Bp(F_(t[2],r)+.5|0,0,255),Bp(F_(t[3],r)+.5|0,0,255),void 0!==e?Bp(F_(e,100),0,1):1]}P_(e)}if(e.startsWith("#")){if(T_.test(e)){let t=e.substring(1),r=t.length<=4?1:2,i=[0,0,0,255];for(let e=0,n=t.length;e<n;e+=r){let n=parseInt(t.substring(e,e+r),16);1===r&&(n+=n<<4),i[e/r]=n}return i[3]=i[3]/255,i}P_(e)}let t=(B_||(B_=w_(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),B_);t.fillStyle="#abcdef";let r=t.fillStyle;t.fillStyle=e,t.fillStyle===r&&(t.fillStyle="#fedcba",r=t.fillStyle,t.fillStyle=e,t.fillStyle===r&&P_(e));let i=t.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return L_(i);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let n=Array.from(t.getImageData(0,0,1,1).data);return n[3]=Pp(n[3]/255,3),n}function M_(e){return"string"==typeof e?e:V_(e)}var k_={},U_=0;function R_(e){if(4===e.length)return e;let t=e.slice();return t[3]=1,t}function D_(e){return e>.0031308?269.025*Math.pow(e,1/2.4)-14.025:3294.6*e}function N_(e){return e>.2068965?Math.pow(e,3):108/841*(e-4/29)}function O_(e){return e>10.314724?Math.pow((e+14.025)/269.025,2.4):e/3294.6}function Q_(e){return e>.0088564?Math.pow(e,1/3):e/(108/841)+4/29}function z_(e){let t=O_(e[0]),r=O_(e[1]),i=O_(e[2]),n=Q_(.222488403*t+.716873169*r+.06060791*i),a=500*(Q_(.452247074*t+.399439023*r+.148375274*i)-n),s=200*(n-Q_(.016863605*t+.117638439*r+.865350722*i)),o=Math.atan2(s,a)*(180/Math.PI);return[116*n-16,Math.sqrt(a*a+s*s),o<0?o+360:o,e[3]]}function H_(e){if("none"===e)return C_;if(k_.hasOwnProperty(e))return k_[e];if(U_>=1024){let e=0;for(let t in k_)!(3&e++)&&(delete k_[t],--U_)}let t=L_(e);4!==t.length&&P_(e);for(let r of t)isNaN(r)&&P_(e);return k_[e]=t,++U_,t}function j_(e){return Array.isArray(e)?e:H_(e)}function V_(e){let t=e[0];t!=(0|t)&&(t=t+.5|0);let r=e[1];r!=(0|r)&&(r=r+.5|0);let i=e[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+t+","+r+","+i+","+(void 0===e[3]?1:Math.round(1e3*e[3])/1e3)+")"}function G_(e,t){return t&&(e.src=t),e.src&&f_?new Promise(((t,r)=>e.decode().then((()=>t(e))).catch((i=>e.complete&&e.width?t(e):r(i))))):function(e,t){return new Promise(((r,i)=>{function n(){s(),r(e)}function a(){s(),i(new Error("Image load error"))}function s(){e.removeEventListener("load",n),e.removeEventListener("error",a)}e.addEventListener("load",n),e.addEventListener("error",a),t&&(e.src=t)}))}(e)}function K_(e,t,r){return t+":"+e+":"+(r?j_(r):"null")}var q_=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let r=this.cache_[t];!(3&e++)&&!r.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t,r){let i=K_(e,t,r);return i in this.cache_?this.cache_[i]:null}getPattern(e,t,r){let i=K_(e,t,r);return i in this.patternCache_?this.patternCache_[i]:null}set(e,t,r,i,n){let a=K_(e,t,r),s=a in this.cache_;this.cache_[a]=i,n&&(i.getImageState()===m_&&i.load(),i.getImageState()===y_?i.ready().then((()=>{this.patternCache_[a]=b_().createPattern(i.getImage(1),"repeat")})):this.patternCache_[a]=b_().createPattern(i.getImage(1),"repeat")),s||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}},Z_=null,W_=class extends cp{constructor(e,t,r,i,n){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=r,this.canvas_={},this.color_=n,this.imageState_=void 0===i?m_:i,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&this.imageState_===__){Z_||(Z_=w_(1,1,void 0,{willReadFrequently:!0})),Z_.drawImage(this.image_,0,0);try{Z_.getImageData(0,0,1,1),this.tainted_=!1}catch{Z_=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(Vd)}handleImageError_(){this.imageState_=v_,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=__,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],r=w_(e,t);r.fillRect(0,0,e,t),this.hitDetectionImage_=r.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===m_){this.image_||this.initializeImage_(),this.imageState_=y_;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&G_(this.image_,this.src_).then((e=>{this.image_=e,this.handleImageLoad_()})).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==__)return;let t=this.image_,r=w_(Math.ceil(t.width*e),Math.ceil(t.height*e)),i=r.canvas;r.scale(e,e),r.drawImage(t,0,0),r.globalCompositeOperation="multiply",r.fillStyle=M_(this.color_),r.fillRect(0,0,i.width/e,i.height/e),r.globalCompositeOperation="destination-in",r.drawImage(t,0,0),this.canvas_[e]=i}ready(){return this.ready_||(this.ready_=new Promise((e=>{if(this.imageState_===__||this.imageState_===v_)e();else{let t=()=>{(this.imageState_===__||this.imageState_===v_)&&(this.removeEventListener(Vd,t),e())};this.addEventListener(Vd,t)}}))),this.ready_}};function $_(e,t,r,i,n,a){let s=void 0===t?void 0:q_.get(t,r,n);return s||(s=new W_(e,e&&"src"in e?e.src||void 0:t,r,i,n),q_.set(t,r,n,s,a)),a&&s&&!q_.getPattern(t,r,n)&&q_.set(t,r,n,s,a),s}var X_=W_;function Y_(e){return e?Array.isArray(e)?V_(e):"object"==typeof e&&"src"in e?function(e){if(!e.offset||!e.size)return q_.getPattern(e.src,"anonymous",e.color);let t=e.src+":"+e.offset,r=q_.getPattern(t,void 0,e.color);if(r)return r;let i=q_.get(e.src,"anonymous",null);if(i.getImageState()!==__)return null;let n=w_(e.size[0],e.size[1]);return n.drawImage(i.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),$_(n.canvas,t,void 0,__,e.color,!0),q_.getPattern(t,void 0,e.color)}(e):e:null}var J_,ev=class{drawCustom(e,t,r,i,n){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,r){}drawFeature(e,t,r){}drawGeometryCollection(e,t,r){}drawLineString(e,t,r){}drawMultiLineString(e,t,r){}drawMultiPoint(e,t,r){}drawMultiPolygon(e,t,r){}drawPoint(e,t,r){}drawPolygon(e,t,r){}drawText(e,t,r){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},tv="ol-hidden",rv="ol-unselectable",iv="ol-control",nv="ol-collapsed",av=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z0-9]+?)\\s*$"].join(""),"i"),sv=["style","variant","weight","size","lineHeight","family"],ov={normal:400,bold:700},lv=function(e){let t=e.match(av);if(!t)return null;let r={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let e=0,i=sv.length;e<i;++e){let i=t[e+1];void 0!==i&&(r[sv[e]]="string"==typeof i?i.trim():i)}return isNaN(Number(r.weight))&&r.weight in ov&&(r.weight=ov[r.weight]),r.families=r.family.split(/,\s?/).map((e=>e.trim().replace(/^['"]|['"]$/g,""))),r},hv="10px sans-serif",Av="#000",uv="round",cv=[],dv="round",pv="#000",fv="center",gv="middle",mv=[0,0,0,0],yv=new vp,_v=null,vv={},wv=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function bv(e,t,r){return`${e} ${t} 16px "${r}"`}var xv=function(){let e,t;async function r(e){await t.ready;let r=await t.load(e);if(0===r.length)return!1;let i=lv(e),n=i.families[0].toLowerCase(),a=i.weight;return r.some((e=>{let t=e.family.replace(/^['"]|['"]$/g,"").toLowerCase(),r=ov[e.weight]||e.weight;return t===n&&e.style===i.style&&r==a}))}async function i(){await t.ready;let n=!0,a=yv.getProperties(),s=Object.keys(a).filter((e=>a[e]<100));for(let e=s.length-1;e>=0;--e){let t=s[e],i=a[t];i<100&&(await r(t)?(hp(vv),yv.set(t,100)):(i+=10,yv.set(t,i,!0),i<100&&(n=!1)))}e=void 0,n||(e=setTimeout(i,100))}return async function(r){t||(t=p_?self.fonts:document.fonts);let n=lv(r);if(!n)return;let a=n.families,s=!1;for(let e of a){if(wv.has(e))continue;let t=bv(n.style,n.weight,e);void 0===yv.get(t)&&(yv.set(t,0,!0),s=!0)}s&&(clearTimeout(e),e=setTimeout(i,100))}}(),Bv=function(){let e;return function(t){let r=vv[t];if(null==r){if(p_){let e=lv(t),i=Cv(t,"Žg");r=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else e||(e=document.createElement("div"),e.innerHTML="M",e.style.minHeight="0",e.style.maxHeight="none",e.style.height="auto",e.style.padding="0",e.style.border="none",e.style.position="absolute",e.style.display="block",e.style.left="-99999px"),e.style.font=t,document.body.appendChild(e),r=e.offsetHeight,document.body.removeChild(e);vv[t]=r}return r}}();function Cv(e,t){return _v||(_v=w_(1,1)),e!=J_&&(_v.font=e,J_=_v.font),_v.measureText(t)}function Sv(e,t){return Cv(e,t).width}function Ev(e,t,r){if(t in r)return r[t];let i=t.split("\n").reduce(((t,r)=>Math.max(t,Sv(e,r))),0);return r[t]=i,i}function Iv(e,t,r,i,n,a,s,o,l,h,A){e.save(),1!==r&&(void 0===e.globalAlpha?e.globalAlpha=e=>e.globalAlpha*=r:e.globalAlpha*=r),t&&e.transform.apply(e,t),i.contextInstructions?(e.translate(l,h),e.scale(A[0],A[1]),function(e,t){let r=e.contextInstructions;for(let e=0,i=r.length;e<i;e+=2)Array.isArray(r[e+1])?t[r[e]].apply(t,r[e+1]):t[r[e]]=r[e+1]}(i,e)):A[0]<0||A[1]<0?(e.translate(l,h),e.scale(A[0],A[1]),e.drawImage(i,n,a,s,o,0,0,s,o)):e.drawImage(i,n,a,s,o,l,h,s*A[0],o*A[1]),e.restore()}var Tv=class extends ev{constructor(e,t,r,i,n,a,s){super(),this.context_=e,this.pixelRatio_=t,this.extent_=r,this.transform_=i,this.transformRotation_=i?Pp(Math.atan2(i[1],i[0]),10):0,this.viewRotation_=n,this.squaredTolerance_=a,this.userTransform_=s,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(e,t,r,i){if(!this.image_)return;let n=hg(e,t,r,i,this.transform_,this.pixelCoordinates_),a=this.context_,s=this.tmpLocalTransform_,o=a.globalAlpha;1!=this.imageOpacity_&&(a.globalAlpha=o*this.imageOpacity_);let l=this.imageRotation_;0===this.transformRotation_&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let e=0,t=n.length;e<t;e+=2){let t=n[e]-this.imageAnchorX_,r=n[e+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){let e=t+this.imageAnchorX_,i=r+this.imageAnchorY_;ng(s,e,i,1,1,l,-e,-i),a.save(),a.transform.apply(a,s),a.translate(e,i),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,r,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(a.globalAlpha=o)}drawText_(e,t,r,i){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let n=hg(e,t,r,i,this.transform_,this.pixelCoordinates_),a=this.context_,s=this.textRotation_;for(0===this.transformRotation_&&(s-=this.viewRotation_),this.textRotateWithView_&&(s+=this.viewRotation_);t<r;t+=i){let e=n[t]+this.textOffsetX_,r=n[t+1]+this.textOffsetY_;0!==s||1!=this.textScale_[0]||1!=this.textScale_[1]?(a.save(),a.translate(e-this.textOffsetX_,r-this.textOffsetY_),a.rotate(s),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,r),this.textFillState_&&a.fillText(this.text_,e,r))}}moveToLineTo_(e,t,r,i,n){let a=this.context_,s=hg(e,t,r,i,this.transform_,this.pixelCoordinates_);a.moveTo(s[0],s[1]);let o=s.length;n&&(o-=2);for(let e=2;e<o;e+=2)a.lineTo(s[e],s[e+1]);return n&&a.closePath(),r}drawRings_(e,t,r,i){for(let n=0,a=r.length;n<a;++n)t=this.moveToLineTo_(e,t,r[n],i,!0);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Dd(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=function(e,t,r){let i=e.getFlatCoordinates();if(!i)return null;let n=e.getStride();return hg(i,0,i.length,n,t,r)}(e,this.transform_,this.pixelCoordinates_),r=t[2]-t[0],i=t[3]-t[1],n=Math.sqrt(r*r+i*i),a=this.context_;a.beginPath(),a.arc(t[0],t[1],n,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}""!==this.text_&&this.drawText_(e.getCenter(),0,2,2)}}setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case"Point":this.drawPoint(e);break;case"LineString":this.drawLineString(e);break;case"Polygon":this.drawPolygon(e);break;case"MultiPoint":this.drawMultiPoint(e);break;case"MultiLineString":this.drawMultiLineString(e);break;case"MultiPolygon":this.drawMultiPolygon(e);break;case"GeometryCollection":this.drawGeometryCollection(e);break;case"Circle":this.drawCircle(e)}}drawFeature(e,t){let r=t.getGeometryFunction()(e);r&&(this.setStyle(t),this.drawGeometry(r))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,r=t.length;e<r;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),r=e.getStride();this.image_&&this.drawImages_(t,0,t.length,r),""!==this.text_&&this.drawText_(t,0,t.length,r)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),r=e.getStride();this.image_&&this.drawImages_(t,0,t.length,r),""!==this.text_&&this.drawText_(t,0,t.length,r)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Dd(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,r=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(r,0,r.length,e.getStride(),!1),t.stroke()}if(""!==this.text_){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Dd(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,r=e.getFlatCoordinates(),i=0,n=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=n.length;e<t;++e)i=this.moveToLineTo_(r,i,n[e],a,!1);t.stroke()}if(""!==this.text_){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Dd(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_;t.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride()),this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(""!==this.text_){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Dd(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=this.context_,r=e.getOrientedFlatCoordinates(),i=0,n=e.getEndss(),a=e.getStride();t.beginPath();for(let e=0,t=n.length;e<t;++e){let t=n[e];i=this.drawRings_(r,i,t,a)}this.fillState_&&t.fill(),this.strokeState_&&t.stroke()}if(""!==this.text_){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,r=this.contextFillState_;r?r.fillStyle!=e.fillStyle&&(r.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,r=this.contextStrokeState_;r?(r.lineCap!=e.lineCap&&(r.lineCap=e.lineCap,t.lineCap=e.lineCap),np(r.lineDash,e.lineDash)||t.setLineDash(r.lineDash=e.lineDash),r.lineDashOffset!=e.lineDashOffset&&(r.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),r.lineJoin!=e.lineJoin&&(r.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),r.lineWidth!=e.lineWidth&&(r.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),r.miterLimit!=e.miterLimit&&(r.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),r.strokeStyle!=e.strokeStyle&&(r.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){let t=this.context_,r=this.contextTextState_,i=e.textAlign?e.textAlign:fv;r?(r.font!=e.font&&(r.font=e.font,t.font=e.font),r.textAlign!=i&&(r.textAlign=i,t.textAlign=i),r.textBaseline!=e.textBaseline&&(r.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=i,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:i,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(e){let t=e.getColor();this.fillState_={fillStyle:Y_(t||Av)}}else this.fillState_=null;if(t){let e=t.getColor(),r=t.getLineCap(),i=t.getLineDash(),n=t.getLineDashOffset(),a=t.getLineJoin(),s=t.getWidth(),o=t.getMiterLimit(),l=i||cv;this.strokeState_={lineCap:void 0!==r?r:uv,lineDash:1===this.pixelRatio_?l:l.map((e=>e*this.pixelRatio_)),lineDashOffset:(n||0)*this.pixelRatio_,lineJoin:void 0!==a?a:dv,lineWidth:(void 0!==s?s:1)*this.pixelRatio_,miterLimit:void 0!==o?o:10,strokeStyle:Y_(e||pv)}}else this.strokeState_=null}setImageStyle(e){let t;if(!e||!(t=e.getSize()))return void(this.image_=null);let r=e.getPixelRatio(this.pixelRatio_),i=e.getAnchor(),n=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*r,this.imageAnchorY_=i[1]*r,this.imageHeight_=t[1]*r,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=n[0],this.imageOriginY_=n[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/r,a[1]*this.pixelRatio_/r],this.imageWidth_=t[0]*r}setTextStyle(e){if(e){let t=e.getFill();if(t){let e=t.getColor();this.textFillState_={fillStyle:Y_(e||Av)}}else this.textFillState_=null;let r=e.getStroke();if(r){let e=r.getColor(),t=r.getLineCap(),i=r.getLineDash(),n=r.getLineDashOffset(),a=r.getLineJoin(),s=r.getWidth(),o=r.getMiterLimit();this.textStrokeState_={lineCap:void 0!==t?t:uv,lineDash:i||cv,lineDashOffset:n||0,lineJoin:void 0!==a?a:dv,lineWidth:void 0!==s?s:1,miterLimit:void 0!==o?o:10,strokeStyle:Y_(e||pv)}}else this.textStrokeState_=null;let i=e.getFont(),n=e.getOffsetX(),a=e.getOffsetY(),s=e.getRotateWithView(),o=e.getRotation(),l=e.getScaleArray(),h=e.getText(),A=e.getTextAlign(),u=e.getTextBaseline();this.textState_={font:void 0!==i?i:hv,textAlign:void 0!==A?A:fv,textBaseline:void 0!==u?u:gv},this.text_=void 0!==h?Array.isArray(h)?h.reduce(((e,t,r)=>e+(r%2?" ":t)),""):h:"",this.textOffsetX_=void 0!==n?this.pixelRatio_*n:0,this.textOffsetY_=void 0!==a?this.pixelRatio_*a:0,this.textRotateWithView_=void 0!==s&&s,this.textRotation_=void 0!==o?o:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}},Fv={Point:function(e,t,r,i,n,a){let s=r.getImage(),o=r.getText(),l=o&&o.getText(),h=a&&s&&l?{}:void 0;if(s){if(s.getImageState()!=__)return;let a=e.getBuilder(r.getZIndex(),"Image");a.setImageStyle(s,h),a.drawPoint(t,i,n)}if(l){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(o,h),a.drawText(t,i,n)}},LineString:function(e,t,r,i,n){let a=r.getStroke();if(a){let s=e.getBuilder(r.getZIndex(),"LineString");s.setFillStrokeStyle(null,a),s.drawLineString(t,i,n)}let s=r.getText();if(s&&s.getText()){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(s),a.drawText(t,i,n)}},Polygon:function(e,t,r,i,n){let a=r.getFill(),s=r.getStroke();if(a||s){let o=e.getBuilder(r.getZIndex(),"Polygon");o.setFillStrokeStyle(a,s),o.drawPolygon(t,i,n)}let o=r.getText();if(o&&o.getText()){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,i,n)}},MultiPoint:function(e,t,r,i,n,a){let s=r.getImage(),o=s&&0!==s.getOpacity(),l=r.getText(),h=l&&l.getText(),A=a&&o&&h?{}:void 0;if(o){if(s.getImageState()!=__)return;let a=e.getBuilder(r.getZIndex(),"Image");a.setImageStyle(s,A),a.drawMultiPoint(t,i,n)}if(h){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(l,A),a.drawText(t,i,n)}},MultiLineString:function(e,t,r,i,n){let a=r.getStroke();if(a){let s=e.getBuilder(r.getZIndex(),"LineString");s.setFillStrokeStyle(null,a),s.drawMultiLineString(t,i,n)}let s=r.getText();if(s&&s.getText()){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(s),a.drawText(t,i,n)}},MultiPolygon:function(e,t,r,i,n){let a=r.getFill(),s=r.getStroke();if(s||a){let o=e.getBuilder(r.getZIndex(),"Polygon");o.setFillStrokeStyle(a,s),o.drawMultiPolygon(t,i,n)}let o=r.getText();if(o&&o.getText()){let a=e.getBuilder(r.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,i,n)}},GeometryCollection:function(e,t,r,i,n,a){let s,o,l=t.getGeometriesArray();for(s=0,o=l.length;s<o;++s){(0,Fv[l[s].getType()])(e,l[s],r,i,n,a)}},Circle:function(e,t,r,i,n){let a=r.getFill(),s=r.getStroke();if(a||s){let o=e.getBuilder(r.getZIndex(),"Circle");o.setFillStrokeStyle(a,s),o.drawCircle(t,i,n)}let o=r.getText();if(o&&o.getText()){let n=e.getBuilder(r.getZIndex(),"Text");n.setTextStyle(o),n.drawText(t,i)}}};function Pv(e,t){return parseInt(Hd(e),10)-parseInt(Hd(t),10)}function Lv(e,t){let r=Mv(e,t);return r*r}function Mv(e,t){return.5*e/t}function kv(e,t,r,i,n,a,s,o){let l=[],h=r.getImage();if(h){let e=!0,t=h.getImageState();t==__||t==v_?e=!1:t==m_&&h.load(),e&&l.push(h.ready())}let A=r.getFill();A&&A.loading()&&l.push(A.ready());let u=l.length>0;return u&&Promise.all(l).then((()=>n(null))),function(e,t,r,i,n,a,s){let o=r.getGeometryFunction()(t);if(!o)return;let l=o.simplifyTransformed(i,n);if(r.getRenderer())Uv(e,l,r,t,s);else{(0,Fv[l.getType()])(e,l,r,t,s,a)}}(e,t,r,i,a,s,o),u}function Uv(e,t,r,i,n){if("GeometryCollection"!=t.getType())e.getBuilder(r.getZIndex(),"Default").drawCustom(t,i,r.getRenderer(),r.getHitDetectionRenderer(),n);else{let a=t.getGeometries();for(let t=0,s=a.length;t<s;++t)Uv(e,a[t],r,i,n)}}function Rv(e,t){return function(r,i,n,a,s){!function(e,t,r,i,n,a,s){let o=new XMLHttpRequest;o.open("GET","function"==typeof e?e(r,i,n):e,!0),"arraybuffer"==t.getType()&&(o.responseType="arraybuffer"),o.withCredentials=!1,o.onload=function(e){if(!o.status||o.status>=200&&o.status<300){let e=t.getType();try{let i;"text"==e||"json"==e?i=o.responseText:"xml"==e?i=o.responseXML||o.responseText:"arraybuffer"==e&&(i=o.response),i?a(t.readFeatures(i,{extent:r,featureProjection:n}),t.readProjection(i)):s()}catch{s()}}else s()},o.onerror=s,o.send()}(e,t,r,i,n,((e,t)=>{this.addFeatures(e),void 0!==a&&a(e)}),(()=>{this.changed(),void 0!==s&&s()}))}}function Dv(e,t){return[[-1/0,-1/0,1/0,1/0]]}function Nv(e,t,r=0,i=e.length-1,n=Qv){for(;i>r;){if(i-r>600){let a=i-r+1,s=t-r+1,o=Math.log(a),l=.5*Math.exp(2*o/3),h=.5*Math.sqrt(o*l*(a-l)/a)*(s-a/2<0?-1:1);Nv(e,t,Math.max(r,Math.floor(t-s*l/a+h)),Math.min(i,Math.floor(t+(a-s)*l/a+h)),n)}let a=e[t],s=r,o=i;for(Ov(e,r,t),n(e[i],a)>0&&Ov(e,r,i);s<o;){for(Ov(e,s,o),s++,o--;n(e[s],a)<0;)s++;for(;n(e[o],a)>0;)o--}0===n(e[r],a)?Ov(e,r,o):(o++,Ov(e,o,i)),o<=t&&(r=o+1),t<=o&&(i=o-1)}}function Ov(e,t,r){let i=e[t];e[t]=e[r],e[r]=i}function Qv(e,t){return e<t?-1:e>t?1:0}var zv=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,r=[];if(!Jv(e,t))return r;let i=this.toBBox,n=[];for(;t;){for(let a=0;a<t.children.length;a++){let s=t.children[a],o=t.leaf?i(s):s;Jv(e,o)&&(t.leaf?r.push(s):Yv(e,o)?this._all(s,r):n.push(s))}t=n.pop()}return r}collides(e){let t=this.data;if(!Jv(e,t))return!1;let r=[];for(;t;){for(let i=0;i<t.children.length;i++){let n=t.children[i],a=t.leaf?this.toBBox(n):n;if(Jv(e,a)){if(t.leaf||Yv(e,a))return!0;r.push(n)}}t=r.pop()}return!1}load(e){if(!e||!e.length)return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(this.data.children.length)if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}else this.data=t;return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=ew([]),this}remove(e,t){if(!e)return this;let r,i,n,a=this.data,s=this.toBBox(e),o=[],l=[];for(;a||o.length;){if(a||(a=o.pop(),i=o[o.length-1],r=l.pop(),n=!0),a.leaf){let r=Hv(e,a.children,t);if(-1!==r)return a.children.splice(r,1),o.push(a),this._condense(o),this}n||a.leaf||!Yv(a,s)?i?(r++,a=i.children[r],n=!1):a=null:(o.push(a),l.push(r),r=0,i=a,a=a.children[0])}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let r=[];for(;e;)e.leaf?t.push(...e.children):r.push(...e.children),e=r.pop();return t}_build(e,t,r,i){let n,a=r-t+1,s=this._maxEntries;if(a<=s)return n=ew(e.slice(t,r+1)),jv(n,this.toBBox),n;i||(i=Math.ceil(Math.log(a)/Math.log(s)),s=Math.ceil(a/Math.pow(s,i-1))),n=ew([]),n.leaf=!1,n.height=i;let o=Math.ceil(a/s),l=o*Math.ceil(Math.sqrt(s));tw(e,t,r,l,this.compareMinX);for(let a=t;a<=r;a+=l){let t=Math.min(a+l-1,r);tw(e,a,t,o,this.compareMinY);for(let r=a;r<=t;r+=o){let a=Math.min(r+o-1,t);n.children.push(this._build(e,r,a,i-1))}}return jv(n,this.toBBox),n}_chooseSubtree(e,t,r,i){for(;i.push(t),!t.leaf&&i.length-1!==r;){let r,i=1/0,n=1/0;for(let a=0;a<t.children.length;a++){let s=t.children[a],o=Zv(s),l=$v(e,s)-o;l<n?(n=l,i=o<i?o:i,r=s):l===n&&o<i&&(i=o,r=s)}t=r||t.children[0]}return t}_insert(e,t,r){let i=r?e:this.toBBox(e),n=[],a=this._chooseSubtree(i,this.data,t,n);for(a.children.push(e),Gv(a,i);t>=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(i,n,t)}_split(e,t){let r=e[t],i=r.children.length,n=this._minEntries;this._chooseSplitAxis(r,n,i);let a=this._chooseSplitIndex(r,n,i),s=ew(r.children.splice(a,r.children.length-a));s.height=r.height,s.leaf=r.leaf,jv(r,this.toBBox),jv(s,this.toBBox),t?e[t-1].children.push(s):this._splitRoot(r,s)}_splitRoot(e,t){this.data=ew([e,t]),this.data.height=e.height+1,this.data.leaf=!1,jv(this.data,this.toBBox)}_chooseSplitIndex(e,t,r){let i,n=1/0,a=1/0;for(let s=t;s<=r-t;s++){let t=Vv(e,0,s,this.toBBox),o=Vv(e,s,r,this.toBBox),l=Xv(t,o),h=Zv(t)+Zv(o);l<n?(n=l,i=s,a=h<a?h:a):l===n&&h<a&&(a=h,i=s)}return i||r-t}_chooseSplitAxis(e,t,r){let i=e.leaf?this.compareMinX:Kv,n=e.leaf?this.compareMinY:qv;this._allDistMargin(e,t,r,i)<this._allDistMargin(e,t,r,n)&&e.children.sort(i)}_allDistMargin(e,t,r,i){e.children.sort(i);let n=this.toBBox,a=Vv(e,0,t,n),s=Vv(e,r-t,r,n),o=Wv(a)+Wv(s);for(let i=t;i<r-t;i++){let t=e.children[i];Gv(a,e.leaf?n(t):t),o+=Wv(a)}for(let i=r-t-1;i>=t;i--){let t=e.children[i];Gv(s,e.leaf?n(t):t),o+=Wv(s)}return o}_adjustParentBBoxes(e,t,r){for(let i=r;i>=0;i--)Gv(t[i],e)}_condense(e){for(let t,r=e.length-1;r>=0;r--)0===e[r].children.length?r>0?(t=e[r-1].children,t.splice(t.indexOf(e[r]),1)):this.clear():jv(e[r],this.toBBox)}};function Hv(e,t,r){if(!r)return t.indexOf(e);for(let i=0;i<t.length;i++)if(r(e,t[i]))return i;return-1}function jv(e,t){Vv(e,0,e.children.length,t,e)}function Vv(e,t,r,i,n){n||(n=ew(null)),n.minX=1/0,n.minY=1/0,n.maxX=-1/0,n.maxY=-1/0;for(let a=t;a<r;a++){let t=e.children[a];Gv(n,e.leaf?i(t):t)}return n}function Gv(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Kv(e,t){return e.minX-t.minX}function qv(e,t){return e.minY-t.minY}function Zv(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function Wv(e){return e.maxX-e.minX+(e.maxY-e.minY)}function $v(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Xv(e,t){let r=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),n=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,n-r)*Math.max(0,a-i)}function Yv(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function Jv(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function ew(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function tw(e,t,r,i,n){let a=[t,r];for(;a.length;){if((r=a.pop())-(t=a.pop())<=i)continue;let s=t+Math.ceil((r-t)/i/2)*i;Nv(e,s,t,r,n),a.push(t,s,s,r)}}var rw=class{constructor(e){this.rbush_=new zv(e),this.items_={}}insert(e,t){let r={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(r),this.items_[Hd(t)]=r}load(e,t){let r=new Array(t.length);for(let i=0,n=t.length;i<n;i++){let n=e[i],a=t[i],s={minX:n[0],minY:n[1],maxX:n[2],maxY:n[3],value:a};r[i]=s,this.items_[Hd(a)]=s}this.rbush_.load(r)}remove(e){let t=Hd(e),r=this.items_[t];return delete this.items_[t],null!==this.rbush_.remove(r)}update(e,t){let r=this.items_[Hd(t)];xd([r.minX,r.minY,r.maxX,r.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map((function(e){return e.value}))}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map((function(e){return e.value}))}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let r;for(let i=0,n=e.length;i<n;i++)if(r=t(e[i]),r)return r;return r}isEmpty(){return Ap(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return _d(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}};function iw(e){return e?"function"==typeof e?e:(Array.isArray(e)||(e=[e]),t=>e):null}var nw=class extends vp{constructor(e){super(),this.projection=Df(e.projection),this.attributions_=iw(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==e.state?e.state:"ready",this.wrapX_=void 0!==e.wrapX&&e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise((function(e,r){t.viewResolver=e,t.viewRejector=r}))}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=iw(e),this.changed()}setState(e){this.state_=e,this.changed()}},aw="addfeature",sw="changefeature",ow="clear",lw="removefeature",hw="featuresloadstart",Aw="featuresloadend",uw="featuresloaderror",cw=class extends up{constructor(e,t,r){super(e),this.feature=t,this.features=r}},dw=class extends nw{constructor(e){super({attributions:(e=e||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===e.wrapX||e.wrapX}),this.on,this.once,this.un,this.loader_=op,this.format_=e.format||null,this.overlaps_=void 0===e.overlaps||e.overlaps,this.url_=e.url,void 0!==e.loader?this.loader_=e.loader:void 0!==this.url_&&(rg(this.format_,"`format` must be set when `url` is set"),this.loader_=Rv(this.url_,this.format_)),this.strategy_=void 0!==e.strategy?e.strategy:Dv;let t,r,i=void 0===e.useSpatialIndex||e.useSpatialIndex;this.featuresRtree_=i?new rw:null,this.loadedExtentsRtree_=new rw,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(e.features)?r=e.features:e.features&&(t=e.features,r=t.getArray()),!i&&void 0===t&&(t=new $y(r)),void 0!==r&&this.addFeaturesInternal(r),void 0!==t&&this.bindFeaturesCollection_(t)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=Hd(e);if(!this.addToIndex_(t,e))return void(this.featuresCollection_&&this.featuresCollection_.remove(e));this.setupChangeEvents_(t,e);let r=e.getGeometry();if(r){let t=r.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new cw(aw,e))}setupChangeEvents_(e,t){t instanceof ym||(this.featureChangeKeys_[e]=[dp(t,Vd,this.handleFeatureChange_,this),dp(t,jd,this.handleFeatureChange_,this)])}addToIndex_(e,t){let r=!0;if(void 0!==t.getId()){let e=String(t.getId());if(e in this.idIndex_)if(t instanceof ym){let i=this.idIndex_[e];i instanceof ym?Array.isArray(i)?i.push(t):this.idIndex_[e]=[i,t]:r=!1}else r=!1;else this.idIndex_[e]=t}return r&&(rg(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),r}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],r=[],i=[];for(let t=0,i=e.length;t<i;t++){let i=e[t],n=Hd(i);this.addToIndex_(n,i)&&r.push(i)}for(let e=0,n=r.length;e<n;e++){let n=r[e],a=Hd(n);this.setupChangeEvents_(a,n);let s=n.getGeometry();if(s){let e=s.getExtent();t.push(e),i.push(n)}else this.nullGeometryFeatures_[a]=n}if(this.featuresRtree_&&this.featuresRtree_.load(t,i),this.hasListener(aw))for(let e=0,t=r.length;e<t;e++)this.dispatchEvent(new cw(aw,r[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(aw,(function(r){t||(t=!0,e.push(r.feature),t=!1)})),this.addEventListener(lw,(function(r){t||(t=!0,e.remove(r.feature),t=!1)})),e.addEventListener(Ky,(e=>{t||(t=!0,this.addFeature(e.element),t=!1)})),e.addEventListener(qy,(e=>{t||(t=!0,this.removeFeature(e.element),t=!1)})),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(fp);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach((e=>{this.removeFeatureInternal(e)}));for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new cw(ow);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){let r=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(r,(function(r){let i=r.getGeometry();if(i instanceof ym||i.intersectsCoordinate(e))return t(r)}))}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,(function(r){let i=r.getGeometry();if(i instanceof ym||i.intersectsExtent(e)){let e=t(r);if(e)return e}}))}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Ap(this.nullGeometryFeatures_)||ip(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,(function(e){t.push(e)})),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let r=function(e,t,r){if(t.canWrapX()){let i=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[i[0],e[1],i[2],e[3]]];Od(e,t);let n=Rd(i);if(Rd(e)>n&&!r)return[[i[0],e[1],i[2],e[3]]];if(e[0]<i[0])return[[e[0]+n,e[1],i[2],e[3]],[i[0],e[1],e[2],e[3]]];if(e[2]>i[2])return[[e[0],e[1],i[2],e[3]],[i[0],e[1],e[2]-n,e[3]]]}return[e]}(e,t);return[].concat(...r.map((e=>this.featuresRtree_.getInExtent(e))))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let r=e[0],i=e[1],n=null,a=[NaN,NaN],s=1/0,o=[-1/0,-1/0,1/0,1/0];return t=t||ap,this.featuresRtree_.forEachInExtent(o,(function(e){if(t(e)){let t=e.getGeometry(),l=s;if(s=t instanceof ym?0:t.closestPointXY(r,i,a,s),s<l){n=e;let t=Math.sqrt(s);o[0]=r-t,o[1]=i-t,o[2]=r+t,o[3]=i+t}}})),n}getExtent(e){return this.featuresRtree_.getExtent(e)}getFeatureById(e){let t=this.idIndex_[e.toString()];return void 0!==t?t:null}getFeatureByUid(e){let t=this.uidIndex_[e];return void 0!==t?t:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,r=Hd(t),i=t.getGeometry();if(i){let e=i.getExtent();r in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[r],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}else r in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[r]=t);let n=t.getId();if(void 0!==n){let e=n.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[r]=t;this.changed(),this.dispatchEvent(new cw(sw,t))}hasFeature(e){let t=e.getId();return void 0!==t?t in this.idIndex_:Hd(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Ap(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()}loadFeatures(e,t,r){let i=this.loadedExtentsRtree_,n=this.strategy_(e,t,r);for(let e=0,a=n.length;e<a;++e){let a=n[e];i.forEachInExtent(a,(function(e){return gd(e.extent,a)}))||(++this.loadingExtentsCount_,this.dispatchEvent(new cw(hw)),this.loader_.call(this,a,t,r,(e=>{--this.loadingExtentsCount_,this.dispatchEvent(new cw(Aw,void 0,e))}),(()=>{--this.loadingExtentsCount_,this.dispatchEvent(new cw(uw))})),i.insert(a,{extent:a.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,r=t.forEachInExtent(e,(function(t){if(xd(t.extent,e))return t}));r&&t.remove(r)}removeFeatures(e){let t=!1;for(let r=0,i=e.length;r<i;++r)t=this.removeFeatureInternal(e[r])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=Hd(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e),this.featureChangeKeys_[t]?.forEach(fp),delete this.featureChangeKeys_[t];let r=e.getId();if(void 0!==r){let t=r.toString(),i=this.idIndex_[t];i===e?delete this.idIndex_[t]:Array.isArray(i)&&(i.splice(i.indexOf(e),1),1===i.length&&(this.idIndex_[t]=i[0]))}return delete this.uidIndex_[t],this.hasListener(lw)&&this.dispatchEvent(new cw(lw,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){rg(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(Rv(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},pw=class e{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,void 0!==e.color&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(null!==e&&"object"==typeof e&&"src"in e){let t=$_(null,e.src,"anonymous",void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then((()=>{this.patternImage_=null})),t.getImageState()===m_&&t.load(),t.getImageState()===y_&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?Hd(e):"object"==typeof e&&"src"in e?e.src+":"+e.offset:j_(e).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}},fw=class e{constructor(e){e=e||{},this.color_=void 0!==e.color?e.color:null,this.lineCap_=e.lineCap,this.lineDash_=void 0!==e.lineDash?e.lineDash:null,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setWidth(e){this.width_=e}};function gw(e){return e[0]>0&&e[1]>0}function mw(e,t){return Array.isArray(e)?e:(void 0===t?t=[e,e]:(t[0]=e,t[1]=e),t)}var yw=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=mw(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return Qd()}getImage(e){return Qd()}getHitDetectionImage(){return Qd()}getPixelRatio(e){return 1}getImageState(){return Qd()}getImageSize(){return Qd()}getOrigin(){return Qd()}getSize(){return Qd()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mw(e)}listenImageChange(e){Qd()}load(){Qd()}unlistenImageChange(e){Qd()}ready(){return Promise.resolve()}},_w=class e extends yw{constructor(e){super({opacity:1,rotateWithView:void 0!==e.rotateWithView&&e.rotateWithView,rotation:void 0!==e.rotation?e.rotation:0,scale:void 0!==e.scale?e.scale:1,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=void 0!==e.fill?e.fill:null,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=void 0!==e.angle?e.angle:0,this.stroke_=void 0!==e.stroke?e.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?y_:__,this.imageState_===y_&&this.ready().then((()=>this.imageState_=__)),this.render()}clone(){let t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r}getAnchor(){let e=this.size_,t=this.getDisplacement(),r=this.getScaleArray();return[e[0]/2-t[0]/r[0],e[1]/2+t[1]/r[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){let t=this.fill_?.getKey(),r=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${t}`+Object.values(this.renderOptions_).join(","),i=q_.get(r,null,null)?.getImage(1);if(!i){let t=this.renderOptions_,n=Math.ceil(t.size*e),a=w_(n,n);this.draw_(t,a,e),i=a.canvas,q_.set(r,null,null,new X_(i,void 0,null,__,null))}return i}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,r){if(0===t||this.points_===1/0||"bevel"!==e&&"miter"!==e)return t;let i=this.radius,n=void 0===this.radius2_?i:this.radius2_;if(i<n){let e=i;i=n,n=e}let a=void 0===this.radius2_?this.points_:2*this.points_,s=2*Math.PI/a,o=n*Math.sin(s),l=i-Math.sqrt(n*n-o*o),h=Math.sqrt(o*o+l*l),A=h/o;if("miter"===e&&A<=r)return A*t;let u=t/2/A,c=t/2*(l/h),d=Math.sqrt((i+u)*(i+u)+c*c)-i;if(void 0===this.radius2_||"bevel"===e)return 2*d;let p=i*Math.sin(s),f=n-Math.sqrt(i*i-p*p),g=Math.sqrt(p*p+f*f)/p;if(g<=r){let e=g*t/2-n-i;return 2*Math.max(d,e)}return 2*d}createRenderOptions(){let e,t=uv,r=dv,i=0,n=null,a=0,s=0;this.stroke_&&(e=Y_(this.stroke_.getColor()??pv),s=this.stroke_.getWidth()??1,n=this.stroke_.getLineDash(),a=this.stroke_.getLineDashOffset()??0,r=this.stroke_.getLineJoin()??dv,t=this.stroke_.getLineCap()??uv,i=this.stroke_.getMiterLimit()??10);let o=this.calculateLineJoinSize_(r,s,i),l=Math.max(this.radius,this.radius2_||0);return{strokeStyle:e,strokeWidth:s,size:Math.ceil(2*l+o),lineCap:t,lineDash:n,lineDashOffset:a,lineJoin:r,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,r){if(t.scale(r,r),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();null===e&&(e=Av),t.fillStyle=Y_(e),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let r=this.fill_.getColor(),i=0;"string"==typeof r&&(r=j_(r)),null===r?i=1:Array.isArray(r)&&(i=4===r.length?r[3]:1),0===i&&(t=w_(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,r=this.radius;if(t===1/0)e.arc(0,0,r,0,2*Math.PI);else{let i=void 0===this.radius2_?r:this.radius2_;void 0!==this.radius2_&&(t*=2);let n=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let s=0;s<t;s++){let t=n+s*a,o=s%2==0?r:i;e.lineTo(o*Math.cos(t),o*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Av,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}},vw=class e extends _w{constructor(e){super({points:1/0,fill:(e=e||{radius:5}).fill,radius:e.radius,stroke:e.stroke,scale:void 0!==e.scale?e.scale:1,rotation:void 0!==e.rotation?e.rotation:0,rotateWithView:void 0!==e.rotateWithView&&e.rotateWithView,displacement:void 0!==e.displacement?e.displacement:[0,0],declutterMode:e.declutterMode})}clone(){let t=this.getScale(),r=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return r.setOpacity(this.getOpacity()),r}setRadius(e){this.radius=e,this.render()}},ww=class e{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=Bw,void 0!==e.geometry&&this.setGeometry(e.geometry),this.fill_=void 0!==e.fill?e.fill:null,this.image_=void 0!==e.image?e.image:null,this.renderer_=void 0!==e.renderer?e.renderer:null,this.hitDetectionRenderer_=void 0!==e.hitDetectionRenderer?e.hitDetectionRenderer:null,this.stroke_=void 0!==e.stroke?e.stroke:null,this.text_=void 0!==e.text?e.text:null,this.zIndex_=e.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new e({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){"function"==typeof e?this.geometryFunction_=e:"string"==typeof e?this.geometryFunction_=function(t){return t.get(e)}:e?void 0!==e&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=Bw,this.geometry_=e}setZIndex(e){this.zIndex_=e}};var bw=null;function xw(e,t){if(!bw){let e=new pw({color:"rgba(255,255,255,0.4)"}),t=new fw({color:"#3399CC",width:1.25});bw=[new ww({image:new vw({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return bw}function Bw(e){return e.getGeometry()}var Cw=ww,Sw=class e{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=mw(void 0!==e.scale?e.scale:1),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=void 0!==e.fill?e.fill:new pw({color:"#333"}),this.maxAngle_=void 0!==e.maxAngle?e.maxAngle:Math.PI/4,this.placement_=void 0!==e.placement?e.placement:"point",this.overflow_=!!e.overflow,this.stroke_=void 0!==e.stroke?e.stroke:null,this.offsetX_=void 0!==e.offsetX?e.offsetX:0,this.offsetY_=void 0!==e.offsetY?e.offsetY:0,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=void 0===e.padding?null:e.padding,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=mw(void 0!==e?e:1)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}},Ew={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},Iw=[Ew.FILL],Tw=[Ew.STROKE],Fw=[Ew.BEGIN_PATH],Pw=[Ew.CLOSE_PATH],Lw=Ew,Mw=class extends ev{constructor(e,t,r,i){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=i,this.maxLineWidth=0,this.resolution=r,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return 1==t?e:e.map((function(e){return e*t}))}appendFlatPointCoordinates(e,t){let r=this.getBufferedMaxExtent(),i=this.tmpCoordinate_,n=this.coordinates,a=n.length;for(let s=0,o=e.length;s<o;s+=t)i[0]=e[s],i[1]=e[s+1],fd(r,i)&&(n[a++]=i[0],n[a++]=i[1]);return a}appendFlatLineCoordinates(e,t,r,i,n,a){let s=this.coordinates,o=s.length,l=this.getBufferedMaxExtent();a&&(t+=i);let h,A,u,c=e[t],d=e[t+1],p=this.tmpCoordinate_,f=!0;for(h=t+i;h<r;h+=i)p[0]=e[h],p[1]=e[h+1],u=yd(l,p),u!==A?(f&&(s[o++]=c,s[o++]=d,f=!1),s[o++]=p[0],s[o++]=p[1]):u===od?(s[o++]=p[0],s[o++]=p[1],f=!1):f=!0,c=p[0],d=p[1],A=u;return(n&&f||h===t+i)&&(s[o++]=c,s[o++]=d),o}drawCustomCoordinates_(e,t,r,i,n){for(let a=0,s=r.length;a<s;++a){let s=r[a],o=this.appendFlatLineCoordinates(e,t,s,i,!1,!1);n.push(o),t=s}return t}drawCustom(e,t,r,i,n){this.beginGeometry(e,t,n);let a,s,o,l,h,A=e.getType(),u=e.getStride(),c=this.coordinates.length;switch(A){case"MultiPolygon":a=e.getOrientedFlatCoordinates(),l=[];let t=e.getEndss();h=0;for(let e=0,r=t.length;e<r;++e){let r=[];h=this.drawCustomCoordinates_(a,h,t[e],u,r),l.push(r)}this.instructions.push([Lw.CUSTOM,c,l,e,r,kg,n]),this.hitDetectionInstructions.push([Lw.CUSTOM,c,l,e,i||r,kg,n]);break;case"Polygon":case"MultiLineString":o=[],a="Polygon"==A?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),h=this.drawCustomCoordinates_(a,0,e.getEnds(),u,o),this.instructions.push([Lw.CUSTOM,c,o,e,r,Mg,n]),this.hitDetectionInstructions.push([Lw.CUSTOM,c,o,e,i||r,Mg,n]);break;case"LineString":case"Circle":a=e.getFlatCoordinates(),s=this.appendFlatLineCoordinates(a,0,a.length,u,!1,!1),this.instructions.push([Lw.CUSTOM,c,s,e,r,Lg,n]),this.hitDetectionInstructions.push([Lw.CUSTOM,c,s,e,i||r,Lg,n]);break;case"MultiPoint":a=e.getFlatCoordinates(),s=this.appendFlatPointCoordinates(a,u),s>c&&(this.instructions.push([Lw.CUSTOM,c,s,e,r,Lg,n]),this.hitDetectionInstructions.push([Lw.CUSTOM,c,s,e,i||r,Lg,n]));break;case"Point":a=e.getFlatCoordinates(),this.coordinates.push(a[0],a[1]),s=this.coordinates.length,this.instructions.push([Lw.CUSTOM,c,s,e,r,void 0,n]),this.hitDetectionInstructions.push([Lw.CUSTOM,c,s,e,i||r,void 0,n])}this.endGeometry(t)}beginGeometry(e,t,r){this.beginGeometryInstruction1_=[Lw.BEGIN_GEOMETRY,t,0,e,r],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[Lw.BEGIN_GEOMETRY,t,0,e,r],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,r,i,n=e.length,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==Lw.END_GEOMETRY?a=t:i==Lw.BEGIN_GEOMETRY&&(r[2]=t,rp(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){let r=e.getColor();t.fillPatternScale=r&&"object"==typeof r&&"src"in r?this.pixelRatio:1,t.fillStyle=Y_(r||Av)}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){let r=e.getColor();t.strokeStyle=Y_(r||pv);let i=e.getLineCap();t.lineCap=void 0!==i?i:uv;let n=e.getLineDash();t.lineDash=n?n.slice():cv;let a=e.getLineDashOffset();t.lineDashOffset=a||0;let s=e.getLineJoin();t.lineJoin=void 0!==s?s:dv;let o=e.getWidth();t.lineWidth=void 0!==o?o:1;let l=e.getMiterLimit();t.miterLimit=void 0!==l?l:10,t.lineWidth>this.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0;return t}setFillStrokeStyle(e,t){let r=this.state;this.fillStyleToState(e,r),this.strokeStyleToState(t,r)}createFill(e){let t=e.fillStyle,r=[Lw.SET_FILL_STYLE,t];return"string"!=typeof t&&r.push(e.fillPatternScale),r}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[Lw.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){let r=e.fillStyle;("string"!=typeof r||e.currentFillStyle!=r)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=r)}updateStrokeStyle(e,t){let r=e.strokeStyle,i=e.lineCap,n=e.lineDash,a=e.lineDashOffset,s=e.lineJoin,o=e.lineWidth,l=e.miterLimit;(e.currentStrokeStyle!=r||e.currentLineCap!=i||n!=e.currentLineDash&&!np(e.currentLineDash,n)||e.currentLineDashOffset!=a||e.currentLineJoin!=s||e.currentLineWidth!=o||e.currentMiterLimit!=l)&&(t.call(this,e),e.currentStrokeStyle=r,e.currentLineCap=i,e.currentLineDash=n,e.currentLineDashOffset=a,e.currentLineJoin=s,e.currentLineWidth=o,e.currentMiterLimit=l)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[Lw.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=dd(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;cd(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},kw=class extends Mw{constructor(e,t,r,i){super(e,t,r,i),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,r){if(!this.image_||this.maxExtent&&!fd(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,r);let i=e.getFlatCoordinates(),n=e.getStride(),a=this.coordinates.length,s=this.appendFlatPointCoordinates(i,n);this.instructions.push([Lw.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Lw.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,r){if(!this.image_)return;this.beginGeometry(e,t,r);let i=e.getFlatCoordinates(),n=[];for(let t=0,r=i.length;t<r;t+=e.getStride())(!this.maxExtent||fd(this.maxExtent,i.slice(t,t+2)))&&n.push(i[t],i[t+1]);let a=this.coordinates.length,s=this.appendFlatPointCoordinates(n,2);this.instructions.push([Lw.DRAW_IMAGE,a,s,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([Lw.DRAW_IMAGE,a,s,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){let r=e.getAnchor(),i=e.getSize(),n=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=r[0],this.anchorY_=r[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=i[1],this.opacity_=e.getOpacity(),this.originX_=n[0],this.originY_=n[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=i[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},Uw=class extends Mw{constructor(e,t,r,i){super(e,t,r,i)}drawFlatCoordinates_(e,t,r,i){let n=this.coordinates.length,a=this.appendFlatLineCoordinates(e,t,r,i,!1,!1),s=[Lw.MOVE_TO_LINE_TO,n,a];return this.instructions.push(s),this.hitDetectionInstructions.push(s),r}drawLineString(e,t,r){let i=this.state,n=i.strokeStyle,a=i.lineWidth;if(void 0===n||void 0===a)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t,r),this.hitDetectionInstructions.push([Lw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,cv,0],Fw);let s=e.getFlatCoordinates(),o=e.getStride();this.drawFlatCoordinates_(s,0,s.length,o),this.hitDetectionInstructions.push(Tw),this.endGeometry(t)}drawMultiLineString(e,t,r){let i=this.state,n=i.strokeStyle,a=i.lineWidth;if(void 0===n||void 0===a)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(e,t,r),this.hitDetectionInstructions.push([Lw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,cv,0],Fw);let s=e.getEnds(),o=e.getFlatCoordinates(),l=e.getStride(),h=0;for(let e=0,t=s.length;e<t;++e)h=this.drawFlatCoordinates_(o,h,s[e],l);this.hitDetectionInstructions.push(Tw),this.endGeometry(t)}finish(){let e=this.state;return null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Tw),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){null!=e.lastStroke&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Tw),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(Fw)}},Rw=class extends Mw{constructor(e,t,r,i){super(e,t,r,i)}drawFlatCoordinatess_(e,t,r,i){let n=this.state,a=void 0!==n.fillStyle,s=void 0!==n.strokeStyle,o=r.length;this.instructions.push(Fw),this.hitDetectionInstructions.push(Fw);for(let n=0;n<o;++n){let a=r[n],o=this.coordinates.length,l=this.appendFlatLineCoordinates(e,t,a,i,!0,!s),h=[Lw.MOVE_TO_LINE_TO,o,l];this.instructions.push(h),this.hitDetectionInstructions.push(h),s&&(this.instructions.push(Pw),this.hitDetectionInstructions.push(Pw)),t=a}return a&&(this.instructions.push(Iw),this.hitDetectionInstructions.push(Iw)),s&&(this.instructions.push(Tw),this.hitDetectionInstructions.push(Tw)),t}drawCircle(e,t,r){let i=this.state,n=i.fillStyle,a=i.strokeStyle;if(void 0===n&&void 0===a)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,r),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Lw.SET_FILL_STYLE,Av]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,cv,0]);let s=e.getFlatCoordinates(),o=e.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,o,!1,!1);let h=[Lw.CIRCLE,l];this.instructions.push(Fw,h),this.hitDetectionInstructions.push(Fw,h),void 0!==i.fillStyle&&(this.instructions.push(Iw),this.hitDetectionInstructions.push(Iw)),void 0!==i.strokeStyle&&(this.instructions.push(Tw),this.hitDetectionInstructions.push(Tw)),this.endGeometry(t)}drawPolygon(e,t,r){let i=this.state,n=i.fillStyle,a=i.strokeStyle;if(void 0===n&&void 0===a)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,r),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Lw.SET_FILL_STYLE,Av]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,cv,0]);let s=e.getEnds(),o=e.getOrientedFlatCoordinates(),l=e.getStride();this.drawFlatCoordinatess_(o,0,s,l),this.endGeometry(t)}drawMultiPolygon(e,t,r){let i=this.state,n=i.fillStyle,a=i.strokeStyle;if(void 0===n&&void 0===a)return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,r),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([Lw.SET_FILL_STYLE,Av]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([Lw.SET_STROKE_STYLE,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,cv,0]);let s=e.getEndss(),o=e.getOrientedFlatCoordinates(),l=e.getStride(),h=0;for(let e=0,t=s.length;e<t;++e)h=this.drawFlatCoordinatess_(o,h,s[e],l);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(0!==e){let t=this.coordinates;for(let r=0,i=t.length;r<i;++r)t[r]=Dg(t[r],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}};function Dw(e,t,r,i,n){let a=[],s=r,o=0,l=t.slice(r,2);for(;o<e&&s+n<i;){let[r,i]=l.slice(-2),h=t[s+n],A=t[s+n+1],u=Math.sqrt((h-r)*(h-r)+(A-i)*(A-i));if(o+=u,o>=e){let t=(e-o+u)/u,c=Fp(r,h,t),d=Fp(i,A,t);l.push(c,d),a.push(l),l=[c,d],o==e&&(s+=n),o=0}else if(o<e)l.push(t[s+n],t[s+n+1]),s+=n;else{let e=u-o,t=Fp(r,h,e/u),c=Fp(i,A,e/u);l.push(t,c),a.push(l),l=[t,c],o=0,s+=n}}return o>0&&a.push(l),a}function Nw(e,t,r,i,n){let a,s,o,l,h,A,u,c,d,p,f=r,g=r,m=0,y=0,_=r;for(s=r;s<i;s+=n){let r=t[s],i=t[s+1];void 0!==h&&(d=r-h,p=i-A,l=Math.sqrt(d*d+p*p),void 0!==u&&(y+=o,a=Math.acos((u*d+c*p)/(o*l)),a>e&&(y>m&&(m=y,f=_,g=s),y=0,_=s-n)),o=l,u=d,c=p),h=r,A=i}return y+=l,y>m?[_,s]:[f,g]}var Ow={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},Qw=class extends Mw{constructor(e,t,r,i){super(e,t,r,i),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Av]={fillStyle:Av},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,r){let i=this.textFillState_,n=this.textStrokeState_,a=this.textState_;if(""===this.text_||!a||!i&&!n)return;let s=this.coordinates,o=s.length,l=e.getType(),h=null,A=e.getStride();if("line"!==a.placement||"LineString"!=l&&"MultiLineString"!=l&&"Polygon"!=l&&"MultiPolygon"!=l){let i=a.overflow?null:[];switch(l){case"Point":case"MultiPoint":h=e.getFlatCoordinates();break;case"LineString":h=e.getFlatMidpoint();break;case"Circle":h=e.getCenter();break;case"MultiLineString":h=e.getFlatMidpoints(),A=2;break;case"Polygon":h=e.getFlatInteriorPoint(),a.overflow||i.push(h[2]/this.resolution),A=3;break;case"MultiPolygon":let t=e.getFlatInteriorPoints();h=[];for(let e=0,r=t.length;e<r;e+=3)a.overflow||i.push(t[e+2]/this.resolution),h.push(t[e],t[e+1]);if(0===h.length)return;A=2}let n=this.appendFlatPointCoordinates(h,A);if(n===o)return;if(i&&(n-o)/2!=h.length/A){let e=o/2;i=i.filter(((t,r)=>{let i=s[2*(e+r)]===h[r*A]&&s[2*(e+r)+1]===h[r*A+1];return i||--e,i}))}this.saveTextStates_();let u=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,c=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,r);let d=a.padding;if(d!=mv&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],r=a.padding[2],i=a.padding[3];a.scale[0]<0&&(t=-t,i=-i),a.scale[1]<0&&(e=-e,r=-r),d=[e,t,r,i]}let p=this.pixelRatio;this.instructions.push([Lw.DRAW_IMAGE,o,n,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,d==mv?mv:d.map((function(e){return e*p})),u,c,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]);let f=1/p,g=u?u.slice(0):null;g&&(g[1]=Av),this.hitDetectionInstructions.push([Lw.DRAW_IMAGE,o,n,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[f,f],NaN,this.declutterMode_,this.declutterImageWithText_,d,g,c,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Av:this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]),this.endGeometry(t)}else{if(!Dd(this.maxExtent,e.getExtent()))return;let i;if(h=e.getFlatCoordinates(),"LineString"==l)i=[h.length];else if("MultiLineString"==l)i=e.getEnds();else if("Polygon"==l)i=e.getEnds().slice(0,1);else if("MultiPolygon"==l){let t=e.getEndss();i=[];for(let e=0,r=t.length;e<r;++e)i.push(t[e][0])}this.beginGeometry(e,t,r);let n=a.repeat,u=n?void 0:a.textAlign,c=0;for(let e=0,t=i.length;e<t;++e){let t;t=n?Dw(n*this.resolution,h,c,i[e],A):[h.slice(c,i[e])];for(let r=0,n=t.length;r<n;++r){let n=t[r],l=0,h=n.length;if(null==u){let e=Nw(a.maxAngle,n,0,n.length,2);l=e[0],h=e[1]}for(let e=l;e<h;e+=A)s.push(n[e],n[e+1]);let d=s.length;c=i[e],this.drawChars_(o,d),o=d}}this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,r=this.textFillState_,i=this.strokeKey_;e&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));let n=this.textKey_;n in this.textStates||(this.textStates[n]={font:t.font,textAlign:t.textAlign||fv,justify:t.justify,textBaseline:t.textBaseline||gv,scale:t.scale});let a=this.fillKey_;r&&(a in this.fillStates||(this.fillStates[a]={fillStyle:r.fillStyle}))}drawChars_(e,t){let r=this.textStrokeState_,i=this.textState_,n=this.strokeKey_,a=this.textKey_,s=this.fillKey_;this.saveTextStates_();let o=this.pixelRatio,l=Ow[i.textBaseline],h=this.textOffsetY_*o,A=this.text_,u=r?r.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([Lw.DRAW_CHARS,e,t,l,i.overflow,s,i.maxAngle,o,h,n,u*o,A,a,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([Lw.DRAW_CHARS,e,t,l,i.overflow,s&&Av,i.maxAngle,o,h,n,u*o,A,a,1/o,this.declutterMode_,this.textKeepUpright_])}setTextStyle(e,t){let r,i,n;if(e){let t=e.getFill();t?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=Y_(t.getColor()||Av)):(i=null,this.textFillState_=i);let a=e.getStroke();if(a){n=this.textStrokeState_,n||(n={},this.textStrokeState_=n);let e=a.getLineDash(),t=a.getLineDashOffset(),r=a.getWidth(),i=a.getMiterLimit();n.lineCap=a.getLineCap()||uv,n.lineDash=e?e.slice():cv,n.lineDashOffset=void 0===t?0:t,n.lineJoin=a.getLineJoin()||dv,n.lineWidth=void 0===r?1:r,n.miterLimit=void 0===i?10:i,n.strokeStyle=Y_(a.getColor()||pv)}else n=null,this.textStrokeState_=n;r=this.textState_;let s=e.getFont()||hv;xv(s);let o=e.getScaleArray();r.overflow=e.getOverflow(),r.font=s,r.maxAngle=e.getMaxAngle(),r.placement=e.getPlacement(),r.textAlign=e.getTextAlign(),r.repeat=e.getRepeat(),r.justify=e.getJustify(),r.textBaseline=e.getTextBaseline()||gv,r.backgroundFill=e.getBackgroundFill(),r.backgroundStroke=e.getBackgroundStroke(),r.padding=e.getPadding()||mv,r.scale=void 0===o?[1,1]:o;let l=e.getOffsetX(),h=e.getOffsetY(),A=e.getRotateWithView(),u=e.getKeepUpright(),c=e.getRotation();this.text_=e.getText()||"",this.textOffsetX_=void 0===l?0:l,this.textOffsetY_=void 0===h?0:h,this.textRotateWithView_=void 0!==A&&A,this.textKeepUpright_=void 0===u||u,this.textRotation_=void 0===c?0:c,this.strokeKey_=n?("string"==typeof n.strokeStyle?n.strokeStyle:Hd(n.strokeStyle))+n.lineCap+n.lineDashOffset+"|"+n.lineWidth+n.lineJoin+n.miterLimit+"["+n.lineDash.join()+"]":"",this.textKey_=r.font+r.scale+(r.textAlign||"?")+(r.repeat||"?")+(r.justify||"?")+(r.textBaseline||"?"),this.fillKey_=i&&i.fillStyle?"string"==typeof i.fillStyle?i.fillStyle:"|"+Hd(i.fillStyle):""}else this.text_="";this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},zw={Circle:Rw,Default:Mw,Image:kw,LineString:Uw,Polygon:Rw,Text:Qw},Hw=class{constructor(e,t,r,i){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=i,this.resolution_=r,this.buildersByZIndex_={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let r=this.buildersByZIndex_[t];for(let i in r){let n=r[i].finish();e[t][i]=n}}return e}getBuilder(e,t){let r=void 0!==e?e.toString():"0",i=this.buildersByZIndex_[r];void 0===i&&(i={},this.buildersByZIndex_[r]=i);let n=i[t];if(void 0===n){n=new(0,zw[t])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[t]=n}return n}};function jw(e,t,r,i,n,a,s,o,l,h,A,u,c=!0){let d=e[t],p=e[t+1],f=0,g=0,m=0,y=0;function _(){f=d,g=p,d=e[t+=i],p=e[t+1],y+=m,m=Math.sqrt((d-f)*(d-f)+(p-g)*(p-g))}do{_()}while(t<r-i&&y+m<a);let v=0===m?0:(a-y)/m,w=Fp(f,d,v),b=Fp(g,p,v),x=t-i,B=y,C=a+o*l(h,n,A);for(;t<r-i&&y+m<C;)_();v=0===m?0:(C-y)/m;let S=Fp(f,d,v),E=Fp(g,p,v),I=!1;if(c)if(u){let e=[w,b,S,E];Ag(e,0,4,2,u,e,e),I=e[0]>e[2]}else I=w>S;let T,F=Math.PI,P=[],L=x+i===t;if(m=0,y=B,d=e[t=x],p=e[t+1],L){_(),T=Math.atan2(p-g,d-f),I&&(T+=T>0?-F:F);let e=(S+w)/2,t=(E+b)/2;return P[0]=[e,t,(C-a)/2,T,n],P}for(let e=0,u=(n=n.replace(/\n/g," ")).length;e<u;){_();let c=Math.atan2(p-g,d-f);if(I&&(c+=c>0?-F:F),void 0!==T){let e=c-T;if(e+=e>F?-2*F:e<-F?2*F:0,Math.abs(e)>s)return null}T=c;let w=e,b=0;for(;e<u;++e){let s=o*l(h,n[I?u-e-1:e],A);if(t+i<r&&y+m<a+b+s/2)break;b+=s}if(e===w)continue;let x=I?n.substring(u-w,u-e):n.substring(w,e);v=0===m?0:(a+b/2-y)/m;let B=Fp(f,d,v),C=Fp(g,p,v);P.push([B,C,b/2,c,x]),a+=b}return P}var Vw=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(b_(),{get:(e,t)=>{if("function"==typeof b_()[t])return this.push_(t),this.pushMethodArgs_},set:(e,t,r)=>(this.push_(t,r),!0)})}push_(...e){let t=this.instructions_,r=this.zIndex+this.offset_;t[r]||(t[r]=[]),t[r].push(...e)}pushMethodArgs_=(...e)=>(this.push_(e),this);pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach((t=>{for(let r=0,i=t.length;r<i;++r){let i=t[r];if("function"==typeof i){i(e);continue}let n=t[++r];if("function"==typeof e[i])e[i](...n);else{if("function"==typeof n){e[i]=n(e);continue}e[i]=n}}}))}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},Gw=[1/0,1/0,-1/0,-1/0],Kw=[],qw=[],Zw=[],Ww=[];function $w(e){return e[3].declutterBox}var Xw=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ-࿿-]");function Yw(e,t){return"start"===t?t=Xw.test(e)?"right":"left":"end"===t&&(t=Xw.test(e)?"left":"right"),Ow[t]}function Jw(e,t,r){return r>0&&e.push("\n",""),e.push(t,""),e}function eb(e,t,r){return r%2==0&&(e+=t),e}var tb=class{constructor(e,t,r,i,n){this.overlaps=r,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=n?new Vw:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,r,i){let n=e+t+r+i;if(this.labels_[n])return this.labels_[n];let a=i?this.strokeStates[i]:null,s=r?this.fillStates[r]:null,o=this.textStates[t],l=this.pixelRatio,h=[o.scale[0]*l,o.scale[1]*l],A=o.justify?Ow[o.justify]:Yw(Array.isArray(e)?e[0]:e,o.textAlign||fv),u=i&&a.lineWidth?a.lineWidth:0,c=Array.isArray(e)?e:String(e).split("\n").reduce(Jw,[]),{width:d,height:p,widths:f,heights:g,lineWidths:m}=function(e,t){let r=[],i=[],n=[],a=0,s=0,o=0,l=0;for(let h=0,A=t.length;h<=A;h+=2){let u=t[h];if("\n"===u||h===A){a=Math.max(a,s),n.push(s),s=0,o+=l,l=0;continue}let c=t[h+1]||e.font,d=Sv(c,u);r.push(d),s+=d;let p=Bv(c);i.push(p),l=Math.max(l,p)}return{width:a,height:o,widths:r,heights:i,lineWidths:n}}(o,c),y=d+u,_=[],v=(y+2)*h[0],w=(p+u)*h[1],b={width:v<0?Math.floor(v):Math.ceil(v),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:_};(1!=h[0]||1!=h[1])&&_.push("scale",h),i&&(_.push("strokeStyle",a.strokeStyle),_.push("lineWidth",u),_.push("lineCap",a.lineCap),_.push("lineJoin",a.lineJoin),_.push("miterLimit",a.miterLimit),_.push("setLineDash",[a.lineDash]),_.push("lineDashOffset",a.lineDashOffset)),r&&_.push("fillStyle",s.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");let x,B=.5-A,C=A*y+B*u,S=[],E=[],I=0,T=0,F=0,P=0;for(let e=0,t=c.length;e<t;e+=2){let t=c[e];if("\n"===t){T+=I,I=0,C=A*y+B*u,++P;continue}let n=c[e+1]||o.font;n!==x&&(i&&S.push("font",n),r&&E.push("font",n),x=n),I=Math.max(I,g[F]);let a=[t,C+B*f[F]+A*(f[F]-m[P]),.5*(u+I)+T];C+=f[F],i&&S.push("strokeText",a),r&&E.push("fillText",a),++F}return Array.prototype.push.apply(_,S),Array.prototype.push.apply(_,E),this.labels_[n]=b,b}replayTextBackground_(e,t,r,i,n,a,s){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,n),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),s&&(this.setStrokeStyle_(e,s),e.stroke())}calculateImageOrLabelDimensions_(e,t,r,i,n,a,s,o,l,h,A,u,c,d,p,f){let g,m=r-(s*=u[0]),y=i-(o*=u[1]),_=n+l>e?e-l:n,v=a+h>t?t-h:a,w=d[3]+_*u[0]+d[1],b=d[0]+v*u[1]+d[2],x=m-d[3],B=y-d[0];return(p||0!==A)&&(Kw[0]=x,Ww[0]=x,Kw[1]=B,qw[1]=B,qw[0]=x+w,Zw[0]=qw[0],Zw[1]=B+b,Ww[1]=Zw[1]),0!==A?(g=ng([1,0,0,1,0,0],r,i,1,1,A,-r,-i),ig(g,Kw),ig(g,qw),ig(g,Zw),ig(g,Ww),_d(Math.min(Kw[0],qw[0],Zw[0],Ww[0]),Math.min(Kw[1],qw[1],Zw[1],Ww[1]),Math.max(Kw[0],qw[0],Zw[0],Ww[0]),Math.max(Kw[1],qw[1],Zw[1],Ww[1]),Gw)):_d(Math.min(x,x+w),Math.min(B,B+b),Math.max(x,x+w),Math.max(B,B+b),Gw),c&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:_,drawImageH:v,originX:l,originY:h,declutterBox:{minX:Gw[0],minY:Gw[1],maxX:Gw[2],maxY:Gw[3],value:f},canvasTransform:g,scale:u}}replayImageOrLabel_(e,t,r,i,n,a,s){let o=!(!a&&!s),l=i.declutterBox,h=s?s[2]*i.scale[0]/2:0;return l.minX-h<=t[0]&&l.maxX+h>=0&&l.minY-h<=t[1]&&l.maxY+h>=0&&(o&&this.replayTextBackground_(e,Kw,qw,Zw,Ww,a,s),Iv(e,i.canvasTransform,n,r,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let r=ig(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;e.save(),e.translate(r[0]%i,r[1]%i),1!==t&&e.scale(t,t),e.rotate(this.viewRotation_)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,r,i){let n=this.textStates[t],a=this.createLabel(e,t,i,r),s=this.strokeStates[r],o=this.pixelRatio,l=Yw(Array.isArray(e)?e[0]:e,n.textAlign||fv),h=Ow[n.textBaseline||gv],A=s&&s.lineWidth?s.lineWidth:0;return{label:a,anchorX:l*(a.width/o-2*n.scale[0])+2*(.5-l)*A,anchorY:h*a.height/o+2*(.5-h)*A}}execute_(e,t,r,i,n,a,s,o){let l,h=this.zIndexContext_;this.pixelCoordinates_&&np(r,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=hg(this.coordinates,0,this.coordinates.length,2,r,this.pixelCoordinates_),function(e,t){e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5]}(this.renderedTransform_,r));let A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E=0,I=i.length,T=0,F=0,P=0,L=this.coordinateCache_,M=this.viewRotation_,k=Math.round(1e12*Math.atan2(-r[1],r[0]))/1e12,U={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:M},R=this.instructions!=i||this.overlaps?0:200;for(;E<I;){let r=i[E];switch(r[0]){case Lw.BEGIN_GEOMETRY:x=r[1],S=r[3],x.getGeometry()?void 0===s||Dd(s,S.getExtent())?++E:E=r[2]+1:E=r[2],h&&(h.zIndex=r[4]);break;case Lw.BEGIN_PATH:F>R&&(this.fill_(e),F=0),P>R&&(e.stroke(),P=0),!F&&!P&&(e.beginPath(),p=NaN,f=NaN),++E;break;case Lw.CIRCLE:T=r[1];let i=l[T],I=l[T+1],D=l[T+2]-i,N=l[T+3]-I,O=Math.sqrt(D*D+N*N);e.moveTo(i+O,I),e.arc(i,I,O,0,2*Math.PI,!0),++E;break;case Lw.CLOSE_PATH:e.closePath(),++E;break;case Lw.CUSTOM:T=r[1],A=r[2];let Q=r[3],z=r[4],H=r[5];U.geometry=Q,U.feature=x,E in L||(L[E]=[]);let j=L[E];H?H(l,T,A,2,j):(j[0]=l[T],j[1]=l[T+1],j.length=2),h&&(h.zIndex=r[6]),z(j,U),++E;break;case Lw.DRAW_IMAGE:T=r[1],A=r[2],y=r[3],u=r[4],c=r[5];let V=r[6],G=r[7],K=r[8],q=r[9],Z=r[10],W=r[11],$=r[12],X=r[13];d=r[14]||"declutter";let Y,J,ee,te,re=r[15];if(!y&&r.length>=20){_=r[19],v=r[20],w=r[21],b=r[22];let e=this.drawLabelWithPointPlacement_(_,v,w,b);y=e.label,r[3]=y;let t=r[23];u=(e.anchorX-t)*this.pixelRatio,r[4]=u;let i=r[24];c=(e.anchorY-i)*this.pixelRatio,r[5]=c,V=y.height,r[6]=V,X=y.width,r[13]=X}r.length>25&&(Y=r[25]),r.length>17?(J=r[16],ee=r[17],te=r[18]):(J=mv,ee=null,te=null),Z&&k?W+=M:!Z&&!k&&(W-=M);let ie=0;for(;T<A;T+=2){if(Y&&Y[ie++]<X/this.pixelRatio)continue;let r=this.calculateImageOrLabelDimensions_(y.width,y.height,l[T],l[T+1],X,V,u,c,K,q,W,$,n,J,!!ee||!!te,x),i=[e,t,y,r,G,ee,te];if(o){let e,t,n,a,s;if(re){let r=A-T;if(!re[r]){re[r]={args:i,declutterMode:d};continue}let a=re[r];e=a.args,t=a.declutterMode,delete re[r],n=$w(e)}if(e&&("declutter"!==t||!o.collides(n))&&(a=!0),("declutter"!==d||!o.collides(r.declutterBox))&&(s=!0),"declutter"===t&&"declutter"===d){let e=a&&s;a=e,s=e}a&&("none"!==t&&o.insert(n),this.replayImageOrLabel_.apply(this,e)),s&&("none"!==d&&o.insert(r.declutterBox),this.replayImageOrLabel_.apply(this,i))}else this.replayImageOrLabel_.apply(this,i)}++E;break;case Lw.DRAW_CHARS:let ne=r[1],ae=r[2],se=r[3],oe=r[4];b=r[5];let le=r[6],he=r[7],Ae=r[8];w=r[9];let ue=r[10];_=r[11],Array.isArray(_)&&(_=_.reduce(eb,"")),v=r[12];let ce=[r[13],r[13]];d=r[14]||"declutter";let de,pe=r[15],fe=this.textStates[v],ge=fe.font,me=[fe.scale[0]*he,fe.scale[1]*he];ge in this.widths_?de=this.widths_[ge]:(de={},this.widths_[ge]=de);let ye=Wg(l,ne,ae,2),_e=Math.abs(me[0])*Ev(ge,_,de);if(oe||_e<=ye){let r=jw(l,ne,ae,2,_,(ye-_e)*Yw(_,this.textStates[v].textAlign),le,Math.abs(me[0]),Ev,ge,de,k?0:this.viewRotation_,pe);e:if(r){let i,n,a,s,l,h=[];if(w)for(i=0,n=r.length;i<n;++i){l=r[i],a=l[4],s=this.createLabel(a,v,"",w),u=l[2]+(me[0]<0?-ue:ue),c=se*s.height+2*(.5-se)*ue*me[1]/me[0]-Ae;let n=this.calculateImageOrLabelDimensions_(s.width,s.height,l[0],l[1],s.width,s.height,u,c,0,0,l[3],ce,!1,mv,!1,x);if(o&&"declutter"===d&&o.collides(n.declutterBox))break e;h.push([e,t,s,n,1,null,null])}if(b)for(i=0,n=r.length;i<n;++i){l=r[i],a=l[4],s=this.createLabel(a,v,b,""),u=l[2],c=se*s.height-Ae;let n=this.calculateImageOrLabelDimensions_(s.width,s.height,l[0],l[1],s.width,s.height,u,c,0,0,l[3],ce,!1,mv,!1,x);if(o&&"declutter"===d&&o.collides(n.declutterBox))break e;h.push([e,t,s,n,1,null,null])}o&&"none"!==d&&o.load(h.map($w));for(let e=0,t=h.length;e<t;++e)this.replayImageOrLabel_.apply(this,h[e])}}++E;break;case Lw.END_GEOMETRY:if(void 0!==a){x=r[1];let e=a(x,S,d);if(e)return e}++E;break;case Lw.FILL:R?F++:this.fill_(e),++E;break;case Lw.MOVE_TO_LINE_TO:for(T=r[1],A=r[2],B=l[T],C=l[T+1],e.moveTo(B,C),p=B+.5|0,f=C+.5|0,T+=2;T<A;T+=2)B=l[T],C=l[T+1],g=B+.5|0,m=C+.5|0,(T==A-2||g!==p||m!==f)&&(e.lineTo(B,C),p=g,f=m);++E;break;case Lw.SET_FILL_STYLE:this.alignAndScaleFill_=r[2],F&&(this.fill_(e),F=0,P&&(e.stroke(),P=0)),e.fillStyle=r[1],++E;break;case Lw.SET_STROKE_STYLE:P&&(e.stroke(),P=0),this.setStrokeStyle_(e,r),++E;break;case Lw.STROKE:R?P++:e.stroke(),++E;break;default:++E}}F&&this.fill_(e),P&&e.stroke()}execute(e,t,r,i,n,a){this.viewRotation_=i,this.execute_(e,t,r,this.instructions,n,void 0,void 0,a)}executeHitDetection(e,t,r,i,n){return this.viewRotation_=r,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,i,n)}},rb=["Polygon","Circle","LineString","Image","Text","Default"],ib=["Image","Text"],nb=rb.filter((e=>!ib.includes(e))),ab={};var sb=class{constructor(e,t,r,i,n,a,s){this.maxExtent_=e,this.overlaps_=i,this.pixelRatio_=r,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(n,s)}clip(e,t){let r=this.getClipCoords(t);e.beginPath(),e.moveTo(r[0],r[1]),e.lineTo(r[2],r[3]),e.lineTo(r[4],r[5]),e.lineTo(r[6],r[7]),e.clip()}createExecutors_(e,t){for(let r in e){let i=this.executorsByZIndex_[r];void 0===i&&(i={},this.executorsByZIndex_[r]=i);let n=e[r];for(let e in n){let r=n[e];i[e]=new tb(this.resolution_,this.pixelRatio_,this.overlaps_,r,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let r=this.executorsByZIndex_[t];for(let t=0,i=e.length;t<i;++t)if(e[t]in r)return!0}return!1}forEachFeatureAtCoordinate(e,t,r,i,n,a){let s=2*(i=Math.round(i))+1,o=ng(this.hitDetectionTransform_,i+.5,i+.5,1/t,-1/t,-r,-e[0],-e[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=w_(s,s));let h,A=this.hitDetectionContext_;A.canvas.width!==s||A.canvas.height!==s?(A.canvas.width=s,A.canvas.height=s):l||A.clearRect(0,0,s,s),void 0!==this.renderBuffer_&&(h=[1/0,1/0,-1/0,-1/0],function(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}(h,e),cd(h,t*(this.renderBuffer_+i),h));let u,c=function(e){if(void 0!==ab[e])return ab[e];let t=2*e+1,r=e*e,i=new Array(r+1);for(let n=0;n<=e;++n)for(let a=0;a<=e;++a){let s=n*n+a*a;if(s>r)break;let o=i[s];o||(o=[],i[s]=o),o.push(4*((e+n)*t+(e+a))+3),n>0&&o.push(4*((e-n)*t+(e+a))+3),a>0&&(o.push(4*((e+n)*t+(e-a))+3),n>0&&o.push(4*((e-n)*t+(e-a))+3))}let n=[];for(let e=0,t=i.length;e<t;++e)i[e]&&n.push(...i[e]);return ab[e]=n,n}(i);function d(e,t,r){let o=A.getImageData(0,0,s,s).data;for(let l=0,h=c.length;l<h;l++)if(o[c[l]]>0){if(!a||"none"===r||"Image"!==u&&"Text"!==u||a.includes(e)){let r=(c[l]-3)/4,a=i-r%s,o=i-(r/s|0),h=n(e,t,a*a+o*o);if(h)return h}A.clearRect(0,0,s,s);break}}let p,f,g,m,y,_=Object.keys(this.executorsByZIndex_).map(Number);for(_.sort(Jd),p=_.length-1;p>=0;--p){let e=_[p].toString();for(g=this.executorsByZIndex_[e],f=rb.length-1;f>=0;--f)if(u=rb[f],m=g[u],void 0!==m&&(y=m.executeHitDetection(A,o,r,d,h),y))return y}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let r=t[0],i=t[1],n=t[2],a=t[3],s=[r,i,r,a,n,a,n,i];return hg(s,0,8,2,e,s),s}isEmpty(){return Ap(this.executorsByZIndex_)}execute(e,t,r,i,n,a,s){let o=Object.keys(this.executorsByZIndex_).map(Number);o.sort(s?ep:Jd),a=a||rb;let l=rb.length;for(let h=0,A=o.length;h<A;++h){let A=o[h].toString(),u=this.executorsByZIndex_[A];for(let A=0,c=a.length;A<c;++A){let c=a[A],d=u[c];if(void 0!==d){let a=null===s?void 0:d.getZIndexContext(),A=a?a.getContext():e,u=this.maxExtent_&&"Image"!==c&&"Text"!==c;if(u&&(A.save(),this.clip(A,r)),a&&"Text"!==c&&"Image"!==c?a.pushFunction((e=>d.execute(e,t,r,i,n,s))):d.execute(A,t,r,i,n,s),u&&A.restore(),a){a.offset();let e=o[h]*l+rb.indexOf(c);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Jd);for(let r=0,i=t.length;r<i;++r)e[t[r]].forEach((e=>{e.draw(this.renderedContext_),e.clear()})),e[t[r]].length=0}};function ob(e,t,r,i){return void 0!==r&&void 0!==i?[r/e,i/t]:void 0!==r?r/e:void 0!==i?i/t:1}var lb=class e extends yw{constructor(e){let t=void 0!==(e=e||{}).opacity?e.opacity:1,r=void 0!==e.rotation?e.rotation:0,i=void 0!==e.scale?e.scale:1,n=void 0!==e.rotateWithView&&e.rotateWithView;super({opacity:t,rotation:r,scale:i,displacement:void 0!==e.displacement?e.displacement:[0,0],rotateWithView:n,declutterMode:e.declutterMode}),this.anchor_=void 0!==e.anchor?e.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==e.anchorOrigin?e.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==e.anchorXUnits?e.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==e.anchorYUnits?e.anchorYUnits:"fraction",this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:null;let a,s=void 0!==e.img?e.img:null,o=e.src;if(rg(!(void 0!==o&&s),"`image` and `src` cannot be provided at the same time"),(void 0===o||0===o.length)&&s&&(o=s.src||Hd(s)),rg(void 0!==o&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),rg(!((void 0!==e.width||void 0!==e.height)&&void 0!==e.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==e.src?a=m_:void 0!==s&&(a="complete"in s?s.complete?s.src?__:m_:y_:__),this.color_=void 0!==e.color?j_(e.color):null,this.iconImage_=$_(s,o,this.crossOrigin_,a,this.color_),this.offset_=void 0!==e.offset?e.offset:[0,0],this.offsetOrigin_=void 0!==e.offsetOrigin?e.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==e.size?e.size:null,this.initialOptions_,void 0!==e.width||void 0!==e.height){let t,r;if(e.size)[t,r]=e.size;else{let i=this.getImage(1);if(i.width&&i.height)t=i.width,r=i.height;else if(i instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let r=this.iconImage_.getSize();this.setScale(ob(r[0],r[1],e.width,e.height))};return void this.listenImageChange(t)}}void 0!==t&&this.setScale(ob(t,r,e.width,e.height))}}clone(){let t,r,i;return this.initialOptions_?(r=this.initialOptions_.width,i=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:r,height:i,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!t)return null;e=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(e[0]*=t[0]),"fraction"==this.anchorYUnits_&&(e[1]*=t[1])}if("top-left"!=this.anchorOrigin_){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),("top-right"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(e[0]=-e[0]+t[0]),("bottom-left"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),r=this.getScaleArray();return[e[0]-t[0]/r[0],e[1]+t[1]/r[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if("top-left"!=this.offsetOrigin_){let t=this.getSize(),r=this.iconImage_.getSize();if(!t||!r)return null;e=e.slice(),("top-right"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(e[0]=r[0]-t[0]-e[0]),("bottom-left"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(e[1]=r[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();return this.size_?this.size_[0]*e[0]:this.iconImage_.getImageState()==__?this.iconImage_.getSize()[0]*e[0]:void 0}getHeight(){let e=this.getScaleArray();return this.size_?this.size_[1]*e[1]:this.iconImage_.getImageState()==__?this.iconImage_.getSize()[1]*e[1]:void 0}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(Vd,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(Vd,e)}ready(){return this.iconImage_.ready()}},hb=.5;var Ab=class extends up{constructor(e,t,r,i){super(e),this.inversePixelTransform=t,this.frameState=r,this.context=i}},ub=class extends yp{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(e){return Qd()}getData(e){return null}prepareFrame(e){return Qd()}renderFrame(e,t){return Qd()}forEachFeatureAtCoordinate(e,t,r,i,n){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===__||t.getState()===v_)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=__&&t!=v_&&e.addEventListener(Vd,this.boundHandleImageChange_),t==m_&&(e.load(),t=e.getState()),t==__}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&"ready"===e.getSourceState()&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}},cb=[],db=null;var pb=class extends ub{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=[1,0,0,1,0,0],this.pixelTransform=[1,0,0,1,0,0],this.inversePixelTransform=[1,0,0,1,0,0],this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,r){let i;db||(db=w_(1,1,void 0,{willReadFrequently:!0})),db.clearRect(0,0,1,1);try{db.drawImage(e,t,r,1,1,0,0,1,1),i=db.getImageData(0,0,1,1).data}catch{return db=null,null}return i}getBackground(e){let t=this.getLayer().getBackground();return"function"==typeof t&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,r){let i,n,a=this.getLayer().getClassName();if(e&&e.className===a&&(!r||e&&e.style.backgroundColor&&np(j_(e.style.backgroundColor),j_(r)))){let t=e.firstElementChild;t instanceof HTMLCanvasElement&&(n=t.getContext("2d"))}if(n&&function(e,t){let r=lg(e),i=lg(t);for(let e=0;e<6;++e)if(0!==Math.round((r[e]-i[e])*sg[e]))return!1;return!0}(n.canvas.style.transform,t)?(this.container=e,this.context=n,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){i=document.createElement("div"),i.className=a;let e=i.style;e.position="absolute",e.width="100%",e.height="100%",n=w_();let t=n.canvas;i.appendChild(t),e=t.style,e.position="absolute",e.left="0",e.transformOrigin="top left",this.container=i,this.context=n}!this.containerReused&&r&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=r)}clipUnrotated(e,t,r){let i=kd(r),n=Ud(r),a=Td(r),s=Id(r);ig(t.coordinateToPixelTransform,i),ig(t.coordinateToPixelTransform,n),ig(t.coordinateToPixelTransform,a),ig(t.coordinateToPixelTransform,s);let o=this.inversePixelTransform;ig(o,i),ig(o,n),ig(o,a),ig(o,s),e.save(),e.beginPath(),e.moveTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(n[0]),Math.round(n[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(s[0]),Math.round(s[1])),e.clip()}prepareContainer(e,t){let r=e.extent,i=e.viewState.resolution,n=e.viewState.rotation,a=e.pixelRatio,s=Math.round(Rd(r)/i*a),o=Math.round(Ld(r)/i*a);ng(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,n,-s/2,-o/2),ag(this.inversePixelTransform,this.pixelTransform);let l=og(this.pixelTransform);if(this.useContainer(t,l,this.getBackground(e)),!this.containerReused){let e=this.context.canvas;e.width!=s||e.height!=o?(e.width=s,e.height=o):this.context.clearRect(0,0,s,o),l!==e.style.transform&&(e.style.transform=l)}}dispatchRenderEvent_(e,t,r){let i=this.getLayer();if(i.hasListener(e)){let n=new Ab(e,this.inversePixelTransform,r,t);i.dispatchEvent(n)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Cy,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Sy,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Vw),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Cy,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Sy,this.context,e))}getRenderTransform(e,t,r,i,n,a,s){let o=n/2,l=a/2,h=i/t,A=-h,u=-e[0]+s,c=-e[1];return ng(this.tempTransform,o,l,h,A,-r,u,c)}disposeInternal(){delete this.frameState,super.disposeInternal()}},fb=class extends pb{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,r){let i=t.extent,n=t.viewState,a=n.center,s=n.resolution,o=n.projection,l=n.rotation,h=o.getExtent(),A=this.getLayer().getSource(),u=this.getLayer().getDeclutter(),c=t.pixelRatio,d=t.viewHints,p=!(d[hy]||d[Ay]),f=this.context,g=Math.round(Rd(i)/s*c),m=Math.round(Ld(i)/s*c),y=A.getWrapX()&&o.canWrapX(),_=y?Rd(h):null,v=y?Math.ceil((i[2]-h[2])/_)+1:1,w=y?Math.floor((i[0]-h[0])/_):0;do{let i=this.getRenderTransform(a,s,0,c,g,m,w*_);t.declutter&&(i=i.slice(0)),e.execute(f,[f.canvas.width,f.canvas.height],i,l,p,void 0===r?rb:r?ib:nb,r?u&&t.declutter[u]:void 0)}while(++w<v)}setDrawContext_(){1!==this.opacity_&&(this.targetContext_=this.context,this.context=w_(this.context.canvas.width,this.context.canvas.height,cb))}resetDrawContext_(){if(1!==this.opacity_&&this.targetContext_){let e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,function(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}(this.context),cb.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(e,t){let r=e.layerStatesArray[e.layerIndex];this.opacity_=r.opacity;let i=e.viewState;this.prepareContainer(e,t);let n=this.context,a=this.replayGroup_,s=a&&!a.isEmpty();if(!s&&!this.getLayer().hasListener(Cy)&&!this.getLayer().hasListener(Sy))return this.container;this.setDrawContext_(),this.preRender(n,e);i.projection;if(this.clipped_=!1,s&&r.extent&&this.clipping){let t=tg(r.extent);s=Dd(t,e.extent),this.clipped_=s&&!gd(t,e.extent),this.clipped_&&this.clipUnrotated(n,e,t)}return s&&this.renderWorlds(a,e,!this.getLayer().getDeclutter()&&void 0),!e.declutter&&this.clipped_&&n.restore(),this.postRender(n,e),this.renderedRotation_!==i.rotation&&(this.renderedRotation_=i.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise((t=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let e=this.frameState.size.slice(),t=this.renderedCenter_,r=this.renderedResolution_,i=this.renderedRotation_,n=this.renderedProjection_,a=this.wrappedRenderedExtent_,s=this.getLayer(),o=[],l=e[0]*hb,h=e[1]*hb;o.push(this.getRenderTransform(t,r,i,hb,l,h,0).slice());let A=s.getSource(),u=n.getExtent();if(A.getWrapX()&&n.canWrapX()&&!gd(u,a)){let e,n=a[0],s=Rd(u),A=0;for(;n<u[0];)--A,e=s*A,o.push(this.getRenderTransform(t,r,i,hb,l,h,e).slice()),n+=s;for(A=0,n=a[2];n>u[2];)++A,e=s*A,o.push(this.getRenderTransform(t,r,i,hb,l,h,e).slice()),n-=s}let c=Xf();this.hitDetectionImageData_=function(e,t,r,i,n,a,s,o,l){let h=l?eg(n):n,A=w_(e[0]*hb,e[1]*hb);A.imageSmoothingEnabled=!1;let u=A.canvas,c=new Tv(A,hb,n,null,s,o,l?jf(Xf(),l):null),d=r.length,p=Math.floor(16777215/d),f={};for(let e=1;e<=d;++e){let t=r[e-1],n=t.getStyleFunction()||i;if(!n)continue;let s=n(t,a);if(!s)continue;Array.isArray(s)||(s=[s]);let o=(e*p).toString(16).padStart(7,"#00000");for(let e=0,r=s.length;e<r;++e){let r=s[e],i=r.getGeometryFunction()(t);if(!i||!Dd(h,i.getExtent()))continue;let n=r.clone(),a=n.getFill();a&&a.setColor(o);let l=n.getStroke();l&&(l.setColor(o),l.setLineDash(null)),n.setText(void 0);let A=r.getImage();if(A){let e=A.getImageSize();if(!e)continue;let t=w_(e[0],e[1],void 0,{alpha:!1}),r=t.canvas;t.fillStyle=o,t.fillRect(0,0,r.width,r.height),n.setImage(new lb({img:r,anchor:A.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:A.getOrigin(),opacity:1,size:A.getSize(),scale:A.getScale(),rotation:A.getRotation(),rotateWithView:A.getRotateWithView()}))}let u=n.getZIndex()||0,c=f[u];c||(c={},f[u]=c,c.Polygon=[],c.Circle=[],c.LineString=[],c.Point=[]);let d=i.getType();if("GeometryCollection"===d){let e=i.getGeometriesArrayRecursive();for(let t=0,r=e.length;t<r;++t){let r=e[t];c[r.getType().replace("Multi","")].push(r,n)}}else c[d.replace("Multi","")].push(i,n)}}let g=Object.keys(f).map(Number).sort(Jd);for(let e=0,r=g.length;e<r;++e){let r=f[g[e]];for(let e in r){let i=r[e];for(let e=0,r=i.length;e<r;e+=2){c.setStyle(i[e+1]);for(let r=0,n=t.length;r<n;++r)c.setTransform(t[r]),c.drawGeometry(i[e])}}}return A.getImageData(0,0,u.width,u.height)}(e,o,this.renderedFeatures_,s.getStyleFunction(),a,r,i,Lv(r,this.renderedPixelRatio_),c?n:null)}t(function(e,t,r){let i=[];if(r){let n=Math.floor(Math.round(e[0])*hb),a=Math.floor(Math.round(e[1])*hb),s=4*(Bp(n,0,r.width-1)+Bp(a,0,r.height-1)*r.width),o=r.data[s],l=r.data[s+1],h=r.data[s+2]+256*(l+256*o),A=Math.floor(16777215/t.length);h&&h%A==0&&i.push(t[h/A-1])}return i}(e,this.renderedFeatures_,this.hitDetectionImageData_))}))}forEachFeatureAtCoordinate(e,t,r,i,n){if(!this.replayGroup_)return;let a=t.viewState.resolution,s=t.viewState.rotation,o=this.getLayer(),l={},h=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,a,s,r,(function(e,t,r){let a=Hd(e),s=l[a];if(s){if(!0!==s&&r<s.distanceSq){if(0===r)return l[a]=!0,n.splice(n.lastIndexOf(s),1),i(e,o,t);s.geometry=t,s.distanceSq=r}}else{if(0===r)return l[a]=!0,i(e,o,t);n.push(l[a]={feature:e,layer:o,geometry:t,distanceSq:r,callback:i})}}),h?t.declutter?.[h]?.all().map((e=>e.value)):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),r=t.getSource();if(!r)return!1;let i=e.viewHints[hy],n=e.viewHints[Ay],a=t.getUpdateWhileAnimating(),s=t.getUpdateWhileInteracting();if(this.ready&&!a&&i||!s&&n)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let o=e.extent,l=e.viewState,h=l.projection,A=l.resolution,u=e.pixelRatio,c=t.getRevision(),d=t.getRenderBuffer(),p=t.getRenderOrder();void 0===p&&(p=Pv);let f=l.center.slice(),g=cd(o,d*A),m=g.slice(),y=[g.slice()],_=h.getExtent();if(r.getWrapX()&&h.canWrapX()&&!gd(_,e.extent)){let e=Rd(_),t=Math.max(Rd(g)/2,e);g[0]=_[0]-t,g[2]=_[2]+t,Up(f,h);let r=Od(y[0],h);r[0]<_[0]&&r[2]<_[2]?y.push([r[0]+e,r[1],r[2]+e,r[3]]):r[0]>_[0]&&r[2]>_[2]&&y.push([r[0]-e,r[1],r[2]-e,r[3]])}if(this.ready&&this.renderedResolution_==A&&this.renderedRevision_==c&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!e.declutter&&gd(this.wrappedRenderedExtent_,g))return np(this.renderedExtent_,m)||(this.hitDetectionImageData_=null,this.renderedExtent_=m),this.renderedCenter_=f,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let v,w=new Hw(Mv(A,u),g,A,u),b=Xf();if(b){for(let e=0,t=y.length;e<t;++e){let t=eg(y[e]);r.loadFeatures(t,A,b)}v=jf(b,h)}else for(let e=0,t=y.length;e<t;++e)r.loadFeatures(y[e],A,h);let x=Lv(A,u),B=!0,C=(e,r)=>{let i,n=e.getStyleFunction()||t.getStyleFunction();if(n&&(i=n(e,A)),i){let t=this.renderFeature(e,x,i,w,v,this.getLayer().getDeclutter(),r);B=B&&!t}},S=eg(g),E=r.getFeaturesInExtent(S);p&&E.sort(p);for(let e=0,t=E.length;e<t;++e)C(E[e],e);this.renderedFeatures_=E,this.ready=B;let I=w.finish(),T=new sb(g,A,u,r.getOverlaps(),I,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=A,this.renderedRevision_=c,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=m,this.wrappedRenderedExtent_=g,this.renderedCenter_=f,this.renderedProjection_=h,this.renderedPixelRatio_=u,this.replayGroup_=T,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,r,i,n,a,s){if(!r)return!1;let o=!1;if(Array.isArray(r))for(let l=0,h=r.length;l<h;++l)o=kv(i,e,r[l],t,this.boundHandleStyleImageChange_,n,a,s)||o;else o=kv(i,e,r,t,this.boundHandleStyleImageChange_,n,a,s);return o}},gb=0,mb=1<<gb++,yb=1<<gb++,_b=1<<gb++,vb=1<<gb++,wb=1<<gb++,bb=1<<gb++,xb=Math.pow(2,6)-1,Bb={[mb]:"boolean",[yb]:"number",[_b]:"string",[vb]:"color",[wb]:"number[]",[bb]:"size"},Cb=Object.keys(Bb).map(Number).sort(Jd);function Sb(e){let t=[];for(let r of Cb)Eb(e,r)&&t.push(Bb[r]);return 0===t.length?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function Eb(e,t){return(e&t)===t}function Ib(e,t){return e===t}var Tb=class{constructor(e,t){if(!(e in Bb))throw new Error(`literal expressions must have a specific type, got ${Sb(e)}`);this.type=e,this.value=t}},Fb=class{constructor(e,t,...r){this.type=e,this.operator=t,this.args=r}};function Pb(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Lb(e,t,r){switch(typeof e){case"boolean":if(Ib(t,_b))return new Tb(_b,e?"true":"false");if(!Eb(t,mb))throw new Error(`got a boolean, but expected ${Sb(t)}`);return new Tb(mb,e);case"number":if(Ib(t,bb))return new Tb(bb,mw(e));if(Ib(t,mb))return new Tb(mb,!!e);if(Ib(t,_b))return new Tb(_b,e.toString());if(!Eb(t,yb))throw new Error(`got a number, but expected ${Sb(t)}`);return new Tb(yb,e);case"string":if(Ib(t,vb))return new Tb(vb,H_(e));if(Ib(t,mb))return new Tb(mb,!!e);if(!Eb(t,_b))throw new Error(`got a string, but expected ${Sb(t)}`);return new Tb(_b,e)}if(!Array.isArray(e))throw new Error("expression must be an array or a primitive value");if(0===e.length)throw new Error("empty expression");if("string"==typeof e[0])return function(e,t,r){let i=e[0],n=Sx[i];if(!n)throw new Error(`unknown operator: ${i}`);return n(e,t,r)}(e,t,r);for(let t of e)if("number"!=typeof t)throw new Error("expected an array of numbers");if(Ib(t,bb)){if(2!==e.length)throw new Error(`expected an array of two values for a size, got ${e.length}`);return new Tb(bb,e)}if(Ib(t,vb)){if(3===e.length)return new Tb(vb,[...e,1]);if(4===e.length)return new Tb(vb,e);throw new Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!Eb(t,wb))throw new Error(`got an array of numbers, but expected ${Sb(t)}`);return new Tb(wb,e)}var Mb="get",kb="var",Ub="concat",Rb="geometry-type",Db="line-metric",Nb="any",Ob="all",Qb="!",zb="resolution",Hb="zoom",jb="time",Vb="==",Gb="!=",Kb=">",qb=">=",Zb="<",Wb="<=",$b="*",Xb="/",Yb="+",Jb="-",ex="clamp",tx="%",rx="^",ix="abs",nx="floor",ax="ceil",sx="round",ox="sin",lx="cos",hx="atan",Ax="sqrt",ux="match",cx="between",dx="interpolate",px="coalesce",fx="case",gx="in",mx="number",yx="string",_x="array",vx="color",wx="id",bx="band",xx="palette",Bx="to-string",Cx="has",Sx={[Mb]:kx(Fx(1,1/0),Ex),[kb]:kx(Fx(1,1),(function(e,t,r){let i=e[1];if("string"!=typeof i)throw new Error("expected a string argument for var operation");return r.variables.add(i),[new Tb(_b,i)]})),[Cx]:kx(Fx(1,1/0),Ex),[wx]:kx((function(e,t,r){r.featureId=!0}),Tx),[Ub]:kx(Fx(2,1/0),Lx(_b)),[Rb]:kx((function(e,t,r){r.geometryType=!0}),Tx),[Db]:kx(Tx),[zb]:kx(Ix,Tx),[Hb]:kx(Ix,Tx),[jb]:kx(Ix,Tx),[Nb]:kx(Fx(2,1/0),Lx(mb)),[Ob]:kx(Fx(2,1/0),Lx(mb)),[Qb]:kx(Fx(1,1),Lx(mb)),[Vb]:kx(Fx(2,2),Lx(xb)),[Gb]:kx(Fx(2,2),Lx(xb)),[Kb]:kx(Fx(2,2),Lx(yb)),[qb]:kx(Fx(2,2),Lx(yb)),[Zb]:kx(Fx(2,2),Lx(yb)),[Wb]:kx(Fx(2,2),Lx(yb)),[$b]:kx(Fx(2,1/0),Px),[px]:kx(Fx(2,1/0),Px),[Xb]:kx(Fx(2,2),Lx(yb)),[Yb]:kx(Fx(2,1/0),Lx(yb)),[Jb]:kx(Fx(2,2),Lx(yb)),[ex]:kx(Fx(3,3),Lx(yb)),[tx]:kx(Fx(2,2),Lx(yb)),[rx]:kx(Fx(2,2),Lx(yb)),[ix]:kx(Fx(1,1),Lx(yb)),[nx]:kx(Fx(1,1),Lx(yb)),[ax]:kx(Fx(1,1),Lx(yb)),[sx]:kx(Fx(1,1),Lx(yb)),[ox]:kx(Fx(1,1),Lx(yb)),[lx]:kx(Fx(1,1),Lx(yb)),[hx]:kx(Fx(1,2),Lx(yb)),[Ax]:kx(Fx(1,1),Lx(yb)),[ux]:kx(Fx(4,1/0),Mx,(function(e,t,r){let i=e.length-1,n=_b|yb|mb,a=Lb(e[1],n,r),s=Lb(e[e.length-1],t,r),o=new Array(i-2);for(let t=0;t<i-2;t+=2){try{let i=Lb(e[t+2],a.type,r);o[t]=i}catch(e){throw new Error(`failed to parse argument ${t+1} of match expression: ${e.message}`)}try{let i=Lb(e[t+3],s.type,r);o[t+1]=i}catch(e){throw new Error(`failed to parse argument ${t+2} of match expression: ${e.message}`)}}return[a,...o,s]})),[cx]:kx(Fx(3,3),Lx(yb)),[dx]:kx(Fx(6,1/0),Mx,(function(e,t,r){let i,n=e[1];switch(n[0]){case"linear":i=1;break;case"exponential":let e=n[1];if("number"!=typeof e||e<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(e)} instead`);i=e;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}let a,s=new Tb(yb,i);try{a=Lb(e[2],yb,r)}catch(e){throw new Error(`failed to parse argument 1 in interpolate expression: ${e.message}`)}let o=new Array(e.length-3);for(let i=0;i<o.length;i+=2){try{let t=Lb(e[i+3],yb,r);o[i]=t}catch(e){throw new Error(`failed to parse argument ${i+2} for interpolate expression: ${e.message}`)}try{let n=Lb(e[i+4],t,r);o[i+1]=n}catch(e){throw new Error(`failed to parse argument ${i+3} for interpolate expression: ${e.message}`)}}return[s,a,...o]})),[fx]:kx(Fx(3,1/0),(function(e,t,r){let i=e[0],n=e.length-1;if(n%2==0)throw new Error(`expected an odd number of arguments for ${i}, got ${n} instead`)}),(function(e,t,r){let i=Lb(e[e.length-1],t,r),n=new Array(e.length-1);for(let t=0;t<n.length-1;t+=2){try{let i=Lb(e[t+1],mb,r);n[t]=i}catch(e){throw new Error(`failed to parse argument ${t} of case expression: ${e.message}`)}try{let a=Lb(e[t+2],i.type,r);n[t+1]=a}catch(e){throw new Error(`failed to parse argument ${t+1} of case expression: ${e.message}`)}}return n[n.length-1]=i,n})),[gx]:kx(Fx(2,2),(function(e,t,r){let i,n=e[2];if(!Array.isArray(n))throw new Error('the second argument for the "in" operator must be an array');if("string"==typeof n[0]){if("literal"!==n[0])throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(n[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');n=n[1],i=_b}else i=yb;let a=new Array(n.length);for(let e=0;e<a.length;e++)try{let t=Lb(n[e],i,r);a[e]=t}catch(t){throw new Error(`failed to parse haystack item ${e} for "in" expression: ${t.message}`)}return[Lb(e[1],i,r),...a]})),[mx]:kx(Fx(1,1/0),Lx(xb)),[yx]:kx(Fx(1,1/0),Lx(xb)),[_x]:kx(Fx(1,1/0),Lx(yb)),[vx]:kx(Fx(1,4),Lx(yb)),[bx]:kx(Fx(1,3),Lx(yb)),[xx]:kx(Fx(2,2),(function(e,t,r){let i;try{i=Lb(e[1],yb,r)}catch(e){throw new Error(`failed to parse first argument in palette expression: ${e.message}`)}let n=e[2];if(!Array.isArray(n))throw new Error("the second argument of palette must be an array");let a=new Array(n.length);for(let e=0;e<a.length;e++){let t;try{t=Lb(n[e],vb,r)}catch(t){throw new Error(`failed to parse color at index ${e} in palette expression: ${t.message}`)}if(!(t instanceof Tb))throw new Error(`the palette color at index ${e} must be a literal value`);a[e]=t}return[i,...a]})),[Bx]:kx(Fx(1,1),Lx(mb|yb|_b|vb))};function Ex(e,t,r){let i=e.length-1,n=new Array(i);for(let t=0;t<i;++t){let i=e[t+1];switch(typeof i){case"number":n[t]=new Tb(yb,i);break;case"string":n[t]=new Tb(_b,i);break;default:throw new Error(`expected a string key or numeric array index for a get operation, got ${i}`)}0===t&&r.properties.add(String(i))}return n}function Ix(e,t,r){r.mapState=!0}function Tx(e,t,r){let i=e[0];if(1!==e.length)throw new Error(`expected no arguments for ${i} operation`);return[]}function Fx(e,t){return function(r,i,n){let a=r[0],s=r.length-1;if(e===t){if(s!==e){throw new Error(`expected ${e} argument${1===e?"":"s"} for ${a}, got ${s}`)}}else if(s<e||s>t){throw new Error(`expected ${t===1/0?`${e} or more`:`${e} to ${t}`} arguments for ${a}, got ${s}`)}}}function Px(e,t,r){let i=e.length-1,n=new Array(i);for(let a=0;a<i;++a){let i=Lb(e[a+1],t,r);n[a]=i}return n}function Lx(e){return function(t,r,i){let n=t.length-1,a=new Array(n);for(let r=0;r<n;++r){let n=Lb(t[r+1],e,i);a[r]=n}return a}}function Mx(e,t,r){let i=e[0],n=e.length-1;if(n%2==1)throw new Error(`expected an even number of arguments for operation ${i}, got ${n} instead`)}function kx(...e){return function(t,r,i){let n,a=t[0];for(let a=0;a<e.length;a++){let s=e[a](t,r,i);if(a==e.length-1){if(!s)throw new Error("expected last argument validator to return the parsed args");n=s}}return new Fb(r,a,...n)}}function Ux(e){if(!e)return"";let t=e.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return Ux(e.getGeometries()[0]);default:return""}}function Rx(e,t,r){return Dx(Lb(e,t,r),r)}function Dx(e,t){if(e instanceof Tb){if(e.type===vb&&"string"==typeof e.value){let t=H_(e.value);return function(){return t}}return function(){return e.value}}let r=e.operator;switch(r){case mx:case yx:case px:return function(e,t){let r=e.operator,i=e.args.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=Dx(e.args[r],t);switch(r){case px:return e=>{for(let t=0;t<i;++t){let r=n[t](e);if(typeof r<"u"&&null!==r)return r}throw new Error("Expected one of the values to be non-null")};case mx:case yx:return e=>{for(let t=0;t<i;++t){let i=n[t](e);if(typeof i===r)return i}throw new Error(`Expected one of the values to be a ${r}`)};default:throw new Error(`Unsupported assertion operator ${r}`)}}(e,t);case Mb:case kb:case Cx:return function(e){let t=e.args[0].value;switch(e.operator){case Mb:return r=>{let i=e.args,n=r.properties[t];for(let e=1,t=i.length;e<t;++e){n=n[i[e].value]}return n};case kb:return e=>e.variables[t];case Cx:return r=>{let i=e.args;if(!(t in r.properties))return!1;let n=r.properties[t];for(let e=1,t=i.length;e<t;++e){let t=i[e].value;if(!n||!Object.hasOwn(n,t))return!1;n=n[t]}return!0};default:throw new Error(`Unsupported accessor operator ${e.operator}`)}}(e);case wx:return e=>e.featureId;case Rb:return e=>e.geometryType;case Ub:{let r=e.args.map((e=>Dx(e,t)));return e=>"".concat(...r.map((t=>t(e).toString())))}case zb:return e=>e.resolution;case Nb:case Ob:case cx:case gx:case Qb:return function(e,t){let r=e.operator,i=e.args.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=Dx(e.args[r],t);switch(r){case Nb:return e=>{for(let t=0;t<i;++t)if(n[t](e))return!0;return!1};case Ob:return e=>{for(let t=0;t<i;++t)if(!n[t](e))return!1;return!0};case cx:return e=>{let t=n[0](e),r=n[1](e),i=n[2](e);return t>=r&&t<=i};case gx:return e=>{let t=n[0](e);for(let r=1;r<i;++r)if(t===n[r](e))return!0;return!1};case Qb:return e=>!n[0](e);default:throw new Error(`Unsupported logical operator ${r}`)}}(e,t);case Vb:case Gb:case Zb:case Wb:case Kb:case qb:return function(e,t){let r=e.operator,i=Dx(e.args[0],t),n=Dx(e.args[1],t);switch(r){case Vb:return e=>i(e)===n(e);case Gb:return e=>i(e)!==n(e);case Zb:return e=>i(e)<n(e);case Wb:return e=>i(e)<=n(e);case Kb:return e=>i(e)>n(e);case qb:return e=>i(e)>=n(e);default:throw new Error(`Unsupported comparison operator ${r}`)}}(e,t);case $b:case Xb:case Yb:case Jb:case ex:case tx:case rx:case ix:case nx:case ax:case sx:case ox:case lx:case hx:case Ax:return function(e,t){let r=e.operator,i=e.args.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=Dx(e.args[r],t);switch(r){case $b:return e=>{let t=1;for(let r=0;r<i;++r)t*=n[r](e);return t};case Xb:return e=>n[0](e)/n[1](e);case Yb:return e=>{let t=0;for(let r=0;r<i;++r)t+=n[r](e);return t};case Jb:return e=>n[0](e)-n[1](e);case ex:return e=>{let t=n[0](e),r=n[1](e);if(t<r)return r;let i=n[2](e);return t>i?i:t};case tx:return e=>n[0](e)%n[1](e);case rx:return e=>Math.pow(n[0](e),n[1](e));case ix:return e=>Math.abs(n[0](e));case nx:return e=>Math.floor(n[0](e));case ax:return e=>Math.ceil(n[0](e));case sx:return e=>Math.round(n[0](e));case ox:return e=>Math.sin(n[0](e));case lx:return e=>Math.cos(n[0](e));case hx:return 2===i?e=>Math.atan2(n[0](e),n[1](e)):e=>Math.atan(n[0](e));case Ax:return e=>Math.sqrt(n[0](e));default:throw new Error(`Unsupported numeric operator ${r}`)}}(e,t);case fx:return function(e,t){let r=e.args.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=Dx(e.args[n],t);return e=>{for(let t=0;t<r-1;t+=2)if(i[t](e))return i[t+1](e);return i[r-1](e)}}(e,t);case ux:return function(e,t){let r=e.args.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=Dx(e.args[n],t);return e=>{let t=i[0](e);for(let n=1;n<r-1;n+=2)if(t===i[n](e))return i[n+1](e);return i[r-1](e)}}(e,t);case dx:return function(e,t){let r=e.args.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=Dx(e.args[n],t);return e=>{let t,n,a=i[0](e),s=i[1](e);for(let o=2;o<r;o+=2){let r=i[o](e),l=i[o+1](e),h=Array.isArray(l);if(h&&(l=R_(l)),r>=s)return 2===o?l:h?Ox(a,s,t,n,r,l):Nx(a,s,t,n,r,l);t=r,n=l}return n}}(e,t);case Bx:return function(e,t){let r=e.operator,i=e.args.length,n=new Array(i);for(let r=0;r<i;++r)n[r]=Dx(e.args[r],t);if(r===Bx)return t=>{let r=n[0](t);return e.args[0].type===vb?V_(r):r.toString()};throw new Error(`Unsupported convert operator ${r}`)}(e,t);default:throw new Error(`Unsupported operator ${r}`)}}function Nx(e,t,r,i,n,a){let s=n-r;if(0===s)return i;let o=t-r;return i+(1===e?o/s:(Math.pow(e,o)-1)/(Math.pow(e,s)-1))*(a-i)}function Ox(e,t,r,i,n,a){if(n-r==0)return i;let s=z_(i),o=z_(a),l=o[2]-s[2];return l>180?l-=360:l<-180&&(l+=360),function(e){let t=(e[0]+16)/116,r=e[1],i=e[2]*Math.PI/180,n=N_(t),a=N_(t+r/500*Math.cos(i)),s=N_(t-r/200*Math.sin(i)),o=D_(3.021973625*a-1.617392459*n-.404875592*s),l=D_(-.943766287*a+1.916279586*n+.027607165*s),h=D_(.069407491*a-.22898585*n+1.159737864*s);return[Bp(o+.5|0,0,255),Bp(l+.5|0,0,255),Bp(h+.5|0,0,255),e[3]]}([Nx(e,t,r,s[0],n,o[0]),Nx(e,t,r,s[1],n,o[1]),s[2]+Nx(e,t,r,0,n,l),Nx(e,t,r,i[3],n,a[3])])}function Qx(e){return!0}function zx(e){let t=Pb(),r=function(e,t){let r=e.length,i=new Array(r);for(let n=0;n<r;++n){let r,a=e[n],s="filter"in a?Rx(a.filter,mb,t):Qx;if(Array.isArray(a.style)){let e=a.style.length;r=new Array(e);for(let i=0;i<e;++i)r[i]=jx(a.style[i],t)}else r=[jx(a.style,t)];i[n]={filter:s,styles:r}}return function(t){let n=[],a=!1;for(let s=0;s<r;++s){if((0,i[s].filter)(t)&&(!e[s].else||!a)){a=!0;for(let e of i[s].styles){let r=e(t);r&&n.push(r)}}}return n}}(e,t),i={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""};return function(e,n){if(i.properties=e.getPropertiesInternal(),i.resolution=n,t.featureId){let t=e.getId();i.featureId=void 0!==t?t:null}return t.geometryType&&(i.geometryType=Ux(e.getGeometry())),r(i)}}function Hx(e){let t=Pb(),r=e.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=jx(e[n],t);let n={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""},a=new Array(r);return function(e,s){if(n.properties=e.getPropertiesInternal(),n.resolution=s,t.featureId){let t=e.getId();n.featureId=void 0!==t?t:null}let o=0;for(let e=0;e<r;++e){let t=i[e](n);t&&(a[o]=t,o+=1)}return a.length=o,a}}function jx(e,t){let r=Vx(e,"",t),i=Gx(e,"",t),n=function(e,t){let r="text-",i=qx(e,r+"value",t);if(!i)return null;let n=Vx(e,r,t),a=Vx(e,r+"background-",t),s=Gx(e,r,t),o=Gx(e,r+"background-",t),l=qx(e,r+"font",t),h=Kx(e,r+"max-angle",t),A=Kx(e,r+"offset-x",t),u=Kx(e,r+"offset-y",t),c=Zx(e,r+"overflow",t),d=qx(e,r+"placement",t),p=Kx(e,r+"repeat",t),f=Jx(e,r+"scale",t),g=Zx(e,r+"rotate-with-view",t),m=Kx(e,r+"rotation",t),y=qx(e,r+"align",t),_=qx(e,r+"justify",t),v=qx(e,r+"baseline",t),w=Zx(e,r+"keep-upright",t),b=$x(e,r+"padding",t),x=iB(e,r+"declutter-mode"),B=new Sw({declutterMode:x});return function(e){if(B.setText(i(e)),n&&B.setFill(n(e)),a&&B.setBackgroundFill(a(e)),s&&B.setStroke(s(e)),o&&B.setBackgroundStroke(o(e)),l&&B.setFont(l(e)),h&&B.setMaxAngle(h(e)),A&&B.setOffsetX(A(e)),u&&B.setOffsetY(u(e)),c&&B.setOverflow(c(e)),d){let t=d(e);if("point"!==t&&"line"!==t)throw new Error("Expected point or line for text-placement");B.setPlacement(t)}if(p&&B.setRepeat(p(e)),f&&B.setScale(f(e)),g&&B.setRotateWithView(g(e)),m&&B.setRotation(m(e)),y){let t=y(e);if("left"!==t&&"center"!==t&&"right"!==t&&"end"!==t&&"start"!==t)throw new Error("Expected left, right, center, start, or end for text-align");B.setTextAlign(t)}if(_){let t=_(e);if("left"!==t&&"right"!==t&&"center"!==t)throw new Error("Expected left, right, or center for text-justify");B.setJustify(t)}if(v){let t=v(e);if("bottom"!==t&&"top"!==t&&"middle"!==t&&"alphabetic"!==t&&"hanging"!==t)throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");B.setTextBaseline(t)}return b&&B.setPadding(b(e)),w&&B.setKeepUpright(w(e)),B}}(e,t),a=function(e,t){return"icon-src"in e?function(e,t){let r="icon-",i=r+"src",n=aB(e[i],i),a=Xx(e,r+"anchor",t),s=Jx(e,r+"scale",t),o=Kx(e,r+"opacity",t),l=Xx(e,r+"displacement",t),h=Kx(e,r+"rotation",t),A=Zx(e,r+"rotate-with-view",t),u=tB(e,r+"anchor-origin"),c=rB(e,r+"anchor-x-units"),d=rB(e,r+"anchor-y-units"),p=function(e,t){let r=e[t];if(void 0!==r)return oB(r,t)}(e,r+"color"),f=function(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Error(`Expected a string for ${t}`);return r}}(e,r+"cross-origin"),g=function(e,t){let r=e[t];if(void 0!==r)return nB(r,t)}(e,r+"offset"),m=tB(e,r+"offset-origin"),y=eB(e,r+"width"),_=eB(e,r+"height"),v=function(e,t){let r=e[t];if(void 0!==r){if("number"==typeof r)return mw(r);if(!Array.isArray(r))throw new Error(`Expected a number or size array for ${t}`);if(2!==r.length||"number"!=typeof r[0]||"number"!=typeof r[1])throw new Error(`Expected a number or size array for ${t}`);return r}}(e,r+"size"),w=iB(e,r+"declutter-mode"),b=new lb({src:n,anchorOrigin:u,anchorXUnits:c,anchorYUnits:d,color:p,crossOrigin:f,offset:g,offsetOrigin:m,height:_,width:y,size:v,declutterMode:w});return function(e){return o&&b.setOpacity(o(e)),l&&b.setDisplacement(l(e)),h&&b.setRotation(h(e)),A&&b.setRotateWithView(A(e)),s&&b.setScale(s(e)),a&&b.setAnchor(a(e)),b}}(e,t):"shape-points"in e?function(e,t){let r="shape-",i=r+"points",n=r+"radius",a=sB(e[i],i),s=sB(e[n],n),o=Vx(e,r,t),l=Gx(e,r,t),h=Jx(e,r+"scale",t),A=Xx(e,r+"displacement",t),u=Kx(e,r+"rotation",t),c=Zx(e,r+"rotate-with-view",t),d=eB(e,r+"radius2"),p=eB(e,r+"angle"),f=iB(e,r+"declutter-mode"),g=new _w({points:a,radius:s,radius2:d,angle:p,declutterMode:f});return function(e){return o&&g.setFill(o(e)),l&&g.setStroke(l(e)),A&&g.setDisplacement(A(e)),u&&g.setRotation(u(e)),c&&g.setRotateWithView(c(e)),h&&g.setScale(h(e)),g}}(e,t):"circle-radius"in e?function(e,t){let r="circle-",i=Vx(e,r,t),n=Gx(e,r,t),a=Kx(e,r+"radius",t),s=Jx(e,r+"scale",t),o=Xx(e,r+"displacement",t),l=Kx(e,r+"rotation",t),h=Zx(e,r+"rotate-with-view",t),A=iB(e,r+"declutter-mode"),u=new vw({radius:5,declutterMode:A});return function(e){return a&&u.setRadius(a(e)),i&&u.setFill(i(e)),n&&u.setStroke(n(e)),o&&u.setDisplacement(o(e)),l&&u.setRotation(l(e)),h&&u.setRotateWithView(h(e)),s&&u.setScale(s(e)),u}}(e,t):null}(e,t),s=Kx(e,"z-index",t);if(!(r||i||n||a||Ap(e)))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(e));let o=new Cw;return function(e){let t=!0;if(r){let i=r(e);i&&(t=!1),o.setFill(i)}if(i){let r=i(e);r&&(t=!1),o.setStroke(r)}if(n){let r=n(e);r&&(t=!1),o.setText(r)}if(a){let r=a(e);r&&(t=!1),o.setImage(r)}return s&&o.setZIndex(s(e)),t?null:o}}function Vx(e,t,r){let i;if(t+"fill-pattern-src"in e)i=function(e,t,r){let i=qx(e,t+"pattern-src",r),n=Yx(e,t+"pattern-offset",r),a=Yx(e,t+"pattern-size",r),s=Wx(e,t+"color",r);return function(e){return{src:i(e),offset:n&&n(e),size:a&&a(e),color:s&&s(e)}}}(e,t+"fill-",r);else{if("none"===e[t+"fill-color"])return e=>null;i=Wx(e,t+"fill-color",r)}if(!i)return null;let n=new pw;return function(e){let t=i(e);return t===C_?null:(n.setColor(t),n)}}function Gx(e,t,r){let i=Kx(e,t+"stroke-width",r),n=Wx(e,t+"stroke-color",r);if(!i&&!n)return null;let a=qx(e,t+"stroke-line-cap",r),s=qx(e,t+"stroke-line-join",r),o=$x(e,t+"stroke-line-dash",r),l=Kx(e,t+"stroke-line-dash-offset",r),h=Kx(e,t+"stroke-miter-limit",r),A=new fw;return function(e){if(n){let t=n(e);if(t===C_)return null;A.setColor(t)}if(i&&A.setWidth(i(e)),a){let t=a(e);if("butt"!==t&&"round"!==t&&"square"!==t)throw new Error("Expected butt, round, or square line cap");A.setLineCap(t)}if(s){let t=s(e);if("bevel"!==t&&"round"!==t&&"miter"!==t)throw new Error("Expected bevel, round, or miter line join");A.setLineJoin(t)}return o&&A.setLineDash(o(e)),l&&A.setLineDashOffset(l(e)),h&&A.setMiterLimit(h(e)),A}}function Kx(e,t,r){if(!(t in e))return;let i=Rx(e[t],yb,r);return function(e){return sB(i(e),t)}}function qx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],_b,r);return function(e){return aB(i(e),t)}}function Zx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],mb,r);return function(e){let r=i(e);if("boolean"!=typeof r)throw new Error(`Expected a boolean for ${t}`);return r}}function Wx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],vb,r);return function(e){return oB(i(e),t)}}function $x(e,t,r){if(!(t in e))return null;let i=Rx(e[t],wb,r);return function(e){return nB(i(e),t)}}function Xx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],wb,r);return function(e){let r=nB(i(e),t);if(2!==r.length)throw new Error(`Expected two numbers for ${t}`);return r}}function Yx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],wb,r);return function(e){return lB(i(e),t)}}function Jx(e,t,r){if(!(t in e))return null;let i=Rx(e[t],wb|yb,r);return function(e){return function(e,t){return"number"==typeof e?e:lB(e,t)}(i(e),t)}}function eB(e,t){let r=e[t];if(void 0!==r){if("number"!=typeof r)throw new Error(`Expected a number for ${t}`);return r}}function tB(e,t){let r=e[t];if(void 0!==r){if("bottom-left"!==r&&"bottom-right"!==r&&"top-left"!==r&&"top-right"!==r)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return r}}function rB(e,t){let r=e[t];if(void 0!==r){if("pixels"!==r&&"fraction"!==r)throw new Error(`Expected pixels or fraction for ${t}`);return r}}function iB(e,t){let r=e[t];if(void 0!==r){if("string"!=typeof r)throw new Error(`Expected a string for ${t}`);if("declutter"!==r&&"obstacle"!==r&&"none"!==r)throw new Error(`Expected declutter, obstacle, or none for ${t}`);return r}}function nB(e,t){if(!Array.isArray(e))throw new Error(`Expected an array for ${t}`);let r=e.length;for(let i=0;i<r;++i)if("number"!=typeof e[i])throw new Error(`Expected an array of numbers for ${t}`);return e}function aB(e,t){if("string"!=typeof e)throw new Error(`Expected a string for ${t}`);return e}function sB(e,t){if("number"!=typeof e)throw new Error(`Expected a number for ${t}`);return e}function oB(e,t){if("string"==typeof e)return e;let r=nB(e,t),i=r.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return r}function lB(e,t){let r=nB(e,t);if(2!==r.length)throw new Error(`Expected an array of two numbers for ${t}`);return r}var hB="renderOrder";var AB=class extends jy{constructor(e){e=e||{};let t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=void 0!==e.renderBuffer?e.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=void 0!==e.updateWhileAnimating&&e.updateWhileAnimating,this.updateWhileInteracting_=void 0!==e.updateWhileInteracting&&e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(hB)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let r=this.getDeclutter();r in e.declutter||(e.declutter[r]=new zv(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(hB,e)}setStyle(e){this.style_=void 0===e?xw:e;let t=function(e){if(void 0===e)return xw;if(!e)return null;if("function"==typeof e||e instanceof Cw)return e;if(!Array.isArray(e))return Hx([e]);if(0===e.length)return[];let t=e.length,r=e[0];if(r instanceof Cw){let r=new Array(t);for(let i=0;i<t;++i){let t=e[i];if(!(t instanceof Cw))throw new Error("Expected a list of style instances");r[i]=t}return r}if("style"in r){let r=new Array(t);for(let i=0;i<t;++i){let t=e[i];if(!("style"in t))throw new Error("Expected a list of rules with a style property");r[i]=t}return zx(r)}return Hx(e)}(e);this.styleFunction_=null===e?void 0:function(e){let t;if("function"==typeof e)t=e;else{let r;Array.isArray(e)?r=e:(rg("function"==typeof e.getZIndex,"Expected an `Style` or an array of `Style`"),r=[e]),t=function(){return r}}return t}(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}},uB=class extends AB{constructor(e){super(e)}createRenderer(){return new fb(this)}},cB=0,dB=2,pB=3,fB=4,gB=class{constructor(e,t,r){this.decay_=e,this.minVelocity_=t,this.delay_=r,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let r=t-3;for(;r>0&&this.points_[r+2]>e;)r-=3;let i=this.points_[t+2]-this.points_[r+2];if(i<1e3/60)return!1;let n=this.points_[t]-this.points_[r],a=this.points_[t+1]-this.points_[r+1];return this.angle_=Math.atan2(a,n),this.initialVelocity_=Math.sqrt(n*n+a*a)/i,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},mB=class extends up{constructor(e,t,r){super(e),this.map=t,this.frameState=void 0!==r?r:null}},yB=class extends mB{constructor(e,t,r,i,n,a){super(e,t,n),this.originalEvent=r,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==i&&i,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}},_B={SINGLECLICK:"singleclick",CLICK:Kd,DBLCLICK:qd,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},vB="pointermove",wB="pointerdown",bB=class extends cp{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===t?1:t,this.down_=null;let r=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=r,this.pointerdownListenerKey_=dp(r,wB,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=dp(r,vB,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener($d,this.boundHandleTouchMove_,!!g_&&{passive:!1})}emulateClick_(e){let t=new yB(_B.CLICK,this.map_,e);this.dispatchEvent(t),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new yB(_B.DBLCLICK,this.map_,e),this.dispatchEvent(t)):this.clickTimeoutId_=setTimeout((()=>{this.clickTimeoutId_=void 0;let t=new yB(_B.SINGLECLICK,this.map_,e);this.dispatchEvent(t)}),250)}updateActivePointers_(e){let t=e,r=t.pointerId;if(t.type==_B.POINTERUP||t.type==_B.POINTERCANCEL){delete this.trackedTouches_[r];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else(t.type==_B.POINTERDOWN||t.type==_B.POINTERMOVE)&&(this.trackedTouches_[r]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new yB(_B.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(fp),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return 0===e.button}handlePointerDown_(e){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(e);let t=new yB(_B.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),0===this.dragListenerKeys_.length){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(dp(e,_B.POINTERMOVE,this.handlePointerMove_,this),dp(e,_B.POINTERUP,this.handlePointerUp_,this),dp(this.element_,_B.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(dp(this.element_.getRootNode(),_B.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new yB(_B.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!(!this.down_||!this.isMoving_(e));this.dispatchEvent(new yB(_B.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&("boolean"!=typeof e.cancelable||!0===e.cancelable)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(fp(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener($d,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(fp(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(fp),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},xB="layergroup",BB="size",CB="target",SB="view",EB=1/0,IB=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,hp(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,r=e[0];1==e.length?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let i=this.keyFunction_(r);return delete this.queuedElements_[i],r}enqueue(e){rg(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t!=EB&&(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(e){return 2*e+1}getRightChildIndex_(e){return 2*e+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return 0===this.elements_.length}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){let t=this.elements_,r=this.priorities_,i=t.length,n=t[e],a=r[e],s=e;for(;e<i>>1;){let n=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),s=a<i&&r[a]<r[n]?a:n;t[e]=t[s],r[e]=r[s],e=s}t[e]=n,r[e]=a,this.siftDown_(s,e)}siftDown_(e,t){let r=this.elements_,i=this.priorities_,n=r[t],a=i[t];for(;t>e;){let e=this.getParentIndex_(t);if(!(i[e]>a))break;r[t]=r[e],i[t]=i[e],t=e}r[t]=n,i[t]=a}reprioritize(){let e,t,r,i=this.priorityFunction_,n=this.elements_,a=this.priorities_,s=0,o=n.length;for(t=0;t<o;++t)e=n[t],r=i(e),r==EB?delete this.queuedElements_[this.keyFunction_(e)]:(a[s]=r,n[s++]=e);n.length=s,a.length=s,this.heapify_()}},TB=class extends IB{constructor(e,t){super((t=>e.apply(null,t)),(e=>e[0].getKey())),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(Vd,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,r=t.getState();if(r===dB||r===pB||r===fB){r!==pB&&t.removeEventListener(Vd,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let r=0;for(;this.tilesLoading_<e&&r<t&&this.getCount()>0;){let e=this.dequeue()[0],t=e.getKey();e.getState()===cB&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++r,e.load())}}};var FB=class extends ly{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===e.collapsed||e.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==e.collapsible,this.collapsible_=void 0===e.collapsible||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;let t=void 0!==e.className?e.className:"ol-attribution",r=void 0!==e.tipLabel?e.tipLabel:"Attributions",i=void 0!==e.expandClassName?e.expandClassName:t+"-expand",n=void 0!==e.collapseLabel?e.collapseLabel:"›",a=void 0!==e.collapseClassName?e.collapseClassName:t+"-collapse";"string"==typeof n?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=n,this.collapseLabel_.className=a):this.collapseLabel_=n;let s=void 0!==e.label?e.label:"i";"string"==typeof s?(this.label_=document.createElement("span"),this.label_.textContent=s,this.label_.className=i):this.label_=s;let o=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=r,this.toggleButton_.appendChild(o),this.toggleButton_.addEventListener(Kd,this.handleClick_.bind(this),!1);let l=t+" "+rv+" "+iv+(this.collapsed_&&this.collapsible_?" "+nv:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=l,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=this.getMap().getAllLayers(),r=new Set(t.flatMap((t=>t.getAttributions(e))));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach((e=>r.add(e))):r.add(this.attributions_)),!this.overrideCollapsible_){let e=!t.some((e=>!1===e.getSource()?.getAttributionsCollapsible()));this.setCollapsible(e)}return Array.from(r)}async updateElement_(e){if(!e)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));let t=await Promise.all(this.collectSourceAttributions_(e).map((e=>{return t=()=>e,function(){let e;try{e=t()}catch(e){return Promise.reject(e)}return e instanceof Promise?e:Promise.resolve(e)}();var t}))),r=t.length>0;if(this.renderedVisible_!=r&&(this.element.style.display=r?"":"none",this.renderedVisible_=r),!np(t,this.renderedAttributions_)){!function(e){for(;e.lastChild;)e.lastChild.remove()}(this.ulElement_);for(let e=0,r=t.length;e<r;++e){let r=document.createElement("li");r.innerHTML=t[e],this.ulElement_.appendChild(r)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(nv),this.collapsed_?x_(this.collapseLabel_,this.label_):x_(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,this.collapsible_&&this.collapsed_!==e&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}},PB=class extends ly{constructor(e){e=e||{},super({element:document.createElement("div"),render:e.render,target:e.target});let t=void 0!==e.className?e.className:"ol-rotate",r=void 0!==e.label?e.label:"⇧",i=void 0!==e.compassClassName?e.compassClassName:"ol-compass";this.label_=null,"string"==typeof r?(this.label_=document.createElement("span"),this.label_.className=i,this.label_.textContent=r):(this.label_=r,this.label_.classList.add(i));let n=e.tipLabel?e.tipLabel:"Reset rotation",a=document.createElement("button");a.className=t+"-reset",a.setAttribute("type","button"),a.title=n,a.appendChild(this.label_),a.addEventListener(Kd,this.handleClick_.bind(this),!1);let s=t+" "+rv+" "+iv,o=this.element;o.className=s,o.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=void 0!==e.duration?e.duration:250,this.autoHide_=void 0===e.autoHide||e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(tv)}handleClick_(e){e.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){let e=this.getMap().getView();if(!e)return;let t=e.getRotation();void 0!==t&&(this.duration_>0&&t%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:py}):e.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let r=t.viewState.rotation;if(r!=this.rotation_){let e="rotate("+r+"rad)";if(this.autoHide_){let e=this.element.classList.contains(tv);e||0!==r?e&&0!==r&&this.element.classList.remove(tv):this.element.classList.add(tv)}this.label_.style.transform=e}this.rotation_=r}},LB=class extends ly{constructor(e){e=e||{},super({element:document.createElement("div"),target:e.target});let t=void 0!==e.className?e.className:"ol-zoom",r=void 0!==e.delta?e.delta:1,i=void 0!==e.zoomInClassName?e.zoomInClassName:t+"-in",n=void 0!==e.zoomOutClassName?e.zoomOutClassName:t+"-out",a=void 0!==e.zoomInLabel?e.zoomInLabel:"+",s=void 0!==e.zoomOutLabel?e.zoomOutLabel:"–",o=void 0!==e.zoomInTipLabel?e.zoomInTipLabel:"Zoom in",l=void 0!==e.zoomOutTipLabel?e.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=i,h.setAttribute("type","button"),h.title=o,h.appendChild("string"==typeof a?document.createTextNode(a):a),h.addEventListener(Kd,this.handleClick_.bind(this,r),!1);let A=document.createElement("button");A.className=n,A.setAttribute("type","button"),A.title=l,A.appendChild("string"==typeof s?document.createTextNode(s):s),A.addEventListener(Kd,this.handleClick_.bind(this,-r),!1);let u=t+" "+rv+" "+iv,c=this.element;c.className=u,c.appendChild(h),c.appendChild(A),this.duration_=void 0!==e.duration?e.duration:250}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap().getView();if(!t)return;let r=t.getZoom();if(void 0!==r){let i=t.getConstrainedZoom(r+e);this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({zoom:i,duration:this.duration_,easing:py})):t.setZoom(i)}}};var MB="active";function kB(e,t,r,i){let n=e.getZoom();if(void 0===n)return;let a=e.getConstrainedZoom(n+t),s=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:s,anchor:r,duration:void 0!==i?i:250,easing:py})}var UB=class extends vp{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(MB)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(MB,e)}setMap(e){this.map_=e}},RB=class extends UB{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=void 0!==e.duration?e.duration:250}handleEvent(e){let t=!1;if(e.type==_B.DBLCLICK){let r=e.originalEvent,i=e.map,n=e.coordinate,a=r.shiftKey?-this.delta_:this.delta_;kB(i.getView(),a,n,this.duration_),r.preventDefault(),t=!0}return!t}};function DB(e){let t=arguments;return function(e){let r=!0;for(let i=0,n=t.length;i<n&&(r=r&&t[i](e),r);++i);return r}}var NB=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},OB=function(e){let t=e.map.getTargetElement(),r=t.getRootNode();return!(r instanceof ShadowRoot?r.host:t).hasAttribute("tabindex")||function(e){let t=e.map.getTargetElement(),r=t.getRootNode(),i=e.map.getOwnerDocument().activeElement;return r instanceof ShadowRoot?r.host.contains(i):t.contains(i)}(e)},QB=ap,zB=function(e){let t=e.originalEvent;return"pointerId"in t&&0==t.button&&!(u_&&c_&&t.ctrlKey)},HB=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},jB=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},VB=function(e){let t=e.originalEvent,r=t.target.tagName;return"INPUT"!==r&&"SELECT"!==r&&"TEXTAREA"!==r&&!t.target.isContentEditable},GB=function(e){let t=e.originalEvent;return"pointerId"in t&&"mouse"==t.pointerType},KB=function(e){let t=e.originalEvent;return"pointerId"in t&&t.isPrimary&&0===t.button};function qB(e){let t=e.length,r=0,i=0;for(let n=0;n<t;n++)r+=e[n].clientX,i+=e[n].clientY;return{clientX:r/t,clientY:i/t}}var ZB=class extends UB{constructor(e){super(e=e||{}),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==_B.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==_B.POINTERUP){let t=this.handleUpEvent(e);this.handlingDownUpSequence=t&&this.targetPointers.length>0}}else if(e.type==_B.POINTERDOWN){let r=this.handleDownEvent(e);this.handlingDownUpSequence=r,t=this.stopDown(r)}else e.type==_B.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}},WB=class extends ZB{constructor(e){super({stopDown:sp}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:DB(HB,KB);this.condition_=e.onFocusOnly?DB(OB,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let r=this.targetPointers,i=t.getEventPixel(qB(r));if(r.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){let t=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],r=e.map.getView();(function(e,t){e[0]*=t,e[1]*=t})(t,r.getResolution()),kp(t,r.getRotation()),r.adjustCenterInternal(t)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=i,this.lastPointersCount_=r.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,r=t.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),n=r.getCenterInternal(),a=t.getPixelFromCoordinateInternal(n),s=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(i),a[1]-e*Math.sin(i)]);r.animateInternal({center:r.getConstrainedCenter(s),duration:500,easing:py})}return this.panning_&&(this.panning_=!1,r.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},$B=class extends ZB{constructor(e){e=e||{},super({stopDown:sp}),this.condition_=e.condition?e.condition:NB,this.lastAngle_=void 0,this.duration_=void 0!==e.duration?e.duration:250}handleDragEvent(e){if(!GB(e))return;let t=e.map,r=t.getView();if(r.getConstraints().rotation===vy)return;let i=t.getSize(),n=e.pixel,a=Math.atan2(i[1]/2-n[1],n[0]-i[0]/2);if(void 0!==this.lastAngle_){let e=a-this.lastAngle_;r.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return!GB(e)||(e.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(e){return!!(GB(e)&&zB(e)&&this.condition_(e))&&(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)}},XB=class extends Yd{constructor(e){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let e=this.startPixel_,t=this.endPixel_,r="px",i=this.element_.style;i.left=Math.min(e[0],t[0])+r,i.top=Math.min(e[1],t[1])+r,i.width=Math.abs(t[0]-e[0])+r,i.height=Math.abs(t[1]-e[1])+r}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;let e=this.startPixel_,t=this.endPixel_,r=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);r[4]=r[0].slice(),this.geometry_?this.geometry_.setCoordinates([r]):this.geometry_=new hm([r])}getGeometry(){return this.geometry_}},YB="boxstart",JB="boxdrag",eC="boxend",tC="boxcancel",rC=class extends up{constructor(e,t,r){super(e),this.coordinate=t,this.mapBrowserEvent=r}},iC=class extends ZB{constructor(e){super(),this.on,this.once,this.un,e=e??{},this.box_=new XB(e.className||"ol-dragbox"),this.minArea_=e.minArea??64,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=e.condition??zB,this.boxEndCondition_=e.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(e,t,r){let i=r[0]-t[0],n=r[1]-t[1];return i*i+n*n>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new rC(JB,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new rC(t?eC:tC,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return!!this.condition_(e)&&(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new rC(YB,e.coordinate,e)),!0)}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new rC(tC,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new rC(tC,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}},nC=class extends iC{constructor(e){super({condition:(e=e||{}).condition?e.condition:jB,className:e.className||"ol-dragzoom",minArea:e.minArea}),this.duration_=void 0!==e.duration?e.duration:200,this.out_=void 0!==e.out&&e.out}onBoxEnd(e){let t=this.getMap().getView(),r=this.getGeometry();if(this.out_){let e=t.rotatedExtentForGeometry(r),i=t.getResolutionForExtentInternal(e),n=t.getResolution()/i;r=r.clone(),r.scale(n*n)}t.fitInternal(r,{duration:this.duration_,easing:py})}},aC="ArrowLeft",sC="ArrowUp",oC="ArrowRight",lC="ArrowDown",hC=class extends UB{constructor(e){super(),e=e||{},this.defaultCondition_=function(e){return HB(e)&&VB(e)},this.condition_=void 0!==e.condition?e.condition:this.defaultCondition_,this.duration_=void 0!==e.duration?e.duration:100,this.pixelDelta_=void 0!==e.pixelDelta?e.pixelDelta:128}handleEvent(e){let t=!1;if(e.type==Zd){let r=e.originalEvent,i=r.key;if(this.condition_(e)&&(i==lC||i==aC||i==oC||i==sC)){let n=e.map.getView(),a=n.getResolution()*this.pixelDelta_,s=0,o=0;i==lC?o=-a:i==aC?s=-a:i==oC?s=a:o=a;let l=[s,o];kp(l,n.getRotation()),function(e,t,r){let i=e.getCenterInternal();if(i){let n=[i[0]+t[0],i[1]+t[1]];e.animateInternal({duration:void 0!==r?r:250,easing:gy,center:e.getConstrainedCenter(n)})}}(n,l,this.duration_),r.preventDefault(),t=!0}}return!t}},AC=class extends UB{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(e){return!function(e){let t=e.originalEvent;return c_?t.metaKey:t.ctrlKey}(e)&&VB(e)},this.delta_=e.delta?e.delta:1,this.duration_=void 0!==e.duration?e.duration:100}handleEvent(e){let t=!1;if(e.type==Zd||e.type==Wd){let r=e.originalEvent,i=r.key;if(this.condition_(e)&&("+"===i||"-"===i)){let n=e.map,a="+"===i?this.delta_:-this.delta_;kB(n.getView(),a,void 0,this.duration_),r.preventDefault(),t=!0}}return!t}},uC=class extends UB{constructor(e){super(e=e||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==e.maxDelta?e.maxDelta:1,this.duration_=void 0!==e.duration?e.duration:250,this.timeout_=void 0!==e.timeout?e.timeout:80,this.useAnchor_=void 0===e.useAnchor||e.useAnchor,this.constrainResolution_=void 0!==e.constrainResolution&&e.constrainResolution;let t=e.condition?e.condition:QB;this.condition_=e.onFocusOnly?DB(OB,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;let e=this.getMap();e&&e.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==Xd)return!0;let t=e.map,r=e.originalEvent;r.preventDefault(),this.useAnchor_&&(this.lastAnchor_=e.pixel);let i=r.deltaY;switch(r.deltaMode){case WheelEvent.DOM_DELTA_LINE:i*=40;break;case WheelEvent.DOM_DELTA_PAGE:i*=300}if(0===i)return!1;this.lastDelta_=i;let n=Date.now();void 0===this.startTime_&&(this.startTime_=n),(!this.mode_||n-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?"trackpad":"wheel");let a=t.getView();if("trackpad"===this.mode_&&!a.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=n,!1;this.totalDelta_+=i;let s=Math.max(this.timeout_-(n-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),s),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let r=-Bp(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(r=r?r>0?1:-1:0),kB(t,r,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}},cC=class extends ZB{constructor(e){let t=e=e||{};t.stopDown||(t.stopDown=sp),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==e.threshold?e.threshold:.3,this.duration_=void 0!==e.duration?e.duration:250}handleDragEvent(e){let t=0,r=this.targetPointers[0],i=this.targetPointers[1],n=Math.atan2(i.clientY-r.clientY,i.clientX-r.clientX);if(void 0!==this.lastAngle_){let e=n-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=n;let a=e.map,s=a.getView();s.getConstraints().rotation!==vy&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(qB(this.targetPointers))),this.rotating_&&(a.render(),s.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return!(this.targetPointers.length<2)||(e.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}},dC=class extends ZB{constructor(e){let t=e=e||{};t.stopDown||(t.stopDown=sp),super(t),this.anchor_=null,this.duration_=void 0!==e.duration?e.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,r=this.targetPointers[0],i=this.targetPointers[1],n=r.clientX-i.clientX,a=r.clientY-i.clientY,s=Math.sqrt(n*n+a*a);void 0!==this.lastDistance_&&(t=this.lastDistance_/s),this.lastDistance_=s;let o=e.map,l=o.getView();1!=t&&(this.lastScaleDelta_=t),this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(qB(this.targetPointers))),o.render(),l.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),r=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,r),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};var pC=class extends up{constructor(e,t){super(e),this.layer=t}},fC="layers",gC=class e extends Qy{constructor(e){e=e||{};let t=Object.assign({},e);delete t.layers;let r=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(fC,this.handleLayersChanged_),r?Array.isArray(r)?r=new $y(r.slice(),{unique:!0}):rg("function"==typeof r.getArray,"Expected `layers` to be an array or a `Collection`"):r=new $y(void 0,{unique:!0}),this.setLayers(r)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(fp),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(dp(e,Ky,this.handleLayersAdd_,this),dp(e,qy,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(fp);hp(this.listenerKeys_);let t=e.getArray();for(let e=0,r=t.length;e<r;e++){let r=t[e];this.registerLayerListeners_(r),this.dispatchEvent(new pC("addlayer",r))}this.changed()}registerLayerListeners_(t){let r=[dp(t,jd,this.handleLayerChange_,this),dp(t,Vd,this.handleLayerChange_,this)];t instanceof e&&r.push(dp(t,"addlayer",this.handleLayerGroupAdd_,this),dp(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Hd(t)]=r}handleLayerGroupAdd_(e){this.dispatchEvent(new pC("addlayer",e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new pC("removelayer",e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new pC("addlayer",t)),this.changed()}handleLayersRemove_(e){let t=e.element,r=Hd(t);this.listenerKeys_[r].forEach(fp),delete this.listenerKeys_[r],this.dispatchEvent(new pC("removelayer",t)),this.changed()}getLayers(){return this.get(fC)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,r=e.length;t<r;++t)this.dispatchEvent(new pC("removelayer",e[t]))}this.set(fC,e)}getLayersArray(e){return e=void 0!==e?e:[],this.getLayers().forEach((function(t){t.getLayersArray(e)})),e}getLayerStatesArray(e){let t=void 0!==e?e:[],r=t.length;this.getLayers().forEach((function(e){e.getLayerStatesArray(t)}));let i=this.getLayerState(),n=i.zIndex;!e&&void 0===i.zIndex&&(n=0);for(let e=r,a=t.length;e<a;e++){let r=t[e];r.opacity*=i.opacity,r.visible=r.visible&&i.visible,r.maxResolution=Math.min(r.maxResolution,i.maxResolution),r.minResolution=Math.max(r.minResolution,i.minResolution),r.minZoom=Math.max(r.minZoom,i.minZoom),r.maxZoom=Math.min(r.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==r.extent?r.extent=Md(r.extent,i.extent):r.extent=i.extent),void 0===r.zIndex&&(r.zIndex=n)}return t}getSourceState(){return"ready"}};function mC(e,t){q_.expire()}var yC=class extends Yd{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){Qd()}calculateMatrices2D(e){let t=e.viewState,r=e.coordinateToPixelTransform,i=e.pixelToCoordinateTransform;ng(r,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),ag(i,r)}forEachFeatureAtCoordinate(e,t,r,i,n,a,s,o){let l,h=t.viewState;function A(e,t,r,i){return n.call(a,t,e?r:null,i)}let u=h.projection,c=Up(e.slice(),u),d=[[0,0]];if(u.canWrapX()&&i){let e=Rd(u.getExtent());d.push([-e,0],[e,0])}let p=t.layerStatesArray,f=p.length,g=[],m=[];for(let i=0;i<d.length;i++)for(let n=f-1;n>=0;--n){let a=p[n],u=a.layer;if(u.hasRenderer()&&zy(a,h)&&s.call(o,u)){let n=u.getRenderer(),s=u.getSource();if(n&&s){let o=s.getWrapX()?c:e,h=A.bind(null,a.managed);m[0]=o[0]+d[i][0],m[1]=o[1]+d[i][1],l=n.forEachFeatureAtCoordinate(m,t,r,h,g)}if(l)return l}}if(0===g.length)return;let y=1/g.length;return g.forEach(((e,t)=>e.distanceSq+=t*y)),g.sort(((e,t)=>e.distanceSq-t.distanceSq)),g.some((e=>l=e.callback(e.feature,e.layer,e.geometry))),l}hasFeatureAtCoordinate(e,t,r,i,n,a){return void 0!==this.forEachFeatureAtCoordinate(e,t,r,i,ap,this,n,a)}getMap(){return this.map_}renderFrame(e){Qd()}scheduleExpireIconCache(e){q_.canExpireCache()&&e.postRenderFunctions.push(mC)}},_C=class extends yC{constructor(e){super(e),this.fontChangeListenerKey_=dp(yv,jd,e.redrawText,e),this.element_=document.createElement("div");let t=this.element_.style;t.position="absolute",t.width="100%",t.height="100%",t.zIndex="0",this.element_.className=rv+" ol-layers";let r=e.getViewport();r.insertBefore(this.element_,r.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let r=this.getMap();if(r.hasListener(e)){let i=new Ab(e,void 0,t);r.dispatchEvent(i)}}disposeInternal(){fp(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(e),this.dispatchRenderEvent(Ey,e);let t=e.layerStatesArray.sort(((e,t)=>e.zIndex-t.zIndex));t.some((e=>e.layer instanceof AB&&e.layer.getDeclutter()))&&(e.declutter={});let r=e.viewState;this.children_.length=0;let i=[],n=null;for(let a=0,s=t.length;a<s;++a){let s=t[a];e.layerIndex=a;let o=s.layer,l=o.getSourceState();if(!zy(s,r)||"ready"!=l&&"undefined"!=l){o.unrender();continue}let h=o.render(e,n);h&&(h!==n&&(this.children_.push(h),n=h),i.push(s))}this.declutter(e,i),function(e,t){let r=e.childNodes;for(let i=0;;++i){let n=r[i],a=t[i];if(!n&&!a)break;if(n!==a){if(!n){e.appendChild(a);continue}if(!a){e.removeChild(n),--i;continue}e.insertBefore(a,n)}}}(this.element_,this.children_),this.dispatchRenderEvent(Iy,e),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let r=t.length-1;r>=0;--r){let i=t[r],n=i.layer;n.getDeclutter()&&n.renderDeclutter(e,i)}t.forEach((t=>t.layer.renderDeferred(e)))}}};function vC(e){e instanceof jy?e.setMapInternal(null):e instanceof gC&&e.getLayers().forEach(vC)}function wC(e,t){if(e instanceof jy)e.setMapInternal(t);else if(e instanceof gC){let r=e.getLayers().getArray();for(let e=0,i=r.length;e<i;++e)wC(r[e],t)}}var bC=class extends vp{constructor(e){super(),e=e||{},this.on,this.once,this.un;let t=function(e){let t=null;void 0!==e.keyboardEventTarget&&(t="string"==typeof e.keyboardEventTarget?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let r,i,n,a={},s=e.layers&&"function"==typeof e.layers.getLayers?e.layers:new gC({layers:e.layers});return a[xB]=s,a[CB]=e.target,a[SB]=e.view instanceof By?e.view:new By,void 0!==e.controls&&(Array.isArray(e.controls)?r=new $y(e.controls.slice()):(rg("function"==typeof e.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),r=e.controls)),void 0!==e.interactions&&(Array.isArray(e.interactions)?i=new $y(e.interactions.slice()):(rg("function"==typeof e.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),i=e.interactions)),void 0!==e.overlays?Array.isArray(e.overlays)?n=new $y(e.overlays.slice()):(rg("function"==typeof e.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),n=e.overlays):n=new $y,{controls:r,interactions:i,keyboardEventTarget:t,overlays:n,values:a}}(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==e.maxTilesLoading?e.maxTilesLoading:16,this.pixelRatio_=void 0!==e.pixelRatio?e.pixelRatio:d_,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver((()=>this.updateSize())),this.controls=t.controls||function(e){e=e||{};let t=new $y;return(void 0===e.zoom||e.zoom)&&t.push(new LB(e.zoomOptions)),(void 0===e.rotate||e.rotate)&&t.push(new PB(e.rotateOptions)),(void 0===e.attribution||e.attribution)&&t.push(new FB(e.attributionOptions)),t}(),this.interactions=t.interactions||function(e){e=e||{};let t=new $y,r=new gB(-.005,.05,100);return(void 0===e.altShiftDragRotate||e.altShiftDragRotate)&&t.push(new $B),(void 0===e.doubleClickZoom||e.doubleClickZoom)&&t.push(new RB({delta:e.zoomDelta,duration:e.zoomDuration})),(void 0===e.dragPan||e.dragPan)&&t.push(new WB({onFocusOnly:e.onFocusOnly,kinetic:r})),(void 0===e.pinchRotate||e.pinchRotate)&&t.push(new cC),(void 0===e.pinchZoom||e.pinchZoom)&&t.push(new dC({duration:e.zoomDuration})),(void 0===e.keyboard||e.keyboard)&&(t.push(new hC),t.push(new AC({delta:e.zoomDelta,duration:e.zoomDuration}))),(void 0===e.mouseWheelZoom||e.mouseWheelZoom)&&t.push(new uC({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(void 0===e.shiftDragZoom||e.shiftDragZoom)&&t.push(new nC({duration:e.zoomDuration})),t}({onFocusOnly:!0}),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new TB(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(xB,this.handleLayerGroupChanged_),this.addChangeListener(SB,this.handleViewChanged_),this.addChangeListener(BB,this.handleSizeChanged_),this.addChangeListener(CB,this.handleTargetChanged_),this.setProperties(t.values);let r=this;e.view&&!(e.view instanceof By)&&e.view.then((function(e){r.setView(new By(e))})),this.controls.addEventListener(Ky,(e=>{e.element.setMap(this)})),this.controls.addEventListener(qy,(e=>{e.element.setMap(null)})),this.interactions.addEventListener(Ky,(e=>{e.element.setMap(this)})),this.interactions.addEventListener(qy,(e=>{e.element.setMap(null)})),this.overlays_.addEventListener(Ky,(e=>{this.addOverlayInternal_(e.element)})),this.overlays_.addEventListener(qy,(e=>{let t=e.element.getId();void 0!==t&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)})),this.controls.forEach((e=>{e.setMap(this)})),this.interactions.forEach((e=>{e.setMap(this)})),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){wC(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();void 0!==t&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,r){if(!this.frameState_||!this.renderer_)return;let i=this.getCoordinateFromPixelInternal(e),n=void 0!==(r=void 0!==r?r:{}).hitTolerance?r.hitTolerance:0,a=void 0!==r.layerFilter?r.layerFilter:ap,s=!1!==r.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,n,s,t,null,a,null)}getFeaturesAtPixel(e,t){let r=[];return this.forEachFeatureAtPixel(e,(function(e){r.push(e)}),t),r}getAllLayers(){let e=[];return function t(r){r.forEach((function(r){r instanceof gC?t(r.getLayers()):e.push(r)}))}(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let r=this.getCoordinateFromPixelInternal(e),i=void 0!==(t=void 0!==t?t:{}).layerFilter?t.layerFilter:ap,n=void 0!==t.hitTolerance?t.hitTolerance:0,a=!1!==t.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(r,this.frameState_,n,a,i,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),r=this.getSize(),i=t.width/r[0],n=t.height/r[1],a="changedTouches"in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/i,(a.clientY-t.top)/n]}getTarget(){return this.get(CB)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return Yf(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?ig(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return void 0!==t?t:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(xB)}setLayers(e){let t=this.getLayerGroup();if(e instanceof $y)return void t.setLayers(e);let r=t.getLayers();r.clear(),r.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,r=e.length;t<r;++t){let r=e[t];if(!r.visible)continue;let i=r.layer.getRenderer();if(i&&!i.ready)return!0;let n=r.layer.getSource();if(n&&n.loading)return!0}return!1}getPixelFromCoordinate(e){let t=Jf(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?ig(t.coordinateToPixelTransform,e.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(BB)}getView(){return this.get(SB)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,r,i){return function(e,t,r,i,n){if(!e||!(r in e.wantedTiles))return EB;if(!e.wantedTiles[r][t.getKey()])return EB;let a=e.viewState.center,s=i[0]-a[0],o=i[1]-a[1];return 65536*Math.log(n)+Math.sqrt(s*s+o*o)/n}(this.frameState_,e,t,r,i)}handleBrowserEvent(e,t){t=t||e.type;let r=new yB(t,this,e);this.handleMapBrowserEvent(r)}handleMapBrowserEvent(e){if(!this.frameState_)return;let t=e.originalEvent,r=t.type;if(r===wB||r===Xd||r===Zd){let e=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():e,i=t.target,n=r instanceof ShadowRoot?r.host===i?r.host.ownerDocument:r:r===e?e.documentElement:r;if(this.overlayContainerStopEvent_.contains(i)||!n.contains(i))return}if(e.frameState=this.frameState_,!1!==this.dispatchEvent(e)){let t=this.getInteractions().getArray().slice();for(let r=t.length-1;r>=0;r--){let i=t[r];if(i.getMap()===this&&i.getActive()&&this.getTargetElement()&&(!i.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let r=this.maxTilesLoading_,i=r;if(e){let t=e.viewHints;if(t[hy]||t[Ay]){let t=Date.now()-e.time>8;r=t?0:8,i=t?0:2}}t.getTilesLoading()<r&&(t.reprioritize(),t.loadMoreTiles(r,i))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Ty)&&this.renderer_.dispatchRenderEvent(Ty,e),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new mB(oy,this,e)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new mB(sy,this,e))));let r=this.postRenderFunctions_;if(e)for(let t=0,i=r.length;t<i;++t)r[t](this,e);r.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let e=0,t=this.targetChangeHandlerKeys_.length;e<t;++e)fp(this.targetChangeHandlerKeys_[e]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(Gd,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Xd,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);let e=this.targetElement_.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.unobserve(e.host),this.setSize(void 0)}let e=this.getTarget(),t="string"==typeof e?document.getElementById(e):e;if(this.targetElement_=t,t){t.appendChild(this.viewport_),this.renderer_||(this.renderer_=new _C(this)),this.mapBrowserEventHandler_=new bB(this,this.moveTolerance_);for(let e in _B)this.mapBrowserEventHandler_.addEventListener(_B[e],this.handleMapBrowserEvent.bind(this));let e;if(this.viewport_.addEventListener(Gd,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Xd,this.boundHandleBrowserEvent_,!!g_&&{passive:!1}),this.keyboardEventTarget_)e=this.keyboardEventTarget_;else{let r=t.getRootNode();e=r instanceof ShadowRoot?r.host:t}this.targetChangeHandlerKeys_=[dp(e,Zd,this.handleBrowserEvent,this),dp(e,Wd,this.handleBrowserEvent,this)];let r=t.getRootNode();r instanceof ShadowRoot&&this.resizeObserver_.observe(r.host),this.resizeObserver_.observe(t)}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(fp(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(fp(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);let e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=dp(e,jd,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=dp(e,Vd,this.handleViewPropertyChanged_,this),e.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(fp),this.layerGroupPropertyListenerKeys_=null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new pC("addlayer",e)),this.layerGroupPropertyListenerKeys_=[dp(e,jd,this.render,this),dp(e,Vd,this.render,this),dp(e,"addlayer",this.handleLayerAdd_,this),dp(e,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;let e=this.frameState_.layerStatesArray;for(let t=0,r=e.length;t<r;++t){let r=e[t].layer;r.hasRenderer()&&r.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){vC(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),r=this.getView(),i=this.frameState_,n=null;if(void 0!==t&&gw(t)&&r&&r.isDef()){let i=r.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=r.getState();if(n={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:Pd(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:i,wantedTiles:{},mapId:Hd(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;n.nextExtent=Pd(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=n,this.renderer_.renderFrame(n),n&&(n.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,n.postRenderFunctions),i&&(!this.previousExtent_||!Nd(this.previousExtent_)&&!xd(n.extent,this.previousExtent_))&&(this.dispatchEvent(new mB(ny,this,i)),this.previousExtent_=vd(this.previousExtent_)),this.previousExtent_&&!n.viewHints[hy]&&!n.viewHints[Ay]&&!xd(n.extent,this.previousExtent_)&&(this.dispatchEvent(new mB(ay,this,n)),dd(n.extent,this.previousExtent_))),this.dispatchEvent(new mB(iy,this,n)),this.renderComplete_=(this.hasListener(sy)||this.hasListener(oy)||this.hasListener(Ty))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout((()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()}),0))}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new pC("removelayer",t)),this.set(xB,e)}setSize(e){this.set(BB,e)}setTarget(e){this.set(CB,e)}setView(e){if(!e||e instanceof By)return void this.set(SB,e);this.set(SB,new By);let t=this;e.then((function(e){t.setView(new By(e))}))}updateSize(){let e,t=this.getTargetElement();if(t){let r=getComputedStyle(t),i=t.offsetWidth-parseFloat(r.borderLeftWidth)-parseFloat(r.paddingLeft)-parseFloat(r.paddingRight)-parseFloat(r.borderRightWidth),n=t.offsetHeight-parseFloat(r.borderTopWidth)-parseFloat(r.paddingTop)-parseFloat(r.paddingBottom)-parseFloat(r.borderBottomWidth);!isNaN(i)&&!isNaN(n)&&(e=[Math.max(0,i),Math.max(0,n)],!gw(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&xp("No map visible because the map container's width or height are 0."))}let r=this.getSize();e&&(!r||!np(e,r))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}},xC="http://www.w3.org/2001/XMLSchema-instance";function BC(e,t){return jC().createElementNS(e,t)}function CC(e,t){return SC(e,t,[]).join("")}function SC(e,t,r){if(e.nodeType==Node.CDATA_SECTION_NODE||e.nodeType==Node.TEXT_NODE)t?r.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,"")):r.push(e.nodeValue);else{let i;for(i=e.firstChild;i;i=i.nextSibling)SC(i,t,r)}return r}function EC(e){return"documentElement"in e}function IC(e){return(new DOMParser).parseFromString(e,"application/xml")}function TC(e,t){return function(r,i){let n=e.call(t??this,r,i);if(void 0!==n){ip(i[i.length-1],n)}}}function FC(e,t){return function(r,i){let n=e.call(t??this,r,i);void 0!==n&&i[i.length-1].push(n)}}function PC(e,t){return function(r,i){let n=e.call(t??this,r,i);void 0!==n&&(i[i.length-1]=n)}}function LC(e,t,r){return function(i,n){let a=e.call(r??this,i,n);if(void 0!==a){n[n.length-1][void 0!==t?t:i.localName]=a}}}function MC(e,t){return function(r,i,n){e.call(t??this,r,i,n),n[n.length-1].node.appendChild(r)}}function kC(e,t){return function(r,i,n){let a=i[i.length-1].node,s=e;return void 0===s&&(s=n),BC(void 0!==t?t:a.namespaceURI,s)}}var UC,RC,DC=kC();function NC(e,t){let r=t.length,i=new Array(r);for(let n=0;n<r;++n)i[n]=e[t[n]];return i}function OC(e,t,r){let i,n;for(r=void 0!==r?r:{},i=0,n=e.length;i<n;++i)r[e[i]]=t;return r}function QC(e,t,r,i){let n;for(n=t.firstElementChild;n;n=n.nextElementSibling){let t=e[n.namespaceURI];if(void 0!==t){let e=t[n.localName];void 0!==e&&e.call(i,n,r)}}}function zC(e,t,r,i,n){return i.push(e),QC(t,r,i,n),i.pop()}function HC(e,t,r,i,n,a,s){return n.push(e),function(e,t,r,i,n,a){let s,o,l=(void 0!==n?n:r).length;for(let h=0;h<l;++h)s=r[h],void 0!==s&&(o=t.call(a,s,i,void 0!==n?n[h]:void 0),void 0!==o&&e[o.namespaceURI][o.localName].call(a,o,s,i))}(t,r,i,n,a,s),n.pop()}function jC(){return void 0===RC&&typeof document<"u"&&(RC=document.implementation.createDocument("","",null)),RC}var VC=class extends _m{constructor(){super(),this.xmlSerializer_=(void 0===UC&&typeof XMLSerializer<"u"&&(UC=new XMLSerializer),UC)}getType(){return"xml"}readFeature(e,t){if(!e)return null;if("string"==typeof e){let r=IC(e);return this.readFeatureFromDocument(r,t)}return EC(e)?this.readFeatureFromDocument(e,t):this.readFeatureFromNode(e,t)}readFeatureFromDocument(e,t){let r=this.readFeaturesFromDocument(e,t);return r.length>0?r[0]:null}readFeatureFromNode(e,t){return null}readFeatures(e,t){if(!e)return[];if("string"==typeof e){let r=IC(e);return this.readFeaturesFromDocument(r,t)}return EC(e)?this.readFeaturesFromDocument(e,t):this.readFeaturesFromNode(e,t)}readFeaturesFromDocument(e,t){let r=[];for(let i=e.firstChild;i;i=i.nextSibling)i.nodeType==Node.ELEMENT_NODE&&ip(r,this.readFeaturesFromNode(i,t));return r}readFeaturesFromNode(e,t){return Qd()}readGeometry(e,t){if(!e)return null;if("string"==typeof e){let r=IC(e);return this.readGeometryFromDocument(r,t)}return EC(e)?this.readGeometryFromDocument(e,t):this.readGeometryFromNode(e,t)}readGeometryFromDocument(e,t){return null}readGeometryFromNode(e,t){return null}readProjection(e){if(!e)return null;if("string"==typeof e){let t=IC(e);return this.readProjectionFromDocument(t)}return EC(e)?this.readProjectionFromDocument(e):this.readProjectionFromNode(e)}readProjectionFromDocument(e){return this.dataProjection}readProjectionFromNode(e){return this.dataProjection}writeFeature(e,t){let r=this.writeFeatureNode(e,t);return this.xmlSerializer_.serializeToString(r)}writeFeatureNode(e,t){return null}writeFeatures(e,t){let r=this.writeFeaturesNode(e,t);return this.xmlSerializer_.serializeToString(r)}writeFeaturesNode(e,t){return null}writeGeometry(e,t){let r=this.writeGeometryNode(e,t);return this.xmlSerializer_.serializeToString(r)}writeGeometryNode(e,t){return null}};function GC(e){return function(e){let t=/^\s*(true|1)|(false|0)\s*$/.exec(e);if(t)return void 0!==t[1]||!1}(CC(e,!1))}function KC(e){return function(e){let t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}(CC(e,!1))}function qC(e){return CC(e,!1).trim()}function ZC(e,t){JC(e,t?"1":"0")}function WC(e,t){let r=t.toPrecision();e.appendChild(jC().createTextNode(r))}var $C=/^\s/,XC=/\s$/,YC=/(\n|\t|\r|<|&| {2})/;function JC(e,t){"string"==typeof t&&($C.test(t)||XC.test(t)||YC.test(t))?t.split("]]>").forEach(((t,r,i)=>{r<i.length-1&&(t+="]]"),r>0&&(t=">"+t),function(e,t){e.appendChild(jC().createCDATASection(t))}(e,t)})):e.appendChild(jC().createTextNode(t))}var eS,tS,rS,iS,nS,aS,sS,oS,lS,hS=["http://www.google.com/kml/ext/2.2"],AS=[null,"http://earth.google.com/kml/2.0","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.2","http://www.opengis.net/kml/2.2"],uS={fraction:"fraction",pixels:"pixels",insetPixels:"pixels"},cS=OC(AS,{ExtendedData:sE,Region:oE,MultiGeometry:LC(XS,"geometry"),LineString:LC(ZS,"geometry"),LinearRing:LC(WS,"geometry"),Point:LC(YS,"geometry"),Polygon:LC(eE,"geometry"),Style:LC(rE),StyleMap:function(e,t){let r=kS.call(this,e,t);if(!r)return;let i=t[t.length-1];if(Array.isArray(r))i.Style=r;else{if("string"!=typeof r)throw new Error("`styleMapValue` has an unknown type");i.styleUrl=r}},address:LC(qC),description:LC(qC),name:LC(qC),open:LC(GC),phoneNumber:LC(qC),styleUrl:LC(PS),visibility:LC(GC)},OC(hS,{MultiTrack:LC((function(e,t){let r=zC([],zS,e,t);if(r)return new Xg(r)}),"geometry"),Track:LC(jS,"geometry")})),dS=OC(AS,{ExtendedData:sE,Region:oE,Link:function(e,t){QC(pS,e,t)},address:LC(qC),description:LC(qC),name:LC(qC),open:LC(GC),phoneNumber:LC(qC),visibility:LC(GC)}),pS=OC(AS,{href:LC(FS)}),fS=OC(AS,{Altitude:LC(KC),Longitude:LC(KC),Latitude:LC(KC),Tilt:LC(KC),AltitudeMode:LC(qC),Heading:LC(KC),Roll:LC(KC)}),gS=OC(AS,{LatLonAltBox:function(e,t){let r=zC({},AE,e,t);if(!r)return;let i=t[t.length-1],n=[parseFloat(r.west),parseFloat(r.south),parseFloat(r.east),parseFloat(r.north)];i.extent=n,i.altitudeMode=r.altitudeMode,i.minAltitude=parseFloat(r.minAltitude),i.maxAltitude=parseFloat(r.maxAltitude)},Lod:function(e,t){let r=zC({},uE,e,t);if(!r)return;let i=t[t.length-1];i.minLodPixels=parseFloat(r.minLodPixels),i.maxLodPixels=parseFloat(r.maxLodPixels),i.minFadeExtent=parseFloat(r.minFadeExtent),i.maxFadeExtent=parseFloat(r.maxFadeExtent)}}),mS=OC(AS,["Document","Placemark"]),yS=OC(AS,{Document:MC((function(e,t,r){HC({node:e},gE,mE,t,r,void 0,this)})),Placemark:MC(zE)}),_S=null,vS=null,wS=null,bS=null,xS=null,BS=null;function CS(e){return 32/Math.min(e[0],e[1])}function SS(e){return e}function ES(e,t,r){return Array.isArray(e)?e:"string"==typeof e?ES(r[e],t,r):t}function IS(e){let t=CC(e,!1),r=/^\s*#?\s*([0-9A-Fa-f]{8})\s*$/.exec(t);if(r){let e=r[1];return[parseInt(e.substr(6,2),16),parseInt(e.substr(4,2),16),parseInt(e.substr(2,2),16),parseInt(e.substr(0,2),16)/255]}}function TS(e){let t=CC(e,!1),r=[];t=t.replace(/\s*,\s*/g,",");let i,n=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?),([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|,|$)(?:([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)(?:\s+|$))?\s*/i;for(;i=n.exec(t);){let e=parseFloat(i[1]),n=parseFloat(i[2]),a=i[3]?parseFloat(i[3]):0;r.push(e,n,a),t=t.substr(i[0].length)}if(""===t)return r}function FS(e){let t=CC(e,!1).trim(),r=e.baseURI;return(!r||"about:blank"==r)&&(r=window.location.href),r?new URL(t,r).href:t}function PS(e){let t=CC(e,!1).trim().replace(/^(?!.*#)/,"#"),r=e.baseURI;return(!r||"about:blank"==r)&&(r=window.location.href),r?new URL(t,r).href:t}function LS(e){return KC(e)}var MS=OC(AS,{Pair:function(e,t){let r=zC({},lE,e,t,this);if(!r)return;let i=r.key;if(i&&"normal"==i){let e=r.styleUrl;e&&(t[t.length-1]=e);let i=r.Style;i&&(t[t.length-1]=i)}}});function kS(e,t){return zC(void 0,MS,e,t,this)}var US=OC(AS,{Icon:LC((function(e,t){let r=zC({},VS,e,t);return r||null})),color:LC(IS),heading:LC(KC),hotSpot:LC((function(e){let t,r=e.getAttribute("xunits"),i=e.getAttribute("yunits");return t="insetPixels"!==r?"insetPixels"!==i?"bottom-left":"top-left":"insetPixels"!==i?"bottom-right":"top-right",{x:parseFloat(e.getAttribute("x")),xunits:uS[r],y:parseFloat(e.getAttribute("y")),yunits:uS[i],origin:t}})),scale:LC(LS)});var RS=OC(AS,{color:LC(IS),scale:LC(LS)});var DS=OC(AS,{color:LC(IS),width:LC(KC)});var NS=OC(AS,{color:LC(IS),fill:LC(GC),outline:LC(GC)});var OS=OC(AS,{coordinates:PC(TS)});function QS(e,t){return zC(null,OS,e,t)}var zS=OC(hS,{Track:FC(jS)});var HS=OC(AS,{when:function(e,t){let r=t[t.length-1].whens,i=CC(e,!1),n=Date.parse(i);r.push(isNaN(n)?0:n)}},OC(hS,{coord:function(e,t){let r=t[t.length-1].coordinates,i=CC(e,!1),n=/^\s*([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s+([+\-]?\d+(?:\.\d*)?(?:e[+\-]?\d*)?)\s*$/i.exec(i);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]),i=parseFloat(n[3]);r.push([e,t,i])}else r.push([])}}));function jS(e,t){let r=zC({coordinates:[],whens:[]},HS,e,t);if(!r)return;let i=[],n=r.coordinates,a=r.whens;for(let e=0,t=Math.min(n.length,a.length);e<t;++e)3==n[e].length&&i.push(n[e][0],n[e][1],n[e][2],a[e]);return new $g(i,"XYZM")}var VS=OC(AS,{href:LC(FS)},OC(hS,{x:LC(KC),y:LC(KC),w:LC(KC),h:LC(KC)}));var GS=OC(AS,{coordinates:PC(TS)});function KS(e,t){return zC(null,GS,e,t)}var qS=OC(AS,{extrude:LC(GC),tessellate:LC(GC),altitudeMode:LC(qC)});function ZS(e,t){let r=zC({},qS,e,t),i=KS(e,t);if(i){let e=new $g(i,"XYZ");return e.setProperties(r,!0),e}}function WS(e,t){let r=zC({},qS,e,t),i=KS(e,t);if(i){let e=new hm(i,"XYZ",[i.length]);return e.setProperties(r,!0),e}}var $S=OC(AS,{LineString:FC(ZS),LinearRing:FC(WS),MultiGeometry:FC(XS),Point:FC(YS),Polygon:FC(eE)});function XS(e,t){let r=zC([],$S,e,t);if(!r)return null;if(0===r.length)return new Bg(r);let i,n,a=!0,s=r[0].getType();for(let e=1,t=r.length;e<t;++e)if(n=r[e],n.getType()!=s){a=!1;break}if(a){let e,t;if("Point"==s){let a=r[0];e=a.getLayout(),t=a.getFlatCoordinates();for(let e=1,i=r.length;e<i;++e)n=r[e],ip(t,n.getFlatCoordinates());i=new Jg(t,e),iE(i,r)}else if("LineString"==s)i=new Xg(r),iE(i,r);else if("Polygon"==s)i=new dm(r),iE(i,r);else{if("GeometryCollection"!=s&&!s.startsWith("Multi"))throw new Error("Unknown geometry type found");i=new Bg(r)}}else i=new Bg(r);return i}function YS(e,t){let r=zC({},qS,e,t),i=KS(e,t);if(i){let e=new Yg(i,"XYZ");return e.setProperties(r,!0),e}}var JS=OC(AS,{innerBoundaryIs:function(e,t){let r=zC([],cE,e,t);r.length>0&&t[t.length-1].push(...r)},outerBoundaryIs:function(e,t){let r=zC(void 0,dE,e,t);if(r){t[t.length-1][0]=r}}});function eE(e,t){let r=zC({},qS,e,t),i=zC([null],JS,e,t);if(i&&i[0]){let e=i[0],t=[e.length];for(let r=1,n=i.length;r<n;++r)ip(e,i[r]),t.push(e.length);let n=new hm(e,"XYZ",t);return n.setProperties(r,!0),n}}var tE=OC(AS,{IconStyle:function(e,t){let r=zC({},US,e,t);if(!r)return;let i,n=t[t.length-1],a="Icon"in r?r.Icon:{},s=!("Icon"in r)||Object.keys(a).length>0,o=a.href;o?i=o:s&&(i=aS);let l,h,A,u="bottom-left",c=r.hotSpot;c?(l=[c.x,c.y],h=c.xunits,A=c.yunits,u=c.origin):/^https?:\/\/maps\.(?:google|gstatic)\.com\//.test(i)&&(i.includes("pushpin")?(l=tS,h=rS,A=iS):i.includes("arrow-reverse")?(l=[54,42],h=rS,A=iS):i.includes("paddle")&&(l=[32,1],h=rS,A=iS));let d,p=a.x,f=a.y;void 0!==p&&void 0!==f&&(d=[p,f]);let g,m=a.w,y=a.h;void 0!==m&&void 0!==y&&(g=[m,y]);let _,v=r.heading;void 0!==v&&(_=Ip(v));let w=r.scale,b=r.color;if(s){i==aS&&(g=nS);let e=new lb({anchor:l,anchorOrigin:u,anchorXUnits:h,anchorYUnits:A,crossOrigin:this.crossOrigin_,offset:d,offsetOrigin:"bottom-left",rotation:_,scale:w,size:g,src:this.iconUrlFunction_(i),color:b}),t=e.getScaleArray()[0],r=e.getSize();if(null===r){let r=e.getImageState();if(r===m_||r===y_){let i=function(){let r=e.getImageState();if(r!==m_&&r!==y_){let r=e.getSize();if(r&&2==r.length){let i=CS(r);e.setScale(t*i)}e.unlistenImageChange(i)}};e.listenImageChange(i),r===m_&&e.load()}}else if(2==r.length){let i=CS(r);e.setScale(t*i)}n.imageStyle=e}else n.imageStyle=sS},LabelStyle:function(e,t){let r=zC({},RS,e,t);if(!r)return;let i=t[t.length-1],n=new Sw({fill:new pw({color:"color"in r?r.color:eS}),scale:r.scale});i.textStyle=n},LineStyle:function(e,t){let r=zC({},DS,e,t);if(!r)return;let i=t[t.length-1],n=new fw({color:"color"in r?r.color:eS,width:"width"in r?r.width:1});i.strokeStyle=n},PolyStyle:function(e,t){let r=zC({},NS,e,t);if(!r)return;let i=t[t.length-1],n=new pw({color:"color"in r?r.color:eS});i.fillStyle=n;let a=r.fill;void 0!==a&&(i.fill=a);let s=r.outline;void 0!==s&&(i.outline=s)}});function rE(e,t){let r=zC({},tE,e,t,this);if(!r)return null;let i,n="fillStyle"in r?r.fillStyle:_S,a=r.fill;void 0!==a&&!a&&(n=null),"imageStyle"in r?r.imageStyle!=sS&&(i=r.imageStyle):i=vS;let s="textStyle"in r?r.textStyle:bS,o="strokeStyle"in r?r.strokeStyle:wS,l=r.outline;return void 0===l||l?[new Cw({fill:n,image:i,stroke:o,text:s,zIndex:void 0})]:[new Cw({geometry:function(e){let t=e.getGeometry(),r=t.getType();if("GeometryCollection"===r){return new Bg(t.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"Polygon"!==t&&"MultiPolygon"!==t})))}if("Polygon"!==r&&"MultiPolygon"!==r)return t},fill:n,image:i,stroke:o,text:s,zIndex:void 0}),new Cw({geometry:function(e){let t=e.getGeometry(),r=t.getType();if("GeometryCollection"===r){return new Bg(t.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"Polygon"===t||"MultiPolygon"===t})))}if("Polygon"===r||"MultiPolygon"===r)return t},fill:n,stroke:null,zIndex:void 0})]}function iE(e,t){let r,i,n,a=t.length,s=new Array(t.length),o=new Array(t.length),l=new Array(t.length);r=!1,i=!1,n=!1;for(let e=0;e<a;++e){let a=t[e];s[e]=a.get("extrude"),o[e]=a.get("tessellate"),l[e]=a.get("altitudeMode"),r=r||void 0!==s[e],i=i||void 0!==o[e],n=n||l[e]}r&&e.set("extrude",s),i&&e.set("tessellate",o),n&&e.set("altitudeMode",l)}var nE=OC(AS,{displayName:LC(qC),value:LC(qC)});var aE=OC(AS,{Data:function(e,t){let r=e.getAttribute("name");QC(nE,e,t);let i=t[t.length-1];r&&i.displayName?i[r]={value:i.value,displayName:i.displayName,toString:function(){return i.value}}:null!==r?i[r]=i.value:null!==i.displayName&&(i[i.displayName]=i.value),delete i.value},SchemaData:function(e,t){QC(hE,e,t)}});function sE(e,t){QC(aE,e,t)}function oE(e,t){QC(gS,e,t)}var lE=OC(AS,{Style:LC(rE),key:LC(qC),styleUrl:LC(PS)});var hE=OC(AS,{SimpleData:function(e,t){let r=e.getAttribute("name");if(null!==r){let i=qC(e);t[t.length-1][r]=i}}});var AE=OC(AS,{altitudeMode:LC(qC),minAltitude:LC(KC),maxAltitude:LC(KC),north:LC(KC),south:LC(KC),east:LC(KC),west:LC(KC)});var uE=OC(AS,{minLodPixels:LC(KC),maxLodPixels:LC(KC),minFadeExtent:LC(KC),maxFadeExtent:LC(KC)});var cE=OC(AS,{LinearRing:FC(QS)});var dE=OC(AS,{LinearRing:PC(QS)});function pE(e,t){let r=j_(t),i=[255*(4==r.length?r[3]:1),r[2],r[1],r[0]];for(let e=0;e<4;++e){let t=Math.floor(i[e]).toString(16);i[e]=1==t.length?"0"+t:t}JC(e,i.join(""))}var fE=OC(AS,{Data:MC((function(e,t,r){e.setAttribute("name",t.name);let i={node:e},n=t.value;"object"==typeof n?(null!==n&&n.displayName&&HC(i,fE,DC,[n.displayName],r,["displayName"]),null!==n&&n.value&&HC(i,fE,DC,[n.value],r,["value"])):HC(i,fE,DC,[n],r,["value"])})),value:MC((function(e,t){JC(e,t)})),displayName:MC((function(e,t){JC(e,t)}))});var gE=OC(AS,{Placemark:MC(zE)}),mE=function(e,t,r){return BC(t[t.length-1].node.namespaceURI,"Placemark")};var yE=kC("Data");var _E=OC(AS,["href"],OC(hS,["x","y","w","h"])),vE=OC(AS,{href:MC(JC)},OC(hS,{x:MC(WC),y:MC(WC),w:MC(WC),h:MC(WC)})),wE=function(e,t,r){return BC(hS[0],"gx:"+r)};var bE=OC(AS,["scale","heading","Icon","color","hotSpot"]),xE=OC(AS,{Icon:MC((function(e,t,r){let i={node:e},n=r[r.length-1].node,a=_E[n.namespaceURI],s=NC(t,a);HC(i,vE,DC,s,r,a),a=_E[hS[0]],s=NC(t,a),HC(i,vE,wE,s,r,a)})),color:MC(pE),heading:MC(WC),hotSpot:MC((function(e,t){e.setAttribute("x",String(t.x)),e.setAttribute("y",String(t.y)),e.setAttribute("xunits",t.xunits),e.setAttribute("yunits",t.yunits)})),scale:MC(XE)});var BE=OC(AS,["color","scale"]),CE=OC(AS,{color:MC(pE),scale:MC(XE)});var SE=OC(AS,["color","width"]),EE=OC(AS,{color:MC(pE),width:MC(WC)});var IE={Point:"Point",LineString:"LineString",LinearRing:"LinearRing",Polygon:"Polygon",MultiPoint:"MultiGeometry",MultiLineString:"MultiGeometry",MultiPolygon:"MultiGeometry",GeometryCollection:"MultiGeometry"},TE=function(e,t,r){if(e){return BC(t[t.length-1].node.namespaceURI,IE[e.getType()])}},FE=kC("Point"),PE=kC("LineString"),LE=kC("LinearRing"),ME=kC("Polygon"),kE=OC(AS,{LineString:MC(VE),Point:MC(VE),Polygon:MC(WE),GeometryCollection:MC(UE)});function UE(e,t,r){let i,n={node:e},a=t.getType(),s=[];if("GeometryCollection"===a)t.getGeometriesArrayRecursive().forEach((function(e){let t=e.getType();if("MultiPoint"===t)s=s.concat(e.getPoints());else if("MultiLineString"===t)s=s.concat(e.getLineStrings());else if("MultiPolygon"===t)s=s.concat(e.getPolygons());else{if("Point"!==t&&"LineString"!==t&&"Polygon"!==t)throw new Error("Unknown geometry type");s.push(e)}})),i=TE;else if("MultiPoint"===a)s=t.getPoints(),i=FE;else if("MultiLineString"===a)s=t.getLineStrings(),i=PE;else{if("MultiPolygon"!==a)throw new Error("Unknown geometry type");s=t.getPolygons(),i=ME}HC(n,kE,i,s,r)}var RE=OC(AS,{LinearRing:MC(VE)});function DE(e,t,r){HC({node:e},RE,LE,[t],r)}var NE=OC(AS,{ExtendedData:MC((function(e,t,r){let i={node:e},n=t.names,a=t.values,s=n.length;for(let e=0;e<s;e++)HC(i,fE,yE,[{name:n[e],value:a[e]}],r)})),MultiGeometry:MC(UE),LineString:MC(VE),LinearRing:MC(VE),Point:MC(VE),Polygon:MC(WE),Style:MC((function(e,t,r){let i={node:e},n={};if(t.pointStyles.length){let e=t.pointStyles[0].getText();e&&(n.LabelStyle=e);let r=t.pointStyles[0].getImage();r&&"function"==typeof r.getSrc&&(n.IconStyle=r)}if(t.lineStyles.length){let e=t.lineStyles[0].getStroke();e&&(n.LineStyle=e)}if(t.polyStyles.length){let e=t.polyStyles[0].getStroke();e&&!n.LineStyle&&(n.LineStyle=e),n.PolyStyle=t.polyStyles[0]}let a=r[r.length-1].node,s=YE[a.namespaceURI],o=NC(n,s);HC(i,JE,DC,o,r,s)})),address:MC(JC),description:MC(JC),name:MC(JC),open:MC(ZC),phoneNumber:MC(JC),styleUrl:MC(JC),visibility:MC(ZC)}),OE=OC(AS,["name","open","visibility","address","phoneNumber","description","styleUrl","Style"]),QE=kC("ExtendedData");function zE(e,t,r){let i={node:e};t.getId()&&e.setAttribute("id",t.getId());let n=t.getProperties(),a={address:1,description:1,name:1,open:1,phoneNumber:1,styleUrl:1,visibility:1};a[t.getGeometryName()]=1;let s=Object.keys(n||{}).sort().filter((function(e){return!a[e]})),o=t.getStyleFunction();if(o){let e=o(t,0);if(e){let r=Array.isArray(e)?e:[e],i=r;if(t.getGeometry()&&(i=r.filter((function(e){let r=e.getGeometryFunction()(t);if(r){let e=r.getType();return"GeometryCollection"===e?r.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"Point"===t||"MultiPoint"===t})).length:"Point"===e||"MultiPoint"===e}}))),this.writeStyles_){let e=r,a=r;t.getGeometry()&&(e=r.filter((function(e){let r=e.getGeometryFunction()(t);if(r){let e=r.getType();return"GeometryCollection"===e?r.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"LineString"===t||"MultiLineString"===t})).length:"LineString"===e||"MultiLineString"===e}})),a=r.filter((function(e){let r=e.getGeometryFunction()(t);if(r){let e=r.getType();return"GeometryCollection"===e?r.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"Polygon"===t||"MultiPolygon"===t})).length:"Polygon"===e||"MultiPolygon"===e}}))),n.Style={pointStyles:i,lineStyles:e,polyStyles:a}}if(i.length&&void 0===n.name){let e=i[0].getText();e&&(n.name=e.getText())}}}let l=r[r.length-1].node,h=OE[l.namespaceURI],A=NC(n,h);if(HC(i,NE,DC,A,r,h),s.length>0){let e=NC(n,s);HC(i,NE,QE,[{names:s,values:e}],r)}let u=r[0],c=t.getGeometry();c&&(c=vm(c,!0,u)),HC(i,NE,TE,[c],r)}var HE=OC(AS,["extrude","tessellate","altitudeMode","coordinates"]),jE=OC(AS,{extrude:MC(ZC),tessellate:MC(ZC),altitudeMode:MC(JC),coordinates:MC((function(e,t,r){let i,n=r[r.length-1],a=n.layout,s=n.stride;if("XY"==a||"XYM"==a)i=2;else{if("XYZ"!=a&&"XYZM"!=a)throw new Error("Invalid geometry layout");i=3}let o=t.length,l="";if(o>0){l+=t[0];for(let e=1;e<i;++e)l+=","+t[e];for(let e=s;e<o;e+=s){l+=" "+t[e];for(let r=1;r<i;++r)l+=","+t[e+r]}}JC(e,l)}))});function VE(e,t,r){let i=t.getFlatCoordinates(),n={node:e};n.layout=t.getLayout(),n.stride=t.getStride();let a=t.getProperties();a.coordinates=i;let s=r[r.length-1].node,o=HE[s.namespaceURI],l=NC(a,o);HC(n,jE,DC,l,r,o)}var GE=OC(AS,["color","fill","outline"]),KE=OC(AS,{outerBoundaryIs:MC(DE),innerBoundaryIs:MC(DE)}),qE=kC("innerBoundaryIs"),ZE=kC("outerBoundaryIs");function WE(e,t,r){let i=t.getLinearRings(),n=i.shift(),a={node:e};HC(a,KE,qE,i,r),HC(a,KE,ZE,[n],r)}var $E=OC(AS,{color:MC(pE),fill:MC(ZC),outline:MC(ZC)});function XE(e,t){WC(e,Math.round(1e6*t)/1e6)}var YE=OC(AS,["IconStyle","LabelStyle","LineStyle","PolyStyle"]),JE=OC(AS,{IconStyle:MC((function(e,t,r){let i={node:e},n={},a=t.getSrc(),s=t.getSize(),o=t.getImageSize(),l={href:a};if(s){l.w=s[0],l.h=s[1];let e=t.getAnchor(),r=t.getOrigin();if(r&&o&&0!==r[0]&&r[1]!==s[1]&&(l.x=r[0],l.y=o[1]-(r[1]+s[1])),e&&(e[0]!==s[0]/2||e[1]!==s[1]/2)){let t={x:e[0],xunits:"pixels",y:s[1]-e[1],yunits:"pixels"};n.hotSpot=t}}n.Icon=l;let h=t.getScaleArray()[0],A=s;if(null===A&&(A=nS),2==A.length){h/=CS(A)}1!==h&&(n.scale=h);let u=t.getRotation();0!==u&&(n.heading=u);let c=t.getColor();c&&(n.color=c);let d=r[r.length-1].node,p=bE[d.namespaceURI],f=NC(n,p);HC(i,xE,DC,f,r,p)})),LabelStyle:MC((function(e,t,r){let i={node:e},n={},a=t.getFill();a&&(n.color=a.getColor());let s=t.getScale();s&&1!==s&&(n.scale=s);let o=r[r.length-1].node,l=BE[o.namespaceURI],h=NC(n,l);HC(i,CE,DC,h,r,l)})),LineStyle:MC((function(e,t,r){let i={node:e},n={color:t.getColor(),width:Number(t.getWidth())||1},a=r[r.length-1].node,s=SE[a.namespaceURI],o=NC(n,s);HC(i,EE,DC,o,r,s)})),PolyStyle:MC((function(e,t,r){let i={node:e},n=t.getFill(),a=t.getStroke(),s={color:n?n.getColor():void 0,fill:!!n&&void 0,outline:!!a&&void 0},o=r[r.length-1].node,l=GE[o.namespaceURI],h=NC(s,l);HC(i,$E,DC,h,r,l)}))});var eI=class extends VC{constructor(e){super(),e=e||{},BS||(_S=new pw({color:eS=[255,255,255,1]}),aS="https://maps.google.com/mapfiles/kml/pushpin/ylw-pushpin.png",vS=new lb({anchor:tS=[20,2],anchorOrigin:"bottom-left",anchorXUnits:rS="pixels",anchorYUnits:iS="pixels",crossOrigin:"anonymous",rotation:0,scale:CS(nS=[64,64]),size:nS,src:aS}),sS="NO_IMAGE",wS=new fw({color:eS,width:1}),oS=new fw({color:[51,51,51,1],width:2}),bS=new Sw({font:"bold 16px Helvetica",fill:_S,stroke:oS,scale:.8}),xS=new Cw({fill:_S,image:vS,text:bS,stroke:wS,zIndex:0}),BS=[xS]),this.dataProjection=Df("EPSG:4326"),this.defaultStyle_=e.defaultStyle?e.defaultStyle:BS,this.extractStyles_=void 0===e.extractStyles||e.extractStyles,this.writeStyles_=void 0===e.writeStyles||e.writeStyles,this.sharedStyles_={},this.showPointNames_=void 0===e.showPointNames||e.showPointNames,this.crossOrigin_=void 0!==e.crossOrigin?e.crossOrigin:"anonymous",this.iconUrlFunction_=e.iconUrlFunction?e.iconUrlFunction:SS,this.supportedMediaTypes=["application/vnd.google-earth.kml+xml"]}readDocumentOrFolder_(e,t){let r=zC([],OC(AS,{Document:TC(this.readDocumentOrFolder_,this),Folder:TC(this.readDocumentOrFolder_,this),Placemark:FC(this.readPlacemark_,this),Style:this.readSharedStyle_.bind(this),StyleMap:this.readSharedStyleMap_.bind(this)}),e,t,this);if(r)return r}readPlacemark_(e,t){let r=zC({geometry:null},cS,e,t,this);if(!r)return;let i=new fm,n=e.getAttribute("id");null!==n&&i.setId(n);let a=t[0],s=r.geometry;if(s&&vm(s,!1,a),i.setGeometry(s),delete r.geometry,this.extractStyles_){let e=function(e,t,r,i,n){return function(a,s){let o=n,l="",h=[];if(o){let e=a.getGeometry();if(e)if(e instanceof Bg)h=e.getGeometriesArrayRecursive().filter((function(e){let t=e.getType();return"Point"===t||"MultiPoint"===t})),o=h.length>0;else{let t=e.getType();o="Point"===t||"MultiPoint"===t}}o&&(l=a.get("name"),o=o&&!!l,o&&/&[^&]+;/.test(l)&&(lS||(lS=document.createElement("textarea")),lS.innerHTML=l,l=lS.value));let A=r;if(e?A=e:t&&(A=ES(t,r,i)),o){let e=function(e,t){let r=[0,0],i="start",n=e.getImage();if(n){let e=n.getSize();if(e&&2==e.length){let t=n.getScaleArray(),a=n.getAnchor();r[0]=t[0]*(e[0]-a[0]),r[1]=t[1]*(e[1]/2-a[1]),i="left"}}let a=e.getText();return a?(a=a.clone(),a.setFont(a.getFont()||bS.getFont()),a.setScale(a.getScale()||bS.getScale()),a.setFill(a.getFill()||bS.getFill()),a.setStroke(a.getStroke()||oS)):a=bS.clone(),a.setText(t),a.setOffsetX(r[0]),a.setOffsetY(r[1]),a.setTextAlign(i),new Cw({image:n,text:a})}(A[0],l);if(h.length>0){return e.setGeometry(new Bg(h)),[e,new Cw({geometry:A[0].getGeometry(),image:null,fill:A[0].getFill(),stroke:A[0].getStroke(),text:null})].concat(A.slice(1))}return e}return A}}(r.Style,r.styleUrl,this.defaultStyle_,this.sharedStyles_,this.showPointNames_);i.setStyle(e)}return delete r.Style,i.setProperties(r,!0),i}readSharedStyle_(e,t){let r=e.getAttribute("id");if(null!==r){let i=rE.call(this,e,t);if(i){let t,n=e.baseURI;(!n||"about:blank"==n)&&(n=window.location.href),t=n?new URL("#"+r,n).href:"#"+r,this.sharedStyles_[t]=i}}}readSharedStyleMap_(e,t){let r=e.getAttribute("id");if(null===r)return;let i=kS.call(this,e,t);if(!i)return;let n,a=e.baseURI;(!a||"about:blank"==a)&&(a=window.location.href),n=a?new URL("#"+r,a).href:"#"+r,this.sharedStyles_[n]=i}readFeatureFromNode(e,t){if(!AS.includes(e.namespaceURI))return null;return this.readPlacemark_(e,[this.getReadOptions(e,t)])||null}readFeaturesFromNode(e,t){if(!AS.includes(e.namespaceURI))return[];let r,i=e.localName;if("Document"==i||"Folder"==i)return r=this.readDocumentOrFolder_(e,[this.getReadOptions(e,t)]),r||[];if("Placemark"==i){let r=this.readPlacemark_(e,[this.getReadOptions(e,t)]);return r?[r]:[]}if("kml"==i){r=[];for(let i=e.firstElementChild;i;i=i.nextElementSibling){let e=this.readFeaturesFromNode(i,t);e&&ip(r,e)}return r}return[]}readName(e){if(e){if("string"==typeof e){let t=IC(e);return this.readNameFromDocument(t)}return EC(e)?this.readNameFromDocument(e):this.readNameFromNode(e)}}readNameFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==Node.ELEMENT_NODE){let e=this.readNameFromNode(t);if(e)return e}}readNameFromNode(e){for(let t=e.firstElementChild;t;t=t.nextElementSibling)if(AS.includes(t.namespaceURI)&&"name"==t.localName)return qC(t);for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=t.localName;if(AS.includes(t.namespaceURI)&&("Document"==e||"Folder"==e||"Placemark"==e||"kml"==e)){let e=this.readNameFromNode(t);if(e)return e}}}readNetworkLinks(e){let t=[];if("string"==typeof e){let r=IC(e);ip(t,this.readNetworkLinksFromDocument(r))}else EC(e)?ip(t,this.readNetworkLinksFromDocument(e)):ip(t,this.readNetworkLinksFromNode(e));return t}readNetworkLinksFromDocument(e){let t=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ip(t,this.readNetworkLinksFromNode(r));return t}readNetworkLinksFromNode(e){let t=[];for(let r=e.firstElementChild;r;r=r.nextElementSibling)if(AS.includes(r.namespaceURI)&&"NetworkLink"==r.localName){let e=zC({},dS,r,[]);t.push(e)}for(let r=e.firstElementChild;r;r=r.nextElementSibling){let e=r.localName;AS.includes(r.namespaceURI)&&("Document"==e||"Folder"==e||"kml"==e)&&ip(t,this.readNetworkLinksFromNode(r))}return t}readRegion(e){let t=[];if("string"==typeof e){let r=IC(e);ip(t,this.readRegionFromDocument(r))}else EC(e)?ip(t,this.readRegionFromDocument(e)):ip(t,this.readRegionFromNode(e));return t}readRegionFromDocument(e){let t=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType==Node.ELEMENT_NODE&&ip(t,this.readRegionFromNode(r));return t}readRegionFromNode(e){let t=[];for(let r=e.firstElementChild;r;r=r.nextElementSibling)if(AS.includes(r.namespaceURI)&&"Region"==r.localName){let e=zC({},gS,r,[]);t.push(e)}for(let r=e.firstElementChild;r;r=r.nextElementSibling){let e=r.localName;AS.includes(r.namespaceURI)&&("Document"==e||"Folder"==e||"kml"==e)&&ip(t,this.readRegionFromNode(r))}return t}readCamera(e){let t=[];if("string"==typeof e){let r=IC(e);ip(t,this.readCameraFromDocument(r))}else EC(e)?ip(t,this.readCameraFromDocument(e)):ip(t,this.readCameraFromNode(e));return t}readCameraFromDocument(e){let t=[];for(let r=e.firstChild;r;r=r.nextSibling)r.nodeType===Node.ELEMENT_NODE&&ip(t,this.readCameraFromNode(r));return t}readCameraFromNode(e){let t=[];for(let r=e.firstElementChild;r;r=r.nextElementSibling)if(AS.includes(r.namespaceURI)&&"Camera"===r.localName){let e=zC({},fS,r,[]);t.push(e)}for(let r=e.firstElementChild;r;r=r.nextElementSibling){let e=r.localName;AS.includes(r.namespaceURI)&&("Document"===e||"Folder"===e||"Placemark"===e||"kml"===e)&&ip(t,this.readCameraFromNode(r))}return t}writeFeaturesNode(e,t){t=this.adaptOptions(t);let r=BC(AS[4],"kml"),i="http://www.w3.org/2000/xmlns/";r.setAttributeNS(i,"xmlns:gx",hS[0]),r.setAttributeNS(i,"xmlns:xsi",xC),r.setAttributeNS(xC,"xsi:schemaLocation","http://www.opengis.net/kml/2.2 https://developers.google.com/kml/schema/kml22gx.xsd");let n={node:r},a={};e.length>1?a.Document=e:1==e.length&&(a.Placemark=e[0]);let s=mS[r.namespaceURI],o=NC(a,s);return HC(n,yS,DC,o,[t],s,this),r}},tI=h(A()),rI=()=>{};typeof window<"u"&&new URLSearchParams(window.location.search).get("deprecated")&&(rI=(0,tI.default)((e=>{console.warn(e)}),1e3));var iI=(e,t)=>{t.properties&&(rI("Deprecated. Don't use properties options. Pass the values directly in options object."),e.setProperties(t.properties)),e.on("propertychange",(e=>{if("children"===e.key&&((e,t)=>{(t||[]).forEach((e=>{e.set("parent",void 0)})),(e.get("children")||[]).forEach((t=>{t.set("parent",e)}))})(e.target,e.oldValue),"map"===e.key){let t=e.target.get(e.key);t?(e.target.get("children")||[]).forEach((e=>{t.addLayer(e)})):e.oldValue&&(e.target.get("children")||[]).forEach((t=>{var r;null===(r=e.oldValue)||void 0===r||r.removeLayer(t)}))}})),e.set("options",t),e.set("children",[...t.children||[]]),Object.defineProperties(e,{children:{get:()=>(rI("Layer.children is deprecated. Use the Layer.get('children') method instead."),e.get("children")||[]),set:t=>{rI("Layer.children is deprecated. Use the Layer.set('children', children) method instead."),e.set("children",t||[])}},copyrights:{get:()=>(rI("Layer.copyrights is deprecated. Get the attributions from the source object"),e.get("copyrights")),set:t=>{rI("Layer.copyrights is deprecated. Set the attributions to the source object.");let r=t&&!Array.isArray(t)?[t]:t;e.set("copyrights",r||[])}},disabled:{get:()=>(rI("Layer.disabled is deprecated. Use the Layer.get('disabled') method instead."),e.get("disabled")),set(t){rI("Layer.disabled is deprecated. Use the Layer.set('disabled', newValue) method instead."),e.set("disabled",t)}},group:{get:()=>(rI("Layer.group is deprecated. Use the Layer.get('group') method instead."),e.get("group"))},hitTolerance:{get:()=>(rI("Layer.hitTolerance is deprecated. Pass the hitTolerance when you request the features."),e.get("hitTolerance")||5),set(t){rI("Layer.hitTolerance is deprecated. Pass the hitTolerance when you request the features."),e.set("hitTolerance",t)}},key:{get:()=>(rI('Layer.key is deprecated. Use the Layer.get("key") method instead.'),e.get("key")||e.get("name"))},map:{get:()=>(rI('Layer.map is deprecated. Use the Layer.get("map") method instead.'),e.getMapInternal())},name:{get:()=>(rI("Layer.name is deprecated. Use the Layer.get('name') method instead."),e.get("name"))},olLayer:{get:()=>(rI("Layer.olLayer is deprecated. mobility-toolbox-js/ol layers inherits now from ol/layer/Layer class. obj getter is only a redirect to the current 'this' object."),e),set(){rI("Layer.olLayer is deprecated. mobility-toolbox-js/ol layers inherits now from ol/layer/Layer class. obj setter has no effect.")}},olListenersKeys:{get:()=>(rI("Layer.olListenersKeys is deprecated. Use the Layer.olEventsKeys instead."),e.olEventsKeys||[]),set(t){rI("Layer.olListenersKeys is deprecated. Use the Layer.olEventsKeys instead."),e.olEventsKeys=t}},options:{get:()=>(rI('Layer.options is deprecated. Use the Layer.get("options") method instead.'),e.get("options")),set:t=>(rI('Layer.options is deprecated.  Use the Layer.set("options", newValue) method instead.'),e.set("options",t))},parent:{get:()=>(rI("Layer.parent is deprecated. Use the Layer.get('parent') method instead."),e.get("parent")),set(t){rI("Layer.parent is deprecated. Use the Layer.set('parent', parent) method instead."),e.set("parent",t)}},properties:{get:()=>(rI("Layer.properties is deprecated. Use the Layer.getProperties() method instead."),e.getProperties()),set(t){rI("Layer.properties is deprecated. Use the Layer.setProperties(newValue) method instead."),e.setProperties(t)}},visible:{get:()=>(rI("Layer.visible is deprecated. Use the Layer.getVisible() method instead."),e.getVisible()),set(t){rI("Layer.visible is deprecated. Use the Layer.setVisible(newValue) method instead."),e.setVisible(t)}}})},nI=h(u(),1),aI={"EPSG:3857":new Im({featureProjection:"EPSG:3857"})},sI=class extends ub{translateZoom;constructor(e,t){super(e),this.translateZoom=t}getFeaturesAtCoordinate(e,t=5){let r=this.getMapLibrePixels(e,t);if(!r)return[];let i=this.getLayer().get("queryRenderedFeaturesOptions")||{};return this.getLayer().mapLibreMap?.queryRenderedFeatures(r,i).map((e=>this.toOlFeature(e)))||[]}prepareFrame(){return!0}renderFrame(e){let t=this.getLayer(),{mapLibreMap:r}=t,i=t.getMapInternal();if(!t||!i||!r)return null;let n=r.getCanvas(),{viewState:a}=e;r.jumpTo({center:Hf(a.center,a.projection),zoom:(this.translateZoom?this.translateZoom(a.zoom):a.zoom)-1,bearing:Ep(-a.rotation)});let s=t.getOpacity().toString();return n&&s!==n.style.opacity&&(n.style.opacity=s),n.isConnected?function(e,t){return e.width===Math.floor(t.size[0]*t.pixelRatio)&&e.height===Math.floor(t.size[1]*t.pixelRatio)}(n,e)||r.resize():i.render(),r.redraw(),r.getContainer()}getFeatures(e){let t=this.getLayer().getMapInternal()?.getCoordinateFromPixel(e);return Promise.resolve(this.getFeaturesAtCoordinate(t))}forEachFeatureAtCoordinate(e,t,r,i){let n=this.getFeaturesAtCoordinate(e,r);return n.forEach((e=>{let t=e.getGeometry();t instanceof gg&&i(e,this.getLayer(),t)})),n?.[0]}getMapLibrePixels(e,t){if(!e)return;let r=this.getLayer().mapLibreMap?.project(Hf(e));if(void 0===r?.x||void 0===r?.y)return;let i=[r.x,r.y];if(t){let[e,r]=i;i=[[e-t,r-t],[e+t,r+t]]}return i}toOlFeature(e){let t=this.getLayer().getMapInternal()?.getView()?.getProjection()?.getCode()||"EPSG:3857";aI[t]||(aI[t]=new Im({featureProjection:t}));let r=aI[t].readFeature(e);return r&&r.set("vectorTileFeature",e,!0),r}};var oI=e=>{let t=e.filter((e=>null!=e&&e.trim&&e.trim())),r=t.map((e=>e.toLowerCase()));return[...new Set(r)].map((e=>t.find((t=>t.toLowerCase()===e))))},lI=e=>{if(!e)return[];let{style:t}=e;if(!t)return[];let{sourceCaches:r}=t,i=[];return Object.values(r).forEach((e=>{if(e.used){let{attribution:t}=e.getSource();t&&(i=i.concat(t.replace(/&copy;/g,"©").split(/(<a.*?<\/a>)/)))}})),oI(i)},hI=class extends jy{mapLibreMap;loaded=!1;olListenersKeys=[];constructor(e){super({source:new nw({attributions:()=>lI(this.mapLibreMap)}),...e})}disposeInternal(){mp(this.olListenersKeys),this.loaded=!1,this.mapLibreMap&&(this.mapLibreMap.triggerRepaint=()=>{},this.mapLibreMap.remove()),super.disposeInternal()}setMapInternal(e){super.setMapInternal(e),e?this.loadMapLibreMap():this.dispose()}loadMapLibreMap(){this.loaded=!1;let e=this.getMapInternal();if(e&&this.olListenersKeys.push(e.on("change:target",this.loadMapLibreMap.bind(this))),!e?.getTargetElement())return;if(!this.getVisible())return void this.olListenersKeys.push(this.once("change:visible",this.loadMapLibreMap.bind(this)));let t=document.createElement("div");t.style.position="absolute",t.style.width="100%",t.style.height="100%";let r=this.get("mapLibreOptions");this.mapLibreMap=new nI.Map(Object.assign({},r,{container:t,attributionControl:!1,interactive:!1,trackResize:!1})),this.mapLibreMap.on("sourcedata",(()=>{this.getSource()?.refresh()})),this.mapLibreMap.once("load",(()=>{this.loaded=!0,this.dispatchEvent(new up("load"))}))}createRenderer(){let e=this.get("translateZoom");return new sI(this,e)}},AI=h(A()),uI=class extends sI{constructor(e,t){super(e,t),this.ignoreNextRender=!1,this.tranaslateZoom2=t,this.setIsReady=this.setIsReady.bind(this),this.ignoreNextRender=!1}prepareFrame(){return!0}renderFrame(e){let t=this.getLayer(),{mapLibreMap:r}=t,i=t.getMapInternal();if(!t||!i||!r)return null;if(this.ready&&this.ignoreNextRender)return this.ignoreNextRender=!1,r?.getContainer();this.ready=!1,this.ignoreNextRender=!1,this.updateReadyState();let n=super.renderFrame(e);return r?.once("idle",this.setIsReady.bind(this)),n}setIsReady(){this.ready||(this.ready=!0,this.ignoreNextRender=!0,this.getLayer().changed())}updateReadyState(){var e,t,r,i;null===(t=null===(e=this.getLayer())||void 0===e?void 0:e.mapLibreMap)||void 0===t||t.off("idle",this.setIsReady.bind(this)),null===(i=null===(r=this.getLayer())||void 0===r?void 0:r.mapLibreMap)||void 0===i||i.once("idle",this.setIsReady.bind(this))}},cI=(e,t,r,i)=>Mc(`${e}/styles/${t}/style.json`,{[i]:r}).toString(),dI=()=>{};typeof window<"u"&&new URLSearchParams(window.location.search).get("deprecated")&&(dI=(0,AI.default)((e=>{console.warn(e)}),1e3));var pI=class e extends hI{set apiKey(e){this.set("apiKey",e)}get apiKey(){return this.get("apiKey")}set apiKeyName(e){this.set("apiKeyName",e)}get apiKeyName(){return this.get("apiKeyName")}get maplibreMap(){return dI("MaplibreLayer.maplibreMap is deprecated. Use layer.mapLibreMap."),this.mapLibreMap}get mbMap(){return dI("MaplibreLayer.mbMap is deprecated. Use layer.maplibreMap."),this.maplibreMap}get style(){return this.get("style")}set style(e){this.set("style",e)}get url(){return this.get("url")}set url(e){this.set("url",e)}constructor(e){var t;e.mapOptions&&!e.mapLibreOptions&&(dI("MaplibreLayer.mapOptions is deprecated. Use mapLibreOptions instead."),e.mapLibreOptions=e.mapOptions);let r=Object.assign(Object.assign({apiKeyName:"key",style:"travic_v2",url:"https://maps.geops.io"},e||{}),{mapLibreOptions:Object.assign({fadeDuration:10},e.mapLibreOptions||{})});!r.mapLibreOptions.style&&null!==(t=r.url)&&void 0!==t&&t.includes("style.json")?r.mapLibreOptions.style=r.url:!r.mapLibreOptions.style&&r.apiKey&&r.style&&"string"==typeof r.style&&(r.mapLibreOptions.style=cI(r.url,r.style,r.apiKey,r.apiKeyName)),super(r),this.olEventsKeys=[],iI(this,e),this.set("options",e)}attachToMap(){let e=(0,AI.default)(this.updateMaplibreMap.bind(this),150);e(),this.olEventsKeys.push(this.on("propertychange",(t=>{/(url|style|apiKey|apiKeyName)/.test(t.key)&&e()})))}clone(t){return new e(Object.assign(Object.assign({},this.get("options")||{}),t||{}))}createRenderer(){return new uI(this)}detachFromMap(){mp(this.olEventsKeys)}disposeInternal(){let e=this.getSource();super.disposeInternal(),this.mapLibreMap=void 0,this.setSource(e)}getStyle(){var e;if(this.style&&"object"==typeof this.style&&this.style.name&&this.style.version)return this.style;if(this.url.includes("style.json"))return this.url;let t=this.get("options");return null!==(e=t?.mapLibreOptions)&&void 0!==e&&e.style?t.mapLibreOptions.style:cI(this.url,this.style,this.apiKey,this.apiKeyName)}setMapInternal(e){e?(super.setMapInternal(e),this.attachToMap()):(this.detachFromMap(),super.setMapInternal(e))}updateMaplibreMap(){var e;try{null===(e=this.mapLibreMap)||void 0===e||e.setStyle(this.getStyle(),{diff:!1})}catch(e){console.error("Error while updating MaplibreMap",e)}}},fI=h(A()),gI={"EPSG:3857":new Im({featureProjection:"EPSG:3857"})},mI=class extends ub{forEachFeatureAtCoordinate(e,t,r,i){let n=this.getFeaturesAtCoordinate(e,r);return n.forEach((e=>{i(e,this.layer_,e.getGeometry())})),n?.[0]}getFeatures(e){var t,r;let i=null===(r=null===(t=this.getLayer())||void 0===t?void 0:t.getMapInternal())||void 0===r?void 0:r.getCoordinateFromPixel(e);return Promise.resolve(this.getFeaturesAtCoordinate(i))}getFeaturesAtCoordinate(e,t=5){var r,i,n;if(!e)return[];let a=this.getLayer(),s=a.getMapInternal(),o=null===(r=a.maplibreLayer)||void 0===r?void 0:r.mapLibreMap,l=(null===(n=null===(i=s?.getView())||void 0===i?void 0:i.getProjection())||void 0===n?void 0:n.getCode())||"EPSG:3857",h=[];if(gI[l]||(gI[l]=new Im({featureProjection:l})),o?.isStyleLoaded()){let r=e&&o.project(Hf(e));if(r?.x&&r?.y){let e=[r.x,r.y];if(t){let[r,i]=e;e=[[r-t,i-t],[r+t,i+t]]}let i=a.layers||[];a.layersFilter&&(i=o.getStyle().layers.filter(a.layersFilter)),a.queryRenderedLayersFilter&&(i=o.getStyle().layers.filter(a.queryRenderedLayersFilter)),h=o.queryRenderedFeatures(e,{layers:i.map((e=>e.id)),validate:!1}).map((e=>{let t=gI[l].readFeature(e);return t&&t.set(ed,e),t}))}}return h}prepareFrame(){return!0}renderFrame(e,t){return t??document.createElement("div")}},yI=()=>{};typeof window<"u"&&new URLSearchParams(window.location.search).get("deprecated")&&(yI=(0,fI.default)(((...e)=>{console.warn(...e)}),1e3));var _I,vI=class e extends jy{get beforeId(){return this.get("beforeId")}set beforeId(e){this.set("beforeId",e)}get layers(){return this.get("layers")||[]}set layers(e){this.set("layers",e)}get layersFilter(){return this.get("layersFilter")}set layersFilter(e){this.set("layersFilter",e)}get mapboxLayer(){return yI("Deprecated. Use maplibreLayer instead."),this.get("maplibreLayer")}get maplibreLayer(){return this.get("maplibreLayer")}set maplibreLayer(e){this.set("maplibreLayer",e)}get queryRenderedLayersFilter(){return this.get("queryRenderedLayersFilter")}set queryRenderedLayersFilter(e){this.set("queryRenderedLayersFilter",e)}get sources(){return this.get("sources")}set sources(e){this.set("sources",e)}get styleLayer(){return yI("Deprecated. Use MaplibreStyleLayer.layer instead."),this.layers[0]}set styleLayer(e){yI("MaplibreStyleLayer.styleLayer is deprecated. Use MaplibreStyleLayer.layer instead."),this.layers=[e]}get styleLayers(){return yI("MaplibreStyleLayer.styleLayers is deprecated. Use MaplibreStyleLayer.layers instead."),this.layers}set styleLayers(e){yI("MaplibreStyleLayer.styleLayers is deprecated. Use MaplibreStyleLayer.layers instead."),this.layers=e}constructor(e={mapLibreOptions:{style:{layers:[],sources:{},version:8}}}){e.mapboxLayer&&(yI("options.mapboxLayer is deprecated. Use options.maplibreLayer instead."),e.maplibreLayer=e.mapboxLayer,delete e.mapboxLayer),e.styleLayer&&(yI("options.styleLayer is deprecated. Use options.layers instead."),e.layers=[e.styleLayer],delete e.styleLayer),e.styleLayers&&(yI("options.styleLayers is deprecated. Use options.layers instead."),e.layers=e.styleLayers,delete e.styleLayers),e.styleLayersFilter&&(yI("options.styleLayersFilter is deprecated. Use options.layersFilter instead."),e.layersFilter=e.styleLayersFilter,delete e.styleLayersFilter),super(Object.assign({source:new nw({})},e)),this.highlightedFeatures=[],this.olEventsKeys=[],this.selectedFeatures=[],iI(this,e),this.set("options",e),this.beforeId=e.beforeId,this.onLoad=this.onLoad.bind(this),!this.layersFilter&&this.layers&&(this.layersFilter=e=>!!this.layers.find((t=>e.id===t.id)))}addLayers(){var e;if(null===(e=this.maplibreLayer)||void 0===e||!e.mapLibreMap||!Array.isArray(this.layers))return;let{mapLibreMap:t}=this.maplibreLayer;t&&(this.layers.forEach((e=>{let{id:r,source:i}=e;(!i||i&&t.getSource(i))&&r&&!t.getLayer(r)&&t.addLayer(e,this.beforeId)})),this.applyLayoutVisibility())}addSources(){var e;if(null===(e=this.maplibreLayer)||void 0===e||!e.mapLibreMap||!this.sources)return;let{mapLibreMap:t}=this.maplibreLayer;t&&Object.entries(this.sources).forEach((([e,r])=>{t.getSource(e)||t.addSource(e,r)}))}applyLayoutVisibility(e){var t,r;if(null===(r=null===(t=this.maplibreLayer)||void 0===t?void 0:t.mapLibreMap)||void 0===r||!r.getStyle()||!this.layersFilter)return;let{mapLibreMap:i}=this.maplibreLayer,n=i.getStyle(),a=this.getVisible()?"visible":"none",s=n.layers||[];for(let e=0;e<s.length;e+=1){let t=s[e];if(this.layersFilter(t)){let{id:e}=t;i.getLayer(e)&&(i.setLayoutProperty(e,"visibility",a),(Number.isFinite(this.getMinZoom())||Number.isFinite(this.getMaxZoom()))&&i.setLayerZoomRange(e,Number.isFinite(this.getMinZoom())?this.getMinZoom()-1:0,Number.isFinite(this.getMaxZoom())?this.getMaxZoom()-1:24))}}}attachToMap(e){if(!this.getMapInternal()||!this.maplibreLayer)return;let{mapLibreMap:t}=this.maplibreLayer;t&&(t.loaded()||t.isStyleLoaded()?this.onLoad():t.once("load",this.onLoad)),this.olEventsKeys.push(this.maplibreLayer.on("load",this.onLoad.bind(this)),this.on("change:visible",(e=>{this.applyLayoutVisibility(e)})),this.on("propertychange",(t=>{/(sources|layers|layersFilter|maplibreLayer|beforeId)/.test(t.key)&&(this.detachFromMap(),this.attachToMap(e))})),this.maplibreLayer.on("propertychange",(e=>{if("style"===e.key){let t=e.target.mapLibreMap;t?.once("styledata",(()=>{t?.once("idle",(()=>{this.onLoad()}))}))}})))}clone(t){return new e(Object.assign(Object.assign({},this.get("options")||{}),t||{}))}createRenderer(){return new mI(this)}detachFromMap(){var e;mp(this.olEventsKeys),null!==(e=this.maplibreLayer)&&void 0!==e&&e.mapLibreMap&&(this.maplibreLayer.mapLibreMap.off("load",this.onLoad),this.removeLayers(),this.removeSources())}highlight(e=[]){var t;yI("Deprecated. Use layer.setFeatureState(features, {hover: true}) instead.");let r=(null===(t=this.highlightedFeatures)||void 0===t?void 0:t.filter((e=>!(this.selectedFeatures||[]).map((e=>e.getId())).includes(e.getId()))))||[];this.setHoverState(r,!1),this.highlightedFeatures=e,this.setHoverState(this.highlightedFeatures,!0)}onLoad(){var e;if(null===(e=this.maplibreLayer)||void 0===e||!e.mapLibreMap)return;this.addSources(),this.addLayers();let{mapLibreMap:t}=this.maplibreLayer,r=t.getStyle();if(r?.layers&&this.layersFilter){let e=r.layers.filter(this.layersFilter);this.set("disabled",!e.length)}this.applyLayoutVisibility()}removeLayers(){var e;if(null===(e=this.maplibreLayer)||void 0===e||!e.mapLibreMap||!Array.isArray(this.layers))return;let{mapLibreMap:t}=this.maplibreLayer;t&&this.layers.forEach((e=>{let{id:r}=e;r&&t?.getLayer(r)&&t.removeLayer(r)}))}removeSources(){var e;if(null===(e=this.maplibreLayer)||void 0===e||!e.mapLibreMap||!this.sources)return;let{mapLibreMap:t}=this.maplibreLayer;t&&Object.keys(this.sources).forEach((e=>{t.getSource(e)&&t.removeSource(e)}))}select(e=[]){yI("Deprecated. Use layer.setFeatureState(features, {selected: true}) instead."),this.setHoverState(this.selectedFeatures||[],!1),this.selectedFeatures=e,this.setHoverState(this.selectedFeatures||[],!0)}setFeatureState(e,t){var r;if(null===(r=this.maplibreLayer)||void 0===r||!r.mapLibreMap||!e.length)return;let i=this.maplibreLayer.mapLibreMap;e.forEach((e=>{let{source:r,sourceLayer:n}=e.get(ed)||{};(r||n)&&e.getId()?r?i.setFeatureState({id:e.getId(),source:r,sourceLayer:n},t):yI("No source found for the feature. To use the feature state functionnality, a source must be defined.",e.getProperties()):e.getId()||yI("No feature's id found. To use the feature state functionnality, tiles must be generated with --generate-ids. See https://github.com/Maplibre/tippecanoe#adding-calculated-attributes.",e.getProperties())}))}setHoverState(e,t){yI(`Deprecated. Use layer.setFeatureState(features, {hover: ${t}}) instead.`),this.setFeatureState(e,{hover:t})}setMapInternal(e){e?(super.setMapInternal(e),this.attachToMap(e)):(this.detachFromMap(),super.setMapInternal(e))}},wI=h(c()),bI=(e=1,t=[235,0,0,1])=>{if(1===e)return t;let r=document.createElement("canvas"),i=d_;r.width=20*i,r.height=20*i;let n={},a=r.getContext("2d");if(a){switch(a.strokeStyle=`rgba(${t.toString()})`,a.fillStyle=`rgba(${t.toString()})`,a.lineWidth=3,e){case 2:a.beginPath(),a.moveTo(0,r.height),a.lineTo(0,r.height-a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,0),a.lineTo(r.width,0),a.lineTo(r.width,a.lineWidth/2),a.lineTo(a.lineWidth/2,r.height),a.lineTo(a.lineWidth/2,r.height),a.fill(),a.closePath(),a.beginPath(),a.moveTo(0,0),a.lineTo(0,a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,r.height),a.lineTo(r.width,r.height),a.lineTo(r.width,r.height-a.lineWidth/2),a.lineTo(a.lineWidth/2,0),a.lineTo(0,0),a.fill(),a.closePath(),n=a.createPattern(r,"repeat"),n.canvas=r;break;case 3:a.beginPath(),a.moveTo(0,0),a.lineTo(0,a.lineWidth/2),a.lineTo(a.lineWidth/2,0),a.fill(),a.closePath(),a.beginPath(),a.moveTo(0,r.height),a.lineTo(0,r.height-a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,0),a.lineTo(r.width,0),a.lineTo(r.width,a.lineWidth/2),a.lineTo(a.lineWidth/2,r.height),a.lineTo(a.lineWidth/2,r.height),a.fill(),a.closePath(),a.beginPath(),a.moveTo(r.width,r.height),a.lineTo(r.width,r.height-a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,r.height),a.fill(),a.closePath(),n=a.createPattern(r,"repeat"),n.canvas=r;break;case 4:a.beginPath(),a.moveTo(r.width,0),a.lineTo(r.width,a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,0),a.fill(),a.closePath(),a.beginPath(),a.moveTo(0,0),a.lineTo(0,a.lineWidth/2),a.lineTo(r.width-a.lineWidth/2,r.height),a.lineTo(r.width,r.height),a.lineTo(r.width,r.height-a.lineWidth/2),a.lineTo(a.lineWidth/2,0),a.lineTo(0,0),a.fill(),a.closePath(),a.beginPath(),a.moveTo(0,r.height),a.lineTo(0,r.height-a.lineWidth/2),a.lineTo(a.lineWidth/2,r.height),a.fill(),a.closePath(),n=a.createPattern(r,"repeat"),n.canvas=r}return 0===e&&(n.empty=!0),n.id=e,n.color=t,n}},xI="circleGeometryCenter",BI="circleGeometryRadius",CI=Df("EPSG:4326"),SI=new pw({color:[255,0,0,.7]}),EI=new fw({color:[255,0,0,1],width:1.5}),II=new vw({fill:SI,radius:7,stroke:EI}),TI=new Cw({fill:SI,image:II,stroke:EI,text:new Sw({fill:SI,font:"normal 16px Helvetica",stroke:new fw({color:[255,255,255,1],width:3})})}),FI=(e,t=!0,r=0)=>{let i=e?.getCoordinates();if(!i)return;let n=i.length-1;return t?i[r]:i[n-r]},PI=(e,t,r,i=!0)=>{let n=e.getGeometry(),a=FI(n,i,1),s=FI(n,i);if(!a||!s)return new Cw;let o=i?a[0]-s[0]:s[0]-a[0],l=i?a[1]-s[1]:s[1]-a[1],h=Math.atan2(l,o);return new Cw({geometry:e=>{let t=e.getGeometry();return new Yg(FI(t,i))},image:new lb({color:r,rotateWithView:!0,rotation:-h,scale:t.scale,size:t.size,src:t.url}),zIndex:t.zIndex})},LI=class{constructor(){this.writeDocumentCamera=(e,t)=>{let r=IC(this.removeDocumentCamera(e));if(t){let e=r.createElement("Camera");Object.keys(t).forEach((i=>{let n=r.createElement(`${i.charAt(0).toUpperCase()+i.slice(1)}`);n.innerHTML=t[i],e.appendChild(n)})),r.getElementsByTagName("Document")[0].appendChild(e)}return(new XMLSerializer).serializeToString(r)}}readFeatures(e,t,r=!1){let i=(new eI).readFeatures(e,{featureProjection:t});return i.forEach((e=>{var i,n;let{[xI]:a,[BI]:s}=e?.getProperties()||{};if(e&&a&&s){let r=new bg(Kf(JSON.parse(a),CI,t||CI),parseFloat(s));r.setProperties(null!==(n=null===(i=e?.getGeometry())||void 0===i?void 0:i.getProperties())&&void 0!==n?n:{}),e.setGeometry(r)}this.sanitizeFeature(e,r)})),i}removeDocumentCamera(e){let t=IC(e),r=t.getElementsByTagName("Camera")[0];return r&&r.remove(),(new XMLSerializer).serializeToString(t)}sanitizeFeature(e,t=!1){var r,i,n,a,s,o,l;let h=e.getGeometry(),A=e.getStyleFunction();e.get("maxZoom")&&e.set("maxZoom",parseFloat(e.get("maxZoom"))),e.get("minZoom")&&e.set("minZoom",parseFloat(e.get("minZoom")));let u=A?.(e,1),c=null===(r=Array.isArray(u)?u[0]:u)||void 0===r?void 0:r.clone(),d=c?.getStroke();if(e.get("lineCap")&&d?.setLineCap(e.get("lineCap")),e.get("lineJoin")&&d?.setLineJoin(e.get("lineJoin")),e.get("lineDash")&&d?.setLineDash((e?.get("lineDash")).split(",").map((e=>parseInt(e,10)))),e.get("lineDashOffset")&&d?.setLineDashOffset(parseInt(e.get("lineDashOffset"),10)),e.get("miterLimit")&&d?.setMiterLimit(parseInt(e.get("miterLimit"),10)),d&&0===d.getWidth()&&(d=void 0),e.get("zIndex")&&c?.setZIndex(parseInt(e.get("zIndex"),10)),c&&(h instanceof Yg||h instanceof Jg)){let r=c.getImage(),s=null,o=c.getFill();if(e.get("name")&&c.getText()&&0!==(null===(i=c.getText())||void 0===i?void 0:i.getScale())){r&&0===r.getScale()&&(r=new vw({fill:new pw({color:[0,0,0,0]}),radius:1,stroke:new fw({color:[0,0,0,0]})}));let t=e.get("name");/\u200B/g.test(t)&&(t=t.replace(/\u200B/g,""),e.set("name",t));let i=e.get("textFont")||"normal 16px Arial";if(t.includes("\n")){let e=[],r=t.split("\n");r.forEach(((t,n)=>{e.push(t||"​",t?i:""),n<r.length-1&&e.push("\n","")})),t=e}else t=[t,i];if(s=new Sw({fill:c.getText().getFill(),font:`${i.replace(/bold/g,"normal")}, Arial, sans-serif`,rotation:e.get("textRotation")||0,scale:null===(n=c.getText())||void 0===n?void 0:n.getScale(),text:t}),e.get("textArray"))try{let t=JSON.parse((0,wI.replace)(e.get("textArray"),/\r?\n/g,"\\n"));s.setText(t)}catch(t){console.error("Error parsing textArray",e.get("textArray"),t)}e.get("textStrokeColor")&&e.get("textStrokeWidth")&&s.setStroke(new fw({color:e.get("textStrokeColor"),width:parseFloat(e.get("textStrokeWidth"))})),e.get("textAlign")&&s.setTextAlign(e.get("textAlign")),e.get("textOffsetX")&&s.setOffsetX(parseFloat(e.get("textOffsetX"))),e.get("textOffsetY")&&s.setOffsetY(parseFloat(e.get("textOffsetY"))),e.get("textBackgroundFillColor")&&s.setBackgroundFill(new pw({color:e.get("textBackgroundFillColor")})),e.get("textPadding")&&s.setPadding(null===(a=e.get("textPadding"))||void 0===a?void 0:a.split(",").map((e=>parseFloat(e)))),r instanceof lb&&((e,t)=>{let r=e.getSize()||[48,48],i=e.getScale()||1,n=e.getAnchor()||[r[0]*i/2,r[1]*i/2],a=[i*(r[0]-n[0])+5,i*(r[1]/2-n[1])];t.setOffsetX(a[0]),t.setOffsetY(a[1]),t.setTextAlign("left")})(r,s)}if(r instanceof lb)if(r.setRotation(parseFloat(e.get("iconRotation"))||0),e.get("iconScale"))r.setScale(parseFloat(e.get("iconScale"))||0);else if(!t&&r.getSize()){let e=(p=r.getSize(),32/Math.min(p[0],p[1]));r.setScale(r.getScaleArray()[0]/e)}o=null,d=null,A=(e,t)=>{var i;if(e.get("pictureOptions")){let n=e.get("pictureOptions");"string"==typeof n&&(n=JSON.parse(n)),e.set("pictureOptions",n),n.resolution&&r?.setScale(n.resolution/t*(null!==(i=n?.defaultScale)&&void 0!==i?i:1))}return new Cw({fill:o??void 0,image:r??void 0,stroke:d??void 0,text:s??void 0,zIndex:c.getZIndex()})}}var p;if(!(h instanceof Yg||h instanceof Jg||h instanceof Bg)){A=[new Cw({fill:null!==(s=c?.getFill())&&void 0!==s?s:void 0,image:void 0,stroke:d??void 0,text:void 0,zIndex:c?.getZIndex()})];let t=e.get("fillPattern");if(t){let r=JSON.parse(t);e.set("fillPattern",r),c?.getFill()||A[0].setFill(new pw);let i=r?.empty?[0,0,0,0]:bI(r.id,r.color);null===(l=null===(o=A[0])||void 0===o?void 0:o.getFill())||void 0===l||l.setColor(i)}e.get("lineStartIcon")&&A.push(PI(e,JSON.parse(e.get("lineStartIcon")),d?.getColor())),e.get("lineEndIcon")&&A.push(PI(e,JSON.parse(e.get("lineEndIcon")),d?.getColor(),!1))}e.setStyle(A)}writeFeatures(e,t,r){var i,n;let a,s=[];return[...null!==(n=null===(i=e?.getSource())||void 0===i?void 0:i.getFeatures())&&void 0!==n?n:[]].sort(((e,t)=>Hd(e)<=Hd(t)?-1:1)).forEach((i=>{var n,a,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E,I,T,F,P,L,M,k,U;let R,D=i.clone();if("Circle"===(null===(n=D.getGeometry())||void 0===n?void 0:n.getType())){let e=i.getGeometry();D.setGeometry(um(e,100)),D.set(xI,JSON.stringify(Kf(e.getCenter(),t,CI))),D.set(BI,e.getRadius())}D.setId(i.getId()),null===(a=D.getGeometry())||void 0===a||a.transform(t,CI),Object.keys(i.getProperties()).forEach((e=>{[xI,BI,"description","geometry","name"].includes(e)||D.unset(e,!0)})),i.getStyleFunction()?R=null===(o=i.getStyleFunction())||void 0===o?void 0:o(i,r):e?.getStyleFunction()&&(R=null===(l=e.getStyleFunction())||void 0===l?void 0:l(i,r));let N=Array.isArray(R)?R[0]:R,O={fill:null!==(h=N?.getFill())&&void 0!==h?h:void 0,image:null!==(A=N?.getImage())&&void 0!==A?A:void 0,stroke:null!==(u=N?.getStroke())&&void 0!==u?u:void 0,text:null!==(c=N?.getText())&&void 0!==c?c:void 0,zIndex:null!==(d=N?.getZIndex())&&void 0!==d?d:void 0};O.zIndex&&D.set("zIndex",O.zIndex);let Q=null===(p=O.text)||void 0===p?void 0:p.getText();if(Q){let e="";Array.isArray(Q)&&(D.set("textArray",JSON.stringify(Q)),e=Q.map(((e,t)=>t%2==0?e:"")).join("").replace(/\u200B/g,"")),e&&(/^(\s|\n)|(\n|\s)$/g.test(e)?D.set("name",`​${e}​`):D.set("name",e))}if(!(null===(f=O.text)||void 0===f)&&f.getRotation()&&D.set("textRotation",O.text.getRotation()),!(null===(g=O.text)||void 0===g)&&g.getFont()&&D.set("textFont",O.text.getFont()),!(null===(m=O.text)||void 0===m)&&m.getTextAlign()&&D.set("textAlign",O.text.getTextAlign()),!(null===(y=O.text)||void 0===y)&&y.getOffsetX()&&D.set("textOffsetX",O.text.getOffsetX()),!(null===(_=O.text)||void 0===_)&&_.getOffsetY()&&D.set("textOffsetY",O.text.getOffsetY()),!(null===(v=O.text)||void 0===v)&&v.getStroke()&&(!(null===(w=O.text.getStroke())||void 0===w)&&w.getColor()&&D.set("textStrokeColor",M_(null===(b=O.text.getStroke())||void 0===b?void 0:b.getColor())),!(null===(x=O.text.getStroke())||void 0===x)&&x.getWidth()&&D.set("textStrokeWidth",null===(B=O.text.getStroke())||void 0===B?void 0:B.getWidth())),!(null===(C=O.text)||void 0===C)&&C.getBackgroundFill()&&D.set("textBackgroundFillColor",M_(null===(S=O.text.getBackgroundFill())||void 0===S?void 0:S.getColor())),!(null===(E=O.text)||void 0===E)&&E.getPadding()&&D.set("textPadding",null===(I=O.text.getPadding())||void 0===I?void 0:I.join()),!(null===(T=O.stroke)||void 0===T)&&T.getLineCap()&&D.set("lineCap",O.stroke.getLineCap()),!(null===(F=O.stroke)||void 0===F)&&F.getLineJoin()&&D.set("lineJoin",O.stroke.getLineJoin()),!(null===(P=O.stroke)||void 0===P)&&P.getLineDash()&&D.set("lineDash",null===(L=O.stroke.getLineDash())||void 0===L?void 0:L.join(",")),!(null===(M=O.stroke)||void 0===M)&&M.getLineDashOffset()&&D.set("lineDashOffset",O.stroke.getLineDashOffset()),!(null===(k=O.stroke)||void 0===k)&&k.getMiterLimit()&&D.set("miterLimit",O.stroke.getMiterLimit()),O.image instanceof vw&&(O.image=void 0),O.image){let e=O.image.getSrc();/(http(s?)):\/\//gi.test(e)||console.log("Local image source not supported for KML export.Should use remote web server"),O.image.getRotation()&&D.set("iconRotation",O.image.getRotation()),O.image.getScale()&&D.set("iconScale",O.image.getScale()),i.get("pictureOptions")&&D.set("pictureOptions",JSON.stringify(i.get("pictureOptions")))}i.get("fillPattern")&&(D.set("fillPattern",JSON.stringify(i.get("fillPattern"))),O.fill=void 0),i.get("maxZoom")&&D.set("maxZoom",parseFloat(i.get("maxZoom"))),i.get("minZoom")&&D.set("minZoom",parseFloat(i.get("minZoom"))),O.text&&!O.image&&(O.image=new lb({scale:0,src:"noimage"})),(Array.isArray(R)&&R.slice(1)||[]).forEach((e=>{var t,r,n,a,s,o,l,h,A;if(e&&e.getImage()instanceof lb&&e.getGeometry()){let u=null===(r=null===(t=e?.getGeometry())||void 0===t?void 0:t(i))||void 0===r?void 0:r.getCoordinates(),c=null===(n=i.getGeometry())||void 0===n?void 0:n.getFirstCoordinate();u?.[0]===c?.[0]&&u?.[1]===c?.[1]?D.set("lineStartIcon",JSON.stringify({scale:null===(a=e?.getImage())||void 0===a?void 0:a.getScale(),size:null===(s=e?.getImage())||void 0===s?void 0:s.getSize(),url:null===(o=e?.getImage())||void 0===o?void 0:o.getSrc(),zIndex:e?.getZIndex()})):D.set("lineEndIcon",JSON.stringify({scale:null===(l=e.getImage())||void 0===l?void 0:l.getScale(),size:null===(h=e.getImage())||void 0===h?void 0:h.getSize(),url:null===(A=e.getImage())||void 0===A?void 0:A.getSrc(),zIndex:e.getZIndex()}))}}));let z=new Cw(O);D.setStyle(z),D.getGeometry()instanceof Yg&&z.getText()&&(null===(U=z.getText())||void 0===U||!U.getText())||s.push(D)})),s.length>0&&(1===s.length&&s.push(new fm),a=new eI({defaultStyle:[TI],extractStyles:!0}).writeFeatures(s),a=a.replace(/<Icon>\s*<href>noimage<\/href>\s*<\/Icon>/g,""),a=a.replace(/<Placemark\/>/g,""),e.get("name")&&(a=a.replace(/<Document>/,`<Document><name>${e.get("name")}</name>`))),a}},MI=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},kI=function(e,t,r,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r},UI=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},RI=new LI;_I=new WeakMap;var DI=class extends uB{get api(){return this.get("api")}set api(e){this.set("api",e)}get apiKey(){return this.get("apiKey")}set apiKey(e){this.apiKey!==e&&(this.set("apiKey",e),this.fetchPlans())}get bbox(){return this.get("bbox")}set bbox(e){var t;(null===(t=this.bbox)||void 0===t?void 0:t.toString())!==e?.toString()&&(this.set("bbox",e),this.fetchPlans())}get doNotRevert32pxScaling(){return this.get("doNotRevert32pxScaling")}set doNotRevert32pxScaling(e){this.set("doNotRevert32pxScaling",e),this.updateFeatures()}get planId(){return this.get("planId")}set planId(e){this.planId!==e&&(this.set("planId",e),this.fetchPlans(e))}get plans(){return this.get("plans")}set plans(e){this.set("plans",e),this.updateFeatures()}get tags(){return this.get("tags")}set tags(e){var t;(null===(t=this.tags)||void 0===t?void 0:t.toString())!==e?.toString()&&(this.set("tags",e),this.fetchPlans())}get tenants(){return this.get("tenants")}set tenants(e){var t;(null===(t=this.tenants)||void 0===t?void 0:t.toString())!==e?.toString()&&(this.set("tenants",e),this.fetchPlans())}get timestamp(){return this.get("timestamp")}set timestamp(e){this.timestamp!==e&&(this.set("timestamp",e),this.fetchPlans())}get url(){return this.get("url")}set url(e){this.url!==e&&(this.set("url",e),this.fetchPlans())}get zoom(){return this.get("zoom")}set zoom(e){this.zoom!==e&&(this.set("zoom",e),this.fetchPlans())}constructor(e={}){var t,r,i;super(Object.assign({source:null!==(t=e.source)&&void 0!==t?t:new dw,url:null!==(r=e.url)&&void 0!==r?r:"https://editor.mapset.io/api/v1",zoom:e.zoom},e)),_I.set(this,void 0),this.api=null!==(i=e.api)&&void 0!==i?i:new Dc({apiKey:e.apiKey,bbox:e.bbox,tags:e.tags,tenants:e.tenants,timestamp:e.timestamp,url:this.url,zoom:e.zoom}),kI(this,_I,new AbortController,"f")}fetchPlans(e){return MI(this,void 0,void 0,(function*(){var t,r;if(null===(t=UI(this,_I,"f"))||void 0===t||t.abort(),kI(this,_I,new AbortController,"f"),e){let t;try{t=yield this.api.getPlanById(e,{signal:UI(this,_I,"f").signal})}catch(e){if((e?.name).includes("AbortError"))return;throw console.error("MapsetLayer: Error fetching plan by ID...",e),e}return void(this.plans=[t])}let i=[];this.api=new Dc({apiKey:this.apiKey,bbox:null!==(r=this.bbox)&&void 0!==r?r:void 0,tags:this.tags||[],tenants:this.tenants||[],timestamp:this.timestamp,url:this.url,zoom:this.zoom});try{i=yield this.api.getPlans({},{signal:UI(this,_I,"f").signal})}catch(e){if((e?.name).includes("AbortError"))return;throw console.error("MapsetLayer: Error fetching plans...",e),e}this.plans=i}))}setMapInternal(e){super.setMapInternal(e),this.planId?this.fetchPlans(this.planId):this.fetchPlans()}updateFeatures(){var e,t,r,i,n;null===(e=this.getSource())||void 0===e||e.clear();let a=this.getMapInternal();if(a&&0!==(null===(t=this.plans)||void 0===t?void 0:t.length)){let e=null!==(i=null===(r=this.plans)||void 0===r?void 0:r.flatMap((e=>RI.readFeatures(e.data,a.getView().getProjection(),this.doNotRevert32pxScaling))))&&void 0!==i?i:[];null===(n=this.getSource())||void 0===n||n.addFeatures(e)}this.dispatchEvent("updatefeatures")}},NI={1:"osm"};function OI(e=0,t=NI){var r;let i=Object.keys(t).map((e=>parseFloat(e))),n=i.reverse().find((t=>t<=Math.floor(e)-1));return n??(n=Math.min(...i)),null!==(r=t[n])&&void 0!==r?r:"osm"}var QI,zI,HI=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},jI=function(e,t,r,i){if("a"===r&&!i)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?i:"a"===r?i.call(e):i?i.value:t.get(e)},VI=function(e,t,r,i,n){if("m"===i)throw new TypeError("Private method is not writable");if("a"===i&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===i?n.call(e,r):n?n.value=r:t.set(e,r),r},GI="moco";QI=new WeakMap,zI=new WeakMap;var KI=class extends vI{get api(){return this.get("api")}set api(e){this.set("api",e),this.updateData()}get apiKey(){return this.api.apiKey}set apiKey(e){this.api.apiKey=e,this.updateData()}get apiParameters(){return this.get("apiParameters")}set apiParameters(e){this.set("apiParameters",e),this.updateData()}get loadAll(){var e;return null===(e=this.get("loadAll"))||void 0===e||e}set loadAll(e){this.set("loadAll",e),this.updateData()}set publicAt(e){this.set("publicAt",e),this.updateData()}get publicAt(){return this.get("publicAt")||new Date}set situations(e){this.loadAll=!1,this.set("situations",e),this.updateData()}get situations(){return this.get("situations")}get tenant(){return this.get("tenant")}set tenant(e){this.set("tenant",e),this.updateData()}get url(){return this.api.url}set url(e){this.api.url=e,this.updateData()}constructor(e){super(Object.assign({api:new Oc({apiKey:e.apiKey,tenant:e.tenant,url:e.url}),layersFilter:({metadata:e,source:t})=>"moco"===e?.["general.filter"]||t===GI},e)),QI.set(this,null),zI.set(this,{features:[],type:"FeatureCollection"})}attachToMap(e){var t,r;super.attachToMap(e),(null===(r=null===(t=this.maplibreLayer)||void 0===t?void 0:t.mapLibreMap)||void 0===r?void 0:r.getSource(GI))&&this.updateData();let i=this.getMapInternal();i&&this.olEventsKeys.push(i.on("moveend",(()=>{this.onZoomEnd()})))}detachFromMap(){var e,t;super.detachFromMap();let r=null===(t=null===(e=this.maplibreLayer)||void 0===e?void 0:e.mapLibreMap)||void 0===t?void 0:t.getSource(GI);r&&r.setData({features:[],type:"FeatureCollection"}),jI(this,QI,"f")&&(jI(this,QI,"f").abort(),VI(this,QI,null,"f"))}getDataByGraph(e){var t,r,i,n,a;let s=OI(null===(r=null===(t=this.getMapInternal())||void 0===t?void 0:t.getView())||void 0===r?void 0:r.getZoom(),null===(a=(null===(n=null===(i=this.maplibreLayer)||void 0===i?void 0:i.mapLibreMap)||void 0===n?void 0:n.getStyle()).metadata)||void 0===a?void 0:a.graphs);return{features:(e?.features||[]).filter((e=>{var t;return(null===(t=e.properties)||void 0===t?void 0:t.graph)===s})),type:"FeatureCollection"}}loadData(){return HI(this,void 0,void 0,(function*(){var e,t,r,i;jI(this,QI,"f")&&jI(this,QI,"f").abort(),VI(this,QI,new AbortController,"f");let n=(null===(r=(null===(t=null===(e=this.maplibreLayer)||void 0===e?void 0:e.mapLibreMap)||void 0===t?void 0:t.getStyle()).metadata)||void 0===r?void 0:r.graphs)??NI,a=[...new Set(Object.values(n))].join(",");try{return(yield this.api.export(Object.assign({graph:a,hasGeoms:!0,publicAt:this.publicAt.toISOString()},null!==(i=this.apiParameters)&&void 0!==i?i:{}),{signal:jI(this,QI,"f").signal})).paginatedSituations.results}catch(e){if(e&&e.name.includes("AbortError"))return[];throw e}}))}onLoad(){super.onLoad(),this.updateData()}onZoomEnd(){var e,t;let r=null===(t=null===(e=this.maplibreLayer)||void 0===e?void 0:e.mapLibreMap)||void 0===t?void 0:t.getSource(GI);if(!r||!jI(this,zI,"f").features.length)return;let i=this.getDataByGraph(jI(this,zI,"f"));i!==jI(this,zI,"f")&&r.setData(i)}updateData(){return HI(this,void 0,void 0,(function*(){var e,t,r;if(this.loadAll){let e=yield this.loadData();this.set("situations",e??[])}let i=null===(t=null===(e=this.maplibreLayer)||void 0===e?void 0:e.mapLibreMap)||void 0===t?void 0:t.getSource(GI);if(!i)return console.warn("MocoLayer: No source found for id : ",GI),Promise.reject(new Error("No source found"));let n={features:(null!==(r=this.situations)&&void 0!==r?r:[]).flatMap((e=>Om(e).features)),type:"FeatureCollection"};return VI(this,zI,n,"f"),i.setData(this.getDataByGraph(n)),Promise.resolve(!0)}))}},qI=h(A()),ZI=h(A()),WI=h(d()),$I=class{get mode(){return this._mode}set mode(e){var t,r;e!==this._mode&&(this._mode=e,null!==(r=null===(t=this.api)||void 0===t?void 0:t.wsApi)&&void 0!==r&&r.open&&(this.stop(),this.start()))}get speed(){return this._speed}set speed(e){this._speed=e,this.start()}get style(){return this._style}set style(e){this._style=e,this.renderTrajectories()}get time(){return this._time}set time(e){this._time=e?.getTime?e:new Date(e),this.renderTrajectories()}constructor(e){var t,r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m;this.isIdle=!1,this.getViewState=()=>({}),this.shouldRender=()=>!0,this._mode=e.mode||jc.TOPOGRAPHIC,this._speed=null!==(t=e.speed)&&void 0!==t?t:1,this._style=null!==(r=e.style)&&void 0!==r?r:Yc,this._time=null!==(i=e.time)&&void 0!==i?i:new Date,this.api=null!==(n=e.api)&&void 0!==n?n:new Vc(e),this.bboxParameters=e.bboxParameters,this.canvas=null!==(a=e.canvas)&&void 0!==a?a:typeof document<"u"?document.createElement("canvas"):void 0,this.debug=null!==(s=e.debug)&&void 0!==s&&s,this.filter=e.filter,this.hoverVehicleId=e.hoverVehicleId,this.live=!1!==e.live,this.minZoomInterpolation=null!==(o=e.minZoomInterpolation)&&void 0!==o?o:8,this.pixelRatio=null!==(l=e.pixelRatio)&&void 0!==l?l:typeof window<"u"?window.devicePixelRatio:1,this.selectedVehicleId=e.selectedVehicleId,this.sort=e.sort,this.styleOptions=Object.assign(Object.assign({},Qm),null!==(h=e.styleOptions)&&void 0!==h?h:{}),this.tenant=null!==(A=e.tenant)&&void 0!==A?A:"",this.trajectories={},this.useDebounce=null!==(u=e.useDebounce)&&void 0!==u&&u,this.useRequestAnimationFrame=null!==(c=e.useRequestAnimationFrame)&&void 0!==c&&c,this.useThrottle=!1!==e.useThrottle,this.getViewState=null!==(d=e.getViewState)&&void 0!==d?d:()=>({}),this.shouldRender=null!==(p=e.shouldRender)&&void 0!==p?p:()=>!0,this.getRefreshTimeInMs=null!==(f=e.getRefreshTimeInMs)&&void 0!==f?f:this.getRefreshTimeInMs.bind(this),this.onRender=e.onRender,this.onIdle=e.onIdle,this.onStart=e.onStart,this.onStop=e.onStop,this.format=new Im,this.motsByZoom=null!==(g=e.motsByZoom)&&void 0!==g?g:[Hm,Hm,Hm,Hm,Hm,Hm,Hm,Hm,Hm,Vm,Vm],this.getMotsByZoom=t=>e.getMotsByZoom?e.getMotsByZoom(t,this.motsByZoom):t>this.motsByZoom.length-1?this.motsByZoom[this.motsByZoom.length-1]:this.motsByZoom[t],this.generalizationLevelByZoom=e.generalizationLevelByZoom||[],this.getGeneralizationLevelByZoom=t=>e.getGeneralizationLevelByZoom?e.getGeneralizationLevelByZoom(t,this.generalizationLevelByZoom):t>this.generalizationLevelByZoom.length-1?this.generalizationLevelByZoom[this.generalizationLevelByZoom.length-1]:this.generalizationLevelByZoom[t],this.graphByZoom=null!==(m=e.graphByZoom)&&void 0!==m?m:[],this.getGraphByZoom=t=>{var r,i;return e.getGraphByZoom?e.getGraphByZoom(t,this.graphByZoom):t>this.graphByZoom.length-1?null===(r=this.graphByZoom)||void 0===r?void 0:r[this.graphByZoom.length-1]:null===(i=this.graphByZoom)||void 0===i?void 0:i[t]},this.renderTimeIntervalByZoom=e.renderTimeIntervalByZoom||[1e5,5e4,4e4,3e4,2e4,15e3,1e4,5e3,2e3,1e3,400,300,250,180,90,60,50,50,50,50,50],this.getRenderTimeIntervalByZoom=t=>e.getRenderTimeIntervalByZoom?e.getRenderTimeIntervalByZoom(t,this.renderTimeIntervalByZoom):this.renderTimeIntervalByZoom[t],this.isUpdateBboxOnMoveEnd=!1!==e.isUpdateBboxOnMoveEnd,this.throttleRenderTrajectories=(0,WI.default)(this.renderTrajectoriesInternal,50,{leading:!1,trailing:!0}),this.debounceRenderTrajectories=(0,ZI.default)(this.renderTrajectoriesInternal,50,{leading:!0,maxWait:5e3,trailing:!0}),this.renderState={center:[0,0],rotation:0,zoom:void 0},this.onTrajectoryMessage=this.onTrajectoryMessage.bind(this),this.onDeleteTrajectoryMessage=this.onDeleteTrajectoryMessage.bind(this),this.onDocumentVisibilityChange=this.onDocumentVisibilityChange.bind(this)}addTrajectory(e){this.trajectories||(this.trajectories={});let t=e.properties.train_id;void 0!==t&&(this.trajectories[t]=e),this.renderTrajectories()}attachToMap(){document.addEventListener("visibilitychange",this.onDocumentVisibilityChange)}detachFromMap(){if(document.removeEventListener("visibilitychange",this.onDocumentVisibilityChange),this.stop(),this.canvas){let e=this.canvas.getContext("2d");e&&e.clearRect(0,0,this.canvas.width,this.canvas.height)}}getRefreshTimeInMs(){var e,t;let r=null!==(e=this.getViewState().zoom)&&void 0!==e?e:0,i=void 0!==r?Math.round(r):-1,n=this.getRenderTimeIntervalByZoom(i)||25,a=Math.max(25,n/(this.speed||1)),s=Math.min(a,500);if(this.useThrottle?this.throttleRenderTrajectories=(0,WI.default)(this.renderTrajectoriesInternal,s,{leading:!0,trailing:!0}):this.useDebounce&&(this.debounceRenderTrajectories=(0,ZI.default)(this.renderTrajectoriesInternal,s,{leading:!0,maxWait:5e3,trailing:!0})),null!==(t=this.api)&&void 0!==t&&t.buffer){let[,e]=this.api.buffer;this.api.buffer=[s,e]}return a}getVehicles(e){return this.trajectories&&Object.values(this.trajectories).filter(e)||[]}getVehiclesAtCoordinate(e,t){let{resolution:r}=this.getViewState(),{hitTolerance:i,nb:n}=t||{},a=cd([...e,...e],(i??5)*(r??1)),s=Object.values(this.trajectories||{});this.sort&&(s=s.sort(this.sort));let o=[];for(let e=0;e<s.length;e+=1){let t=s[e],{coordinate:r}=t.properties;if(r&&fd(a,r)&&o.push(t),o.length===n)break}return{features:o,type:"FeatureCollection"}}onDeleteTrajectoryMessage(e){e.content&&this.removeTrajectory(e.content)}onDocumentVisibilityChange(){if(document.hidden)this.stop(),this.trajectories={};else{if(!this.getViewState().visible)return;this.start()}}onTrajectoryMessage(e){if(this.updateIdleState(),!e.content)return;let t=e.content,{geometry:r,properties:{raw_coordinates:i,time_since_update:n}}=t;n<0||this.purgeTrajectory(t)||(this.debug&&this.mode===jc.TOPOGRAPHIC&&i?t.properties.olGeometry=this.format.readGeometry({coordinates:zf(i),type:"Point"}):t.properties.olGeometry=this.format.readGeometry(r),t.properties.timeOffset=Date.now()-e.timestamp,this.addTrajectory(t))}onZoomEnd(){this.startUpdateTime()}purgeOutOfDateTrajectories(){Object.entries(this.trajectories||{}).forEach((([e,t])=>{var r;let i=null===(r=t?.properties)||void 0===r?void 0:r.time_intervals;this.time&&i?.length&&i[i.length-1][0]<this.time.getTime()&&this.removeTrajectory(e)}))}purgeTrajectory(e){let t=this.getViewState().extent,{bounds:r,type:i}=e.properties;return!!(this.isUpdateBboxOnMoveEnd&&t&&!Dd(t,r)||this.mots&&!this.mots.includes(i))&&(this.removeTrajectory(e),!0)}removeTrajectory(e){var t;let r;r="string"!=typeof e?null===(t=e?.properties)||void 0===t?void 0:t.train_id:e,void 0!==r&&this.trajectories&&delete this.trajectories[r]}renderTrajectories(e){let t=this.getViewState();this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=void 0),t?.center&&t?.extent&&t?.size&&(!e&&this.useRequestAnimationFrame?this.requestId=requestAnimationFrame((()=>{this.renderTrajectoriesInternal(t,e)})):!e&&this.useDebounce?this.debounceRenderTrajectories(t,e):!e&&this.useThrottle?this.throttleRenderTrajectories(t,e):this.renderTrajectoriesInternal(t,e))}renderTrajectoriesInternal(e,t=!1){var r,i;if(!this.trajectories||!this.shouldRender())return!1;let n=this.live?Date.now():null===(r=this.time)||void 0===r?void 0:r.getTime(),a=Object.values(this.trajectories);return this.sort&&a.sort(this.sort),!this.canvas||!this.style||(this.renderState=ry(this.canvas,a,this.style,Object.assign(Object.assign({},e),{pixelRatio:this.pixelRatio||1,time:n}),Object.assign({filter:this.filter,hoverVehicleId:this.hoverVehicleId,noInterpolate:(e.zoom||0)<this.minZoomInterpolation||t,selectedVehicleId:this.selectedVehicleId},this.styleOptions)),null===(i=this.onRender)||void 0===i||i.call(this,this.renderState,e)),!0}setBbox(){var e;this.updateIdleState();let t=this.getViewState(),r=t.extent,i=null!==(e=t.zoom)&&void 0!==e?e:0;if(!r||Number.isNaN(i))return;if(this.trajectories&&r&&i){let e=Object.keys(this.trajectories);for(let t=e.length-1;t>=0;t-=1)this.purgeTrajectory(this.trajectories[e[t]])}let n=Math.floor(i);if(!r||Number.isNaN(n))return;let[a,s,o,l]=r,h=[Math.floor(a),Math.floor(s),Math.ceil(o),Math.ceil(l),n];this.generalizationLevel=this.getGeneralizationLevelByZoom(n),this.generalizationLevel&&h.push(`gen=${this.generalizationLevel}`),this.mots=this.getMotsByZoom(n),this.mots&&h.push(`mots=${this.mots.toString()}`),this.tenant&&h.push(`tenant=${this.tenant}`),"topographic"!==this.mode&&h.push(`channel_prefix=${this.mode}`);let A=this.getGraphByZoom(n);A&&h.push(`graph=${A}`),this.bboxParameters&&Object.entries(this.bboxParameters).forEach((([e,t])=>{h.push(`${e}=${t}`)})),this.api.bbox=h}start(){this.stop(),this.purgeOutOfDateTrajectories(),this.renderTrajectories(),this.startUpdateTime(),this.api.open(),this.api.subscribeTrajectory(this.mode,this.onTrajectoryMessage,void 0,this.isUpdateBboxOnMoveEnd),this.api.subscribeDeletedVehicles(this.mode,this.onDeleteTrajectoryMessage,void 0,this.isUpdateBboxOnMoveEnd),this.isUpdateBboxOnMoveEnd&&this.setBbox(),this.onStart&&this.onStart(this)}startUpdateTime(){this.stopUpdateTime(),this.updateTimeDelay=this.getRefreshTimeInMs()||0,this.updateTimeInterval=window.setInterval((()=>{this.live?this.time=new Date:this.time&&this.updateTimeDelay&&this.speed&&(this.time=new Date(this.time.getTime()+this.updateTimeDelay*this.speed))}),this.updateTimeDelay)}stop(){this.api.unsubscribeTrajectory(this.onTrajectoryMessage),this.api.unsubscribeDeletedVehicles(this.onDeleteTrajectoryMessage),this.api.close(),this.onStop&&this.onStop(this)}stopUpdateTime(){this.updateTimeInterval&&(clearInterval(this.updateTimeInterval),this.updateTimeInterval=void 0)}updateIdleState(){this.isIdle=!1,clearTimeout(this._idleTimeout),this._idleTimeout=window.setTimeout((()=>{var e;this.isIdle=!0,null===(e=this.onIdle)||void 0===e||e.call(this,this)}),1e3)}},XI=new Im,YI=class extends pb{forEachFeatureAtCoordinate(e,t,r,i){let n=this.getFeaturesAtCoordinate(e,r);return n.forEach((e=>{i(e,this.layer_,e.getGeometry())})),n?.[0]}getData(e){var t;let r;try{let{pixelRatio:i}=this.getLayer(),n=null===(t=this.canvas)||void 0===t?void 0:t.getContext("2d",{willReadFrequently:!0});return r=n?.getImageData(e[0]*(i||1),e[1]*(i||1),1,1).data||null,r}catch(e){console.error("error getting data",e)}return null}getFeatures(e){var t,r;let i=null===(r=null===(t=this.getLayer())||void 0===t?void 0:t.getMapInternal())||void 0===r?void 0:r.getCoordinateFromPixel(e);return Promise.resolve(this.getFeaturesAtCoordinate(i))}getFeaturesAtCoordinate(e,t=5){if(!e)return[];let r=this.getLayer(),i=r.engine.getVehiclesAtCoordinate(e,{hitTolerance:t,nb:r.maxNbFeaturesRequested});return XI.readFeatures(i)}prepareFrame(){return!0}renderFrame(e){var t;let{canvas:r,engine:i,renderedViewState:n}=this.getLayer();if(this.getLayer().engine.pixelRatio=e.pixelRatio,this.ready=!(null===(t=i.renderState)||void 0===t||!t.renderedTrajectories)&&i.isIdle,this.container||(this.container=document.createElement("div"),this.container.className=this.getLayer().getClassName(),this.container.style.position="absolute",this.container.style.width="100%",this.container.style.height="100%",r instanceof HTMLCanvasElement&&(r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.transformOrigin="top left",this.container.appendChild(r))),n){let{center:t,resolution:i,rotation:a}=e.viewState,{center:s,resolution:o,rotation:l}=n;if(o/i>=3){let e=r?.getContext("2d");r?.width&&r?.height&&e?.clearRect(0,0,r.width,r.height)}else{let e=this.getLayer().getMapInternal(),r=e?.getPixelFromCoordinate(s),n=e?.getPixelFromCoordinate(t);r&&n&&(this.container.style.transform=function(e,t,r,i,n,a,s){return og(ng([1,0,0,1,0,0],e,t,r,i,n,a,s))}(r[0]-n[0],r[1]-n[1],o/i,o/i,a-l,0,0))}}return this.container}},JI=new Cw({image:new vw({fill:new pw({color:"#000000"}),radius:5}),stroke:new fw({color:"#000000",width:6}),zIndex:2}),eT=(e,t,r)=>{let i="#ffffff",n=e.get("type"),a=e.get("stroke");return a&&"#"!==a[0]&&(a=`#${a}`),i=a||r?.getBgColor(n,{name:e.get("line_name")}),i=/#ffffff/i.test(i)?"#ff0000":i,[JI,new Cw({image:new vw({fill:new pw({color:i}),radius:4}),stroke:new fw({color:i,width:4}),zIndex:3})]},tT=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},rT=new Im,iT=class e extends jy{get api(){return this.engine.api}set api(e){this.engine.api=e}get canvas(){return this.engine.canvas}get filter(){return this.engine.filter}set filter(e){this.engine.filter=e}get hoverVehicleId(){return this.engine.hoverVehicleId}set hoverVehicleId(e){this.engine.hoverVehicleId=e}get mode(){return this.engine.mode}set mode(e){this.engine.mode=e}get pixelRatio(){return this.engine.pixelRatio}get selectedVehicleId(){return this.engine.selectedVehicleId}set selectedVehicleId(e){this.engine.selectedVehicleId=e}get sort(){return this.engine.sort}set sort(e){this.engine.sort=e}get style(){var e;return null===(e=this.engine)||void 0===e?void 0:e.style}set style(e){this.engine&&(this.engine.style=e)}get trajectories(){return this.engine.trajectories}constructor(e){super(Object.assign({source:new nw({})},e)),this.allowRenderWhenAnimating=!1,this.maxNbFeaturesRequested=100,this.olEventsKeys=[],iI(this,e),this.engine=new $I(Object.assign({getViewState:this.getViewState.bind(this),onIdle:this.onRealtimeEngineIdle.bind(this),onRender:this.onRealtimeEngineRender.bind(this)},e)),this.allowRenderWhenAnimating=!!e.allowRenderWhenAnimating,this.vectorLayer=new uB({source:new dw({features:[]}),style:(t,r)=>(e.fullTrajectoryStyle||eT)(t,r,this.engine.styleOptions),updateWhileAnimating:this.allowRenderWhenAnimating,updateWhileInteracting:!0}),this.onZoomEndDebounced=(0,qI.default)(this.onZoomEnd,100),this.onMoveEndDebounced=(0,qI.default)(this.onMoveEnd,100)}addTrajectory(e){var t;null===(t=this.engine)||void 0===t||t.addTrajectory(e)}attachToMap(){this.engine.attachToMap();let e=this.getMapInternal();e&&(this.getVisible()&&this.engine.start(),this.olEventsKeys.push(e.on("movestart",(()=>{this.engine.isUpdateBboxOnMoveEnd&&this.engine.updateIdleState()})),...e.on(["moveend","change:target"],(e=>{let t=(e.map||e.target).getView();if(!t||t?.getAnimating()||t?.getInteracting())return;let r=t.getZoom();this.currentZoom!==r&&this.onZoomEndDebounced(e),this.currentZoom=r,this.onMoveEndDebounced(e)})),this.on("change:visible",(e=>{e.target.getVisible()?this.engine.start():this.engine.stop()})),this.on("propertychange",(e=>{/(opacity|visible|zIndex|minResolution|maxResolution|minZoom|maxZoom)/.test(e.key)&&this.vectorLayer.set(e.key,e.target.get(e.key))}))))}cleanVectorLayer(){var e,t,r;null===(t=null===(e=this.vectorLayer)||void 0===e?void 0:e.getSource())||void 0===t||t.clear(!0),null===(r=this.vectorLayer.getMapInternal())||void 0===r||r.removeLayer(this.vectorLayer)}clone(t){return new e(Object.assign(Object.assign({},this.get("options")),t))}createRenderer(){return new YI(this)}detachFromMap(){var e;mp(this.olEventsKeys),null===(e=this.getMapInternal())||void 0===e||e.removeLayer(this.vectorLayer),this.engine.detachFromMap()}getFullTrajectory(e){return tT(this,void 0,void 0,(function*(){var t,r,i,n;let a=yield this.engine.api.getFullTrajectory(e,this.engine.mode,this.engine.getGeneralizationLevelByZoom(Math.floor((null===(r=null===(t=this.getMapInternal())||void 0===t?void 0:t.getView())||void 0===r?void 0:r.getZoom())||0)));return null!==(n=null===(i=a?.content)||void 0===i?void 0:i.features)&&void 0!==n&&n.length?rT.readFeatures(a?.content):[]}))}getStopSequences(e){return tT(this,void 0,void 0,(function*(){let t=yield this.engine.api.getStopSequence(e);return t?.content}))}getTrajectoryInfos(e){return tT(this,void 0,void 0,(function*(){let t=[this.getStopSequences(e),this.getFullTrajectory(e)],[r,i]=yield Promise.all(t);return{fullTrajectory:i,stopSequences:r}}))}getVehicles(e){return this.engine.getVehicles(e)}getViewState(){let e=this.getMapInternal();if(!e?.getView())return{};let t=e.getView(),r=t.calculateExtent(),i=this.getExtent();return i&&(r=Md(r,i),Nd(r)&&(r=i)),{center:t.getCenter(),extent:r,pixelRatio:this.engine.pixelRatio,resolution:t.getResolution(),rotation:t.getRotation(),size:e.getSize(),visible:this.getVisible(),zoom:t.getZoom()}}highlight(e){let t=Array.isArray(e)?e[0]:e,r=t?.get("train_id");this.hoverVehicleId!==r&&(this.hoverVehicleId=r,this.engine.renderTrajectories(!0))}highlightTrajectory(e){return tT(this,void 0,void 0,(function*(){var t,r,i,n,a,s;let o=yield this.getFullTrajectory(e);this.cleanVectorLayer(),o.length&&(null===(r=null===(t=this.vectorLayer)||void 0===t?void 0:t.getSource())||void 0===r||r.addFeatures(o)),this.vectorLayer.getMapInternal()&&this.vectorLayer.getMapInternal()!==this.getMapInternal()&&(null===(i=this.vectorLayer.getMapInternal())||void 0===i||i.removeLayer(this.vectorLayer));let l=this.getZIndex();if(void 0!==l)this.vectorLayer.setZIndex(l-1),this.vectorLayer.getMapInternal()||null===(n=this.getMapInternal())||void 0===n||n.addLayer(this.vectorLayer);else if(!this.vectorLayer.getMapInternal()){let e=(null===(a=this.getMapInternal())||void 0===a?void 0:a.getLayers().getArray().indexOf(this))||0;e&&(null===(s=this.getMapInternal())||void 0===s||s.getLayers().insertAt(e,this.vectorLayer))}return o}))}onMoveEnd(){!this.engine.isUpdateBboxOnMoveEnd||!this.getVisible()||this.engine.setBbox()}onRealtimeEngineIdle(){this.changed()}onRealtimeEngineRender(e,t){this.renderedViewState=Object.assign({},t);let{container:r}=this.getRenderer();r&&(r.style.transform="")}onZoomEnd(){this.engine.onZoomEnd(),this.engine.isUpdateBboxOnMoveEnd&&this.getVisible()&&this.selectedVehicleId&&this.highlightTrajectory(this.selectedVehicleId)}removeTrajectory(e){var t;null===(t=this.engine)||void 0===t||t.removeTrajectory(e)}renderTrajectories(e){dI("RealtimeLayer.renderTrajectories is deprecated. Use RealtimeLayer.engine.renderTrajectories instead."),this.engine.renderTrajectories(e)}select(e){let t=Array.isArray(e)?e[0]:e,r=t?.get("train_id");this.selectedVehicleId!==r&&(this.cleanVectorLayer(),this.selectedVehicleId=r,this.engine.renderTrajectories(!0)),this.highlightTrajectory(r)}setMapInternal(e){e?(super.setMapInternal(e),this.attachToMap()):(this.detachFromMap(),super.setMapInternal(e))}shouldRender(){var e,t;return!this.allowRenderWhenAnimating&&((null===(e=this.getMapInternal())||void 0===e?void 0:e.getView().getAnimating())||(null===(t=this.getMapInternal())||void 0===t?void 0:t.getView().getInteracting()))}start(){this.engine.start()}stop(){this.engine.stop()}},nT=function(e,t,r,i){return new(r||(r=Promise))((function(n,a){function s(e){try{l(i.next(e))}catch(e){a(e)}}function o(e){try{l(i.throw(e))}catch(e){a(e)}}function l(e){e.done?n(e.value):function(e){return e instanceof r?e:new r((function(t){t(e)}))}(e.value).then(s,o)}l((i=i.apply(e,t||[])).next())}))},aT=new Im,sT={},oT=(e,t,...r)=>nT(void 0,[e,t,...r],void 0,(function*(e,t,r=5,i=!1){Object.values(sT).forEach((e=>{e?.abort()})),sT={};let n=nd(t).map((t=>nT(void 0,void 0,void 0,(function*(){var n,a,s,o;let l=t.getMapInternal(),h=null===(a=null===(n=l?.getView())||void 0===n?void 0:n.getProjection())||void 0===a?void 0:a.getCode(),A={coordinate:e,features:[],layer:t};if(!h)return Promise.resolve(A);let u=t;if(!i&&u.getFeatureInfoAtCoordinate)return u.getFeatureInfoAtCoordinate(e);let c=u?.getSource();if(c?.getFeatureInfoUrl){let t=Hd(u);null===(s=sT[t])||void 0===s||s.abort(),sT[t]=new AbortController;let r=null===(o=l?.getView())||void 0===o?void 0:o.getResolution(),i=yield((e,t,r)=>{let i,{coordinate:n,params:a,projection:s,resolution:o}=t;return e&&o&&s&&(i=e.getFeatureInfoUrl(n,o,s,Object.assign({info_format:"application/json",query_layers:e.getParams().layers},a))),fetch(i,{signal:r.signal}).then((e=>e.json())).then((e=>aT.readFeatures(e))).catch((()=>[]))})(c,{coordinate:e,params:{info_format:"application/json",query_layers:c.getParams().layers},projection:h,resolution:r},sT[t]).catch((()=>[])),n={coordinate:e,features:i,layer:u};return Promise.resolve(n)}let d=l?.getPixelFromCoordinate(e);if(!d)return Promise.resolve(A);let p=l?.getFeaturesAtPixel(d,{hitTolerance:u.get("hitTolerance")||r||5,layerFilter:e=>e===u});return Promise.resolve({coordinate:e,features:p,layer:u})}))));return Promise.all(n)})),lT=eu({hasDetails:!1,hasGeolocation:!1,hasLayerTree:!1,hasLnp:!1,hasMapset:!1,hasNotification:!1,hasPermalink:!1,hasPrint:!1,hasRealtime:!1,hasSearch:!1,hasShare:!1,hasStations:!1,hasToolbar:!0,isEmbed:!1,isExportMenuOpen:!1,isFollowing:!1,isLayerTreeOpen:!1,isOverlayOpen:!1,isSearchOpen:!1,isShareMenuOpen:!1,isTracking:!1,selectedFeatures:[],setBaseLayer:e=>{},setIsFollowing:e=>{},setIsTracking:e=>{},setLinesNetworkPlanLayer:e=>{},setMap:e=>{},setMapsetLayer:e=>{},setNotificationsLayer:e=>{},setPermalinkUrlSearchParams:e=>{},setPreviewNotifications:e=>{},setRealtimeLayer:e=>{},setSelectedFeature:e=>{},setSelectedFeatures:e=>{},setStation:e=>{},setStationId:e=>{},setStationsLayer:e=>{},setStopSequence:e=>{},setTrainId:e=>{}}),hT=()=>{let e=Uu(lT);if(!e)throw new Error("useMapContext must be used within a ContextProvider");return e};var AT=ec((function(e){let{apikey:t,baselayer:r,map:i,mapsurl:n,setBaseLayer:a}=hT(),s=Mu((()=>{if(r&&t)return new pI({apiKey:t,style:r,url:n,zIndex:0,...e||{}})}),[r,t,e,n]);return Tu((()=>{a(s)}),[s,a]),Tu((()=>{if(i&&s)return i.addLayer(s),()=>{i.removeLayer(s)}}),[i,s]),null}));var uT=function(){let{featuresInfos:e,featuresInfosHovered:t,realtimeLayer:r,setSelectedFeature:i,setSelectedFeatures:n,setStationId:a,setTrainId:s,stationsLayer:o,tenant:l}=hT();return Tu((()=>{let[e]=t?.find((e=>e.layer===r))?.features||[];r?.highlight(e)}),[t,r]),Tu((()=>{let[t]=e?.find((e=>e.layer===r))?.features||[],a=e?.find((e=>e.layer===o))?.features||[],[s]=a.filter((e=>e.get("tralis_network")?.includes(l))),h=e?.flatMap((e=>e.features))||[];t||s||!h.length?(i(t||s||null),n(t||s?[t||s]:[])):(n(h),i(t||s||h[0]))}),[e,r,i,n,a,s,o,l]),null};var cT=function(){let{details:e,embed:t,geolocation:r,hasDetails:i,hasLayerTree:n,hasPrint:a,hasRealtime:s,hasShare:o,isExportMenuOpen:l,isLayerTreeOpen:h,isSearchOpen:A,isShareMenuOpen:u,layertree:c,lnp:d,mapset:p,mapsetbbox:f,mapsetplanid:g,mapsettenants:m,notification:y,permalink:_,previewNotifications:v,print:w,realtime:b,search:x,selectedFeature:B,setFeaturesInfos:C,setHasDetails:S,setHasGeolocation:E,setHasLayerTree:I,setHasLnp:T,setHasMapset:F,setHasNotification:P,setHasPermalink:L,setHasPrint:M,setHasRealtime:k,setHasSearch:U,setHasShare:R,setHasStations:D,setHasToolbar:N,setIsEmbed:O,setIsExportMenuOpen:Q,setIsLayerTreeOpen:z,setIsOverlayOpen:H,setIsSearchOpen:j,setIsShareMenuOpen:V,setStationId:G,setTrainId:K,share:q,stationId:Z,tenant:W,toolbar:$,trainId:X}=hT();return Tu((()=>{D(!!W)}),[D,W]),Tu((()=>{k("true"===b)}),[b,k]),Tu((()=>{P("true"===y||!!v)}),[y,v,P]),Tu((()=>{F(!("true"!==p||(!f||!m)&&!g))}),[p,f,g,m,F]),Tu((()=>{E("true"===r)}),[r,E]),Tu((()=>{L("true"===_)}),[_,L]),Tu((()=>{U("true"===x)}),[x,U]),Tu((()=>{O("true"===t)}),[t,O]),Tu((()=>{T("true"===d)}),[d,T]),Tu((()=>{R("true"===q)}),[q,R]),Tu((()=>{M("true"===w)}),[w,M]),Tu((()=>{S("true"===e)}),[e,S]),Tu((()=>{N("true"===$)}),[$,N]),Tu((()=>{I("true"===c)}),[c,I]),Tu((()=>{A&&(z(!1),Q(!1),V(!1),G(null),K(null),C(null))}),[A,C,Q,z,V,G,K]),Tu((()=>{u&&(z(!1),Q(!1),j(!1),G(null),K(null),C(null))}),[u,C,Q,z,j,G,K]),Tu((()=>{h&&(Q(!1),z(h),j(!1),C(null),K(null),G(null),V(!1))}),[h,C,Q,z,j,V,G,K]),Tu((()=>{l&&(z(!1),Q(l),j(!1),C(null),K(null),V(!1),G(null))}),[l,C,Q,z,j,V,G,K]),Tu((()=>{B?(z(!1),j(!1),Q(!1),V(!1),K(B?.get("train_id")||null),G(B?.get("uid")||null)):B||(K(null),G(null))}),[B,Q,z,j,V,G,K]),Tu((()=>{Z&&(z(!1),Q(!1),j(!1),K(null),V(!1))}),[C,Q,z,j,V,K,Z]),Tu((()=>{X&&(z(!1),Q(!1),j(!1),G(null),V(!1))}),[C,Q,z,j,V,G,X]),Tu((()=>{H(i&&!!B||a&&l||n&&h||o&&u||s&&!!X||W&&!!Z)}),[i,B,a,l,n,h,o,u,s,X,W,Z,H]),null},dT="realtime",pT="stations",fT="notifications",gT="linesnetworkplan",mT="mapset",yT={linesnetworkplan:gT,mapset:mT,notifications:fT,realtime:dT,stations:pT},_T=Object.values(yT),vT=Object.values([gT,fT,pT,dT]),wT="isExporting";var bT=ec((function(e){let{baseLayer:t,map:r,setLinesNetworkPlanLayer:i}=hT(),n=Mu((()=>t?new vI({layersFilter:({metadata:e,source:t})=>e?.["geops.filter"]?.startsWith("netzplan")||"network_plans"===t,maplibreLayer:t,name:yT.linesnetworkplan,queryRenderedLayersFilter:({metadata:e})=>"netzplan_trips_info"===e?.["geops.filter"]||"netzplan_trips_info"===e?.["rvf.filter"],...e||{}}):null),[t,e]);return Tu((()=>{i?.(n)}),[n,i]),Tu((()=>{if(r&&n)return r.addLayer(n),()=>{r.removeLayer(n)}}),[r,n]),null})),xT=class extends Event{data;constructor(e,t,r={}){super(e,{...r,composed:!0}),this.data=t}logImportantData(){console.log(this.data)}},BT=xT,CT=(e,t,r)=>{e?.dispatchEvent(new BT(t,r,{bubbles:!0}))},ST=new Im;var ET=ec((function({node:e,wcAttributes:t}){let{map:r,permalinkUrlSearchParams:i,selectedFeature:n}=hT();return Tu((()=>{CT(e,"mwc:attribute",t)}),[e,t]),Tu((()=>{r?.on("singleclick",(t=>{CT(e,"mwc:singleclick",{coordinate:t.coordinate,pixel:t.pixel})}))}),[e,r]),Tu((()=>{let t=n?ST.writeFeatureObject(n):null;t?.properties?.features?.length>0&&(t.properties.features=t.properties.features.map((e=>ST.writeFeatureObject(e)))),CT(e,"mwc:selectedfeature",t)}),[e,n]),Tu((()=>{CT(e,"mwc:permalink",i?.toString())}),[e,i]),null})),IT=e=>{let t=LT(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),TT(r,t)||PT(e)},getConflictingClassGroupIds:(e,t)=>{let n=r[e]||[];return t&&i[e]?[...n,...i[e]]:n}}},TT=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],i=t.nextPart.get(r),n=i?TT(e.slice(1),i):void 0;if(n)return n;if(0===t.validators.length)return;let a=e.join("-");return t.validators.find((({validator:e})=>e(a)))?.classGroupId},FT=/^\[(.+)\]$/,PT=e=>{if(FT.test(e)){let t=FT.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},LT=e=>{let{theme:t,classGroups:r}=e,i={nextPart:new Map,validators:[]};for(let e in r)MT(r[e],i,e,t);return i},MT=(e,t,r,i)=>{e.forEach((e=>{if("string"!=typeof e){if("function"==typeof e)return UT(e)?void MT(e(i),t,r,i):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach((([e,n])=>{MT(n,kT(t,e),r,i)}))}else{(""===e?t:kT(t,e)).classGroupId=r}}))},kT=(e,t)=>{let r=e;return t.split("-").forEach((e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)})),r},UT=e=>e.isThemeGetter,RT=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,i=new Map,n=(n,a)=>{r.set(n,a),t++,t>e&&(t=0,i=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=i.get(e))?(n(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):n(e,t)}}},DT=e=>{let{prefix:t,experimentalParseClassName:r}=e,i=e=>{let t,r=[],i=0,n=0,a=0;for(let s=0;s<e.length;s++){let o=e[s];if(0===i&&0===n){if(":"===o){r.push(e.slice(a,s)),a=s+1;continue}if("/"===o){t=s;continue}}"["===o?i++:"]"===o?i--:"("===o?n++:")"===o&&n--}let s=0===r.length?e:e.substring(a),o=NT(s);return{modifiers:r,hasImportantModifier:o!==s,baseClassName:o,maybePostfixModifierPosition:t&&t>a?t-a:void 0}};if(t){let e=t+":",r=i;i=t=>t.startsWith(e)?r(t.substring(e.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:t,maybePostfixModifierPosition:void 0}}if(r){let e=i;i=t=>r({className:t,parseClassName:e})}return i},NT=e=>e.endsWith("!")?e.substring(0,e.length-1):e.startsWith("!")?e.substring(1):e,OT=e=>{let t=Object.fromEntries(e.orderSensitiveModifiers.map((e=>[e,!0])));return e=>{if(e.length<=1)return e;let r=[],i=[];return e.forEach((e=>{"["===e[0]||t[e]?(r.push(...i.sort(),e),i=[]):i.push(e)})),r.push(...i.sort()),r}},QT=/\s+/;function zT(){let e,t,r=0,i="";for(;r<arguments.length;)(e=arguments[r++])&&(t=HT(e))&&(i&&(i+=" "),i+=t);return i}var HT=e=>{if("string"==typeof e)return e;let t,r="";for(let i=0;i<e.length;i++)e[i]&&(t=HT(e[i]))&&(r&&(r+=" "),r+=t);return r};var jT=e=>{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},VT=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,GT=/^\((?:(\w[\w-]*):)?(.+)\)$/i,KT=/^\d+\/\d+$/,qT=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZT=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,WT=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,$T=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,XT=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,YT=e=>KT.test(e),JT=e=>!!e&&!Number.isNaN(Number(e)),eF=e=>!!e&&Number.isInteger(Number(e)),tF=e=>e.endsWith("%")&&JT(e.slice(0,-1)),rF=e=>qT.test(e),iF=()=>!0,nF=e=>ZT.test(e)&&!WT.test(e),aF=()=>!1,sF=e=>$T.test(e),oF=e=>XT.test(e),lF=e=>!AF(e)&&!gF(e),hF=e=>xF(e,EF,aF),AF=e=>VT.test(e),uF=e=>xF(e,IF,nF),cF=e=>xF(e,TF,JT),dF=e=>xF(e,CF,aF),pF=e=>xF(e,SF,oF),fF=e=>xF(e,PF,sF),gF=e=>GT.test(e),mF=e=>BF(e,IF),yF=e=>BF(e,FF),_F=e=>BF(e,CF),vF=e=>BF(e,EF),wF=e=>BF(e,SF),bF=e=>BF(e,PF,!0),xF=(e,t,r)=>{let i=VT.exec(e);return!!i&&(i[1]?t(i[1]):r(i[2]))},BF=(e,t,r=!1)=>{let i=GT.exec(e);return!!i&&(i[1]?t(i[1]):r)},CF=e=>"position"===e||"percentage"===e,SF=e=>"image"===e||"url"===e,EF=e=>"length"===e||"size"===e||"bg-size"===e,IF=e=>"length"===e,TF=e=>"number"===e,FF=e=>"family-name"===e,PF=e=>"shadow"===e,LF=function(e,...t){let r,i,n,a=function(o){let l=t.reduce(((e,t)=>t(e)),e());return r=(e=>({cache:RT(e.cacheSize),parseClassName:DT(e),sortModifiers:OT(e),...IT(e)}))(l),i=r.cache.get,n=r.cache.set,a=s,s(o)};function s(e){let t=i(e);if(t)return t;let a=((e,t)=>{let{parseClassName:r,getClassGroupId:i,getConflictingClassGroupIds:n,sortModifiers:a}=t,s=[],o=e.trim().split(QT),l="";for(let e=o.length-1;e>=0;e-=1){let t=o[e],{isExternal:h,modifiers:A,hasImportantModifier:u,baseClassName:c,maybePostfixModifierPosition:d}=r(t);if(h){l=t+(l.length>0?" "+l:l);continue}let p=!!d,f=i(p?c.substring(0,d):c);if(!f){if(!p){l=t+(l.length>0?" "+l:l);continue}if(f=i(c),!f){l=t+(l.length>0?" "+l:l);continue}p=!1}let g=a(A).join(":"),m=u?g+"!":g,y=m+f;if(s.includes(y))continue;s.push(y);let _=n(f,p);for(let e=0;e<_.length;++e){let t=_[e];s.push(m+t)}l=t+(l.length>0?" "+l:l)}return l})(e,r);return n(e,a),a}return function(){return a(zT.apply(null,arguments))}}((()=>{let e=jT("color"),t=jT("font"),r=jT("text"),i=jT("font-weight"),n=jT("tracking"),a=jT("leading"),s=jT("breakpoint"),o=jT("container"),l=jT("spacing"),h=jT("radius"),A=jT("shadow"),u=jT("inset-shadow"),c=jT("text-shadow"),d=jT("drop-shadow"),p=jT("blur"),f=jT("perspective"),g=jT("aspect"),m=jT("ease"),y=jT("animate"),_=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",gF,AF],v=()=>[gF,AF,l],w=()=>[YT,"full","auto",...v()],b=()=>[eF,"none","subgrid",gF,AF],x=()=>["auto",{span:["full",eF,gF,AF]},eF,gF,AF],B=()=>[eF,"auto",gF,AF],C=()=>["auto","min","max","fr",gF,AF],S=()=>["auto",...v()],E=()=>[YT,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...v()],I=()=>[e,gF,AF],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",_F,dF,{position:[gF,AF]}],F=()=>["auto","cover","contain",vF,hF,{size:[gF,AF]}],P=()=>[tF,mF,uF],L=()=>["","none","full",h,gF,AF],M=()=>["",JT,mF,uF],k=()=>[JT,tF,_F,dF],U=()=>["","none",p,gF,AF],R=()=>["none",JT,gF,AF],D=()=>["none",JT,gF,AF],N=()=>[JT,gF,AF],O=()=>[YT,"full",...v()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rF],breakpoint:[rF],color:[iF],container:[rF],"drop-shadow":[rF],ease:["in","out","in-out"],font:[lF],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rF],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rF],shadow:[rF],spacing:["px",JT],text:[rF],"text-shadow":[rF],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",YT,AF,gF,g]}],container:["container"],columns:[{columns:[JT,AF,gF,o]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:_()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[eF,"auto",gF,AF]}],basis:[{basis:[YT,"full","auto",o,...v()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[JT,YT,"auto","initial","none",AF]}],grow:[{grow:["",JT,gF,AF]}],shrink:[{shrink:["",JT,gF,AF]}],order:[{order:[eF,"first","last","none",gF,AF]}],"grid-cols":[{"grid-cols":b()}],"col-start-end":[{col:x()}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":b()}],"row-start-end":[{row:x()}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":C()}],"auto-rows":[{"auto-rows":C()}],gap:[{gap:v()}],"gap-x":[{"gap-x":v()}],"gap-y":[{"gap-y":v()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:v()}],px:[{px:v()}],py:[{py:v()}],ps:[{ps:v()}],pe:[{pe:v()}],pt:[{pt:v()}],pr:[{pr:v()}],pb:[{pb:v()}],pl:[{pl:v()}],m:[{m:S()}],mx:[{mx:S()}],my:[{my:S()}],ms:[{ms:S()}],me:[{me:S()}],mt:[{mt:S()}],mr:[{mr:S()}],mb:[{mb:S()}],ml:[{ml:S()}],"space-x":[{"space-x":v()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":v()}],"space-y-reverse":["space-y-reverse"],size:[{size:E()}],w:[{w:[o,"screen",...E()]}],"min-w":[{"min-w":[o,"screen","none",...E()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...E()]}],h:[{h:["screen","lh",...E()]}],"min-h":[{"min-h":["screen","lh","none",...E()]}],"max-h":[{"max-h":["screen","lh",...E()]}],"font-size":[{text:["base",r,mF,uF]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,gF,cF]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",tF,AF]}],"font-family":[{font:[yF,AF,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,gF,AF]}],"line-clamp":[{"line-clamp":[JT,"none",gF,cF]}],leading:[{leading:[a,...v()]}],"list-image":[{"list-image":["none",gF,AF]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",gF,AF]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[JT,"from-font","auto",gF,uF]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[JT,"auto",gF,AF]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:v()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gF,AF]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gF,AF]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:T()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:F()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},eF,gF,AF],radial:["",gF,AF],conic:[eF,gF,AF]},wF,pF]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:P()}],"gradient-via-pos":[{via:P()}],"gradient-to-pos":[{to:P()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:L()}],"rounded-s":[{"rounded-s":L()}],"rounded-e":[{"rounded-e":L()}],"rounded-t":[{"rounded-t":L()}],"rounded-r":[{"rounded-r":L()}],"rounded-b":[{"rounded-b":L()}],"rounded-l":[{"rounded-l":L()}],"rounded-ss":[{"rounded-ss":L()}],"rounded-se":[{"rounded-se":L()}],"rounded-ee":[{"rounded-ee":L()}],"rounded-es":[{"rounded-es":L()}],"rounded-tl":[{"rounded-tl":L()}],"rounded-tr":[{"rounded-tr":L()}],"rounded-br":[{"rounded-br":L()}],"rounded-bl":[{"rounded-bl":L()}],"border-w":[{border:M()}],"border-w-x":[{"border-x":M()}],"border-w-y":[{"border-y":M()}],"border-w-s":[{"border-s":M()}],"border-w-e":[{"border-e":M()}],"border-w-t":[{"border-t":M()}],"border-w-r":[{"border-r":M()}],"border-w-b":[{"border-b":M()}],"border-w-l":[{"border-l":M()}],"divide-x":[{"divide-x":M()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":M()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[JT,gF,AF]}],"outline-w":[{outline:["",JT,mF,uF]}],"outline-color":[{outline:I()}],shadow:[{shadow:["","none",A,bF,fF]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":["none",u,bF,fF]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[JT,uF]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":M()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":["none",c,bF,fF]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[JT,gF,AF]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[JT]}],"mask-image-linear-from-pos":[{"mask-linear-from":k()}],"mask-image-linear-to-pos":[{"mask-linear-to":k()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":k()}],"mask-image-t-to-pos":[{"mask-t-to":k()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":k()}],"mask-image-r-to-pos":[{"mask-r-to":k()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":k()}],"mask-image-b-to-pos":[{"mask-b-to":k()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":k()}],"mask-image-l-to-pos":[{"mask-l-to":k()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":k()}],"mask-image-x-to-pos":[{"mask-x-to":k()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":k()}],"mask-image-y-to-pos":[{"mask-y-to":k()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[gF,AF]}],"mask-image-radial-from-pos":[{"mask-radial-from":k()}],"mask-image-radial-to-pos":[{"mask-radial-to":k()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[JT]}],"mask-image-conic-from-pos":[{"mask-conic-from":k()}],"mask-image-conic-to-pos":[{"mask-conic-to":k()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:T()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:F()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",gF,AF]}],filter:[{filter:["","none",gF,AF]}],blur:[{blur:U()}],brightness:[{brightness:[JT,gF,AF]}],contrast:[{contrast:[JT,gF,AF]}],"drop-shadow":[{"drop-shadow":["","none",d,bF,fF]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:["",JT,gF,AF]}],"hue-rotate":[{"hue-rotate":[JT,gF,AF]}],invert:[{invert:["",JT,gF,AF]}],saturate:[{saturate:[JT,gF,AF]}],sepia:[{sepia:["",JT,gF,AF]}],"backdrop-filter":[{"backdrop-filter":["","none",gF,AF]}],"backdrop-blur":[{"backdrop-blur":U()}],"backdrop-brightness":[{"backdrop-brightness":[JT,gF,AF]}],"backdrop-contrast":[{"backdrop-contrast":[JT,gF,AF]}],"backdrop-grayscale":[{"backdrop-grayscale":["",JT,gF,AF]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[JT,gF,AF]}],"backdrop-invert":[{"backdrop-invert":["",JT,gF,AF]}],"backdrop-opacity":[{"backdrop-opacity":[JT,gF,AF]}],"backdrop-saturate":[{"backdrop-saturate":[JT,gF,AF]}],"backdrop-sepia":[{"backdrop-sepia":["",JT,gF,AF]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":v()}],"border-spacing-x":[{"border-spacing-x":v()}],"border-spacing-y":[{"border-spacing-y":v()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",gF,AF]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[JT,"initial",gF,AF]}],ease:[{ease:["linear","initial",m,gF,AF]}],delay:[{delay:[JT,gF,AF]}],animate:[{animate:["none",y,gF,AF]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,gF,AF]}],"perspective-origin":[{"perspective-origin":_()}],rotate:[{rotate:R()}],"rotate-x":[{"rotate-x":R()}],"rotate-y":[{"rotate-y":R()}],"rotate-z":[{"rotate-z":R()}],scale:[{scale:D()}],"scale-x":[{"scale-x":D()}],"scale-y":[{"scale-y":D()}],"scale-z":[{"scale-z":D()}],"scale-3d":["scale-3d"],skew:[{skew:N()}],"skew-x":[{"skew-x":N()}],"skew-y":[{"skew-y":N()}],transform:[{transform:[gF,AF,"","none","gpu","cpu"]}],"transform-origin":[{origin:_()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:I()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gF,AF]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":v()}],"scroll-mx":[{"scroll-mx":v()}],"scroll-my":[{"scroll-my":v()}],"scroll-ms":[{"scroll-ms":v()}],"scroll-me":[{"scroll-me":v()}],"scroll-mt":[{"scroll-mt":v()}],"scroll-mr":[{"scroll-mr":v()}],"scroll-mb":[{"scroll-mb":v()}],"scroll-ml":[{"scroll-ml":v()}],"scroll-p":[{"scroll-p":v()}],"scroll-px":[{"scroll-px":v()}],"scroll-py":[{"scroll-py":v()}],"scroll-ps":[{"scroll-ps":v()}],"scroll-pe":[{"scroll-pe":v()}],"scroll-pt":[{"scroll-pt":v()}],"scroll-pr":[{"scroll-pr":v()}],"scroll-pb":[{"scroll-pb":v()}],"scroll-pl":[{"scroll-pl":v()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gF,AF]}],fill:[{fill:["none",...I()]}],"stroke-w":[{stroke:[JT,mF,uF,cF]}],stroke:[{stroke:["none",...I()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}})),MF=0;Array.isArray;function kF(e,t,r,i,n,a){t||(t={});var s,o,l=t;if("ref"in l)for(o in l={},t)"ref"==o?s=t[o]:l[o]=t[o];var h={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--MF,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(s=e.defaultProps))for(o in s)void 0===l[o]&&(l[o]=s[o]);return oA.vnode&&oA.vnode(h),h}var UF=function({options:e,...t}){let{map:r}=hT(),[i,n]=Eu(),a=Mu((()=>{if(!i)return null;let t=document.createElement("div");return t.className="flex flex-wrap-reverse justify-end",new Gy({element:t,target:i,...e})}),[e,i]);return Tu((()=>{if(r&&a)return r.addControl(a),()=>{r?.removeControl(a)}}),[r,a]),kF("div",{ref:e=>{n(e)},...t,children:kF("style",{children:"a  {\n  white-space: pre;\n}"})})},RF="units",DF=[1,2,5],NF=25.4/.28,OF=class extends ly{constructor(e){e=e||{};let t=document.createElement("div");t.style.pointerEvents="none",super({element:t,render:e.render,target:e.target}),this.on,this.once,this.un;let r=void 0!==e.className?e.className:e.bar?"ol-scale-bar":"ol-scale-line";this.innerElement_=document.createElement("div"),this.innerElement_.className=r+"-inner",this.element.className=r+" "+rv,this.element.appendChild(this.innerElement_),this.viewState_=null,this.minWidth_=void 0!==e.minWidth?e.minWidth:64,this.maxWidth_=e.maxWidth,this.renderedVisible_=!1,this.renderedWidth_=void 0,this.renderedHTML_="",this.addChangeListener(RF,this.handleUnitsChanged_),this.setUnits(e.units||"metric"),this.scaleBar_=e.bar||!1,this.scaleBarSteps_=e.steps||4,this.scaleBarText_=e.text||!1,this.dpi_=e.dpi||void 0}getUnits(){return this.get(RF)}handleUnitsChanged_(){this.updateElement_()}setUnits(e){this.set(RF,e)}setDpi(e){this.dpi_=e}updateElement_(){let e=this.viewState_;if(!e)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));let t=e.center,r=e.projection,i=this.getUnits(),n="degrees"==i?"degrees":"m",a=Nf(r,e.resolution,t,n),s=this.minWidth_*(this.dpi_||NF)/NF,o=void 0!==this.maxWidth_?this.maxWidth_*(this.dpi_||NF)/NF:void 0,l=s*a,h="";if("degrees"==i){let e=Rp.degrees;l*=e,l<e/60?(h="″",a*=3600):l<e?(h="′",a*=60):h="°"}else if("imperial"==i)l<.9144?(h="in",a/=.0254):l<1609.344?(h="ft",a/=.3048):(h="mi",a/=1609.344);else if("nautical"==i)a/=1852,h="NM";else if("metric"==i)l<1e-6?(h="nm",a*=1e9):l<.001?(h="μm",a*=1e6):l<1?(h="mm",a*=1e3):l<1e3?h="m":(h="km",a/=1e3);else{if("us"!=i)throw new Error("Invalid units");l<.9144?(h="in",a*=39.37):l<1609.344?(h="ft",a/=.30480061):(h="mi",a/=1609.3472)}let A,u,c,d,p,f=3*Math.floor(Math.log(s*a)/Math.log(10)),g=0;for(;;){c=Math.floor(f/3);let e=Math.pow(10,c);if(A=DF[(f%3+3)%3]*e,u=Math.round(A/a),isNaN(u))return this.element.style.display="none",void(this.renderedVisible_=!1);if(void 0!==o&&u>=o){A=g,u=d,c=p;break}if(u>=s)break;g=A,d=u,p=c,++f}let m=this.scaleBar_?this.createScaleBar(u,A,h):A.toFixed(c<0?-c:0)+" "+h;this.renderedHTML_!=m&&(this.innerElement_.innerHTML=m,this.renderedHTML_=m),this.renderedWidth_!=u&&(this.innerElement_.style.width=u+"px",this.renderedWidth_=u),this.renderedVisible_||(this.element.style.display="",this.renderedVisible_=!0)}createScaleBar(e,t,r){let i=this.getScaleForResolution(),n=i<1?Math.round(1/i).toLocaleString()+" : 1":"1 : "+Math.round(i).toLocaleString(),a=this.scaleBarSteps_,s=e/a,o=[this.createMarker("absolute")];for(let i=0;i<a;++i){let n=i%2==0?"ol-scale-singlebar-odd":"ol-scale-singlebar-even";o.push(`<div><div class="ol-scale-singlebar ${n}" style="width: ${s}px;"></div>`+this.createMarker("relative")+(i%2==0||2===a?this.createStepText(i,e,!1,t,r):"")+"</div>")}return o.push(this.createStepText(a,e,!0,t,r)),(this.scaleBarText_?`<div class="ol-scale-text" style="width: ${e}px;">`+n+"</div>":"")+o.join("")}createMarker(e){return`<div class="ol-scale-step-marker" style="position: ${e}; top: ${"absolute"===e?3:-10}px;"></div>`}createStepText(e,t,r,i,n){let a=(0===e?0:Math.round(i/this.scaleBarSteps_*e*100)/100)+(0===e?"":" "+n);return`<div class="ol-scale-step-text" style="margin-left: ${0===e?-3:t/this.scaleBarSteps_*-1}px;text-align: ${0===e?"left":"center"};min-width: ${0===e?0:t/this.scaleBarSteps_*2}px;left: ${r?t+"px":"unset"};">`+a+"</div>"}getScaleForResolution(){return Nf(this.viewState_.projection,this.viewState_.resolution,this.viewState_.center,"m")*(1e3/25.4)*(this.dpi_||NF)}render(e){let t=e.frameState;this.viewState_=t?t.viewState:null,this.updateElement_()}},QF=class extends ly{dragPan;icon;onPointerDragRef;text;constructor(e={}){let t=document.createElement("div");t.className=void 0!==e.className?e.className:"ol-drag-pan-warning",t.style.display="none",t.style.pointerEvents="auto",super({element:t,render:e.render,target:e.target}),this.icon=document.createElement("div"),this.icon.className=`${t.className}-icon`,this.icon.innerHTML='\n      <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48">\n        <path fill="none" stroke="currentColor" stroke-width="2" d="M22.999,25 L22.997,13.002 C22.997,11.896 23.893,11 24.999,11 C26.105,11 27.001,11.896 27.001,13.002 L26.999,26.002 M31,25.003 C31,23.897 31.896,23.001 33.002,23.001 C34.11,23.001 35.006,23.897 35.006,25.003 C35.006,25.003 35,26.125 35,32.001 C35,37.875 33.2,41.001 33.2,41.001 L19,41.001 C19,41.001 12.21,29.483 11.586,28.419 C10.962,27.355 10.804,26.369 11.586,25.587 C12.37,24.805 13.636,24.805 14.418,25.587 L18.998,30.169 L19,30.169 L19,25.001 L18.996,15.003 C18.996,13.897 19.894,13.001 21,13.001 C22.106,13.001 23.002,13.897 23.002,15.003 L23,26.015 M26.9942,22.997 C26.9942,21.891 27.8902,20.995 28.9962,20.995 C30.1042,20.995 31.0002,21.891 31.0002,22.997 L31.0002,26.001 M30,16.3046 C30.632,15.3606 31,14.2246 31,13.0006 C31,9.6846 28.314,7.0006 25,7.0006 C23.208,7.0006 21.616,7.8026 20.518,9.0486 C17.432,9.2986 15,11.8506 15,15.0006 C15,16.2166 15.368,17.3426 15.988,18.2866"/>\n      </svg>\n    ',this.element.appendChild(this.icon),this.text=document.createElement("p"),this.text.className=`${t.className}-text`,this.text.innerHTML="Benutzen Sie 2 Finger um die Karte zu bedienen.",this.element.appendChild(this.text),this.dragPan=void 0,this.onPointerDragRef=void 0,this.onPointerDrag=this.onPointerDrag.bind(this),this.onTouchEnd=this.onTouchEnd.bind(this)}onPointerDrag(e){return 1!==e.activePointers?.length||(this.element.style.display="flex",document.addEventListener("touchend",this.onTouchEnd,{once:!0}),!1)}onTouchEnd(){mp(this.onPointerDragRef),this.element.style.display="none"}setMap(e){if(super.setMap(e),document.removeEventListener("touchend",this.onTouchEnd),mp(this.onPointerDragRef),e){if(e.getViewport().style.touchAction="pan-x pan-y",this.dragPan=e.getInteractions().getArray().find((e=>e instanceof WB)),!this.dragPan)return void console.error("Impossible to find the DragPan interaction, DragPanWarning will not work as expected.");this.listenerKeys.push(e.on("pointerdown",(t=>(document.removeEventListener("touchend",this.onTouchEnd),"touch"===t.originalEvent.pointerType&&this.dragPan?.condition_(t)?(this.onPointerDragRef=e.on("pointerdrag",this.onPointerDrag),!0):(this.element.style.display="none",!0))))),this.element.addEventListener("click",this.onTouchEnd)}}};var zF=function(){let{isEmbed:e,map:t}=hT(),[r,i]=Eu(null);return Tu((()=>{let i=null;if(t&&r&&e)return t.getInteractions().forEach((e=>{e instanceof uC&&e.setActive(!1)})),i=new QF({target:r}),t.addControl(i),()=>{i&&t.removeControl(i),t.getInteractions().forEach((e=>{e instanceof uC&&e.setActive(!0)}))}}),[t,r,e]),kF("div",{ref:e=>i(e)})},HF={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},jF=Lc.createContext&&Lc.createContext(HF),VF=["attr","size","title"];function GF(e,t){if(null==e)return{};var r,i,n=function(e,t){if(null==e)return{};var r={};for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){if(t.indexOf(i)>=0)continue;r[i]=e[i]}return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)r=a[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function KF(){return KF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},KF.apply(this,arguments)}function qF(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function ZF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qF(Object(r),!0).forEach((function(t){WF(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qF(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function WF(e,t,r){return t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $F(e){return e&&e.map(((e,t)=>Lc.createElement(e.tag,ZF({key:t},e.attr),$F(e.child))))}function XF(e){return t=>Lc.createElement(YF,KF({attr:ZF({},e.attr)},t),$F(e.child))}function YF(e){var t=t=>{var r,{attr:i,size:n,title:a}=e,s=GF(e,VF),o=n||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),Lc.createElement("svg",KF({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,i,s,{className:r,style:ZF(ZF({color:e.color||t.color},t.style),e.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),a&&Lc.createElement("title",null,a),e.children)};return void 0!==jF?Lc.createElement(jF.Consumer,null,(e=>t(e))):t(HF)}function JF(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"},child:[]}]})(e)}function eP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"},child:[]}]})(e)}function tP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"},child:[]}]})(e)}function rP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"},child:[]}]})(e)}function iP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 13H5v-2h14v2z"},child:[]}]})(e)}function nP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8 8-8z"},child:[]}]})(e)}function aP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"},child:[]}]})(e)}function sP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"},child:[]}]})(e)}function oP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"},child:[]}]})(e)}function lP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"},child:[]}]})(e)}function hP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18 15v3H6v-3H4v3c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-3h-2zm-1-4-1.41-1.41L13 12.17V4h-2v8.17L8.41 9.59 7 11l5 5 5-5z"},child:[]}]})(e)}function AP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z"},child:[]}]})(e)}function uP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"m11.99 18.54-7.37-5.73L3 14.07l9 7 9-7-1.63-1.27zM12 16l7.36-5.73L21 9l-9-7-9 7 1.63 1.27L12 16zm0-11.47L17.74 9 12 13.47 6.26 9 12 4.53z"},child:[]}]})(e)}function cP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4zm8.94 3A8.994 8.994 0 0 0 13 3.06V1h-2v2.06A8.994 8.994 0 0 0 3.06 11H1v2h2.06A8.994 8.994 0 0 0 11 20.94V23h2v-2.06A8.994 8.994 0 0 0 20.94 13H23v-2h-2.06zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7z"},child:[]}]})(e)}function dP(e){return XF({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M18 16.08c-.76 0-1.44.3-1.96.77L8.91 12.7c.05-.23.09-.46.09-.7s-.04-.47-.09-.7l7.05-4.11c.54.5 1.25.81 2.04.81 1.66 0 3-1.34 3-3s-1.34-3-3-3-3 1.34-3 3c0 .24.04.47.09.7L8.04 9.81C7.5 9.31 6.79 9 6 9c-1.66 0-3 1.34-3 3s1.34 3 3 3c.79 0 1.5-.31 2.04-.81l7.12 4.16c-.05.21-.08.43-.08.65 0 1.61 1.31 2.92 2.92 2.92s2.92-1.31 2.92-2.92c0-1.61-1.31-2.92-2.92-2.92zM18 4c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zM6 13c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1zm12 7.02c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1z"},child:[]}]})(e)}var pP=function(e){return kF(hP,{size:24,...e})},fP={primary:{classes:"",selectedClasses:""},secondary:{classes:"",selectedClasses:""}};var gP=ec((function({children:e,className:t,href:r,selected:i=!1,theme:n="secondary",...a}){let s=Mu((()=>LF("flex size-9 items-center justify-center rounded-full bg-white p-1.5 shadow-lg hover:not-disabled:cursor-pointer",fP[n].classes,i?fP[n].selectedClasses:"",t)),[t,i,n]);return r?kF("a",{className:s,href:r,...a,children:e}):kF("button",{className:s,...a,children:e})})),mP=eu({t:(e,t)=>`${e} ${JSON.stringify(t)}`}),yP=()=>{let e=Uu(mP);if(!e)throw new Error("useI18n must be used within a ContextProvider");return e};var _P=ec((function({...e}){let{isExportMenuOpen:t,setIsExportMenuOpen:r}=hT(),{t:i}=yP(),n=ku((()=>{r(!t)}),[t,r]);return kF(gP,{title:i("print_menu_title"),...e,onClick:n,selected:t,children:kF(pP,{})})}));var vP=function(e){return kF(cP,{size:24,...e})};var wP=ec((function({...e}){let t=hT(),{isTracking:r,map:i,setIsTracking:n}=t,{t:a}=yP(),s=Mu((()=>new h_),[]);return Tu((()=>{let e=[];if(i&&s)return e=[s.once("change:position",(e=>{let t=e.target.getPosition();e.target.getPosition()&&(i.getView().setZoom(16),i.getView().setCenter(zf(t,"EPSG:3857")))})),s.on("change:position",(e=>{let t=e.target.getPosition();e.target.getPosition()&&i.getView().setCenter(zf(t,"EPSG:3857"))}))],()=>{mp(e)}}),[i,s]),Tu((()=>{s.setTracking(r)}),[s,r]),kF(gP,{onClick:()=>{n(!r)},title:a(r?"geolocation_button_title_off":"geolocation_button_title_on"),...e,children:kF(vP,{className:r?"animate-pulse":""})})}));var bP=function(e){return kF(uP,{size:24,...e})};var xP=ec((function({...e}){let{isLayerTreeOpen:t,setIsLayerTreeOpen:r}=hT(),{t:i}=yP(),n=ku((()=>{r(!t)}),[t,r]);return kF(gP,{title:i("layertree_menu_title"),...e,onClick:n,selected:t,children:kF(bP,{})})}));var BP=ec((function({children:e,...t}){let r=Pu(),{center:i,extent:n,map:a,maxextent:s,maxzoom:o,minzoom:l,setMap:h,zoom:A}=hT(),u=Mu((()=>{if(!s)return;let e=s.split(",").map((e=>parseFloat(e)));return new By({constrainOnlyCenter:!0,extent:e})}),[s]);return Tu((()=>{if(!a||!u)return;let e=a.on("change:view",(e=>{let t=e.oldValue;t&&(u.setMinZoom(t.getMinZoom()),u.setMaxZoom(t.getMaxZoom()),u.setCenter(t.getCenter()),u.setZoom(t.getZoom()))}));return a.setView(u),()=>{mp(e)}}),[a,u]),Tu((()=>{let e;return r.current&&(e=new bC({controls:[],target:r.current}),h(e)),()=>{e?.setTarget(),h()}}),[h]),Tu((()=>{if(!a||!n)return;let e=n.split(",").map((e=>parseFloat(e)));e&&a.getView().fit(e)}),[a,n]),Tu((()=>{if(!a||!i)return;let[e,t]=i.split(",").map((e=>parseFloat(e)));e&&t&&a.getView().setCenter([e,t])}),[a,i]),Tu((()=>{if(!a)return;let e=parseFloat(A);e&&a.getView().setZoom(e)}),[a,A]),Tu((()=>{if(!a)return;let e=parseFloat(o);e&&a.getView().setMaxZoom(e)}),[a,o]),Tu((()=>{if(!a)return;let e=parseFloat(l);e&&a.getView().setMinZoom(e)}),[a,l]),kF(PA,{children:[kF("style",{children:':root,\n:host {\n  --ol-background-color: white;\n  --ol-accent-background-color: #F5F5F5;\n  --ol-subtle-background-color: rgba(128, 128, 128, 0.25);\n  --ol-partial-background-color: rgba(255, 255, 255, 0.75);\n  --ol-foreground-color: #333333;\n  --ol-subtle-foreground-color: #666666;\n  --ol-brand-color: #00AAFF;\n}\n\n.ol-box {\n  box-sizing: border-box;\n  border-radius: 2px;\n  border: 1.5px solid var(--ol-background-color);\n  background-color: var(--ol-partial-background-color);\n}\n\n.ol-mouse-position {\n  top: 8px;\n  right: 8px;\n  position: absolute;\n}\n\n.ol-scale-line {\n  background: var(--ol-partial-background-color);\n  border-radius: 4px;\n  bottom: 8px;\n  left: 8px;\n  padding: 2px;\n  position: absolute;\n}\n\n.ol-scale-line-inner {\n  border: 1px solid var(--ol-subtle-foreground-color);\n  border-top: none;\n  color: var(--ol-foreground-color);\n  font-size: 10px;\n  text-align: center;\n  margin: 1px;\n  will-change: contents, width;\n  transition: all 0.25s;\n}\n\n.ol-scale-bar {\n  position: absolute;\n  bottom: 8px;\n  left: 8px;\n}\n\n.ol-scale-bar-inner {\n  display: flex;\n}\n\n.ol-scale-step-marker {\n  width: 1px;\n  height: 15px;\n  background-color: var(--ol-foreground-color);\n  float: right;\n  z-index: 10;\n}\n\n.ol-scale-step-text {\n  position: absolute;\n  bottom: -5px;\n  font-size: 10px;\n  z-index: 11;\n  color: var(--ol-foreground-color);\n  text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-text {\n  position: absolute;\n  font-size: 12px;\n  text-align: center;\n  bottom: 25px;\n  color: var(--ol-foreground-color);\n  text-shadow: -1.5px 0 var(--ol-partial-background-color), 0 1.5px var(--ol-partial-background-color), 1.5px 0 var(--ol-partial-background-color), 0 -1.5px var(--ol-partial-background-color);\n}\n\n.ol-scale-singlebar {\n  position: relative;\n  height: 10px;\n  z-index: 9;\n  box-sizing: border-box;\n  border: 1px solid var(--ol-foreground-color);\n}\n\n.ol-scale-singlebar-even {\n  background-color: var(--ol-subtle-foreground-color);\n}\n\n.ol-scale-singlebar-odd {\n  background-color: var(--ol-background-color);\n}\n\n.ol-unsupported {\n  display: none;\n}\n\n.ol-viewport,\n.ol-unselectable {\n  -webkit-touch-callout: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  user-select: none;\n  -webkit-tap-highlight-color: transparent;\n}\n\n.ol-viewport canvas {\n  all: unset;\n  overflow: hidden;\n}\n\n.ol-viewport {\n  touch-action: pan-x pan-y;\n}\n\n.ol-selectable {\n  -webkit-touch-callout: default;\n  -webkit-user-select: text;\n  -moz-user-select: text;\n  user-select: text;\n}\n\n.ol-grabbing {\n  cursor: -webkit-grabbing;\n  cursor: -moz-grabbing;\n  cursor: grabbing;\n}\n\n.ol-grab {\n  cursor: move;\n  cursor: -webkit-grab;\n  cursor: -moz-grab;\n  cursor: grab;\n}\n\n.ol-control {\n  position: absolute;\n  background-color: var(--ol-subtle-background-color);\n  border-radius: 4px;\n}\n\n.ol-zoom {\n  top: .5em;\n  left: .5em;\n}\n\n.ol-rotate {\n  top: .5em;\n  right: .5em;\n  transition: opacity .25s linear, visibility 0s linear;\n}\n\n.ol-rotate.ol-hidden {\n  opacity: 0;\n  visibility: hidden;\n  transition: opacity .25s linear, visibility 0s linear .25s;\n}\n\n.ol-zoom-extent {\n  top: 4.643em;\n  left: .5em;\n}\n\n.ol-full-screen {\n  right: .5em;\n  top: .5em;\n}\n\n.ol-control button {\n  display: block;\n  margin: 1px;\n  padding: 0;\n  color: var(--ol-subtle-foreground-color);\n  font-weight: bold;\n  text-decoration: none;\n  font-size: inherit;\n  text-align: center;\n  height: 1.375em;\n  width: 1.375em;\n  line-height: .4em;\n  background-color: var(--ol-background-color);\n  border: none;\n  border-radius: 2px;\n}\n\n.ol-control button::-moz-focus-inner {\n  border: none;\n  padding: 0;\n}\n\n.ol-zoom-extent button {\n  line-height: 1.4em;\n}\n\n.ol-compass {\n  display: block;\n  font-weight: normal;\n  will-change: transform;\n}\n\n.ol-touch .ol-control button {\n  font-size: 1.5em;\n}\n\n.ol-touch .ol-zoom-extent {\n  top: 5.5em;\n}\n\n.ol-control button:hover,\n.ol-control button:focus {\n  text-decoration: none;\n  outline: 1px solid var(--ol-subtle-foreground-color);\n  color: var(--ol-foreground-color);\n}\n\n.ol-zoom .ol-zoom-in {\n  border-radius: 2px 2px 0 0;\n}\n\n.ol-zoom .ol-zoom-out {\n  border-radius: 0 0 2px 2px;\n}\n\n.ol-attribution {\n  text-align: right;\n  bottom: .5em;\n  right: .5em;\n  max-width: calc(100% - 1.3em);\n  display: flex;\n  flex-flow: row-reverse;\n  align-items: center;\n}\n\n.ol-attribution a {\n  color: var(--ol-subtle-foreground-color);\n  text-decoration: none;\n}\n\n.ol-attribution ul {\n  margin: 0;\n  padding: 1px .5em;\n  color: var(--ol-foreground-color);\n  text-shadow: 0 0 2px var(--ol-background-color);\n  font-size: 12px;\n}\n\n.ol-attribution li {\n  display: inline;\n  list-style: none;\n}\n\n.ol-attribution li:not(:last-child):after {\n  content: " ";\n}\n\n.ol-attribution img {\n  max-height: 2em;\n  max-width: inherit;\n  vertical-align: middle;\n}\n\n.ol-attribution button {\n  flex-shrink: 0;\n}\n\n.ol-attribution.ol-collapsed ul {\n  display: none;\n}\n\n.ol-attribution:not(.ol-collapsed) {\n  background: var(--ol-partial-background-color);\n}\n\n.ol-attribution.ol-uncollapsible {\n  bottom: 0;\n  right: 0;\n  border-radius: 4px 0 0;\n}\n\n.ol-attribution.ol-uncollapsible img {\n  margin-top: -.2em;\n  max-height: 1.6em;\n}\n\n.ol-attribution.ol-uncollapsible button {\n  display: none;\n}\n\n.ol-zoomslider {\n  top: 4.5em;\n  left: .5em;\n  height: 200px;\n}\n\n.ol-zoomslider button {\n  position: relative;\n  height: 10px;\n}\n\n.ol-touch .ol-zoomslider {\n  top: 5.5em;\n}\n\n.ol-overviewmap {\n  left: 0.5em;\n  bottom: 0.5em;\n}\n\n.ol-overviewmap.ol-uncollapsible {\n  bottom: 0;\n  left: 0;\n  border-radius: 0 4px 0 0;\n}\n\n.ol-overviewmap .ol-overviewmap-map,\n.ol-overviewmap button {\n  display: block;\n}\n\n.ol-overviewmap .ol-overviewmap-map {\n  border: 1px solid var(--ol-subtle-foreground-color);\n  height: 150px;\n  width: 150px;\n}\n\n.ol-overviewmap:not(.ol-collapsed) button {\n  bottom: 0;\n  left: 0;\n  position: absolute;\n}\n\n.ol-overviewmap.ol-collapsed .ol-overviewmap-map,\n.ol-overviewmap.ol-uncollapsible button {\n  display: none;\n}\n\n.ol-overviewmap:not(.ol-collapsed) {\n  background: var(--ol-subtle-background-color);\n}\n\n.ol-overviewmap-box {\n  border: 1.5px dotted var(--ol-subtle-foreground-color);\n}\n\n.ol-overviewmap .ol-overviewmap-box:hover {\n  cursor: move;\n}\n\n.ol-overviewmap .ol-viewport:hover {\n  cursor: pointer;\n}\n'}),kF("div",{ref:r,...t,children:e})]})}));var CP=function(e){let[t,r]=Eu(),[i,n]=Eu(),{children:a}=e;return Tu((()=>()=>{i&&(i.style.height="",i.style.maxHeight="")}),[i]),kF("div",{ref:e=>{e&&(r(e),n(e.parentElement))},...e,onPointerDown:e=>{t.setPointerCapture(e.pointerId);let r=i.parentElement.getBoundingClientRect(),n=t.getBoundingClientRect(),a=r.top+(e.clientY-n.top);function s(e){i.style.height=`calc(100% - ${e.clientY-a}px)`,i.style.maxHeight="100%"}function o(t){t.target.releasePointerCapture(e.pointerId),document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",o)}document.addEventListener("pointerup",o),document.addEventListener("pointermove",s),document.addEventListener("pointercancel",(e=>{document.removeEventListener("pointermove",s),document.removeEventListener("pointerup",o),e.stopPropagation(),e.preventDefault()}))},children:a})};var SP=function({children:e,className:t,ScrollableHandlerProps:r={}}){let i=!!e;return Array.isArray(e)&&(i=e?.length&&(e||[]).find((e=>!!e))),i?kF("div",{className:(LF("pointer-events-auto relative z-50 flex flex-col overflow-hidden bg-white transition-[min-height,max-height] @lg:transition-[width]"),t),children:i&&kF(PA,{children:[kF(CP,{className:"absolute inset-0 flex h-[65px] touch-none justify-center @lg/main:hidden",style:{width:"100%"},...r,children:kF("div",{className:"m-2 mr-[-60px] bg-gray-300",style:{borderRadius:2,height:4,width:32}})}),e]})}):null},EP={primary:{classes:"",selectedClasses:""},secondary:{classes:"",selectedClasses:""}};var IP=ec((function({children:e,className:t,href:r,selected:i=!1,theme:n="secondary",...a}){let s=Mu((()=>LF("flex gap-2 items-center px-4 py-2 rounded-2xl border hover:border-black hover:not-disabled:cursor-pointer",EP[n].classes,i?EP[n].selectedClasses:"",t)),[t,i,n]);return r?kF("a",{className:s,href:r,...a,children:e}):kF("button",{className:s,...a,children:e})}));var TP=ec((function({className:e,...t}){let r=t.checkedIconUrl||'data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?>%0A<svg width="24px" height="24px" strokeviewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">%0A    <title>iconfont/ok</title>%0A    <g id="iconfont/ok" stroke="%237C7C7C" fill="%237C7C7C" stroke-width="1">%0A        <path d="M8.99793431,17.9985348 L8.96211481,17.9959585 C8.73926265,17.9759185 8.52175215,17.8813416 8.3500159,17.71195 L2.79624371,12.2104415 C2.40387772,11.8217676 2.40088466,11.1886097 2.78955853,10.7962437 C3.17823239,10.4038777 3.8113903,10.4008847 4.20375629,10.7895585 L9.04399993,15.5834862 L19.2409309,5.24625614 C19.6287619,4.85305703 20.2619119,4.84870533 20.6551111,5.23653636 C21.0483102,5.62436739 21.0526619,6.25751741 20.6648308,6.65071652 L9.76419606,17.7022302 C9.70090516,17.7663971 9.63108102,17.8202084 9.55683265,17.8636496 C9.5174093,17.8867215 9.47662371,17.9069178 9.43490359,17.9241713 C9.38857789,17.9433279 9.34109351,17.9588594 9.29289059,17.9707599 C9.24768974,17.9819175 9.20193892,17.9898714 9.15591761,17.9946414 C9.10378262,18.000016 9.05184796,18.0013348 9.00007711,17.998649 Z"></path>%0A    </g>%0A</svg>';return kF("input",{checked:t.checked,className:LF("border-grey text-grey disabled:border-lightgrey box-border size-[20px] flex-none cursor-pointer appearance-none rounded border-2 bg-white bg-contain bg-center disabled:cursor-default",e),style:{backgroundImage:t.checked&&!t.disabled?`url('${r}')`:""},...t,type:"checkbox"})}));var FP=function(e){return kF(nP,{size:24,...e})};var PP=function({children:e,className:t,onChange:r}){return kF("div",{className:"text-grey relative flex items-center",children:[kF("select",{className:`h-[32px] cursor-pointer appearance-none rounded-[12px] border border-current bg-white px-[13px] text-[16px] leading-[22px] disabled:cursor-default @sm/main:h-[36px] @md/main:h-[40px] ${t}`,onChange:r,children:e}),kF(FP,{className:"pointer-events-none absolute right-[8px]"})]})};function LP(e){return LP="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},LP(e)}var MP=Uint8Array,kP=Uint16Array,UP=Int32Array,RP=new MP([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),DP=new MP([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),NP=new MP([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),OP=function(e,t){for(var r=new kP(31),i=0;i<31;++i)r[i]=t+=1<<e[i-1];var n=new UP(r[30]);for(i=1;i<30;++i)for(var a=r[i];a<r[i+1];++a)n[a]=a-r[i]<<5|i;return{b:r,r:n}},QP=OP(RP,2),zP=QP.b,HP=QP.r;zP[28]=258,HP[258]=28;var jP=OP(DP,0),VP=(jP.b,jP.r),GP=new kP(32768);for($P=0;$P<32768;++$P)KP=(61680&(KP=(52428&(KP=(43690&$P)>>1|(21845&$P)<<1))>>2|(13107&KP)<<2))>>4|(3855&KP)<<4,GP[$P]=((65280&KP)>>8|(255&KP)<<8)>>1;var KP,qP=function(e,t,r){for(var i=e.length,n=0,a=new kP(t);n<i;++n)e[n]&&++a[e[n]-1];var s,o=new kP(t);for(n=1;n<t;++n)o[n]=o[n-1]+a[n-1]<<1;if(r){s=new kP(1<<t);var l=15-t;for(n=0;n<i;++n)if(e[n])for(var h=n<<4|e[n],A=t-e[n],u=o[e[n]-1]++<<A,c=u|(1<<A)-1;u<=c;++u)s[GP[u]>>l]=h}else for(s=new kP(i),n=0;n<i;++n)e[n]&&(s[n]=GP[o[e[n]-1]++]>>15-e[n]);return s},ZP=new MP(288);for($P=0;$P<144;++$P)ZP[$P]=8;for($P=144;$P<256;++$P)ZP[$P]=9;for($P=256;$P<280;++$P)ZP[$P]=7;for($P=280;$P<288;++$P)ZP[$P]=8;var WP=new MP(32);for($P=0;$P<32;++$P)WP[$P]=5;var $P,XP=qP(ZP,9,0),YP=qP(WP,5,0),JP=function(e){return(e+7)/8|0},eL=function(e,t,r){r<<=7&t;var i=t/8|0;e[i]|=r,e[i+1]|=r>>8},tL=function(e,t,r){r<<=7&t;var i=t/8|0;e[i]|=r,e[i+1]|=r>>8,e[i+2]|=r>>16},rL=function(e,t){for(var r=[],i=0;i<e.length;++i)e[i]&&r.push({s:i,f:e[i]});var n=r.length,a=r.slice();if(!n)return{t:hL,l:0};if(1==n){var s=new MP(r[0].s+1);return s[r[0].s]=1,{t:s,l:1}}r.sort((function(e,t){return e.f-t.f})),r.push({s:-1,f:25001});var o=r[0],l=r[1],h=0,A=1,u=2;for(r[0]={s:-1,f:o.f+l.f,l:o,r:l};A!=n-1;)o=r[r[h].f<r[u].f?h++:u++],l=r[h!=A&&r[h].f<r[u].f?h++:u++],r[A++]={s:-1,f:o.f+l.f,l:o,r:l};var c=a[0].s;for(i=1;i<n;++i)a[i].s>c&&(c=a[i].s);var d=new kP(c+1),p=iL(r[A-1],d,0);if(p>t){i=0;var f=0,g=p-t,m=1<<g;for(a.sort((function(e,t){return d[t.s]-d[e.s]||e.f-t.f}));i<n;++i){var y=a[i].s;if(!(d[y]>t))break;f+=m-(1<<p-d[y]),d[y]=t}for(f>>=g;f>0;){var _=a[i].s;d[_]<t?f-=1<<t-d[_]++-1:++i}for(;i>=0&&f;--i){var v=a[i].s;d[v]==t&&(--d[v],++f)}p=t}return{t:new MP(d),l:p}},iL=function(e,t,r){return-1==e.s?Math.max(iL(e.l,t,r+1),iL(e.r,t,r+1)):t[e.s]=r},nL=function(e){for(var t=e.length;t&&!e[--t];);for(var r=new kP(++t),i=0,n=e[0],a=1,s=function(e){r[i++]=e},o=1;o<=t;++o)if(e[o]==n&&o!=t)++a;else{if(!n&&a>2){for(;a>138;a-=138)s(32754);a>2&&(s(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(s(n),--a;a>6;a-=6)s(8304);a>2&&(s(a-3<<5|8208),a=0)}for(;a--;)s(n);a=1,n=e[o]}return{c:r.subarray(0,i),n:t}},aL=function(e,t){for(var r=0,i=0;i<t.length;++i)r+=e[i]*t[i];return r},sL=function(e,t,r){var i=r.length,n=JP(t+2);e[n]=255&i,e[n+1]=i>>8,e[n+2]=255^e[n],e[n+3]=255^e[n+1];for(var a=0;a<i;++a)e[n+a+4]=r[a];return 8*(n+4+i)},oL=function(e,t,r,i,n,a,s,o,l,h,A){eL(t,A++,r),++n[256];for(var u=rL(n,15),c=u.t,d=u.l,p=rL(a,15),f=p.t,g=p.l,m=nL(c),y=m.c,_=m.n,v=nL(f),w=v.c,b=v.n,x=new kP(19),B=0;B<y.length;++B)++x[31&y[B]];for(B=0;B<w.length;++B)++x[31&w[B]];for(var C=rL(x,7),S=C.t,E=C.l,I=19;I>4&&!S[NP[I-1]];--I);var T,F,P,L,M=h+5<<3,k=aL(n,ZP)+aL(a,WP)+s,U=aL(n,c)+aL(a,f)+s+14+3*I+aL(x,S)+2*x[16]+3*x[17]+7*x[18];if(l>=0&&M<=k&&M<=U)return sL(t,A,e.subarray(l,l+h));if(eL(t,A,1+(U<k)),A+=2,U<k){T=qP(c,d,0),F=c,P=qP(f,g,0),L=f;var R=qP(S,E,0);eL(t,A,_-257),eL(t,A+5,b-1),eL(t,A+10,I-4),A+=14;for(B=0;B<I;++B)eL(t,A+3*B,S[NP[B]]);A+=3*I;for(var D=[y,w],N=0;N<2;++N){var O=D[N];for(B=0;B<O.length;++B){var Q=31&O[B];eL(t,A,R[Q]),A+=S[Q],Q>15&&(eL(t,A,O[B]>>5&127),A+=O[B]>>12)}}}else T=XP,F=ZP,P=YP,L=WP;for(B=0;B<o;++B){var z=i[B];if(z>255){tL(t,A,T[(Q=z>>18&31)+257]),A+=F[Q+257],Q>7&&(eL(t,A,z>>23&31),A+=RP[Q]);var H=31&z;tL(t,A,P[H]),A+=L[H],H>3&&(tL(t,A,z>>5&8191),A+=DP[H])}else tL(t,A,T[z]),A+=F[z]}return tL(t,A,T[256]),A+F[256]},lL=new UP([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),hL=new MP(0),AL=function(e,t,r,i,n,a){var s=a.z||e.length,o=new MP(i+s+5*(1+Math.ceil(s/7e3))+n),l=o.subarray(i,o.length-n),h=a.l,A=7&(a.r||0);if(t){A&&(l[0]=a.r>>3);for(var u=lL[t-1],c=u>>13,d=8191&u,p=(1<<r)-1,f=a.p||new kP(32768),g=a.h||new kP(p+1),m=Math.ceil(r/3),y=2*m,_=function(t){return(e[t]^e[t+1]<<m^e[t+2]<<y)&p},v=new UP(25e3),w=new kP(288),b=new kP(32),x=0,B=0,C=a.i||0,S=0,E=a.w||0,I=0;C+2<s;++C){var T=_(C),F=32767&C,P=g[T];if(f[F]=P,g[T]=F,E<=C){var L=s-C;if((x>7e3||S>24576)&&(L>423||!h)){A=oL(e,l,0,v,w,b,B,S,I,C-I,A),S=x=B=0,I=C;for(var M=0;M<286;++M)w[M]=0;for(M=0;M<30;++M)b[M]=0}var k=2,U=0,R=d,D=F-P&32767;if(L>2&&T==_(C-D))for(var N=Math.min(c,L)-1,O=Math.min(32767,C),Q=Math.min(258,L);D<=O&&--R&&F!=P;){if(e[C+k]==e[C+k-D]){for(var z=0;z<Q&&e[C+z]==e[C+z-D];++z);if(z>k){if(k=z,U=D,z>N)break;var H=Math.min(D,z-2),j=0;for(M=0;M<H;++M){var V=C-D+M&32767,G=V-f[V]&32767;G>j&&(j=G,P=V)}}}D+=(F=P)-(P=f[F])&32767}if(U){v[S++]=268435456|HP[k]<<18|VP[U];var K=31&HP[k],q=31&VP[U];B+=RP[K]+DP[q],++w[257+K],++b[q],E=C+k,++x}else v[S++]=e[C],++w[e[C]]}}for(C=Math.max(C,E);C<s;++C)v[S++]=e[C],++w[e[C]];A=oL(e,l,h,v,w,b,B,S,I,C-I,A),h||(a.r=7&A|l[A/8|0]<<3,A-=7,a.h=g,a.p=f,a.i=C,a.w=E)}else{for(C=a.w||0;C<s+h;C+=65535){var Z=C+65535;Z>=s&&(l[A/8|0]=h,Z=s),A=sL(l,A+1,e.subarray(C,Z))}a.i=s}return function(e,t,r){return(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length),new MP(e.subarray(t,r))}(o,0,i+JP(A)+n)},uL=function(){var e=1,t=0;return{p:function(r){for(var i=e,n=t,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s<o;++s)n+=i+=r[s];i=(65535&i)+15*(i>>16),n=(65535&n)+15*(n>>16)}e=i,t=n},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},cL=function(e,t,r){for(;r;++t)e[t]=r,r>>>=8};function dL(e,t){t||(t={});var r=uL();r.p(e);var i=function(e,t,r,i,n){if(!n&&(n={l:1},t.dictionary)){var a=t.dictionary.subarray(-32768),s=new MP(a.length+e.length);s.set(a),s.set(e,a.length),e=s,n.w=a.length}return AL(e,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+t.mem,r,i,n)}(e,t,t.dictionary?6:2,4);return function(e,t){var r=t.level,i=0==r?0:r<6?1:9==r?3:2;if(e[0]=120,e[1]=i<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var n=uL();n.p(t.dictionary),cL(e,2,n.d())}}(i,t),cL(i,i.length-4,r.d()),i}var pL=typeof TextDecoder<"u"&&new TextDecoder;try{pL.decode(hL,{stream:!0})}catch{}function fL(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function gL(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,a,s,o=[],l=!0,h=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(i=a.call(r)).done)&&(o.push(i.value),o.length!==t);l=!0);}catch(e){h=!0,n=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(h)throw n}}return o}}(e,t)||function(e,t){if(e){if("string"==typeof e)return fL(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?fL(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function mL(e,t="utf8"){return new TextDecoder(t).decode(e)}var yL=new TextEncoder;var _L=(()=>{let e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])})(),vL={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array},wL=class e{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=8192,r={}){let i=!1;"number"==typeof t?t=new ArrayBuffer(t):(i=!0,this.lastWrittenByte=t.byteLength);let n=r.offset?r.offset>>>0:0,a=t.byteLength-n,s=n;(ArrayBuffer.isView(t)||t instanceof e)&&(t.byteLength!==t.buffer.byteLength&&(s=t.byteOffset+n),t=t.buffer),this.lastWrittenByte=i?a:0,this.buffer=t,this.length=a,this.byteLength=a,this.byteOffset=s,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,s,a),this._mark=0,this._marks=[]}available(e=1){return this.offset+e<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(e=1){return this.offset+=e,this}back(e=1){return this.offset-=e,this}seek(e){return this.offset=e,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let e=this._marks.pop();if(void 0===e)throw new Error("Mark stack empty");return this.seek(e),this}rewind(){return this.offset=0,this}ensureAvailable(e=1){if(!this.available(e)){let t=2*(this.offset+e),r=new Uint8Array(t);r.set(new Uint8Array(this.buffer)),this.buffer=r.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(e=1){return this.readArray(e,"uint8")}readArray(e,t){let r=vL[t].BYTES_PER_ELEMENT*e,i=this.byteOffset+this.offset,n=this.buffer.slice(i,i+r);if(this.littleEndian===_L&&"uint8"!==t&&"int8"!==t){let e=new Uint8Array(this.buffer.slice(i,i+r));e.reverse();let n=new vL[t](e.buffer);return this.offset+=r,n.reverse(),n}let a=new vL[t](n);return this.offset+=r,a}readInt16(){let e=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,e}readUint16(){let e=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,e}readInt32(){let e=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,e}readUint32(){let e=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat32(){let e=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,e}readFloat64(){let e=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,e}readBigInt64(){let e=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,e}readBigUint64(){let e=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,e}readChar(){return String.fromCharCode(this.readInt8())}readChars(e=1){let t="";for(let r=0;r<e;r++)t+=this.readChar();return t}readUtf8(e=1){return mL(this.readBytes(e))}decodeText(e=1,t="utf8"){return mL(this.readBytes(e),t)}writeBoolean(e){return this.writeUint8(e?255:0),this}writeInt8(e){return this.ensureAvailable(1),this._data.setInt8(this.offset++,e),this._updateLastWrittenByte(),this}writeUint8(e){return this.ensureAvailable(1),this._data.setUint8(this.offset++,e),this._updateLastWrittenByte(),this}writeByte(e){return this.writeUint8(e)}writeBytes(e){this.ensureAvailable(e.length);for(let t=0;t<e.length;t++)this._data.setUint8(this.offset++,e[t]);return this._updateLastWrittenByte(),this}writeInt16(e){return this.ensureAvailable(2),this._data.setInt16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(e){return this.ensureAvailable(2),this._data.setUint16(this.offset,e,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(e){return this.ensureAvailable(4),this._data.setInt32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(e){return this.ensureAvailable(4),this._data.setUint32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(e){return this.ensureAvailable(4),this._data.setFloat32(this.offset,e,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(e){return this.ensureAvailable(8),this._data.setFloat64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(e){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(e){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,e,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(e){return this.writeUint8(e.charCodeAt(0))}writeChars(e){for(let t=0;t<e.length;t++)this.writeUint8(e.charCodeAt(t));return this}writeUtf8(e){return this.writeBytes(function(e){return yL.encode(e)}(e))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}};Wr();var bL=[];for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)1&t?t=3988292384^t>>>1:t>>>=1;bL[e]=t}var xL=4294967295;function BL(e,t){return(function(e,t,r){let i=e;for(let e=0;e<r;e++)i=bL[255&(i^t[e])]^i>>>8;return i}(xL,e,t)^xL)>>>0}function CL(e,t,r){let i=e.readUint32(),n=BL(new Uint8Array(e.buffer,e.byteOffset+e.offset-t-4,t),t);if(n!==i)throw new Error(`CRC mismatch for chunk ${r}. Expected ${i}, found ${n}`)}function SL(e,t,r){for(let i=0;i<r;i++)t[i]=e[i]}function EL(e,t,r,i){let n=0;for(;n<i;n++)t[n]=e[n];for(;n<r;n++)t[n]=e[n]+t[n-i]&255}function IL(e,t,r,i){let n=0;if(0===r.length)for(;n<i;n++)t[n]=e[n];else for(;n<i;n++)t[n]=e[n]+r[n]&255}function TL(e,t,r,i,n){let a=0;if(0===r.length){for(;a<n;a++)t[a]=e[a];for(;a<i;a++)t[a]=e[a]+(t[a-n]>>1)&255}else{for(;a<n;a++)t[a]=e[a]+(r[a]>>1)&255;for(;a<i;a++)t[a]=e[a]+(t[a-n]+r[a]>>1)&255}}function FL(e,t,r,i,n){let a=0;if(0===r.length){for(;a<n;a++)t[a]=e[a];for(;a<i;a++)t[a]=e[a]+t[a-n]&255}else{for(;a<n;a++)t[a]=e[a]+r[a]&255;for(;a<i;a++)t[a]=e[a]+PL(t[a-n],r[a],r[a-n])&255}}function PL(e,t,r){let i=e+t-r,n=Math.abs(i-e),a=Math.abs(i-t),s=Math.abs(i-r);return n<=a&&n<=s?e:a<=s?t:r}function LL(e,t,r,i,n,a){switch(e){case 0:SL(t,r,n);break;case 1:EL(t,r,n,a);break;case 2:IL(t,r,i,n);break;case 3:TL(t,r,i,n,a);break;case 4:FL(t,r,i,n,a);break;default:throw new Error(`Unsupported filter: ${e}`)}}var ML=new Uint16Array([255]),kL=255===new Uint8Array(ML.buffer)[0];function UL(e){return(255&e)<<8|e>>8&255}var RL=new Uint16Array([255]),DL=255===new Uint8Array(RL.buffer)[0],NL=new Uint8Array(0);function OL(e){let t,r,{data:i,width:n,height:a,channels:s,depth:o}=e,l=Math.ceil(o/8)*s,h=Math.ceil(o/8*s*n),A=new Uint8Array(a*h),u=NL,c=0;for(let e=0;e<a;e++){switch(t=i.subarray(c+1,c+1+h),r=A.subarray(e*h,(e+1)*h),i[c]){case 0:SL(t,r,h);break;case 1:EL(t,r,h,l);break;case 2:IL(t,r,u,h);break;case 3:TL(t,r,u,h,l);break;case 4:FL(t,r,u,h,l);break;default:throw new Error(`Unsupported filter: ${i[c]}`)}u=r,c+=h+1}if(16===o){let e=new Uint16Array(A.buffer);if(DL)for(let t=0;t<e.length;t++)e[t]=QL(e[t]);return e}return A}function QL(e){return(255&e)<<8|e>>8&255}var zL=Uint8Array.of(137,80,78,71,13,10,26,10);function HL(e){if(!function(e){if(e.length<zL.length)return!1;for(let t=0;t<zL.length;t++)if(e[t]!==zL[t])return!1;return!0}(e.readBytes(zL.length)))throw new Error("wrong PNG signature")}var jL=new TextDecoder("latin1");function VL(e){if(function(e){if(!GL.test(e))throw new Error("invalid latin1 text")}(e),0===e.length||e.length>79)throw new Error("keyword length must be between 1 and 79")}var GL=/^[\u0000-\u00FF]*$/;function KL(e,t,r){let i=qL(t);e[i]=function(e,t){return jL.decode(e.readBytes(t))}(t,r-i.length-1)}function qL(e){for(e.mark();0!==e.readByte(););let t=e.offset;e.reset();let r=jL.decode(e.readBytes(t-e.offset-1));return e.skip(1),VL(r),r}var ZL,WL,$L=-1,XL=0,YL=2,JL=3,eM=4,tM=6,rM=-1,iM=0,nM=-1,aM=0,sM=-1,oM=0,lM=1,hM=0,AM=1,uM=2,cM=0,dM=1,pM=class extends wL{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(e,t={}){super(e);let{checkCrc:r=!1}=t;this._checkCrc=r,this._inflator=new qr,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=rM,this._filterMethod=nM,this._interlaceMethod=sM,this._colorType=$L,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(HL(this);!this._end;){let e=this.readUint32(),t=this.readChars(4);this.decodeChunk(e,t)}return this.decodeImage(),this._png}decodeApng(){for(HL(this);!this._end;){let e=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(e,t)}return this.decodeApngImage(),this._apng}decodeChunk(e,t){let r=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(e);break;case"IDAT":this.decodeIDAT(e);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(e);break;case"iCCP":this.decodeiCCP(e);break;case"tEXt":KL(this._png.text,this,e);break;case"pHYs":this.decodepHYs();break;default:this.skip(e)}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?CL(this,e+4,t):this.skip(4)}decodeApngChunk(e,t){let r=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(e);break;default:this.decodeChunk(e,t),this.offset=r+e}if(this.offset-r!==e)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?CL(this,e+4,t):this.skip(4)}decodeIHDR(){let e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(e){if(1!==e&&2!==e&&4!==e&&8!==e&&16!==e)throw new Error(`invalid bit depth: ${e}`);return e}(this.readUint8());let t,r=this.readUint8();switch(this._colorType=r,r){case XL:t=1;break;case YL:t=3;break;case JL:t=1;break;case eM:t=2;break;case tM:t=4;break;default:throw new Error(`Unknown color type: ${r}`)}if(this._png.channels=t,this._compressionMethod=this.readUint8(),this._compressionMethod!==iM)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){let e={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(e)}decodePLTE(e){if(e%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${e}`);let t=e/3;this._hasPalette=!0;let r=[];this._palette=r;for(let e=0;e<t;e++)r.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(e){this._writingDataChunks=!0;let t=e,r=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,r,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodeFDAT(e){this._writingDataChunks=!0;let t=e,r=this.offset+this.byteOffset;if(r+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,r,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(e)}decodetRNS(e){switch(this._colorType){case XL:case YL:if(e%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${e}`);if(e/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${e/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(e/2);for(let t=0;t<e/2;t++)this._transparency[t]=this.readUint16();break;case JL:{if(e>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${e} vs ${this._palette.length})`);let t=0;for(;t<e;t++){let e=this.readByte();this._palette[t].push(e)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(e){let t=qL(this),r=this.readUint8();if(r!==iM)throw new Error(`Unsupported iCCP compression method: ${r}`);let i=this.readBytes(e-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:Zr(i)}}decodepHYs(){let e=this.readUint32(),t=this.readUint32(),r=this.readByte();this._png.resolution={x:e,y:t,unit:r}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let e=0;e<this._numberOfFrames;e++){let t={sequenceNumber:this._frames[e].sequenceNumber,delayNumber:this._frames[e].delayNumber,delayDenominator:this._frames[e].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},r=this._frames.at(e);if(r){if(r.data=OL({data:r.data,width:r.width,height:r.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===e||0===r.xOffset&&0===r.yOffset&&r.width===this._png.width&&r.height===this._png.height)t.data=r.data;else{let i=this._apng.frames.at(e-1);this.disposeFrame(r,i,t),this.addFrameDataToCanvas(t,r)}this._apng.frames.push(t)}}return this._apng}disposeFrame(e,t,r){switch(e.disposeOp){case hM:break;case AM:for(let t=0;t<this._png.height;t++)for(let i=0;i<this._png.width;i++){let n=(t*e.width+i)*this._png.channels;for(let e=0;e<this._png.channels;e++)r.data[n+e]=0}break;case uM:r.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(e,t){let r=1<<this._png.depth,i=(e,r)=>({index:((e+t.yOffset)*this._png.width+t.xOffset+r)*this._png.channels,frameIndex:(e*t.width+r)*this._png.channels});switch(t.blendOp){case cM:for(let r=0;r<t.height;r++)for(let n=0;n<t.width;n++){let{index:a,frameIndex:s}=i(r,n);for(let r=0;r<this._png.channels;r++)e.data[a+r]=t.data[s+r]}break;case dM:for(let n=0;n<t.height;n++)for(let a=0;a<t.width;a++){let{index:s,frameIndex:o}=i(n,a);for(let i=0;i<this._png.channels;i++){let n=t.data[o+this._png.channels-1]/r,a=i%(this._png.channels-1)==0?1:t.data[o+i],l=Math.floor(n*a+(1-n)*e.data[s+i]);e.data[s+i]+=l}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);let e=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==aM)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===oM)this._png.data=OL({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==lM)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(e){let{data:t,width:r,height:i,channels:n,depth:a}=e,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],o=Math.ceil(a/8)*n,l=new Uint8Array(i*r*o),h=0;for(let e=0;e<7;e++){let n=s[e],a=Math.ceil((r-n.x)/n.xStep),A=Math.ceil((i-n.y)/n.yStep);if(a<=0||A<=0)continue;let u=a*o,c=new Uint8Array(u);for(let e=0;e<A;e++){let s=t[h++],A=t.subarray(h,h+u);h+=u;let d=new Uint8Array(u);LL(s,A,d,c,u,o),c.set(d);for(let t=0;t<a;t++){let a=n.x+t*n.xStep,s=n.y+e*n.yStep;if(!(a>=r||s>=i))for(let e=0;e<o;e++)l[(s*r+a)*o+e]=d[t*o+e]}}}if(16===a){let e=new Uint16Array(l.buffer);if(kL)for(let t=0;t<e.length;t++)e[t]=UL(e[t]);return e}return l}({data:e,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){let e=this._inflator.result,t=this._frames.at(-1);t?t.data=e:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:hM,blendOp:cM,data:e}),this._inflator=new qr,this._writingDataChunks=!1}};Wr(),(WL=ZL||(ZL={}))[WL.UNKNOWN=0]="UNKNOWN",WL[WL.METRE=1]="METRE";var fM=function(){return typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this}();function gM(){fM.console&&"function"==typeof fM.console.log&&fM.console.log.apply(fM.console,arguments)}var mM={log:gM,warn:function(e){fM.console&&("function"==typeof fM.console.warn?fM.console.warn.apply(fM.console,arguments):gM.call(null,arguments))},error:function(e){fM.console&&("function"==typeof fM.console.error?fM.console.error.apply(fM.console,arguments):gM(e))}};function yM(e,t,r){var i=new XMLHttpRequest;i.open("GET",e),i.responseType="blob",i.onload=function(){wM(i.response,t,r)},i.onerror=function(){mM.error("could not download file")},i.send()}function _M(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function vM(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var wM=fM.saveAs||("object"!==(typeof window>"u"?"undefined":LP(window))||window!==fM?function(){}:typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype?function(e,t,r){var i=fM.URL||fM.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener","string"==typeof e?(n.href=e,n.origin!==location.origin?_M(n.href)?yM(e,t,r):vM(n,n.target="_blank"):vM(n)):(n.href=i.createObjectURL(e),setTimeout((function(){i.revokeObjectURL(n.href)}),4e4),setTimeout((function(){vM(n)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download","string"==typeof e)if(_M(e))yM(e,t,r);else{var i=document.createElement("a");i.href=e,i.target="_blank",setTimeout((function(){vM(i)}))}else navigator.msSaveOrOpenBlob((n=e,void 0===(a=r)?a={autoBom:!1}:"object"!==LP(a)&&(mM.warn("Deprecated: Expected third argument to be a object"),a={autoBom:!a}),a.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(n.type)?new Blob(["\ufeff",n],{type:n.type}):n),t);var n,a}:function(e,t,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return yM(e,t,r);var n="application/octet-stream"===e.type,a=/constructor/i.test(fM.HTMLElement)||fM.safari,s=/CriOS\/[\d]+/.test(navigator.userAgent);if((s||n&&a)&&"object"===(typeof FileReader>"u"?"undefined":LP(FileReader))){var o=new FileReader;o.onloadend=function(){var e=o.result;e=s?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},o.readAsDataURL(e)}else{var l=fM.URL||fM.webkitURL,h=l.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){l.revokeObjectURL(h)}),4e4)}});function bM(e){var t;e=e||"",this.ok=!1,"#"==e.charAt(0)&&(e=e.substr(1,6)),e={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dodgerblue:"1e90ff",feldspar:"d19275",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslateblue:"8470ff",lightslategray:"778899",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370d8",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"d87093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",red:"ff0000",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",violetred:"d02090",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"}[e=(e=e.replace(/ /g,"")).toLowerCase()]||e;for(var r=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,example:["rgb(123, 234, 45)","rgb(255,234,245)"],process:function(e){return[parseInt(e[1]),parseInt(e[2]),parseInt(e[3])]}},{re:/^(\w{2})(\w{2})(\w{2})$/,example:["#00ff00","336699"],process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,example:["#fb0","f0f"],process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],i=0;i<r.length;i++){var n=r[i].re,a=r[i].process,s=n.exec(e);s&&(t=a(s),this.r=t[0],this.g=t[1],this.b=t[2],this.ok=!0)}this.r=this.r<0||isNaN(this.r)?0:this.r>255?255:this.r,this.g=this.g<0||isNaN(this.g)?0:this.g>255?255:this.g,this.b=this.b<0||isNaN(this.b)?0:this.b>255?255:this.b,this.toRGB=function(){return"rgb("+this.r+", "+this.g+", "+this.b+")"},this.toHex=function(){var e=this.r.toString(16),t=this.g.toString(16),r=this.b.toString(16);return 1==e.length&&(e="0"+e),1==t.length&&(t="0"+t),1==r.length&&(r="0"+r),"#"+e+t+r}}var xM=fM.atob.bind(fM),BM=fM.btoa.bind(fM);function CM(e,t){var r=e[0],i=e[1],n=e[2],a=e[3];r=EM(r,i,n,a,t[0],7,-680876936),a=EM(a,r,i,n,t[1],12,-389564586),n=EM(n,a,r,i,t[2],17,606105819),i=EM(i,n,a,r,t[3],22,-1044525330),r=EM(r,i,n,a,t[4],7,-176418897),a=EM(a,r,i,n,t[5],12,1200080426),n=EM(n,a,r,i,t[6],17,-1473231341),i=EM(i,n,a,r,t[7],22,-45705983),r=EM(r,i,n,a,t[8],7,1770035416),a=EM(a,r,i,n,t[9],12,-1958414417),n=EM(n,a,r,i,t[10],17,-42063),i=EM(i,n,a,r,t[11],22,-1990404162),r=EM(r,i,n,a,t[12],7,1804603682),a=EM(a,r,i,n,t[13],12,-40341101),n=EM(n,a,r,i,t[14],17,-1502002290),r=IM(r,i=EM(i,n,a,r,t[15],22,1236535329),n,a,t[1],5,-165796510),a=IM(a,r,i,n,t[6],9,-1069501632),n=IM(n,a,r,i,t[11],14,643717713),i=IM(i,n,a,r,t[0],20,-373897302),r=IM(r,i,n,a,t[5],5,-701558691),a=IM(a,r,i,n,t[10],9,38016083),n=IM(n,a,r,i,t[15],14,-660478335),i=IM(i,n,a,r,t[4],20,-405537848),r=IM(r,i,n,a,t[9],5,568446438),a=IM(a,r,i,n,t[14],9,-1019803690),n=IM(n,a,r,i,t[3],14,-187363961),i=IM(i,n,a,r,t[8],20,1163531501),r=IM(r,i,n,a,t[13],5,-1444681467),a=IM(a,r,i,n,t[2],9,-51403784),n=IM(n,a,r,i,t[7],14,1735328473),r=TM(r,i=IM(i,n,a,r,t[12],20,-1926607734),n,a,t[5],4,-378558),a=TM(a,r,i,n,t[8],11,-2022574463),n=TM(n,a,r,i,t[11],16,1839030562),i=TM(i,n,a,r,t[14],23,-35309556),r=TM(r,i,n,a,t[1],4,-1530992060),a=TM(a,r,i,n,t[4],11,1272893353),n=TM(n,a,r,i,t[7],16,-155497632),i=TM(i,n,a,r,t[10],23,-1094730640),r=TM(r,i,n,a,t[13],4,681279174),a=TM(a,r,i,n,t[0],11,-358537222),n=TM(n,a,r,i,t[3],16,-722521979),i=TM(i,n,a,r,t[6],23,76029189),r=TM(r,i,n,a,t[9],4,-640364487),a=TM(a,r,i,n,t[12],11,-421815835),n=TM(n,a,r,i,t[15],16,530742520),r=FM(r,i=TM(i,n,a,r,t[2],23,-995338651),n,a,t[0],6,-198630844),a=FM(a,r,i,n,t[7],10,1126891415),n=FM(n,a,r,i,t[14],15,-1416354905),i=FM(i,n,a,r,t[5],21,-57434055),r=FM(r,i,n,a,t[12],6,1700485571),a=FM(a,r,i,n,t[3],10,-1894986606),n=FM(n,a,r,i,t[10],15,-1051523),i=FM(i,n,a,r,t[1],21,-2054922799),r=FM(r,i,n,a,t[8],6,1873313359),a=FM(a,r,i,n,t[15],10,-30611744),n=FM(n,a,r,i,t[6],15,-1560198380),i=FM(i,n,a,r,t[13],21,1309151649),r=FM(r,i,n,a,t[4],6,-145523070),a=FM(a,r,i,n,t[11],10,-1120210379),n=FM(n,a,r,i,t[2],15,718787259),i=FM(i,n,a,r,t[9],21,-343485551),e[0]=NM(r,e[0]),e[1]=NM(i,e[1]),e[2]=NM(n,e[2]),e[3]=NM(a,e[3])}function SM(e,t,r,i,n,a){return t=NM(NM(t,e),NM(i,a)),NM(t<<n|t>>>32-n,r)}function EM(e,t,r,i,n,a,s){return SM(t&r|~t&i,e,t,n,a,s)}function IM(e,t,r,i,n,a,s){return SM(t&i|r&~i,e,t,n,a,s)}function TM(e,t,r,i,n,a,s){return SM(t^r^i,e,t,n,a,s)}function FM(e,t,r,i,n,a,s){return SM(r^(t|~i),e,t,n,a,s)}function PM(e){var t,r=e.length,i=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)CM(i,LM(e.substring(t-64,t)));e=e.substring(t-64);var n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<e.length;t++)n[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(n[t>>2]|=128<<(t%4<<3),t>55)for(CM(i,n),t=0;t<16;t++)n[t]=0;return n[14]=8*r,CM(i,n),i}function LM(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}var MM="0123456789abcdef".split("");function kM(e){for(var t="",r=0;r<4;r++)t+=MM[e>>8*r+4&15]+MM[e>>8*r&15];return t}function UM(e){return String.fromCharCode(255&e,(65280&e)>>8,(16711680&e)>>16,(4278190080&e)>>24)}function RM(e){return PM(e).map(UM).join("")}var DM="5d41402abc4b2a76b9719d911017c592"!=function(e){for(var t=0;t<e.length;t++)e[t]=kM(e[t]);return e.join("")}(PM("hello"));function NM(e,t){if(DM){var r=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(r>>16)<<16|65535&r}return e+t&4294967295}function OM(e,t){var r,i,n,a;if(e!==r){for(var s=(n=e,a=1+(256/e.length|0),new Array(a+1).join(n)),o=[],l=0;l<256;l++)o[l]=l;var h=0;for(l=0;l<256;l++){var A=o[l];h=(h+A+s.charCodeAt(l))%256,o[l]=o[h],o[h]=A}r=e,i=o}else o=i;var u=t.length,c=0,d=0,p="";for(l=0;l<u;l++)d=(d+(A=o[c=(c+1)%256]))%256,o[c]=o[d],o[d]=A,s=o[(o[c]+o[d])%256],p+=String.fromCharCode(t.charCodeAt(l)^s);return p}var QM={print:4,modify:8,copy:16,"annot-forms":32};function zM(e,t,r,i){this.v=1,this.r=2;var n=192;e.forEach((function(e){if(void 0!==QM.perm)throw new Error("Invalid permission: "+e);n+=QM[e]})),this.padding="(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";var a=(t+this.padding).substr(0,32),s=(r+this.padding).substr(0,32);this.O=this.processOwnerPassword(a,s),this.P=-(1+(255^n)),this.encryptionKey=RM(a+this.O+this.lsbFirstWord(this.P)+this.hexToBytes(i)).substr(0,5),this.U=OM(this.encryptionKey,this.padding)}function HM(e){if(/[^\u0000-\u00ff]/.test(e))throw new Error("Invalid PDF Name Object: "+e+", Only accept ASCII characters.");for(var t="",r=e.length,i=0;i<r;i++){var n=e.charCodeAt(i);t+=n<33||35===n||37===n||40===n||41===n||47===n||60===n||62===n||91===n||93===n||123===n||125===n||n>126?"#"+("0"+n.toString(16)).slice(-2):e[i]}return t}function jM(e){if("object"!==LP(e))throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");var t={};this.subscribe=function(e,r,i){if(i=i||!1,"string"!=typeof e||"function"!=typeof r||"boolean"!=typeof i)throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");t.hasOwnProperty(e)||(t[e]={});var n=Math.random().toString(35);return t[e][n]=[r,!!i],n},this.unsubscribe=function(e){for(var r in t)if(t[r][e])return delete t[r][e],0===Object.keys(t[r]).length&&delete t[r],!0;return!1},this.publish=function(r){if(t.hasOwnProperty(r)){var i=Array.prototype.slice.call(arguments,1),n=[];for(var a in t[r]){var s=t[r][a];try{s[0].apply(e,i)}catch(e){fM.console&&mM.error("jsPDF PubSub Error",e.message,e)}s[1]&&n.push(a)}n.length&&n.forEach(this.unsubscribe)}},this.getTopics=function(){return t}}function VM(e){if(!(this instanceof VM))return new VM(e);var t="opacity,stroke-opacity".split(",");for(var r in e)e.hasOwnProperty(r)&&t.indexOf(r)>=0&&(this[r]=e[r]);this.id="",this.objectNumber=-1}function GM(e,t){this.gState=e,this.matrix=t,this.id="",this.objectNumber=-1}function KM(e,t,r,i,n){if(!(this instanceof KM))return new KM(e,t,r,i,n);this.type="axial"===e?2:3,this.coords=t,this.colors=r,GM.call(this,i,n)}function qM(e,t,r,i,n){if(!(this instanceof qM))return new qM(e,t,r,i,n);this.boundingBox=e,this.xStep=t,this.yStep=r,this.stream="",this.cloneIndex=0,GM.call(this,i,n)}function ZM(e){var t,r="string"==typeof arguments[0]?arguments[0]:"p",i=arguments[1],n=arguments[2],a=arguments[3],s=[],o=1,l=16,h="S",A=null;"object"===LP(e=e||{})&&(r=e.orientation,i=e.unit||i,n=e.format||n,a=e.compress||e.compressPdf||a,null!==(A=e.encryption||null)&&(A.userPassword=A.userPassword||"",A.ownerPassword=A.ownerPassword||"",A.userPermissions=A.userPermissions||[]),o="number"==typeof e.userUnit?Math.abs(e.userUnit):1,void 0!==e.precision&&(t=e.precision),void 0!==e.floatPrecision&&(l=e.floatPrecision),h=e.defaultPathOperation||"S"),s=e.filters||(!0===a?["FlateEncode"]:s),i=i||"mm",r=(""+(r||"P")).toLowerCase();var u=e.putOnlyUsedFonts||!1,c={},d={internal:{},__private__:{}};d.__private__.PubSub=jM;var p="1.3",f=d.__private__.getPdfVersion=function(){return p};d.__private__.setPdfVersion=function(e){p=e};var g={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};d.__private__.getPageFormats=function(){return g};var m=d.__private__.getPageFormat=function(e){return g[e]};n=n||"a4";var y="compat",_="advanced",v=y;function w(){this.saveGraphicsState(),X(new Pe(ce,0,0,-ce,0,cr()*ce).toString()+" cm"),this.setFontSize(this.getFontSize()/ce),h="n",v=_}function b(){this.restoreGraphicsState(),h="S",v=y}var x=d.__private__.combineFontStyleAndFontWeight=function(e,t){if("bold"==e&&"normal"==t||"bold"==e&&400==t||"normal"==e&&"italic"==t||"bold"==e&&"italic"==t)throw new Error("Invalid Combination of fontweight and fontstyle");return t&&(e=400==t||"normal"===t?"italic"===e?"italic":"normal":700!=t&&"bold"!==t||"normal"!==e?(700==t?"bold":t)+""+e:"bold"),e};d.advancedAPI=function(e){var t=v===y;return t&&w.call(this),"function"!=typeof e||(e(this),t&&b.call(this)),this},d.compatAPI=function(e){var t=v===_;return t&&b.call(this),"function"!=typeof e||(e(this),t&&w.call(this)),this},d.isAdvancedAPI=function(){return v===_};var B,C=function(e){if(v!==_)throw new Error(e+" is only available in 'advanced' API mode. You need to call advancedAPI() first.")},S=d.roundToPrecision=d.__private__.roundToPrecision=function(e,r){var i=t||r;if(isNaN(e)||isNaN(i))throw new Error("Invalid argument passed to jsPDF.roundToPrecision");return e.toFixed(i).replace(/0+$/,"")};B=d.hpf=d.__private__.hpf="number"==typeof l?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return S(e,l)}:"smart"===l?function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return S(e,e>-1&&e<1?16:5)}:function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.hpf");return S(e,16)};var E=d.f2=d.__private__.f2=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f2");return S(e,2)},I=d.__private__.f3=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.f3");return S(e,3)},T=d.scale=d.__private__.scale=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.scale");return v===y?e*ce:v===_?e:void 0},F=function(e){return T((t=e,v===y?cr()-t:v===_?t:void 0));var t};d.__private__.setPrecision=d.setPrecision=function(e){"number"==typeof parseInt(e,10)&&(t=parseInt(e,10))};var P,L="00000000000000000000000000000000",M=d.__private__.getFileId=function(){return L},k=d.__private__.setFileId=function(e){return L=void 0!==e&&/^[a-fA-F0-9]{32}$/.test(e)?e.toUpperCase():L.split("").map((function(){return"ABCDEF0123456789".charAt(Math.floor(16*Math.random()))})).join(""),null!==A&&(yt=new zM(A.userPermissions,A.userPassword,A.ownerPassword,L)),L};d.setFileId=function(e){return k(e),this},d.getFileId=function(){return M()};var U=d.__private__.convertDateToPDFDate=function(e){var t=e.getTimezoneOffset(),r=t<0?"+":"-",i=Math.floor(Math.abs(t/60)),n=Math.abs(t%60),a=[r,Q(i),"'",Q(n),"'"].join("");return["D:",e.getFullYear(),Q(e.getMonth()+1),Q(e.getDate()),Q(e.getHours()),Q(e.getMinutes()),Q(e.getSeconds()),a].join("")},R=d.__private__.convertPDFDateToDate=function(e){var t=parseInt(e.substr(2,4),10),r=parseInt(e.substr(6,2),10)-1,i=parseInt(e.substr(8,2),10),n=parseInt(e.substr(10,2),10),a=parseInt(e.substr(12,2),10),s=parseInt(e.substr(14,2),10);return new Date(t,r,i,n,a,s,0)},D=d.__private__.setCreationDate=function(e){var t;if(void 0===e&&(e=new Date),e instanceof Date)t=U(e);else{if(!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(e))throw new Error("Invalid argument passed to jsPDF.setCreationDate");t=e}return P=t},N=d.__private__.getCreationDate=function(e){var t=P;return"jsDate"===e&&(t=R(P)),t};d.setCreationDate=function(e){return D(e),this},d.getCreationDate=function(e){return N(e)};var O,Q=d.__private__.padd2=function(e){return("0"+parseInt(e)).slice(-2)},z=d.__private__.padd2Hex=function(e){return("00"+(e=e.toString())).substr(e.length)},H=0,j=[],V=[],G=0,K=[],q=[],Z=!1,W=V;d.__private__.setCustomOutputDestination=function(e){Z=!0,W=e};var $=function(e){Z||(W=e)};d.__private__.resetCustomOutputDestination=function(){Z=!1,W=V};var X=d.__private__.out=function(e){return e=e.toString(),G+=e.length+1,W.push(e),W},Y=d.__private__.write=function(e){return X(1===arguments.length?e.toString():Array.prototype.join.call(arguments," "))},J=d.__private__.getArrayBuffer=function(e){for(var t=e.length,r=new ArrayBuffer(t),i=new Uint8Array(r);t--;)i[t]=e.charCodeAt(t);return r},ee=[["Helvetica","helvetica","normal","WinAnsiEncoding"],["Helvetica-Bold","helvetica","bold","WinAnsiEncoding"],["Helvetica-Oblique","helvetica","italic","WinAnsiEncoding"],["Helvetica-BoldOblique","helvetica","bolditalic","WinAnsiEncoding"],["Courier","courier","normal","WinAnsiEncoding"],["Courier-Bold","courier","bold","WinAnsiEncoding"],["Courier-Oblique","courier","italic","WinAnsiEncoding"],["Courier-BoldOblique","courier","bolditalic","WinAnsiEncoding"],["Times-Roman","times","normal","WinAnsiEncoding"],["Times-Bold","times","bold","WinAnsiEncoding"],["Times-Italic","times","italic","WinAnsiEncoding"],["Times-BoldItalic","times","bolditalic","WinAnsiEncoding"],["ZapfDingbats","zapfdingbats","normal",null],["Symbol","symbol","normal",null]];d.__private__.getStandardFonts=function(){return ee};var te=e.fontSize||16;d.__private__.setFontSize=d.setFontSize=function(e){return te=v===_?e/ce:e,this};var re,ie=d.__private__.getFontSize=d.getFontSize=function(){return v===y?te:te*ce},ne=e.R2L||!1;d.__private__.setR2L=d.setR2L=function(e){return ne=e,this},d.__private__.getR2L=d.getR2L=function(){return ne};var ae,se=d.__private__.setZoomMode=function(e){if(/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(e))re=e;else if(isNaN(e)){if(-1===[void 0,null,"fullwidth","fullheight","fullpage","original"].indexOf(e))throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "'+e+'" is not recognized.');re=e}else re=parseInt(e,10)};d.__private__.getZoomMode=function(){return re};var oe,le=d.__private__.setPageMode=function(e){if(-1==[void 0,null,"UseNone","UseOutlines","UseThumbs","FullScreen"].indexOf(e))throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "'+e+'" is not recognized.');ae=e};d.__private__.getPageMode=function(){return ae};var he=d.__private__.setLayoutMode=function(e){if(-1==[void 0,null,"continuous","single","twoleft","tworight","two"].indexOf(e))throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "'+e+'" is not recognized.');oe=e};d.__private__.getLayoutMode=function(){return oe},d.__private__.setDisplayMode=d.setDisplayMode=function(e,t,r){return se(e),he(t),le(r),this};var Ae={title:"",subject:"",author:"",keywords:"",creator:""};d.__private__.getDocumentProperty=function(e){if(-1===Object.keys(Ae).indexOf(e))throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");return Ae[e]},d.__private__.getDocumentProperties=function(){return Ae},d.__private__.setDocumentProperties=d.setProperties=d.setDocumentProperties=function(e){for(var t in Ae)Ae.hasOwnProperty(t)&&e[t]&&(Ae[t]=e[t]);return this},d.__private__.setDocumentProperty=function(e,t){if(-1===Object.keys(Ae).indexOf(e))throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");return Ae[e]=t};var ue,ce,de,pe,fe,ge={},me={},ye=[],_e={},ve={},we={},be={},xe=null,Be=0,Ce=[],Se=new jM(d),Ee=e.hotfixes||[],Ie={},Te={},Fe=[],Pe=function e(t,r,i,n,a,s){if(!(this instanceof e))return new e(t,r,i,n,a,s);isNaN(t)&&(t=1),isNaN(r)&&(r=0),isNaN(i)&&(i=0),isNaN(n)&&(n=1),isNaN(a)&&(a=0),isNaN(s)&&(s=0),this._matrix=[t,r,i,n,a,s]};Object.defineProperty(Pe.prototype,"sx",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Pe.prototype,"shy",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Pe.prototype,"shx",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Pe.prototype,"sy",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Pe.prototype,"tx",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Pe.prototype,"ty",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Pe.prototype,"a",{get:function(){return this._matrix[0]},set:function(e){this._matrix[0]=e}}),Object.defineProperty(Pe.prototype,"b",{get:function(){return this._matrix[1]},set:function(e){this._matrix[1]=e}}),Object.defineProperty(Pe.prototype,"c",{get:function(){return this._matrix[2]},set:function(e){this._matrix[2]=e}}),Object.defineProperty(Pe.prototype,"d",{get:function(){return this._matrix[3]},set:function(e){this._matrix[3]=e}}),Object.defineProperty(Pe.prototype,"e",{get:function(){return this._matrix[4]},set:function(e){this._matrix[4]=e}}),Object.defineProperty(Pe.prototype,"f",{get:function(){return this._matrix[5]},set:function(e){this._matrix[5]=e}}),Object.defineProperty(Pe.prototype,"rotation",{get:function(){return Math.atan2(this.shx,this.sx)}}),Object.defineProperty(Pe.prototype,"scaleX",{get:function(){return this.decompose().scale.sx}}),Object.defineProperty(Pe.prototype,"scaleY",{get:function(){return this.decompose().scale.sy}}),Object.defineProperty(Pe.prototype,"isIdentity",{get:function(){return 1===this.sx&&0===this.shy&&0===this.shx&&1===this.sy&&0===this.tx&&0===this.ty}}),Pe.prototype.join=function(e){return[this.sx,this.shy,this.shx,this.sy,this.tx,this.ty].map(B).join(e)},Pe.prototype.multiply=function(e){var t=e.sx*this.sx+e.shy*this.shx,r=e.sx*this.shy+e.shy*this.sy,i=e.shx*this.sx+e.sy*this.shx,n=e.shx*this.shy+e.sy*this.sy,a=e.tx*this.sx+e.ty*this.shx+this.tx,s=e.tx*this.shy+e.ty*this.sy+this.ty;return new Pe(t,r,i,n,a,s)},Pe.prototype.decompose=function(){var e=this.sx,t=this.shy,r=this.shx,i=this.sy,n=this.tx,a=this.ty,s=Math.sqrt(e*e+t*t),o=(e/=s)*r+(t/=s)*i;r-=e*o,i-=t*o;var l=Math.sqrt(r*r+i*i);return o/=l,e*(i/=l)<t*(r/=l)&&(e=-e,t=-t,o=-o,s=-s),{scale:new Pe(s,0,0,l,0,0),translate:new Pe(1,0,0,1,n,a),rotate:new Pe(e,t,-t,e,0,0),skew:new Pe(1,0,o,1,0,0)}},Pe.prototype.toString=function(e){return this.join(" ")},Pe.prototype.inversed=function(){var e=this.sx,t=this.shy,r=this.shx,i=this.sy,n=this.tx,a=this.ty,s=1/(e*i-t*r),o=i*s,l=-t*s,h=-r*s,A=e*s;return new Pe(o,l,h,A,-o*n-h*a,-l*n-A*a)},Pe.prototype.applyToPoint=function(e){var t=e.x*this.sx+e.y*this.shx+this.tx,r=e.x*this.shy+e.y*this.sy+this.ty;return new tr(t,r)},Pe.prototype.applyToRectangle=function(e){var t=this.applyToPoint(e),r=this.applyToPoint(new tr(e.x+e.w,e.y+e.h));return new rr(t.x,t.y,r.x-t.x,r.y-t.y)},Pe.prototype.clone=function(){var e=this.sx,t=this.shy,r=this.shx,i=this.sy,n=this.tx,a=this.ty;return new Pe(e,t,r,i,n,a)},d.Matrix=Pe;var Le=d.matrixMult=function(e,t){return t.multiply(e)},Me=new Pe(1,0,0,1,0,0);d.unitMatrix=d.identityMatrix=Me;var ke=function(e,t){if(!ve[e]){var r=(t instanceof KM?"Sh":"P")+(Object.keys(_e).length+1).toString(10);t.id=r,ve[e]=r,_e[r]=t,Se.publish("addPattern",t)}};d.ShadingPattern=KM,d.TilingPattern=qM,d.addShadingPattern=function(e,t){return C("addShadingPattern()"),ke(e,t),this},d.beginTilingPattern=function(e){C("beginTilingPattern()"),nr(e.boundingBox[0],e.boundingBox[1],e.boundingBox[2]-e.boundingBox[0],e.boundingBox[3]-e.boundingBox[1],e.matrix)},d.endTilingPattern=function(e,t){C("endTilingPattern()"),t.stream=q[O].join("\n"),ke(e,t),Se.publish("endTilingPattern",t),Fe.pop().restore()};var Ue,Re=d.__private__.newObject=function(){var e=De();return Ne(e,!0),e},De=d.__private__.newObjectDeferred=function(){return H++,j[H]=function(){return G},H},Ne=function(e,t){return t="boolean"==typeof t&&t,j[e]=G,t&&X(e+" 0 obj"),e},Oe=d.__private__.newAdditionalObject=function(){var e={objId:De(),content:""};return K.push(e),e},Qe=De(),ze=De(),He=d.__private__.decodeColorString=function(e){var t=e.split(" ");if(2!==t.length||"g"!==t[1]&&"G"!==t[1])5!==t.length||"k"!==t[4]&&"K"!==t[4]||(t=[(1-t[0])*(1-t[3]),(1-t[1])*(1-t[3]),(1-t[2])*(1-t[3]),"r"]);else{var r=parseFloat(t[0]);t=[r,r,r,"r"]}for(var i="#",n=0;n<3;n++)i+=("0"+Math.floor(255*parseFloat(t[n])).toString(16)).slice(-2);return i},je=d.__private__.encodeColorString=function(e){var t;"string"==typeof e&&(e={ch1:e});var r=e.ch1,i=e.ch2,n=e.ch3,a=e.ch4,s="draw"===e.pdfColorType?["G","RG","K"]:["g","rg","k"];if("string"==typeof r&&"#"!==r.charAt(0)){var o=new bM(r);if(o.ok)r=o.toHex();else if(!/^\d*\.?\d*$/.test(r))throw new Error('Invalid color "'+r+'" passed to jsPDF.encodeColorString.')}if("string"==typeof r&&/^#[0-9A-Fa-f]{3}$/.test(r)&&(r="#"+r[1]+r[1]+r[2]+r[2]+r[3]+r[3]),"string"==typeof r&&/^#[0-9A-Fa-f]{6}$/.test(r)){var l=parseInt(r.substr(1),16);r=l>>16&255,i=l>>8&255,n=255&l}if(void 0===i||void 0===a&&r===i&&i===n)t="string"==typeof r?r+" "+s[0]:2===e.precision?E(r/255)+" "+s[0]:I(r/255)+" "+s[0];else if(void 0===a||"object"===LP(a)){if(a&&!isNaN(a.a)&&0===a.a)return["1.","1.","1.",s[1]].join(" ");t="string"==typeof r?[r,i,n,s[1]].join(" "):2===e.precision?[E(r/255),E(i/255),E(n/255),s[1]].join(" "):[I(r/255),I(i/255),I(n/255),s[1]].join(" ")}else t="string"==typeof r?[r,i,n,a,s[2]].join(" "):2===e.precision?[E(r),E(i),E(n),E(a),s[2]].join(" "):[I(r),I(i),I(n),I(a),s[2]].join(" ");return t},Ve=d.__private__.getFilters=function(){return s},Ge=d.__private__.putStream=function(e){var t=(e=e||{}).data||"",r=e.filters||Ve(),i=e.alreadyAppliedFilters||[],n=e.addLength1||!1,a=t.length,s=e.objectId,o=function(e){return e};if(null!==A&&void 0===s)throw new Error("ObjectId must be passed to putStream for file encryption");null!==A&&(o=yt.encryptor(s,0));var l={};!0===r&&(r=["FlateEncode"]);var h=e.additionalKeyValues||[],u=(l=void 0!==ZM.API.processDataByFilters?ZM.API.processDataByFilters(t,r):{data:t,reverseChain:[]}).reverseChain+(Array.isArray(i)?i.join(" "):i.toString());if(0!==l.data.length&&(h.push({key:"Length",value:l.data.length}),!0===n&&h.push({key:"Length1",value:a})),0!=u.length)if(u.split("/").length-1==1)h.push({key:"Filter",value:u});else{h.push({key:"Filter",value:"["+u+"]"});for(var c=0;c<h.length;c+=1)if("DecodeParms"===h[c].key){for(var d=[],p=0;p<l.reverseChain.split("/").length-1;p+=1)d.push("null");d.push(h[c].value),h[c].value="["+d.join(" ")+"]"}}X("<<");for(var f=0;f<h.length;f++)X("/"+h[f].key+" "+h[f].value);X(">>"),0!==l.data.length&&(X("stream"),X(o(l.data)),X("endstream"))},Ke=d.__private__.putPage=function(e){var t=e.number,r=e.data,i=e.objId,n=e.contentsObjId;Ne(i,!0),X("<</Type /Page"),X("/Parent "+e.rootDictionaryObjId+" 0 R"),X("/Resources "+e.resourceDictionaryObjId+" 0 R"),X("/MediaBox ["+parseFloat(B(e.mediaBox.bottomLeftX))+" "+parseFloat(B(e.mediaBox.bottomLeftY))+" "+B(e.mediaBox.topRightX)+" "+B(e.mediaBox.topRightY)+"]"),null!==e.cropBox&&X("/CropBox ["+B(e.cropBox.bottomLeftX)+" "+B(e.cropBox.bottomLeftY)+" "+B(e.cropBox.topRightX)+" "+B(e.cropBox.topRightY)+"]"),null!==e.bleedBox&&X("/BleedBox ["+B(e.bleedBox.bottomLeftX)+" "+B(e.bleedBox.bottomLeftY)+" "+B(e.bleedBox.topRightX)+" "+B(e.bleedBox.topRightY)+"]"),null!==e.trimBox&&X("/TrimBox ["+B(e.trimBox.bottomLeftX)+" "+B(e.trimBox.bottomLeftY)+" "+B(e.trimBox.topRightX)+" "+B(e.trimBox.topRightY)+"]"),null!==e.artBox&&X("/ArtBox ["+B(e.artBox.bottomLeftX)+" "+B(e.artBox.bottomLeftY)+" "+B(e.artBox.topRightX)+" "+B(e.artBox.topRightY)+"]"),"number"==typeof e.userUnit&&1!==e.userUnit&&X("/UserUnit "+e.userUnit),Se.publish("putPage",{objId:i,pageContext:Ce[t],pageNumber:t,page:r}),X("/Contents "+n+" 0 R"),X(">>"),X("endobj");var a=r.join("\n");return v===_&&(a+="\nQ"),Ne(n,!0),Ge({data:a,filters:Ve(),objectId:n}),X("endobj"),i},qe=d.__private__.putPages=function(){var e,t,r=[];for(e=1;e<=Be;e++)Ce[e].objId=De(),Ce[e].contentsObjId=De();for(e=1;e<=Be;e++)r.push(Ke({number:e,data:q[e],objId:Ce[e].objId,contentsObjId:Ce[e].contentsObjId,mediaBox:Ce[e].mediaBox,cropBox:Ce[e].cropBox,bleedBox:Ce[e].bleedBox,trimBox:Ce[e].trimBox,artBox:Ce[e].artBox,userUnit:Ce[e].userUnit,rootDictionaryObjId:Qe,resourceDictionaryObjId:ze}));Ne(Qe,!0),X("<</Type /Pages");var i="/Kids [";for(t=0;t<Be;t++)i+=r[t]+" 0 R ";X(i+"]"),X("/Count "+Be),X(">>"),X("endobj"),Se.publish("postPutPages")},Ze=function(e){Se.publish("putFont",{font:e,out:X,newObject:Re,putStream:Ge}),!0!==e.isAlreadyPutted&&(e.objectNumber=Re(),X("<<"),X("/Type /Font"),X("/BaseFont /"+HM(e.postScriptName)),X("/Subtype /Type1"),"string"==typeof e.encoding&&X("/Encoding /"+e.encoding),X("/FirstChar 32"),X("/LastChar 255"),X(">>"),X("endobj"))},We=function(e){e.objectNumber=Re();var t=[];t.push({key:"Type",value:"/XObject"}),t.push({key:"Subtype",value:"/Form"}),t.push({key:"BBox",value:"["+[B(e.x),B(e.y),B(e.x+e.width),B(e.y+e.height)].join(" ")+"]"}),t.push({key:"Matrix",value:"["+e.matrix.toString()+"]"});var r=e.pages[1].join("\n");Ge({data:r,additionalKeyValues:t,objectId:e.objectNumber}),X("endobj")},$e=function(e,t){t||(t=21);var r=Re(),i=function(e,t){var r,i=[],n=1/(t-1);for(r=0;r<1;r+=n)i.push(r);if(i.push(1),0!=e[0].offset){var a={offset:0,color:e[0].color};e.unshift(a)}if(1!=e[e.length-1].offset){var s={offset:1,color:e[e.length-1].color};e.push(s)}for(var o="",l=0,h=0;h<i.length;h++){for(r=i[h];r>e[l+1].offset;)l++;var A=e[l].offset,u=(r-A)/(e[l+1].offset-A),c=e[l].color,d=e[l+1].color;o+=z(Math.round((1-u)*c[0]+u*d[0]).toString(16))+z(Math.round((1-u)*c[1]+u*d[1]).toString(16))+z(Math.round((1-u)*c[2]+u*d[2]).toString(16))}return o.trim()}(e.colors,t),n=[];n.push({key:"FunctionType",value:"0"}),n.push({key:"Domain",value:"[0.0 1.0]"}),n.push({key:"Size",value:"["+t+"]"}),n.push({key:"BitsPerSample",value:"8"}),n.push({key:"Range",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),n.push({key:"Decode",value:"[0.0 1.0 0.0 1.0 0.0 1.0]"}),Ge({data:i,additionalKeyValues:n,alreadyAppliedFilters:["/ASCIIHexDecode"],objectId:r}),X("endobj"),e.objectNumber=Re(),X("<< /ShadingType "+e.type),X("/ColorSpace /DeviceRGB");var a="/Coords ["+B(parseFloat(e.coords[0]))+" "+B(parseFloat(e.coords[1]))+" ";2===e.type?a+=B(parseFloat(e.coords[2]))+" "+B(parseFloat(e.coords[3])):a+=B(parseFloat(e.coords[2]))+" "+B(parseFloat(e.coords[3]))+" "+B(parseFloat(e.coords[4]))+" "+B(parseFloat(e.coords[5])),X(a+="]"),e.matrix&&X("/Matrix ["+e.matrix.toString()+"]"),X("/Function "+r+" 0 R"),X("/Extend [true true]"),X(">>"),X("endobj")},Xe=function(e,t){var r=De(),i=Re();t.push({resourcesOid:r,objectOid:i}),e.objectNumber=i;var n=[];n.push({key:"Type",value:"/Pattern"}),n.push({key:"PatternType",value:"1"}),n.push({key:"PaintType",value:"1"}),n.push({key:"TilingType",value:"1"}),n.push({key:"BBox",value:"["+e.boundingBox.map(B).join(" ")+"]"}),n.push({key:"XStep",value:B(e.xStep)}),n.push({key:"YStep",value:B(e.yStep)}),n.push({key:"Resources",value:r+" 0 R"}),e.matrix&&n.push({key:"Matrix",value:"["+e.matrix.toString()+"]"}),Ge({data:e.stream,additionalKeyValues:n,objectId:e.objectNumber}),X("endobj")},Ye=function(e){for(var t in e.objectNumber=Re(),X("<<"),e)switch(t){case"opacity":X("/ca "+E(e[t]));break;case"stroke-opacity":X("/CA "+E(e[t]))}X(">>"),X("endobj")},Je=function(e){Ne(e.resourcesOid,!0),X("<<"),X("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"),function(){for(var e in X("/Font <<"),ge)ge.hasOwnProperty(e)&&(!1===u||!0===u&&c.hasOwnProperty(e))&&X("/"+e+" "+ge[e].objectNumber+" 0 R");X(">>")}(),function(){if(Object.keys(_e).length>0){for(var e in X("/Shading <<"),_e)_e.hasOwnProperty(e)&&_e[e]instanceof KM&&_e[e].objectNumber>=0&&X("/"+e+" "+_e[e].objectNumber+" 0 R");Se.publish("putShadingPatternDict"),X(">>")}}(),function(e){if(Object.keys(_e).length>0){for(var t in X("/Pattern <<"),_e)_e.hasOwnProperty(t)&&_e[t]instanceof d.TilingPattern&&_e[t].objectNumber>=0&&_e[t].objectNumber<e&&X("/"+t+" "+_e[t].objectNumber+" 0 R");Se.publish("putTilingPatternDict"),X(">>")}}(e.objectOid),function(){if(Object.keys(we).length>0){var e;for(e in X("/ExtGState <<"),we)we.hasOwnProperty(e)&&we[e].objectNumber>=0&&X("/"+e+" "+we[e].objectNumber+" 0 R");Se.publish("putGStateDict"),X(">>")}}(),function(){for(var e in X("/XObject <<"),Ie)Ie.hasOwnProperty(e)&&Ie[e].objectNumber>=0&&X("/"+e+" "+Ie[e].objectNumber+" 0 R");Se.publish("putXobjectDict"),X(">>")}(),X(">>"),X("endobj")},et=function(e){me[e.fontName]=me[e.fontName]||{},me[e.fontName][e.fontStyle]=e.id},tt=function(e,t,r,i,n){var a={id:"F"+(Object.keys(ge).length+1).toString(10),postScriptName:e,fontName:t,fontStyle:r,encoding:i,isStandardFont:n||!1,metadata:{}};return Se.publish("addFont",{font:a,instance:this}),ge[a.id]=a,et(a),a.id},rt=d.__private__.pdfEscape=d.pdfEscape=function(e,t){return function(e,t){var r,i,n,a,s,o,l,h,A;if(n=(t=t||{}).sourceEncoding||"Unicode",s=t.outputEncoding,(t.autoencode||s)&&ge[ue].metadata&&ge[ue].metadata[n]&&ge[ue].metadata[n].encoding&&(a=ge[ue].metadata[n].encoding,!s&&ge[ue].encoding&&(s=ge[ue].encoding),!s&&a.codePages&&(s=a.codePages[0]),"string"==typeof s&&(s=a[s]),s)){for(l=!1,o=[],r=0,i=e.length;r<i;r++)(h=s[e.charCodeAt(r)])?o.push(String.fromCharCode(h)):o.push(e[r]),o[r].charCodeAt(0)>>8&&(l=!0);e=o.join("")}for(r=e.length;void 0===l&&0!==r;)e.charCodeAt(r-1)>>8&&(l=!0),r--;if(!l)return e;for(o=t.noBOM?[]:[254,255],r=0,i=e.length;r<i;r++){if((A=(h=e.charCodeAt(r))>>8)>>8)throw new Error("Character at position "+r+" of string '"+e+"' exceeds 16bits. Cannot be encoded into UCS-2 BE");o.push(A),o.push(h-(A<<8))}return String.fromCharCode.apply(void 0,o)}(e,t).replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},it=d.__private__.beginPage=function(e){q[++Be]=[],Ce[Be]={objId:0,contentsObjId:0,userUnit:Number(o),artBox:null,bleedBox:null,cropBox:null,trimBox:null,mediaBox:{bottomLeftX:0,bottomLeftY:0,topRightX:Number(e[0]),topRightY:Number(e[1])}},st(Be),$(q[O])},nt=function(e,t){var i,a,s;switch(r=t||r,"string"==typeof e&&(i=m(e.toLowerCase()),Array.isArray(i)&&(a=i[0],s=i[1])),Array.isArray(e)&&(a=e[0]*ce,s=e[1]*ce),isNaN(a)&&(a=n[0],s=n[1]),(a>14400||s>14400)&&(mM.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"),a=Math.min(14400,a),s=Math.min(14400,s)),n=[a,s],r.substr(0,1)){case"l":s>a&&(n=[s,a]);break;case"p":a>s&&(n=[s,a])}it(n),Nt(Rt),X(Kt),0!==Yt&&X(Yt+" J"),0!==Jt&&X(Jt+" j"),Se.publish("addPage",{pageNumber:Be})},at=function(e){e>0&&e<=Be&&(q.splice(e,1),Ce.splice(e,1),Be--,O>Be&&(O=Be),this.setPage(O))},st=function(e){e>0&&e<=Be&&(O=e)},ot=d.__private__.getNumberOfPages=d.getNumberOfPages=function(){return q.length-1},lt=function(e,t,r){var i,n=void 0;return r=r||{},e=void 0!==e?e:ge[ue].fontName,t=void 0!==t?t:ge[ue].fontStyle,i=e.toLowerCase(),void 0!==me[i]&&void 0!==me[i][t]?n=me[i][t]:void 0!==me[e]&&void 0!==me[e][t]?n=me[e][t]:!1===r.disableWarning&&mM.warn("Unable to look up font label for font '"+e+"', '"+t+"'. Refer to getFontList() for available fonts."),n||r.noFallback||null==(n=me.times[t])&&(n=me.times.normal),n},ht=d.__private__.putInfo=function(){var e=Re(),t=function(e){return e};for(var r in null!==A&&(t=yt.encryptor(e,0)),X("<<"),X("/Producer ("+rt(t("jsPDF "+ZM.version))+")"),Ae)Ae.hasOwnProperty(r)&&Ae[r]&&X("/"+r.substr(0,1).toUpperCase()+r.substr(1)+" ("+rt(t(Ae[r]))+")");X("/CreationDate ("+rt(t(P))+")"),X(">>"),X("endobj")},At=d.__private__.putCatalog=function(e){var t=(e=e||{}).rootDictionaryObjId||Qe;switch(Re(),X("<<"),X("/Type /Catalog"),X("/Pages "+t+" 0 R"),re||(re="fullwidth"),re){case"fullwidth":X("/OpenAction [3 0 R /FitH null]");break;case"fullheight":X("/OpenAction [3 0 R /FitV null]");break;case"fullpage":X("/OpenAction [3 0 R /Fit]");break;case"original":X("/OpenAction [3 0 R /XYZ null null 1]");break;default:var r=""+re;"%"===r.substr(r.length-1)&&(re=parseInt(re)/100),"number"==typeof re&&X("/OpenAction [3 0 R /XYZ null null "+E(re)+"]")}switch(oe||(oe="continuous"),oe){case"continuous":X("/PageLayout /OneColumn");break;case"single":X("/PageLayout /SinglePage");break;case"two":case"twoleft":X("/PageLayout /TwoColumnLeft");break;case"tworight":X("/PageLayout /TwoColumnRight")}ae&&X("/PageMode /"+ae),Se.publish("putCatalog"),X(">>"),X("endobj")},ut=d.__private__.putTrailer=function(){X("trailer"),X("<<"),X("/Size "+(H+1)),X("/Root "+H+" 0 R"),X("/Info "+(H-1)+" 0 R"),null!==A&&X("/Encrypt "+yt.oid+" 0 R"),X("/ID [ <"+L+"> <"+L+"> ]"),X(">>")},ct=d.__private__.putHeader=function(){X("%PDF-"+p),X("%ºß¬à")},dt=d.__private__.putXRef=function(){var e="0000000000";X("xref"),X("0 "+(H+1)),X("0000000000 65535 f ");for(var t=1;t<=H;t++)"function"==typeof j[t]?X((e+j[t]()).slice(-10)+" 00000 n "):void 0!==j[t]?X((e+j[t]).slice(-10)+" 00000 n "):X("0000000000 00000 n ")},pt=d.__private__.buildDocument=function(){var e;H=0,G=0,V=[],j=[],K=[],Qe=De(),ze=De(),$(V),Se.publish("buildDocument"),ct(),qe(),function(){Se.publish("putAdditionalObjects");for(var e=0;e<K.length;e++){var t=K[e];Ne(t.objId,!0),X(t.content),X("endobj")}Se.publish("postPutAdditionalObjects")}(),e=[],function(){for(var e in ge)ge.hasOwnProperty(e)&&(!1===u||!0===u&&c.hasOwnProperty(e))&&Ze(ge[e])}(),function(){var e;for(e in we)we.hasOwnProperty(e)&&Ye(we[e])}(),function(){for(var e in Ie)Ie.hasOwnProperty(e)&&We(Ie[e])}(),function(e){var t;for(t in _e)_e.hasOwnProperty(t)&&(_e[t]instanceof KM?$e(_e[t]):_e[t]instanceof qM&&Xe(_e[t],e))}(e),Se.publish("putResources"),e.forEach(Je),Je({resourcesOid:ze,objectOid:Number.MAX_SAFE_INTEGER}),Se.publish("postPutResources"),null!==A&&(yt.oid=Re(),X("<<"),X("/Filter /Standard"),X("/V "+yt.v),X("/R "+yt.r),X("/U <"+yt.toHexString(yt.U)+">"),X("/O <"+yt.toHexString(yt.O)+">"),X("/P "+yt.P),X(">>"),X("endobj")),ht(),At();var t=G;return dt(),ut(),X("startxref"),X(""+t),X("%%EOF"),$(q[O]),V.join("\n")},ft=d.__private__.getBlob=function(e){return new Blob([J(e)],{type:"application/pdf"})},gt=d.output=d.__private__.output=((Ue=function(e,t){switch("string"==typeof(t=t||{})?t={filename:t}:t.filename=t.filename||"generated.pdf",e){case void 0:return pt();case"save":d.save(t.filename);break;case"arraybuffer":return J(pt());case"blob":return ft(pt());case"bloburi":case"bloburl":if(void 0!==fM.URL&&"function"==typeof fM.URL.createObjectURL)return fM.URL&&fM.URL.createObjectURL(ft(pt()))||void 0;mM.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");break;case"datauristring":case"dataurlstring":var r="",i=pt();try{r=BM(i)}catch{r=BM(unescape(encodeURIComponent(i)))}return"data:application/pdf;filename="+t.filename+";base64,"+r;case"pdfobjectnewwindow":if("[object Window]"===Object.prototype.toString.call(fM)){var n="https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js",a=' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';t.pdfObjectUrl&&(n=t.pdfObjectUrl,a="");var s='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><script src="'+n+'"'+a+'><\/script><script >PDFObject.embed("'+this.output("dataurlstring")+'", '+JSON.stringify(t)+");<\/script></body></html>",o=fM.open();return null!==o&&o.document.write(s),o}throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");case"pdfjsnewwindow":if("[object Window]"===Object.prototype.toString.call(fM)){var l='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe id="pdfViewer" src="'+(t.pdfJsUrl||"examples/PDF.js/web/viewer.html")+"?file=&downloadName="+t.filename+'" width="500px" height="400px" /></body></html>',h=fM.open();if(null!==h){h.document.write(l);var A=this;h.document.documentElement.querySelector("#pdfViewer").onload=function(){h.document.title=t.filename,h.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(A.output("bloburl"))}}return h}throw new Error("The option pdfjsnewwindow just works in a browser-environment.");case"dataurlnewwindow":if("[object Window]"!==Object.prototype.toString.call(fM))throw new Error("The option dataurlnewwindow just works in a browser-environment.");var u='<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;}  </style><body><iframe src="'+this.output("datauristring",t)+'"></iframe></body></html>',c=fM.open();if(null!==c&&(c.document.write(u),c.document.title=t.filename),c||typeof safari>"u")return c;break;case"datauri":case"dataurl":return fM.document.location.href=this.output("datauristring",t);default:return null}}).foo=function(){try{return Ue.apply(this,arguments)}catch(r){var e=r.stack||"";~e.indexOf(" at ")&&(e=e.split(" at ")[1]);var t="Error in function "+e.split("\n")[0].split("<")[0]+": "+r.message;if(!fM.console)throw new Error(t);fM.console.error(t,r),fM.alert&&alert(t)}},Ue.foo.bar=Ue,Ue.foo),mt=function(e){return!0===Array.isArray(Ee)&&Ee.indexOf(e)>-1};switch(i){case"pt":ce=1;break;case"mm":ce=72/25.4;break;case"cm":ce=72/2.54;break;case"in":ce=72;break;case"px":ce=1==mt("px_scaling")?.75:96/72;break;case"pc":case"em":ce=12;break;case"ex":ce=6;break;default:if("number"!=typeof i)throw new Error("Invalid unit: "+i);ce=i}var yt=null;D(),k();var _t=d.__private__.getPageInfo=d.getPageInfo=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfo");return{objId:Ce[e].objId,pageNumber:e,pageContext:Ce[e]}},vt=d.__private__.getPageInfoByObjId=function(e){if(isNaN(e)||e%1!=0)throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");for(var t in Ce)if(Ce[t].objId===e)break;return _t(t)},wt=d.__private__.getCurrentPageInfo=d.getCurrentPageInfo=function(){return{objId:Ce[O].objId,pageNumber:O,pageContext:Ce[O]}};d.addPage=function(){return nt.apply(this,arguments),this},d.setPage=function(){return st.apply(this,arguments),$.call(this,q[O]),this},d.insertPage=function(e){return this.addPage(),this.movePage(O,e),this},d.movePage=function(e,t){var r,i;if(e>t){r=q[e],i=Ce[e];for(var n=e;n>t;n--)q[n]=q[n-1],Ce[n]=Ce[n-1];q[t]=r,Ce[t]=i,this.setPage(t)}else if(e<t){r=q[e],i=Ce[e];for(var a=e;a<t;a++)q[a]=q[a+1],Ce[a]=Ce[a+1];q[t]=r,Ce[t]=i,this.setPage(t)}return this},d.deletePage=function(){return at.apply(this,arguments),this},d.__private__.text=d.text=function(e,t,r,i,n){var a,s,o,l,h,A,u,d,p,f=(i=i||{}).scope||this;if("number"==typeof e&&"number"==typeof t&&("string"==typeof r||Array.isArray(r))){var g=r;r=t,t=e,e=g}if(arguments[3]instanceof Pe==0?(o=arguments[4],l=arguments[5],"object"===LP(u=arguments[3])&&null!==u||("string"==typeof o&&(l=o,o=null),"string"==typeof u&&(l=u,u=null),"number"==typeof u&&(o=u,u=null),i={flags:u,angle:o,align:l})):(C("The transform parameter of text() with a Matrix value"),p=n),isNaN(t)||isNaN(r)||null==e)throw new Error("Invalid arguments passed to jsPDF.text");if(0===e.length)return f;var m,y="",w="number"==typeof i.lineHeightFactor?i.lineHeightFactor:Ut,b=f.internal.scaleFactor;function x(e){return e=e.split("\t").join(Array(i.TabLen||9).join(" ")),rt(e,u)}function S(e){for(var t,r=e.concat(),i=[],n=r.length;n--;)"string"==typeof(t=r.shift())?i.push(t):Array.isArray(e)&&(1===t.length||void 0===t[1]&&void 0===t[2])?i.push(t[0]):i.push([t[0],t[1],t[2]]);return i}function E(e,t){var r;if("string"==typeof e)r=t(e)[0];else if(Array.isArray(e)){for(var i,n,a=e.concat(),s=[],o=a.length;o--;)"string"==typeof(i=a.shift())?s.push(t(i)[0]):Array.isArray(i)&&"string"==typeof i[0]&&(n=t(i[0],i[1],i[2]),s.push([n[0],n[1],n[2]]));r=s}return r}var I=!1,F=!0;if("string"==typeof e)I=!0;else if(Array.isArray(e)){var P=e.concat();s=[];for(var L,M=P.length;M--;)("string"!=typeof(L=P.shift())||Array.isArray(L)&&"string"!=typeof L[0])&&(F=!1);I=F}if(!1===I)throw new Error('Type of text must be string or Array. "'+e+'" is not recognized.');"string"==typeof e&&(e=e.match(/[\r?\n]/)?e.split(/\r\n|\r|\n/g):[e]);var k=te/f.internal.scaleFactor,U=k*(w-1);switch(i.baseline){case"bottom":r-=U;break;case"top":r+=k-U;break;case"hanging":r+=k-2*U;break;case"middle":r+=k/2-U}if((A=i.maxWidth||0)>0&&("string"==typeof e?e=f.splitTextToSize(e,A):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce((function(e,t){return e.concat(f.splitTextToSize(t,A))}),[]))),a={text:e,x:t,y:r,options:i,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:ge,activeFontSize:te}},Se.publish("preProcessText",a),e=a.text,o=(i=a.options).angle,p instanceof Pe==0&&o&&"number"==typeof o){o*=Math.PI/180,0===i.rotationDirection&&(o=-o),v===_&&(o=-o);var R=Math.cos(o),D=Math.sin(o);p=new Pe(R,D,-D,R,0,0)}else o&&o instanceof Pe&&(p=o);v!==_||p||(p=Me),void 0!==(h=i.charSpace||$t)&&(y+=B(T(h))+" Tc\n",this.setCharSpace(this.getCharSpace()||0)),void 0!==(d=i.horizontalScale)&&(y+=B(100*d)+" Tz\n"),i.lang;var N=-1,O=void 0!==i.renderingMode?i.renderingMode:i.stroke,Q=f.internal.getCurrentPageInfo().pageContext;switch(O){case 0:case!1:case"fill":N=0;break;case 1:case!0:case"stroke":N=1;break;case 2:case"fillThenStroke":N=2;break;case 3:case"invisible":N=3;break;case 4:case"fillAndAddForClipping":N=4;break;case 5:case"strokeAndAddPathForClipping":N=5;break;case 6:case"fillThenStrokeAndAddToPathForClipping":N=6;break;case 7:case"addToPathForClipping":N=7}var z=void 0!==Q.usedRenderingMode?Q.usedRenderingMode:-1;-1!==N?y+=N+" Tr\n":-1!==z&&(y+="0 Tr\n"),-1!==N&&(Q.usedRenderingMode=N),l=i.align||"left";var H,j=te*w,V=f.internal.pageSize.getWidth(),G=ge[ue];h=i.charSpace||$t,A=i.maxWidth||0,u=Object.assign({autoencode:!0,noBOM:!0},i.flags);var K=[],q=function(e){return f.getStringUnitWidth(e,{font:G,charSpace:h,fontSize:te,doKerning:!1})*te/b};if("[object Array]"===Object.prototype.toString.call(e)){var Z;s=S(e),"left"!==l&&(H=s.map(q));var W,$=0;if("right"===l){t-=H[0],e=[],M=s.length;for(var Y=0;Y<M;Y++)0===Y?(W=Ht(t),Z=jt(r)):(W=T($-H[Y]),Z=-j),e.push([s[Y],W,Z]),$=H[Y]}else if("center"===l){t-=H[0]/2,e=[],M=s.length;for(var J=0;J<M;J++)0===J?(W=Ht(t),Z=jt(r)):(W=T(($-H[J])/2),Z=-j),e.push([s[J],W,Z]),$=H[J]}else if("left"===l){e=[],M=s.length;for(var ee=0;ee<M;ee++)e.push(s[ee])}else if("justify"===l&&"Identity-H"===G.encoding){e=[],M=s.length,A=0!==A?A:V;for(var re=0,ie=0;ie<M;ie++)if(Z=0===ie?jt(r):-j,W=0===ie?Ht(t):re,ie<M-1){var ae=T((A-H[ie])/(s[ie].split(" ").length-1)),se=s[ie].split(" ");e.push([se[0]+" ",W,Z]),re=0;for(var oe=1;oe<se.length;oe++){var le=(q(se[oe-1]+" "+se[oe])-q(se[oe]))*b+ae;oe==se.length-1?e.push([se[oe],le,0]):e.push([se[oe]+" ",le,0]),re-=le}}else e.push([s[ie],W,Z]);e.push(["",re,0])}else{if("justify"!==l)throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');for(e=[],M=s.length,A=0!==A?A:V,ie=0;ie<M;ie++){Z=0===ie?jt(r):-j,W=0===ie?Ht(t):0;var he=s[ie].split(" ").length-1,Ae=he>0?(A-H[ie])/he:0;ie<M-1?K.push(B(T(Ae))):K.push(0),e.push([s[ie],W,Z])}}}!0===("boolean"==typeof i.R2L?i.R2L:ne)&&(e=E(e,(function(e,t,r){return[e.split("").reverse().join(""),t,r]}))),a={text:e,x:t,y:r,options:i,mutex:{pdfEscape:rt,activeFontKey:ue,fonts:ge,activeFontSize:te}},Se.publish("postProcessText",a),e=a.text,m=a.mutex.isHex||!1;var ce=ge[ue].encoding;"WinAnsiEncoding"!==ce&&"StandardEncoding"!==ce||(e=E(e,(function(e,t,r){return[x(e),t,r]}))),s=S(e),e=[];for(var de,pe,fe,me=Array.isArray(s[0])?1:0,ye="",_e=function(e,t,r){var n="";return r instanceof Pe?(r="number"==typeof i.angle?Le(r,new Pe(1,0,0,1,e,t)):Le(new Pe(1,0,0,1,e,t),r),v===_&&(r=Le(new Pe(1,0,0,-1,0,0),r)),n=r.join(" ")+" Tm\n"):n=B(e)+" "+B(t)+" Td\n",n},ve=0;ve<s.length;ve++){switch(ye="",me){case 1:fe=(m?"<":"(")+s[ve][0]+(m?">":")"),de=parseFloat(s[ve][1]),pe=parseFloat(s[ve][2]);break;case 0:fe=(m?"<":"(")+s[ve]+(m?">":")"),de=Ht(t),pe=jt(r)}void 0!==K&&void 0!==K[ve]&&(ye=K[ve]+" Tw\n"),0===ve?e.push(ye+_e(de,pe,p)+fe):0===me?e.push(ye+fe):1===me&&e.push(ye+_e(de,pe,p)+fe)}e=0===me?e.join(" Tj\nT* "):e.join(" Tj\n"),e+=" Tj\n";var we="BT\n/";return we+=ue+" "+te+" Tf\n",we+=B(te*w)+" TL\n",we+=Zt+"\n",we+=y,we+=e,X(we+="ET"),c[ue]=!0,f};var bt=d.__private__.clip=d.clip=function(e){return X("evenodd"===e?"W*":"W"),this};d.clipEvenOdd=function(){return bt("evenodd")},d.__private__.discardPath=d.discardPath=function(){return X("n"),this};var xt=d.__private__.isValidStyle=function(e){var t=!1;return-1!==[void 0,null,"S","D","F","DF","FD","f","f*","B","B*","n"].indexOf(e)&&(t=!0),t};d.__private__.setDefaultPathOperation=d.setDefaultPathOperation=function(e){return xt(e)&&(h=e),this};var Bt=d.__private__.getStyle=d.getStyle=function(e){var t=h;switch(e){case"D":case"S":t="S";break;case"F":t="f";break;case"FD":case"DF":t="B";break;case"f":case"f*":case"B":case"B*":t=e}return t},Ct=d.close=function(){return X("h"),this};d.stroke=function(){return X("S"),this},d.fill=function(e){return St("f",e),this},d.fillEvenOdd=function(e){return St("f*",e),this},d.fillStroke=function(e){return St("B",e),this},d.fillStrokeEvenOdd=function(e){return St("B*",e),this};var St=function(e,t){"object"===LP(t)?Tt(t,e):X(e)},Et=function(e){null===e||v===_&&void 0===e||(e=Bt(e),X(e))};function It(e,t,r,i,n){var a=new qM(t||this.boundingBox,r||this.xStep,i||this.yStep,this.gState,n||this.matrix);a.stream=this.stream;var s=e+"$$"+this.cloneIndex+++"$$";return ke(s,a),a}var Tt=function(e,t){var r=ve[e.key],i=_e[r];if(i instanceof KM)X("q"),X(Ft(t)),i.gState&&d.setGState(i.gState),X(e.matrix.toString()+" cm"),X("/"+r+" sh"),X("Q");else if(i instanceof qM){var n=new Pe(1,0,0,-1,0,cr());e.matrix&&(n=n.multiply(e.matrix||Me),r=It.call(i,e.key,e.boundingBox,e.xStep,e.yStep,n).id),X("q"),X("/Pattern cs"),X("/"+r+" scn"),i.gState&&d.setGState(i.gState),X(t),X("Q")}},Ft=function(e){switch(e){case"f":case"F":case"n":return"W n";case"f*":return"W* n";case"B":case"S":return"W S";case"B*":return"W* S"}},Pt=d.moveTo=function(e,t){return X(B(T(e))+" "+B(F(t))+" m"),this},Lt=d.lineTo=function(e,t){return X(B(T(e))+" "+B(F(t))+" l"),this},Mt=d.curveTo=function(e,t,r,i,n,a){return X([B(T(e)),B(F(t)),B(T(r)),B(F(i)),B(T(n)),B(F(a)),"c"].join(" ")),this};d.__private__.line=d.line=function(e,t,r,i,n){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.line");return v===y?this.lines([[r-e,i-t]],e,t,[1,1],n||"S"):this.lines([[r-e,i-t]],e,t,[1,1]).stroke()},d.__private__.lines=d.lines=function(e,t,r,i,n,a){var s,o,l,h,A,u,c,d,p,f,g,m;if("number"==typeof e&&(m=r,r=t,t=e,e=m),i=i||[1,1],a=a||!1,isNaN(t)||isNaN(r)||!Array.isArray(e)||!Array.isArray(i)||!xt(n)||"boolean"!=typeof a)throw new Error("Invalid arguments passed to jsPDF.lines");for(Pt(t,r),s=i[0],o=i[1],h=e.length,f=t,g=r,l=0;l<h;l++)2===(A=e[l]).length?(f=A[0]*s+f,g=A[1]*o+g,Lt(f,g)):(u=A[0]*s+f,c=A[1]*o+g,d=A[2]*s+f,p=A[3]*o+g,f=A[4]*s+f,g=A[5]*o+g,Mt(u,c,d,p,f,g));return a&&Ct(),Et(n),this},d.path=function(e){for(var t=0;t<e.length;t++){var r=e[t],i=r.c;switch(r.op){case"m":Pt(i[0],i[1]);break;case"l":Lt(i[0],i[1]);break;case"c":Mt.apply(this,i);break;case"h":Ct()}}return this},d.__private__.rect=d.rect=function(e,t,r,i,n){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.rect");return v===y&&(i=-i),X([B(T(e)),B(F(t)),B(T(r)),B(T(i)),"re"].join(" ")),Et(n),this},d.__private__.triangle=d.triangle=function(e,t,r,i,n,a,s){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||isNaN(n)||isNaN(a)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.triangle");return this.lines([[r-e,i-t],[n-r,a-i],[e-n,t-a]],e,t,[1,1],s,!0),this},d.__private__.roundedRect=d.roundedRect=function(e,t,r,i,n,a,s){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||isNaN(n)||isNaN(a)||!xt(s))throw new Error("Invalid arguments passed to jsPDF.roundedRect");var o=4/3*(Math.SQRT2-1);return n=Math.min(n,.5*r),a=Math.min(a,.5*i),this.lines([[r-2*n,0],[n*o,0,n,a-a*o,n,a],[0,i-2*a],[0,a*o,-n*o,a,-n,a],[2*n-r,0],[-n*o,0,-n,-a*o,-n,-a],[0,2*a-i],[0,-a*o,n*o,-a,n,-a]],e+n,t,[1,1],s,!0),this},d.__private__.ellipse=d.ellipse=function(e,t,r,i,n){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||!xt(n))throw new Error("Invalid arguments passed to jsPDF.ellipse");var a=4/3*(Math.SQRT2-1)*r,s=4/3*(Math.SQRT2-1)*i;return Pt(e+r,t),Mt(e+r,t-s,e+a,t-i,e,t-i),Mt(e-a,t-i,e-r,t-s,e-r,t),Mt(e-r,t+s,e-a,t+i,e,t+i),Mt(e+a,t+i,e+r,t+s,e+r,t),Et(n),this},d.__private__.circle=d.circle=function(e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r)||!xt(i))throw new Error("Invalid arguments passed to jsPDF.circle");return this.ellipse(e,t,r,r,i)},d.setFont=function(e,t,r){return r&&(t=x(t,r)),ue=lt(e,t,{disableWarning:!1}),this};var kt=d.__private__.getFont=d.getFont=function(){return ge[lt.apply(d,arguments)]};d.__private__.getFontList=d.getFontList=function(){var e,t,r={};for(e in me)if(me.hasOwnProperty(e))for(t in r[e]=[],me[e])me[e].hasOwnProperty(t)&&r[e].push(t);return r},d.addFont=function(e,t,r,i,n){var a=["StandardEncoding","MacRomanEncoding","Identity-H","WinAnsiEncoding"];return arguments[3]&&-1!==a.indexOf(arguments[3])?n=arguments[3]:arguments[3]&&-1==a.indexOf(arguments[3])&&(r=x(r,i)),tt.call(this,e,t,r,n=n||"Identity-H")};var Ut,Rt=e.lineWidth||.200025,Dt=d.__private__.getLineWidth=d.getLineWidth=function(){return Rt},Nt=d.__private__.setLineWidth=d.setLineWidth=function(e){return Rt=e,X(B(T(e))+" w"),this};d.__private__.setLineDash=ZM.API.setLineDash=ZM.API.setLineDashPattern=function(e,t){if(e=e||[],t=t||0,isNaN(t)||!Array.isArray(e))throw new Error("Invalid arguments passed to jsPDF.setLineDash");return e=e.map((function(e){return B(T(e))})).join(" "),t=B(T(t)),X("["+e+"] "+t+" d"),this};var Ot=d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ut};d.__private__.getLineHeight=d.getLineHeight=function(){return te*Ut};var Qt=d.__private__.setLineHeightFactor=d.setLineHeightFactor=function(e){return"number"==typeof(e=e||1.15)&&(Ut=e),this},zt=d.__private__.getLineHeightFactor=d.getLineHeightFactor=function(){return Ut};Qt(e.lineHeight);var Ht=d.__private__.getHorizontalCoordinate=function(e){return T(e)},jt=d.__private__.getVerticalCoordinate=function(e){return v===_?e:Ce[O].mediaBox.topRightY-Ce[O].mediaBox.bottomLeftY-T(e)},Vt=d.__private__.getHorizontalCoordinateString=d.getHorizontalCoordinateString=function(e){return B(Ht(e))},Gt=d.__private__.getVerticalCoordinateString=d.getVerticalCoordinateString=function(e){return B(jt(e))},Kt=e.strokeColor||"0 G";d.__private__.getStrokeColor=d.getDrawColor=function(){return He(Kt)},d.__private__.setStrokeColor=d.setDrawColor=function(e,t,r,i){return Kt=je({ch1:e,ch2:t,ch3:r,ch4:i,pdfColorType:"draw",precision:2}),X(Kt),this};var qt=e.fillColor||"0 g";d.__private__.getFillColor=d.getFillColor=function(){return He(qt)},d.__private__.setFillColor=d.setFillColor=function(e,t,r,i){return qt=je({ch1:e,ch2:t,ch3:r,ch4:i,pdfColorType:"fill",precision:2}),X(qt),this};var Zt=e.textColor||"0 g",Wt=d.__private__.getTextColor=d.getTextColor=function(){return He(Zt)};d.__private__.setTextColor=d.setTextColor=function(e,t,r,i){return Zt=je({ch1:e,ch2:t,ch3:r,ch4:i,pdfColorType:"text",precision:3}),this};var $t=e.charSpace,Xt=d.__private__.getCharSpace=d.getCharSpace=function(){return parseFloat($t||0)};d.__private__.setCharSpace=d.setCharSpace=function(e){if(isNaN(e))throw new Error("Invalid argument passed to jsPDF.setCharSpace");return $t=e,this};var Yt=0;d.CapJoinStyles={0:0,butt:0,but:0,miter:0,1:1,round:1,rounded:1,circle:1,2:2,projecting:2,project:2,square:2,bevel:2},d.__private__.setLineCap=d.setLineCap=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line cap style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Yt=t,X(t+" J"),this};var Jt=0;d.__private__.setLineJoin=d.setLineJoin=function(e){var t=d.CapJoinStyles[e];if(void 0===t)throw new Error("Line join style of '"+e+"' is not recognized. See or extend .CapJoinStyles property for valid styles");return Jt=t,X(t+" j"),this},d.__private__.setLineMiterLimit=d.__private__.setMiterLimit=d.setLineMiterLimit=d.setMiterLimit=function(e){if(e=e||0,isNaN(e))throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");return X(B(T(e))+" M"),this},d.GState=VM,d.setGState=function(e){(e="string"==typeof e?we[be[e]]:er(null,e)).equals(xe)||(X("/"+e.id+" gs"),xe=e)};var er=function(e,t){if(!e||!be[e]){var r=!1;for(var i in we)if(we.hasOwnProperty(i)&&we[i].equals(t)){r=!0;break}if(r)t=we[i];else{var n="GS"+(Object.keys(we).length+1).toString(10);we[n]=t,t.id=n}return e&&(be[e]=t.id),Se.publish("addGState",t),t}};d.addGState=function(e,t){return er(e,t),this},d.saveGraphicsState=function(){return X("q"),ye.push({key:ue,size:te,color:Zt}),this},d.restoreGraphicsState=function(){X("Q");var e=ye.pop();return ue=e.key,te=e.size,Zt=e.color,xe=null,this},d.setCurrentTransformationMatrix=function(e){return X(e.toString()+" cm"),this},d.comment=function(e){return X("#"+e),this};var tr=function(e,t){var r=e||0;Object.defineProperty(this,"x",{enumerable:!0,get:function(){return r},set:function(e){isNaN(e)||(r=parseFloat(e))}});var i=t||0;Object.defineProperty(this,"y",{enumerable:!0,get:function(){return i},set:function(e){isNaN(e)||(i=parseFloat(e))}});var n="pt";return Object.defineProperty(this,"type",{enumerable:!0,get:function(){return n},set:function(e){n=e.toString()}}),this},rr=function(e,t,r,i){tr.call(this,e,t),this.type="rect";var n=r||0;Object.defineProperty(this,"w",{enumerable:!0,get:function(){return n},set:function(e){isNaN(e)||(n=parseFloat(e))}});var a=i||0;return Object.defineProperty(this,"h",{enumerable:!0,get:function(){return a},set:function(e){isNaN(e)||(a=parseFloat(e))}}),this},ir=function(){this.page=Be,this.currentPage=O,this.pages=q.slice(0),this.pagesContext=Ce.slice(0),this.x=de,this.y=pe,this.matrix=fe,this.width=sr(O),this.height=lr(O),this.outputDestination=W,this.id="",this.objectNumber=-1};ir.prototype.restore=function(){Be=this.page,O=this.currentPage,Ce=this.pagesContext,q=this.pages,de=this.x,pe=this.y,fe=this.matrix,or(O,this.width),hr(O,this.height),W=this.outputDestination};var nr=function(e,t,r,i,n){Fe.push(new ir),Be=O=0,q=[],de=e,pe=t,fe=n,it([r,i])};for(var ar in d.beginFormObject=function(e,t,r,i,n){return nr(e,t,r,i,n),this},d.endFormObject=function(e){return function(e){if(Te[e])Fe.pop().restore();else{var t=new ir,r="Xo"+(Object.keys(Ie).length+1).toString(10);t.id=r,Te[e]=r,Ie[r]=t,Se.publish("addFormObject",t),Fe.pop().restore()}}(e),this},d.doFormObject=function(e,t){var r=Ie[Te[e]];return X("q"),X(t.toString()+" cm"),X("/"+r.id+" Do"),X("Q"),this},d.getFormObject=function(e){var t=Ie[Te[e]];return{x:t.x,y:t.y,width:t.width,height:t.height,matrix:t.matrix}},d.save=function(e,t){return e=e||"generated.pdf",(t=t||{}).returnPromise=t.returnPromise||!1,!1===t.returnPromise?(wM(ft(pt()),e),"function"==typeof wM.unload&&fM.setTimeout&&setTimeout(wM.unload,911),this):new Promise((function(t,r){try{var i=wM(ft(pt()),e);"function"==typeof wM.unload&&fM.setTimeout&&setTimeout(wM.unload,911),t(i)}catch(e){r(e.message)}}))},ZM.API)ZM.API.hasOwnProperty(ar)&&("events"===ar&&ZM.API.events.length?function(e,t){var r,i,n;for(n=t.length-1;-1!==n;n--)r=t[n][0],i=t[n][1],e.subscribe.apply(e,[r].concat("function"==typeof i?[i]:i))}(Se,ZM.API.events):d[ar]=ZM.API[ar]);function sr(e){return Ce[e].mediaBox.topRightX-Ce[e].mediaBox.bottomLeftX}function or(e,t){Ce[e].mediaBox.topRightX=t+Ce[e].mediaBox.bottomLeftX}function lr(e){return Ce[e].mediaBox.topRightY-Ce[e].mediaBox.bottomLeftY}function hr(e,t){Ce[e].mediaBox.topRightY=t+Ce[e].mediaBox.bottomLeftY}var Ar=d.getPageWidth=function(e){return sr(e=e||O)/ce},ur=d.setPageWidth=function(e,t){or(e,t*ce)},cr=d.getPageHeight=function(e){return lr(e=e||O)/ce},dr=d.setPageHeight=function(e,t){hr(e,t*ce)};return d.internal={pdfEscape:rt,getStyle:Bt,getFont:kt,getFontSize:ie,getCharSpace:Xt,getTextColor:Wt,getLineHeight:Ot,getLineHeightFactor:zt,getLineWidth:Dt,write:Y,getHorizontalCoordinate:Ht,getVerticalCoordinate:jt,getCoordinateString:Vt,getVerticalCoordinateString:Gt,collections:{},newObject:Re,newAdditionalObject:Oe,newObjectDeferred:De,newObjectDeferredBegin:Ne,getFilters:Ve,putStream:Ge,events:Se,scaleFactor:ce,pageSize:{getWidth:function(){return Ar(O)},setWidth:function(e){ur(O,e)},getHeight:function(){return cr(O)},setHeight:function(e){dr(O,e)}},encryptionOptions:A,encryption:yt,getEncryptor:function(e){return null!==A?yt.encryptor(e,0):function(e){return e}},output:gt,getNumberOfPages:ot,pages:q,out:X,f2:E,f3:I,getPageInfo:_t,getPageInfoByObjId:vt,getCurrentPageInfo:wt,getPDFVersion:f,Point:tr,Rectangle:rr,Matrix:Pe,hasHotfix:mt},Object.defineProperty(d.internal.pageSize,"width",{get:function(){return Ar(O)},set:function(e){ur(O,e)},enumerable:!0,configurable:!0}),Object.defineProperty(d.internal.pageSize,"height",{get:function(){return cr(O)},set:function(e){dr(O,e)},enumerable:!0,configurable:!0}),function(e){for(var t=0,r=ee.length;t<r;t++){var i=tt.call(this,e[t][0],e[t][1],e[t][2],ee[t][3],!0);!1===u&&(c[i]=!0);var n=e[t][0].split("-");et({id:i,fontName:n[0],fontStyle:n[1]||""})}Se.publish("addFonts",{fonts:ge,dictionary:me})}.call(d,ee),ue="F1",nt(n,r),Se.publish("initialized"),d}zM.prototype.lsbFirstWord=function(e){return String.fromCharCode(255&e,e>>8&255,e>>16&255,e>>24&255)},zM.prototype.toHexString=function(e){return e.split("").map((function(e){return("0"+(255&e.charCodeAt(0)).toString(16)).slice(-2)})).join("")},zM.prototype.hexToBytes=function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(String.fromCharCode(parseInt(e.substr(r,2),16)));return t.join("")},zM.prototype.processOwnerPassword=function(e,t){return OM(RM(t).substr(0,5),e)},zM.prototype.encryptor=function(e,t){var r=RM(this.encryptionKey+String.fromCharCode(255&e,e>>8&255,e>>16&255,255&t,t>>8&255)).substr(0,10);return function(e){return OM(r,e)}},VM.prototype.equals=function(e){var t,r="id,objectNumber,equals";if(!e||LP(e)!==LP(this))return!1;var i=0;for(t in this)if(!(r.indexOf(t)>=0)){if(this.hasOwnProperty(t)&&!e.hasOwnProperty(t)||this[t]!==e[t])return!1;i++}for(t in e)e.hasOwnProperty(t)&&r.indexOf(t)<0&&i--;return 0===i},ZM.API={events:[]},ZM.version="3.0.3";var WM=ZM.API,$M=1,XM=function(e){return e.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},YM=function(e){return e.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},JM=function(e){return e.toFixed(2)},ek=function(e){return e.toFixed(5)};WM.__acroform__={};var tk=function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e},rk=function(e){return e*$M},ik=function(e){var t=new _k,r=Mk.internal.getHeight(e)||0,i=Mk.internal.getWidth(e)||0;return t.BBox=[0,0,Number(JM(i)),Number(JM(r))],t},nk=WM.__acroform__.setBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return e|1<<t},ak=WM.__acroform__.clearBit=function(e,t){if(e=e||0,t=t||0,isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return e&~(1<<t)},sk=WM.__acroform__.getBit=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return e&1<<t?1:0},ok=WM.__acroform__.getBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return sk(e,t-1)},lk=WM.__acroform__.setBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return nk(e,t-1)},hk=WM.__acroform__.clearBitForPdf=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return ak(e,t-1)},Ak=WM.__acroform__.calculateCoordinates=function(e,t){var r=t.internal.getHorizontalCoordinate,i=t.internal.getVerticalCoordinate,n=e[0],a=e[1],s=e[2],o=e[3],l={};return l.lowerLeft_X=r(n)||0,l.lowerLeft_Y=i(a+o)||0,l.upperRight_X=r(n+s)||0,l.upperRight_Y=i(a)||0,[Number(JM(l.lowerLeft_X)),Number(JM(l.lowerLeft_Y)),Number(JM(l.upperRight_X)),Number(JM(l.upperRight_Y))]},uk=function(e){if(e.appearanceStreamContent)return e.appearanceStreamContent;if(e.V||e.DV){var t=[],r=e._V||e.DV,i=ck(e,r),n=e.scope.internal.getFont(e.fontName,e.fontStyle).id;t.push("/Tx BMC"),t.push("q"),t.push("BT"),t.push(e.scope.__private__.encodeColorString(e.color)),t.push("/"+n+" "+JM(i.fontSize)+" Tf"),t.push("1 0 0 1 0 0 Tm"),t.push(i.text),t.push("ET"),t.push("Q"),t.push("EMC");var a=ik(e);return a.scope=e.scope,a.stream=t.join("\n"),a}},ck=function(e,t){var r=0===e.fontSize?e.maxFontSize:e.fontSize,i={text:"",fontSize:""},n=(t=")"==(t="("==t.substr(0,1)?t.substr(1):t).substr(t.length-1)?t.substr(0,t.length-1):t).split(" ");n=e.multiline?n.map((function(e){return e.split("\n")})):n.map((function(e){return[e]}));var a=r,s=Mk.internal.getHeight(e)||0;s=s<0?-s:s;var o=Mk.internal.getWidth(e)||0;o=o<0?-o:o;var l=function(t,r,i){if(t+1<n.length){var a=r+" "+n[t+1][0];return dk(a,e,i).width<=o-4}return!1};a++;e:for(;a>0;){t="",a--;var h,A,u=dk("3",e,a).height,c=e.multiline?s-a:(s-u)/2,d=c+=2,p=0,f=0,g=0;if(a<=0){t="(...) Tj\n",t+="% Width of Text: "+dk(t,e,a=12).width+", FieldWidth:"+o+"\n";break}for(var m="",y=0,_=0;_<n.length;_++)if(n.hasOwnProperty(_)){var v=!1;if(1!==n[_].length&&g!==n[_].length-1){if((u+2)*(y+2)+2>s)continue e;m+=n[_][g],v=!0,f=_,_--}else{m=" "==(m+=n[_][g]+" ").substr(m.length-1)?m.substr(0,m.length-1):m;var w=parseInt(_),b=l(w,m,a),x=_>=n.length-1;if(b&&!x){m+=" ",g=0;continue}if(b||x){if(x)f=w;else if(e.multiline&&(u+2)*(y+2)+2>s)continue e}else{if(!e.multiline||(u+2)*(y+2)+2>s)continue e;f=w}}for(var B="",C=p;C<=f;C++){var S=n[C];if(e.multiline){if(C===f){B+=S[g]+" ",g=(g+1)%S.length;continue}if(C===p){B+=S[S.length-1]+" ";continue}}B+=S[0]+" "}switch(B=" "==B.substr(B.length-1)?B.substr(0,B.length-1):B,A=dk(B,e,a).width,e.textAlign){case"right":h=o-A-2;break;case"center":h=(o-A)/2;break;default:h=2}t+=JM(h)+" "+JM(d)+" Td\n",t+="("+XM(B)+") Tj\n",t+=-JM(h)+" 0 Td\n",d=-(a+2),A=0,p=v?f:f+1,y++,m=""}break}return i.text=t,i.fontSize=a,i},dk=function(e,t,r){var i=t.scope.internal.getFont(t.fontName,t.fontStyle),n=t.scope.getStringUnitWidth(e,{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r);return{height:t.scope.getStringUnitWidth("3",{font:i,fontSize:parseFloat(r),charSpace:0})*parseFloat(r)*1.5,width:n}},pk={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},fk=function(e,t){var r={type:"reference",object:e};void 0===t.internal.getPageInfo(e.page).pageContext.annotations.find((function(e){return e.type===r.type&&e.object===r.object}))&&t.internal.getPageInfo(e.page).pageContext.annotations.push(r)},gk=WM.__acroform__.arrayToPdfArray=function(e,t,r){var i=function(e){return e};if(Array.isArray(e)){for(var n="[",a=0;a<e.length;a++)switch(0!==a&&(n+=" "),LP(e[a])){case"boolean":case"number":case"object":n+=e[a].toString();break;case"string":"/"!==e[a].substr(0,1)?(void 0!==t&&r&&(i=r.internal.getEncryptor(t)),n+="("+XM(i(e[a].toString()))+")"):n+=e[a].toString()}return n+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},mk=function(e,t,r){var i=function(e){return e};return void 0!==t&&r&&(i=r.internal.getEncryptor(t)),(e=e||"").toString(),"("+XM(i(e))+")"},yk=function(){this._objId=void 0,this._scope=void 0,Object.defineProperty(this,"objId",{get:function(){if(void 0===this._objId){if(void 0===this.scope)return;this._objId=this.scope.internal.newObjectDeferred()}return this._objId},set:function(e){this._objId=e}}),Object.defineProperty(this,"scope",{value:this._scope,writable:!0})};yk.prototype.toString=function(){return this.objId+" 0 R"},yk.prototype.putStream=function(){var e=this.getKeyValueListForStream();this.scope.internal.putStream({data:this.stream,additionalKeyValues:e,objectId:this.objId}),this.scope.internal.out("endobj")},yk.prototype.getKeyValueListForStream=function(){var e=[],t=Object.getOwnPropertyNames(this).filter((function(e){return"content"!=e&&"appearanceStreamContent"!=e&&"scope"!=e&&"objId"!=e&&"_"!=e.substring(0,1)}));for(var r in t)if(!1===Object.getOwnPropertyDescriptor(this,t[r]).configurable){var i=t[r],n=this[i];n&&(Array.isArray(n)?e.push({key:i,value:gk(n,this.objId,this.scope)}):n instanceof yk?(n.scope=this.scope,e.push({key:i,value:n.objId+" 0 R"})):"function"!=typeof n&&e.push({key:i,value:n}))}return e};var _k=function(){yk.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writable:!0});var e,t=[];Object.defineProperty(this,"BBox",{configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};tk(_k,yk);var vk=function(){yk.call(this);var e,t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e){var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+XM(t(e))+")"}},set:function(t){e=t}})};tk(vk,yk);var wk=function e(){yk.call(this);var t=4;Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return!!ok(t,3)},set:function(e){this.F=e?lk(t,3):hk(t,3)}});var r=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return r},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute Ff supplied.');r=e}});var i=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==i.length)return i},set:function(e){i=void 0!==e?e:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[0])?0:i[0]},set:function(e){i[0]=e}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[1])?0:i[1]},set:function(e){i[1]=e}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[2])?0:i[2]},set:function(e){i[2]=e}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[3])?0:i[3]},set:function(e){i[3]=e}});var n="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return n},set:function(e){switch(e){case"/Btn":case"/Tx":case"/Ch":case"/Sig":n=e;break;default:throw new Error('Invalid value "'+e+'" for attribute FT supplied.')}}});var a=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!a||a.length<1){if(this instanceof Tk)return;a="FieldObject"+e.FieldNum++}var t=function(e){return e};return this.scope&&(t=this.scope.internal.getEncryptor(this.objId)),"("+XM(t(a))+")"},set:function(e){a=e.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return a},set:function(e){a=e}});var s="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return s},set:function(e){s=e}});var o="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return o},set:function(e){o=e}});var l=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return l},set:function(e){l=e}});var h=void 0;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return void 0===h?50/$M:h},set:function(e){h=e}});var A="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return A},set:function(e){A=e}});var u="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!u||this instanceof Tk||this instanceof Pk))return mk(u,this.objId,this.scope)},set:function(e){e=e.toString(),u=e}});var c=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(c)return this instanceof Sk==0?mk(c,this.objId,this.scope):c},set:function(e){e=e.toString(),c=this instanceof Sk==0?"("===e.substr(0,1)?YM(e.substr(1,e.length-2)):YM(e):e}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof Sk==1?YM(c.substr(1,c.length-1)):c},set:function(e){e=e.toString(),c=this instanceof Sk==1?"/"+e:e}});var d=null;Object.defineProperty(this,"_V",{enumerable:!1,configurable:!1,get:function(){if(d)return d},set:function(e){this.V=e}}),Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(d)return this instanceof Sk==0?mk(d,this.objId,this.scope):d},set:function(e){e=e.toString(),d=this instanceof Sk==0?"("===e.substr(0,1)?YM(e.substr(1,e.length-2)):YM(e):e}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof Sk==1?YM(d.substr(1,d.length-1)):d},set:function(e){e=e.toString(),d=this instanceof Sk==1?"/"+e:e}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var p,f=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return f},set:function(e){f=e=!!e}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,get:function(){if(p)return p},set:function(e){p=e}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,1)},set:function(e){this.Ff=e?lk(this.Ff,1):hk(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,2)},set:function(e){this.Ff=e?lk(this.Ff,2):hk(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,3)},set:function(e){this.Ff=e?lk(this.Ff,3):hk(this.Ff,3)}});var g=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==g)return g},set:function(e){if(-1===[0,1,2].indexOf(e))throw new Error('Invalid value "'+e+'" for attribute Q supplied.');g=e}}),Object.defineProperty(this,"textAlign",{get:function(){var e;switch(g){case 0:default:e="left";break;case 1:e="center";break;case 2:e="right"}return e},configurable:!0,enumerable:!0,set:function(e){switch(e){case"right":case 2:g=2;break;case"center":case 1:g=1;break;default:g=0}}})};tk(wk,yk);var bk=function(){wk.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var e=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){e=t}});var t=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return gk(t,this.objId,this.scope)},set:function(e){var r,i;i=[],"string"==typeof(r=e)&&(i=function(e,t,r){r||(r=1);for(var i,n=[];i=t.exec(e);)n.push(i[r]);return n}(r,/\((.*?)\)/g)),t=i}}),this.getOptions=function(){return t},this.setOptions=function(e){t=e,this.sort&&t.sort()},this.addOption=function(e){e=(e=e||"").toString(),t.push(e),this.sort&&t.sort()},this.removeOption=function(e,r){for(r=r||!1,e=(e=e||"").toString();-1!==t.indexOf(e)&&(t.splice(t.indexOf(e),1),!1!==r););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,18)},set:function(e){this.Ff=e?lk(this.Ff,18):hk(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,19)},set:function(e){!0===this.combo&&(this.Ff=e?lk(this.Ff,19):hk(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,20)},set:function(e){e?(this.Ff=lk(this.Ff,20),t.sort()):this.Ff=hk(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,22)},set:function(e){this.Ff=e?lk(this.Ff,22):hk(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,23)},set:function(e){this.Ff=e?lk(this.Ff,23):hk(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,27)},set:function(e){this.Ff=e?lk(this.Ff,27):hk(this.Ff,27)}}),this.hasAppearanceStream=!1};tk(bk,wk);var xk=function(){bk.call(this),this.fontName="helvetica",this.combo=!1};tk(xk,bk);var Bk=function(){xk.call(this),this.combo=!0};tk(Bk,xk);var Ck=function(){Bk.call(this),this.edit=!0};tk(Ck,Bk);var Sk=function(){wk.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,15)},set:function(e){this.Ff=e?lk(this.Ff,15):hk(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,16)},set:function(e){this.Ff=e?lk(this.Ff,16):hk(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,17)},set:function(e){this.Ff=e?lk(this.Ff,17):hk(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,26)},set:function(e){this.Ff=e?lk(this.Ff,26):hk(this.Ff,26)}});var e,t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};if(this.scope&&(e=this.scope.internal.getEncryptor(this.objId)),0!==Object.keys(t).length){var r,i=[];for(r in i.push("<<"),t)i.push("/"+r+" ("+XM(e(t[r]))+")");return i.push(">>"),i.join("\n")}},set:function(e){"object"===LP(e)&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};tk(Sk,wk);var Ek=function(){Sk.call(this),this.pushButton=!0};tk(Ek,Sk);var Ik=function(){Sk.call(this),this.radio=!0,this.pushButton=!1;var e=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=void 0!==t?t:[]}})};tk(Ik,Sk);var Tk=function(){var e,t;wk.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return t},set:function(e){t=e}});var r,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var e=function(e){return e};this.scope&&(e=this.scope.internal.getEncryptor(this.objId));var t,r=[];for(t in r.push("<<"),i)r.push("/"+t+" ("+XM(e(i[t]))+")");return r.push(">>"),r.join("\n")},set:function(e){"object"===LP(e)&&(i=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(e){"string"==typeof e&&(i.CA=e)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return r},set:function(e){r=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return r.substr(1,r.length-1)},set:function(e){r="/"+e}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=Mk.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};tk(Tk,wk),Ik.prototype.setAppearance=function(e){if(!("createAppearanceStream"in e)||!("getCA"in e))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var t in this.Kids)if(this.Kids.hasOwnProperty(t)){var r=this.Kids[t];r.appearanceStreamContent=e.createAppearanceStream(r.optionName),r.caption=e.getCA()}},Ik.prototype.createOption=function(e){var t=new Tk;return t.Parent=this,t.optionName=e,this.Kids.push(t),kk.call(this.scope,t),t};var Fk=function(){Sk.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=Mk.CheckBox.createAppearanceStream()};tk(Fk,Sk);var Pk=function(){wk.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,13)},set:function(e){this.Ff=e?lk(this.Ff,13):hk(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,21)},set:function(e){this.Ff=e?lk(this.Ff,21):hk(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,23)},set:function(e){this.Ff=e?lk(this.Ff,23):hk(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,24)},set:function(e){this.Ff=e?lk(this.Ff,24):hk(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,25)},set:function(e){this.Ff=e?lk(this.Ff,25):hk(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,26)},set:function(e){this.Ff=e?lk(this.Ff,26):hk(this.Ff,26)}});var e=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return e},set:function(t){Number.isInteger(t)&&(e=t)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};tk(Pk,wk);var Lk=function(){Pk.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return!!ok(this.Ff,14)},set:function(e){this.Ff=e?lk(this.Ff,14):hk(this.Ff,14)}}),this.password=!0};tk(Lk,Pk);var Mk={CheckBox:{createAppearanceStream:function(){return{N:{On:Mk.CheckBox.YesNormal},D:{On:Mk.CheckBox.YesPushDown,Off:Mk.CheckBox.OffPushDown}}},YesPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=[],i=e.scope.internal.getFont(e.fontName,e.fontStyle).id,n=e.scope.__private__.encodeColorString(e.color),a=ck(e,e.caption);return r.push("0.749023 g"),r.push("0 0 "+JM(Mk.internal.getWidth(e))+" "+JM(Mk.internal.getHeight(e))+" re"),r.push("f"),r.push("BMC"),r.push("q"),r.push("0 0 1 rg"),r.push("/"+i+" "+JM(a.fontSize)+" Tf "+n),r.push("BT"),r.push(a.text),r.push("ET"),r.push("Q"),r.push("EMC"),t.stream=r.join("\n"),t},YesNormal:function(e){var t=ik(e);t.scope=e.scope;var r=e.scope.internal.getFont(e.fontName,e.fontStyle).id,i=e.scope.__private__.encodeColorString(e.color),n=[],a=Mk.internal.getHeight(e),s=Mk.internal.getWidth(e),o=ck(e,e.caption);return n.push("1 g"),n.push("0 0 "+JM(s)+" "+JM(a)+" re"),n.push("f"),n.push("q"),n.push("0 0 1 rg"),n.push("0 0 "+JM(s-1)+" "+JM(a-1)+" re"),n.push("W"),n.push("n"),n.push("0 g"),n.push("BT"),n.push("/"+r+" "+JM(o.fontSize)+" Tf "+i),n.push(o.text),n.push("ET"),n.push("Q"),t.stream=n.join("\n"),t},OffPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+JM(Mk.internal.getWidth(e))+" "+JM(Mk.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join("\n"),t}},RadioButton:{Circle:{createAppearanceStream:function(e){var t={D:{Off:Mk.RadioButton.Circle.OffPushDown},N:{}};return t.N[e]=Mk.RadioButton.Circle.YesNormal,t.D[e]=Mk.RadioButton.Circle.YesPushDown,t},getCA:function(){return"l"},YesNormal:function(e){var t=ik(e);t.scope=e.scope;var r=[],i=Mk.internal.getWidth(e)<=Mk.internal.getHeight(e)?Mk.internal.getWidth(e)/4:Mk.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var n=Mk.internal.Bezier_C,a=Number((i*n).toFixed(5));return r.push("q"),r.push("1 0 0 1 "+ek(Mk.internal.getWidth(e)/2)+" "+ek(Mk.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),r.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),r.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),r.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join("\n"),t},YesPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=[],i=Mk.internal.getWidth(e)<=Mk.internal.getHeight(e)?Mk.internal.getWidth(e)/4:Mk.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var n=Number((2*i).toFixed(5)),a=Number((n*Mk.internal.Bezier_C).toFixed(5)),s=Number((i*Mk.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ek(Mk.internal.getWidth(e)/2)+" "+ek(Mk.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),r.push("0 g"),r.push("q"),r.push("1 0 0 1 "+ek(Mk.internal.getWidth(e)/2)+" "+ek(Mk.internal.getHeight(e)/2)+" cm"),r.push(i+" 0 m"),r.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),r.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),r.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),r.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join("\n"),t},OffPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=[],i=Mk.internal.getWidth(e)<=Mk.internal.getHeight(e)?Mk.internal.getWidth(e)/4:Mk.internal.getHeight(e)/4;i=Number((.9*i).toFixed(5));var n=Number((2*i).toFixed(5)),a=Number((n*Mk.internal.Bezier_C).toFixed(5));return r.push("0.749023 g"),r.push("q"),r.push("1 0 0 1 "+ek(Mk.internal.getWidth(e)/2)+" "+ek(Mk.internal.getHeight(e)/2)+" cm"),r.push(n+" 0 m"),r.push(n+" "+a+" "+a+" "+n+" 0 "+n+" c"),r.push("-"+a+" "+n+" -"+n+" "+a+" -"+n+" 0 c"),r.push("-"+n+" -"+a+" -"+a+" -"+n+" 0 -"+n+" c"),r.push(a+" -"+n+" "+n+" -"+a+" "+n+" 0 c"),r.push("f"),r.push("Q"),t.stream=r.join("\n"),t}},Cross:{createAppearanceStream:function(e){var t={D:{Off:Mk.RadioButton.Cross.OffPushDown},N:{}};return t.N[e]=Mk.RadioButton.Cross.YesNormal,t.D[e]=Mk.RadioButton.Cross.YesPushDown,t},getCA:function(){return"8"},YesNormal:function(e){var t=ik(e);t.scope=e.scope;var r=[],i=Mk.internal.calculateCross(e);return r.push("q"),r.push("1 1 "+JM(Mk.internal.getWidth(e)-2)+" "+JM(Mk.internal.getHeight(e)-2)+" re"),r.push("W"),r.push("n"),r.push(JM(i.x1.x)+" "+JM(i.x1.y)+" m"),r.push(JM(i.x2.x)+" "+JM(i.x2.y)+" l"),r.push(JM(i.x4.x)+" "+JM(i.x4.y)+" m"),r.push(JM(i.x3.x)+" "+JM(i.x3.y)+" l"),r.push("s"),r.push("Q"),t.stream=r.join("\n"),t},YesPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=Mk.internal.calculateCross(e),i=[];return i.push("0.749023 g"),i.push("0 0 "+JM(Mk.internal.getWidth(e))+" "+JM(Mk.internal.getHeight(e))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+JM(Mk.internal.getWidth(e)-2)+" "+JM(Mk.internal.getHeight(e)-2)+" re"),i.push("W"),i.push("n"),i.push(JM(r.x1.x)+" "+JM(r.x1.y)+" m"),i.push(JM(r.x2.x)+" "+JM(r.x2.y)+" l"),i.push(JM(r.x4.x)+" "+JM(r.x4.y)+" m"),i.push(JM(r.x3.x)+" "+JM(r.x3.y)+" l"),i.push("s"),i.push("Q"),t.stream=i.join("\n"),t},OffPushDown:function(e){var t=ik(e);t.scope=e.scope;var r=[];return r.push("0.749023 g"),r.push("0 0 "+JM(Mk.internal.getWidth(e))+" "+JM(Mk.internal.getHeight(e))+" re"),r.push("f"),t.stream=r.join("\n"),t}}},createDefaultAppearanceStream:function(e){var t=e.scope.internal.getFont(e.fontName,e.fontStyle).id,r=e.scope.__private__.encodeColorString(e.color);return"/"+t+" "+e.fontSize+" Tf "+r}};Mk.internal={Bezier_C:.551915024494,calculateCross:function(e){var t=Mk.internal.getWidth(e),r=Mk.internal.getHeight(e),i=Math.min(t,r);return{x1:{x:(t-i)/2,y:(r-i)/2+i},x2:{x:(t-i)/2+i,y:(r-i)/2},x3:{x:(t-i)/2,y:(r-i)/2},x4:{x:(t-i)/2+i,y:(r-i)/2+i}}}},Mk.internal.getWidth=function(e){var t=0;return"object"===LP(e)&&(t=rk(e.Rect[2])),t},Mk.internal.getHeight=function(e){var t=0;return"object"===LP(e)&&(t=rk(e.Rect[3])),t};var kk=WM.addField=function(e){if(function(e,t){if(t.scope=e,void 0!==e.internal&&(void 0===e.internal.acroformPlugin||!1===e.internal.acroformPlugin.isInitialized)){if(wk.FieldNum=0,e.internal.acroformPlugin=JSON.parse(JSON.stringify(pk)),e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");$M=e.internal.scaleFactor,e.internal.acroformPlugin.acroFormDictionaryRoot=new vk,e.internal.acroformPlugin.acroFormDictionaryRoot.scope=e,e.internal.acroformPlugin.acroFormDictionaryRoot._eventID=e.internal.events.subscribe("postPutResources",(function(){!function(e){e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID,e.internal.acroformPlugin.printedOut=!0}(e)})),e.internal.events.subscribe("buildDocument",(function(){!function(e){e.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];i.objId=void 0,i.hasAnnotation&&fk(i,e)}}(e)})),e.internal.events.subscribe("putCatalog",(function(){!function(e){if(void 0===e.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");e.internal.write("/AcroForm "+e.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")}(e)})),e.internal.events.subscribe("postPutPages",(function(t){!function(e,t){var r=!e;for(var i in e||(t.internal.newObjectDeferredBegin(t.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),t.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),e=e||t.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(e.hasOwnProperty(i)){var n=e[i],a=[],s=n.Rect;if(n.Rect&&(n.Rect=Ak(n.Rect,t)),t.internal.newObjectDeferredBegin(n.objId,!0),n.DA=Mk.createDefaultAppearanceStream(n),"object"===LP(n)&&"function"==typeof n.getKeyValueListForStream&&(a=n.getKeyValueListForStream()),n.Rect=s,n.hasAppearanceStream&&!n.appearanceStreamContent){var o=uk(n);a.push({key:"AP",value:"<</N "+o+">>"}),t.internal.acroformPlugin.xForms.push(o)}if(n.appearanceStreamContent){var l="";for(var h in n.appearanceStreamContent)if(n.appearanceStreamContent.hasOwnProperty(h)){var A=n.appearanceStreamContent[h];if(l+="/"+h+" ",l+="<<",Object.keys(A).length>=1||Array.isArray(A)){for(var i in A)if(A.hasOwnProperty(i)){var u=A[i];"function"==typeof u&&(u=u.call(t,n)),l+="/"+i+" "+u+" ",t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=A)&&(u=u.call(t,n)),l+="/"+i+" "+u,t.internal.acroformPlugin.xForms.indexOf(u)>=0||t.internal.acroformPlugin.xForms.push(u);l+=">>"}a.push({key:"AP",value:"<<\n"+l+">>"})}t.internal.putStream({additionalKeyValues:a,objectId:n.objId}),t.internal.out("endobj")}r&&function(e,t){for(var r in e)if(e.hasOwnProperty(r)){var i=r,n=e[r];t.internal.newObjectDeferredBegin(n.objId,!0),"object"===LP(n)&&"function"==typeof n.putStream&&n.putStream(),delete e[i]}}(t.internal.acroformPlugin.xForms,t)}(t,e)})),e.internal.acroformPlugin.isInitialized=!0}}(this,e),!(e instanceof wk))throw new Error("Invalid argument passed to jsPDF.addField.");var t;return(t=e).scope.internal.acroformPlugin.printedOut&&(t.scope.internal.acroformPlugin.printedOut=!1,t.scope.internal.acroformPlugin.acroFormDictionaryRoot=null),t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t),e.page=e.scope.internal.getCurrentPageInfo().pageNumber,this};WM.AcroFormChoiceField=bk,WM.AcroFormListBox=xk,WM.AcroFormComboBox=Bk,WM.AcroFormEditBox=Ck,WM.AcroFormButton=Sk,WM.AcroFormPushButton=Ek,WM.AcroFormRadioButton=Ik,WM.AcroFormCheckBox=Fk,WM.AcroFormTextField=Pk,WM.AcroFormPasswordField=Lk,WM.AcroFormAppearance=Mk,WM.AcroForm={ChoiceField:bk,ListBox:xk,ComboBox:Bk,EditBox:Ck,Button:Sk,PushButton:Ek,RadioButton:Ik,CheckBox:Fk,TextField:Pk,PasswordField:Lk,Appearance:Mk},ZM.AcroForm={ChoiceField:bk,ListBox:xk,ComboBox:Bk,EditBox:Ck,Button:Sk,PushButton:Ek,RadioButton:Ik,CheckBox:Fk,TextField:Pk,PasswordField:Lk,Appearance:Mk};ZM.AcroForm;function Uk(e){return e.reduce((function(e,t,r){return e[t]=r,e}),{})}(function(e){var t="addImage_";e.__addimage__={};var r="UNKNOWN",i={PNG:[[137,80,78,71]],TIFF:[[77,77,0,42],[73,73,42,0]],JPEG:[[255,216,255,224,void 0,void 0,74,70,73,70,0],[255,216,255,225,void 0,void 0,69,120,105,102,0,0],[255,216,255,219],[255,216,255,238]],JPEG2000:[[0,0,0,12,106,80,32,32]],GIF87a:[[71,73,70,56,55,97]],GIF89a:[[71,73,70,56,57,97]],WEBP:[[82,73,70,70,void 0,void 0,void 0,void 0,87,69,66,80]],BMP:[[66,77],[66,65],[67,73],[67,80],[73,67],[80,84]]},n=e.__addimage__.getImageFileTypeByImageData=function(e,t){var n,a,s,o,l,h=r;if("RGBA"===(t=t||r)||void 0!==e.data&&e.data instanceof Uint8ClampedArray&&"height"in e&&"width"in e)return"RGBA";if(b(e))for(l in i)for(s=i[l],n=0;n<s.length;n+=1){for(o=!0,a=0;a<s[n].length;a+=1)if(void 0!==s[n][a]&&s[n][a]!==e[a]){o=!1;break}if(!0===o){h=l;break}}else for(l in i)for(s=i[l],n=0;n<s.length;n+=1){for(o=!0,a=0;a<s[n].length;a+=1)if(void 0!==s[n][a]&&s[n][a]!==e.charCodeAt(a)){o=!1;break}if(!0===o){h=l;break}}return h===r&&t!==r&&(h=t),h},a=function e(t){for(var r=this.internal.write,i=this.internal.putStream,n=(0,this.internal.getFilters)();-1!==n.indexOf("FlateEncode");)n.splice(n.indexOf("FlateEncode"),1);t.objectId=this.internal.newObject();var a=[];if(a.push({key:"Type",value:"/XObject"}),a.push({key:"Subtype",value:"/Image"}),a.push({key:"Width",value:t.width}),a.push({key:"Height",value:t.height}),t.colorSpace===m.INDEXED?a.push({key:"ColorSpace",value:"[/Indexed /DeviceRGB "+(t.palette.length/3-1)+" "+("sMask"in t&&void 0!==t.sMask?t.objectId+2:t.objectId+1)+" 0 R]"}):(a.push({key:"ColorSpace",value:"/"+t.colorSpace}),t.colorSpace===m.DEVICE_CMYK&&a.push({key:"Decode",value:"[1 0 1 0 1 0 1 0]"})),a.push({key:"BitsPerComponent",value:t.bitsPerComponent}),"decodeParameters"in t&&void 0!==t.decodeParameters&&a.push({key:"DecodeParms",value:"<<"+t.decodeParameters+">>"}),"transparency"in t&&Array.isArray(t.transparency)&&t.transparency.length>0){for(var s="",o=0,l=t.transparency.length;o<l;o++)s+=t.transparency[o]+" "+t.transparency[o]+" ";a.push({key:"Mask",value:"["+s+"]"})}void 0!==t.sMask&&a.push({key:"SMask",value:t.objectId+1+" 0 R"});var h=void 0!==t.filter?["/"+t.filter]:void 0;if(i({data:t.data,additionalKeyValues:a,alreadyAppliedFilters:h,objectId:t.objectId}),r("endobj"),"sMask"in t&&void 0!==t.sMask){var A,u=null!==(A=t.sMaskBitsPerComponent)&&void 0!==A?A:t.bitsPerComponent,c={width:t.width,height:t.height,colorSpace:"DeviceGray",bitsPerComponent:u,data:t.sMask};"filter"in t&&(c.decodeParameters="/Predictor ".concat(t.predictor," /Colors 1 /BitsPerComponent ").concat(u," /Columns ").concat(t.width),c.filter=t.filter),e.call(this,c)}if(t.colorSpace===m.INDEXED){var d=this.internal.newObject();i({data:B(new Uint8Array(t.palette)),objectId:d}),r("endobj")}},s=function(){var e=this.internal.collections[t+"images"];for(var r in e)a.call(this,e[r])},o=function(){var e,r=this.internal.collections[t+"images"],i=this.internal.write;for(var n in r)i("/I"+(e=r[n]).index,e.objectId,"0","R")},l=function(){this.internal.collections[t+"images"]||(this.internal.collections[t+"images"]={},this.internal.events.subscribe("putResources",s),this.internal.events.subscribe("putXobjectDict",o))},h=function(){var e=this.internal.collections[t+"images"];return l.call(this),e},A=function(){return Object.keys(this.internal.collections[t+"images"]).length},u=function(t){return"function"==typeof e["process"+t.toUpperCase()]},c=function(e){return"object"===LP(e)&&1===e.nodeType},d=function(t,r){if("IMG"===t.nodeName&&t.hasAttribute("src")){var i=""+t.getAttribute("src");if(0===i.indexOf("data:image/"))return xM(unescape(i).split("base64,").pop());var n=e.loadFile(i,!0);if(void 0!==n)return n}if("CANVAS"===t.nodeName){if(0===t.width||0===t.height)throw new Error("Given canvas must have data. Canvas width: "+t.width+", height: "+t.height);var a;switch(r){case"PNG":a="image/png";break;case"WEBP":a="image/webp";break;default:a="image/jpeg"}return xM(t.toDataURL(a,1).split("base64,").pop())}},p=function(e){var r=this.internal.collections[t+"images"];if(r)for(var i in r)if(e===r[i].alias)return r[i]},f=function(e,t,r){return e||t||(e=-96,t=-96),e<0&&(e=-1*r.width*72/e/this.internal.scaleFactor),t<0&&(t=-1*r.height*72/t/this.internal.scaleFactor),0===e&&(e=t*r.width/r.height),0===t&&(t=e*r.height/r.width),[e,t]},g=function(e,t,r,i,n,a){var s=f.call(this,r,i,n),o=this.internal.getCoordinateString,l=this.internal.getVerticalCoordinateString,A=h.call(this);if(r=s[0],i=s[1],A[n.index]=n,a){a*=Math.PI/180;var u=Math.cos(a),c=Math.sin(a),d=function(e){return e.toFixed(4)},p=[d(u),d(c),d(-1*c),d(u),0,0,"cm"]}this.internal.write("q"),a?(this.internal.write([1,"0","0",1,o(e),l(t+i),"cm"].join(" ")),this.internal.write(p.join(" ")),this.internal.write([o(r),"0","0",o(i),"0","0","cm"].join(" "))):this.internal.write([o(r),"0","0",o(i),o(e),l(t+i),"cm"].join(" ")),this.isAdvancedAPI()&&this.internal.write([1,0,0,-1,0,0,"cm"].join(" ")),this.internal.write("/I"+n.index+" Do"),this.internal.write("Q")},m=e.color_spaces={DEVICE_RGB:"DeviceRGB",DEVICE_GRAY:"DeviceGray",DEVICE_CMYK:"DeviceCMYK",CAL_GREY:"CalGray",CAL_RGB:"CalRGB",LAB:"Lab",ICC_BASED:"ICCBased",INDEXED:"Indexed",PATTERN:"Pattern",SEPARATION:"Separation",DEVICE_N:"DeviceN"};e.decode={DCT_DECODE:"DCTDecode",FLATE_DECODE:"FlateDecode",LZW_DECODE:"LZWDecode",JPX_DECODE:"JPXDecode",JBIG2_DECODE:"JBIG2Decode",ASCII85_DECODE:"ASCII85Decode",ASCII_HEX_DECODE:"ASCIIHexDecode",RUN_LENGTH_DECODE:"RunLengthDecode",CCITT_FAX_DECODE:"CCITTFaxDecode"};var y=e.image_compression={NONE:"NONE",FAST:"FAST",MEDIUM:"MEDIUM",SLOW:"SLOW"},_=e.__addimage__.sHashCode=function(e){var t,r,i=0;if("string"==typeof e)for(r=e.length,t=0;t<r;t++)i=(i<<5)-i+e.charCodeAt(t),i|=0;else if(b(e))for(r=e.byteLength/2,t=0;t<r;t++)i=(i<<5)-i+e[t],i|=0;return i},v=e.__addimage__.validateStringAsBase64=function(e){(e=e||"").toString().trim();var t=!0;return 0===e.length&&(t=!1),e.length%4!=0&&(t=!1),!1===/^[A-Za-z0-9+/]+$/.test(e.substr(0,e.length-2))&&(t=!1),!1===/^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(e.substr(-2))&&(t=!1),t},w=e.__addimage__.extractImageFromDataUrl=function(e){if(null==e||!(e=e.trim()).startsWith("data:"))return null;var t=e.indexOf(",");return t<0?null:e.substring(0,t).trim().endsWith("base64")?e.substring(t+1):null};e.__addimage__.isArrayBuffer=function(e){return e instanceof ArrayBuffer};var b=e.__addimage__.isArrayBufferView=function(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array},x=e.__addimage__.binaryStringToUint8Array=function(e){for(var t=e.length,r=new Uint8Array(t),i=0;i<t;i++)r[i]=e.charCodeAt(i);return r},B=e.__addimage__.arrayBufferToBinaryString=function(e){for(var t="",r=b(e)?e:new Uint8Array(e),i=0;i<r.length;i+=8192)t+=String.fromCharCode.apply(null,r.subarray(i,i+8192));return t};e.addImage=function(){var e,t,i,n,a,s,o,h,A;if("number"==typeof arguments[1]?(t=r,i=arguments[1],n=arguments[2],a=arguments[3],s=arguments[4],o=arguments[5],h=arguments[6],A=arguments[7]):(t=arguments[1],i=arguments[2],n=arguments[3],a=arguments[4],s=arguments[5],o=arguments[6],h=arguments[7],A=arguments[8]),"object"===LP(e=arguments[0])&&!c(e)&&"imageData"in e){var u=e;e=u.imageData,t=u.format||t||r,i=u.x||i||0,n=u.y||n||0,a=u.w||u.width||a,s=u.h||u.height||s,o=u.alias||o,h=u.compression||h,A=u.rotation||u.angle||A}var d=this.internal.getFilters();if(void 0===h&&-1!==d.indexOf("FlateEncode")&&(h="SLOW"),isNaN(i)||isNaN(n))throw new Error("Invalid coordinates passed to jsPDF.addImage");l.call(this);var p=C.call(this,e,t,o,h);return g.call(this,i,n,a,s,p,A),this};var C=function(t,i,a,s){var o,l,h,f;if("string"==typeof t&&n(t)===r){t=unescape(t);var g=S(t,!1);(""!==g||void 0!==(g=e.loadFile(t,!0)))&&(t=g)}if(c(t)&&(t=d(t,i)),i=n(t,i),!u(i))throw new Error("addImage does not support files of type '"+i+"', please ensure that a plugin for '"+i+"' support is added.");if((null==(h=a)||0===h.length)&&(a="string"==typeof(f=t)||b(f)?_(f):b(f.data)?_(f.data):null),(o=p.call(this,a))||(t instanceof Uint8Array||"RGBA"===i||(l=t,t=x(t)),o=this["process"+i.toUpperCase()](t,A.call(this),a,function(t){return t&&"string"==typeof t&&(t=t.toUpperCase()),t in e.image_compression?t:y.NONE}(s),l)),!o)throw new Error("An unknown error occurred whilst processing the image.");return o},S=e.__addimage__.convertBase64ToBinaryString=function(e,t){t="boolean"!=typeof t||t;var r,i="";if("string"==typeof e){var n;r=null!==(n=w(e))&&void 0!==n?n:e;try{i=xM(r)}catch(e){if(t)throw v(r)?new Error("atob-Error in jsPDF.convertBase64ToBinaryString "+e.message):new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ")}}return i};e.getImageProperties=function(t){var i,a,s="";if(c(t)&&(t=d(t)),"string"==typeof t&&n(t)===r&&(""===(s=S(t,!1))&&(s=e.loadFile(t)||""),t=s),a=n(t),!u(a))throw new Error("addImage does not support files of type '"+a+"', please ensure that a plugin for '"+a+"' support is added.");if(t instanceof Uint8Array||(t=x(t)),!(i=this["process"+a.toUpperCase()](t)))throw new Error("An unknown error occurred whilst processing the image");return i.fileType=a,i}})(ZM.API),function(e){var t=function(e){if(void 0!==e&&""!=e)return!0};ZM.API.events.push(["addPage",function(e){this.internal.getPageInfo(e.pageNumber).pageContext.annotations=[]}]),e.events.push(["putPage",function(e){for(var r,i,n,a=this.internal.getCoordinateString,s=this.internal.getVerticalCoordinateString,o=this.internal.getPageInfoByObjId(e.objId),l=e.pageContext.annotations,h=!1,A=0;A<l.length&&!h;A++)switch((r=l[A]).type){case"link":(t(r.options.url)||t(r.options.pageNumber))&&(h=!0);break;case"reference":case"text":case"freetext":h=!0}if(0!=h){this.internal.write("/Annots [");for(var u=0;u<l.length;u++){r=l[u];var c=this.internal.pdfEscape,d=this.internal.getEncryptor(e.objId);switch(r.type){case"reference":this.internal.write(" "+r.object.objId+" 0 R ");break;case"text":var p=this.internal.newAdditionalObject(),f=this.internal.newAdditionalObject(),g=this.internal.getEncryptor(p.objId),m=r.title||"Note";n="<</Type /Annot /Subtype /Text "+(i="/Rect ["+a(r.bounds.x)+" "+s(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y)+"] ")+"/Contents ("+c(g(r.contents))+")",n+=" /Popup "+f.objId+" 0 R",n+=" /P "+o.objId+" 0 R",n+=" /T ("+c(g(m))+") >>",p.content=n;var y=p.objId+" 0 R";n="<</Type /Annot /Subtype /Popup "+(i="/Rect ["+a(r.bounds.x+30)+" "+s(r.bounds.y+r.bounds.h)+" "+a(r.bounds.x+r.bounds.w+30)+" "+s(r.bounds.y)+"] ")+" /Parent "+y,r.open&&(n+=" /Open true"),n+=" >>",f.content=n,this.internal.write(p.objId,"0 R",f.objId,"0 R");break;case"freetext":i="/Rect ["+a(r.bounds.x)+" "+s(r.bounds.y)+" "+a(r.bounds.x+r.bounds.w)+" "+s(r.bounds.y+r.bounds.h)+"] ";var _=r.color||"#000000";n="<</Type /Annot /Subtype /FreeText "+i+"/Contents ("+c(d(r.contents))+")",n+=" /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#"+_+")",n+=" /Border [0 0 0]",n+=" >>",this.internal.write(n);break;case"link":if(r.options.name){var v=this.annotations._nameMap[r.options.name];r.options.pageNumber=v.page,r.options.top=v.y}else r.options.top||(r.options.top=0);if(i="/Rect ["+r.finalBounds.x+" "+r.finalBounds.y+" "+r.finalBounds.w+" "+r.finalBounds.h+"] ",n="",r.options.url)n="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /A <</S /URI /URI ("+c(d(r.options.url))+") >>";else if(r.options.pageNumber)switch(n="<</Type /Annot /Subtype /Link "+i+"/Border [0 0 0] /Dest ["+this.internal.getPageInfo(r.options.pageNumber).objId+" 0 R",r.options.magFactor=r.options.magFactor||"XYZ",r.options.magFactor){case"Fit":n+=" /Fit]";break;case"FitH":n+=" /FitH "+r.options.top+"]";break;case"FitV":r.options.left=r.options.left||0,n+=" /FitV "+r.options.left+"]";break;default:var w=s(r.options.top);r.options.left=r.options.left||0,void 0===r.options.zoom&&(r.options.zoom=0),n+=" /XYZ "+r.options.left+" "+w+" "+r.options.zoom+"]"}""!=n&&(n+=" >>",this.internal.write(n))}}this.internal.write("]")}}]),e.createAnnotation=function(e){var t=this.internal.getCurrentPageInfo();switch(e.type){case"link":this.link(e.bounds.x,e.bounds.y,e.bounds.w,e.bounds.h,e);break;case"text":case"freetext":t.pageContext.annotations.push(e)}},e.link=function(e,t,r,i,n){var a=this.internal.getCurrentPageInfo(),s=this.internal.getCoordinateString,o=this.internal.getVerticalCoordinateString;a.pageContext.annotations.push({finalBounds:{x:s(e),y:o(t),w:s(e+r),h:o(t+i)},options:n,type:"link"})},e.textWithLink=function(e,t,r,i){var n,a,s=this.getTextWidth(e),o=this.internal.getLineHeight()/this.internal.scaleFactor;if(void 0!==i.maxWidth){a=i.maxWidth;var l=this.splitTextToSize(e,a).length;n=Math.ceil(o*l)}else a=s,n=o;return this.text(e,t,r,i),r+=.2*o,"center"===i.align&&(t-=s/2),"right"===i.align&&(t-=s),this.link(t,r-o,a,n,i),s},e.getTextWidth=function(e){var t=this.internal.getFontSize();return this.getStringUnitWidth(e)*t/this.internal.scaleFactor}}(ZM.API),function(e){var t={1569:[65152],1570:[65153,65154],1571:[65155,65156],1572:[65157,65158],1573:[65159,65160],1574:[65161,65162,65163,65164],1575:[65165,65166],1576:[65167,65168,65169,65170],1577:[65171,65172],1578:[65173,65174,65175,65176],1579:[65177,65178,65179,65180],1580:[65181,65182,65183,65184],1581:[65185,65186,65187,65188],1582:[65189,65190,65191,65192],1583:[65193,65194],1584:[65195,65196],1585:[65197,65198],1586:[65199,65200],1587:[65201,65202,65203,65204],1588:[65205,65206,65207,65208],1589:[65209,65210,65211,65212],1590:[65213,65214,65215,65216],1591:[65217,65218,65219,65220],1592:[65221,65222,65223,65224],1593:[65225,65226,65227,65228],1594:[65229,65230,65231,65232],1601:[65233,65234,65235,65236],1602:[65237,65238,65239,65240],1603:[65241,65242,65243,65244],1604:[65245,65246,65247,65248],1605:[65249,65250,65251,65252],1606:[65253,65254,65255,65256],1607:[65257,65258,65259,65260],1608:[65261,65262],1609:[65263,65264,64488,64489],1610:[65265,65266,65267,65268],1649:[64336,64337],1655:[64477],1657:[64358,64359,64360,64361],1658:[64350,64351,64352,64353],1659:[64338,64339,64340,64341],1662:[64342,64343,64344,64345],1663:[64354,64355,64356,64357],1664:[64346,64347,64348,64349],1667:[64374,64375,64376,64377],1668:[64370,64371,64372,64373],1670:[64378,64379,64380,64381],1671:[64382,64383,64384,64385],1672:[64392,64393],1676:[64388,64389],1677:[64386,64387],1678:[64390,64391],1681:[64396,64397],1688:[64394,64395],1700:[64362,64363,64364,64365],1702:[64366,64367,64368,64369],1705:[64398,64399,64400,64401],1709:[64467,64468,64469,64470],1711:[64402,64403,64404,64405],1713:[64410,64411,64412,64413],1715:[64406,64407,64408,64409],1722:[64414,64415],1723:[64416,64417,64418,64419],1726:[64426,64427,64428,64429],1728:[64420,64421],1729:[64422,64423,64424,64425],1733:[64480,64481],1734:[64473,64474],1735:[64471,64472],1736:[64475,64476],1737:[64482,64483],1739:[64478,64479],1740:[64508,64509,64510,64511],1744:[64484,64485,64486,64487],1746:[64430,64431],1747:[64432,64433]},r={65247:{65154:65269,65156:65271,65160:65273,65166:65275},65248:{65154:65270,65156:65272,65160:65274,65166:65276},65165:{65247:{65248:{65258:65010}}},1617:{1612:64606,1613:64607,1614:64608,1615:64609,1616:64610}},i={1612:64606,1613:64607,1614:64608,1615:64609,1616:64610},n=[1570,1571,1573,1575];e.__arabicParser__={};var a=e.__arabicParser__.isInArabicSubstitutionA=function(e){return void 0!==t[e.charCodeAt(0)]},s=e.__arabicParser__.isArabicLetter=function(e){return"string"==typeof e&&/^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(e)},o=e.__arabicParser__.isArabicEndLetter=function(e){return s(e)&&a(e)&&t[e.charCodeAt(0)].length<=2},l=e.__arabicParser__.isArabicAlfLetter=function(e){return s(e)&&n.indexOf(e.charCodeAt(0))>=0};e.__arabicParser__.arabicLetterHasIsolatedForm=function(e){return s(e)&&a(e)&&t[e.charCodeAt(0)].length>=1};var h=e.__arabicParser__.arabicLetterHasFinalForm=function(e){return s(e)&&a(e)&&t[e.charCodeAt(0)].length>=2};e.__arabicParser__.arabicLetterHasInitialForm=function(e){return s(e)&&a(e)&&t[e.charCodeAt(0)].length>=3};var A=e.__arabicParser__.arabicLetterHasMedialForm=function(e){return s(e)&&a(e)&&4==t[e.charCodeAt(0)].length},u=e.__arabicParser__.resolveLigatures=function(e){var t=0,i=r,n="",a=0;for(t=0;t<e.length;t+=1)void 0!==i[e.charCodeAt(t)]?(a++,"number"==typeof(i=i[e.charCodeAt(t)])&&(n+=String.fromCharCode(i),i=r,a=0),t===e.length-1&&(i=r,n+=e.charAt(t-(a-1)),t-=a-1,a=0)):(i=r,n+=e.charAt(t-a),t-=a,a=0);return n};e.__arabicParser__.isArabicDiacritic=function(e){return void 0!==e&&void 0!==i[e.charCodeAt(0)]};var c=e.__arabicParser__.getCorrectForm=function(e,t,r){return s(e)?!1===a(e)?-1:!h(e)||!s(t)&&!s(r)||!s(r)&&o(t)||o(e)&&!s(t)||o(e)&&l(t)||o(e)&&o(t)?0:A(e)&&s(t)&&!o(t)&&s(r)&&h(r)?3:o(e)||!s(r)?1:2:-1},d=function(e){var r=0,i=0,n=0,a="",o="",l="",h=(e=e||"").split("\\s+"),A=[];for(r=0;r<h.length;r+=1){for(A.push(""),i=0;i<h[r].length;i+=1)a=h[r][i],o=h[r][i-1],l=h[r][i+1],s(a)?(n=c(a,o,l),A[r]+=-1!==n?String.fromCharCode(t[a.charCodeAt(0)][n]):a):A[r]+=a;A[r]=u(A[r])}return A.join(" ")},p=e.__arabicParser__.processArabic=e.processArabic=function(){var e,t="string"==typeof arguments[0]?arguments[0]:arguments[0].text,r=[];if(Array.isArray(t)){var i=0;for(r=[],i=0;i<t.length;i+=1)Array.isArray(t[i])?r.push([d(t[i][0]),t[i][1],t[i][2]]):r.push([d(t[i])]);e=r}else e=d(t);return"string"==typeof arguments[0]?e:(arguments[0].text=e,arguments[0])};e.events.push(["preProcessText",p])}(ZM.API),ZM.API.autoPrint=function(e){var t;return(e=e||{}).variant=e.variant||"non-conform","javascript"===e.variant?this.addJS("print({});"):(this.internal.events.subscribe("postPutResources",(function(){t=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /Named"),this.internal.out("/Type /Action"),this.internal.out("/N /Print"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){this.internal.out("/OpenAction "+t+" 0 R")}))),this},function(e){var t=function(){var e=void 0;Object.defineProperty(this,"pdf",{get:function(){return e},set:function(t){e=t}});var t=150;Object.defineProperty(this,"width",{get:function(){return t},set:function(e){t=isNaN(e)||!1===Number.isInteger(e)||e<0?150:e,this.getContext("2d").pageWrapXEnabled&&(this.getContext("2d").pageWrapX=t+1)}});var r=300;Object.defineProperty(this,"height",{get:function(){return r},set:function(e){r=isNaN(e)||!1===Number.isInteger(e)||e<0?300:e,this.getContext("2d").pageWrapYEnabled&&(this.getContext("2d").pageWrapY=r+1)}});var i=[];Object.defineProperty(this,"childNodes",{get:function(){return i},set:function(e){i=e}});var n={};Object.defineProperty(this,"style",{get:function(){return n},set:function(e){n=e}}),Object.defineProperty(this,"parentNode",{})};t.prototype.getContext=function(e,t){var r;if("2d"!==(e=e||"2d"))return null;for(r in t)this.pdf.context2d.hasOwnProperty(r)&&(this.pdf.context2d[r]=t[r]);return this.pdf.context2d._canvas=this,this.pdf.context2d},t.prototype.toDataURL=function(){throw new Error("toDataURL is not implemented.")},e.events.push(["initialized",function(){this.canvas=new t,this.canvas.pdf=this}])}(ZM.API),function(e){var t={left:0,top:0,bottom:0,right:0},r=!1,i=function(){void 0===this.internal.__cell__&&(this.internal.__cell__={},this.internal.__cell__.padding=3,this.internal.__cell__.headerFunction=void 0,this.internal.__cell__.margins=Object.assign({},t),this.internal.__cell__.margins.width=this.getPageWidth(),n.call(this))},n=function(){this.internal.__cell__.lastCell=new a,this.internal.__cell__.pages=1},a=function(){var e=arguments[0];Object.defineProperty(this,"x",{enumerable:!0,get:function(){return e},set:function(t){e=t}});var t=arguments[1];Object.defineProperty(this,"y",{enumerable:!0,get:function(){return t},set:function(e){t=e}});var r=arguments[2];Object.defineProperty(this,"width",{enumerable:!0,get:function(){return r},set:function(e){r=e}});var i=arguments[3];Object.defineProperty(this,"height",{enumerable:!0,get:function(){return i},set:function(e){i=e}});var n=arguments[4];Object.defineProperty(this,"text",{enumerable:!0,get:function(){return n},set:function(e){n=e}});var a=arguments[5];Object.defineProperty(this,"lineNumber",{enumerable:!0,get:function(){return a},set:function(e){a=e}});var s=arguments[6];return Object.defineProperty(this,"align",{enumerable:!0,get:function(){return s},set:function(e){s=e}}),this};a.prototype.clone=function(){return new a(this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align)},a.prototype.toArray=function(){return[this.x,this.y,this.width,this.height,this.text,this.lineNumber,this.align]},e.setHeaderFunction=function(e){return i.call(this),this.internal.__cell__.headerFunction="function"==typeof e?e:void 0,this},e.getTextDimensions=function(e,t){i.call(this);var r=(t=t||{}).fontSize||this.getFontSize(),n=t.font||this.getFont(),a=t.scaleFactor||this.internal.scaleFactor,s=0,o=0,l=0,h=this;if(!Array.isArray(e)&&"string"!=typeof e){if("number"!=typeof e)throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");e=String(e)}var A=t.maxWidth;A>0?"string"==typeof e?e=this.splitTextToSize(e,A):"[object Array]"===Object.prototype.toString.call(e)&&(e=e.reduce((function(e,t){return e.concat(h.splitTextToSize(t,A))}),[])):e=Array.isArray(e)?e:[e];for(var u=0;u<e.length;u++)s<(l=this.getStringUnitWidth(e[u],{font:n})*r)&&(s=l);return 0!==s&&(o=e.length),{w:s/=a,h:Math.max((o*r*this.getLineHeightFactor()-r*(this.getLineHeightFactor()-1))/a,0)}},e.cellAddPage=function(){i.call(this),this.addPage();var e=this.internal.__cell__.margins||t;return this.internal.__cell__.lastCell=new a(e.left,e.top,void 0,void 0),this.internal.__cell__.pages+=1,this};var s=e.cell=function(){var e;e=arguments[0]instanceof a?arguments[0]:new a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]),i.call(this);var n=this.internal.__cell__.lastCell,s=this.internal.__cell__.padding,o=this.internal.__cell__.margins||t,l=this.internal.__cell__.tableHeaderRow,h=this.internal.__cell__.printHeaders;return void 0!==n.lineNumber&&(n.lineNumber===e.lineNumber?(e.x=(n.x||0)+(n.width||0),e.y=n.y||0):n.y+n.height+e.height+o.bottom>this.getPageHeight()?(this.cellAddPage(),e.y=o.top,h&&l&&(this.printHeaderRow(e.lineNumber,!0),e.y+=l[0].height)):e.y=n.y+n.height||e.y),void 0!==e.text[0]&&(this.rect(e.x,e.y,e.width,e.height,!0===r?"FD":void 0),"right"===e.align?this.text(e.text,e.x+e.width-s,e.y+s,{align:"right",baseline:"top"}):"center"===e.align?this.text(e.text,e.x+e.width/2,e.y+s,{align:"center",baseline:"top",maxWidth:e.width-s-s}):this.text(e.text,e.x+s,e.y+s,{align:"left",baseline:"top",maxWidth:e.width-s-s})),this.internal.__cell__.lastCell=e,this};e.table=function(e,r,l,h,A){if(i.call(this),!l)throw new Error("No data for PDF table.");var u,c,d,p,f=[],g=[],m=[],y={},_={},v=[],w=[],b=(A=A||{}).autoSize||!1,x=!1!==A.printHeaders,B=A.css&&void 0!==A.css["font-size"]?16*A.css["font-size"]:A.fontSize||12,C=A.margins||Object.assign({width:this.getPageWidth()},t),S="number"==typeof A.padding?A.padding:3,E=A.headerBackgroundColor||"#c8c8c8",I=A.headerTextColor||"#000";if(n.call(this),this.internal.__cell__.printHeaders=x,this.internal.__cell__.margins=C,this.internal.__cell__.table_font_size=B,this.internal.__cell__.padding=S,this.internal.__cell__.headerBackgroundColor=E,this.internal.__cell__.headerTextColor=I,this.setFontSize(B),null==h)g=f=Object.keys(l[0]),m=f.map((function(){return"left"}));else if(Array.isArray(h)&&"object"===LP(h[0]))for(f=h.map((function(e){return e.name})),g=h.map((function(e){return e.prompt||e.name||""})),m=h.map((function(e){return e.align||"left"})),u=0;u<h.length;u+=1)_[h[u].name]=.7499990551181103*h[u].width;else Array.isArray(h)&&"string"==typeof h[0]&&(g=f=h,m=f.map((function(){return"left"})));if(b||Array.isArray(h)&&"string"==typeof h[0])for(u=0;u<f.length;u+=1){for(y[p=f[u]]=l.map((function(e){return e[p]})),this.setFont(void 0,"bold"),v.push(this.getTextDimensions(g[u],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w),c=y[p],this.setFont(void 0,"normal"),d=0;d<c.length;d+=1)v.push(this.getTextDimensions(c[d],{fontSize:this.internal.__cell__.table_font_size,scaleFactor:this.internal.scaleFactor}).w);_[p]=Math.max.apply(null,v)+S+S,v=[]}if(x){var T={};for(u=0;u<f.length;u+=1)T[f[u]]={},T[f[u]].text=g[u],T[f[u]].align=m[u];var F=o.call(this,T,_);w=f.map((function(t){return new a(e,r,_[t],F,T[t].text,void 0,T[t].align)})),this.setTableHeaderRow(w),this.printHeaderRow(1,!1)}var P=h.reduce((function(e,t){return e[t.name]=t.align,e}),{});for(u=0;u<l.length;u+=1){"rowStart"in A&&A.rowStart instanceof Function&&A.rowStart({row:u,data:l[u]},this);var L=o.call(this,l[u],_);for(d=0;d<f.length;d+=1){var M=l[u][f[d]];"cellStart"in A&&A.cellStart instanceof Function&&A.cellStart({row:u,col:d,data:M},this),s.call(this,new a(e,r,_[f[d]],L,M,u+2,P[f[d]]))}}return this.internal.__cell__.table_x=e,this.internal.__cell__.table_y=r,this};var o=function(e,t){var r=this.internal.__cell__.padding,i=this.internal.__cell__.table_font_size,n=this.internal.scaleFactor;return Object.keys(e).map((function(i){var n=e[i];return this.splitTextToSize(n.hasOwnProperty("text")?n.text:n,t[i]-r-r)}),this).map((function(e){return this.getLineHeightFactor()*e.length*i/n+r+r}),this).reduce((function(e,t){return Math.max(e,t)}),0)};e.setTableHeaderRow=function(e){i.call(this),this.internal.__cell__.tableHeaderRow=e},e.printHeaderRow=function(e,t){if(i.call(this),!this.internal.__cell__.tableHeaderRow)throw new Error("Property tableHeaderRow does not exist.");var n;if(r=!0,"function"==typeof this.internal.__cell__.headerFunction){var o=this.internal.__cell__.headerFunction(this,this.internal.__cell__.pages);this.internal.__cell__.lastCell=new a(o[0],o[1],o[2],o[3],void 0,-1)}this.setFont(void 0,"bold");for(var l=[],h=0;h<this.internal.__cell__.tableHeaderRow.length;h+=1){n=this.internal.__cell__.tableHeaderRow[h].clone(),t&&(n.y=this.internal.__cell__.margins.top||0,l.push(n)),n.lineNumber=e;var A=this.getTextColor();this.setTextColor(this.internal.__cell__.headerTextColor),this.setFillColor(this.internal.__cell__.headerBackgroundColor),s.call(this,n),this.setTextColor(A)}l.length>0&&this.setTableHeaderRow(l),this.setFont(void 0,"normal"),r=!1}}(ZM.API);var Rk={italic:["italic","oblique","normal"],oblique:["oblique","italic","normal"],normal:["normal","oblique","italic"]},Dk=["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded"],Nk=Uk(Dk),Ok=[100,200,300,400,500,600,700,800,900],Qk=Uk(Ok);function zk(e){var t,r=e.family.replace(/"|'/g,"").toLowerCase(),i=(t=e.style,Rk[t=t||"normal"]?t:"normal"),n=function(e){return e?"number"==typeof e?e>=100&&e<=900&&e%100==0?e:400:/^\d00$/.test(e)?parseInt(e):"bold"===e?700:400:400}(e.weight),a=function(e){return"number"==typeof Nk[e=e||"normal"]?e:"normal"}(e.stretch);return{family:r,style:i,weight:n,stretch:a,src:e.src||[],ref:e.ref||{name:r,style:[a,i,n].join(" ")}}}function Hk(e,t,r,i){var n;for(n=r;n>=0&&n<t.length;n+=i)if(e[t[n]])return e[t[n]];for(n=r;n>=0&&n<t.length;n-=i)if(e[t[n]])return e[t[n]]}var jk={"sans-serif":"helvetica",fixed:"courier",monospace:"courier",terminal:"courier",cursive:"times",fantasy:"times",serif:"times"},Vk={caption:"times",icon:"times",menu:"times","message-box":"times","small-caption":"times","status-bar":"times"};function Gk(e){return[e.stretch,e.style,e.weight,e.family].join(" ")}function Kk(e){return e.trimLeft()}function qk(e,t){for(var r=0;r<e.length;){if(e.charAt(r)===t)return[e.substring(0,r),e.substring(r+1)];r+=1}return null}function Zk(e){var t=e.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);return null===t?null:[t[0],e.substring(t[0].length)]}var Wk,$k,Xk,Yk,Jk,eU,tU,rU,iU=["times"];function nU(e,t,r,i,n){var a=4,s=oU;switch(n){case ZM.API.image_compression.FAST:a=1,s=sU;break;case ZM.API.image_compression.MEDIUM:a=6,s=lU;break;case ZM.API.image_compression.SLOW:a=9,s=hU}var o=dL(e=function(e,t,r,i){for(var n,a=e.length/t,s=new Uint8Array(e.length+a),o=[aU,sU,oU,lU,hU],l=0;l<a;l+=1){var h=l*t,A=e.subarray(h,h+t);if(i)s.set(i(A,r,n),h+l);else{for(var u=o.length,c=[],d=0;d<u;d+=1)c[d]=o[d](A,r,n);var p=uU(c.concat());s.set(c[p],h+l)}n=A}return s}(e,t,Math.ceil(r*i/8),s),{level:a});return ZM.API.__addimage__.arrayBufferToBinaryString(o)}function aU(e){var t=Array.apply([],e);return t.unshift(0),t}function sU(e,t){var r=e.length,i=[];i[0]=1;for(var n=0;n<r;n+=1){var a=e[n-t]||0;i[n+1]=e[n]-a+256&255}return i}function oU(e,t,r){var i=e.length,n=[];n[0]=2;for(var a=0;a<i;a+=1){var s=r&&r[a]||0;n[a+1]=e[a]-s+256&255}return n}function lU(e,t,r){var i=e.length,n=[];n[0]=3;for(var a=0;a<i;a+=1){var s=e[a-t]||0,o=r&&r[a]||0;n[a+1]=e[a]+256-(s+o>>>1)&255}return n}function hU(e,t,r){var i=e.length,n=[];n[0]=4;for(var a=0;a<i;a+=1){var s=AU(e[a-t]||0,r&&r[a]||0,r&&r[a-t]||0);n[a+1]=e[a]-s+256&255}return n}function AU(e,t,r){if(e===t&&t===r)return e;var i=Math.abs(t-r),n=Math.abs(e-r),a=Math.abs(e+t-r-r);return i<=n&&i<=a?e:n<=a?t:r}function uU(e){var t=e.map((function(e){return e.reduce((function(e,t){return e+Math.abs(t)}),0)}));return t.indexOf(Math.min.apply(null,t))}function cU(e,t,r){var i=t*r,n=Math.floor(i/8),a=16-(i-8*n+r),s=(1<<r)-1;return pU(e,n)>>a&s}function dU(e,t,r,i){var n=r*i,a=Math.floor(n/8),s=16-(n-8*a+i),o=(1<<i)-1,l=(t&o)<<s;!function(e,t,r){if(t+1<e.byteLength)e.setUint16(t,r,!1);else{var i=r>>8&255;e.setUint8(t,i)}}(e,a,pU(e,a)&~(o<<s)&65535|l)}function pU(e,t){return t+1<e.byteLength?e.getUint16(t,!1):e.getUint8(t)<<8}function fU(e){var t=0;if(71!==e[t++]||73!==e[t++]||70!==e[t++]||56!==e[t++]||56!=(e[t++]+1&253)||97!==e[t++])throw new Error("Invalid GIF 87a/89a header.");var r=e[t++]|e[t++]<<8,i=e[t++]|e[t++]<<8,n=e[t++],a=n>>7,s=1<<1+(7&n);e[t++],e[t++];var o=null,l=null;a&&(o=t,l=s,t+=3*s);var h=!0,A=[],u=0,c=null,d=0,p=null;for(this.width=r,this.height=i;h&&t<e.length;)switch(e[t++]){case 33:switch(e[t++]){case 255:if(11!==e[t]||78==e[t+1]&&69==e[t+2]&&84==e[t+3]&&83==e[t+4]&&67==e[t+5]&&65==e[t+6]&&80==e[t+7]&&69==e[t+8]&&50==e[t+9]&&46==e[t+10]&&48==e[t+11]&&3==e[t+12]&&1==e[t+13]&&0==e[t+16])t+=14,p=e[t++]|e[t++]<<8,t++;else for(t+=12;;){if(!((E=e[t++])>=0))throw Error("Invalid block size");if(0===E)break;t+=E}break;case 249:if(4!==e[t++]||0!==e[t+4])throw new Error("Invalid graphics extension block.");var f=e[t++];u=e[t++]|e[t++]<<8,c=e[t++],1&f||(c=null),d=f>>2&7,t++;break;case 254:for(;;){if(!((E=e[t++])>=0))throw Error("Invalid block size");if(0===E)break;t+=E}break;default:throw new Error("Unknown graphic control label: 0x"+e[t-1].toString(16))}break;case 44:var g=e[t++]|e[t++]<<8,m=e[t++]|e[t++]<<8,y=e[t++]|e[t++]<<8,_=e[t++]|e[t++]<<8,v=e[t++],w=v>>6&1,b=1<<1+(7&v),x=o,B=l,C=!1;v>>7&&(C=!0,x=t,B=b,t+=3*b);var S=t;for(t++;;){var E;if(!((E=e[t++])>=0))throw Error("Invalid block size");if(0===E)break;t+=E}A.push({x:g,y:m,width:y,height:_,has_local_palette:C,palette_offset:x,palette_size:B,data_offset:S,data_length:t-S,transparent_index:c,interlaced:!!w,delay:u,disposal:d});break;case 59:h=!1;break;default:throw new Error("Unknown gif block: 0x"+e[t-1].toString(16))}this.numFrames=function(){return A.length},this.loopCount=function(){return p},this.frameInfo=function(e){if(e<0||e>=A.length)throw new Error("Frame index out of range.");return A[e]},this.decodeAndBlitFrameBGRA=function(t,i){var n=this.frameInfo(t),a=n.width*n.height,s=new Uint8Array(a);gU(e,n.data_offset,s,a);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,A=r-h,u=h,c=4*(n.y*r+n.x),d=4*((n.y+n.height)*r+n.x),p=c,f=4*A;!0===n.interlaced&&(f+=4*r*7);for(var g=8,m=0,y=s.length;m<y;++m){var _=s[m];if(0===u&&(u=h,(p+=f)>=d&&(f=4*A+4*r*(g-1),p=c+(h+A)*(g<<1),g>>=1)),_===l)p+=4;else{var v=e[o+3*_],w=e[o+3*_+1],b=e[o+3*_+2];i[p++]=b,i[p++]=w,i[p++]=v,i[p++]=255}--u}},this.decodeAndBlitFrameRGBA=function(t,i){var n=this.frameInfo(t),a=n.width*n.height,s=new Uint8Array(a);gU(e,n.data_offset,s,a);var o=n.palette_offset,l=n.transparent_index;null===l&&(l=256);var h=n.width,A=r-h,u=h,c=4*(n.y*r+n.x),d=4*((n.y+n.height)*r+n.x),p=c,f=4*A;!0===n.interlaced&&(f+=4*r*7);for(var g=8,m=0,y=s.length;m<y;++m){var _=s[m];if(0===u&&(u=h,(p+=f)>=d&&(f=4*A+4*r*(g-1),p=c+(h+A)*(g<<1),g>>=1)),_===l)p+=4;else{var v=e[o+3*_],w=e[o+3*_+1],b=e[o+3*_+2];i[p++]=v,i[p++]=w,i[p++]=b,i[p++]=255}--u}}}function gU(e,t,r,i){for(var n=e[t++],a=1<<n,s=a+1,o=s+1,l=n+1,h=(1<<l)-1,A=0,u=0,c=0,d=e[t++],p=new Int32Array(4096),f=null;;){for(;A<16&&0!==d;)u|=e[t++]<<A,A+=8,1===d?d=e[t++]:--d;if(A<l)break;var g=u&h;if(u>>=l,A-=l,g!==a){if(g===s)break;for(var m=g<o?g:f,y=0,_=m;_>a;)_=p[_]>>8,++y;var v=_;if(c+y+(m!==g?1:0)>i)return void mM.log("Warning, gif stream longer than expected.");r[c++]=v;var w=c+=y;for(m!==g&&(r[c++]=v),_=m;y--;)_=p[_],r[--w]=255&_,_>>=8;null!==f&&o<4096&&(p[o++]=f<<8|v,o>=h+1&&l<12&&(++l,h=h<<1|1)),f=g}else o=s+1,h=(1<<(l=n+1))-1,f=null}return c!==i&&mM.log("Warning, gif stream shorter than expected."),r}function mU(e){var t,r,i,n,a,s=Math.floor,o=new Array(64),l=new Array(64),h=new Array(64),A=new Array(64),u=new Array(65535),c=new Array(65535),d=new Array(64),p=new Array(64),f=[],g=0,m=7,y=new Array(64),_=new Array(64),v=new Array(64),w=new Array(256),b=new Array(2048),x=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],B=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],C=[0,1,2,3,4,5,6,7,8,9,10,11],S=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],E=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],I=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],T=[0,1,2,3,4,5,6,7,8,9,10,11],F=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],P=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function L(e,t){for(var r=0,i=0,n=new Array,a=1;a<=16;a++){for(var s=1;s<=e[a];s++)n[t[i]]=[],n[t[i]][0]=r,n[t[i]][1]=a,i++,r++;r*=2}return n}function M(e){for(var t=e[0],r=e[1]-1;r>=0;)t&1<<r&&(g|=1<<m),r--,--m<0&&(255==g?(k(255),k(0)):k(g),m=7,g=0)}function k(e){f.push(e)}function U(e){k(e>>8&255),k(255&e)}function R(e,t,r,i,n){for(var a,s=n[0],o=n[240],l=function(e,t){var r,i,n,a,s,o,l,h,A,u,c=0;for(A=0;A<8;++A){r=e[c],i=e[c+1],n=e[c+2],a=e[c+3],s=e[c+4],o=e[c+5],l=e[c+6];var p=r+(h=e[c+7]),f=r-h,g=i+l,m=i-l,y=n+o,_=n-o,v=a+s,w=a-s,b=p+v,x=p-v,B=g+y,C=g-y;e[c]=b+B,e[c+4]=b-B;var S=.707106781*(C+x);e[c+2]=x+S,e[c+6]=x-S;var E=.382683433*((b=w+_)-(C=m+f)),I=.5411961*b+E,T=1.306562965*C+E,F=.707106781*(B=_+m),P=f+F,L=f-F;e[c+5]=L+I,e[c+3]=L-I,e[c+1]=P+T,e[c+7]=P-T,c+=8}for(c=0,A=0;A<8;++A){r=e[c],i=e[c+8],n=e[c+16],a=e[c+24],s=e[c+32],o=e[c+40],l=e[c+48];var M=r+(h=e[c+56]),k=r-h,U=i+l,R=i-l,D=n+o,N=n-o,O=a+s,Q=a-s,z=M+O,H=M-O,j=U+D,V=U-D;e[c]=z+j,e[c+32]=z-j;var G=.707106781*(V+H);e[c+16]=H+G,e[c+48]=H-G;var K=.382683433*((z=Q+N)-(V=R+k)),q=.5411961*z+K,Z=1.306562965*V+K,W=.707106781*(j=N+R),$=k+W,X=k-W;e[c+40]=X+q,e[c+24]=X-q,e[c+8]=$+Z,e[c+56]=$-Z,c++}for(A=0;A<64;++A)u=e[A]*t[A],d[A]=u>0?u+.5|0:u-.5|0;return d}(e,t),h=0;h<64;++h)p[x[h]]=l[h];var A=p[0]-r;r=p[0],0==A?M(i[0]):(M(i[c[a=32767+A]]),M(u[a]));for(var f=63;f>0&&0==p[f];)f--;if(0==f)return M(s),r;for(var g,m=1;m<=f;){for(var y=m;0==p[m]&&m<=f;)++m;var _=m-y;if(_>=16){g=_>>4;for(var v=1;v<=g;++v)M(o);_&=15}a=32767+p[m],M(n[(_<<4)+c[a]]),M(u[a]),m++}return 63!=f&&M(s),r}function D(e){e=Math.min(Math.max(e,1),100),a!=e&&(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],r=0;r<64;r++){var i=s((t[r]*e+50)/100);i=Math.min(Math.max(i,1),255),o[x[r]]=i}for(var n=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var u=s((n[a]*e+50)/100);u=Math.min(Math.max(u,1),255),l[x[a]]=u}for(var c=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],d=0,p=0;p<8;p++)for(var f=0;f<8;f++)h[d]=1/(o[x[d]]*c[p]*c[f]*8),A[d]=1/(l[x[d]]*c[p]*c[f]*8),d++}(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e)}this.encode=function(e,a){var s,u;a&&D(a),f=new Array,g=0,m=7,U(65496),U(65504),U(16),k(74),k(70),k(73),k(70),k(0),k(1),k(1),k(0),U(1),U(1),k(0),k(0),function(){U(65499),U(132),k(0);for(var e=0;e<64;e++)k(o[e]);k(1);for(var t=0;t<64;t++)k(l[t])}(),s=e.width,u=e.height,U(65472),U(17),k(8),U(u),U(s),k(3),k(1),k(17),k(0),k(2),k(17),k(1),k(3),k(17),k(1),function(){U(65476),U(418),k(0);for(var e=0;e<16;e++)k(B[e+1]);for(var t=0;t<=11;t++)k(C[t]);k(16);for(var r=0;r<16;r++)k(S[r+1]);for(var i=0;i<=161;i++)k(E[i]);k(1);for(var n=0;n<16;n++)k(I[n+1]);for(var a=0;a<=11;a++)k(T[a]);k(17);for(var s=0;s<16;s++)k(F[s+1]);for(var o=0;o<=161;o++)k(P[o])}(),U(65498),U(12),k(3),k(1),k(0),k(2),k(17),k(3),k(17),k(0),k(63),k(0);var c=0,d=0,p=0;g=0,m=7,this.encode.displayName="_encode_";for(var w,x,L,N,O,Q,z,H,j,V=e.data,G=e.width,K=e.height,q=4*G,Z=0;Z<K;){for(w=0;w<q;){for(O=q*Z+w,z=-1,H=0,j=0;j<64;j++)Q=O+(H=j>>3)*q+(z=4*(7&j)),Z+H>=K&&(Q-=q*(Z+1+H-K)),w+z>=q&&(Q-=w+z-q+4),x=V[Q++],L=V[Q++],N=V[Q++],y[j]=(b[x]+b[L+256|0]+b[N+512|0]>>16)-128,_[j]=(b[x+768|0]+b[L+1024|0]+b[N+1280|0]>>16)-128,v[j]=(b[x+1280|0]+b[L+1536|0]+b[N+1792|0]>>16)-128;c=R(y,h,c,t,i),d=R(_,A,d,r,n),p=R(v,A,p,r,n),w+=32}Z+=8}if(m>=0){var W=[];W[1]=m+1,W[0]=(1<<m+1)-1,M(W)}return U(65497),new Uint8Array(f)},e=e||50,function(){for(var e=String.fromCharCode,t=0;t<256;t++)w[t]=e(t)}(),t=L(B,C),r=L(I,T),i=L(S,E),n=L(F,P),function(){for(var e=1,t=2,r=1;r<=15;r++){for(var i=e;i<t;i++)c[32767+i]=r,u[32767+i]=[],u[32767+i][1]=r,u[32767+i][0]=i;for(var n=-(t-1);n<=-e;n++)c[32767+n]=r,u[32767+n]=[],u[32767+n][1]=r,u[32767+n][0]=t-1+n;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)b[e]=19595*e,b[e+256|0]=38470*e,b[e+512|0]=7471*e+32768,b[e+768|0]=-11059*e,b[e+1024|0]=-21709*e,b[e+1280|0]=32768*e+8421375,b[e+1536|0]=-27439*e,b[e+1792|0]=-5329*e}(),D(e)}function yU(e,t){if(this.pos=0,this.buffer=e,this.datav=new DataView(e.buffer),this.is_with_alpha=!!t,this.bottom_up=!0,this.flag=String.fromCharCode(this.buffer[0])+String.fromCharCode(this.buffer[1]),this.pos+=2,-1===["BM","BA","CI","CP","IC","PT"].indexOf(this.flag))throw new Error("Invalid BMP File");this.parseHeader(),this.parseBGR()}function _U(e){function t(e){if(!e)throw Error("assert :P")}function r(e,t,r){for(var i=0;4>i;i++)if(e[t+i]!=r.charCodeAt(i))return!0;return!1}function i(e,t,r,i,n){for(var a=0;a<n;a++)e[t+a]=r[i+a]}function n(e,t,r,i){for(var n=0;n<i;n++)e[t+n]=r}function a(e){return new Int32Array(e)}function s(e,t){for(var r=[],i=0;i<e;i++)r.push(new t);return r}function o(e,t){var r=[];return function e(r,i,n){for(var a=n[i],s=0;s<a&&(r.push(n.length>i+1?[]:new t),!(n.length<i+1));s++)e(r[s],i+1,n)}(r,0,e),r}var l=function(){var e=this;function l(e,t){for(var r=1<<t-1>>>0;e&r;)r>>>=1;return r?(e&r-1)+r:e}function h(e,r,i,n,a){t(!(n%i));do{e[r+(n-=i)]=a}while(0<n)}function A(e,r,i,n,s){if(t(2328>=s),512>=s)var o=a(512);else if(null==(o=a(s)))return 0;return function(e,r,i,n,s,o){var A,c,d=r,p=1<<i,f=a(16),g=a(16);for(t(0!=s),t(null!=n),t(null!=e),t(0<i),c=0;c<s;++c){if(15<n[c])return 0;++f[n[c]]}if(f[0]==s)return 0;for(g[1]=0,A=1;15>A;++A){if(f[A]>1<<A)return 0;g[A+1]=g[A]+f[A]}for(c=0;c<s;++c)A=n[c],0<n[c]&&(o[g[A]++]=c);if(1==g[15])return(n=new u).g=0,n.value=o[0],h(e,d,1,p,n),p;var m,y=-1,_=p-1,v=0,w=1,b=1,x=1<<i;for(c=0,A=1,s=2;A<=i;++A,s<<=1){if(w+=b<<=1,0>(b-=f[A]))return 0;for(;0<f[A];--f[A])(n=new u).g=A,n.value=o[c++],h(e,d+v,s,x,n),v=l(v,A)}for(A=i+1,s=2;15>=A;++A,s<<=1){if(w+=b<<=1,0>(b-=f[A]))return 0;for(;0<f[A];--f[A]){if(n=new u,(v&_)!=y){for(d+=x,m=1<<(y=A)-i;15>y&&!(0>=(m-=f[y]));)++y,m<<=1;p+=x=1<<(m=y-i),e[r+(y=v&_)].g=m+i,e[r+y].value=d-r-y}n.g=A-i,n.value=o[c++],h(e,d+(v>>i),s,x,n),v=l(v,A)}}return w!=2*g[15]-1?0:p}(e,r,i,n,s,o)}function u(){this.value=this.g=0}function c(){this.value=this.g=0}function d(){this.G=s(5,u),this.H=a(5),this.jc=this.Qb=this.qb=this.nd=0,this.pd=s(Dr,c)}function p(e,r,i,n){t(null!=e),t(null!=r),t(2147483648>n),e.Ca=254,e.I=0,e.b=-8,e.Ka=0,e.oa=r,e.pa=i,e.Jd=r,e.Yc=i+n,e.Zc=4<=n?i+n-4+1:i,S(e)}function f(e,t){for(var r=0;0<t--;)r|=I(e,128)<<t;return r}function g(e,t){var r=f(e,t);return E(e)?-r:r}function m(e,r,i,n){var a,s=0;for(t(null!=e),t(null!=r),t(4294967288>n),e.Sb=n,e.Ra=0,e.u=0,e.h=0,4<n&&(n=4),a=0;a<n;++a)s+=r[i+a]<<8*a;e.Ra=s,e.bb=n,e.oa=r,e.pa=i}function y(e){for(;8<=e.u&&e.bb<e.Sb;)e.Ra>>>=8,e.Ra+=e.oa[e.pa+e.bb]<<Qr-8>>>0,++e.bb,e.u-=8;x(e)&&(e.h=1,e.u=0)}function _(e,r){if(t(0<=r),!e.h&&r<=Or){var i=b(e)&Nr[r];return e.u+=r,y(e),i}return e.h=1,e.u=0}function v(){this.b=this.Ca=this.I=0,this.oa=[],this.pa=0,this.Jd=[],this.Yc=0,this.Zc=[],this.Ka=0}function w(){this.Ra=0,this.oa=[],this.h=this.u=this.bb=this.Sb=this.pa=0}function b(e){return e.Ra>>>(e.u&Qr-1)>>>0}function x(e){return t(e.bb<=e.Sb),e.h||e.bb==e.Sb&&e.u>Qr}function B(e,t){e.u=t,e.h=x(e)}function C(e){e.u>=zr&&(t(e.u>=zr),y(e))}function S(e){t(null!=e&&null!=e.oa),e.pa<e.Zc?(e.I=(e.oa[e.pa++]|e.I<<8)>>>0,e.b+=8):(t(null!=e&&null!=e.oa),e.pa<e.Yc?(e.b+=8,e.I=e.oa[e.pa++]|e.I<<8):e.Ka?e.b=0:(e.I<<=8,e.b+=8,e.Ka=1))}function E(e){return f(e,1)}function I(e,t){var r=e.Ca;0>e.b&&S(e);var i=e.b,n=r*t>>>8,a=(e.I>>>i>n)+0;for(a?(r-=n,e.I-=n+1<<i>>>0):r=n+1,i=r,n=0;256<=i;)n+=8,i>>=8;return i=7^n+Hr[i],e.b-=i,e.Ca=(r<<i)-1,a}function T(e,t,r){e[t+0]=r>>24&255,e[t+1]=r>>16&255,e[t+2]=r>>8&255,e[t+3]=255&r}function F(e,t){return e[t+0]|e[t+1]<<8}function P(e,t){return F(e,t)|e[t+2]<<16}function L(e,t){return F(e,t)|F(e,t+2)<<16}function M(e,r){var i=1<<r;return t(null!=e),t(0<r),e.X=a(i),null==e.X?0:(e.Mb=32-r,e.Xa=r,1)}function k(e,r){t(null!=e),t(null!=r),t(e.Xa==r.Xa),i(r.X,0,e.X,0,1<<r.Xa)}function U(){this.X=[],this.Xa=this.Mb=0}function R(e,r,i,n){t(null!=i),t(null!=n);var a=i[0],s=n[0];return 0==a&&(a=(e*s+r/2)/r),0==s&&(s=(r*a+e/2)/e),0>=a||0>=s?0:(i[0]=a,n[0]=s,1)}function D(e,t){return e+(1<<t)-1>>>t}function N(e,t){return((4278255360&e)+(4278255360&t)>>>0&4278255360)+((16711935&e)+(16711935&t)>>>0&16711935)>>>0}function O(t,r){e[r]=function(r,i,n,a,s,o,l){var h;for(h=0;h<s;++h){var A=e[t](o[l+h-1],n,a+h);o[l+h]=N(r[i+h],A)}}}function Q(){this.ud=this.hd=this.jd=0}function z(e,t){return((4278124286&(e^t))>>>1)+(e&t)>>>0}function H(e){return 0<=e&&256>e?e:0>e?0:255<e?255:void 0}function j(e,t){return H(e+(e-t+.5>>1))}function V(e,t,r){return Math.abs(t-r)-Math.abs(e-r)}function G(e,t,r,i,n,a,s){for(i=a[s-1],r=0;r<n;++r)a[s+r]=i=N(e[t+r],i)}function K(e,t,r,i,n){var a;for(a=0;a<r;++a){var s=e[t+a],o=s>>8&255,l=16711935&(l=(l=16711935&s)+((o<<16)+o));i[n+a]=(4278255360&s)+l>>>0}}function q(e,t){t.jd=255&e,t.hd=e>>8&255,t.ud=e>>16&255}function Z(e,t,r,i,n,a){var s;for(s=0;s<i;++s){var o=t[r+s],l=o>>>8,h=o,A=255&(A=(A=o>>>16)+((e.jd<<24>>24)*(l<<24>>24)>>>5));h=255&(h=(h+=(e.hd<<24>>24)*(l<<24>>24)>>>5)+((e.ud<<24>>24)*(A<<24>>24)>>>5)),n[a+s]=(4278255360&o)+(A<<16)+h}}function W(t,r,i,n,a){e[r]=function(e,t,r,i,s,o,l,h,A){for(i=l;i<h;++i)for(l=0;l<A;++l)s[o++]=a(r[n(e[t++])])},e[t]=function(t,r,s,o,l,h,A){var u=8>>t.b,c=t.Ea,d=t.K[0],p=t.w;if(8>u)for(t=(1<<t.b)-1,p=(1<<u)-1;r<s;++r){var f,g=0;for(f=0;f<c;++f)f&t||(g=n(o[l++])),h[A++]=a(d[g&p]),g>>=u}else e["VP8LMapColor"+i](o,l,d,p,h,A,r,s,c)}}function $(e,t,r,i,n){for(r=t+r;t<r;){var a=e[t++];i[n++]=a>>16&255,i[n++]=a>>8&255,i[n++]=255&a}}function X(e,t,r,i,n){for(r=t+r;t<r;){var a=e[t++];i[n++]=a>>16&255,i[n++]=a>>8&255,i[n++]=255&a,i[n++]=a>>24&255}}function Y(e,t,r,i,n){for(r=t+r;t<r;){var a=(s=e[t++])>>16&240|s>>12&15,s=240&s|s>>28&15;i[n++]=a,i[n++]=s}}function J(e,t,r,i,n){for(r=t+r;t<r;){var a=(s=e[t++])>>16&248|s>>13&7,s=s>>5&224|s>>3&31;i[n++]=a,i[n++]=s}}function ee(e,t,r,i,n){for(r=t+r;t<r;){var a=e[t++];i[n++]=255&a,i[n++]=a>>8&255,i[n++]=a>>16&255}}function te(e,t,r,n,a,s){if(0==s)for(r=t+r;t<r;)T(n,((s=e[t++])[0]>>24|s[1]>>8&65280|s[2]<<8&16711680|s[3]<<24)>>>0),a+=32;else i(n,a,e,t,r)}function re(t,r){e[r][0]=e[t+"0"],e[r][1]=e[t+"1"],e[r][2]=e[t+"2"],e[r][3]=e[t+"3"],e[r][4]=e[t+"4"],e[r][5]=e[t+"5"],e[r][6]=e[t+"6"],e[r][7]=e[t+"7"],e[r][8]=e[t+"8"],e[r][9]=e[t+"9"],e[r][10]=e[t+"10"],e[r][11]=e[t+"11"],e[r][12]=e[t+"12"],e[r][13]=e[t+"13"],e[r][14]=e[t+"0"],e[r][15]=e[t+"0"]}function ie(e){return e==zi||e==Hi||e==ji||e==Vi}function ne(){this.eb=[],this.size=this.A=this.fb=0}function ae(){this.y=[],this.f=[],this.ea=[],this.F=[],this.Tc=this.Ed=this.Cd=this.Fd=this.lb=this.Db=this.Ab=this.fa=this.J=this.W=this.N=this.O=0}function se(){this.Rd=this.height=this.width=this.S=0,this.f={},this.f.RGBA=new ne,this.f.kb=new ae,this.sd=null}function oe(){this.width=[0],this.height=[0],this.Pd=[0],this.Qd=[0],this.format=[0]}function le(){this.Id=this.fd=this.Md=this.hb=this.ib=this.da=this.bd=this.cd=this.j=this.v=this.Da=this.Sd=this.ob=0}function he(e){return alert("todo:WebPSamplerProcessPlane"),e.T}function Ae(e,t){var r=e.T,n=t.ba.f.RGBA,a=n.eb,s=n.fb+e.ka*n.A,o=gn[t.ba.S],l=e.y,h=e.O,A=e.f,u=e.N,c=e.ea,d=e.W,p=t.cc,f=t.dc,g=t.Mc,m=t.Nc,y=e.ka,_=e.ka+e.T,v=e.U,w=v+1>>1;for(0==y?o(l,h,null,null,A,u,c,d,A,u,c,d,a,s,null,null,v):(o(t.ec,t.fc,l,h,p,f,g,m,A,u,c,d,a,s-n.A,a,s,v),++r);y+2<_;y+=2)p=A,f=u,g=c,m=d,u+=e.Rc,d+=e.Rc,s+=2*n.A,o(l,(h+=2*e.fa)-e.fa,l,h,p,f,g,m,A,u,c,d,a,s-n.A,a,s,v);return h+=e.fa,e.j+_<e.o?(i(t.ec,t.fc,l,h,v),i(t.cc,t.dc,A,u,w),i(t.Mc,t.Nc,c,d,w),r--):1&_||o(l,h,null,null,A,u,c,d,A,u,c,d,a,s+n.A,null,null,v),r}function ue(e,r,i){var n=e.F,a=[e.J];if(null!=n){var s=e.U,o=r.ba.S,l=o==Ni||o==ji;r=r.ba.f.RGBA;var h=[0],A=e.ka;h[0]=e.T,e.Kb&&(0==A?--h[0]:(--A,a[0]-=e.width),e.j+e.ka+e.T==e.o&&(h[0]=e.o-e.j-A));var u=r.eb;A=r.fb+A*r.A,e=xi(n,a[0],e.width,s,h,u,A+(l?0:3),r.A),t(i==h),e&&ie(o)&&wi(u,A,l,s,h,r.A)}return 0}function ce(e){var t=e.ma,r=t.ba.S,i=11>r,n=r==Ui||r==Di||r==Ni||r==Oi||12==r||ie(r);if(t.memory=null,t.Ib=null,t.Jb=null,t.Nd=null,!kr(t.Oa,e,n?11:12))return 0;if(n&&ie(r)&&gr(),e.da)alert("todo:use_scaling");else{if(i){if(t.Ib=he,e.Kb){if(r=e.U+1>>1,t.memory=a(e.U+2*r),null==t.memory)return 0;t.ec=t.memory,t.fc=0,t.cc=t.ec,t.dc=t.fc+e.U,t.Mc=t.cc,t.Nc=t.dc+r,t.Ib=Ae,gr()}}else alert("todo:EmitYUV");n&&(t.Jb=ue,i&&pr())}if(i&&!Fn){for(e=0;256>e;++e)Pn[e]=89858*(e-128)+Cn>>Bn,kn[e]=-22014*(e-128)+Cn,Mn[e]=-45773*(e-128),Ln[e]=113618*(e-128)+Cn>>Bn;for(e=Sn;e<En;++e)t=76283*(e-16)+Cn>>Bn,Un[e-Sn]=Ir(t,255),Rn[e-Sn]=Ir(t+8>>4,15);Fn=1}return 1}function de(e){var r=e.ma,i=e.U,n=e.T;return t(!(1&e.ka)),0>=i||0>=n?0:(i=r.Ib(e,r),null!=r.Jb&&r.Jb(e,r,i),r.Dc+=i,1)}function pe(e){e.ma.memory=null}function fe(e,t,r,i){return 47!=_(e,8)?0:(t[0]=_(e,14)+1,r[0]=_(e,14)+1,i[0]=_(e,1),0!=_(e,3)?0:!e.h)}function ge(e,t){if(4>e)return e+1;var r=e-2>>1;return(2+(1&e)<<r)+_(t,r)+1}function me(e,t){return 120<t?t-120:1<=(r=((r=$i[t-1])>>4)*e+(8-(15&r)))?r:1;var r}function ye(e,t,r){var i=b(r),n=e[t+=255&i].g-8;return 0<n&&(B(r,r.u+8),i=b(r),t+=e[t].value,t+=i&(1<<n)-1),B(r,r.u+e[t].g),e[t].value}function _e(e,r,i){return i.g+=e.g,i.value+=e.value<<r>>>0,t(8>=i.g),e.g}function ve(e,r,i){var n=e.xc;return t((r=0==n?0:e.vc[e.md*(i>>n)+(r>>n)])<e.Wb),e.Ya[r]}function we(e,r,n,a){var s=e.ab,o=e.c*r,l=e.C;r=l+r;var h=n,A=a;for(a=e.Ta,n=e.Ua;0<s--;){var u=e.gc[s],c=l,d=r,p=h,f=A,g=(A=a,h=n,u.Ea);switch(t(c<d),t(d<=u.nc),u.hc){case 2:Gr(p,f,(d-c)*g,A,h);break;case 0:var m=c,y=d,_=A,v=h,w=(S=u).Ea;0==m&&(jr(p,f,null,null,1,_,v),G(p,f+1,0,0,w-1,_,v+1),f+=w,v+=w,++m);for(var b=1<<S.b,x=b-1,B=D(w,S.b),C=S.K,S=S.w+(m>>S.b)*B;m<y;){var E=C,I=S,T=1;for(Vr(p,f,_,v-w,1,_,v);T<w;){var F=(T&~x)+b;F>w&&(F=w),(0,$r[E[I++]>>8&15])(p,f+ +T,_,v+T-w,F-T,_,v+T),T=F}f+=w,v+=w,++m&x||(S+=B)}d!=u.nc&&i(A,h-g,A,h+(d-c-1)*g,g);break;case 1:for(g=p,y=f,w=(p=u.Ea)-(v=p&~(_=(f=1<<u.b)-1)),m=D(p,u.b),b=u.K,u=u.w+(c>>u.b)*m;c<d;){for(x=b,B=u,C=new Q,S=y+v,E=y+p;y<S;)q(x[B++],C),Xr(C,g,y,f,A,h),y+=f,h+=f;y<E&&(q(x[B++],C),Xr(C,g,y,w,A,h),y+=w,h+=w),++c&_||(u+=m)}break;case 3:if(p==A&&f==h&&0<u.b){for(y=A,p=g=h+(d-c)*g-(v=(d-c)*D(u.Ea,u.b)),f=A,_=h,m=[],v=(w=v)-1;0<=v;--v)m[v]=f[_+v];for(v=w-1;0<=v;--v)y[p+v]=m[v];Kr(u,c,d,A,g,A,h)}else Kr(u,c,d,p,f,A,h)}h=a,A=n}A!=n&&i(a,n,h,A,o)}function be(e,r){var i=e.V,n=e.Ba+e.c*e.C,a=r-e.C;if(t(r<=e.l.o),t(16>=a),0<a){var s=e.l,o=e.Ta,l=e.Ua,h=s.width;if(we(e,a,i,n),a=l=[l],t((i=e.C)<(n=r)),t(s.v<s.va),n>s.o&&(n=s.o),i<s.j){var A=s.j-i;i=s.j,a[0]+=A*h}if(i>=n?i=0:(a[0]+=4*s.v,s.ka=i-s.j,s.U=s.va-s.v,s.T=n-i,i=1),i){if(l=l[0],11>(i=e.ca).S){var u=i.f.RGBA,c=(n=i.S,a=s.U,s=s.T,A=u.eb,u.A),d=s;for(u=u.fb+e.Ma*u.A;0<d--;){var p=o,f=l,g=a,m=A,y=u;switch(n){case ki:Yr(p,f,g,m,y);break;case Ui:Jr(p,f,g,m,y);break;case zi:Jr(p,f,g,m,y),wi(m,y,0,g,1,0);break;case Ri:ri(p,f,g,m,y);break;case Di:te(p,f,g,m,y,1);break;case Hi:te(p,f,g,m,y,1),wi(m,y,0,g,1,0);break;case Ni:te(p,f,g,m,y,0);break;case ji:te(p,f,g,m,y,0),wi(m,y,1,g,1,0);break;case Oi:ei(p,f,g,m,y);break;case Vi:ei(p,f,g,m,y),bi(m,y,g,1,0);break;case Qi:ti(p,f,g,m,y);break;default:t(0)}l+=h,u+=c}e.Ma+=s}else alert("todo:EmitRescaledRowsYUVA");t(e.Ma<=i.height)}}e.C=r,t(e.C<=e.i)}function xe(e){var t;if(0<e.ua)return 0;for(t=0;t<e.Wb;++t){var r=e.Ya[t].G,i=e.Ya[t].H;if(0<r[1][i[1]+0].g||0<r[2][i[2]+0].g||0<r[3][i[3]+0].g)return 0}return 1}function Be(e,r,i,n,a,s){if(0!=e.Z){var o=e.qd,l=e.rd;for(t(null!=fn[e.Z]);r<i;++r)fn[e.Z](o,l,n,a,n,a,s),o=n,l=a,a+=s;e.qd=o,e.rd=l}}function Ce(e,r){var i=e.l.ma,n=0==i.Z||1==i.Z?e.l.j:e.C;if(n=e.C<n?n:e.C,t(r<=e.l.o),r>n){var a=e.l.width,s=i.ca,o=i.tb+a*n,l=e.V,h=e.Ba+e.c*n,A=e.gc;t(1==e.ab),t(3==A[0].hc),Zr(A[0],n,r,l,h,s,o),Be(i,n,r,s,o,a)}e.C=e.Ma=r}function Se(e,r,i,n,a,s,o){var l=e.$/n,h=e.$%n,A=e.m,u=e.s,c=i+e.$,d=c;a=i+n*a;var p=i+n*s,f=280+u.ua,g=e.Pb?l:16777216,m=0<u.ua?u.Wa:null,y=u.wc,_=c<p?ve(u,h,l):null;t(e.C<s),t(p<=a);var v=!1;e:for(;;){for(;v||c<p;){var w=0;if(l>=g){var S=c-i;t((g=e).Pb),g.wd=g.m,g.xd=S,0<g.s.ua&&k(g.s.Wa,g.s.vb),g=l+Yi}if(h&y||(_=ve(u,h,l)),t(null!=_),_.Qb&&(r[c]=_.qb,v=!0),!v)if(C(A),_.jc){w=A,S=r;var E=c,I=_.pd[b(w)&Dr-1];t(_.jc),256>I.g?(B(w,w.u+I.g),S[E]=I.value,w=0):(B(w,w.u+I.g-256),t(256<=I.value),w=I.value),0==w&&(v=!0)}else w=ye(_.G[0],_.H[0],A);if(A.h)break;if(v||256>w){if(!v)if(_.nd)r[c]=(_.qb|w<<8)>>>0;else{if(C(A),v=ye(_.G[1],_.H[1],A),C(A),S=ye(_.G[2],_.H[2],A),E=ye(_.G[3],_.H[3],A),A.h)break;r[c]=(E<<24|v<<16|w<<8|S)>>>0}if(v=!1,++c,++h>=n&&(h=0,++l,null!=o&&l<=s&&!(l%16)&&o(e,l),null!=m))for(;d<c;)w=r[d++],m.X[(506832829*w&4294967295)>>>m.Mb]=w}else if(280>w){if(w=ge(w-256,A),S=ye(_.G[4],_.H[4],A),C(A),S=me(n,S=ge(S,A)),A.h)break;if(c-i<S||a-c<w)break e;for(E=0;E<w;++E)r[c+E]=r[c+E-S];for(c+=w,h+=w;h>=n;)h-=n,++l,null!=o&&l<=s&&!(l%16)&&o(e,l);if(t(c<=a),h&y&&(_=ve(u,h,l)),null!=m)for(;d<c;)w=r[d++],m.X[(506832829*w&4294967295)>>>m.Mb]=w}else{if(!(w<f))break e;for(v=w-280,t(null!=m);d<c;)w=r[d++],m.X[(506832829*w&4294967295)>>>m.Mb]=w;w=c,t(!(v>>>(S=m).Xa)),r[w]=S.X[v],v=!0}v||t(A.h==x(A))}if(e.Pb&&A.h&&c<a)t(e.m.h),e.a=5,e.m=e.wd,e.$=e.xd,0<e.s.ua&&k(e.s.vb,e.s.Wa);else{if(A.h)break e;o?.(e,l>s?s:l),e.a=0,e.$=c-i}return 1}return e.a=3,0}function Ee(e){t(null!=e),e.vc=null,e.yc=null,e.Ya=null;var r=e.Wa;null!=r&&(r.X=null),e.vb=null,t(null!=e)}function Ie(){var t=new nr;return null==t?null:(t.a=0,t.xb=pn,re("Predictor","VP8LPredictors"),re("Predictor","VP8LPredictors_C"),re("PredictorAdd","VP8LPredictorsAdd"),re("PredictorAdd","VP8LPredictorsAdd_C"),Gr=K,Xr=Z,Yr=$,Jr=X,ei=Y,ti=J,ri=ee,e.VP8LMapColor32b=qr,e.VP8LMapColor8b=Wr,t)}function Te(e,r,i,o,l){var h=1,c=[e],p=[r],f=o.m,g=o.s,m=null,y=0;e:for(;;){if(i)for(;h&&_(f,1);){var v=c,w=p,x=o,S=1,E=x.m,I=x.gc[x.ab],T=_(E,2);if(x.Oc&1<<T)h=0;else{switch(x.Oc|=1<<T,I.hc=T,I.Ea=v[0],I.nc=w[0],I.K=[null],++x.ab,t(4>=x.ab),T){case 0:case 1:I.b=_(E,3)+2,S=Te(D(I.Ea,I.b),D(I.nc,I.b),0,x,I.K),I.K=I.K[0];break;case 3:var F,P=_(E,8)+1,L=16<P?0:4<P?1:2<P?2:3;if(v[0]=D(I.Ea,L),I.b=L,F=S=Te(P,1,0,x,I.K)){var k,U=P,R=I,O=1<<(8>>R.b),Q=a(O);if(null==Q)F=0;else{var z=R.K[0],H=R.w;for(Q[0]=R.K[0][0],k=1;k<1*U;++k)Q[k]=N(z[H+k],Q[k-1]);for(;k<4*O;++k)Q[k]=0;R.K[0]=null,R.K[0]=Q,F=1}}S=F;break;case 2:break;default:t(0)}h=S}}if(c=c[0],p=p[0],h&&_(f,1)&&!(h=1<=(y=_(f,4))&&11>=y)){o.a=3;break e}var j;if(j=h)t:{var V,G,K,q=o,Z=c,W=p,$=y,X=i,Y=q.m,J=q.s,ee=[null],te=1,re=0,ie=Xi[$];r:for(;;){if(X&&_(Y,1)){var ne=_(Y,3)+2,ae=D(Z,ne),se=D(W,ne),oe=ae*se;if(!Te(ae,se,0,q,ee))break r;for(ee=ee[0],J.xc=ne,V=0;V<oe;++V){var le=ee[V]>>8&65535;ee[V]=le,le>=te&&(te=le+1)}}if(Y.h)break r;for(G=0;5>G;++G){var he=qi[G];!G&&0<$&&(he+=1<<$),re<he&&(re=he)}var Ae=s(te*ie,u),ue=te,ce=s(ue,d);if(null==ce)var de=null;else t(65536>=ue),de=ce;var pe=a(re);if(null==de||null==pe||null==Ae){q.a=1;break r}var fe=Ae;for(V=K=0;V<te;++V){var ge=de[V],me=ge.G,ye=ge.H,ve=0,we=1,be=0;for(G=0;5>G;++G){he=qi[G],me[G]=fe,ye[G]=K,!G&&0<$&&(he+=1<<$);i:{var xe,Be=he,Ce=q,Ie=pe,Fe=fe,Pe=K,Le=0,Me=Ce.m,ke=_(Me,1);if(n(Ie,0,0,Be),ke){var Ue=_(Me,1)+1,Re=_(Me,1),De=_(Me,0==Re?1:8);Ie[De]=1,2==Ue&&(Ie[De=_(Me,8)]=1);var Ne=1}else{var Oe=a(19),Qe=_(Me,4)+4;if(19<Qe){Ce.a=3;var ze=0;break i}for(xe=0;xe<Qe;++xe)Oe[Wi[xe]]=_(Me,3);var He=void 0,je=void 0,Ve=Ce,Ge=Oe,Ke=Be,qe=Ie,Ze=0,We=Ve.m,$e=8,Xe=s(128,u);n:for(;A(Xe,0,7,Ge,19);){if(_(We,1)){var Ye=2+2*_(We,3);if((He=2+_(We,Ye))>Ke)break n}else He=Ke;for(je=0;je<Ke&&He--;){C(We);var Je=Xe[0+(127&b(We))];B(We,We.u+Je.g);var et=Je.value;if(16>et)qe[je++]=et,0!=et&&($e=et);else{var tt=16==et,rt=et-16,it=Ki[rt],nt=_(We,Gi[rt])+it;if(je+nt>Ke)break n;for(var at=tt?$e:0;0<nt--;)qe[je++]=at}}Ze=1;break n}Ze||(Ve.a=3),Ne=Ze}(Ne=Ne&&!Me.h)&&(Le=A(Fe,Pe,8,Ie,Be)),Ne&&0!=Le?ze=Le:(Ce.a=3,ze=0)}if(0==ze)break r;if(we&&1==Zi[G]&&(we=0==fe[K].g),ve+=fe[K].g,K+=ze,3>=G){var st,ot=pe[0];for(st=1;st<he;++st)pe[st]>ot&&(ot=pe[st]);be+=ot}}if(ge.nd=we,ge.Qb=0,we&&(ge.qb=(me[3][ye[3]+0].value<<24|me[1][ye[1]+0].value<<16|me[2][ye[2]+0].value)>>>0,0==ve&&256>me[0][ye[0]+0].value&&(ge.Qb=1,ge.qb+=me[0][ye[0]+0].value<<8)),ge.jc=!ge.Qb&&6>be,ge.jc){var lt,ht=ge;for(lt=0;lt<Dr;++lt){var At=lt,ut=ht.pd[At],ct=ht.G[0][ht.H[0]+At];256<=ct.value?(ut.g=ct.g+256,ut.value=ct.value):(ut.g=0,ut.value=0,At>>=_e(ct,8,ut),At>>=_e(ht.G[1][ht.H[1]+At],16,ut),At>>=_e(ht.G[2][ht.H[2]+At],0,ut),_e(ht.G[3][ht.H[3]+At],24,ut))}}}J.vc=ee,J.Wb=te,J.Ya=de,J.yc=Ae,j=1;break t}j=0}if(!(h=j)){o.a=3;break e}if(0<y){if(g.ua=1<<y,!M(g.Wa,y)){o.a=1,h=0;break e}}else g.ua=0;var dt=o,pt=c,ft=p,gt=dt.s,mt=gt.xc;if(dt.c=pt,dt.i=ft,gt.md=D(pt,mt),gt.wc=0==mt?-1:(1<<mt)-1,i){o.xb=dn;break e}if(null==(m=a(c*p))){o.a=1,h=0;break e}h=(h=Se(o,m,0,c,p,p,null))&&!f.h;break e}return h?(null!=l?l[0]=m:(t(null==m),t(i)),o.$=0,i||Ee(g)):Ee(g),h}function Fe(e,r){var i=e.c*e.i,n=i+r+16*r;return t(e.c<=r),e.V=a(n),null==e.V?(e.Ta=null,e.Ua=0,e.a=1,0):(e.Ta=e.V,e.Ua=e.Ba+i+r,1)}function Pe(e,r){var i=e.C,n=r-i,a=e.V,s=e.Ba+e.c*i;for(t(r<=e.l.o);0<n;){var o=16<n?16:n,l=e.l.ma,h=e.l.width,A=h*o,u=l.ca,c=l.tb+h*i,d=e.Ta,p=e.Ua;we(e,o,a,s),Bi(d,p,u,c,A),Be(l,i,i+o,u,c,h),n-=o,a+=o*e.c,i+=o}t(i==r),e.C=e.Ma=r}function Le(){this.ub=this.yd=this.td=this.Rb=0}function Me(){this.Kd=this.Ld=this.Ud=this.Td=this.i=this.c=0}function ke(){this.Fb=this.Bb=this.Cb=0,this.Zb=a(4),this.Lb=a(4)}function Ue(){var e;this.Yb=(function e(t,r,i){for(var n=i[r],a=0;a<n&&(t.push(i.length>r+1?[]:0),!(i.length<r+1));a++)e(t[a],r+1,i)}(e=[],0,[3,11]),e)}function Re(){this.jb=a(3),this.Wc=o([4,8],Ue),this.Xc=o([4,17],Ue)}function De(){this.Pc=this.wb=this.Tb=this.zd=0,this.vd=new a(4),this.od=new a(4)}function Ne(){this.ld=this.La=this.dd=this.tc=0}function Oe(){this.Na=this.la=0}function Qe(){this.Sc=[0,0],this.Eb=[0,0],this.Qc=[0,0],this.ia=this.lc=0}function ze(){this.ad=a(384),this.Za=0,this.Ob=a(16),this.$b=this.Ad=this.ia=this.Gc=this.Hc=this.Dd=0}function He(){this.uc=this.M=this.Nb=0,this.wa=Array(new Ne),this.Y=0,this.ya=Array(new ze),this.aa=0,this.l=new Ge}function je(){this.y=a(16),this.f=a(8),this.ea=a(8)}function Ve(){this.cb=this.a=0,this.sc="",this.m=new v,this.Od=new Le,this.Kc=new Me,this.ed=new De,this.Qa=new ke,this.Ic=this.$c=this.Aa=0,this.D=new He,this.Xb=this.Va=this.Hb=this.zb=this.yb=this.Ub=this.za=0,this.Jc=s(8,v),this.ia=0,this.pb=s(4,Qe),this.Pa=new Re,this.Bd=this.kc=0,this.Ac=[],this.Bc=0,this.zc=[0,0,0,0],this.Gd=Array(new je),this.Hd=0,this.rb=Array(new Oe),this.sb=0,this.wa=Array(new Ne),this.Y=0,this.oc=[],this.pc=0,this.sa=[],this.ta=0,this.qa=[],this.ra=0,this.Ha=[],this.B=this.R=this.Ia=0,this.Ec=[],this.M=this.ja=this.Vb=this.Fc=0,this.ya=Array(new ze),this.L=this.aa=0,this.gd=o([4,2],Ne),this.ga=null,this.Fa=[],this.Cc=this.qc=this.P=0,this.Gb=[],this.Uc=0,this.mb=[],this.nb=0,this.rc=[],this.Ga=this.Vc=0}function Ge(){this.T=this.U=this.ka=this.height=this.width=0,this.y=[],this.f=[],this.ea=[],this.Rc=this.fa=this.W=this.N=this.O=0,this.ma="void",this.put="VP8IoPutHook",this.ac="VP8IoSetupHook",this.bc="VP8IoTeardownHook",this.ha=this.Kb=0,this.data=[],this.hb=this.ib=this.da=this.o=this.j=this.va=this.v=this.Da=this.ob=this.w=0,this.F=[],this.J=0}function Ke(){var e=new Ve;return null!=e&&(e.a=0,e.sc="OK",e.cb=0,e.Xb=0,tn||(tn=$e)),e}function qe(e,t,r){return 0==e.a&&(e.a=t,e.sc=r,e.cb=0),0}function Ze(e,t,r){return 3<=r&&157==e[t+0]&&1==e[t+1]&&42==e[t+2]}function We(e,r){if(null==e)return 0;if(e.a=0,e.sc="OK",null==r)return qe(e,2,"null VP8Io passed to VP8GetHeaders()");var i=r.data,a=r.w,s=r.ha;if(4>s)return qe(e,7,"Truncated header.");var o=i[a+0]|i[a+1]<<8|i[a+2]<<16,l=e.Od;if(l.Rb=!(1&o),l.td=o>>1&7,l.yd=o>>4&1,l.ub=o>>5,3<l.td)return qe(e,3,"Incorrect keyframe parameters.");if(!l.yd)return qe(e,4,"Frame not displayable.");a+=3,s-=3;var h=e.Kc;if(l.Rb){if(7>s)return qe(e,7,"cannot parse picture header");if(!Ze(i,a,s))return qe(e,3,"Bad code word");h.c=16383&(i[a+4]<<8|i[a+3]),h.Td=i[a+4]>>6,h.i=16383&(i[a+6]<<8|i[a+5]),h.Ud=i[a+6]>>6,a+=7,s-=7,e.za=h.c+15>>4,e.Ub=h.i+15>>4,r.width=h.c,r.height=h.i,r.Da=0,r.j=0,r.v=0,r.va=r.width,r.o=r.height,r.da=0,r.ib=r.width,r.hb=r.height,r.U=r.width,r.T=r.height,n((o=e.Pa).jb,0,255,o.jb.length),t(null!=(o=e.Qa)),o.Cb=0,o.Bb=0,o.Fb=1,n(o.Zb,0,0,o.Zb.length),n(o.Lb,0,0,o.Lb)}if(l.ub>s)return qe(e,7,"bad partition length");p(o=e.m,i,a,l.ub),a+=l.ub,s-=l.ub,l.Rb&&(h.Ld=E(o),h.Kd=E(o)),h=e.Qa;var A,u=e.Pa;if(t(null!=o),t(null!=h),h.Cb=E(o),h.Cb){if(h.Bb=E(o),E(o)){for(h.Fb=E(o),A=0;4>A;++A)h.Zb[A]=E(o)?g(o,7):0;for(A=0;4>A;++A)h.Lb[A]=E(o)?g(o,6):0}if(h.Bb)for(A=0;3>A;++A)u.jb[A]=E(o)?f(o,8):255}else h.Bb=0;if(o.Ka)return qe(e,3,"cannot parse segment header");if((h=e.ed).zd=E(o),h.Tb=f(o,6),h.wb=f(o,3),h.Pc=E(o),h.Pc&&E(o)){for(u=0;4>u;++u)E(o)&&(h.vd[u]=g(o,6));for(u=0;4>u;++u)E(o)&&(h.od[u]=g(o,6))}if(e.L=0==h.Tb?0:h.zd?1:2,o.Ka)return qe(e,3,"cannot parse filter header");var c=s;if(s=A=a,a=A+c,h=c,e.Xb=(1<<f(e.m,2))-1,c<3*(u=e.Xb))i=7;else{for(A+=3*u,h-=3*u,c=0;c<u;++c){var d=i[s+0]|i[s+1]<<8|i[s+2]<<16;d>h&&(d=h),p(e.Jc[+c],i,A,d),A+=d,h-=d,s+=3}p(e.Jc[+u],i,A,h),i=A<a?0:5}if(0!=i)return qe(e,i,"cannot parse partitions");for(i=f(A=e.m,7),s=E(A)?g(A,4):0,a=E(A)?g(A,4):0,h=E(A)?g(A,4):0,u=E(A)?g(A,4):0,A=E(A)?g(A,4):0,c=e.Qa,d=0;4>d;++d){if(c.Cb){var m=c.Zb[d];c.Fb||(m+=i)}else{if(0<d){e.pb[d]=e.pb[0];continue}m=i}var y=e.pb[d];y.Sc[0]=Ji[Ir(m+s,127)],y.Sc[1]=en[Ir(m+0,127)],y.Eb[0]=2*Ji[Ir(m+a,127)],y.Eb[1]=101581*en[Ir(m+h,127)]>>16,8>y.Eb[1]&&(y.Eb[1]=8),y.Qc[0]=Ji[Ir(m+u,117)],y.Qc[1]=en[Ir(m+A,127)],y.lc=m+A}if(!l.Rb)return qe(e,4,"Not a key frame.");for(E(o),l=e.Pa,i=0;4>i;++i){for(s=0;8>s;++s)for(a=0;3>a;++a)for(h=0;11>h;++h)u=I(o,ln[i][s][a][h])?f(o,8):sn[i][s][a][h],l.Wc[i][s].Yb[a][h]=u;for(s=0;17>s;++s)l.Xc[i][s]=l.Wc[i][hn[s]]}return e.kc=E(o),e.kc&&(e.Bd=f(o,8)),e.cb=1}function $e(e,t,r,i,n,a,s){var o=t[n].Yb[r];for(r=0;16>n;++n){if(!I(e,o[r+0]))return n;for(;!I(e,o[r+1]);)if(o=t[++n].Yb[0],r=0,16==n)return 16;var l=t[n+1].Yb;if(I(e,o[r+2])){var h=e,A=0;if(I(h,(c=o)[(u=r)+3]))if(I(h,c[u+6])){for(o=0,u=2*(A=I(h,c[u+8]))+(c=I(h,c[u+9+A])),A=0,c=rn[u];c[o];++o)A+=A+I(h,c[o]);A+=3+(8<<u)}else I(h,c[u+7])?(A=7+2*I(h,165),A+=I(h,145)):A=5+I(h,159);else A=I(h,c[u+4])?3+I(h,c[u+5]):2;o=l[2]}else A=1,o=l[1];l=s+nn[n],0>(h=e).b&&S(h);var u,c=h.b,d=(u=h.Ca>>1)-(h.I>>c)>>31;--h.b,h.Ca+=d,h.Ca|=1,h.I-=(u+1&d)<<c,a[l]=((A^d)-d)*i[(0<n)+0]}return 16}function Xe(e){var t=e.rb[e.sb-1];t.la=0,t.Na=0,n(e.zc,0,0,e.zc.length),e.ja=0}function Ye(e,t,r,i,n){n=e[t+r+32*i]+(n>>3),e[t+r+32*i]=-256&n?0>n?0:255:n}function Je(e,t,r,i,n,a){Ye(e,t,0,r,i+n),Ye(e,t,1,r,i+a),Ye(e,t,2,r,i-a),Ye(e,t,3,r,i-n)}function et(e){return(20091*e>>16)+e}function tt(e,t,r,i){var n,s=0,o=a(16);for(n=0;4>n;++n){var l=e[t+0]+e[t+8],h=e[t+0]-e[t+8],A=(35468*e[t+4]>>16)-et(e[t+12]),u=et(e[t+4])+(35468*e[t+12]>>16);o[s+0]=l+u,o[s+1]=h+A,o[s+2]=h-A,o[s+3]=l-u,s+=4,t++}for(n=s=0;4>n;++n)l=(e=o[s+0]+4)+o[s+8],h=e-o[s+8],A=(35468*o[s+4]>>16)-et(o[s+12]),Ye(r,i,0,0,l+(u=et(o[s+4])+(35468*o[s+12]>>16))),Ye(r,i,1,0,h+A),Ye(r,i,2,0,h-A),Ye(r,i,3,0,l-u),s++,i+=32}function rt(e,t,r,i){var n=e[t+0]+4,a=35468*e[t+4]>>16,s=et(e[t+4]),o=35468*e[t+1]>>16;Je(r,i,0,n+s,e=et(e[t+1]),o),Je(r,i,1,n+a,e,o),Je(r,i,2,n-a,e,o),Je(r,i,3,n-s,e,o)}function it(e,t,r,i,n){tt(e,t,r,i),n&&tt(e,t+16,r,i+4)}function nt(e,t,r,i){ni(e,t+0,r,i,1),ni(e,t+32,r,i+128,1)}function at(e,t,r,i){var n;for(e=e[t+0]+4,n=0;4>n;++n)for(t=0;4>t;++t)Ye(r,i,t,n,e)}function st(e,t,r,i){e[t+0]&&oi(e,t+0,r,i),e[t+16]&&oi(e,t+16,r,i+4),e[t+32]&&oi(e,t+32,r,i+128),e[t+48]&&oi(e,t+48,r,i+128+4)}function ot(e,t,r,i){var n,s=a(16);for(n=0;4>n;++n){var o=e[t+0+n]+e[t+12+n],l=e[t+4+n]+e[t+8+n],h=e[t+4+n]-e[t+8+n],A=e[t+0+n]-e[t+12+n];s[0+n]=o+l,s[8+n]=o-l,s[4+n]=A+h,s[12+n]=A-h}for(n=0;4>n;++n)o=(e=s[0+4*n]+3)+s[3+4*n],l=s[1+4*n]+s[2+4*n],h=s[1+4*n]-s[2+4*n],A=e-s[3+4*n],r[i+0]=o+l>>3,r[i+16]=A+h>>3,r[i+32]=o-l>>3,r[i+48]=A-h>>3,i+=64}function lt(e,t,r){var i,n=t-32,a=Li,s=255-e[n-1];for(i=0;i<r;++i){var o,l=a,h=s+e[t-1];for(o=0;o<r;++o)e[t+o]=l[h+e[n+o]];t+=32}}function ht(e,t){lt(e,t,4)}function At(e,t){lt(e,t,8)}function ut(e,t){lt(e,t,16)}function ct(e,t){var r;for(r=0;16>r;++r)i(e,t+32*r,e,t-32,16)}function dt(e,t){var r;for(r=16;0<r;--r)n(e,t,e[t-1],16),t+=32}function pt(e,t,r){var i;for(i=0;16>i;++i)n(t,r+32*i,e,16)}function ft(e,t){var r,i=16;for(r=0;16>r;++r)i+=e[t-1+32*r]+e[t+r-32];pt(i>>5,e,t)}function gt(e,t){var r,i=8;for(r=0;16>r;++r)i+=e[t-1+32*r];pt(i>>4,e,t)}function mt(e,t){var r,i=8;for(r=0;16>r;++r)i+=e[t+r-32];pt(i>>4,e,t)}function yt(e,t){pt(128,e,t)}function _t(e,t,r){return e+2*t+r+2>>2}function vt(e,t){var r,n=t-32;for(n=new Uint8Array([_t(e[n-1],e[n+0],e[n+1]),_t(e[n+0],e[n+1],e[n+2]),_t(e[n+1],e[n+2],e[n+3]),_t(e[n+2],e[n+3],e[n+4])]),r=0;4>r;++r)i(e,t+32*r,n,0,n.length)}function wt(e,t){var r=e[t-1],i=e[t-1+32],n=e[t-1+64],a=e[t-1+96];T(e,t+0,16843009*_t(e[t-1-32],r,i)),T(e,t+32,16843009*_t(r,i,n)),T(e,t+64,16843009*_t(i,n,a)),T(e,t+96,16843009*_t(n,a,a))}function bt(e,t){var r,i=4;for(r=0;4>r;++r)i+=e[t+r-32]+e[t-1+32*r];for(i>>=3,r=0;4>r;++r)n(e,t+32*r,i,4)}function xt(e,t){var r=e[t-1+0],i=e[t-1+32],n=e[t-1+64],a=e[t-1-32],s=e[t+0-32],o=e[t+1-32],l=e[t+2-32],h=e[t+3-32];e[t+0+96]=_t(i,n,e[t-1+96]),e[t+1+96]=e[t+0+64]=_t(r,i,n),e[t+2+96]=e[t+1+64]=e[t+0+32]=_t(a,r,i),e[t+3+96]=e[t+2+64]=e[t+1+32]=e[t+0+0]=_t(s,a,r),e[t+3+64]=e[t+2+32]=e[t+1+0]=_t(o,s,a),e[t+3+32]=e[t+2+0]=_t(l,o,s),e[t+3+0]=_t(h,l,o)}function Bt(e,t){var r=e[t+1-32],i=e[t+2-32],n=e[t+3-32],a=e[t+4-32],s=e[t+5-32],o=e[t+6-32],l=e[t+7-32];e[t+0+0]=_t(e[t+0-32],r,i),e[t+1+0]=e[t+0+32]=_t(r,i,n),e[t+2+0]=e[t+1+32]=e[t+0+64]=_t(i,n,a),e[t+3+0]=e[t+2+32]=e[t+1+64]=e[t+0+96]=_t(n,a,s),e[t+3+32]=e[t+2+64]=e[t+1+96]=_t(a,s,o),e[t+3+64]=e[t+2+96]=_t(s,o,l),e[t+3+96]=_t(o,l,l)}function Ct(e,t){var r=e[t-1+0],i=e[t-1+32],n=e[t-1+64],a=e[t-1-32],s=e[t+0-32],o=e[t+1-32],l=e[t+2-32],h=e[t+3-32];e[t+0+0]=e[t+1+64]=a+s+1>>1,e[t+1+0]=e[t+2+64]=s+o+1>>1,e[t+2+0]=e[t+3+64]=o+l+1>>1,e[t+3+0]=l+h+1>>1,e[t+0+96]=_t(n,i,r),e[t+0+64]=_t(i,r,a),e[t+0+32]=e[t+1+96]=_t(r,a,s),e[t+1+32]=e[t+2+96]=_t(a,s,o),e[t+2+32]=e[t+3+96]=_t(s,o,l),e[t+3+32]=_t(o,l,h)}function St(e,t){var r=e[t+0-32],i=e[t+1-32],n=e[t+2-32],a=e[t+3-32],s=e[t+4-32],o=e[t+5-32],l=e[t+6-32],h=e[t+7-32];e[t+0+0]=r+i+1>>1,e[t+1+0]=e[t+0+64]=i+n+1>>1,e[t+2+0]=e[t+1+64]=n+a+1>>1,e[t+3+0]=e[t+2+64]=a+s+1>>1,e[t+0+32]=_t(r,i,n),e[t+1+32]=e[t+0+96]=_t(i,n,a),e[t+2+32]=e[t+1+96]=_t(n,a,s),e[t+3+32]=e[t+2+96]=_t(a,s,o),e[t+3+64]=_t(s,o,l),e[t+3+96]=_t(o,l,h)}function Et(e,t){var r=e[t-1+0],i=e[t-1+32],n=e[t-1+64],a=e[t-1+96];e[t+0+0]=r+i+1>>1,e[t+2+0]=e[t+0+32]=i+n+1>>1,e[t+2+32]=e[t+0+64]=n+a+1>>1,e[t+1+0]=_t(r,i,n),e[t+3+0]=e[t+1+32]=_t(i,n,a),e[t+3+32]=e[t+1+64]=_t(n,a,a),e[t+3+64]=e[t+2+64]=e[t+0+96]=e[t+1+96]=e[t+2+96]=e[t+3+96]=a}function It(e,t){var r=e[t-1+0],i=e[t-1+32],n=e[t-1+64],a=e[t-1+96],s=e[t-1-32],o=e[t+0-32],l=e[t+1-32],h=e[t+2-32];e[t+0+0]=e[t+2+32]=r+s+1>>1,e[t+0+32]=e[t+2+64]=i+r+1>>1,e[t+0+64]=e[t+2+96]=n+i+1>>1,e[t+0+96]=a+n+1>>1,e[t+3+0]=_t(o,l,h),e[t+2+0]=_t(s,o,l),e[t+1+0]=e[t+3+32]=_t(r,s,o),e[t+1+32]=e[t+3+64]=_t(i,r,s),e[t+1+64]=e[t+3+96]=_t(n,i,r),e[t+1+96]=_t(a,n,i)}function Tt(e,t){var r;for(r=0;8>r;++r)i(e,t+32*r,e,t-32,8)}function Ft(e,t){var r;for(r=0;8>r;++r)n(e,t,e[t-1],8),t+=32}function Pt(e,t,r){var i;for(i=0;8>i;++i)n(t,r+32*i,e,8)}function Lt(e,t){var r,i=8;for(r=0;8>r;++r)i+=e[t+r-32]+e[t-1+32*r];Pt(i>>4,e,t)}function Mt(e,t){var r,i=4;for(r=0;8>r;++r)i+=e[t+r-32];Pt(i>>3,e,t)}function kt(e,t){var r,i=4;for(r=0;8>r;++r)i+=e[t-1+32*r];Pt(i>>3,e,t)}function Ut(e,t){Pt(128,e,t)}function Rt(e,t,r){var i=e[t-r],n=e[t+0],a=3*(n-i)+Fi[1020+e[t-2*r]-e[t+r]],s=Pi[112+(a+4>>3)];e[t-r]=Li[255+i+Pi[112+(a+3>>3)]],e[t+0]=Li[255+n-s]}function Dt(e,t,r,i){var n=e[t+0],a=e[t+r];return Mi[255+e[t-2*r]-e[t-r]]>i||Mi[255+a-n]>i}function Nt(e,t,r,i){return 4*Mi[255+e[t-r]-e[t+0]]+Mi[255+e[t-2*r]-e[t+r]]<=i}function Ot(e,t,r,i,n){var a=e[t-3*r],s=e[t-2*r],o=e[t-r],l=e[t+0],h=e[t+r],A=e[t+2*r],u=e[t+3*r];return 4*Mi[255+o-l]+Mi[255+s-h]>i?0:Mi[255+e[t-4*r]-a]<=n&&Mi[255+a-s]<=n&&Mi[255+s-o]<=n&&Mi[255+u-A]<=n&&Mi[255+A-h]<=n&&Mi[255+h-l]<=n}function Qt(e,t,r,i){var n=2*i+1;for(i=0;16>i;++i)Nt(e,t+i,r,n)&&Rt(e,t+i,r)}function zt(e,t,r,i){var n=2*i+1;for(i=0;16>i;++i)Nt(e,t+i*r,1,n)&&Rt(e,t+i*r,1)}function Ht(e,t,r,i){var n;for(n=3;0<n;--n)Qt(e,t+=4*r,r,i)}function jt(e,t,r,i){var n;for(n=3;0<n;--n)zt(e,t+=4,r,i)}function Vt(e,t,r,i,n,a,s,o){for(a=2*a+1;0<n--;){if(Ot(e,t,r,a,s))if(Dt(e,t,r,o))Rt(e,t,r);else{var l=e,h=t,A=r,u=l[h-2*A],c=l[h-A],d=l[h+0],p=l[h+A],f=l[h+2*A],g=27*(y=Fi[1020+3*(d-c)+Fi[1020+u-p]])+63>>7,m=18*y+63>>7,y=9*y+63>>7;l[h-3*A]=Li[255+l[h-3*A]+y],l[h-2*A]=Li[255+u+m],l[h-A]=Li[255+c+g],l[h+0]=Li[255+d-g],l[h+A]=Li[255+p-m],l[h+2*A]=Li[255+f-y]}t+=i}}function Gt(e,t,r,i,n,a,s,o){for(a=2*a+1;0<n--;){if(Ot(e,t,r,a,s))if(Dt(e,t,r,o))Rt(e,t,r);else{var l=e,h=t,A=r,u=l[h-A],c=l[h+0],d=l[h+A],p=Pi[112+(4+(f=3*(c-u))>>3)],f=Pi[112+(f+3>>3)],g=p+1>>1;l[h-2*A]=Li[255+l[h-2*A]+g],l[h-A]=Li[255+u+f],l[h+0]=Li[255+c-p],l[h+A]=Li[255+d-g]}t+=i}}function Kt(e,t,r,i,n,a){Vt(e,t,r,1,16,i,n,a)}function qt(e,t,r,i,n,a){Vt(e,t,1,r,16,i,n,a)}function Zt(e,t,r,i,n,a){var s;for(s=3;0<s;--s)Gt(e,t+=4*r,r,1,16,i,n,a)}function Wt(e,t,r,i,n,a){var s;for(s=3;0<s;--s)Gt(e,t+=4,1,r,16,i,n,a)}function $t(e,t,r,i,n,a,s,o){Vt(e,t,n,1,8,a,s,o),Vt(r,i,n,1,8,a,s,o)}function Xt(e,t,r,i,n,a,s,o){Vt(e,t,1,n,8,a,s,o),Vt(r,i,1,n,8,a,s,o)}function Yt(e,t,r,i,n,a,s,o){Gt(e,t+4*n,n,1,8,a,s,o),Gt(r,i+4*n,n,1,8,a,s,o)}function Jt(e,t,r,i,n,a,s,o){Gt(e,t+4,1,n,8,a,s,o),Gt(r,i+4,1,n,8,a,s,o)}function er(){this.ba=new se,this.ec=[],this.cc=[],this.Mc=[],this.Dc=this.Nc=this.dc=this.fc=0,this.Oa=new le,this.memory=0,this.Ib="OutputFunc",this.Jb="OutputAlphaFunc",this.Nd="OutputRowFunc"}function tr(){this.data=[],this.offset=this.kd=this.ha=this.w=0,this.na=[],this.xa=this.gb=this.Ja=this.Sa=this.P=0}function rr(){this.nc=this.Ea=this.b=this.hc=0,this.K=[],this.w=0}function ir(){this.ua=0,this.Wa=new U,this.vb=new U,this.md=this.xc=this.wc=0,this.vc=[],this.Wb=0,this.Ya=new d,this.yc=new u}function nr(){this.xb=this.a=0,this.l=new Ge,this.ca=new se,this.V=[],this.Ba=0,this.Ta=[],this.Ua=0,this.m=new w,this.Pb=0,this.wd=new w,this.Ma=this.$=this.C=this.i=this.c=this.xd=0,this.s=new ir,this.ab=0,this.gc=s(4,rr),this.Oc=0}function ar(){this.Lc=this.Z=this.$a=this.i=this.c=0,this.l=new Ge,this.ic=0,this.ca=[],this.tb=0,this.qd=null,this.rd=0}function sr(e,t,r,i,n,a,s){for(e=null==e?0:e[t+0],t=0;t<s;++t)n[a+t]=e+r[i+t]&255,e=n[a+t]}function or(e,t,r,i,n,a,s){var o;if(null==e)sr(null,null,r,i,n,a,s);else for(o=0;o<s;++o)n[a+o]=e[t+o]+r[i+o]&255}function lr(e,t,r,i,n,a,s){if(null==e)sr(null,null,r,i,n,a,s);else{var o,l=e[t+0],h=l,A=l;for(o=0;o<s;++o)h=A+(l=e[t+o])-h,A=r[i+o]+(-256&h?0>h?0:255:h)&255,h=l,n[a+o]=A}}function hr(e,r,n,s){var o=r.width,l=r.o;if(t(null!=e&&null!=r),0>n||0>=s||n+s>l)return null;if(!e.Cc){if(null==e.ga){var h;if(e.ga=new ar,(h=null==e.ga)||(h=r.width*r.o,t(0==e.Gb.length),e.Gb=a(h),e.Uc=0,null==e.Gb?h=0:(e.mb=e.Gb,e.nb=e.Uc,e.rc=null,h=1),h=!h),!h){h=e.ga;var A=e.Fa,u=e.P,c=e.qc,d=e.mb,p=e.nb,f=u+1,g=c-1,y=h.l;if(t(null!=A&&null!=d&&null!=r),fn[0]=null,fn[1]=sr,fn[2]=or,fn[3]=lr,h.ca=d,h.tb=p,h.c=r.width,h.i=r.height,t(0<h.c&&0<h.i),1>=c)r=0;else if(h.$a=3&A[u+0],h.Z=A[u+0]>>2&3,h.Lc=A[u+0]>>4&3,u=A[u+0]>>6&3,0>h.$a||1<h.$a||4<=h.Z||1<h.Lc||u)r=0;else if(y.put=de,y.ac=ce,y.bc=pe,y.ma=h,y.width=r.width,y.height=r.height,y.Da=r.Da,y.v=r.v,y.va=r.va,y.j=r.j,y.o=r.o,h.$a)e:{t(1==h.$a),r=Ie();t:for(;;){if(null==r){r=0;break e}if(t(null!=h),h.mc=r,r.c=h.c,r.i=h.i,r.l=h.l,r.l.ma=h,r.l.width=h.c,r.l.height=h.i,r.a=0,m(r.m,A,f,g),!Te(h.c,h.i,1,r,null)||(1==r.ab&&3==r.gc[0].hc&&xe(r.s)?(h.ic=1,A=r.c*r.i,r.Ta=null,r.Ua=0,r.V=a(A),r.Ba=0,null==r.V?(r.a=1,r=0):r=1):(h.ic=0,r=Fe(r,h.c)),!r))break t;r=1;break e}h.mc=null,r=0}else r=g>=h.c*h.i;h=!r}if(h)return null;1!=e.ga.Lc?e.Ga=0:s=l-n}t(null!=e.ga),t(n+s<=l);e:{if(r=(A=e.ga).c,l=A.l.o,0==A.$a){if(f=e.rc,g=e.Vc,y=e.Fa,u=e.P+1+n*r,c=e.mb,d=e.nb+n*r,t(u<=e.P+e.qc),0!=A.Z)for(t(null!=fn[A.Z]),h=0;h<s;++h)fn[A.Z](f,g,y,u,c,d,r),f=c,g=d,d+=r,u+=r;else for(h=0;h<s;++h)i(c,d,y,u,r),f=c,g=d,d+=r,u+=r;e.rc=f,e.Vc=g}else{if(t(null!=A.mc),r=n+s,t(null!=(h=A.mc)),t(r<=h.i),h.C>=r)r=1;else if(A.ic||pr(),A.ic){A=h.V,f=h.Ba,g=h.c;var _=h.i,v=(y=1,u=h.$/g,c=h.$%g,d=h.m,p=h.s,h.$),w=g*_,b=g*r,B=p.wc,S=v<b?ve(p,c,u):null;t(v<=w),t(r<=_),t(xe(p));t:for(;;){for(;!d.h&&v<b;){if(c&B||(S=ve(p,c,u)),t(null!=S),C(d),256>(_=ye(S.G[0],S.H[0],d)))A[f+v]=_,++v,++c>=g&&(c=0,++u<=r&&!(u%16)&&Ce(h,u));else{if(!(280>_)){y=0;break t}_=ge(_-256,d);var E,I=ye(S.G[4],S.H[4],d);if(C(d),!(v>=(I=me(g,I=ge(I,d)))&&w-v>=_)){y=0;break t}for(E=0;E<_;++E)A[f+v+E]=A[f+v+E-I];for(v+=_,c+=_;c>=g;)c-=g,++u<=r&&!(u%16)&&Ce(h,u);v<b&&c&B&&(S=ve(p,c,u))}t(d.h==x(d))}Ce(h,u>r?r:u);break t}!y||d.h&&v<w?(y=0,h.a=d.h?5:3):h.$=v,r=y}else r=Se(h,h.V,h.Ba,h.c,h.i,r,Pe);if(!r){s=0;break e}}n+s>=l&&(e.Cc=1),s=1}if(!s)return null;if(e.Cc&&(null!=(s=e.ga)&&(s.mc=null),e.ga=null,0<e.Ga))return alert("todo:WebPDequantizeLevels"),null}return e.nb+n*o}function Ar(e,t,r,i,n,a){for(;0<n--;){var s,o=e,l=t+(r?1:0),h=e,A=t+(r?0:3);for(s=0;s<i;++s){var u=h[A+4*s];255!=u&&(u*=32897,o[l+4*s+0]=o[l+4*s+0]*u>>23,o[l+4*s+1]=o[l+4*s+1]*u>>23,o[l+4*s+2]=o[l+4*s+2]*u>>23)}t+=a}}function ur(e,t,r,i,n){for(;0<i--;){var a;for(a=0;a<r;++a){var s=e[t+2*a+0],o=15&(h=e[t+2*a+1]),l=4369*o,h=(240&h|h>>4)*l>>16;e[t+2*a+0]=(240&s|s>>4)*l>>16&240|(15&s|s<<4)*l>>16>>4&15,e[t+2*a+1]=240&h|o}t+=n}}function cr(e,t,r,i,n,a,s,o){var l,h,A=255;for(h=0;h<n;++h){for(l=0;l<i;++l){var u=e[t+l];a[s+4*l]=u,A&=u}t+=r,s+=o}return 255!=A}function dr(e,t,r,i,n){var a;for(a=0;a<n;++a)r[i+a]=e[t+a]>>8}function pr(){wi=Ar,bi=ur,xi=cr,Bi=dr}function fr(r,i,n){e[r]=function(e,r,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_){var v,w=_-1>>1,b=o[l+0]|h[A+0]<<16,x=u[c+0]|d[p+0]<<16;t(null!=e);var B=3*b+x+131074>>2;for(i(e[r+0],255&B,B>>16,f,g),null!=a&&(B=3*x+b+131074>>2,i(a[s+0],255&B,B>>16,m,y)),v=1;v<=w;++v){var C=o[l+v]|h[A+v]<<16,S=u[c+v]|d[p+v]<<16,E=b+C+x+S+524296,I=E+2*(C+x)>>3;B=I+b>>1,b=(E=E+2*(b+S)>>3)+C>>1,i(e[r+2*v-1],255&B,B>>16,f,g+(2*v-1)*n),i(e[r+2*v-0],255&b,b>>16,f,g+(2*v-0)*n),null!=a&&(B=E+x>>1,b=I+S>>1,i(a[s+2*v-1],255&B,B>>16,m,y+(2*v-1)*n),i(a[s+2*v+0],255&b,b>>16,m,y+(2*v+0)*n)),b=C,x=S}1&_||(B=3*b+x+131074>>2,i(e[r+_-1],255&B,B>>16,f,g+(_-1)*n),null!=a&&(B=3*x+b+131074>>2,i(a[s+_-1],255&B,B>>16,m,y+(_-1)*n)))}}function gr(){gn[ki]=mn,gn[Ui]=_n,gn[Ri]=yn,gn[Di]=vn,gn[Ni]=wn,gn[Oi]=bn,gn[Qi]=xn,gn[zi]=_n,gn[Hi]=vn,gn[ji]=wn,gn[Vi]=bn}function mr(e){return e&~Tn?0>e?0:255:e>>In}function yr(e,t){return mr((19077*e>>8)+(26149*t>>8)-14234)}function _r(e,t,r){return mr((19077*e>>8)-(6419*t>>8)-(13320*r>>8)+8708)}function vr(e,t){return mr((19077*e>>8)+(33050*t>>8)-17685)}function wr(e,t,r,i,n){i[n+0]=yr(e,r),i[n+1]=_r(e,t,r),i[n+2]=vr(e,t)}function br(e,t,r,i,n){i[n+0]=vr(e,t),i[n+1]=_r(e,t,r),i[n+2]=yr(e,r)}function xr(e,t,r,i,n){var a=_r(e,t,r);t=a<<3&224|vr(e,t)>>3,i[n+0]=248&yr(e,r)|a>>5,i[n+1]=t}function Br(e,t,r,i,n){var a=240&vr(e,t)|15;i[n+0]=240&yr(e,r)|_r(e,t,r)>>4,i[n+1]=a}function Cr(e,t,r,i,n){i[n+0]=255,wr(e,t,r,i,n+1)}function Sr(e,t,r,i,n){br(e,t,r,i,n),i[n+3]=255}function Er(e,t,r,i,n){wr(e,t,r,i,n),i[n+3]=255}function Ir(e,t){return 0>e?0:e>t?t:e}function Tr(t,r,i){e[t]=function(e,t,n,a,s,o,l,h,A){for(var u=h+(-2&A)*i;h!=u;)r(e[t+0],n[a+0],s[o+0],l,h),r(e[t+1],n[a+0],s[o+0],l,h+i),t+=2,++a,++o,h+=2*i;1&A&&r(e[t+0],n[a+0],s[o+0],l,h)}}function Fr(e,t,r){return 0==r?0==e?0==t?6:5:0==t?4:0:r}function Pr(e,t,r,i,n){switch(e>>>30){case 3:ni(t,r,i,n,0);break;case 2:ai(t,r,i,n);break;case 1:oi(t,r,i,n)}}function Lr(e,t){var r,a,s=t.M,o=t.Nb,l=e.oc,h=e.pc+40,A=e.oc,u=e.pc+584,c=e.oc,d=e.pc+600;for(r=0;16>r;++r)l[h+32*r-1]=129;for(r=0;8>r;++r)A[u+32*r-1]=129,c[d+32*r-1]=129;for(0<s?l[h-1-32]=A[u-1-32]=c[d-1-32]=129:(n(l,h-32-1,127,21),n(A,u-32-1,127,9),n(c,d-32-1,127,9)),a=0;a<e.za;++a){var p=t.ya[t.aa+a];if(0<a){for(r=-1;16>r;++r)i(l,h+32*r-4,l,h+32*r+12,4);for(r=-1;8>r;++r)i(A,u+32*r-4,A,u+32*r+4,4),i(c,d+32*r-4,c,d+32*r+4,4)}var f=e.Gd,g=e.Hd+a,m=p.ad,y=p.Hc;if(0<s&&(i(l,h-32,f[g].y,0,16),i(A,u-32,f[g].f,0,8),i(c,d-32,f[g].ea,0,8)),p.Za){var _=l,v=h-32+16;for(0<s&&(a>=e.za-1?n(_,v,f[g].y[15],4):i(_,v,f[g+1].y,0,4)),r=0;4>r;r++)_[v+128+r]=_[v+256+r]=_[v+384+r]=_[v+0+r];for(r=0;16>r;++r,y<<=2)_=l,v=h+Dn[r],un[p.Ob[r]](_,v),Pr(y,m,16*+r,_,v)}else if(_=Fr(a,s,p.Ob[0]),An[_](l,h),0!=y)for(r=0;16>r;++r,y<<=2)Pr(y,m,16*+r,l,h+Dn[r]);for(r=p.Gc,_=Fr(a,s,p.Dd),cn[_](A,u),cn[_](c,d),y=m,_=A,v=u,255&(p=0|r)&&(170&p?si(y,256,_,v):li(y,256,_,v)),p=c,y=d,255&(r>>=8)&&(170&r?si(m,320,p,y):li(m,320,p,y)),s<e.Ub-1&&(i(f[g].y,0,l,h+480,16),i(f[g].f,0,A,u+224,8),i(f[g].ea,0,c,d+224,8)),r=8*o*e.B,f=e.sa,g=e.ta+16*a+16*o*e.R,m=e.qa,p=e.ra+8*a+r,y=e.Ha,_=e.Ia+8*a+r,r=0;16>r;++r)i(f,g+r*e.R,l,h+32*r,16);for(r=0;8>r;++r)i(m,p+r*e.B,A,u+32*r,8),i(y,_+r*e.B,c,d+32*r,8)}}function Mr(e,i,n,a,s,o,l,h,A){var u=[0],c=[0],d=0,p=null!=A?A.kd:0,f=A??new tr;if(null==e||12>n)return 7;f.data=e,f.w=i,f.ha=n,i=[i],n=[n],f.gb=[f.gb];e:{var g=i,y=n,_=f.gb;if(t(null!=e),t(null!=y),t(null!=_),_[0]=0,12<=y[0]&&!r(e,g[0],"RIFF")){if(r(e,g[0]+8,"WEBP")){_=3;break e}var v=L(e,g[0]+4);if(12>v||4294967286<v){_=3;break e}if(p&&v>y[0]-8){_=7;break e}_[0]=v,g[0]+=12,y[0]-=12}_=0}if(0!=_)return _;for(v=0<f.gb[0],n=n[0];;){e:{var b=e;y=i,_=n;var x=u,B=c,C=g=[0];if((I=d=[d])[0]=0,8>_[0])_=7;else{if(!r(b,y[0],"VP8X")){if(10!=L(b,y[0]+4)){_=3;break e}if(18>_[0]){_=7;break e}var S=L(b,y[0]+8),E=1+P(b,y[0]+12);if(2147483648<=E*(b=1+P(b,y[0]+15))){_=3;break e}null!=C&&(C[0]=S),null!=x&&(x[0]=E),null!=B&&(B[0]=b),y[0]+=18,_[0]-=18,I[0]=1}_=0}}if(d=d[0],g=g[0],0!=_)return _;if(y=!!(2&g),!v&&d)return 3;if(null!=o&&(o[0]=!!(16&g)),null!=l&&(l[0]=y),null!=h&&(h[0]=0),l=u[0],g=c[0],d&&y&&null==A){_=0;break}if(4>n){_=7;break}if(v&&d||!v&&!d&&!r(e,i[0],"ALPH")){n=[n],f.na=[f.na],f.P=[f.P],f.Sa=[f.Sa];e:{S=e,_=i,v=n;var I=f.gb;x=f.na,B=f.P,C=f.Sa,E=22,t(null!=S),t(null!=v),b=_[0];var T=v[0];for(t(null!=x),t(null!=C),x[0]=null,B[0]=null,C[0]=0;;){if(_[0]=b,v[0]=T,8>T){_=7;break e}var F=L(S,b+4);if(4294967286<F){_=3;break e}var M=8+F+1&-2;if(E+=M,0<I&&E>I){_=3;break e}if(!r(S,b,"VP8 ")||!r(S,b,"VP8L")){_=0;break e}if(T[0]<M){_=7;break e}r(S,b,"ALPH")||(x[0]=S,B[0]=b+8,C[0]=F),b+=M,T-=M}}if(n=n[0],f.na=f.na[0],f.P=f.P[0],f.Sa=f.Sa[0],0!=_)break}n=[n],f.Ja=[f.Ja],f.xa=[f.xa];e:if(I=e,_=i,v=n,x=f.gb[0],B=f.Ja,C=f.xa,S=_[0],b=!r(I,S,"VP8 "),E=!r(I,S,"VP8L"),t(null!=I),t(null!=v),t(null!=B),t(null!=C),8>v[0])_=7;else{if(b||E){if(I=L(I,S+4),12<=x&&I>x-12){_=3;break e}if(p&&I>v[0]-8){_=7;break e}B[0]=I,_[0]+=8,v[0]-=8,C[0]=E}else C[0]=5<=v[0]&&47==I[S+0]&&!(I[S+4]>>5),B[0]=v[0];_=0}if(n=n[0],f.Ja=f.Ja[0],f.xa=f.xa[0],i=i[0],0!=_)break;if(4294967286<f.Ja)return 3;if(null==h||y||(h[0]=f.xa?2:1),l=[l],g=[g],f.xa){if(5>n){_=7;break}h=l,p=g,y=o,null==e||5>n?e=0:5<=n&&47==e[i+0]&&!(e[i+4]>>5)?(v=[0],I=[0],x=[0],m(B=new w,e,i,n),fe(B,v,I,x)?(null!=h&&(h[0]=v[0]),null!=p&&(p[0]=I[0]),null!=y&&(y[0]=x[0]),e=1):e=0):e=0}else{if(10>n){_=7;break}h=g,null==e||10>n||!Ze(e,i+3,n-3)?e=0:(p=e[i+0]|e[i+1]<<8|e[i+2]<<16,y=16383&(e[i+7]<<8|e[i+6]),e=16383&(e[i+9]<<8|e[i+8]),1&p||3<(p>>1&7)||!(p>>4&1)||p>>5>=f.Ja||!y||!e?e=0:(l&&(l[0]=y),h&&(h[0]=e),e=1))}if(!e||(l=l[0],g=g[0],d&&(u[0]!=l||c[0]!=g)))return 3;null!=A&&(A[0]=f,A.offset=i-A.w,t(4294967286>i-A.w),t(A.offset==A.ha-n));break}return 0==_||7==_&&d&&null==A?(null!=o&&(o[0]|=null!=f.na&&0<f.na.length),null!=a&&(a[0]=l),null!=s&&(s[0]=g),0):_}function kr(e,t,r){var i=t.width,n=t.height,a=0,s=0,o=i,l=n;if(t.Da=null!=e&&0<e.Da,t.Da&&(o=e.cd,l=e.bd,a=e.v,s=e.j,11>r||(a&=-2,s&=-2),0>a||0>s||0>=o||0>=l||a+o>i||s+l>n))return 0;if(t.v=a,t.j=s,t.va=a+o,t.o=s+l,t.U=o,t.T=l,t.da=null!=e&&0<e.da,t.da){if(!R(o,l,r=[e.ib],a=[e.hb]))return 0;t.ib=r[0],t.hb=a[0]}return t.ob=null!=e&&e.ob,t.Kb=null==e||!e.Sd,t.da&&(t.ob=t.ib<3*i/4&&t.hb<3*n/4,t.Kb=0),1}function Ur(e){if(null==e)return 2;if(11>e.S){var t=e.f.RGBA;t.fb+=(e.height-1)*t.A,t.A=-t.A}else t=e.f.kb,e=e.height,t.O+=(e-1)*t.fa,t.fa=-t.fa,t.N+=(e-1>>1)*t.Ab,t.Ab=-t.Ab,t.W+=(e-1>>1)*t.Db,t.Db=-t.Db,null!=t.F&&(t.J+=(e-1)*t.lb,t.lb=-t.lb);return 0}function Rr(e,t,r,i){if(null==i||0>=e||0>=t)return 2;if(null!=r){if(r.Da){var n=r.cd,s=r.bd,o=-2&r.v,l=-2&r.j;if(0>o||0>l||0>=n||0>=s||o+n>e||l+s>t)return 2;e=n,t=s}if(r.da){if(!R(e,t,n=[r.ib],s=[r.hb]))return 2;e=n[0],t=s[0]}}i.width=e,i.height=t;e:{var h=i.width,A=i.height;if(e=i.S,0>=h||0>=A||!(e>=ki&&13>e))e=2;else{if(0>=i.Rd&&null==i.sd){o=s=n=t=0;var u=(l=h*Qn[e])*A;if(11>e||(s=(A+1)/2*(t=(h+1)/2),12==e&&(o=(n=h)*A)),null==(A=a(u+2*s+o))){e=1;break e}i.sd=A,11>e?((h=i.f.RGBA).eb=A,h.fb=0,h.A=l,h.size=u):((h=i.f.kb).y=A,h.O=0,h.fa=l,h.Fd=u,h.f=A,h.N=0+u,h.Ab=t,h.Cd=s,h.ea=A,h.W=0+u+s,h.Db=t,h.Ed=s,12==e&&(h.F=A,h.J=0+u+2*s),h.Tc=o,h.lb=n)}if(t=1,n=i.S,s=i.width,o=i.height,n>=ki&&13>n)if(11>n)e=i.f.RGBA,t&=(l=Math.abs(e.A))*(o-1)+s<=e.size,t&=l>=s*Qn[n],t&=null!=e.eb;else{e=i.f.kb,l=(s+1)/2,u=(o+1)/2,h=Math.abs(e.fa),A=Math.abs(e.Ab);var c=Math.abs(e.Db),d=Math.abs(e.lb),p=d*(o-1)+s;t&=h*(o-1)+s<=e.Fd,t&=A*(u-1)+l<=e.Cd,t=(t&=c*(u-1)+l<=e.Ed)&h>=s&A>=l&c>=l,t&=null!=e.y,t&=null!=e.f,t&=null!=e.ea,12==n&&(t&=d>=s,t&=p<=e.Tc,t&=null!=e.F)}else t=0;e=t?0:2}}return 0!=e||null!=r&&r.fd&&(e=Ur(i)),e}var Dr=64,Nr=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535,131071,262143,524287,1048575,2097151,4194303,8388607,16777215],Or=24,Qr=32,zr=8,Hr=[0,0,1,1,2,2,2,2,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7];O("Predictor0","PredictorAdd0"),e.Predictor0=function(){return 4278190080},e.Predictor1=function(e){return e},e.Predictor2=function(e,t,r){return t[r+0]},e.Predictor3=function(e,t,r){return t[r+1]},e.Predictor4=function(e,t,r){return t[r-1]},e.Predictor5=function(e,t,r){return z(z(e,t[r+1]),t[r+0])},e.Predictor6=function(e,t,r){return z(e,t[r-1])},e.Predictor7=function(e,t,r){return z(e,t[r+0])},e.Predictor8=function(e,t,r){return z(t[r-1],t[r+0])},e.Predictor9=function(e,t,r){return z(t[r+0],t[r+1])},e.Predictor10=function(e,t,r){return z(z(e,t[r-1]),z(t[r+0],t[r+1]))},e.Predictor11=function(e,t,r){var i=t[r+0];return 0>=V(i>>24&255,e>>24&255,(t=t[r-1])>>24&255)+V(i>>16&255,e>>16&255,t>>16&255)+V(i>>8&255,e>>8&255,t>>8&255)+V(255&i,255&e,255&t)?i:e},e.Predictor12=function(e,t,r){var i=t[r+0];return(H((e>>24&255)+(i>>24&255)-((t=t[r-1])>>24&255))<<24|H((e>>16&255)+(i>>16&255)-(t>>16&255))<<16|H((e>>8&255)+(i>>8&255)-(t>>8&255))<<8|H((255&e)+(255&i)-(255&t)))>>>0},e.Predictor13=function(e,t,r){var i=t[r-1];return(j((e=z(e,t[r+0]))>>24&255,i>>24&255)<<24|j(e>>16&255,i>>16&255)<<16|j(e>>8&255,i>>8&255)<<8|j(255&e,255&i))>>>0};var jr=e.PredictorAdd0;e.PredictorAdd1=G,O("Predictor2","PredictorAdd2"),O("Predictor3","PredictorAdd3"),O("Predictor4","PredictorAdd4"),O("Predictor5","PredictorAdd5"),O("Predictor6","PredictorAdd6"),O("Predictor7","PredictorAdd7"),O("Predictor8","PredictorAdd8"),O("Predictor9","PredictorAdd9"),O("Predictor10","PredictorAdd10"),O("Predictor11","PredictorAdd11"),O("Predictor12","PredictorAdd12"),O("Predictor13","PredictorAdd13");var Vr=e.PredictorAdd2;W("ColorIndexInverseTransform","MapARGB","32b",(function(e){return e>>8&255}),(function(e){return e})),W("VP8LColorIndexInverseTransformAlpha","MapAlpha","8b",(function(e){return e}),(function(e){return e>>8&255}));var Gr,Kr=e.ColorIndexInverseTransform,qr=e.MapARGB,Zr=e.VP8LColorIndexInverseTransformAlpha,Wr=e.MapAlpha,$r=e.VP8LPredictorsAdd=[];$r.length=16,(e.VP8LPredictors=[]).length=16,(e.VP8LPredictorsAdd_C=[]).length=16,(e.VP8LPredictors_C=[]).length=16;var Xr,Yr,Jr,ei,ti,ri,ii,ni,ai,si,oi,li,hi,Ai,ui,ci,di,pi,fi,gi,mi,yi,_i,vi,wi,bi,xi,Bi,Ci=a(511),Si=a(2041),Ei=a(225),Ii=a(767),Ti=0,Fi=Si,Pi=Ei,Li=Ii,Mi=Ci,ki=0,Ui=1,Ri=2,Di=3,Ni=4,Oi=5,Qi=6,zi=7,Hi=8,ji=9,Vi=10,Gi=[2,3,7],Ki=[3,3,11],qi=[280,256,256,256,40],Zi=[0,1,1,1,0],Wi=[17,18,0,1,2,3,4,5,16,6,7,8,9,10,11,12,13,14,15],$i=[24,7,23,25,40,6,39,41,22,26,38,42,56,5,55,57,21,27,54,58,37,43,72,4,71,73,20,28,53,59,70,74,36,44,88,69,75,52,60,3,87,89,19,29,86,90,35,45,68,76,85,91,51,61,104,2,103,105,18,30,102,106,34,46,84,92,67,77,101,107,50,62,120,1,119,121,83,93,17,31,100,108,66,78,118,122,33,47,117,123,49,63,99,109,82,94,0,116,124,65,79,16,32,98,110,48,115,125,81,95,64,114,126,97,111,80,113,127,96,112],Xi=[2954,2956,2958,2962,2970,2986,3018,3082,3212,3468,3980,5004],Yi=8,Ji=[4,5,6,7,8,9,10,10,11,12,13,14,15,16,17,17,18,19,20,20,21,21,22,22,23,23,24,25,25,26,27,28,29,30,31,32,33,34,35,36,37,37,38,39,40,41,42,43,44,45,46,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,76,77,78,79,80,81,82,83,84,85,86,87,88,89,91,93,95,96,98,100,101,102,104,106,108,110,112,114,116,118,122,124,126,128,130,132,134,136,138,140,143,145,148,151,154,157],en=[4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,177,181,185,189,193,197,201,205,209,213,217,221,225,229,234,239,245,249,254,259,264,269,274,279,284],tn=null,rn=[[173,148,140,0],[176,155,140,135,0],[180,157,141,134,130,0],[254,254,243,230,196,177,153,140,133,130,129,0]],nn=[0,1,4,8,5,2,3,6,9,12,13,10,7,11,14,15],an=[-0,1,-1,2,-2,3,4,6,-3,5,-4,-5,-6,7,-7,8,-8,-9],sn=[[[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]],[[253,136,254,255,228,219,128,128,128,128,128],[189,129,242,255,227,213,255,219,128,128,128],[106,126,227,252,214,209,255,255,128,128,128]],[[1,98,248,255,236,226,255,255,128,128,128],[181,133,238,254,221,234,255,154,128,128,128],[78,134,202,247,198,180,255,219,128,128,128]],[[1,185,249,255,243,255,128,128,128,128,128],[184,150,247,255,236,224,128,128,128,128,128],[77,110,216,255,236,230,128,128,128,128,128]],[[1,101,251,255,241,255,128,128,128,128,128],[170,139,241,252,236,209,255,255,128,128,128],[37,116,196,243,228,255,255,255,128,128,128]],[[1,204,254,255,245,255,128,128,128,128,128],[207,160,250,255,238,128,128,128,128,128,128],[102,103,231,255,211,171,128,128,128,128,128]],[[1,152,252,255,240,255,128,128,128,128,128],[177,135,243,255,234,225,128,128,128,128,128],[80,129,211,255,194,224,128,128,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[246,1,255,128,128,128,128,128,128,128,128],[255,128,128,128,128,128,128,128,128,128,128]]],[[[198,35,237,223,193,187,162,160,145,155,62],[131,45,198,221,172,176,220,157,252,221,1],[68,47,146,208,149,167,221,162,255,223,128]],[[1,149,241,255,221,224,255,255,128,128,128],[184,141,234,253,222,220,255,199,128,128,128],[81,99,181,242,176,190,249,202,255,255,128]],[[1,129,232,253,214,197,242,196,255,255,128],[99,121,210,250,201,198,255,202,128,128,128],[23,91,163,242,170,187,247,210,255,255,128]],[[1,200,246,255,234,255,128,128,128,128,128],[109,178,241,255,231,245,255,255,128,128,128],[44,130,201,253,205,192,255,255,128,128,128]],[[1,132,239,251,219,209,255,165,128,128,128],[94,136,225,251,218,190,255,255,128,128,128],[22,100,174,245,186,161,255,199,128,128,128]],[[1,182,249,255,232,235,128,128,128,128,128],[124,143,241,255,227,234,128,128,128,128,128],[35,77,181,251,193,211,255,205,128,128,128]],[[1,157,247,255,236,231,255,255,128,128,128],[121,141,235,255,225,227,255,255,128,128,128],[45,99,188,251,195,217,255,224,128,128,128]],[[1,1,251,255,213,255,128,128,128,128,128],[203,1,248,255,255,128,128,128,128,128,128],[137,1,177,255,224,255,128,128,128,128,128]]],[[[253,9,248,251,207,208,255,192,128,128,128],[175,13,224,243,193,185,249,198,255,255,128],[73,17,171,221,161,179,236,167,255,234,128]],[[1,95,247,253,212,183,255,255,128,128,128],[239,90,244,250,211,209,255,255,128,128,128],[155,77,195,248,188,195,255,255,128,128,128]],[[1,24,239,251,218,219,255,205,128,128,128],[201,51,219,255,196,186,128,128,128,128,128],[69,46,190,239,201,218,255,228,128,128,128]],[[1,191,251,255,255,128,128,128,128,128,128],[223,165,249,255,213,255,128,128,128,128,128],[141,124,248,255,255,128,128,128,128,128,128]],[[1,16,248,255,255,128,128,128,128,128,128],[190,36,230,255,236,255,128,128,128,128,128],[149,1,255,128,128,128,128,128,128,128,128]],[[1,226,255,128,128,128,128,128,128,128,128],[247,192,255,128,128,128,128,128,128,128,128],[240,128,255,128,128,128,128,128,128,128,128]],[[1,134,252,255,255,128,128,128,128,128,128],[213,62,250,255,255,128,128,128,128,128,128],[55,93,255,128,128,128,128,128,128,128,128]],[[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128],[128,128,128,128,128,128,128,128,128,128,128]]],[[[202,24,213,235,186,191,220,160,240,175,255],[126,38,182,232,169,184,228,174,255,187,128],[61,46,138,219,151,178,240,170,255,216,128]],[[1,112,230,250,199,191,247,159,255,255,128],[166,109,228,252,211,215,255,174,128,128,128],[39,77,162,232,172,180,245,178,255,255,128]],[[1,52,220,246,198,199,249,220,255,255,128],[124,74,191,243,183,193,250,221,255,255,128],[24,71,130,219,154,170,243,182,255,255,128]],[[1,182,225,249,219,240,255,224,128,128,128],[149,150,226,252,216,205,255,171,128,128,128],[28,108,170,242,183,194,254,223,255,255,128]],[[1,81,230,252,204,203,255,192,128,128,128],[123,102,209,247,188,196,255,233,128,128,128],[20,95,153,243,164,173,255,203,128,128,128]],[[1,222,248,255,216,213,128,128,128,128,128],[168,175,246,252,235,205,255,255,128,128,128],[47,116,215,255,211,212,255,255,128,128,128]],[[1,121,236,253,212,214,255,255,128,128,128],[141,84,213,252,201,202,255,219,128,128,128],[42,80,160,240,162,185,255,205,128,128,128]],[[1,1,255,128,128,128,128,128,128,128,128],[244,1,255,128,128,128,128,128,128,128,128],[238,1,255,128,128,128,128,128,128,128,128]]]],on=[[[231,120,48,89,115,113,120,152,112],[152,179,64,126,170,118,46,70,95],[175,69,143,80,85,82,72,155,103],[56,58,10,171,218,189,17,13,152],[114,26,17,163,44,195,21,10,173],[121,24,80,195,26,62,44,64,85],[144,71,10,38,171,213,144,34,26],[170,46,55,19,136,160,33,206,71],[63,20,8,114,114,208,12,9,226],[81,40,11,96,182,84,29,16,36]],[[134,183,89,137,98,101,106,165,148],[72,187,100,130,157,111,32,75,80],[66,102,167,99,74,62,40,234,128],[41,53,9,178,241,141,26,8,107],[74,43,26,146,73,166,49,23,157],[65,38,105,160,51,52,31,115,128],[104,79,12,27,217,255,87,17,7],[87,68,71,44,114,51,15,186,23],[47,41,14,110,182,183,21,17,194],[66,45,25,102,197,189,23,18,22]],[[88,88,147,150,42,46,45,196,205],[43,97,183,117,85,38,35,179,61],[39,53,200,87,26,21,43,232,171],[56,34,51,104,114,102,29,93,77],[39,28,85,171,58,165,90,98,64],[34,22,116,206,23,34,43,166,73],[107,54,32,26,51,1,81,43,31],[68,25,106,22,64,171,36,225,114],[34,19,21,102,132,188,16,76,124],[62,18,78,95,85,57,50,48,51]],[[193,101,35,159,215,111,89,46,111],[60,148,31,172,219,228,21,18,111],[112,113,77,85,179,255,38,120,114],[40,42,1,196,245,209,10,25,109],[88,43,29,140,166,213,37,43,154],[61,63,30,155,67,45,68,1,209],[100,80,8,43,154,1,51,26,71],[142,78,78,16,255,128,34,197,171],[41,40,5,102,211,183,4,1,221],[51,50,17,168,209,192,23,25,82]],[[138,31,36,171,27,166,38,44,229],[67,87,58,169,82,115,26,59,179],[63,59,90,180,59,166,93,73,154],[40,40,21,116,143,209,34,39,175],[47,15,16,183,34,223,49,45,183],[46,17,33,183,6,98,15,32,183],[57,46,22,24,128,1,54,17,37],[65,32,73,115,28,128,23,128,205],[40,3,9,115,51,192,18,6,223],[87,37,9,115,59,77,64,21,47]],[[104,55,44,218,9,54,53,130,226],[64,90,70,205,40,41,23,26,57],[54,57,112,184,5,41,38,166,213],[30,34,26,133,152,116,10,32,134],[39,19,53,221,26,114,32,73,255],[31,9,65,234,2,15,1,118,73],[75,32,12,51,192,255,160,43,51],[88,31,35,67,102,85,55,186,85],[56,21,23,111,59,205,45,37,192],[55,38,70,124,73,102,1,34,98]],[[125,98,42,88,104,85,117,175,82],[95,84,53,89,128,100,113,101,45],[75,79,123,47,51,128,81,171,1],[57,17,5,71,102,57,53,41,49],[38,33,13,121,57,73,26,1,85],[41,10,67,138,77,110,90,47,114],[115,21,2,10,102,255,166,23,6],[101,29,16,10,85,128,101,196,26],[57,18,10,102,102,213,34,20,43],[117,20,15,36,163,128,68,1,26]],[[102,61,71,37,34,53,31,243,192],[69,60,71,38,73,119,28,222,37],[68,45,128,34,1,47,11,245,171],[62,17,19,70,146,85,55,62,70],[37,43,37,154,100,163,85,160,1],[63,9,92,136,28,64,32,201,85],[75,15,9,9,64,255,184,119,16],[86,6,28,5,64,255,25,248,1],[56,8,17,132,137,255,55,116,128],[58,15,20,82,135,57,26,121,40]],[[164,50,31,137,154,133,25,35,218],[51,103,44,131,131,123,31,6,158],[86,40,64,135,148,224,45,183,128],[22,26,17,131,240,154,14,1,209],[45,16,21,91,64,222,7,1,197],[56,21,39,155,60,138,23,102,213],[83,12,13,54,192,255,68,47,28],[85,26,85,85,128,128,32,146,171],[18,11,7,63,144,171,4,4,246],[35,27,10,146,174,171,12,26,128]],[[190,80,35,99,180,80,126,54,45],[85,126,47,87,176,51,41,20,32],[101,75,128,139,118,146,116,128,85],[56,41,15,176,236,85,37,9,62],[71,30,17,119,118,255,17,18,138],[101,38,60,138,55,70,43,26,142],[146,36,19,30,171,255,97,27,20],[138,45,61,62,219,1,81,188,64],[32,41,20,117,151,142,20,21,163],[112,19,12,61,195,128,48,4,24]]],ln=[[[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[176,246,255,255,255,255,255,255,255,255,255],[223,241,252,255,255,255,255,255,255,255,255],[249,253,253,255,255,255,255,255,255,255,255]],[[255,244,252,255,255,255,255,255,255,255,255],[234,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255]],[[255,246,254,255,255,255,255,255,255,255,255],[239,253,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[251,255,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[251,254,254,255,255,255,255,255,255,255,255],[254,255,254,255,255,255,255,255,255,255,255]],[[255,254,253,255,254,255,255,255,255,255,255],[250,255,254,255,254,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[217,255,255,255,255,255,255,255,255,255,255],[225,252,241,253,255,255,254,255,255,255,255],[234,250,241,250,253,255,253,254,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[223,254,254,255,255,255,255,255,255,255,255],[238,253,254,254,255,255,255,255,255,255,255]],[[255,248,254,255,255,255,255,255,255,255,255],[249,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,255,255,255,255,255,255,255,255,255],[247,254,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[252,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[253,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[186,251,250,255,255,255,255,255,255,255,255],[234,251,244,254,255,255,255,255,255,255,255],[251,251,243,253,254,255,254,255,255,255,255]],[[255,253,254,255,255,255,255,255,255,255,255],[236,253,254,255,255,255,255,255,255,255,255],[251,253,253,254,254,255,255,255,255,255,255]],[[255,254,254,255,255,255,255,255,255,255,255],[254,254,254,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,254,255,255,255,255,255,255,255,255,255],[254,254,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]],[[[248,255,255,255,255,255,255,255,255,255,255],[250,254,252,254,255,255,255,255,255,255,255],[248,254,249,253,255,255,255,255,255,255,255]],[[255,253,253,255,255,255,255,255,255,255,255],[246,253,253,255,255,255,255,255,255,255,255],[252,254,251,254,254,255,255,255,255,255,255]],[[255,254,252,255,255,255,255,255,255,255,255],[248,254,253,255,255,255,255,255,255,255,255],[253,255,254,254,255,255,255,255,255,255,255]],[[255,251,254,255,255,255,255,255,255,255,255],[245,251,254,255,255,255,255,255,255,255,255],[253,253,254,255,255,255,255,255,255,255,255]],[[255,251,253,255,255,255,255,255,255,255,255],[252,253,254,255,255,255,255,255,255,255,255],[255,254,255,255,255,255,255,255,255,255,255]],[[255,252,255,255,255,255,255,255,255,255,255],[249,255,254,255,255,255,255,255,255,255,255],[255,255,254,255,255,255,255,255,255,255,255]],[[255,255,253,255,255,255,255,255,255,255,255],[250,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]],[[255,255,255,255,255,255,255,255,255,255,255],[254,255,255,255,255,255,255,255,255,255,255],[255,255,255,255,255,255,255,255,255,255,255]]]],hn=[0,1,2,3,6,4,5,6,6,6,6,6,6,6,6,7,0],An=[],un=[],cn=[],dn=1,pn=2,fn=[],gn=[];fr("UpsampleRgbLinePair",wr,3),fr("UpsampleBgrLinePair",br,3),fr("UpsampleRgbaLinePair",Er,4),fr("UpsampleBgraLinePair",Sr,4),fr("UpsampleArgbLinePair",Cr,4),fr("UpsampleRgba4444LinePair",Br,2),fr("UpsampleRgb565LinePair",xr,2);var mn=e.UpsampleRgbLinePair,yn=e.UpsampleBgrLinePair,_n=e.UpsampleRgbaLinePair,vn=e.UpsampleBgraLinePair,wn=e.UpsampleArgbLinePair,bn=e.UpsampleRgba4444LinePair,xn=e.UpsampleRgb565LinePair,Bn=16,Cn=1<<Bn-1,Sn=-227,En=482,In=6,Tn=(256<<In)-1,Fn=0,Pn=a(256),Ln=a(256),Mn=a(256),kn=a(256),Un=a(En-Sn),Rn=a(En-Sn);Tr("YuvToRgbRow",wr,3),Tr("YuvToBgrRow",br,3),Tr("YuvToRgbaRow",Er,4),Tr("YuvToBgraRow",Sr,4),Tr("YuvToArgbRow",Cr,4),Tr("YuvToRgba4444Row",Br,2),Tr("YuvToRgb565Row",xr,2);var Dn=[0,4,8,12,128,132,136,140,256,260,264,268,384,388,392,396],Nn=[0,2,8],On=[8,7,6,4,4,2,2,2,1,1,1,1];this.WebPDecodeRGBA=function(e,r,o,l,h){var A=Ui,u=new er,c=new se;u.ba=c,c.S=A,c.width=[c.width],c.height=[c.height];var d=c.width,p=c.height,f=new oe;if(null==f||null==e)var g=2;else t(null!=f),g=Mr(e,r,o,f.width,f.height,f.Pd,f.Qd,f.format,null);if(0!=g?d=0:(null!=d&&(d[0]=f.width[0]),null!=p&&(p[0]=f.height[0]),d=1),d){c.width=c.width[0],c.height=c.height[0],null!=l&&(l[0]=c.width),null!=h&&(h[0]=c.height);e:{if(l=new Ge,(h=new tr).data=e,h.w=r,h.ha=o,h.kd=1,r=[0],t(null!=h),(0==(e=Mr(h.data,h.w,h.ha,null,null,null,r,null,h))||7==e)&&r[0]&&(e=4),0==(r=e)){if(t(null!=u),l.data=h.data,l.w=h.w+h.offset,l.ha=h.ha-h.offset,l.put=de,l.ac=ce,l.bc=pe,l.ma=u,h.xa){if(null==(e=Ie())){u=1;break e}if(function(e,r){var i=[0],n=[0],a=[0];t:for(;;){if(null==e)return 0;if(null==r)return e.a=2,0;if(e.l=r,e.a=0,m(e.m,r.data,r.w,r.ha),!fe(e.m,i,n,a)){e.a=3;break t}if(e.xb=pn,r.width=i[0],r.height=n[0],!Te(i[0],n[0],1,e,null))break t;return 1}return t(0!=e.a),0}(e,l)){if(l=0==(r=Rr(l.width,l.height,u.Oa,u.ba))){t:{l=e;r:for(;;){if(null==l){l=0;break t}if(t(null!=l.s.yc),t(null!=l.s.Ya),t(0<l.s.Wb),t(null!=(o=l.l)),t(null!=(h=o.ma)),0!=l.xb){if(l.ca=h.ba,l.tb=h.tb,t(null!=l.ca),!kr(h.Oa,o,Di)){l.a=2;break r}if(!Fe(l,o.width)||o.da)break r;if((o.da||ie(l.ca.S))&&pr(),11>l.ca.S||(alert("todo:WebPInitConvertARGBToYUV"),null!=l.ca.f.kb.F&&pr()),l.Pb&&0<l.s.ua&&null==l.s.vb.X&&!M(l.s.vb,l.s.Wa.Xa)){l.a=1;break r}l.xb=0}if(!Se(l,l.V,l.Ba,l.c,l.i,o.o,be))break r;h.Dc=l.Ma,l=1;break t}t(0!=l.a),l=0}l=!l}l&&(r=e.a)}else r=e.a}else{if(null==(e=new Ke)){u=1;break e}if(e.Fa=h.na,e.P=h.P,e.qc=h.Sa,We(e,l)){if(0==(r=Rr(l.width,l.height,u.Oa,u.ba))){if(e.Aa=0,o=u.Oa,t(null!=(h=e)),null!=o){if(0<(d=0>(d=o.Md)?0:100<d?255:255*d/100)){for(p=f=0;4>p;++p)12>(g=h.pb[p]).lc&&(g.ia=d*On[0>g.lc?0:g.lc]>>3),f|=g.ia;f&&(alert("todo:VP8InitRandom"),h.ia=1)}h.Ga=o.Id,100<h.Ga?h.Ga=100:0>h.Ga&&(h.Ga=0)}(function(e,r){if(null==e)return 0;if(null==r)return qe(e,2,"NULL VP8Io parameter in VP8Decode().");if(!e.cb&&!We(e,r))return 0;if(t(e.cb),null==r.ac||r.ac(r)){r.ob&&(e.L=0);var o=Nn[e.L];if(2==e.L?(e.yb=0,e.zb=0):(e.yb=r.v-o>>4,e.zb=r.j-o>>4,0>e.yb&&(e.yb=0),0>e.zb&&(e.zb=0)),e.Va=r.o+15+o>>4,e.Hb=r.va+15+o>>4,e.Hb>e.za&&(e.Hb=e.za),e.Va>e.Ub&&(e.Va=e.Ub),0<e.L){var l=e.ed;for(o=0;4>o;++o){var h;if(e.Qa.Cb){var A=e.Qa.Lb[o];e.Qa.Fb||(A+=l.Tb)}else A=l.Tb;for(h=0;1>=h;++h){var u=e.gd[o][h],c=A;if(l.Pc&&(c+=l.vd[0],h&&(c+=l.od[0])),0<(c=0>c?0:63<c?63:c)){var d=c;0<l.wb&&(d=4<l.wb?d>>2:d>>1)>9-l.wb&&(d=9-l.wb),1>d&&(d=1),u.dd=d,u.tc=2*c+d,u.ld=40<=c?2:15<=c?1:0}else u.tc=0;u.La=h}}}o=0}else qe(e,6,"Frame setup failed"),o=e.a;if(o=0==o){if(o){e.$c=0,0<e.Aa||(e.Ic=1);t:{o=e.Ic,l=4*(d=e.za);var p=32*d,f=d+1,g=0<e.L?d*(0<e.Aa?2:1):0,m=(2==e.Aa?2:1)*d;if((u=l+832+(h=3*(16*o+Nn[e.L])/2*p)+(A=null!=e.Fa&&0<e.Fa.length?e.Kc.c*e.Kc.i:0))!=u)o=0;else{if(u>e.Vb){if(e.Vb=0,e.Ec=a(u),e.Fc=0,null==e.Ec){o=qe(e,1,"no memory during frame initialization.");break t}e.Vb=u}u=e.Ec,c=e.Fc,e.Ac=u,e.Bc=c,c+=l,e.Gd=s(p,je),e.Hd=0,e.rb=s(f+1,Oe),e.sb=1,e.wa=g?s(g,Ne):null,e.Y=0,e.D.Nb=0,e.D.wa=e.wa,e.D.Y=e.Y,0<e.Aa&&(e.D.Y+=d),t(!0),e.oc=u,e.pc=c,c+=832,e.ya=s(m,ze),e.aa=0,e.D.ya=e.ya,e.D.aa=e.aa,2==e.Aa&&(e.D.aa+=d),e.R=16*d,e.B=8*d,d=(p=Nn[e.L])*e.R,p=p/2*e.B,e.sa=u,e.ta=c+d,e.qa=e.sa,e.ra=e.ta+16*o*e.R+p,e.Ha=e.qa,e.Ia=e.ra+8*o*e.B+p,e.$c=0,c+=h,e.mb=A?u:null,e.nb=A?c:null,t(c+A<=e.Fc+e.Vb),Xe(e),n(e.Ac,e.Bc,0,l),o=1}}if(o){if(r.ka=0,r.y=e.sa,r.O=e.ta,r.f=e.qa,r.N=e.ra,r.ea=e.Ha,r.Vd=e.Ia,r.fa=e.R,r.Rc=e.B,r.F=null,r.J=0,!Ti){for(o=-255;255>=o;++o)Ci[255+o]=0>o?-o:o;for(o=-1020;1020>=o;++o)Si[1020+o]=-128>o?-128:127<o?127:o;for(o=-112;112>=o;++o)Ei[112+o]=-16>o?-16:15<o?15:o;for(o=-255;510>=o;++o)Ii[255+o]=0>o?0:255<o?255:o;Ti=1}ii=ot,ni=it,si=nt,oi=at,li=st,ai=rt,hi=Kt,Ai=qt,ui=$t,ci=Xt,di=Zt,pi=Wt,fi=Yt,gi=Jt,mi=Qt,yi=zt,_i=Ht,vi=jt,un[0]=bt,un[1]=ht,un[2]=vt,un[3]=wt,un[4]=xt,un[5]=Ct,un[6]=Bt,un[7]=St,un[8]=It,un[9]=Et,An[0]=ft,An[1]=ut,An[2]=ct,An[3]=dt,An[4]=gt,An[5]=mt,An[6]=yt,cn[0]=Lt,cn[1]=At,cn[2]=Tt,cn[3]=Ft,cn[4]=kt,cn[5]=Mt,cn[6]=Ut,o=1}else o=0}o&&(o=function(e,r){for(e.M=0;e.M<e.Va;++e.M){var s,o=e.Jc[e.M&e.Xb],l=e.m,h=e;for(s=0;s<h.za;++s){var A=l,u=h,c=u.Ac,d=u.Bc+4*s,p=u.zc,f=u.ya[u.aa+s];if(u.Qa.Bb?f.$b=I(A,u.Pa.jb[0])?2+I(A,u.Pa.jb[2]):I(A,u.Pa.jb[1]):f.$b=0,u.kc&&(f.Ad=I(A,u.Bd)),f.Za=!I(A,145)+0,f.Za){var g=f.Ob,m=0;for(u=0;4>u;++u){var y,_=p[0+u];for(y=0;4>y;++y){_=on[c[d+y]][_];for(var v=an[I(A,_[0])];0<v;)v=an[2*v+I(A,_[v])];_=-v,c[d+y]=_}i(g,m,c,d,4),m+=4,p[0+u]=_}}else _=I(A,156)?I(A,128)?1:3:I(A,163)?2:0,f.Ob[0]=_,n(c,d,_,4),n(p,0,_,4);f.Dd=I(A,142)?I(A,114)?I(A,183)?1:3:2:0}if(h.m.Ka)return qe(e,7,"Premature end-of-partition0 encountered.");for(;e.ja<e.za;++e.ja){if(h=o,A=(l=e).rb[l.sb-1],c=l.rb[l.sb+l.ja],s=l.ya[l.aa+l.ja],d=l.kc?s.Ad:0)A.la=c.la=0,s.Za||(A.Na=c.Na=0),s.Hc=0,s.Gc=0,s.ia=0;else{var w,b;if(A=c,c=h,d=l.Pa.Xc,p=l.ya[l.aa+l.ja],f=l.pb[p.$b],u=p.ad,g=0,m=l.rb[l.sb-1],_=y=0,n(u,g,0,384),p.Za)var x=0,B=d[3];else{v=a(16);var C=A.Na+m.Na;if(C=tn(c,d[1],C,f.Eb,0,v,0),A.Na=m.Na=(0<C)+0,1<C)ii(v,0,u,g);else{var S=v[0]+3>>3;for(v=0;256>v;v+=16)u[g+v]=S}x=1,B=d[0]}var E=15&A.la,T=15&m.la;for(v=0;4>v;++v){var F=1&T;for(S=b=0;4>S;++S)E=E>>1|(F=(C=tn(c,B,C=F+(1&E),f.Sc,x,u,g))>x)<<7,b=b<<2|(3<C?3:1<C?2:0!=u[g+0]),g+=16;E>>=4,T=T>>1|F<<7,y=(y<<8|b)>>>0}for(B=E,x=T>>4,w=0;4>w;w+=2){for(b=0,E=A.la>>4+w,T=m.la>>4+w,v=0;2>v;++v){for(F=1&T,S=0;2>S;++S)C=F+(1&E),E=E>>1|(F=0<(C=tn(c,d[2],C,f.Qc,0,u,g)))<<3,b=b<<2|(3<C?3:1<C?2:0!=u[g+0]),g+=16;E>>=2,T=T>>1|F<<5}_|=b<<4*w,B|=E<<4<<w,x|=(240&T)<<w}A.la=B,m.la=x,p.Hc=y,p.Gc=_,p.ia=43690&_?0:f.ia,d=!(y|_)}if(0<l.L&&(l.wa[l.Y+l.ja]=l.gd[s.$b][s.Za],l.wa[l.Y+l.ja].La|=!d),h.Ka)return qe(e,7,"Premature end-of-file encountered.")}if(Xe(e),l=r,h=1,s=(o=e).D,A=0<o.L&&o.M>=o.zb&&o.M<=o.Va,0==o.Aa)t:{if(s.M=o.M,s.uc=A,Lr(o,s),h=1,s=(b=o.D).Nb,A=(_=Nn[o.L])*o.R,c=_/2*o.B,v=16*s*o.R,S=8*s*o.B,d=o.sa,p=o.ta-A+v,f=o.qa,u=o.ra-c+S,g=o.Ha,m=o.Ia-c+S,T=0==(E=b.M),y=E>=o.Va-1,2==o.Aa&&Lr(o,b),b.uc)for(F=(C=o).D.M,t(C.D.uc),b=C.yb;b<C.Hb;++b){x=b,B=F;var P=(L=(z=C).D).Nb;w=z.R;var L=L.wa[L.Y+x],M=z.sa,k=z.ta+16*P*w+16*x,U=L.dd,R=L.tc;if(0!=R)if(t(3<=R),1==z.L)0<x&&yi(M,k,w,R+4),L.La&&vi(M,k,w,R),0<B&&mi(M,k,w,R+4),L.La&&_i(M,k,w,R);else{var D=z.B,N=z.qa,O=z.ra+8*P*D+8*x,Q=z.Ha,z=z.Ia+8*P*D+8*x;P=L.ld,0<x&&(Ai(M,k,w,R+4,U,P),ci(N,O,Q,z,D,R+4,U,P)),L.La&&(pi(M,k,w,R,U,P),gi(N,O,Q,z,D,R,U,P)),0<B&&(hi(M,k,w,R+4,U,P),ui(N,O,Q,z,D,R+4,U,P)),L.La&&(di(M,k,w,R,U,P),fi(N,O,Q,z,D,R,U,P))}}if(o.ia&&alert("todo:DitherRow"),null!=l.put){if(b=16*E,E=16*(E+1),T?(l.y=o.sa,l.O=o.ta+v,l.f=o.qa,l.N=o.ra+S,l.ea=o.Ha,l.W=o.Ia+S):(b-=_,l.y=d,l.O=p,l.f=f,l.N=u,l.ea=g,l.W=m),y||(E-=_),E>l.o&&(E=l.o),l.F=null,l.J=null,null!=o.Fa&&0<o.Fa.length&&b<E&&(l.J=hr(o,l,b,E-b),l.F=o.mb,null==l.F&&0==l.F.length)){h=qe(o,3,"Could not decode alpha data.");break t}b<l.j&&(_=l.j-b,b=l.j,t(!(1&_)),l.O+=o.R*_,l.N+=o.B*(_>>1),l.W+=o.B*(_>>1),null!=l.F&&(l.J+=l.width*_)),b<E&&(l.O+=l.v,l.N+=l.v>>1,l.W+=l.v>>1,null!=l.F&&(l.J+=l.v),l.ka=b-l.j,l.U=l.va-l.v,l.T=E-b,h=l.put(l))}s+1!=o.Ic||y||(i(o.sa,o.ta-A,d,p+16*o.R,A),i(o.qa,o.ra-c,f,u+8*o.B,c),i(o.Ha,o.Ia-c,g,m+8*o.B,c))}if(!h)return qe(e,6,"Output aborted.")}return 1}(e,r)),null!=r.bc&&r.bc(r),o&=1}return o?(e.cb=0,o):0})(e,l)||(r=e.a)}}else r=e.a}0==r&&null!=u.Oa&&u.Oa.fd&&(r=Ur(u.ba))}u=r}A=0!=u?null:11>A?c.f.RGBA.eb:c.f.kb.y}else A=null;return A};var Qn=[3,4,3,4,4,2,2,4,4,4,2,1,1]};function h(e,t){for(var r="",i=0;i<4;i++)r+=String.fromCharCode(e[t++]);return r}function A(e,t){return e[t+0]|e[t+1]<<8}function u(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16)>>>0}function c(e,t){return(e[t+0]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}new l;var d=[0],p=[0],f=[],g=new l,m=e,y=function(e,t){var r={},i=0,n=!1,a=0,s=0;if(r.frames=[],!function(e,t){for(var r=0;r<4;r++)if(e[t+r]!="RIFF".charCodeAt(r))return!0;return!1}(e,t)){for(c(e,t+=4),t+=8;t<e.length;){var o=h(e,t),l=c(e,t+=4);t+=4;var d=l+(1&l);switch(o){case"VP8 ":case"VP8L":void 0===r.frames[i]&&(r.frames[i]={}),(g=r.frames[i]).src_off=n?s:t-8,g.src_size=a+l+8,i++,n&&(n=!1,a=0,s=0);break;case"VP8X":(g=r.header={}).feature_flags=e[t];var p=t+4;g.canvas_width=1+u(e,p),p+=3,g.canvas_height=1+u(e,p),p+=3;break;case"ALPH":n=!0,a=d+8,s=t-8;break;case"ANIM":(g=r.header).bgcolor=c(e,t),p=t+4,g.loop_count=A(e,p),p+=2;break;case"ANMF":var f,g;(g=r.frames[i]={}).offset_x=2*u(e,t),t+=3,g.offset_y=2*u(e,t),t+=3,g.width=1+u(e,t),t+=3,g.height=1+u(e,t),t+=3,g.duration=u(e,t),t+=3,f=e[t++],g.dispose=1&f,g.blend=f>>1&1}"ANMF"!=o&&(t+=d)}return r}}(m,0);y.response=m,y.rgbaoutput=!0,y.dataurl=!1;var _=y.header?y.header:null,v=y.frames?y.frames:null;if(_){_.loop_counter=_.loop_count,d=[_.canvas_height],p=[_.canvas_width];for(var w=0;w<v.length&&0!=v[w].blend;w++);}var b=v[0],x=g.WebPDecodeRGBA(m,b.src_off,b.src_size,p,d);b.rgba=x,b.imgwidth=p[0],b.imgheight=d[0];for(var B=0;B<p[0]*d[0]*4;B++)f[B]=x[B];return this.width=p,this.height=d,this.data=f,this}(function(e){var t,r,i,n,a,s,o,l,h,A=function(e){return e=e||{},this.isStrokeTransparent=e.isStrokeTransparent||!1,this.strokeOpacity=e.strokeOpacity||1,this.strokeStyle=e.strokeStyle||"#000000",this.fillStyle=e.fillStyle||"#000000",this.isFillTransparent=e.isFillTransparent||!1,this.fillOpacity=e.fillOpacity||1,this.font=e.font||"10px sans-serif",this.textBaseline=e.textBaseline||"alphabetic",this.textAlign=e.textAlign||"left",this.lineWidth=e.lineWidth||1,this.lineJoin=e.lineJoin||"miter",this.lineCap=e.lineCap||"butt",this.path=e.path||[],this.transform=void 0!==e.transform?e.transform.clone():new l,this.globalCompositeOperation=e.globalCompositeOperation||"normal",this.globalAlpha=e.globalAlpha||1,this.clip_path=e.clip_path||[],this.currentPoint=e.currentPoint||new s,this.miterLimit=e.miterLimit||10,this.lastPoint=e.lastPoint||new s,this.lineDashOffset=e.lineDashOffset||0,this.lineDash=e.lineDash||[],this.margin=e.margin||[0,0,0,0],this.prevPageLastElemOffset=e.prevPageLastElemOffset||0,this.ignoreClearRect="boolean"!=typeof e.ignoreClearRect||e.ignoreClearRect,this};e.events.push(["initialized",function(){this.context2d=new u(this),t=this.internal.f2,r=this.internal.getCoordinateString,i=this.internal.getVerticalCoordinateString,n=this.internal.getHorizontalCoordinate,a=this.internal.getVerticalCoordinate,s=this.internal.Point,o=this.internal.Rectangle,l=this.internal.Matrix,h=new A}]);var u=function(e){Object.defineProperty(this,"canvas",{get:function(){return{parentNode:!1,style:!1}}});var t=e;Object.defineProperty(this,"pdf",{get:function(){return t}});var r=!1;Object.defineProperty(this,"pageWrapXEnabled",{get:function(){return r},set:function(e){r=!!e}});var i=!1;Object.defineProperty(this,"pageWrapYEnabled",{get:function(){return i},set:function(e){i=!!e}});var n=0;Object.defineProperty(this,"posX",{get:function(){return n},set:function(e){isNaN(e)||(n=e)}});var a=0;Object.defineProperty(this,"posY",{get:function(){return a},set:function(e){isNaN(e)||(a=e)}}),Object.defineProperty(this,"margin",{get:function(){return h.margin},set:function(e){var t;"number"==typeof e?t=[e,e,e,e]:((t=new Array(4))[0]=e[0],t[1]=e.length>=2?e[1]:t[0],t[2]=e.length>=3?e[2]:t[0],t[3]=e.length>=4?e[3]:t[1]),h.margin=t}});var s=!1;Object.defineProperty(this,"autoPaging",{get:function(){return s},set:function(e){s=e}});var o=0;Object.defineProperty(this,"lastBreak",{get:function(){return o},set:function(e){o=e}});var l=[];Object.defineProperty(this,"pageBreaks",{get:function(){return l},set:function(e){l=e}}),Object.defineProperty(this,"ctx",{get:function(){return h},set:function(e){e instanceof A&&(h=e)}}),Object.defineProperty(this,"path",{get:function(){return h.path},set:function(e){h.path=e}});var u=[];Object.defineProperty(this,"ctxStack",{get:function(){return u},set:function(e){u=e}}),Object.defineProperty(this,"fillStyle",{get:function(){return this.ctx.fillStyle},set:function(e){var t;t=c(e),this.ctx.fillStyle=t.style,this.ctx.isFillTransparent=0===t.a,this.ctx.fillOpacity=t.a,this.pdf.setFillColor(t.r,t.g,t.b,{a:t.a}),this.pdf.setTextColor(t.r,t.g,t.b,{a:t.a})}}),Object.defineProperty(this,"strokeStyle",{get:function(){return this.ctx.strokeStyle},set:function(e){var t=c(e);this.ctx.strokeStyle=t.style,this.ctx.isStrokeTransparent=0===t.a,this.ctx.strokeOpacity=t.a,0===t.a?this.pdf.setDrawColor(255,255,255):(t.a,this.pdf.setDrawColor(t.r,t.g,t.b))}}),Object.defineProperty(this,"lineCap",{get:function(){return this.ctx.lineCap},set:function(e){-1!==["butt","round","square"].indexOf(e)&&(this.ctx.lineCap=e,this.pdf.setLineCap(e))}}),Object.defineProperty(this,"lineWidth",{get:function(){return this.ctx.lineWidth},set:function(e){isNaN(e)||(this.ctx.lineWidth=e,this.pdf.setLineWidth(e))}}),Object.defineProperty(this,"lineJoin",{get:function(){return this.ctx.lineJoin},set:function(e){-1!==["bevel","round","miter"].indexOf(e)&&(this.ctx.lineJoin=e,this.pdf.setLineJoin(e))}}),Object.defineProperty(this,"miterLimit",{get:function(){return this.ctx.miterLimit},set:function(e){isNaN(e)||(this.ctx.miterLimit=e,this.pdf.setMiterLimit(e))}}),Object.defineProperty(this,"textBaseline",{get:function(){return this.ctx.textBaseline},set:function(e){this.ctx.textBaseline=e}}),Object.defineProperty(this,"textAlign",{get:function(){return this.ctx.textAlign},set:function(e){-1!==["right","end","center","left","start"].indexOf(e)&&(this.ctx.textAlign=e)}});var d=null,p=null;Object.defineProperty(this,"fontFaces",{get:function(){return p},set:function(e){d=null,p=e}}),Object.defineProperty(this,"font",{get:function(){return this.ctx.font},set:function(e){var t;if(this.ctx.font=e,null!==(t=/^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(e))){var r=t[1];t[2];var i=t[3],n=t[4];t[5];var a=t[6],s=/^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(n)[2];n=Math.floor("px"===s?parseFloat(n)*this.pdf.internal.scaleFactor:"em"===s?parseFloat(n)*this.pdf.getFontSize():parseFloat(n)*this.pdf.internal.scaleFactor),this.pdf.setFontSize(n);var o=function(e){var t,r,i=[],n=e.trim();if(""===n)return iU;if(n in Vk)return[Vk[n]];for(;""!==n;){switch(r=null,t=(n=Kk(n)).charAt(0)){case'"':case"'":r=qk(n.substring(1),t);break;default:r=Zk(n)}if(null===r||(i.push(r[0]),""!==(n=Kk(r[1]))&&","!==n.charAt(0)))return iU;n=n.replace(/^,/,"")}return i}(a);if(this.fontFaces){var l=function(e,t,r){for(var i=(r=r||{}).defaultFontFamily||"times",n=Object.assign({},jk,r.genericFontFamilies||{}),a=null,s=null,o=0;o<t.length;++o)if(n[(a=zk(t[o])).family]&&(a.family=n[a.family]),e.hasOwnProperty(a.family)){s=e[a.family];break}if(!(s=s||e[i]))throw new Error("Could not find a font-family for the rule '"+Gk(a)+"' and default family '"+i+"'.");if(s=function(e,t){if(t[e])return t[e];var r=Nk[e],i=r<=Nk.normal?-1:1,n=Hk(t,Dk,r,i);if(!n)throw new Error("Could not find a matching font-stretch value for "+e);return n}(a.stretch,s),s=function(e,t){if(t[e])return t[e];for(var r=Rk[e],i=0;i<r.length;++i)if(t[r[i]])return t[r[i]];throw new Error("Could not find a matching font-style for "+e)}(a.style,s),!(s=function(e,t){if(t[e])return t[e];if(400===e&&t[500])return t[500];if(500===e&&t[400])return t[400];var r=Qk[e],i=Hk(t,Ok,r,e<400?-1:1);if(!i)throw new Error("Could not find a matching font-weight for value "+e);return i}(a.weight,s)))throw new Error("Failed to resolve a font for the rule '"+Gk(a)+"'.");return s}(function(e,t){if(null===d){var r=(i=e.getFontList(),n=[],Object.keys(i).forEach((function(e){i[e].forEach((function(t){var r=null;switch(t){case"bold":r={family:e,weight:"bold"};break;case"italic":r={family:e,style:"italic"};break;case"bolditalic":r={family:e,weight:"bold",style:"italic"};break;case"":case"normal":r={family:e}}null!==r&&(r.ref={name:e,style:t},n.push(r))}))})),n);d=function(e){for(var t={},r=0;r<e.length;++r){var i=zk(e[r]),n=i.family,a=i.stretch,s=i.style,o=i.weight;t[n]=t[n]||{},t[n][a]=t[n][a]||{},t[n][a][s]=t[n][a][s]||{},t[n][a][s][o]=i}return t}(r.concat(t))}var i,n;return d}(this.pdf,this.fontFaces),o.map((function(e){return{family:e,stretch:"normal",weight:i,style:r}})));this.pdf.setFont(l.ref.name,l.ref.style)}else{var h="";("bold"===i||parseInt(i,10)>=700||"bold"===r)&&(h="bold"),"italic"===r&&(h+="italic"),0===h.length&&(h="normal");for(var A="",u={arial:"Helvetica",Arial:"Helvetica",verdana:"Helvetica",Verdana:"Helvetica",helvetica:"Helvetica",Helvetica:"Helvetica","sans-serif":"Helvetica",fixed:"Courier",monospace:"Courier",terminal:"Courier",cursive:"Times",fantasy:"Times",serif:"Times"},c=0;c<o.length;c++){if(void 0!==this.pdf.internal.getFont(o[c],h,{noFallback:!0,disableWarning:!0})){A=o[c];break}if("bolditalic"===h&&void 0!==this.pdf.internal.getFont(o[c],"bold",{noFallback:!0,disableWarning:!0}))A=o[c],h="bold";else if(void 0!==this.pdf.internal.getFont(o[c],"normal",{noFallback:!0,disableWarning:!0})){A=o[c],h="normal";break}}if(""===A)for(var p=0;p<o.length;p++)if(u[o[p]]){A=u[o[p]];break}A=""===A?"Times":A,this.pdf.setFont(A,h)}}}}),Object.defineProperty(this,"globalCompositeOperation",{get:function(){return this.ctx.globalCompositeOperation},set:function(e){this.ctx.globalCompositeOperation=e}}),Object.defineProperty(this,"globalAlpha",{get:function(){return this.ctx.globalAlpha},set:function(e){this.ctx.globalAlpha=e}}),Object.defineProperty(this,"lineDashOffset",{get:function(){return this.ctx.lineDashOffset},set:function(e){this.ctx.lineDashOffset=e,D.call(this)}}),Object.defineProperty(this,"lineDash",{get:function(){return this.ctx.lineDash},set:function(e){this.ctx.lineDash=e,D.call(this)}}),Object.defineProperty(this,"ignoreClearRect",{get:function(){return this.ctx.ignoreClearRect},set:function(e){this.ctx.ignoreClearRect=!!e}})};u.prototype.setLineDash=function(e){this.lineDash=e},u.prototype.getLineDash=function(){return this.lineDash.length%2?this.lineDash.concat(this.lineDash):this.lineDash.slice()},u.prototype.fill=function(){v.call(this,"fill",!1)},u.prototype.stroke=function(){v.call(this,"stroke",!1)},u.prototype.beginPath=function(){this.path=[{type:"begin"}]},u.prototype.moveTo=function(e,t){if(isNaN(e)||isNaN(t))throw mM.error("jsPDF.context2d.moveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.moveTo");var r=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"mt",x:r.x,y:r.y}),this.ctx.lastPoint=new s(e,t)},u.prototype.closePath=function(){var e=new s(0,0),t=0;for(t=this.path.length-1;-1!==t;t--)if("begin"===this.path[t].type&&"object"===LP(this.path[t+1])&&"number"==typeof this.path[t+1].x){e=new s(this.path[t+1].x,this.path[t+1].y);break}this.path.push({type:"close"}),this.ctx.lastPoint=new s(e.x,e.y)},u.prototype.lineTo=function(e,t){if(isNaN(e)||isNaN(t))throw mM.error("jsPDF.context2d.lineTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.lineTo");var r=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"lt",x:r.x,y:r.y}),this.ctx.lastPoint=new s(r.x,r.y)},u.prototype.clip=function(){this.ctx.clip_path=JSON.parse(JSON.stringify(this.path)),v.call(this,null,!0)},u.prototype.quadraticCurveTo=function(e,t,r,i){if(isNaN(r)||isNaN(i)||isNaN(e)||isNaN(t))throw mM.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");var n=this.ctx.transform.applyToPoint(new s(r,i)),a=this.ctx.transform.applyToPoint(new s(e,t));this.path.push({type:"qct",x1:a.x,y1:a.y,x:n.x,y:n.y}),this.ctx.lastPoint=new s(n.x,n.y)},u.prototype.bezierCurveTo=function(e,t,r,i,n,a){if(isNaN(n)||isNaN(a)||isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i))throw mM.error("jsPDF.context2d.bezierCurveTo: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");var o=this.ctx.transform.applyToPoint(new s(n,a)),l=this.ctx.transform.applyToPoint(new s(e,t)),h=this.ctx.transform.applyToPoint(new s(r,i));this.path.push({type:"bct",x1:l.x,y1:l.y,x2:h.x,y2:h.y,x:o.x,y:o.y}),this.ctx.lastPoint=new s(o.x,o.y)},u.prototype.arc=function(e,t,r,i,n,a){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||isNaN(n))throw mM.error("jsPDF.context2d.arc: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.arc");if(a=!!a,!this.ctx.transform.isIdentity){var o=this.ctx.transform.applyToPoint(new s(e,t));e=o.x,t=o.y;var l=this.ctx.transform.applyToPoint(new s(0,r)),h=this.ctx.transform.applyToPoint(new s(0,0));r=Math.sqrt(Math.pow(l.x-h.x,2)+Math.pow(l.y-h.y,2))}Math.abs(n-i)>=2*Math.PI&&(i=0,n=2*Math.PI),this.path.push({type:"arc",x:e,y:t,radius:r,startAngle:i,endAngle:n,counterclockwise:a})},u.prototype.arcTo=function(e,t,r,i,n){throw new Error("arcTo not implemented.")},u.prototype.rect=function(e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i))throw mM.error("jsPDF.context2d.rect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rect");this.moveTo(e,t),this.lineTo(e+r,t),this.lineTo(e+r,t+i),this.lineTo(e,t+i),this.lineTo(e,t),this.lineTo(e+r,t),this.lineTo(e,t)},u.prototype.fillRect=function(e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i))throw mM.error("jsPDF.context2d.fillRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillRect");if(!d.call(this)){var n={};"butt"!==this.lineCap&&(n.lineCap=this.lineCap,this.lineCap="butt"),"miter"!==this.lineJoin&&(n.lineJoin=this.lineJoin,this.lineJoin="miter"),this.beginPath(),this.rect(e,t,r,i),this.fill(),n.hasOwnProperty("lineCap")&&(this.lineCap=n.lineCap),n.hasOwnProperty("lineJoin")&&(this.lineJoin=n.lineJoin)}},u.prototype.strokeRect=function(e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i))throw mM.error("jsPDF.context2d.strokeRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");p.call(this)||(this.beginPath(),this.rect(e,t,r,i),this.stroke())},u.prototype.clearRect=function(e,t,r,i){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i))throw mM.error("jsPDF.context2d.clearRect: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.clearRect");this.ignoreClearRect||(this.fillStyle="#ffffff",this.fillRect(e,t,r,i))},u.prototype.save=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,r=0;r<this.pdf.internal.getNumberOfPages();r++)this.pdf.setPage(r+1),this.pdf.internal.out("q");if(this.pdf.setPage(t),e){this.ctx.fontSize=this.pdf.internal.getFontSize();var i=new A(this.ctx);this.ctxStack.push(this.ctx),this.ctx=i}},u.prototype.restore=function(e){e="boolean"!=typeof e||e;for(var t=this.pdf.internal.getCurrentPageInfo().pageNumber,r=0;r<this.pdf.internal.getNumberOfPages();r++)this.pdf.setPage(r+1),this.pdf.internal.out("Q");this.pdf.setPage(t),e&&0!==this.ctxStack.length&&(this.ctx=this.ctxStack.pop(),this.fillStyle=this.ctx.fillStyle,this.strokeStyle=this.ctx.strokeStyle,this.font=this.ctx.font,this.lineCap=this.ctx.lineCap,this.lineWidth=this.ctx.lineWidth,this.lineJoin=this.ctx.lineJoin,this.lineDash=this.ctx.lineDash,this.lineDashOffset=this.ctx.lineDashOffset)},u.prototype.toDataURL=function(){throw new Error("toDataUrl not implemented.")};var c=function(e){var t,r,i,n;if(!0===e.isCanvasGradient&&(e=e.getColor()),!e)return{r:0,g:0,b:0,a:0,style:e};if(/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(e))t=0,r=0,i=0,n=0;else{var a=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(e);if(null!==a)t=parseInt(a[1]),r=parseInt(a[2]),i=parseInt(a[3]),n=1;else if(null!==(a=/rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(e)))t=parseInt(a[1]),r=parseInt(a[2]),i=parseInt(a[3]),n=parseFloat(a[4]);else{if(n=1,"string"==typeof e&&"#"!==e.charAt(0)){var s=new bM(e);e=s.ok?s.toHex():"#000000"}4===e.length?(t=e.substring(1,2),t+=t,r=e.substring(2,3),r+=r,i=e.substring(3,4),i+=i):(t=e.substring(1,3),r=e.substring(3,5),i=e.substring(5,7)),t=parseInt(t,16),r=parseInt(r,16),i=parseInt(i,16)}}return{r:t,g:r,b:i,a:n,style:e}},d=function(){return this.ctx.isFillTransparent||0==this.globalAlpha},p=function(){return!(!this.ctx.isStrokeTransparent&&0!=this.globalAlpha)};u.prototype.fillText=function(e,t,r,i){if(isNaN(t)||isNaN(r)||"string"!=typeof e)throw mM.error("jsPDF.context2d.fillText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.fillText");if(i=isNaN(i)?void 0:i,!d.call(this)){var n=k(this.ctx.transform.rotation),a=this.ctx.transform.scaleX;I.call(this,{text:e,x:t,y:r,scale:a,angle:n,align:this.textAlign,maxWidth:i})}},u.prototype.strokeText=function(e,t,r,i){if(isNaN(t)||isNaN(r)||"string"!=typeof e)throw mM.error("jsPDF.context2d.strokeText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.strokeText");if(!p.call(this)){i=isNaN(i)?void 0:i;var n=k(this.ctx.transform.rotation),a=this.ctx.transform.scaleX;I.call(this,{text:e,x:t,y:r,scale:a,renderingMode:"stroke",angle:n,align:this.textAlign,maxWidth:i})}},u.prototype.measureText=function(e){if("string"!=typeof e)throw mM.error("jsPDF.context2d.measureText: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.measureText");var t=this.pdf,r=this.pdf.internal.scaleFactor,i=t.internal.getFontSize(),n=t.getStringUnitWidth(e)*i/t.internal.scaleFactor;return new function(e){var t=(e=e||{}).width||0;return Object.defineProperty(this,"width",{get:function(){return t}}),this}({width:n*=Math.round(96*r/72*1e4)/1e4})},u.prototype.scale=function(e,t){if(isNaN(e)||isNaN(t))throw mM.error("jsPDF.context2d.scale: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.scale");var r=new l(e,0,0,t,0,0);this.ctx.transform=this.ctx.transform.multiply(r)},u.prototype.rotate=function(e){if(isNaN(e))throw mM.error("jsPDF.context2d.rotate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.rotate");var t=new l(Math.cos(e),Math.sin(e),-Math.sin(e),Math.cos(e),0,0);this.ctx.transform=this.ctx.transform.multiply(t)},u.prototype.translate=function(e,t){if(isNaN(e)||isNaN(t))throw mM.error("jsPDF.context2d.translate: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.translate");var r=new l(1,0,0,1,e,t);this.ctx.transform=this.ctx.transform.multiply(r)},u.prototype.transform=function(e,t,r,i,n,a){if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(i)||isNaN(n)||isNaN(a))throw mM.error("jsPDF.context2d.transform: Invalid arguments",arguments),new Error("Invalid arguments passed to jsPDF.context2d.transform");var s=new l(e,t,r,i,n,a);this.ctx.transform=this.ctx.transform.multiply(s)},u.prototype.setTransform=function(e,t,r,i,n,a){e=isNaN(e)?1:e,t=isNaN(t)?0:t,r=isNaN(r)?0:r,i=isNaN(i)?1:i,n=isNaN(n)?0:n,a=isNaN(a)?0:a,this.ctx.transform=new l(e,t,r,i,n,a)};var f=function(){return this.margin[0]>0||this.margin[1]>0||this.margin[2]>0||this.margin[3]>0};u.prototype.drawImage=function(e,t,r,i,n,a,s,h,A){var u=this.pdf.getImageProperties(e),c=1,d=1,p=1,m=1;void 0!==i&&void 0!==h&&(p=h/i,m=A/n,c=u.width/i*h/i,d=u.height/n*A/n),void 0===a&&(a=t,s=r,t=0,r=0),void 0!==i&&void 0===h&&(h=i,A=n),void 0===i&&void 0===h&&(h=u.width,A=u.height);for(var v,b=this.ctx.transform.decompose(),x=k(b.rotate.shx),B=new l,C=(B=(B=(B=B.multiply(b.translate)).multiply(b.skew)).multiply(b.scale)).applyToRectangle(new o(a-t*p,s-r*m,i*c,n*d)),S=g.call(this,C),E=[],I=0;I<S.length;I+=1)-1===E.indexOf(S[I])&&E.push(S[I]);if(_(E),this.autoPaging)for(var T=E[0],F=E[E.length-1],P=T;P<F+1;P++){this.pdf.setPage(P);var L=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],M=1===P?this.posY+this.margin[0]:this.margin[0],U=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],R=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],D=1===P?0:U+(P-2)*R;if(0!==this.ctx.clip_path.length){var N=this.path;v=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(v,this.posX+this.margin[3],-D+M+this.ctx.prevPageLastElemOffset),w.call(this,"fill",!0),this.path=N}var O=JSON.parse(JSON.stringify(C));O=y([O],this.posX+this.margin[3],-D+M+this.ctx.prevPageLastElemOffset)[0];var Q=(P>T||P<F)&&f.call(this);Q&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],L,R,null).clip().discardPath()),this.pdf.addImage(e,"JPEG",O.x,O.y,O.w,O.h,null,null,x),Q&&this.pdf.restoreGraphicsState()}else this.pdf.addImage(e,"JPEG",C.x,C.y,C.w,C.h,null,null,x)};var g=function(e,t,r){var i=[];t=t||this.pdf.internal.pageSize.width,r=r||this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2];var n=this.posY+this.ctx.prevPageLastElemOffset;switch(e.type){default:case"mt":case"lt":i.push(Math.floor((e.y+n)/r)+1);break;case"arc":i.push(Math.floor((e.y+n-e.radius)/r)+1),i.push(Math.floor((e.y+n+e.radius)/r)+1);break;case"qct":var a=U(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x,e.y);i.push(Math.floor((a.y+n)/r)+1),i.push(Math.floor((a.y+a.h+n)/r)+1);break;case"bct":var s=R(this.ctx.lastPoint.x,this.ctx.lastPoint.y,e.x1,e.y1,e.x2,e.y2,e.x,e.y);i.push(Math.floor((s.y+n)/r)+1),i.push(Math.floor((s.y+s.h+n)/r)+1);break;case"rect":i.push(Math.floor((e.y+n)/r)+1),i.push(Math.floor((e.y+e.h+n)/r)+1)}for(var o=0;o<i.length;o+=1)for(;this.pdf.internal.getNumberOfPages()<i[o];)m.call(this);return i},m=function(){var e=this.fillStyle,t=this.strokeStyle,r=this.font,i=this.lineCap,n=this.lineWidth,a=this.lineJoin;this.pdf.addPage(),this.fillStyle=e,this.strokeStyle=t,this.font=r,this.lineCap=i,this.lineWidth=n,this.lineJoin=a},y=function(e,t,r){for(var i=0;i<e.length;i++)switch(e[i].type){case"bct":e[i].x2+=t,e[i].y2+=r;case"qct":e[i].x1+=t,e[i].y1+=r;default:e[i].x+=t,e[i].y+=r}return e},_=function(e){return e.sort((function(e,t){return e-t}))},v=function(e,t){for(var r,i,n=this.fillStyle,a=this.strokeStyle,s=this.lineCap,o=this.lineWidth,l=Math.abs(o*this.ctx.transform.scaleX),h=this.lineJoin,A=JSON.parse(JSON.stringify(this.path)),u=JSON.parse(JSON.stringify(this.path)),c=[],d=0;d<u.length;d++)if(void 0!==u[d].x)for(var p=g.call(this,u[d]),v=0;v<p.length;v+=1)-1===c.indexOf(p[v])&&c.push(p[v]);for(var b=0;b<c.length;b++)for(;this.pdf.internal.getNumberOfPages()<c[b];)m.call(this);if(_(c),this.autoPaging)for(var x=c[0],B=c[c.length-1],C=x;C<B+1;C++){this.pdf.setPage(C),this.fillStyle=n,this.strokeStyle=a,this.lineCap=s,this.lineWidth=l,this.lineJoin=h;var S=this.pdf.internal.pageSize.width-this.margin[3]-this.margin[1],E=1===C?this.posY+this.margin[0]:this.margin[0],I=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],T=this.pdf.internal.pageSize.height-this.margin[0]-this.margin[2],F=1===C?0:I+(C-2)*T;if(0!==this.ctx.clip_path.length){var P=this.path;r=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(r,this.posX+this.margin[3],-F+E+this.ctx.prevPageLastElemOffset),w.call(this,e,!0),this.path=P}if(i=JSON.parse(JSON.stringify(A)),this.path=y(i,this.posX+this.margin[3],-F+E+this.ctx.prevPageLastElemOffset),!1===t||0===C){var L=(C>x||C<B)&&f.call(this);L&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],S,T,null).clip().discardPath()),w.call(this,e,t),L&&this.pdf.restoreGraphicsState()}this.lineWidth=o}else this.lineWidth=l,w.call(this,e,t),this.lineWidth=o;this.path=A},w=function(e,t){if(("stroke"!==e||t||!p.call(this))&&("stroke"===e||t||!d.call(this))){for(var r,i,n=[],a=this.path,s=0;s<a.length;s++){var o=a[s];switch(o.type){case"begin":n.push({begin:!0});break;case"close":n.push({close:!0});break;case"mt":n.push({start:o,deltas:[],abs:[]});break;case"lt":var l=n.length;if(a[s-1]&&!isNaN(a[s-1].x)&&(r=[o.x-a[s-1].x,o.y-a[s-1].y],l>0))for(;l>=0;l--)if(!0!==n[l-1].close&&!0!==n[l-1].begin){n[l-1].deltas.push(r),n[l-1].abs.push(o);break}break;case"bct":r=[o.x1-a[s-1].x,o.y1-a[s-1].y,o.x2-a[s-1].x,o.y2-a[s-1].y,o.x-a[s-1].x,o.y-a[s-1].y],n[n.length-1].deltas.push(r);break;case"qct":var h=a[s-1].x+2/3*(o.x1-a[s-1].x),A=a[s-1].y+2/3*(o.y1-a[s-1].y),u=o.x+2/3*(o.x1-o.x),c=o.y+2/3*(o.y1-o.y),f=o.x,g=o.y;r=[h-a[s-1].x,A-a[s-1].y,u-a[s-1].x,c-a[s-1].y,f-a[s-1].x,g-a[s-1].y],n[n.length-1].deltas.push(r);break;case"arc":n.push({deltas:[],abs:[],arc:!0}),Array.isArray(n[n.length-1].abs)&&n[n.length-1].abs.push(o)}}i=t?null:"stroke"===e?"stroke":"fill";for(var m=!1,y=0;y<n.length;y++)if(n[y].arc)for(var _=n[y].abs,v=0;v<_.length;v++){var w=_[v];"arc"===w.type?B.call(this,w.x,w.y,w.radius,w.startAngle,w.endAngle,w.counterclockwise,void 0,t,!m):T.call(this,w.x,w.y),m=!0}else if(!0===n[y].close)this.pdf.internal.out("h"),m=!1;else if(!0!==n[y].begin){var b=n[y].start.x,x=n[y].start.y;F.call(this,n[y].deltas,b,x),m=!0}i&&C.call(this,i),t&&S.call(this)}},b=function(e){var t=this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor,r=t*(this.pdf.internal.getLineHeightFactor()-1);switch(this.ctx.textBaseline){case"bottom":return e-r;case"top":return e+t-r;case"hanging":return e+t-2*r;case"middle":return e+t/2-r;default:return e}},x=function(e){return e+this.pdf.internal.getFontSize()/this.pdf.internal.scaleFactor*(this.pdf.internal.getLineHeightFactor()-1)};u.prototype.createLinearGradient=function(){var e=function(){};return e.colorStops=[],e.addColorStop=function(e,t){this.colorStops.push([e,t])},e.getColor=function(){return 0===this.colorStops.length?"#000000":this.colorStops[0][1]},e.isCanvasGradient=!0,e},u.prototype.createPattern=function(){return this.createLinearGradient()},u.prototype.createRadialGradient=function(){return this.createLinearGradient()};var B=function(e,t,r,i,n,a,s,o,l){for(var h=L.call(this,r,i,n,a),A=0;A<h.length;A++){var u=h[A];0===A&&(l?E.call(this,u.x1+e,u.y1+t):T.call(this,u.x1+e,u.y1+t)),P.call(this,e,t,u.x2,u.y2,u.x3,u.y3,u.x4,u.y4)}o?S.call(this):C.call(this,s)},C=function(e){switch(e){case"stroke":this.pdf.internal.out("S");break;case"fill":this.pdf.internal.out("f")}},S=function(){this.pdf.clip(),this.pdf.discardPath()},E=function(e,t){this.pdf.internal.out(r(e)+" "+i(t)+" m")},I=function(e){var t;switch(e.align){case"right":case"end":t="right";break;case"center":t="center";break;default:t="left"}var r=this.pdf.getTextDimensions(e.text),i=b.call(this,e.y),n=x.call(this,i)-r.h,a=this.ctx.transform.applyToPoint(new s(e.x,i)),h=this.ctx.transform.decompose(),A=new l;A=(A=(A=A.multiply(h.translate)).multiply(h.skew)).multiply(h.scale);for(var u,c,d,p=this.ctx.transform.applyToRectangle(new o(e.x,i,r.w,r.h)),m=A.applyToRectangle(new o(e.x,n,r.w,r.h)),v=g.call(this,m),B=[],C=0;C<v.length;C+=1)-1===B.indexOf(v[C])&&B.push(v[C]);if(_(B),this.autoPaging)for(var S=B[0],E=B[B.length-1],I=S;I<E+1;I++){this.pdf.setPage(I);var T=1===I?this.posY+this.margin[0]:this.margin[0],F=this.pdf.internal.pageSize.height-this.posY-this.margin[0]-this.margin[2],P=this.pdf.internal.pageSize.height-this.margin[2],L=P-this.margin[0],M=this.pdf.internal.pageSize.width-this.margin[1],k=M-this.margin[3],U=1===I?0:F+(I-2)*L;if(0!==this.ctx.clip_path.length){var R=this.path;u=JSON.parse(JSON.stringify(this.ctx.clip_path)),this.path=y(u,this.posX+this.margin[3],-1*U+T),w.call(this,"fill",!0),this.path=R}var D=y([JSON.parse(JSON.stringify(m))],this.posX+this.margin[3],-U+T+this.ctx.prevPageLastElemOffset)[0];e.scale>=.01&&(c=this.pdf.internal.getFontSize(),this.pdf.setFontSize(c*e.scale),d=this.lineWidth,this.lineWidth=d*e.scale);var N="text"!==this.autoPaging;if(N||D.y+D.h<=P){if(N||D.y>=T&&D.x<=M){var O=N?e.text:this.pdf.splitTextToSize(e.text,e.maxWidth||M-D.x)[0],Q=y([JSON.parse(JSON.stringify(p))],this.posX+this.margin[3],-U+T+this.ctx.prevPageLastElemOffset)[0],z=N&&(I>S||I<E)&&f.call(this);z&&(this.pdf.saveGraphicsState(),this.pdf.rect(this.margin[3],this.margin[0],k,L,null).clip().discardPath()),this.pdf.text(O,Q.x,Q.y,{angle:e.angle,align:t,renderingMode:e.renderingMode}),z&&this.pdf.restoreGraphicsState()}}else D.y<P&&(this.ctx.prevPageLastElemOffset+=P-D.y);e.scale>=.01&&(this.pdf.setFontSize(c),this.lineWidth=d)}else e.scale>=.01&&(c=this.pdf.internal.getFontSize(),this.pdf.setFontSize(c*e.scale),d=this.lineWidth,this.lineWidth=d*e.scale),this.pdf.text(e.text,a.x+this.posX,a.y+this.posY,{angle:e.angle,align:t,renderingMode:e.renderingMode,maxWidth:e.maxWidth}),e.scale>=.01&&(this.pdf.setFontSize(c),this.lineWidth=d)},T=function(e,t,n,a){n=n||0,a=a||0,this.pdf.internal.out(r(e+n)+" "+i(t+a)+" l")},F=function(e,t,r){return this.pdf.lines(e,t,r,null,null)},P=function(e,r,i,s,o,l,h,A){this.pdf.internal.out([t(n(i+e)),t(a(s+r)),t(n(o+e)),t(a(l+r)),t(n(h+e)),t(a(A+r)),"c"].join(" "))},L=function(e,t,r,i){for(var n=2*Math.PI,a=Math.PI/2;t>r;)t-=n;var s=Math.abs(r-t);s<n&&i&&(s=n-s);for(var o=[],l=i?-1:1,h=t;s>1e-5;){var A=h+l*Math.min(s,a);o.push(M.call(this,e,h,A)),s-=Math.abs(A-h),h=A}return o},M=function(e,t,r){var i=(r-t)/2,n=e*Math.cos(i),a=e*Math.sin(i),s=n,o=-a,l=s*s+o*o,h=l+s*n+o*a,A=4/3*(Math.sqrt(2*l*h)-h)/(s*a-o*n),u=s-A*o,c=o+A*s,d=u,p=-c,f=i+t,g=Math.cos(f),m=Math.sin(f);return{x1:e*Math.cos(t),y1:e*Math.sin(t),x2:u*g-c*m,y2:u*m+c*g,x3:d*g-p*m,y3:d*m+p*g,x4:e*Math.cos(r),y4:e*Math.sin(r)}},k=function(e){return 180*e/Math.PI},U=function(e,t,r,i,n,a){var s=e+.5*(r-e),l=t+.5*(i-t),h=n+.5*(r-n),A=a+.5*(i-a),u=Math.min(e,n,s,h),c=Math.max(e,n,s,h),d=Math.min(t,a,l,A),p=Math.max(t,a,l,A);return new o(u,d,c-u,p-d)},R=function(e,t,r,i,n,a,s,l){var h,A,u,c,d,p,f,g,m,y,_,v,w,b,x=r-e,B=i-t,C=n-r,S=a-i,E=s-n,I=l-a;for(A=0;A<41;A++)m=(f=(u=e+(h=A/40)*x)+h*((d=r+h*C)-u))+h*(d+h*(n+h*E-d)-f),y=(g=(c=t+h*B)+h*((p=i+h*S)-c))+h*(p+h*(a+h*I-p)-g),0==A?(_=m,v=y,w=m,b=y):(_=Math.min(_,m),v=Math.min(v,y),w=Math.max(w,m),b=Math.max(b,y));return new o(Math.round(_),Math.round(v),Math.round(w-_),Math.round(b-v))},D=function(){if(this.prevLineDash||this.ctx.lineDash.length||this.ctx.lineDashOffset){var e,t,r=(e=this.ctx.lineDash,t=this.ctx.lineDashOffset,JSON.stringify({lineDash:e,lineDashOffset:t}));this.prevLineDash!==r&&(this.pdf.setLineDash(this.ctx.lineDash,this.ctx.lineDashOffset),this.prevLineDash=r)}}})(ZM.API),function(e){var t=function(e){var t,r,i,n,a,s,o,l,h,A;for(/[^\x00-\xFF]/.test(e),r=[],i=0,n=(e+=t="\0\0\0\0".slice(e.length%4||4)).length;n>i;i+=4)0!==(a=(e.charCodeAt(i)<<24)+(e.charCodeAt(i+1)<<16)+(e.charCodeAt(i+2)<<8)+e.charCodeAt(i+3))?(s=(a=((a=((a=((a=(a-(A=a%85))/85)-(h=a%85))/85)-(l=a%85))/85)-(o=a%85))/85)%85,r.push(s+33,o+33,l+33,h+33,A+33)):r.push(122);return function(e,t){for(var r=t;r>0;r--)e.pop()}(r,t.length),String.fromCharCode.apply(String,r)+"~>"},r=function(e){var t,r,i,n,a,s=String,o="length",l=255,h="charCodeAt",A="slice",u="replace";for(e[A](-2),e=e[A](0,-2)[u](/\s/g,"")[u]("z","!!!!!"),i=[],n=0,a=(e+=t="uuuuu"[A](e[o]%5||5))[o];a>n;n+=5)r=52200625*(e[h](n)-33)+614125*(e[h](n+1)-33)+7225*(e[h](n+2)-33)+85*(e[h](n+3)-33)+(e[h](n+4)-33),i.push(l&r>>24,l&r>>16,l&r>>8,l&r);return function(e,t){for(var r=t;r>0;r--)e.pop()}(i,t[o]),s.fromCharCode.apply(s,i)},i=function(e){return e.split("").map((function(e){return("0"+e.charCodeAt().toString(16)).slice(-2)})).join("")+">"},n=function(e){var t=new RegExp(/^([0-9A-Fa-f]{2})+$/);if(-1!==(e=e.replace(/\s/g,"")).indexOf(">")&&(e=e.substr(0,e.indexOf(">"))),e.length%2&&(e+="0"),!1===t.test(e))return"";for(var r="",i=0;i<e.length;i+=2)r+=String.fromCharCode("0x"+(e[i]+e[i+1]));return r},a=function(e){for(var t=new Uint8Array(e.length),r=e.length;r--;)t[r]=e.charCodeAt(r);return(t=dL(t)).reduce((function(e,t){return e+String.fromCharCode(t)}),"")};e.processDataByFilters=function(e,s){var o=0,l=e||"",h=[];for("string"==typeof(s=s||[])&&(s=[s]),o=0;o<s.length;o+=1)switch(s[o]){case"ASCII85Decode":case"/ASCII85Decode":l=r(l),h.push("/ASCII85Encode");break;case"ASCII85Encode":case"/ASCII85Encode":l=t(l),h.push("/ASCII85Decode");break;case"ASCIIHexDecode":case"/ASCIIHexDecode":l=n(l),h.push("/ASCIIHexEncode");break;case"ASCIIHexEncode":case"/ASCIIHexEncode":l=i(l),h.push("/ASCIIHexDecode");break;case"FlateEncode":case"/FlateEncode":l=a(l),h.push("/FlateDecode");break;default:throw new Error('The filter: "'+s[o]+'" is not implemented')}return{data:l,reverseChain:h.reverse().join(" ")}}}(ZM.API),function(e){e.loadFile=function(e,t,r){return function(e,t,r){t=!1!==t,r="function"==typeof r?r:function(){};var i=void 0;try{i=function(e,t,r){var i=new XMLHttpRequest,n=0,a=function(e){var t=e.length,r=[],i=String.fromCharCode;for(n=0;n<t;n+=1)r.push(i(255&e.charCodeAt(n)));return r.join("")};if(i.open("GET",e,!t),i.overrideMimeType("text/plain; charset=x-user-defined"),!1===t&&(i.onload=function(){200===i.status?r(a(this.responseText)):r(void 0)}),i.send(null),t&&200===i.status)return a(i.responseText)}(e,t,r)}catch{}return i}(e,t,r)},e.loadImageFile=e.loadFile}(ZM.API),function(e){function t(){return(fM.html2canvas?Promise.resolve(fM.html2canvas):Promise.resolve().then((()=>h($r())))).catch((function(e){return Promise.reject(new Error("Could not load html2canvas: "+e))})).then((function(e){return e.default?e.default:e}))}function r(){return(fM.DOMPurify?Promise.resolve(fM.DOMPurify):Promise.resolve().then((()=>(tn(),Xr)))).catch((function(e){return Promise.reject(new Error("Could not load dompurify: "+e))})).then((function(e){return e.default?e.default:e}))}var i=function(e){var t=LP(e);return"undefined"===t?"undefined":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?"function":e&&e.constructor===Array?"array":e&&1===e.nodeType?"element":"object"===t?"object":"unknown"},n=function(e,t){var r=document.createElement(e);for(var i in t.className&&(r.className=t.className),t.innerHTML&&t.dompurify&&(r.innerHTML=t.dompurify.sanitize(t.innerHTML)),t.style)r.style[i]=t.style[i];return r},a=function e(t,r){for(var i=3===t.nodeType?document.createTextNode(t.nodeValue):t.cloneNode(!1),n=t.firstChild;n;n=n.nextSibling)!0!==r&&1===n.nodeType&&"SCRIPT"===n.nodeName||i.appendChild(e(n,r));return 1===t.nodeType&&("CANVAS"===t.nodeName?(i.width=t.width,i.height=t.height,i.getContext("2d").drawImage(t,0,0)):"TEXTAREA"!==t.nodeName&&"SELECT"!==t.nodeName||(i.value=t.value),i.addEventListener("load",(function(){i.scrollTop=t.scrollTop,i.scrollLeft=t.scrollLeft}),!0)),i},s=function e(t){var r=Object.assign(e.convert(Promise.resolve()),JSON.parse(JSON.stringify(e.template))),i=e.convert(Promise.resolve(),r);return(i=i.setProgress(1,e,1,[e])).set(t)};(s.prototype=Object.create(Promise.prototype)).constructor=s,s.convert=function(e,t){return e.__proto__=t||s.prototype,e},s.template={prop:{src:null,container:null,overlay:null,canvas:null,img:null,pdf:null,pageSize:null,callback:function(){}},progress:{val:0,state:null,n:0,stack:[]},opt:{filename:"file.pdf",margin:[0,0,0,0],enableLinks:!0,x:0,y:0,html2canvas:{},jsPDF:{},backgroundColor:"transparent"}},s.prototype.from=function(e,t){return this.then((function(){switch(t=t||function(e){switch(i(e)){case"string":return"string";case"element":return"canvas"===e.nodeName.toLowerCase()?"canvas":"element";default:return"unknown"}}(e)){case"string":return this.then(r).then((function(t){return this.set({src:n("div",{innerHTML:e,dompurify:t})})}));case"element":return this.set({src:e});case"canvas":return this.set({canvas:e});case"img":return this.set({img:e});default:return this.error("Unknown source type.")}}))},s.prototype.to=function(e){switch(e){case"container":return this.toContainer();case"canvas":return this.toCanvas();case"img":return this.toImg();case"pdf":return this.toPdf();default:return this.error("Invalid target.")}},s.prototype.toContainer=function(){return this.thenList([function(){return this.prop.src||this.error("Cannot duplicate - no source HTML.")},function(){return this.prop.pageSize||this.setPageSize()}]).then((function(){var e={position:"relative",display:"inline-block",width:("number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?Math.max(this.prop.src.clientWidth,this.prop.src.scrollWidth,this.prop.src.offsetWidth):this.opt.windowWidth)+"px",left:0,right:0,top:0,margin:"auto",backgroundColor:this.opt.backgroundColor},t=a(this.prop.src,this.opt.html2canvas.javascriptEnabled);"BODY"===t.tagName&&(e.height=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)+"px"),this.prop.overlay=n("div",{className:"html2pdf__overlay",style:{position:"fixed",overflow:"hidden",zIndex:1e3,left:"-100000px",right:0,bottom:0,top:0}}),this.prop.container=n("div",{className:"html2pdf__container",style:e}),this.prop.container.appendChild(t),this.prop.container.firstChild.appendChild(n("div",{style:{clear:"both",border:"0 none transparent",margin:0,padding:0,height:0}})),this.prop.container.style.float="none",this.prop.overlay.appendChild(this.prop.container),document.body.appendChild(this.prop.overlay),this.prop.container.firstChild.style.position="relative",this.prop.container.height=Math.max(this.prop.container.firstChild.clientHeight,this.prop.container.firstChild.scrollHeight,this.prop.container.firstChild.offsetHeight)+"px"}))},s.prototype.toCanvas=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=Object.assign({},this.opt.html2canvas);return delete t.onrendered,e(this.prop.container,t)})).then((function(e){(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},s.prototype.toContext2d=function(){var e=[function(){return document.body.contains(this.prop.container)||this.toContainer()}];return this.thenList(e).then(t).then((function(e){var t=this.opt.jsPDF,r=this.opt.fontFaces,i="number"!=typeof this.opt.width||isNaN(this.opt.width)||"number"!=typeof this.opt.windowWidth||isNaN(this.opt.windowWidth)?1:this.opt.width/this.opt.windowWidth,n=Object.assign({async:!0,allowTaint:!0,scale:i,scrollX:this.opt.scrollX||0,scrollY:this.opt.scrollY||0,backgroundColor:"#ffffff",imageTimeout:15e3,logging:!0,proxy:null,removeContainer:!0,foreignObjectRendering:!1,useCORS:!1},this.opt.html2canvas);if(delete n.onrendered,t.context2d.autoPaging=void 0===this.opt.autoPaging||this.opt.autoPaging,t.context2d.posX=this.opt.x,t.context2d.posY=this.opt.y,t.context2d.margin=this.opt.margin,t.context2d.fontFaces=r,r)for(var a=0;a<r.length;++a){var s=r[a],o=s.src.find((function(e){return"truetype"===e.format}));o&&t.addFont(o.url,s.ref.name,s.ref.style)}return n.windowHeight=n.windowHeight||0,n.windowHeight=0==n.windowHeight?Math.max(this.prop.container.clientHeight,this.prop.container.scrollHeight,this.prop.container.offsetHeight):n.windowHeight,t.context2d.save(!0),e(this.prop.container,n)})).then((function(e){this.opt.jsPDF.context2d.restore(!0),(this.opt.html2canvas.onrendered||function(){})(e),this.prop.canvas=e,document.body.removeChild(this.prop.overlay)}))},s.prototype.toImg=function(){return this.thenList([function(){return this.prop.canvas||this.toCanvas()}]).then((function(){var e=this.prop.canvas.toDataURL("image/"+this.opt.image.type,this.opt.image.quality);this.prop.img=document.createElement("img"),this.prop.img.src=e}))},s.prototype.toPdf=function(){return this.thenList([function(){return this.toContext2d()}]).then((function(){this.prop.pdf=this.prop.pdf||this.opt.jsPDF}))},s.prototype.output=function(e,t,r){return"img"===(r=r||"pdf").toLowerCase()||"image"===r.toLowerCase()?this.outputImg(e,t):this.outputPdf(e,t)},s.prototype.outputPdf=function(e,t){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){return this.prop.pdf.output(e,t)}))},s.prototype.outputImg=function(e){return this.thenList([function(){return this.prop.img||this.toImg()}]).then((function(){switch(e){case void 0:case"img":return this.prop.img;case"datauristring":case"dataurlstring":return this.prop.img.src;case"datauri":case"dataurl":return document.location.href=this.prop.img.src;default:throw'Image output type "'+e+'" is not supported.'}}))},s.prototype.save=function(e){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).set(e?{filename:e}:null).then((function(){this.prop.pdf.save(this.opt.filename)}))},s.prototype.doCallback=function(){return this.thenList([function(){return this.prop.pdf||this.toPdf()}]).then((function(){this.prop.callback(this.prop.pdf)}))},s.prototype.set=function(e){if("object"!==i(e))return this;var t=Object.keys(e||{}).map((function(t){if(t in s.template.prop)return function(){this.prop[t]=e[t]};switch(t){case"margin":return this.setMargin.bind(this,e.margin);case"jsPDF":return function(){return this.opt.jsPDF=e.jsPDF,this.setPageSize()};case"pageSize":return this.setPageSize.bind(this,e.pageSize);default:return function(){this.opt[t]=e[t]}}}),this);return this.then((function(){return this.thenList(t)}))},s.prototype.get=function(e,t){return this.then((function(){var r=e in s.template.prop?this.prop[e]:this.opt[e];return t?t(r):r}))},s.prototype.setMargin=function(e){return this.then((function(){switch(i(e)){case"number":e=[e,e,e,e];case"array":if(2===e.length&&(e=[e[0],e[1],e[0],e[1]]),4===e.length)break;default:return this.error("Invalid margin array.")}this.opt.margin=e})).then(this.setPageSize)},s.prototype.setPageSize=function(e){function t(e,t){return Math.floor(e*t/72*96)}return this.then((function(){(e=e||ZM.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner")||(e.inner={width:e.width-this.opt.margin[1]-this.opt.margin[3],height:e.height-this.opt.margin[0]-this.opt.margin[2]},e.inner.px={width:t(e.inner.width,e.k),height:t(e.inner.height,e.k)},e.inner.ratio=e.inner.height/e.inner.width),this.prop.pageSize=e}))},s.prototype.setProgress=function(e,t,r,i){return null!=e&&(this.progress.val=e),null!=t&&(this.progress.state=t),null!=r&&(this.progress.n=r),null!=i&&(this.progress.stack=i),this.progress.ratio=this.progress.val/this.progress.state,this},s.prototype.updateProgress=function(e,t,r,i){return this.setProgress(e?this.progress.val+e:null,t||null,r?this.progress.n+r:null,i?this.progress.stack.concat(i):null)},s.prototype.then=function(e,t){var r=this;return this.thenCore(e,t,(function(e,t){return r.updateProgress(null,null,1,[e]),Promise.prototype.then.call(this,(function(t){return r.updateProgress(null,e),t})).then(e,t).then((function(e){return r.updateProgress(1),e}))}))},s.prototype.thenCore=function(e,t,r){r=r||Promise.prototype.then;var i=this;e&&(e=e.bind(i)),t&&(t=t.bind(i));var n=-1!==Promise.toString().indexOf("[native code]")&&"Promise"===Promise.name?i:s.convert(Object.assign({},i),Promise.prototype),a=r.call(n,e,t);return s.convert(a,i.__proto__)},s.prototype.thenExternal=function(e,t){return Promise.prototype.then.call(this,e,t)},s.prototype.thenList=function(e){var t=this;return e.forEach((function(e){t=t.thenCore(e)})),t},s.prototype.catch=function(e){e&&(e=e.bind(this));var t=Promise.prototype.catch.call(this,e);return s.convert(t,this)},s.prototype.catchExternal=function(e){return Promise.prototype.catch.call(this,e)},s.prototype.error=function(e){return this.then((function(){throw new Error(e)}))},s.prototype.using=s.prototype.set,s.prototype.saveAs=s.prototype.save,s.prototype.export=s.prototype.output,s.prototype.run=s.prototype.then,ZM.getPageSize=function(e,t,r){if("object"===LP(e)){var i=e;e=i.orientation,t=i.unit||t,r=i.format||r}t=t||"mm",r=r||"a4",e=(""+(e||"P")).toLowerCase();var n,a=(""+r).toLowerCase(),s={a0:[2383.94,3370.39],a1:[1683.78,2383.94],a2:[1190.55,1683.78],a3:[841.89,1190.55],a4:[595.28,841.89],a5:[419.53,595.28],a6:[297.64,419.53],a7:[209.76,297.64],a8:[147.4,209.76],a9:[104.88,147.4],a10:[73.7,104.88],b0:[2834.65,4008.19],b1:[2004.09,2834.65],b2:[1417.32,2004.09],b3:[1000.63,1417.32],b4:[708.66,1000.63],b5:[498.9,708.66],b6:[354.33,498.9],b7:[249.45,354.33],b8:[175.75,249.45],b9:[124.72,175.75],b10:[87.87,124.72],c0:[2599.37,3676.54],c1:[1836.85,2599.37],c2:[1298.27,1836.85],c3:[918.43,1298.27],c4:[649.13,918.43],c5:[459.21,649.13],c6:[323.15,459.21],c7:[229.61,323.15],c8:[161.57,229.61],c9:[113.39,161.57],c10:[79.37,113.39],dl:[311.81,623.62],letter:[612,792],"government-letter":[576,756],legal:[612,1008],"junior-legal":[576,360],ledger:[1224,792],tabloid:[792,1224],"credit-card":[153,243]};switch(t){case"pt":n=1;break;case"mm":n=72/25.4;break;case"cm":n=72/2.54;break;case"in":n=72;break;case"px":n=.75;break;case"pc":case"em":n=12;break;case"ex":n=6;break;default:throw"Invalid unit: "+t}var o,l=0,h=0;if(s.hasOwnProperty(a))l=s[a][1]/n,h=s[a][0]/n;else try{l=r[1],h=r[0]}catch{throw new Error("Invalid format: "+r)}if("p"===e||"portrait"===e)e="p",h>l&&(o=h,h=l,l=o);else{if("l"!==e&&"landscape"!==e)throw"Invalid orientation: "+e;e="l",l>h&&(o=h,h=l,l=o)}return{width:h,height:l,unit:t,k:n,orientation:e}},e.html=function(e,t){(t=t||{}).callback=t.callback||function(){},t.html2canvas=t.html2canvas||{},t.html2canvas.canvas=t.html2canvas.canvas||this.canvas,t.jsPDF=t.jsPDF||this,t.fontFaces=t.fontFaces?t.fontFaces.map(zk):null;var r=new s(t);return t.worker?r:r.from(e).doCallback()}}(ZM.API),ZM.API.addJS=function(e){return Xk=e,this.internal.events.subscribe("postPutResources",(function(){Wk=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/Names [(EmbeddedJS) "+(Wk+1)+" 0 R]"),this.internal.out(">>"),this.internal.out("endobj"),$k=this.internal.newObject(),this.internal.out("<<"),this.internal.out("/S /JavaScript"),this.internal.out("/JS ("+Xk+")"),this.internal.out(">>"),this.internal.out("endobj")})),this.internal.events.subscribe("putCatalog",(function(){void 0!==Wk&&void 0!==$k&&this.internal.out("/Names <</JavaScript "+Wk+" 0 R>>")})),this},function(e){var t;e.events.push(["postPutResources",function(){var e=this,r=/^(\d+) 0 obj$/;if(this.outline.root.children.length>0)for(var i=e.outline.render().split(/\r\n/),n=0;n<i.length;n++){var a=i[n],s=r.exec(a);if(null!=s){var o=s[1];e.internal.newObjectDeferredBegin(o,!1)}e.internal.write(a)}if(this.outline.createNamedDestinations){var l=this.internal.pages.length,h=[];for(n=0;n<l;n++){var A=e.internal.newObject();h.push(A);var u=e.internal.getPageInfo(n+1);e.internal.write("<< /D["+u.objId+" 0 R /XYZ null null null]>> endobj")}var c=e.internal.newObject();for(e.internal.write("<< /Names [ "),n=0;n<h.length;n++)e.internal.write("(page_"+(n+1)+")"+h[n]+" 0 R");e.internal.write(" ] >>","endobj"),t=e.internal.newObject(),e.internal.write("<< /Dests "+c+" 0 R"),e.internal.write(">>","endobj")}}]),e.events.push(["putCatalog",function(){var e=this;e.outline.root.children.length>0&&(e.internal.write("/Outlines",this.outline.makeRef(this.outline.root)),this.outline.createNamedDestinations&&e.internal.write("/Names "+t+" 0 R"))}]),e.events.push(["initialized",function(){var e=this;e.outline={createNamedDestinations:!1,root:{children:[]}},e.outline.add=function(e,t,r){var i={title:t,options:r,children:[]};return null==e&&(e=this.root),e.children.push(i),i},e.outline.render=function(){return this.ctx={},this.ctx.val="",this.ctx.pdf=e,this.genIds_r(this.root),this.renderRoot(this.root),this.renderItems(this.root),this.ctx.val},e.outline.genIds_r=function(t){t.id=e.internal.newObjectDeferred();for(var r=0;r<t.children.length;r++)this.genIds_r(t.children[r])},e.outline.renderRoot=function(e){this.objStart(e),this.line("/Type /Outlines"),e.children.length>0&&(this.line("/First "+this.makeRef(e.children[0])),this.line("/Last "+this.makeRef(e.children[e.children.length-1]))),this.line("/Count "+this.count_r({count:0},e)),this.objEnd()},e.outline.renderItems=function(t){for(var r=this.ctx.pdf.internal.getVerticalCoordinateString,i=0;i<t.children.length;i++){var n=t.children[i];this.objStart(n),this.line("/Title "+this.makeString(n.title)),this.line("/Parent "+this.makeRef(t)),i>0&&this.line("/Prev "+this.makeRef(t.children[i-1])),i<t.children.length-1&&this.line("/Next "+this.makeRef(t.children[i+1])),n.children.length>0&&(this.line("/First "+this.makeRef(n.children[0])),this.line("/Last "+this.makeRef(n.children[n.children.length-1])));var a=this.count=this.count_r({count:0},n);if(a>0&&this.line("/Count "+a),n.options&&n.options.pageNumber){var s=e.internal.getPageInfo(n.options.pageNumber);this.line("/Dest ["+s.objId+" 0 R /XYZ 0 "+r(0)+" 0]")}this.objEnd()}for(var o=0;o<t.children.length;o++)this.renderItems(t.children[o])},e.outline.line=function(e){this.ctx.val+=e+"\r\n"},e.outline.makeRef=function(e){return e.id+" 0 R"},e.outline.makeString=function(t){return"("+e.internal.pdfEscape(t)+")"},e.outline.objStart=function(e){this.ctx.val+="\r\n"+e.id+" 0 obj\r\n<<\r\n"},e.outline.objEnd=function(){this.ctx.val+=">> \r\nendobj\r\n"},e.outline.count_r=function(e,t){for(var r=0;r<t.children.length;r++)e.count++,this.count_r(e,t.children[r]);return e.count}}])}(ZM.API),function(e){var t=[192,193,194,195,196,197,198,199];e.processJPEG=function(e,r,i,n,a,s){var o,l=this.decode.DCT_DECODE,h=null;if("string"==typeof e||this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e)){switch(e=a||e,e=this.__addimage__.isArrayBuffer(e)?new Uint8Array(e):e,(o=function(e){for(var r,i=256*e.charCodeAt(4)+e.charCodeAt(5),n=e.length,a={width:0,height:0,numcomponents:1},s=4;s<n;s+=2){if(s+=i,-1!==t.indexOf(e.charCodeAt(s+1))){r=256*e.charCodeAt(s+5)+e.charCodeAt(s+6),a={width:256*e.charCodeAt(s+7)+e.charCodeAt(s+8),height:r,numcomponents:e.charCodeAt(s+9)};break}i=256*e.charCodeAt(s+2)+e.charCodeAt(s+3)}return a}(e=this.__addimage__.isArrayBufferView(e)?this.__addimage__.arrayBufferToBinaryString(e):e)).numcomponents){case 1:s=this.color_spaces.DEVICE_GRAY;break;case 4:s=this.color_spaces.DEVICE_CMYK;break;case 3:s=this.color_spaces.DEVICE_RGB}h={data:e,width:o.width,height:o.height,colorSpace:s,bitsPerComponent:8,filter:l,index:r,alias:i}}return h}}(ZM.API),ZM.API.processPNG=function(e,t,r,i){if(this.__addimage__.isArrayBuffer(e)&&(e=new Uint8Array(e)),this.__addimage__.isArrayBufferView(e)){var n,a,s,o=function(e,t){return new pM(e,t).decode()}(e,{checkCrc:!0}),l=o.width,h=o.height,A=o.channels,u=o.palette,c=o.depth,d=u&&1===A?function(e){for(var t=e.width,r=e.height,i=e.data,n=e.palette,a=e.depth,s=!1,o=[],l=[],h=void 0,A=!1,u=0,c=0;c<n.length;c++){var d=gL(n[c],4),p=d[0],f=d[1],g=d[2],m=d[3];o.push(p,f,g),null!=m&&(0===m?(u++,l.length<1&&l.push(c)):m<255&&(A=!0))}if(A||u>1){s=!0,l=void 0;var y=t*r;h=new Uint8Array(y);for(var _=new DataView(i.buffer),v=0;v<y;v++){var w=gL(n[cU(_,v,a)],4)[3];h[v]=w}}else 0===u&&(l=void 0);return{colorSpace:"Indexed",colorsPerPixel:1,sMaskBitsPerComponent:s?8:void 0,colorBytes:i,alphaBytes:h,needSMask:s,palette:o,mask:l}}(o):2===A||4===A?function(e){for(var t=e.data,r=e.width,i=e.height,n=e.channels,a=e.depth,s=2===n?"DeviceGray":"DeviceRGB",o=n-1,l=r*i,h=o,A=l*h,u=1*l,c=Math.ceil(A*a/8),d=Math.ceil(u*a/8),p=new Uint8Array(c),f=new Uint8Array(d),g=new DataView(t.buffer),m=new DataView(p.buffer),y=new DataView(f.buffer),_=!1,v=0;v<l;v++){for(var w=v*n,b=0;b<h;b++)dU(m,cU(g,w+b,a),v*h+b,a);var x=cU(g,w+h,a);x<(1<<a)-1&&(_=!0),dU(y,x,1*v,a)}return{colorSpace:s,colorsPerPixel:o,sMaskBitsPerComponent:_?a:void 0,colorBytes:p,alphaBytes:f,needSMask:_}}(o):(B=(x=o).data,{colorSpace:C=1===x.channels?"DeviceGray":"DeviceRGB",colorsPerPixel:"DeviceGray"===C?1:3,colorBytes:B instanceof Uint16Array?function(e){for(var t=e.length,r=new Uint8Array(2*t),i=new DataView(r.buffer,r.byteOffset,r.byteLength),n=0;n<t;n++)i.setUint16(2*n,e[n],!1);return r}(B):B,needSMask:!1}),p=d.colorSpace,f=d.colorsPerPixel,g=d.sMaskBitsPerComponent,m=d.colorBytes,y=d.alphaBytes,_=d.needSMask,v=d.palette,w=d.mask,b=null;return i!==ZM.API.image_compression.NONE?(b=function(e){var t;switch(e){case ZM.API.image_compression.FAST:t=11;break;case ZM.API.image_compression.MEDIUM:t=13;break;case ZM.API.image_compression.SLOW:t=14;break;default:t=12}return t}(i),n=this.decode.FLATE_DECODE,a="/Predictor ".concat(b," /Colors ").concat(f," /BitsPerComponent ").concat(c," /Columns ").concat(l),e=nU(m,Math.ceil(l*f*c/8),f,c,i),_&&(s=nU(y,Math.ceil(l*g/8),1,g,i))):(n=void 0,a=void 0,e=m,_&&(s=y)),(this.__addimage__.isArrayBuffer(e)||this.__addimage__.isArrayBufferView(e))&&(e=this.__addimage__.arrayBufferToBinaryString(e)),(s&&this.__addimage__.isArrayBuffer(s)||this.__addimage__.isArrayBufferView(s))&&(s=this.__addimage__.arrayBufferToBinaryString(s)),{alias:r,data:e,index:t,filter:n,decodeParameters:a,transparency:w,palette:v,sMask:s,predictor:b,width:l,height:h,bitsPerComponent:c,sMaskBitsPerComponent:g,colorSpace:p}}var x,B,C},function(e){e.processGIF89A=function(t,r,i,n){var a=new fU(t),s=a.width,o=a.height,l=[];a.decodeAndBlitFrameRGBA(0,l);var h={data:l,width:s,height:o},A=new mU(100).encode(h,100);return e.processJPEG.call(this,A,r,i,n)},e.processGIF87A=e.processGIF89A}(ZM.API),yU.prototype.parseHeader=function(){if(this.fileSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.reserved=this.datav.getUint32(this.pos,!0),this.pos+=4,this.offset=this.datav.getUint32(this.pos,!0),this.pos+=4,this.headerSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.width=this.datav.getUint32(this.pos,!0),this.pos+=4,this.height=this.datav.getInt32(this.pos,!0),this.pos+=4,this.planes=this.datav.getUint16(this.pos,!0),this.pos+=2,this.bitPP=this.datav.getUint16(this.pos,!0),this.pos+=2,this.compress=this.datav.getUint32(this.pos,!0),this.pos+=4,this.rawSize=this.datav.getUint32(this.pos,!0),this.pos+=4,this.hr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.vr=this.datav.getUint32(this.pos,!0),this.pos+=4,this.colors=this.datav.getUint32(this.pos,!0),this.pos+=4,this.importantColors=this.datav.getUint32(this.pos,!0),this.pos+=4,16===this.bitPP&&this.is_with_alpha&&(this.bitPP=15),this.bitPP<15){var e=0===this.colors?1<<this.bitPP:this.colors;this.palette=new Array(e);for(var t=0;t<e;t++){var r=this.datav.getUint8(this.pos++,!0),i=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0);this.palette[t]={red:n,green:i,blue:r,quad:a}}}this.height<0&&(this.height*=-1,this.bottom_up=!1)},yU.prototype.parseBGR=function(){this.pos=this.offset;try{var e="bit"+this.bitPP,t=this.width*this.height*4;this.data=new Uint8Array(t),this[e]()}catch(e){mM.log("bit decode error:"+e)}},yU.prototype.bit1=function(){var e,t=Math.ceil(this.width/8),r=t%4;for(e=this.height-1;e>=0;e--){for(var i=this.bottom_up?e:this.height-1-e,n=0;n<t;n++)for(var a=this.datav.getUint8(this.pos++,!0),s=i*this.width*4+8*n*4,o=0;o<8&&8*n+o<this.width;o++){var l=this.palette[a>>7-o&1];this.data[s+4*o]=l.blue,this.data[s+4*o+1]=l.green,this.data[s+4*o+2]=l.red,this.data[s+4*o+3]=255}0!==r&&(this.pos+=4-r)}},yU.prototype.bit4=function(){for(var e=Math.ceil(this.width/2),t=e%4,r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n<e;n++){var a=this.datav.getUint8(this.pos++,!0),s=i*this.width*4+2*n*4,o=a>>4,l=15&a,h=this.palette[o];if(this.data[s]=h.blue,this.data[s+1]=h.green,this.data[s+2]=h.red,this.data[s+3]=255,2*n+1>=this.width)break;h=this.palette[l],this.data[s+4]=h.blue,this.data[s+4+1]=h.green,this.data[s+4+2]=h.red,this.data[s+4+3]=255}0!==t&&(this.pos+=4-t)}},yU.prototype.bit8=function(){for(var e=this.width%4,t=this.height-1;t>=0;t--){for(var r=this.bottom_up?t:this.height-1-t,i=0;i<this.width;i++){var n=this.datav.getUint8(this.pos++,!0),a=r*this.width*4+4*i;if(n<this.palette.length){var s=this.palette[n];this.data[a]=s.red,this.data[a+1]=s.green,this.data[a+2]=s.blue,this.data[a+3]=255}else this.data[a]=255,this.data[a+1]=255,this.data[a+2]=255,this.data[a+3]=255}0!==e&&(this.pos+=4-e)}},yU.prototype.bit15=function(){for(var e=this.width%3,t=parseInt("11111",2),r=this.height-1;r>=0;r--){for(var i=this.bottom_up?r:this.height-1-r,n=0;n<this.width;n++){var a=this.datav.getUint16(this.pos,!0);this.pos+=2;var s=(a&t)/t*255|0,o=(a>>5&t)/t*255|0,l=(a>>10&t)/t*255|0,h=a>>15?255:0,A=i*this.width*4+4*n;this.data[A]=l,this.data[A+1]=o,this.data[A+2]=s,this.data[A+3]=h}this.pos+=e}},yU.prototype.bit16=function(){for(var e=this.width%3,t=parseInt("11111",2),r=parseInt("111111",2),i=this.height-1;i>=0;i--){for(var n=this.bottom_up?i:this.height-1-i,a=0;a<this.width;a++){var s=this.datav.getUint16(this.pos,!0);this.pos+=2;var o=(s&t)/t*255|0,l=(s>>5&r)/r*255|0,h=(s>>11)/t*255|0,A=n*this.width*4+4*a;this.data[A]=h,this.data[A+1]=l,this.data[A+2]=o,this.data[A+3]=255}this.pos+=e}},yU.prototype.bit24=function(){for(var e=this.height-1;e>=0;e--){for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=t*this.width*4+4*r;this.data[s]=a,this.data[s+1]=n,this.data[s+2]=i,this.data[s+3]=255}this.pos+=this.width%4}},yU.prototype.bit32=function(){for(var e=this.height-1;e>=0;e--)for(var t=this.bottom_up?e:this.height-1-e,r=0;r<this.width;r++){var i=this.datav.getUint8(this.pos++,!0),n=this.datav.getUint8(this.pos++,!0),a=this.datav.getUint8(this.pos++,!0),s=this.datav.getUint8(this.pos++,!0),o=t*this.width*4+4*r;this.data[o]=a,this.data[o+1]=n,this.data[o+2]=i,this.data[o+3]=s}},yU.prototype.getData=function(){return this.data},function(e){e.processBMP=function(t,r,i,n){var a=new yU(t,!1),s=a.width,o=a.height,l={data:a.getData(),width:s,height:o},h=new mU(100).encode(l,100);return e.processJPEG.call(this,h,r,i,n)}}(ZM.API),_U.prototype.getData=function(){return this.data},function(e){e.processWEBP=function(t,r,i,n){var a=new _U(t),s=a.width,o=a.height,l={data:a.getData(),width:s,height:o},h=new mU(100).encode(l,100);return e.processJPEG.call(this,h,r,i,n)}}(ZM.API),ZM.API.processRGBA=function(e,t,r){for(var i=e.data,n=i.length,a=new Uint8Array(n/4*3),s=new Uint8Array(n/4),o=0,l=0,h=0;h<n;h+=4){var A=i[h],u=i[h+1],c=i[h+2],d=i[h+3];a[o++]=A,a[o++]=u,a[o++]=c,s[l++]=d}var p=this.__addimage__.arrayBufferToBinaryString(a);return{alpha:this.__addimage__.arrayBufferToBinaryString(s),data:p,index:t,alias:r,colorSpace:"DeviceRGB",bitsPerComponent:8,width:e.width,height:e.height}},ZM.API.setLanguage=function(e){return void 0===this.internal.languageSettings&&(this.internal.languageSettings={},this.internal.languageSettings.isSubscribed=!1),void 0!=={af:"Afrikaans",sq:"Albanian",ar:"Arabic (Standard)","ar-DZ":"Arabic (Algeria)","ar-BH":"Arabic (Bahrain)","ar-EG":"Arabic (Egypt)","ar-IQ":"Arabic (Iraq)","ar-JO":"Arabic (Jordan)","ar-KW":"Arabic (Kuwait)","ar-LB":"Arabic (Lebanon)","ar-LY":"Arabic (Libya)","ar-MA":"Arabic (Morocco)","ar-OM":"Arabic (Oman)","ar-QA":"Arabic (Qatar)","ar-SA":"Arabic (Saudi Arabia)","ar-SY":"Arabic (Syria)","ar-TN":"Arabic (Tunisia)","ar-AE":"Arabic (U.A.E.)","ar-YE":"Arabic (Yemen)",an:"Aragonese",hy:"Armenian",as:"Assamese",ast:"Asturian",az:"Azerbaijani",eu:"Basque",be:"Belarusian",bn:"Bengali",bs:"Bosnian",br:"Breton",bg:"Bulgarian",my:"Burmese",ca:"Catalan",ch:"Chamorro",ce:"Chechen",zh:"Chinese","zh-HK":"Chinese (Hong Kong)","zh-CN":"Chinese (PRC)","zh-SG":"Chinese (Singapore)","zh-TW":"Chinese (Taiwan)",cv:"Chuvash",co:"Corsican",cr:"Cree",hr:"Croatian",cs:"Czech",da:"Danish",nl:"Dutch (Standard)","nl-BE":"Dutch (Belgian)",en:"English","en-AU":"English (Australia)","en-BZ":"English (Belize)","en-CA":"English (Canada)","en-IE":"English (Ireland)","en-JM":"English (Jamaica)","en-NZ":"English (New Zealand)","en-PH":"English (Philippines)","en-ZA":"English (South Africa)","en-TT":"English (Trinidad & Tobago)","en-GB":"English (United Kingdom)","en-US":"English (United States)","en-ZW":"English (Zimbabwe)",eo:"Esperanto",et:"Estonian",fo:"Faeroese",fj:"Fijian",fi:"Finnish",fr:"French (Standard)","fr-BE":"French (Belgium)","fr-CA":"French (Canada)","fr-FR":"French (France)","fr-LU":"French (Luxembourg)","fr-MC":"French (Monaco)","fr-CH":"French (Switzerland)",fy:"Frisian",fur:"Friulian",gd:"Gaelic (Scots)","gd-IE":"Gaelic (Irish)",gl:"Galacian",ka:"Georgian",de:"German (Standard)","de-AT":"German (Austria)","de-DE":"German (Germany)","de-LI":"German (Liechtenstein)","de-LU":"German (Luxembourg)","de-CH":"German (Switzerland)",el:"Greek",gu:"Gujurati",ht:"Haitian",he:"Hebrew",hi:"Hindi",hu:"Hungarian",is:"Icelandic",id:"Indonesian",iu:"Inuktitut",ga:"Irish",it:"Italian (Standard)","it-CH":"Italian (Switzerland)",ja:"Japanese",kn:"Kannada",ks:"Kashmiri",kk:"Kazakh",km:"Khmer",ky:"Kirghiz",tlh:"Klingon",ko:"Korean","ko-KP":"Korean (North Korea)","ko-KR":"Korean (South Korea)",la:"Latin",lv:"Latvian",lt:"Lithuanian",lb:"Luxembourgish",mk:"North Macedonia",ms:"Malay",ml:"Malayalam",mt:"Maltese",mi:"Maori",mr:"Marathi",mo:"Moldavian",nv:"Navajo",ng:"Ndonga",ne:"Nepali",no:"Norwegian",nb:"Norwegian (Bokmal)",nn:"Norwegian (Nynorsk)",oc:"Occitan",or:"Oriya",om:"Oromo",fa:"Persian","fa-IR":"Persian/Iran",pl:"Polish",pt:"Portuguese","pt-BR":"Portuguese (Brazil)",pa:"Punjabi","pa-IN":"Punjabi (India)","pa-PK":"Punjabi (Pakistan)",qu:"Quechua",rm:"Rhaeto-Romanic",ro:"Romanian","ro-MO":"Romanian (Moldavia)",ru:"Russian","ru-MO":"Russian (Moldavia)",sz:"Sami (Lappish)",sg:"Sango",sa:"Sanskrit",sc:"Sardinian",sd:"Sindhi",si:"Singhalese",sr:"Serbian",sk:"Slovak",sl:"Slovenian",so:"Somani",sb:"Sorbian",es:"Spanish","es-AR":"Spanish (Argentina)","es-BO":"Spanish (Bolivia)","es-CL":"Spanish (Chile)","es-CO":"Spanish (Colombia)","es-CR":"Spanish (Costa Rica)","es-DO":"Spanish (Dominican Republic)","es-EC":"Spanish (Ecuador)","es-SV":"Spanish (El Salvador)","es-GT":"Spanish (Guatemala)","es-HN":"Spanish (Honduras)","es-MX":"Spanish (Mexico)","es-NI":"Spanish (Nicaragua)","es-PA":"Spanish (Panama)","es-PY":"Spanish (Paraguay)","es-PE":"Spanish (Peru)","es-PR":"Spanish (Puerto Rico)","es-ES":"Spanish (Spain)","es-UY":"Spanish (Uruguay)","es-VE":"Spanish (Venezuela)",sx:"Sutu",sw:"Swahili",sv:"Swedish","sv-FI":"Swedish (Finland)","sv-SV":"Swedish (Sweden)",ta:"Tamil",tt:"Tatar",te:"Teluga",th:"Thai",tig:"Tigre",ts:"Tsonga",tn:"Tswana",tr:"Turkish",tk:"Turkmen",uk:"Ukrainian",hsb:"Upper Sorbian",ur:"Urdu",ve:"Venda",vi:"Vietnamese",vo:"Volapuk",wa:"Walloon",cy:"Welsh",xh:"Xhosa",ji:"Yiddish",zu:"Zulu"}[e]&&(this.internal.languageSettings.languageCode=e,!1===this.internal.languageSettings.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){this.internal.write("/Lang ("+this.internal.languageSettings.languageCode+")")})),this.internal.languageSettings.isSubscribed=!0)),this},Yk=ZM.API,Jk=Yk.getCharWidthsArray=function(e,t){var r,i,n=(t=t||{}).font||this.internal.getFont(),a=t.fontSize||this.internal.getFontSize(),s=t.charSpace||this.internal.getCharSpace(),o=t.widths?t.widths:n.metadata.Unicode.widths,l=o.fof?o.fof:1,h=t.kerning?t.kerning:n.metadata.Unicode.kerning,A=h.fof?h.fof:1,u=!1!==t.doKerning,c=0,d=e.length,p=0,f=o[0]||l,g=[];for(r=0;r<d;r++)i=e.charCodeAt(r),"function"==typeof n.metadata.widthOfString?g.push((n.metadata.widthOfGlyph(n.metadata.characterToGlyph(i))+s*(1e3/a)||0)/1e3):(c=u&&"object"===LP(h[i])&&!isNaN(parseInt(h[i][p],10))?h[i][p]/A:0,g.push((o[i]||f)/l+c)),p=i;return g},eU=Yk.getStringUnitWidth=function(e,t){var r=(t=t||{}).fontSize||this.internal.getFontSize(),i=t.font||this.internal.getFont(),n=t.charSpace||this.internal.getCharSpace();return Yk.processArabic&&(e=Yk.processArabic(e)),"function"==typeof i.metadata.widthOfString?i.metadata.widthOfString(e,r,n)/r:Jk.apply(this,arguments).reduce((function(e,t){return e+t}),0)},tU=function(e,t,r,i){for(var n=[],a=0,s=e.length,o=0;a!==s&&o+t[a]<r;)o+=t[a],a++;n.push(e.slice(0,a));var l=a;for(o=0;a!==s;)o+t[a]>i&&(n.push(e.slice(l,a)),o=0,l=a),o+=t[a],a++;return l!==a&&n.push(e.slice(l,a)),n},rU=function(e,t,r){r||(r={});var i,n,a,s,o,l,h,A=[],u=[A],c=r.textIndent||0,d=0,p=0,f=e.split(" "),g=Jk.apply(this,[" ",r])[0];if(l=-1===r.lineIndent?f[0].length+2:r.lineIndent||0){var m=Array(l).join(" "),y=[];f.map((function(e){(e=e.split(/\s*\n/)).length>1?y=y.concat(e.map((function(e,t){return(t&&e.length?"\n":"")+e}))):y.push(e[0])})),f=y,l=eU.apply(this,[m,r])}for(a=0,s=f.length;a<s;a++){var _=0;if(i=f[a],l&&"\n"==i[0]&&(i=i.substr(1),_=1),c+d+(p=(n=Jk.apply(this,[i,r])).reduce((function(e,t){return e+t}),0))>t||_){if(p>t){for(o=tU.apply(this,[i,n,t-(c+d),t]),A.push(o.shift()),A=[o.pop()];o.length;)u.push([o.shift()]);p=n.slice(i.length-(A[0]?A[0].length:0)).reduce((function(e,t){return e+t}),0)}else A=[i];u.push(A),c=p+l,d=g}else A.push(i),c+=d+p,d=g}return h=l?function(e,t){return(t?m:"")+e.join(" ")}:function(e){return e.join(" ")},u.map(h)},Yk.splitTextToSize=function(e,t,r){var i,n=(r=r||{}).fontSize||this.internal.getFontSize(),a=function(e){if(e.widths&&e.kerning)return{widths:e.widths,kerning:e.kerning};var t=this.internal.getFont(e.fontName,e.fontStyle),r="Unicode";return t.metadata[r]?{widths:t.metadata[r].widths||{0:1},kerning:t.metadata[r].kerning||{}}:{font:t.metadata,fontSize:this.internal.getFontSize(),charSpace:this.internal.getCharSpace()}}.call(this,r);i=Array.isArray(e)?e:String(e).split(/\r?\n/);var s=1*this.internal.scaleFactor*t/n;a.textIndent=r.textIndent?1*r.textIndent*this.internal.scaleFactor/n:0,a.lineIndent=r.lineIndent;var o,l,h=[];for(o=0,l=i.length;o<l;o++)h=h.concat(rU.apply(this,[i[o],s,a]));return h},function(e){e.__fontmetrics__=e.__fontmetrics__||{};for(var t="0123456789abcdef",r="klmnopqrstuvwxyz",i={},n={},a=0;a<16;a++)i[r[a]]=t[a],n[t[a]]=r[a];var s=function(e){return"0x"+parseInt(e,10).toString(16)},o=e.__fontmetrics__.compress=function(e){var t,r,i,a,l=["{"];for(var h in e){if(t=e[h],isNaN(parseInt(h,10))?r="'"+h+"'":(h=parseInt(h,10),r=(r=s(h).slice(2)).slice(0,-1)+n[r.slice(-1)]),"number"==typeof t)t<0?(i=s(t).slice(3),a="-"):(i=s(t).slice(2),a=""),i=a+i.slice(0,-1)+n[i.slice(-1)];else{if("object"!==LP(t))throw new Error("Don't know what to do with value type "+LP(t)+".");i=o(t)}l.push(r+i)}return l.push("}"),l.join("")},l=e.__fontmetrics__.uncompress=function(e){if("string"!=typeof e)throw new Error("Invalid argument passed to uncompress.");for(var t,r,n,a,s={},o=1,l=s,h=[],A="",u="",c=e.length-1,d=1;d<c;d+=1)"'"==(a=e[d])?t?(n=t.join(""),t=void 0):t=[]:t?t.push(a):"{"==a?(h.push([l,n]),l={},n=void 0):"}"==a?((r=h.pop())[0][r[1]]=l,n=void 0,l=r[0]):"-"==a?o=-1:void 0===n?i.hasOwnProperty(a)?(A+=i[a],n=parseInt(A,16)*o,o=1,A=""):A+=a:i.hasOwnProperty(a)?(u+=i[a],l[n]=parseInt(u,16)*o,o=1,n=void 0,u=""):u+=a;return s},h={codePages:["WinAnsiEncoding"],WinAnsiEncoding:l("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}")},A={Unicode:{Courier:h,"Courier-Bold":h,"Courier-BoldOblique":h,"Courier-Oblique":h,Helvetica:h,"Helvetica-Bold":h,"Helvetica-BoldOblique":h,"Helvetica-Oblique":h,"Times-Roman":h,"Times-Bold":h,"Times-BoldItalic":h,"Times-Italic":h}},u={Unicode:{"Courier-Oblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-BoldItalic":l("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"),"Helvetica-Bold":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),Courier:l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-BoldOblique":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Bold":l("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"),Symbol:l("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"),Helvetica:l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"),"Helvetica-BoldOblique":l("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"),ZapfDingbats:l("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"),"Courier-Bold":l("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"),"Times-Italic":l("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"),"Times-Roman":l("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"),"Helvetica-Oblique":l("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}")}};e.events.push(["addFont",function(e){var t=e.font,r=u.Unicode[t.postScriptName];r&&(t.metadata.Unicode={},t.metadata.Unicode.widths=r.widths,t.metadata.Unicode.kerning=r.kerning);var i=A.Unicode[t.postScriptName];i&&(t.metadata.Unicode.encoding=i,t.encoding=i.codePages[0])}])}(ZM.API),function(e){var t=function(e){for(var t=e.length,r=new Uint8Array(t),i=0;i<t;i++)r[i]=e.charCodeAt(i);return r};e.API.events.push(["addFont",function(r){var i,n,a=void 0,s=r.font,o=r.instance;if(!s.isStandardFont){if(void 0===o)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");if("string"!=typeof(a=!1===o.existsFileInVFS(s.postScriptName)?o.loadFile(s.postScriptName):o.getFileFromVFS(s.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+s.postScriptName+"').");i=s,n=/^\x00\x01\x00\x00/.test(n=a)?t(n):t(xM(n)),i.metadata=e.API.TTFFont.open(n),i.metadata.Unicode=i.metadata.Unicode||{encoding:{},kerning:{},widths:[]},i.metadata.glyIdsUsed=[0]}}])}(ZM),ZM.API.addSvgAsImage=function(e,t,r,i,n,a,s,o){if(isNaN(t)||isNaN(r))throw mM.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(i)||isNaN(n))throw mM.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var l=document.createElement("canvas");l.width=i,l.height=n;var h=l.getContext("2d");h.fillStyle="#fff",h.fillRect(0,0,l.width,l.height);var A={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},u=this;return(fM.canvg?Promise.resolve(fM.canvg):Promise.resolve().then((()=>(yA(),Go)))).catch((function(e){return Promise.reject(new Error("Could not load canvg: "+e))})).then((function(e){return e.default?e.default:e})).then((function(t){return t.fromString(h,e,A)}),(function(){return Promise.reject(new Error("Could not load canvg."))})).then((function(e){return e.render(A)})).then((function(){u.addImage(l.toDataURL("image/jpeg",1),t,r,i,n,s,o)}))},ZM.API.putTotalPages=function(e){var t,r=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(e,"g"),r=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(e,this.internal.getFont()),"g"),r=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var i=1;i<=this.internal.getNumberOfPages();i++)for(var n=0;n<this.internal.pages[i].length;n++)this.internal.pages[i][n]=this.internal.pages[i][n].replace(t,r);return this},ZM.API.viewerPreferences=function(e,t){var r;e=e||{},t=t||!1;var i,n,a,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},o=Object.keys(s),l=[],h=0,A=0,u=0;function c(e,t){var r,i=!1;for(r=0;r<e.length;r+=1)e[r]===t&&(i=!0);return i}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),r=this.internal.viewerpreferences.configuration,"reset"===e||!0===t){var d=o.length;for(u=0;u<d;u+=1)r[o[u]].value=r[o[u]].defaultValue,r[o[u]].explicitSet=!1}if("object"===LP(e))for(n in e)if(a=e[n],c(o,n)&&void 0!==a){if("boolean"===r[n].type&&"boolean"==typeof a)r[n].value=a;else if("name"===r[n].type&&c(r[n].valueSet,a))r[n].value=a;else if("integer"===r[n].type&&Number.isInteger(a))r[n].value=a;else if("array"===r[n].type){for(h=0;h<a.length;h+=1)if(i=!0,1===a[h].length&&"number"==typeof a[h][0])l.push(String(a[h]-1));else if(a[h].length>1){for(A=0;A<a[h].length;A+=1)"number"!=typeof a[h][A]&&(i=!1);!0===i&&l.push([a[h][0]-1,a[h][1]-1].join(" "))}r[n].value="["+l.join(" ")+"]"}else r[n].value=r[n].defaultValue;r[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",(function(){var e,t=[];for(e in r)!0===r[e].explicitSet&&("name"===r[e].type?t.push("/"+e+" /"+r[e].value):t.push("/"+e+" "+r[e].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")})),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=r,this},function(e){var t=function(){var e='<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="'+this.internal.__metadata__.namespaceuri+'"><jspdf:metadata>',t=unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')),r=unescape(encodeURIComponent(e)),i=unescape(encodeURIComponent(this.internal.__metadata__.metadata)),n=unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")),a=unescape(encodeURIComponent("</x:xmpmeta>")),s=r.length+i.length+n.length+t.length+a.length;this.internal.__metadata__.metadata_object_number=this.internal.newObject(),this.internal.write("<< /Type /Metadata /Subtype /XML /Length "+s+" >>"),this.internal.write("stream"),this.internal.write(t+r+i+n+a),this.internal.write("endstream"),this.internal.write("endobj")},r=function(){this.internal.__metadata__.metadata_object_number&&this.internal.write("/Metadata "+this.internal.__metadata__.metadata_object_number+" 0 R")};e.addMetadata=function(e,i){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:e,namespaceuri:i||"http://jspdf.default.namespaceuri/"},this.internal.events.subscribe("putCatalog",r),this.internal.events.subscribe("postPutResources",t)),this}}(ZM.API),function(e){var t=e.API,r=t.pdfEscape16=function(e,t){for(var r,i=t.metadata.Unicode.widths,n=["","0","00","000","0000"],a=[""],s=0,o=e.length;s<o;++s){if(r=t.metadata.characterToGlyph(e.charCodeAt(s)),t.metadata.glyIdsUsed.push(r),t.metadata.toUnicode[r]=e.charCodeAt(s),-1==i.indexOf(r)&&(i.push(r),i.push([parseInt(t.metadata.widthOfGlyph(r),10)])),"0"==r)return a.join("");r=r.toString(16),a.push(n[4-r.length],r)}return a.join("")},i=function(e){var t,r,i,n,a,s,o;for(a="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n  /Registry (Adobe)\n  /Ordering (UCS)\n  /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",i=[],s=0,o=(r=Object.keys(e).sort((function(e,t){return e-t}))).length;s<o;s++)t=r[s],i.length>=100&&(a+="\n"+i.length+" beginbfchar\n"+i.join("\n")+"\nendbfchar",i=[]),void 0!==e[t]&&null!==e[t]&&"function"==typeof e[t].toString&&(n=("0000"+e[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),i.push("<"+t+"><"+n+">"));return i.length&&(a+="\n"+i.length+" beginbfchar\n"+i.join("\n")+"\nendbfchar\n"),a+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var r=t.font,n=t.out,a=t.newObject,s=t.putStream;if(r.metadata instanceof e.API.TTFFont&&"Identity-H"===r.encoding){for(var o=r.metadata.Unicode.widths,l=r.metadata.subset.encode(r.metadata.glyIdsUsed,1),h="",A=0;A<l.length;A++)h+=String.fromCharCode(l[A]);var u=a();s({data:h,addLength1:!0,objectId:u}),n("endobj");var c=a();s({data:i(r.metadata.toUnicode),addLength1:!0,objectId:c}),n("endobj");var d=a();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+HM(r.fontName)),n("/FontFile2 "+u+" 0 R"),n("/FontBBox "+e.API.PDFObject.convert(r.metadata.bbox)),n("/Flags "+r.metadata.flags),n("/StemV "+r.metadata.stemV),n("/ItalicAngle "+r.metadata.italicAngle),n("/Ascent "+r.metadata.ascender),n("/Descent "+r.metadata.decender),n("/CapHeight "+r.metadata.capHeight),n(">>"),n("endobj");var p=a();n("<<"),n("/Type /Font"),n("/BaseFont /"+HM(r.fontName)),n("/FontDescriptor "+d+" 0 R"),n("/W "+e.API.PDFObject.convert(o)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+r.encoding+")"),n(">>"),n(">>"),n("endobj"),r.objectNumber=a(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+c+" 0 R"),n("/BaseFont /"+HM(r.fontName)),n("/Encoding /"+r.encoding),n("/DescendantFonts ["+p+" 0 R]"),n(">>"),n("endobj"),r.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var r=t.font,n=t.out,a=t.newObject,s=t.putStream;if(r.metadata instanceof e.API.TTFFont&&"WinAnsiEncoding"===r.encoding){for(var o=r.metadata.rawData,l="",h=0;h<o.length;h++)l+=String.fromCharCode(o[h]);var A=a();s({data:l,addLength1:!0,objectId:A}),n("endobj");var u=a();s({data:i(r.metadata.toUnicode),addLength1:!0,objectId:u}),n("endobj");var c=a();n("<<"),n("/Descent "+r.metadata.decender),n("/CapHeight "+r.metadata.capHeight),n("/StemV "+r.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+A+" 0 R"),n("/Flags 96"),n("/FontBBox "+e.API.PDFObject.convert(r.metadata.bbox)),n("/FontName /"+HM(r.fontName)),n("/ItalicAngle "+r.metadata.italicAngle),n("/Ascent "+r.metadata.ascender),n(">>"),n("endobj"),r.objectNumber=a();for(var d=0;d<r.metadata.hmtx.widths.length;d++)r.metadata.hmtx.widths[d]=parseInt(r.metadata.hmtx.widths[d]*(1e3/r.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+u+" 0 R/BaseFont/"+HM(r.fontName)+"/FontDescriptor "+c+" 0 R/Encoding/"+r.encoding+" /FirstChar 29 /LastChar 255 /Widths "+e.API.PDFObject.convert(r.metadata.hmtx.widths)+">>"),n("endobj"),r.isAlreadyPutted=!0}}(t)}]);var n=function(e){var t,i=e.text||"",n=e.x,a=e.y,s=e.options||{},o=e.mutex||{},l=o.pdfEscape,h=o.activeFontKey,A=o.fonts,u=h,c="",d=0,p="",f=A[u].encoding;if("Identity-H"!==A[u].encoding)return{text:i,x:n,y:a,options:s,mutex:o};for(p=i,u=h,Array.isArray(i)&&(p=i[0]),d=0;d<p.length;d+=1)A[u].metadata.hasOwnProperty("cmap")&&(t=A[u].metadata.cmap.unicode.codeMap[p[d].charCodeAt(0)]),t||p[d].charCodeAt(0)<256&&A[u].metadata.hasOwnProperty("Unicode")?c+=p[d]:c+="";var g="";return parseInt(u.slice(1))<14||"WinAnsiEncoding"===f?g=l(c,u).split("").map((function(e){return e.charCodeAt(0).toString(16)})).join(""):"Identity-H"===f&&(g=r(c,A[u])),o.isHex=!0,{text:g,x:n,y:a,options:s,mutex:o}};t.events.push(["postProcessText",function(e){var t=e.text||"",r=[],i={text:t,x:e.x,y:e.y,options:e.options,mutex:e.mutex};if(Array.isArray(t)){var a=0;for(a=0;a<t.length;a+=1)Array.isArray(t[a])&&3===t[a].length?r.push([n(Object.assign({},i,{text:t[a][0]})).text,t[a][1],t[a][2]]):r.push(n(Object.assign({},i,{text:t[a]})).text);e.text=r}else e.text=n(Object.assign({},i,{text:t})).text}])}(ZM),function(e){var t=function(){return void 0===this.internal.vFS&&(this.internal.vFS={}),!0};e.existsFileInVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]},e.addFileToVFS=function(e,r){return t.call(this),this.internal.vFS[e]=r,this},e.getFileFromVFS=function(e){return t.call(this),void 0!==this.internal.vFS[e]?this.internal.vFS[e]:null}}(ZM.API),function(e){e.__bidiEngine__=e.prototype.__bidiEngine__=function(e){var r,i,n,a,s,o,l,h=t,A=[[0,3,0,1,0,0,0],[0,3,0,1,2,2,0],[0,3,0,17,2,0,1],[0,3,5,5,4,1,0],[0,3,21,21,4,0,1],[0,3,5,5,4,2,0]],u=[[2,0,1,1,0,1,0],[2,0,1,1,0,2,0],[2,0,2,1,3,2,0],[2,0,2,33,3,1,1]],c={L:0,R:1,EN:2,AN:3,N:4,B:5,S:6},d={0:0,5:1,6:2,7:3,32:4,251:5,254:6,255:7},p=["(",")","(","<",">","<","[","]","[","{","}","{","«","»","«","‹","›","‹","⁅","⁆","⁅","⁽","⁾","⁽","₍","₎","₍","≤","≥","≤","〈","〉","〈","﹙","﹚","﹙","﹛","﹜","﹛","﹝","﹞","﹝","﹤","﹥","﹤"],f=new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/),g=!1,m=0;this.__bidiEngine__={};var y=function(e){var t=e.charCodeAt(),r=t>>8,i=d[r];return void 0!==i?h[256*i+(255&t)]:252===r||253===r?"AL":f.test(r)?"L":8===r?"R":"N"},_=function(e){for(var t,r=0;r<e.length;r++){if("L"===(t=y(e.charAt(r))))return!1;if("R"===t)return!0}return!1},v=function(e,t,s,o){var l,h,A,u,c=t[o];switch(c){case"L":case"R":case"LRE":case"RLE":case"LRO":case"RLO":case"PDF":g=!1;break;case"N":case"AN":break;case"EN":g&&(c="AN");break;case"AL":g=!0,c="R";break;case"WS":case"BN":c="N";break;case"CS":o<1||o+1>=t.length||"EN"!==(l=s[o-1])&&"AN"!==l||"EN"!==(h=t[o+1])&&"AN"!==h?c="N":g&&(h="AN"),c=h===l?h:"N";break;case"ES":c="EN"===(l=o>0?s[o-1]:"B")&&o+1<t.length&&"EN"===t[o+1]?"EN":"N";break;case"ET":if(o>0&&"EN"===s[o-1]){c="EN";break}if(g){c="N";break}for(A=o+1,u=t.length;A<u&&"ET"===t[A];)A++;c=A<u&&"EN"===t[A]?"EN":"N";break;case"NSM":if(n&&!a){for(u=t.length,A=o+1;A<u&&"NSM"===t[A];)A++;if(A<u){var d=e[o],p=d>=1425&&d<=2303||64286===d;if(l=t[A],p&&("R"===l||"AL"===l)){c="R";break}}}c=o<1||"B"===(l=t[o-1])?"N":s[o-1];break;case"B":g=!1,r=!0,c=m;break;case"S":i=!0,c="N"}return c},w=function(e,t,r){var i=e.split("");return r&&b(i,r,{hiLevel:m}),i.reverse(),t&&t.reverse(),i.join("")},b=function(e,t,n){var a,s,o,l,h,d=-1,p=e.length,f=0,_=[],w=m?u:A,b=[];for(g=!1,r=!1,i=!1,s=0;s<p;s++)b[s]=y(e[s]);for(o=0;o<p;o++){if(h=f,_[o]=v(e,b,_,o),a=240&(f=w[h][c[_[o]]]),f&=15,t[o]=l=w[f][5],a>0)if(16===a){for(s=d;s<o;s++)t[s]=1;d=-1}else d=-1;if(w[f][6])-1===d&&(d=o);else if(d>-1){for(s=d;s<o;s++)t[s]=l;d=-1}"B"===b[o]&&(t[o]=0),n.hiLevel|=l}i&&function(e,t,r){for(var i=0;i<r;i++)if("S"===e[i]){t[i]=m;for(var n=i-1;n>=0&&"WS"===e[n];n--)t[n]=m}}(b,t,p)},x=function(e,t,i,n,a){if(!(a.hiLevel<e)){if(1===e&&1===m&&!r)return t.reverse(),void(i&&i.reverse());for(var s,o,l,h,A=t.length,u=0;u<A;){if(n[u]>=e){for(l=u+1;l<A&&n[l]>=e;)l++;for(h=u,o=l-1;h<o;h++,o--)s=t[h],t[h]=t[o],t[o]=s,i&&(s=i[h],i[h]=i[o],i[o]=s);u=l}u++}}},B=function(e,t,r){var i=e.split(""),n={hiLevel:m};return r||(r=[]),b(i,r,n),function(e,t,r){if(0!==r.hiLevel&&l)for(var i,n=0;n<e.length;n++)1===t[n]&&(i=p.indexOf(e[n]))>=0&&(e[n]=p[i+1])}(i,r,n),x(2,i,t,r,n),x(1,i,t,r,n),i.join("")};return this.__bidiEngine__.doBidiReorder=function(e,t,r){if(function(e,t){if(t)for(var r=0;r<e.length;r++)t[r]=r;void 0===a&&(a=_(e)),void 0===o&&(o=_(e))}(e,t),n||!s||o)if(n&&s&&a^o)m=a?1:0,e=w(e,t,r);else if(!n&&s&&o)m=a?1:0,e=B(e,t,r),e=w(e,t);else if(!n||a||s||o){if(n&&!s&&a^o)e=w(e,t),a?(m=0,e=B(e,t,r)):(m=1,e=B(e,t,r),e=w(e,t));else if(n&&a&&!s&&o)m=1,e=B(e,t,r),e=w(e,t);else if(!n&&!s&&a^o){var i=l;a?(m=1,e=B(e,t,r),m=0,l=!1,e=B(e,t,r),l=i):(m=0,e=B(e,t,r),e=w(e,t),m=1,l=!1,e=B(e,t,r),l=i,e=w(e,t))}}else m=0,e=B(e,t,r);else m=a?1:0,e=B(e,t,r);return e},this.__bidiEngine__.setOptions=function(e){e&&(n=e.isInputVisual,s=e.isOutputVisual,a=e.isInputRtl,o=e.isOutputRtl,l=e.isSymmetricSwapping)},this.__bidiEngine__.setOptions(e),this.__bidiEngine__};var t=["BN","BN","BN","BN","BN","BN","BN","BN","BN","S","B","S","WS","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","B","B","B","S","WS","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","BN","BN","BN","BN","BN","BN","B","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","BN","CS","N","ET","ET","ET","ET","N","N","N","N","L","N","N","BN","N","N","ET","ET","EN","EN","N","L","N","N","N","EN","L","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","L","L","L","L","L","L","L","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","L","N","N","N","N","N","ET","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","NSM","R","NSM","NSM","R","NSM","NSM","R","NSM","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","N","N","N","N","N","R","R","R","R","R","N","N","N","N","N","N","N","N","N","N","N","AN","AN","AN","AN","AN","AN","N","N","AL","ET","ET","AL","CS","AL","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","AN","AN","AN","AN","AN","AN","AN","AN","AN","ET","AN","AN","AL","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AN","N","NSM","NSM","NSM","NSM","NSM","NSM","AL","AL","NSM","NSM","N","NSM","NSM","NSM","NSM","AL","AL","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","AL","AL","NSM","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","R","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","R","R","N","N","N","N","R","N","N","N","N","N","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","WS","BN","BN","BN","L","R","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","B","LRE","RLE","PDF","LRO","RLO","CS","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","WS","BN","BN","BN","BN","BN","N","LRI","RLI","FSI","PDI","BN","BN","BN","BN","BN","BN","EN","L","N","N","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","L","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","ES","ES","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","N","N","N","N","N","R","NSM","R","R","R","R","R","R","R","R","R","R","ES","R","R","R","R","R","R","R","R","R","R","R","R","R","N","R","R","R","R","R","N","R","N","R","R","N","R","R","N","R","R","R","R","R","R","R","R","R","R","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","NSM","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","CS","N","CS","N","N","CS","N","N","N","N","N","N","N","N","N","ET","N","N","ES","ES","N","N","N","N","N","ET","ET","N","N","N","N","N","AL","AL","AL","AL","AL","N","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","AL","N","N","BN","N","N","N","ET","ET","ET","N","N","N","N","N","ES","CS","ES","CS","CS","EN","EN","EN","EN","EN","EN","EN","EN","EN","EN","CS","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","N","N","N","N","N","N","N","N","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","L","N","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","L","L","L","N","N","L","L","L","N","N","N","ET","ET","N","N","N","ET","ET","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N"],r=new e.__bidiEngine__({isInputVisual:!0});e.API.events.push(["postProcessText",function(e){var t=e.text;e.x,e.y;var i=e.options||{};e.mutex,i.lang;var n=[];if(i.isInputVisual="boolean"!=typeof i.isInputVisual||i.isInputVisual,r.setOptions(i),"[object Array]"===Object.prototype.toString.call(t)){var a=0;for(n=[],a=0;a<t.length;a+=1)"[object Array]"===Object.prototype.toString.call(t[a])?n.push([r.doBidiReorder(t[a][0]),t[a][1],t[a][2]]):n.push([r.doBidiReorder(t[a])]);e.text=n}else e.text=r.doBidiReorder(t);r.setOptions({isInputVisual:!0})}])}(ZM),ZM.API.TTFFont=function(){function e(e){var t;if(this.rawData=e,t=this.contents=new wU(e),this.contents.pos=4,"ttcf"===t.readString(4))throw new Error("TTCF not supported.");t.pos=0,this.parse(),this.subset=new QU(this),this.registerTTF()}return e.open=function(t){return new e(t)},e.prototype.parse=function(){return this.directory=new bU(this.contents),this.head=new CU(this),this.name=new LU(this),this.cmap=new EU(this),this.toUnicode={},this.hhea=new IU(this),this.maxp=new MU(this),this.hmtx=new kU(this),this.post=new FU(this),this.os2=new TU(this),this.loca=new OU(this),this.glyf=new RU(this),this.ascender=this.os2.exists&&this.os2.ascender||this.hhea.ascender,this.decender=this.os2.exists&&this.os2.decender||this.hhea.decender,this.lineGap=this.os2.exists&&this.os2.lineGap||this.hhea.lineGap,this.bbox=[this.head.xMin,this.head.yMin,this.head.xMax,this.head.yMax]},e.prototype.registerTTF=function(){var e,t,r,i,n;if(this.scaleFactor=1e3/this.head.unitsPerEm,this.bbox=function(){var t,r,i,n;for(n=[],t=0,r=(i=this.bbox).length;t<r;t++)e=i[t],n.push(Math.round(e*this.scaleFactor));return n}.call(this),this.stemV=0,this.post.exists?(r=255&(i=this.post.italic_angle),32768&(t=i>>16)&&(t=-(1+(65535^t))),this.italicAngle=+(t+"."+r)):this.italicAngle=0,this.ascender=Math.round(this.ascender*this.scaleFactor),this.decender=Math.round(this.decender*this.scaleFactor),this.lineGap=Math.round(this.lineGap*this.scaleFactor),this.capHeight=this.os2.exists&&this.os2.capHeight||this.ascender,this.xHeight=this.os2.exists&&this.os2.xHeight||0,this.familyClass=(this.os2.exists&&this.os2.familyClass||0)>>8,this.isSerif=1===(n=this.familyClass)||2===n||3===n||4===n||5===n||7===n,this.isScript=10===this.familyClass,this.flags=0,this.post.isFixedPitch&&(this.flags|=1),this.isSerif&&(this.flags|=2),this.isScript&&(this.flags|=8),0!==this.italicAngle&&(this.flags|=64),this.flags|=32,!this.cmap.unicode)throw new Error("No unicode cmap for font")},e.prototype.characterToGlyph=function(e){var t;return(null!=(t=this.cmap.unicode)?t.codeMap[e]:void 0)||0},e.prototype.widthOfGlyph=function(e){var t;return t=1e3/this.head.unitsPerEm,this.hmtx.forGlyph(e).advance*t},e.prototype.widthOfString=function(e,t,r){var i,n,a,s;for(a=0,n=0,s=(e=""+e).length;0<=s?n<s:n>s;n=0<=s?++n:--n)i=e.charCodeAt(n),a+=this.widthOfGlyph(this.characterToGlyph(i))+r*(1e3/t)||0;return a*(t/1e3)},e.prototype.lineHeight=function(e,t){var r;return null==t&&(t=!1),r=t?this.lineGap:0,(this.ascender+r-this.decender)/1e3*e},e}();var vU,wU=function(){function e(e){this.data=e??[],this.pos=0,this.length=this.data.length}return e.prototype.readByte=function(){return this.data[this.pos++]},e.prototype.writeByte=function(e){return this.data[this.pos++]=e},e.prototype.readUInt32=function(){return 16777216*this.readByte()+(this.readByte()<<16)+(this.readByte()<<8)+this.readByte()},e.prototype.writeUInt32=function(e){return this.writeByte(e>>>24&255),this.writeByte(e>>16&255),this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt32=function(){var e;return(e=this.readUInt32())>=2147483648?e-4294967296:e},e.prototype.writeInt32=function(e){return e<0&&(e+=4294967296),this.writeUInt32(e)},e.prototype.readUInt16=function(){return this.readByte()<<8|this.readByte()},e.prototype.writeUInt16=function(e){return this.writeByte(e>>8&255),this.writeByte(255&e)},e.prototype.readInt16=function(){var e;return(e=this.readUInt16())>=32768?e-65536:e},e.prototype.writeInt16=function(e){return e<0&&(e+=65536),this.writeUInt16(e)},e.prototype.readString=function(e){var t,r;for(r=[],t=0;0<=e?t<e:t>e;t=0<=e?++t:--t)r[t]=String.fromCharCode(this.readByte());return r.join("")},e.prototype.writeString=function(e){var t,r,i;for(i=[],t=0,r=e.length;0<=r?t<r:t>r;t=0<=r?++t:--t)i.push(this.writeByte(e.charCodeAt(t)));return i},e.prototype.readShort=function(){return this.readInt16()},e.prototype.writeShort=function(e){return this.writeInt16(e)},e.prototype.readLongLong=function(){var e,t,r,i,n,a,s,o;return e=this.readByte(),t=this.readByte(),r=this.readByte(),i=this.readByte(),n=this.readByte(),a=this.readByte(),s=this.readByte(),o=this.readByte(),128&e?-1*(72057594037927940*(255^e)+281474976710656*(255^t)+1099511627776*(255^r)+4294967296*(255^i)+16777216*(255^n)+65536*(255^a)+256*(255^s)+(255^o)+1):72057594037927940*e+281474976710656*t+1099511627776*r+4294967296*i+16777216*n+65536*a+256*s+o},e.prototype.writeLongLong=function(e){var t,r;return t=Math.floor(e/4294967296),r=4294967295&e,this.writeByte(t>>24&255),this.writeByte(t>>16&255),this.writeByte(t>>8&255),this.writeByte(255&t),this.writeByte(r>>24&255),this.writeByte(r>>16&255),this.writeByte(r>>8&255),this.writeByte(255&r)},e.prototype.readInt=function(){return this.readInt32()},e.prototype.writeInt=function(e){return this.writeInt32(e)},e.prototype.read=function(e){var t,r;for(t=[],r=0;0<=e?r<e:r>e;r=0<=e?++r:--r)t.push(this.readByte());return t},e.prototype.write=function(e){var t,r,i,n;for(n=[],r=0,i=e.length;r<i;r++)t=e[r],n.push(this.writeByte(t));return n},e}(),bU=function(){var e;function t(e){var t,r,i;for(this.scalarType=e.readInt(),this.tableCount=e.readShort(),this.searchRange=e.readShort(),this.entrySelector=e.readShort(),this.rangeShift=e.readShort(),this.tables={},r=0,i=this.tableCount;0<=i?r<i:r>i;r=0<=i?++r:--r)t={tag:e.readString(4),checksum:e.readInt(),offset:e.readInt(),length:e.readInt()},this.tables[t.tag]=t}return t.prototype.encode=function(t){var r,i,n,a,s,o,l,h,A,u,c,d,p;for(p in c=Object.keys(t).length,o=Math.log(2),A=16*Math.floor(Math.log(c)/o),a=Math.floor(A/o),h=16*c-A,(i=new wU).writeInt(this.scalarType),i.writeShort(c),i.writeShort(A),i.writeShort(a),i.writeShort(h),n=16*c,l=i.pos+n,s=null,d=[],t)for(u=t[p],i.writeString(p),i.writeInt(e(u)),i.writeInt(l),i.writeInt(u.length),d=d.concat(u),"head"===p&&(s=l),l+=u.length;l%4;)d.push(0),l++;return i.write(d),r=2981146554-e(i.data),i.pos=s+8,i.writeUInt32(r),i.data},e=function(e){var t,r,i,n;for(e=UU.call(e);e.length%4;)e.push(0);for(i=new wU(e),r=0,t=0,n=e.length;t<n;t=t+=4)r+=i.readUInt32();return 4294967295&r},t}(),xU={}.hasOwnProperty,BU=function(e,t){for(var r in t)xU.call(t,r)&&(e[r]=t[r]);function i(){this.constructor=e}return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e};vU=function(){function e(e){var t;this.file=e,t=this.file.directory.tables[this.tag],this.exists=!!t,t&&(this.offset=t.offset,this.length=t.length,this.parse(this.file.contents))}return e.prototype.parse=function(){},e.prototype.encode=function(){},e.prototype.raw=function(){return this.exists?(this.file.contents.pos=this.offset,this.file.contents.read(this.length)):null},e}();var CU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="head",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.revision=e.readInt(),this.checkSumAdjustment=e.readInt(),this.magicNumber=e.readInt(),this.flags=e.readShort(),this.unitsPerEm=e.readShort(),this.created=e.readLongLong(),this.modified=e.readLongLong(),this.xMin=e.readShort(),this.yMin=e.readShort(),this.xMax=e.readShort(),this.yMax=e.readShort(),this.macStyle=e.readShort(),this.lowestRecPPEM=e.readShort(),this.fontDirectionHint=e.readShort(),this.indexToLocFormat=e.readShort(),this.glyphDataFormat=e.readShort()},e.prototype.encode=function(e){var t;return(t=new wU).writeInt(this.version),t.writeInt(this.revision),t.writeInt(this.checkSumAdjustment),t.writeInt(this.magicNumber),t.writeShort(this.flags),t.writeShort(this.unitsPerEm),t.writeLongLong(this.created),t.writeLongLong(this.modified),t.writeShort(this.xMin),t.writeShort(this.yMin),t.writeShort(this.xMax),t.writeShort(this.yMax),t.writeShort(this.macStyle),t.writeShort(this.lowestRecPPEM),t.writeShort(this.fontDirectionHint),t.writeShort(e),t.writeShort(this.glyphDataFormat),t.data},e}(),SU=function(){function e(e,t){var r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y;switch(this.platformID=e.readUInt16(),this.encodingID=e.readShort(),this.offset=t+e.readInt(),A=e.pos,e.pos=this.offset,this.format=e.readUInt16(),this.length=e.readUInt16(),this.language=e.readUInt16(),this.isUnicode=3===this.platformID&&1===this.encodingID&&4===this.format||0===this.platformID&&4===this.format,this.codeMap={},this.format){case 0:for(o=0;o<256;++o)this.codeMap[o]=e.readByte();break;case 4:for(c=e.readUInt16(),u=c/2,e.pos+=6,n=function(){var t,r;for(r=[],o=t=0;0<=u?t<u:t>u;o=0<=u?++t:--t)r.push(e.readUInt16());return r}(),e.pos+=2,p=function(){var t,r;for(r=[],o=t=0;0<=u?t<u:t>u;o=0<=u?++t:--t)r.push(e.readUInt16());return r}(),l=function(){var t,r;for(r=[],o=t=0;0<=u?t<u:t>u;o=0<=u?++t:--t)r.push(e.readUInt16());return r}(),h=function(){var t,r;for(r=[],o=t=0;0<=u?t<u:t>u;o=0<=u?++t:--t)r.push(e.readUInt16());return r}(),i=(this.length-e.pos+this.offset)/2,s=function(){var t,r;for(r=[],o=t=0;0<=i?t<i:t>i;o=0<=i?++t:--t)r.push(e.readUInt16());return r}(),o=g=0,y=n.length;g<y;o=++g)for(f=n[o],r=m=d=p[o];d<=f?m<=f:m>=f;r=d<=f?++m:--m)0===h[o]?a=r+l[o]:0!==(a=s[h[o]/2+(r-d)-(u-o)]||0)&&(a+=l[o]),this.codeMap[r]=65535&a}e.pos=A}return e.encode=function(e,t){var r,i,n,a,s,o,l,h,A,u,c,d,p,f,g,m,y,_,v,w,b,x,B,C,S,E,I,T,F,P,L,M,k,U,R,D,N,O,Q,z,H,j,V,G,K,q;switch(T=new wU,a=Object.keys(e).sort((function(e,t){return e-t})),t){case"macroman":for(p=0,f=function(){var e=[];for(d=0;d<256;++d)e.push(0);return e}(),m={0:0},n={},F=0,k=a.length;F<k;F++)null==m[V=e[i=a[F]]]&&(m[V]=++p),n[i]={old:e[i],new:m[e[i]]},f[i]=m[e[i]];return T.writeUInt16(1),T.writeUInt16(0),T.writeUInt32(12),T.writeUInt16(0),T.writeUInt16(262),T.writeUInt16(0),T.write(f),{charMap:n,subtable:T.data,maxGlyphID:p+1};case"unicode":for(E=[],A=[],y=0,m={},r={},g=l=null,P=0,U=a.length;P<U;P++)null==m[v=e[i=a[P]]]&&(m[v]=++y),r[i]={old:v,new:m[v]},s=m[v]-i,null!=g&&s===l||(g&&A.push(g),E.push(i),l=s),g=i;for(g&&A.push(g),A.push(65535),E.push(65535),C=2*(B=E.length),x=2*Math.pow(Math.log(B)/Math.LN2,2),u=Math.log(x/2)/Math.LN2,b=2*B-x,o=[],w=[],c=[],d=L=0,R=E.length;L<R;d=++L){if(S=E[d],h=A[d],65535===S){o.push(0),w.push(0);break}if(S-(I=r[S].new)>=32768)for(o.push(0),w.push(2*(c.length+B-d)),i=M=S;S<=h?M<=h:M>=h;i=S<=h?++M:--M)c.push(r[i].new);else o.push(I-S),w.push(0)}for(T.writeUInt16(3),T.writeUInt16(1),T.writeUInt32(12),T.writeUInt16(4),T.writeUInt16(16+8*B+2*c.length),T.writeUInt16(0),T.writeUInt16(C),T.writeUInt16(x),T.writeUInt16(u),T.writeUInt16(b),H=0,D=A.length;H<D;H++)i=A[H],T.writeUInt16(i);for(T.writeUInt16(0),j=0,N=E.length;j<N;j++)i=E[j],T.writeUInt16(i);for(G=0,O=o.length;G<O;G++)s=o[G],T.writeUInt16(s);for(K=0,Q=w.length;K<Q;K++)_=w[K],T.writeUInt16(_);for(q=0,z=c.length;q<z;q++)p=c[q],T.writeUInt16(p);return{charMap:r,subtable:T.data,maxGlyphID:y+1}}},e}(),EU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="cmap",e.prototype.parse=function(e){var t,r,i;for(e.pos=this.offset,this.version=e.readUInt16(),i=e.readUInt16(),this.tables=[],this.unicode=null,r=0;0<=i?r<i:r>i;r=0<=i?++r:--r)t=new SU(e,this.offset),this.tables.push(t),t.isUnicode&&null==this.unicode&&(this.unicode=t);return!0},e.encode=function(e,t){var r,i;return null==t&&(t="macroman"),r=SU.encode(e,t),(i=new wU).writeUInt16(0),i.writeUInt16(1),r.table=i.data.concat(r.subtable),r},e}(),IU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="hhea",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.ascender=e.readShort(),this.decender=e.readShort(),this.lineGap=e.readShort(),this.advanceWidthMax=e.readShort(),this.minLeftSideBearing=e.readShort(),this.minRightSideBearing=e.readShort(),this.xMaxExtent=e.readShort(),this.caretSlopeRise=e.readShort(),this.caretSlopeRun=e.readShort(),this.caretOffset=e.readShort(),e.pos+=8,this.metricDataFormat=e.readShort(),this.numberOfMetrics=e.readUInt16()},e}(),TU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="OS/2",e.prototype.parse=function(e){if(e.pos=this.offset,this.version=e.readUInt16(),this.averageCharWidth=e.readShort(),this.weightClass=e.readUInt16(),this.widthClass=e.readUInt16(),this.type=e.readShort(),this.ySubscriptXSize=e.readShort(),this.ySubscriptYSize=e.readShort(),this.ySubscriptXOffset=e.readShort(),this.ySubscriptYOffset=e.readShort(),this.ySuperscriptXSize=e.readShort(),this.ySuperscriptYSize=e.readShort(),this.ySuperscriptXOffset=e.readShort(),this.ySuperscriptYOffset=e.readShort(),this.yStrikeoutSize=e.readShort(),this.yStrikeoutPosition=e.readShort(),this.familyClass=e.readShort(),this.panose=function(){var t,r;for(r=[],t=0;t<10;++t)r.push(e.readByte());return r}(),this.charRange=function(){var t,r;for(r=[],t=0;t<4;++t)r.push(e.readInt());return r}(),this.vendorID=e.readString(4),this.selection=e.readShort(),this.firstCharIndex=e.readShort(),this.lastCharIndex=e.readShort(),this.version>0&&(this.ascent=e.readShort(),this.descent=e.readShort(),this.lineGap=e.readShort(),this.winAscent=e.readShort(),this.winDescent=e.readShort(),this.codePageRange=function(){var t,r;for(r=[],t=0;t<2;t=++t)r.push(e.readInt());return r}(),this.version>1))return this.xHeight=e.readShort(),this.capHeight=e.readShort(),this.defaultChar=e.readShort(),this.breakChar=e.readShort(),this.maxContext=e.readShort()},e}(),FU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="post",e.prototype.parse=function(e){var t,r,i;switch(e.pos=this.offset,this.format=e.readInt(),this.italicAngle=e.readInt(),this.underlinePosition=e.readShort(),this.underlineThickness=e.readShort(),this.isFixedPitch=e.readInt(),this.minMemType42=e.readInt(),this.maxMemType42=e.readInt(),this.minMemType1=e.readInt(),this.maxMemType1=e.readInt(),this.format){case 65536:case 196608:break;case 131072:var n;for(r=e.readUInt16(),this.glyphNameIndex=[],n=0;0<=r?n<r:n>r;n=0<=r?++n:--n)this.glyphNameIndex.push(e.readUInt16());for(this.names=[],i=[];e.pos<this.offset+this.length;)t=e.readByte(),i.push(this.names.push(e.readString(t)));return i;case 151552:return r=e.readUInt16(),this.offsets=e.read(r);case 262144:return this.map=function(){var t,r,i;for(i=[],n=t=0,r=this.file.maxp.numGlyphs;0<=r?t<r:t>r;n=0<=r?++t:--t)i.push(e.readUInt32());return i}.call(this)}},e}(),PU=function(e,t){this.raw=e,this.length=e.length,this.platformID=t.platformID,this.encodingID=t.encodingID,this.languageID=t.languageID},LU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="name",e.prototype.parse=function(e){var t,r,i,n,a,s,o,l,h,A,u;for(e.pos=this.offset,e.readShort(),t=e.readShort(),s=e.readShort(),r=[],n=0;0<=t?n<t:n>t;n=0<=t?++n:--n)r.push({platformID:e.readShort(),encodingID:e.readShort(),languageID:e.readShort(),nameID:e.readShort(),length:e.readShort(),offset:this.offset+s+e.readShort()});for(o={},n=h=0,A=r.length;h<A;n=++h)i=r[n],e.pos=i.offset,l=e.readString(i.length),a=new PU(l,i),null==o[u=i.nameID]&&(o[u]=[]),o[i.nameID].push(a);this.strings=o,this.copyright=o[0],this.fontFamily=o[1],this.fontSubfamily=o[2],this.uniqueSubfamily=o[3],this.fontName=o[4],this.version=o[5];try{this.postscriptName=o[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}catch{this.postscriptName=o[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g,"")}return this.trademark=o[7],this.manufacturer=o[8],this.designer=o[9],this.description=o[10],this.vendorUrl=o[11],this.designerUrl=o[12],this.license=o[13],this.licenseUrl=o[14],this.preferredFamily=o[15],this.preferredSubfamily=o[17],this.compatibleFull=o[18],this.sampleText=o[19]},e}(),MU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="maxp",e.prototype.parse=function(e){return e.pos=this.offset,this.version=e.readInt(),this.numGlyphs=e.readUInt16(),this.maxPoints=e.readUInt16(),this.maxContours=e.readUInt16(),this.maxCompositePoints=e.readUInt16(),this.maxComponentContours=e.readUInt16(),this.maxZones=e.readUInt16(),this.maxTwilightPoints=e.readUInt16(),this.maxStorage=e.readUInt16(),this.maxFunctionDefs=e.readUInt16(),this.maxInstructionDefs=e.readUInt16(),this.maxStackElements=e.readUInt16(),this.maxSizeOfInstructions=e.readUInt16(),this.maxComponentElements=e.readUInt16(),this.maxComponentDepth=e.readUInt16()},e}(),kU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="hmtx",e.prototype.parse=function(e){var t,r,i,n,a,s,o;for(e.pos=this.offset,this.metrics=[],t=0,s=this.file.hhea.numberOfMetrics;0<=s?t<s:t>s;t=0<=s?++t:--t)this.metrics.push({advance:e.readUInt16(),lsb:e.readInt16()});for(i=this.file.maxp.numGlyphs-this.file.hhea.numberOfMetrics,this.leftSideBearings=function(){var r,n;for(n=[],t=r=0;0<=i?r<i:r>i;t=0<=i?++r:--r)n.push(e.readInt16());return n}(),this.widths=function(){var e,t,r,i;for(i=[],e=0,t=(r=this.metrics).length;e<t;e++)n=r[e],i.push(n.advance);return i}.call(this),r=this.widths[this.widths.length-1],o=[],t=a=0;0<=i?a<i:a>i;t=0<=i?++a:--a)o.push(this.widths.push(r));return o},e.prototype.forGlyph=function(e){return e in this.metrics?this.metrics[e]:{advance:this.metrics[this.metrics.length-1].advance,lsb:this.leftSideBearings[e-this.metrics.length]}},e}(),UU=[].slice,RU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="glyf",e.prototype.parse=function(){return this.cache={}},e.prototype.glyphFor=function(e){var t,r,i,n,a,s,o,l,h,A;return e in this.cache?this.cache[e]:(n=this.file.loca,t=this.file.contents,r=n.indexOf(e),0===(i=n.lengthOf(e))?this.cache[e]=null:(t.pos=this.offset+r,a=(s=new wU(t.read(i))).readShort(),l=s.readShort(),A=s.readShort(),o=s.readShort(),h=s.readShort(),this.cache[e]=-1===a?new NU(s,l,A,o,h):new DU(s,a,l,A,o,h),this.cache[e]))},e.prototype.encode=function(e,t,r){var i,n,a,s,o;for(a=[],n=[],s=0,o=t.length;s<o;s++)i=e[t[s]],n.push(a.length),i&&(a=a.concat(i.encode(r)));return n.push(a.length),{table:a,offsets:n}},e}(),DU=function(){function e(e,t,r,i,n,a){this.raw=e,this.numberOfContours=t,this.xMin=r,this.yMin=i,this.xMax=n,this.yMax=a,this.compound=!1}return e.prototype.encode=function(){return this.raw.data},e}(),NU=function(){function e(e,t,r,i,n){var a,s;for(this.raw=e,this.xMin=t,this.yMin=r,this.xMax=i,this.yMax=n,this.compound=!0,this.glyphIDs=[],this.glyphOffsets=[],a=this.raw;s=a.readShort(),this.glyphOffsets.push(a.pos),this.glyphIDs.push(a.readUInt16()),32&s;)a.pos+=1&s?4:2,128&s?a.pos+=8:64&s?a.pos+=4:8&s&&(a.pos+=2)}return e.prototype.encode=function(){var e,t,r;for(t=new wU(UU.call(this.raw.data)),e=0,r=this.glyphIDs.length;e<r;++e)t.pos=this.glyphOffsets[e];return t.data},e}(),OU=function(){function e(){return e.__super__.constructor.apply(this,arguments)}return BU(e,vU),e.prototype.tag="loca",e.prototype.parse=function(e){var t,r;return e.pos=this.offset,t=this.file.head.indexToLocFormat,this.offsets=0===t?function(){var t,i;for(i=[],r=0,t=this.length;r<t;r+=2)i.push(2*e.readUInt16());return i}.call(this):function(){var t,i;for(i=[],r=0,t=this.length;r<t;r+=4)i.push(e.readUInt32());return i}.call(this)},e.prototype.indexOf=function(e){return this.offsets[e]},e.prototype.lengthOf=function(e){return this.offsets[e+1]-this.offsets[e]},e.prototype.encode=function(e,t){for(var r=new Uint32Array(this.offsets.length),i=0,n=0,a=0;a<r.length;++a)if(r[a]=i,n<t.length&&t[n]==a){++n,r[a]=i;var s=this.offsets[a],o=this.offsets[a+1]-s;o>0&&(i+=o)}for(var l=new Array(4*r.length),h=0;h<r.length;++h)l[4*h+3]=255&r[h],l[4*h+2]=(65280&r[h])>>8,l[4*h+1]=(16711680&r[h])>>16,l[4*h]=(4278190080&r[h])>>24;return l},e}(),QU=function(){function e(e){this.font=e,this.subset={},this.unicodes={},this.next=33}return e.prototype.generateCmap=function(){var e,t,r,i,n;for(t in i=this.font.cmap.tables[0].codeMap,e={},n=this.subset)r=n[t],e[t]=i[r];return e},e.prototype.glyphsFor=function(e){var t,r,i,n,a,s,o;for(i={},a=0,s=e.length;a<s;a++)i[n=e[a]]=this.font.glyf.glyphFor(n);for(n in t=[],i)null!=(r=i[n])&&r.compound&&t.push.apply(t,r.glyphIDs);if(t.length>0)for(n in o=this.glyphsFor(t))r=o[n],i[n]=r;return i},e.prototype.encode=function(e,t){var r,i,n,a,s,o,l,h,A,u,c,d,p,f,g;for(i in r=EU.encode(this.generateCmap(),"unicode"),a=this.glyphsFor(e),c={0:0},g=r.charMap)c[(o=g[i]).old]=o.new;for(d in u=r.maxGlyphID,a)d in c||(c[d]=u++);return h=function(e){var t,r;for(t in r={},e)r[e[t]]=t;return r}(c),A=Object.keys(h).sort((function(e,t){return e-t})),p=function(){var e,t,r;for(r=[],e=0,t=A.length;e<t;e++)s=A[e],r.push(h[s]);return r}(),n=this.font.glyf.encode(a,p,c),l=this.font.loca.encode(n.offsets,p),f={cmap:this.font.cmap.raw(),glyf:n.table,loca:l,hmtx:this.font.hmtx.raw(),hhea:this.font.hhea.raw(),maxp:this.font.maxp.raw(),post:this.font.post.raw(),name:this.font.name.raw(),head:this.font.head.encode(t)},this.font.os2.exists&&(f["OS/2"]=this.font.os2.raw()),this.font.directory.encode(f)},e}();ZM.API.PDFObject=function(){var e;function t(){}return e=function(e,t){return(Array(t+1).join("0")+e).slice(-t)},t.convert=function(r){var i,n,a,s;if(Array.isArray(r))return"["+function(){var e,n,a;for(a=[],e=0,n=r.length;e<n;e++)i=r[e],a.push(t.convert(i));return a}().join(" ")+"]";if("string"==typeof r)return"/"+r;if(r?.isString)return"("+r+")";if(r instanceof Date)return"(D:"+e(r.getUTCFullYear(),4)+e(r.getUTCMonth(),2)+e(r.getUTCDate(),2)+e(r.getUTCHours(),2)+e(r.getUTCMinutes(),2)+e(r.getUTCSeconds(),2)+"Z)";if("[object Object]"==={}.toString.call(r)){for(n in a=["<<"],r)s=r[n],a.push("/"+n+" "+t.convert(s));return a.push(">>"),a.join("\n")}return""+r},t}();var zU=!1,HU=function(){function e(e,t,r){for(let i=0;i<t;++i)if(0!==e.data[r*t*4+4*i+3])return!1;return!0}function t(e,t,r,i,n){for(let a=i;a<n;++a)if(0!==e.data[a*t*4+4*r+3])return!1;return!0}return function(r){let i=r.getContext("2d"),n=r.width,a=i.getImageData(0,0,r.width,r.height),s=a.height,o=0,l=a.width,h=0;for(;h<s&&e(a,n,h);)++h;for(;s-1>h&&e(a,n,s-1);)--s;for(;o<l&&t(a,n,o,h,s);)++o;for(;l-1>o&&t(a,n,l-1,h,s);)--l;let A=i.getImageData(o,h,l-o,s-h),u=r.ownerDocument.createElement("canvas"),c=u.getContext("2d");return u.width=A.width,u.height=A.height,c.putImageData(A,0,0),u}}(),jU=(e,t,r,i)=>{let n=document.createElement("canvas");n.width=t,n.height=r;let{fillStyle:a="black",font:s="12px Arial",textAlign:o="left",textBaseline:l="top"}=i,h=n.getContext("2d");h.fillStyle=a,h.font=s,h.font=((e,t,r,i=1)=>{let n,a;do{n=e.font.match(/[0-9]+(?:\.[0-9]+)?(px)/i),a=parseInt(n[0].replace(n[1],""),10),e.font=e.font.replace(a,a-1),zU=!1,a-1==8&&(zU=!0)}while(a-1>8&&e.measureText(r).width*i>t);return e.font})(h,n.width,e),h.textAlign=o,h.textBaseline=l;let A=e,u=h.measureText(A);if(zU){let t=e.split(" ").length;for(let e=0;e<t&&!(1*u.width<n.width);e+=1)A=A.substring(0,A.lastIndexOf(" ")),u=h.measureText(A)}let c=[A,e.replace(A,"").trim()].filter((e=>!!e));"bottom"===l&&(c=c.reverse());let d="right"===o?n.width:0,p="bottom"===l?n.height:0;return c.forEach((e=>{let{fontBoundingBoxAscent:t,fontBoundingBoxDescent:r}=h.measureText(e),i=t+r;h.fillText(e,d,p);let n=i;"bottom"===l&&(n=-i),p+=n})),HU(n)},VU=(e,t,r)=>{let i,n;if(t?(i=kd(t),n=Td(t)):r&&([i,,n]=r),i&&n){let t=e.getPixelFromCoordinate(i),r=e.getPixelFromCoordinate(n),a=[t[0]<=r[0]?t[0]:r[0],t[1]<=r[1]?t[1]:r[1]],s=[t[0]>r[0]?t[0]:r[0],t[1]>r[1]?t[1]:r[1]];return{h:s[1]-a[1],w:s[0]-a[0],x:a[0],y:a[1]}}return null},GU=(e,t,r)=>{let i,n,a=e.getTargetElement().getElementsByTagName("canvas");for(let s=0;s<a.length;s+=1){let o=a[s];if(!o.width||!o.height)continue;let l=VU(e,t,r)||{h:o.height,w:o.width,x:0,y:0};i||(i=document.createElement("canvas"),i.width=l.w,i.height=l.h,n=i.getContext("2d")),n.drawImage(o,l.x,l.y,l.w,l.h,0,0,i.width,i.height)}return Promise.resolve(i)},KU={A0:[3370,2384],A1:[2384,1684],A3:[1191,842],A4:[842,595]};var qU=async function(e,t={},r={}){let i,{maxExtent:n,onAfter:a,onBefore:s,pixelRatio:o=3,useCopyright:l=!0,usePlaceholder:h=!0}=r,A=t?.format||"A4",u=KU[A]||A,c=u.map((e=>96*e/72)),d=n,p=window.devicePixelRatio;Object.defineProperty(window,"devicePixelRatio",{get:()=>o}),h&&(i=await GU(e),i.style.zIndex="0",i.style.position="absolute",e.getViewport().querySelector(".ol-layers").insertAdjacentElement("afterend",i));let f=[...e.getLayers().getArray()],g=r?.copyrightOptions?.text||e.getControls().getArray().find((e=>e instanceof Gy))?.element?.textContent;e.getLayers().clear(),s?.(e,f);let m=await(async(e,t,r,i,n={},a={})=>{let s=i||e.getSize(),o=r,l=document.createElement("div");l.style.width=`${s[0]}px`,l.style.height=`${s[1]}px`,l.style.margin="0 0 0 -50000px",document.body.style.overflow="hidden",l.style.position="absolute",l.style.top="400px",l.style.zIndex="10000",document.body.append(l);let h=new bC({pixelRatio:window.devicePixelRatio,target:l,view:new By({center:e.getView().getCenter(),projection:e.getView().getProjection(),zoom:e.getView().getZoom(),...a}),...n});return o&&h.getView().fit(o),h.setLayers(t),await new Promise((e=>{let t=window.setTimeout((()=>{e(h)}),1e4);h.once("rendercomplete",(()=>{clearTimeout(t),e(h)}))}))})(e,f,d,c,{pixelRatio:o});Object.defineProperty(window,"devicePixelRatio",{get:()=>p});let y=await GU(m);if(m.getLayers().clear(),m.getTargetElement().remove(),m.setTarget(null),m.dispose(),document.body.style.overflow="auto",e.setLayers(f),a?.(e,f),i&&e.once("rendercomplete",(()=>{i.remove()})),l&&((e,t,r={})=>{let{fillStyle:i,font:n,margin:a=10,placement:s="bottom-left"}=r,[o,l]=s.split("-"),h="function"==typeof e?e():e,A=jU(h,t.width,t.height,{fillStyle:i,font:n,textAlign:l,textBaseline:o}),u=a,c=a;"right"===l&&(u=t.width-A.width-a),"bottom"===o&&(c=t.height-A.height-a),t.getContext("2d").drawImage(A,u,c)})(g,y,{...r?.copyrightOptions||{},font:`${(12*o).toString()}px Arial`}),/^A[0-9]{1,2}/.test(A)||2===A?.length){try{let e=new ZM({orientation:"landscape",unit:"pt",...t});e.addImage(y,"JPEG",0,0,u[0],u[1]),e.save(`rvf-${(new Date).toISOString().slice(0,10)}.pdf`)}catch(e){return console.error(e),!1}return!0}return await((e,t="image/png",r=e=>e.replace("/","."))=>{try{if(window.navigator.msSaveBlob){let i;try{i=e.msToBlob()}catch(e){console.error(e)}let n=new Blob([i],{type:t});window.navigator.msSaveBlob(n,r(t))}else e.toBlob((e=>{let i=document.createElement("a");i.download=r(t),i.href=URL.createObjectURL(e),document.body.appendChild(i),i.click()}),t);return Promise.resolve(!0)}catch(e){return console.error(e),Promise.resolve(!1)}})(y)},ZU=e=>{let t=[];return function e(r){r.forEach((function(r){r instanceof gC?e(r.getLayers()):t.push(r)}))}(e?.getLayers?.()||e),t},WU=["A4","A3","A1","A0"],$U=!1;var XU=ec((function({...e}){let{map:t,realtimeLayer:r}=hT(),[i,n]=Eu(!1),[a,s]=Eu(WU[0]),o=Du(),l=Du(),[h,A]=Eu(!1),[u,c]=Eu(!1),{t:d}=yP();return kF("div",{...e,children:[kF("div",{className:"flex flex-1 flex-col gap-4",children:[kF("div",{className:"flex flex-wrap items-center gap-2",children:[kF(TP,{checked:i,id:o,onChange:()=>n(!i)}),kF("label",{htmlFor:o,children:d("export_all_region")})]}),kF("div",{className:"flex flex-wrap items-center gap-2",children:[kF("label",{htmlFor:l,children:[d("export_format_title"),":"]}),kF(PP,{className:"w-24",id:l,onChange:e=>{s(e.target.value)},children:WU.map((e=>kF("option",{children:e},e)))})]})]}),kF("div",{children:kF(IP,{disabled:h,onClick:async()=>{c(!1),A(!0);let e=await qU(t,{format:a},{maxExtent:i?undefined:void 0,onAfter:(e,t)=>{r&&$U!==r?.getVisible()&&r.setVisible($U),ZU(t).forEach((e=>{e.set(wT,!1)})),e.set(wT,!1)},onBefore:(e,t)=>{e.set(wT,!0),r&&($U=r.getVisible(),r.getVisible()&&r.setVisible(!1)),ZU(t).forEach((e=>{e.set(wT,!0)}))}});setTimeout((()=>{A(!1),c(!e)}),1e3)},children:d(h?"exporting":u?"error":"download")})})]})})),YU=eu(null),JU=eu(null);var eR=function(e){return kF(sP,{size:24,...e})};var tR=function e({childContainerClassName:t,childItems:r,className:i,isCollapsedOnControlClick:n,isControlChecked:a,layer:s,selectionType:o,title:l}){let[h,A]=Eu(!0),u=Uu(JU),c=Du(),d=Du(),{t:p}=yP();Tu((()=>{n&&A(a)}),[a,n,s]);let f=r.filter((({title:e})=>!!e)).map(((t,r)=>kF(e,{...t},r)));if(!l)return null;let g=()=>r.length>0&&(r.filter((e=>e.isControlChecked)).length!==r.length&&r.some((e=>e.isControlChecked)));return kF(PA,{children:[kF("div",{className:LF("flex items-center gap-2 py-2",i),children:["radio"===o?null:kF(TP,{checked:a,checkedIconUrl:g()?'data:image/svg+xml,<?xml version="1.0" encoding="UTF-8"?>%0A<svg width="24px" height="24px" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">%0A    <title>iconfont/minus</title>%0A    <g id="iconfont/minus" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">%0A        <path d="M19,10.9999 C19.5522847,10.9999 20,11.4476153 20,11.9999 C20,12.5521847 19.5522847,12.9999 19,12.9999 L5,12.9999 C4.44771525,12.9999 4,12.5521847 4,11.9999 C4,11.4476153 4.44771525,10.9999 5,10.9999 L19,10.9999 Z" id="Line-6" fill="%23000000" fill-rule="nonzero"></path>%0A    </g>%0A</svg>':null,className:g()?"bg-[length:18px]":"",id:c,onChange:e=>{u({payload:{...this.props,isControlChecked:e.target.checked},type:"SELECT_ITEM"})}}),kF("label",{className:"flex-1 cursor-pointer",htmlFor:f.length>0?d:c,children:"string"==typeof l?p(l):l}),f.length>0&&kF("button",{className:"flex cursor-pointer items-center gap-2",id:d,onClick:()=>{A(!h),n&&!h&&u({payload:{...this.props,isControlChecked:!0},type:"SELECT_ITEM"})},children:kF(h?eR:FP,{})})]}),h&&f.length>0&&kF("div",{className:LF("pl-6",t),children:f})]})},rR={childItems:[],parent:null},iR=(e,t)=>{for(let r of e)r.parent=t,r.childItems.length&&iR(r.childItems,r)},nR=(e,t)=>{if(e.id===t.id)return e;if(e.childItems.length)for(let r of e.childItems){let e=nR(r,t);if(e)return e}},aR=(e,t,r)=>{if(t.isControlChecked)if("checkbox"===t.selectionType)e.isControlChecked=t.isControlChecked,e.layer.setVisible(e.isControlChecked);else for(let t of e.parent.childItems)t.isControlChecked=t.id===e.id,t.isControlChecked||oR(t);else"checkbox"===t.selectionType&&(e.isControlChecked=t.isControlChecked,e.layer.setVisible(e.isControlChecked));e.childItems.length&&!r&&sR(e),hR(e)},sR=e=>{"radio"===e.childItems[0].selectionType?oR(e):lR(e)},oR=e=>{if(e.isControlChecked)for(let t=0;t<e.childItems.length;t++)e.childItems[t].isControlChecked=0===t;else for(let t of e.childItems)t.isControlChecked=!1;e.childItems.length&&e.childItems[0].childItems.length&&sR(e.childItems[0])},lR=e=>{for(let t of e.childItems)t.isControlChecked=e.isControlChecked,t.layer.setVisible(t.isControlChecked),t.childItems.length&&sR(t)},hR=e=>{if(e.parent)if("checkbox"===e.parent.selectionType){let t={...e.parent,isControlChecked:e.parent.childItems.some((e=>e.isControlChecked))};aR(e.parent,t,!0)}else if(e?.parent?.parent){let t={...e.parent,isControlChecked:e.parent.childItems.some((e=>e.isControlChecked))};aR(e.parent,t,!0)}};var AR=function(e=rR,t){switch(t.type){case"INIT":return(e=>{let t={...rR};return t.childItems=e,iR(t.childItems,t),t})(t.payload);case"SELECT_ITEM":return((e,t)=>{let r=nR(e,t);return r&&aR(r,t,!1),{...e}})(e,t.payload);default:return e}};var uR=ec((function({className:e,layers:t,treeItemProps:r,...i}){let[n,a]=Iu(AR,t);return Tu((()=>{a({payload:t,type:"INIT"})}),[t]),kF(YU.Provider,{value:n,children:kF(JU.Provider,{value:a,children:kF("div",{className:LF("relative flex flex-col",e),...i,children:t.map((e=>TA(tR,{...r||{},className:LF("w-full",r?.className),key:e.id,...e})))})})})}));var cR=function(){let{layersconfig:e}=hT(),[t,r]=Eu({});return Tu((()=>{try{let t=JSON.parse(e||"{}");Object.values(yT).forEach((e=>{t[e]={title:e,...t[e]||{}}})),r(t)}catch(e){console.error("Error parsing layersconfig:",e)}}),[e]),t},dR=(e,t,r={})=>{let i=r[e.get("name")]?.title||"",n=e.get("layerTreeTitle"),a=i;return"function"==typeof n&&(a=n(a)),{childItems:e?.getLayers?.().getArray().map((e=>dR(e,t,r)))||[],id:Hd(e),isControlChecked:e.getVisible(),layer:e,revision:t,selectionType:"checkbox",title:a}};var pR=ec((function(e){let{map:t}=hT(),[r,i]=Eu(0),n=cR(),a=Mu((()=>t?.getLayers().getArray().map((e=>dR(e,r,n)))||[]),[n,t,r]);return Tu((()=>{let e=[];return nd(t.getLayers().getArray()).forEach((t=>{let r=t.on("change:visible",(()=>{i((e=>e+1))}));e.push(r)})),e.push(t.on("change:layergroup",(()=>{i((e=>e+1))})),t.getLayers().on("add",(()=>{i((e=>e+1))})),t.getLayers().on("remove",(()=>{i((e=>e+1))}))),()=>{mp(e)}}),[t]),kF(uR,{layers:a,...e})}));var fR=function(e){return kF("svg",{height:"24",viewBox:"0 0 42 42",width:"24",xmlns:"http://www.w3.org/2000/svg",...e,children:[kF("path",{d:"M40,20A20,20,0,1,1,20,0,20,20,0,0,1,40,20Z","data-name":"Pfad 1",fill:"#353535",id:"Pfad_1",transform:"translate(0 0)"}),kF("path",{d:"M25.481,11.843a9.993,9.993,0,0,0-10,9.992c0,7.773,10,14.8,10,14.8s9.992-7.5,9.992-14.8a9.991,9.991,0,0,0-9.992-9.992m0,14.662a4.924,4.924,0,1,1,4.924-4.924A4.93,4.93,0,0,1,25.482,26.5","data-name":"Pfad 2",fill:"#fff",id:"Pfad_2",transform:"translate(-5.477 -4.19)"}),kF("path",{d:"M12.015,8.124,38.081,34.031,35.4,36.536,9.06,10.527Z","data-name":"Pfad 3",fill:"#ec0016",id:"Pfad_3",transform:"translate(-3.206 -2.874)"}),kF("path",{d:"M20,3.231A16.769,16.769,0,1,1,3.231,20,16.788,16.788,0,0,1,20,3.231M20,0A20,20,0,1,0,40,20,20,20,0,0,0,20,0","data-name":"Pfad 4",fill:"#353535",id:"Pfad_4",transform:"translate(0 0)"})]})},gR=Qm.getBgColor,mR=(e=null)=>{let t=e?.properties?.line?.color||e?.line?.color||e?.color;if(!t){let r=e?.properties?.type||e?.type;if(!r){let t=e?.vehicleType;Number.isFinite(t)||(t=e?.train_type),r=Number.isFinite(t)?t:"rail"}t=gR(r)||gR("rail")}return t&&"#"!==t[0]&&(t=`#${t}`),t},yR=e=>Qm.getTextColor(e),_R=(e,t)=>`bold ${e}px arial`,vR=(e="")=>e?.properties?.line?.name||e?.line?.name||e?.name||e||"",wR=[16,16,16,14,12];var bR=function({children:e,className:t,departure:r,displayNoRealtimeIcon:i=!1,line:n,stopSequence:a,trajectory:s,...o}){let l=n||r?.line||a?.line||s?.properties?.line,h=l?.type||a?.type||s?.type,A=mR(n||r||a||s),u=l?.text_color||yR(h),c=l?.stroke||"black",d=vR(n||r||a||s),p=wR[d.length]||12,f=_R(p,d),g=!0===a?.has_realtime_journey,m=!!a,y="JOURNEY_CANCELLED"===a?.stations[0]?.state;return c===A&&(c="black"),kF("span",{className:LF("relative flex h-[40px] min-w-[40px] items-center justify-center rounded-full border-2 px-1",t),style:{backgroundColor:A,borderColor:c,color:u,font:f},...o,children:[e||d,i&&m&&!y&&!g&&kF(fR,{className:"absolute -top-2 -left-2"})]})};var xR=ec((function({children:e,className:t,...r}){return kF("div",{...r,className:LF("relative overflow-y-auto",t),children:[kF("div",{className:"pointer-events-none sticky top-0 right-0 left-0 h-4 bg-gradient-to-t from-transparent to-white"}),e,kF("div",{className:"pointer-events-none sticky right-0 bottom-[-1px] left-0 h-4 bg-gradient-to-b from-transparent to-white"})]})})),BR=null,CR=null,SR="original_line_id";var ER=function({className:e,features:t,...r}){let{baseLayer:i}=hT(),[n,a]=Eu(null),[s,o]=Eu(null),[l,h]=Eu(null),A=Mu((()=>"true"===new URLSearchParams(window.location.search).get("runs")),[]);Tu((()=>{let e=i?.mapLibreMap?.getSource("network_plans"),t=new AbortController;return e?.url&&(async e=>{if(!BR){let r=await(await fetch(e,{signal:t.signal})).json();BR=r["geops.lnp.lines"],CR=r["geops.lnp.stops"]}a(BR),o(CR)})(e?.url),()=>{t?.abort()}}),[i?.mapLibreMap]);let u=Mu((()=>{let e={};return[...new Set(t.map((e=>e.get(SR))))].filter((e=>!!e&&!!n?.[e])).forEach((r=>{let{operator_name:i}=n[r];e[i]||(e[i]=[],e[i].runs=0),n[r].id=r;let a=t.filter((e=>e.get(SR)===r)).reduce(((e,t)=>e+t.get("runs")),0);n[r].id=r,n[r].runs=a,e[i].runs+=a,e[i].push(n[r])})),e}),[t,n]);return Mu((()=>{let e={};return t.forEach((t=>{let r=t.get(SR);if(r&&!e[r]&&t.get("stop_ids"))try{e[r]=JSON.parse(t.get("stop_ids"))}catch(e){console.log(e)}})),e}),[t]),t?.length&&n?kF(xR,{...r,className:LF("px-4 text-base",e),children:kF("div",{className:"space-y-4",children:Object.entries(u).sort((([e],[t])=>u[e].runs<u[t].runs?1:-1)).map((([e,t])=>kF("div",{className:"flex flex-col gap-2",children:[kF("div",{children:e}),kF("div",{className:"flex flex-wrap gap-2",children:t.sort(((e,t)=>e.runs<t.runs?1:-1)).map((e=>{let{color:t,long_name:r,mot:i,runs:n,short_name:a,text_color:o}=e,l=r,h=null;if(h?.length||(h=null),!l&&h){let e=h.map((e=>s[e].short_name));l=[...new Set([e[0],e[e.length-1]])].join(" - ")}let u={color:null,id:null,name:a,stroke:null,text_color:null,type:i};return o&&(u.text_color=o.startsWith("#")?o:`#${o}`),t&&(u.color=t.startsWith("#")?t:`#${t}`),kF("div",{className:l?"w-full":"",children:kF("div",{className:"flex justify-between gap-2",children:[kF("div",{children:kF(bR,{line:u})}),!!l&&kF("div",{className:"flex-1 text-left *:before:content-['_–'] *:first:font-semibold *:first:before:!content-[_p] *:last:font-semibold *:last:before:!content-[_p]",children:l.split("-").map((e=>kF("div",{children:e},e)))}),A&&kF("div",{className:"text-xs",children:n})]})},a)}))})]},e)))})}):null};var IR=function(e){return kF(JF,{size:24,...e})},TR=(e,t,r)=>{let i=e.toLocaleTimeString(["de"],{hour:"2-digit",minute:"2-digit"});return`${e.toLocaleDateString(["de"],{day:"2-digit",month:"short",weekday:"short",year:r?"numeric":void 0})}${t&&t!==i?` ${i}`:""}`.replace(",","").replace(/\./,"").replace(/\.$/,"")};var FR=function({className:e,feature:t,...r}){let{t:i}=yP(),{notificationtenant:n}=hT(),[a,s]=Eu([]),{affected_products:o,affected_time_intervals:l,consequence_de:h,description_de:A,disruption_type:u,reason_de:c,recommendation_de:d,situation:p,summary_de:f}=t.getProperties();Tu((()=>{let e=new AbortController;return n||s([]),fetch(`https://tralis-tracker-api.geops.io/api/lines/${n}/`).then((e=>e.json())).then((e=>{s(e)})).catch((e=>{console.error("Failed to fetch lines",e)})),()=>{e?.abort()}}),[n]);let g="",m="",y=[];try{let e=JSON.parse(l)?.[0]||{};m=e.start,g=e.end,y=JSON.parse(o),y?.sort(((e,t)=>e.name.localeCompare(t.name)))}catch(e){console.error(e)}if(u)return kF("div",{className:"flex flex-col gap-2 text-sm",children:[!!y?.length&&kF("div",{className:"flex flex-wrap gap-2",children:y?.map((({name:e})=>{let t=((e,t)=>{if(t?.length){let r=t.find((t=>t.name===e));if(r)return r}return{mot:"bus",name:e}})(e,a);return kF(PA,{children:kF("div",{className:"w-fit rounded-md bg-black px-[12px] py-[9px] leading-none font-bold text-white",style:{backgroundColor:gR(t.mot,t)},children:e},e)})}))}),kF("div",{className:"text-base font-bold",children:[!!m&&!g&&`ab${TR(new Date(m),!0)}`,!m&&!!g&&`bis${TR(new Date(g),!0)}`,!!m&&!!g&&`${TR(new Date(m),!0)} - ${TR(new Date(g),!0)}`]}),kF("div",{className:"flex flex-col gap-2",children:[kF("p",{className:"text-base",children:f}),kF("p",{className:"text-base",children:A}),[{content:d,label:"recommendation"},{content:c,label:"reason"},{content:h,label:"consequence"}].map((e=>e.content?kF("div",{children:[!!e.label&&kF("p",{className:"font-bold",children:[i(e.label),":"]}),kF("p",{children:e.content})]},e.content):null))]})]});let _={},v=[],w=[],b=[];try{let e=JSON.parse(p)||{};w=(e?.publications||[])?.filter((({publicationWindows:e})=>e.find((({endTime:e,startTime:t})=>{let r=new Date,i=new Date(t),n=new Date(e);return i<=r&&r<=n}))))||[],v=(e?.affectedTimeIntervals||[]).filter((({endTime:e,startTime:t})=>{let r=new Date,i=new Date(t),n=new Date(e);return i<=r&&r<=n||r<i}))||[],b=(e?.reasons||[]).map((({name:e})=>e))}catch(e){console.error("Failed to parse publications",e)}return kF(xR,{...r,className:LF("px-4 text-base",e),children:kF("div",{children:w?.map((({id:e,publicationLines:t,publicationStops:r,textualContentLarge:n,textualContentMedium:a,textualContentSmall:s})=>{_=(n||a||s)?.de;let o=t?.flatMap((e=>e.lines?.map((({name:e})=>e))||[]))||[],l=r.map((e=>e?.name||""));return kF("div",{className:"text-base",children:[kF("div",{className:"text-xs uppercase",children:b}),kF("h3",{className:"space-x-2 text-lg font-bold text-balance",children:[kF("span",{className:"line-height-[1.3] inline-block align-middle",children:kF(IR,{})}),kF("span",{className:"*:inline",dangerouslySetInnerHTML:{__html:_?.summary}})]}),kF("hr",{className:"my-1"}),v?.map((({dailyEndTime:e,dailyStartTime:t,endTime:r,startTime:n})=>{let a=e&&t,s=(new Date).getFullYear()===new Date(n).getFullYear(),o=(new Date).getFullYear()===new Date(r).getFullYear(),l=r.includes("2500");return kF("div",{className:"text-sm font-bold text-balance",children:[kF("span",{children:i("from_to",{from:TR(new Date(n),!a,!s),to:l?void 0:TR(new Date(r),!a,!o)})}),a&&kF("span",{children:` (${i("daily_from_to",{from:t,to:e})})`})]},n)})),kF("div",{className:"mt-4",dangerouslySetInnerHTML:{__html:_?.description||i("no_details_available")}}),!!o?.length&&kF("div",{children:[kF("br",{}),kF("div",{className:"font-bold",children:[i("affected_lines"),":"]}),kF("div",{className:"flex flex-wrap gap-1 text-sm",children:o?.map((e=>kF("div",{className:"rounded-md bg-black px-2 py-1 font-bold text-white",children:e},e)))})]}),kF("div",{children:[kF("br",{}),kF("div",{className:"font-bold",children:[i("affected_stops"),":"]}),kF("div",{className:"flex flex-wrap gap-1 text-sm",children:l?.length?l.map((e=>kF("div",{className:"rounded-md bg-black px-2 py-1 font-bold text-white",children:e},e))):kF("div",{className:"rounded-md bg-black px-2 py-1 font-bold text-white",children:i("all_line_stops")})})]})]},e)}))})})},PR=(e,t)=>t?kF("a",{className:"whitespace-normal underline",href:t,rel:"noreferrer",target:"_blank",children:e}):e;var LR=ec((function(){let{stopSequence:e}=hT();return e.operator||e.publisher?kF(PA,{children:[kF("div",{className:"m-4 mb-0 flex flex-wrap text-xs text-gray-500",children:[e.operator&&PR(e.operator,e.operatorUrl),e.operator&&e.publisher&&kF("span",{children:" - "}),e.publisher&&PR(e.publisher,e.publisherUrl),e.license&&kF("span",{children:" ("}),e.license&&PR(e.license,e.licenseUrl),e.license&&")"]}),kF("div",{className:"pointer-events-none sticky bottom-0 h-8 w-full bg-gradient-to-b from-transparent to-white"})]}):null}));var MR=function({...e}){return kF("svg",{fill:"none",height:"24",part:"svg",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...e,children:[kF("path",{clipRule:"evenodd",d:"M7 0.333344C7.375 0.333344 7.66667 0.62501 7.66667 0.97921V2.35414C9.7292 2.66668 11.3333 4.27081 11.625 6.33334H13C13.375 6.33334 13.6667 6.62501 13.6667 7.00001C13.6667 7.37501 13.375 7.66668 13 7.66668H11.625C11.3333 9.70834 9.70833 11.3333 7.66667 11.625V13C7.66667 13.375 7.375 13.6667 7 13.6667C6.64587 13.6667 6.33333 13.375 6.33333 13V11.625C4.29167 11.3333 2.68747 9.70834 2.39587 7.66668H1C0.625 7.66668 0.333333 7.37501 0.333333 7.00001C0.333333 6.62501 0.625 6.33334 1 6.33334H2.39587C2.68747 4.27081 4.29167 2.66668 6.33333 2.35414V0.97921C6.33333 0.62501 6.64587 0.333344 7 0.333344ZM7 3.66668C5.16667 3.66668 3.66667 5.16668 3.66667 7.00001C3.66667 8.79168 5.08333 10.3125 7 10.3125C8.89587 10.3125 10.3333 8.81254 10.3333 7.00001C10.3333 5.16668 8.83333 3.66668 7 3.66668Z",fill:"currentColor",fillRule:"evenodd"}),kF("path",{clipRule:"evenodd",d:"M5.66667 7.00001C5.66667 6.27081 6.2708 5.66668 7 5.66668C7.7292 5.66668 8.33333 6.27081 8.33333 7.00001C8.33333 7.72921 7.7292 8.33334 7 8.33334C6.2708 8.33334 5.66667 7.72921 5.66667 7.00001Z",fill:"currentColor",fillRule:"evenodd",part:"circle"})]})};var kR=ec((function({stopSequence:e,...t}){let{destination:r}=e||{};return kF("span",{...t,children:r})}));var UR=ec((function({stopSequence:e,...t}){let{longName:r,routeIdentifier:i}=e||{},n=r;if(i){let e=i;i.includes(".")?[e]=i.split("."):i.includes("_")?[e]=i.split("_"):i.includes(":")&&([e]=i.split(":")),/^\d*$/.test(e)&&(e=`${parseInt(e,10)}`),r.includes(e)||(n=`${r} (${e})`)}return kF("span",{...t,children:n})}));var RR=ec((function({stopSequence:e,...t}){return kF("div",{...t,children:[kF(kR,{className:"font-bold",stopSequence:e}),kF(UR,{className:"text-sm",stopSequence:e})]})}));var DR=ec((function(){let{isFollowing:e,setIsFollowing:t,stopSequence:r}=hT();return kF("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4",children:[kF(bR,{stopSequence:r}),kF(RR,{className:"flex grow flex-col",stopSequence:r}),kF(gP,{className:""+(e?"animate-pulse":""),onClick:()=>{t(!e)},selected:e,children:kF(MR,{})})]})})),NR=()=>Mu((()=>{let e=new URLSearchParams(window.location.search).get("debug");return!(!e||"false"===e)&&e}),[]),OR=eu({index:null,invertColor:null,station:null,status:null,stop:null}),QR=()=>{let e=Uu(OR);if(!e)throw new Error("useRouteStop must be used within a ContextProvider");return e};var zR=function(e){let{status:t,stop:r}=QR();return NR()?kF("div",{className:"p-4 text-left text-xs",...e,children:[kF("div",{children:["State: ",kF("b",{children:r.state})," (isPassed: ",`${t.isPassed}`,") (cancelled: ",`${r.cancelled}`,")"]}),kF("div",{children:["Arrival time: ",r.arrivalTime," (delay: ",kF("b",{children:`${r.arrivalDelay}`}),") (aimed: ",r.aimedArrivalTime,")"]}),kF("div",{children:["Departure time: ",r.arrivalTime," (delay:"," ",kF("b",{children:`${r.departureDelay}`}),") (aimed: ",r.aimedArrivalTime,")"]}),kF("div",{children:Object.entries(t).map((([e,t])=>!1===t?null:kF("div",{children:[e,": ",`${t}`]},e)))})]}):null},HR=e=>{let t=Math.round(e/1e3/60);return t>=10?"#dc2626":t>=5?"#ea580c":t>=3?"#ca8a04":"#16a34a"},jR=e=>{let t=e;t<0&&(t=0);let r=Math.floor(t/36e5),i=Math.round(t%36e5/6e4),n="";return r>0&&(n+=`${r}h`),i>0&&(n+=`${i}m`),n||"0"};var VR=ec((function(e){let{status:t,stop:r}=QR(),{arrivalDelay:i,departureDelay:n}=r,a=t.isNotRealtime||t.isCancelled||t.isNotStop||t.isPassed;return kF("div",{...e,children:[a||null===i||t.isFirst?null:kF("span",{style:{color:HR(i)},children:`+${jR(i)}`}),a||null===n||t.isLast?null:kF("span",{style:{color:HR(i)},children:`+${jR(n)}`})]})}));var GR=ec((function({svgProps:e,...t}){let{stopSequence:r}=hT(),{invertColor:i,status:n}=QR(),{isBoarding:a,isFirst:s,isLast:o,isLeft:l,isPassed:h,progress:A}=n,u=s?"50%":"-100%",c=o?"50%":"100%",d=`${A}%`,p="rgb(156, 163, 175)",f=mR(r),g=h?p:f,m=h?f:p,y=p;i&&(g=h?f:p,m=h?p:f,y=f);let _=h||!l&&!a?g:m;return kF("div",{...t,children:kF("svg",{fill:"none",height:"100%",stroke:g,width:"16",xmlns:"http://www.w3.org/2000/svg",...e,children:[kF("circle",{cx:"50%",cy:"50%",r:"5",stroke:"black",strokeWidth:"6"}),kF("line",{stroke:"black",strokeWidth:"6",x1:"50%",x2:"50%",y1:u,y2:c}),kF("line",{stroke:y,strokeWidth:"4",x1:"50%",x2:"50%",y1:u,y2:d}),kF("line",{strokeWidth:"4",x1:"50%",x2:"50%",y1:A-2+"%",y2:c}),kF("circle",{cx:"50%",cy:"50%",r:"5",strokeWidth:"4"}),kF("circle",{className:a?"animate-pulse":"",cx:"50%",cy:"50%",r:"5",stroke:_,strokeWidth:"4"}),kF("circle",{cx:"50%",cy:"50%",fill:"white",r:"3",stroke:"black",strokeWidth:"1"})]})})}));var KR=ec((function({...e}){let{stop:t}=QR(),{stopSequence:r}=hT(),{type:i}=r,{t:n}=yP(),{platform:a}=t||{};return a?kF("span",{...e,children:[n(`platform_${i||"rail"}`)||n("platform_rail")," ",a]}):null}));var qR=ec((function({children:e,...t}){let{stop:r}=QR(),{stationName:i}=r||{};return kF("div",{...t,children:[i,kF("br",{}),kF(KR,{className:"rounded-sm bg-slate-100 px-0.5 py-px text-xs group-hover:bg-slate-50"}),e]})}));var ZR=function({...e}){return kF("svg",{fill:"currentColor",height:"24",version:"1.1",viewBox:"0 0 14 14",width:"24",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"m 14,8 0,1 -6,-1 0,3 2,2 0,1 L 7,13 4,14 4,13 6,11 6,8 0,9 0,8 6,5 6,2 C 6,1 6.22222,0 7,0 7.77777,0 8,1 8,2 l 0,3 z"})})};var WR=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 -3.84 122.88 122.88",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"M29.03,100.46l20.79-25.21l9.51,12.13L41,110.69C33.98,119.61,20.99,110.21,29.03,100.46L29.03,100.46z M53.31,43.05 c1.98-6.46,1.07-11.98-6.37-20.18L28.76,1c-2.58-3.03-8.66,1.42-6.12,5.09L37.18,24c2.75,3.34-2.36,7.76-5.2,4.32L16.94,9.8 c-2.8-3.21-8.59,1.03-5.66,4.7c4.24,5.1,10.8,13.43,15.04,18.53c2.94,2.99-1.53,7.42-4.43,3.69L6.96,18.32 c-2.19-2.38-5.77-0.9-6.72,1.88c-1.02,2.97,1.49,5.14,3.2,7.34L20.1,49.06c5.17,5.99,10.95,9.54,17.67,7.53 c1.03-0.31,2.29-0.94,3.64-1.77l44.76,57.78c2.41,3.11,7.06,3.44,10.08,0.93l0.69-0.57c3.4-2.83,3.95-8,1.04-11.34L50.58,47.16 C51.96,45.62,52.97,44.16,53.31,43.05L53.31,43.05z M65.98,55.65l7.37-8.94C63.87,23.21,99-8.11,116.03,6.29 C136.72,23.8,105.97,66,84.36,55.57l-8.73,11.09L65.98,55.65L65.98,55.65z"})})};var $R=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 512 512",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:[kF("g",{children:kF("g",{children:kF("path",{d:"M256,0c-9.217,0-16.696,7.473-16.696,16.696v478.609c0,9.223,7.479,16.696,16.696,16.696\n       c9.217,0,16.696-7.473,16.696-16.696V16.696C272.696,7.473,265.217,0,256,0z"})})}),kF("g",{children:kF("g",{children:kF("path",{d:"M105.739,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783\n       s66.783-29.956,66.783-66.783C172.522,74.478,142.565,44.522,105.739,44.522z"})})}),kF("g",{children:kF("g",{children:kF("path",{d:"M406.261,44.522c-36.826,0-66.783,29.956-66.783,66.783c0,36.826,29.956,66.783,66.783,66.783\n       s66.783-29.956,66.783-66.783C473.043,74.478,443.087,44.522,406.261,44.522z"})})}),kF("g",{children:kF("g",{children:kF("path",{d:"M202.935,218.664c-3.109-4.501-8.239-7.186-13.717-7.186H22.261c-5.478,0-10.608,2.685-13.717,7.185\n       c-3.12,4.5-3.837,10.244-1.913,15.374l49.022,130.729v63.755c0,27.619,22.468,50.087,50.087,50.087s50.087-22.468,50.087-50.087\n       v-63.755l49.022-130.728C206.772,228.909,206.054,223.163,202.935,218.664z"})})}),kF("g",{children:kF("g",{children:kF("path",{d:"M505.37,355.875l-50.087-133.565c-2.445-6.516-8.674-10.831-15.63-10.831H372.87c-6.957,0-13.185,4.315-15.63,10.831\n       l-50.087,133.565c-1.924,5.13-1.207,10.876,1.913,15.374c3.109,4.501,8.239,7.186,13.717,7.186h33.391v50.087\n       c0,27.619,22.468,50.087,50.087,50.087s50.087-22.468,50.087-50.087v-50.087h33.391c5.478,0,10.608-2.685,13.717-7.185\n       C506.576,366.75,507.293,361.006,505.37,355.875z"})})})]})};var XR=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 14 14",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"m 0,0 0,10 2.000077,0 0,-3.5 2.500097,0 c 1.976154,3e-7 3.500135,-1 3.500135,-3.25 C 8.000309,1 6.4871,2e-7 4.968942,0 z m 2.000077,2 2.500097,0 c 0.963608,0 1.500058,0.5254308 1.500058,1.25 0,0.7245692 -0.631804,1.25 -1.500058,1.25 l -2.500097,0 z M 9,7 9,7.5938559 9.500367,8 l 0,0.75 -3.000116,0 0,-0.25 0.50002,0 c 0.479412,0 0.455442,-0.5 0,-0.5 L 5.500213,8 c -0.50002,0 -0.50002,0.452061 0,0.5 l 0.500019,0 0,0.25 -0.562522,1.28125 C 5.296384,10.001436 5.147956,10 5.000193,10 c -1.02182,0 -2.000077,0.793929 -2.000077,2 0,1.206071 0.978257,2 2.000077,2 1.02182,0 1.937575,-0.856429 1.937575,-2.0625 0,-0.150759 -0.0039,-0.302075 -0.03125,-0.4375 l 0.843783,0 1.821945,-2 0.365639,0.78125 C 9.383285,10.615837 9.000348,11.229684 9.000348,12 c 0,1.206071 0.978257,2 2.000077,2 C 12.022246,14 12.938,13.143571 12.938,11.9375 12.938,10.731429 12.022246,10 11.000425,10 c -0.15008,0 -0.292278,0.02946 -0.437517,0.0625 L 10.000386,8.75 10,7.8 z m -2.593502,2.5 2.193834,0 -1.193796,1.25 -0.843782,0 C 6.422636,10.56342 6.258266,10.401358 6.062734,10.28125 z M 5.000193,11 c 0.635098,0 1.000039,0.549217 1.000039,1 0,0.450783 -0.364941,1 -1.000039,1 -0.635098,0 -1.000038,-0.549217 -1.000038,-1 0,-0.450783 0.36494,-1 1.000038,-1 z m 6.000232,0 c 0.635099,0 1.000039,0.549217 1.000039,1 0,0.450783 -0.36494,1 -1.000039,1 -0.635098,0 -1.000039,-0.549217 -1.000039,-1 0,-0.450783 0.364941,-1 1.000039,-1 z"})})};var YR=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",viewBox:"0 0 24 24",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"M2 22h15V2H2zm14-1h-6V3h6zM3 3h6v18H3zm15.625 10h3.75L20.5 16zm3.75-2h-3.75L20.5 8z"})})};var JR=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",version:"1.1",viewBox:"0 0 15 15",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"M5.5,1L6,2h5l0.5-1H5.5z M6,2.5v1.25c0,0,0,2.75,2.5,2.75S11,3.75,11,3.75V2.5H6z M1.9844,3.9863\n\tC1.4329,3.9949,0.9924,4.4485,1,5v4c-0.0001,0.6398,0.5922,1.1152,1.2168,0.9766L5,9.3574V14l5.8789-6.9297\n\tC10.7391,7.0294,10.5947,7,10.4414,7H6.5L3,7.7539V5C3.0077,4.4362,2.5481,3.9775,1.9844,3.9863z M11.748,7.7109L6.4121,14H12\n\tV8.5586C12,8.2451,11.9061,7.9548,11.748,7.7109z",id:"rect4718"})})};var eD=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",viewBox:"0 0 15 15",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"M13.5,13h-3V9h3a.5.5,0,0,0,.4092-.7871L11.66,5h.84a.5.5,0,0,0,.3838-.82l-2.5-3a.5155.5155,0,0,0-.7676,0l-2.5,3A.5.5,0,0,0,7.5,5h.84L6.0908,8.2129A.5.5,0,0,0,6.5,9h3v4H4V11H5.5a.5.5,0,0,0,0-1h-4a.5.5,0,0,0,0,1H3v2H1.5a.5.5,0,0,0,0,1h12a.5.5,0,0,0,0-1Z"})})};var tD=function({...e}){return kF("svg",{fill:"currentColor",height:"24px",viewBox:"0 0 24 24",width:"24px",xmlns:"http://www.w3.org/2000/svg",...e,children:kF("path",{d:"M12,6.5a2,2,0,1,0-2-2A2,2,0,0,0,12,6.5Zm7.5,14h-1v-5a1,1,0,0,0-1-1h-5v-2h5a1,1,0,0,0,0-2h-5v-2a1,1,0,0,0-2,0v7a1,1,0,0,0,1,1h5v5a1,1,0,0,0,1,1h2a1,1,0,0,0,0-2Zm-6.8-1.6a4,4,0,0,1-7.2-2.4,4,4,0,0,1,2.4-3.66A1,1,0,1,0,7.1,11a6,6,0,1,0,7.2,9.1,1,1,0,0,0-1.6-1.2Z"})})};var rD=ec((function({accessibility:e=!1,airport:t=!1,barAndRestaurants:r=!1,bathroom:i=!1,bikeStorage:n=!1,elevator:a=!1,iconProps:s={},police:o=!1,station:l,waitingAreas:h=!1,...A}){if(!l)return null;let{hasAccessibility:u,hasAirport:c,hasBarAndRestaurants:d,hasBathroom:p,hasBikeStorage:f,hasElevator:g,hasPolice:m,hasWaitingAreas:y}=l.properties;return kF("div",{...A,children:[e&&u&&kF(tD,{...s}),t&&c&&kF(ZR,{...s}),r&&d&&kF(WR,{...s}),i&&p&&kF($R,{...s}),n&&f&&kF(XR,{...s}),a&&g&&kF(YR,{...s}),o&&m&&kF(JR,{...s}),h&&y&&kF(eD,{...s})]})}));var iD=ec((function(e){let{station:t}=QR();return t?kF(rD,{accessibility:!0,station:t,...e,iconProps:{width:20}}):null}));var nD=ec((function({children:e,className:t="flex items-center gap-2",classNameCancelled:r="text-red-600 line-through",...i}){let{status:n}=QR();return kF("div",{...i,className:LF(t,n.isCancelled?r:""),children:[kF(qR,{}),kF(iD,{className:"flex flex-wrap gap-1"}),e]})})),aD=e=>e<10?`0${e}`:e,sD=e=>{if(!e||e<=0)return"";let t=new Date(e);return`${aD(t.getHours())}:${aD(t.getMinutes())}`};var oD=ec((function(e){let{status:t,stop:r}=QR(),{isCancelled:i,isFirst:n,isLast:a}=t,{aimedArrivalTime:s,aimedDepartureTime:o}=r;return kF("div",{...e,children:[kF("span",{className:`${i?"text-red-600 line-through":""} ${n?"hidden":""}`,children:sD(s)}),kF("span",{className:`${t.isCancelled?"text-red-600 line-through":""} ${a?"hidden":""}`,children:sD(o)})]})})),lD=(e,t,r,i)=>{let n=e.arrivalTime,a=e.arrivalTime;r&&(n=e.arrivalTime-(e.arrivalTime-r.arrivalTime)/2),i&&(a=e.arrivalTime+(i.arrivalTime-e.arrivalTime)/2);let s=!e.arrivalTime&&!e.departureTime,o=null===e.arrivalDelay&&null===e.departureDelay,l="TIME_BASED"===e.state||o,h="JOURNEY_CANCELLED"===e.state||"STOP_CANCELLED"===e.state,A=t>a;return{bottomBoundary:a,isBoarding:"BOARDING"===e.state,isCancelled:h,isLeft:"LEAVING"===e.state||l&&A||h&&A,isNotRealtime:l,isNotStop:s,isPassedBottom:A,topBoundary:n}},hD=(e,t)=>{let{stations:r}=e,i=0,n=r[t-1],a=r[t],s=r[t+1];if(!a)return{};let o=Date.now(),l=n&&lD(n,o,r[t-2],a),h=lD(a,o,n,s),{isLeft:A}=h,{bottomBoundary:u,isBoarding:c,isCancelled:d,isNotRealtime:p,isNotStop:f,isPassedBottom:g,topBoundary:m}=h,y=!A&&(!n||l.isLeft),_=!(A||n&&l.isLeft),v=!1;if(y){let e=.2*(u-m);v=o>a.arrivalTime-e}let w=g&&!y&&!_;m<o&&o<u&&!_&&(i=Math.round(100*(o-m)/(u-m))),g&&(y||_)&&(i=0);let b=0===t;return b&&(i=50),(c||!b&&(A&&i<50||!A&&i>50))&&(i=50),i>50&&hD(e,t+1).progress>0&&(i=100,A=!0,w=!0),w&&(i=100),{isBoarding:c,isCancelled:d,isCloseToNextStop:v,isFirst:!n,isInBetween:!w&&i>0,isLast:!s,isLeft:A,isNextStop:y,isNotRealtime:p,isNotStop:f,isPassed:w,progress:i}},AD=hD;var uD=ec((function({children:e,classNameGreyOut:t="text-gray-600",index:r,invertColor:i=!1,stop:n,...a}){let{map:s,realtimeLayer:o,stopSequence:l}=hT(),{stopUID:h}=n,[A,u]=Eu(),[c,d]=Eu(AD(l,r));Tu((()=>{let e=null;return d(AD(l,r)),c.isInBetween&&(e=setInterval((()=>{d(AD(l,r))}),1e3)),()=>{clearInterval(e)}}),[r,c.isInBetween,l]),Tu((()=>{if(h&&o?.api)return o?.api?.subscribe(`station ${h}`,(({content:e})=>{e&&u(e)})),()=>{u(null),h&&o?.api?.unsubscribe(`station ${h}`)}}),[h,o?.api]);let p=Mu((()=>({index:r,invertColor:i,station:A,status:c,stop:n})),[n,c,r,i,A]),f=c.isPassed||c.isLeft?t:"";return i&&(f=c.isPassed||c.isLeft||c.isBoarding?"":t),kF(OR.Provider,{value:p,children:[kF("button",{className:`flex max-h-[58px] w-full scroll-mt-[50px] items-stretch rounded text-left hover:bg-slate-100 ${f}`,"data-station-passed":c.isPassed,onClick:()=>{n.coordinate&&s.getView().animate({center:[n.coordinate[0],n.coordinate[1]],zoom:s.getView().getZoom()})},type:"button",...a,children:e||kF(PA,{children:[kF(oD,{className:"ml-4 flex w-10 shrink-0 flex-col justify-center text-xs"}),kF(VR,{className:"flex w-8 shrink-0 flex-col justify-center text-[0.6rem]"}),kF(GR,{className:"relative flex w-8 shrink-0 items-center"}),kF(nD,{className:"flex grow flex-col items-start justify-center pr-2 text-sm font-medium"})]})}),kF(zR,{})]})}));var cD=ec((function(e){let{stopSequence:t}=hT(),r=Pu();if(Tu((()=>{let e=window.setInterval((()=>{let t=r.current;if(!t)return;let i=t.querySelector("[data-station-passed=false]");i&&i.parentNode.parentNode.scrollTo({behavior:"smooth",top:i.offsetTop||0}),clearInterval(e)}),300);return()=>{clearTimeout(e)}}),[t]),!t)return null;let{className:i}=e;return kF(PA,{children:[kF(DR,{}),kF(xR,{children:kF("div",{className:LF("text-base",i),ref:r,children:[t.stations.map(((e,t)=>{let{arrivalTime:r,departureTime:i,stationId:n,stationName:a}=e;return kF(uD,{index:t,stop:e},(`${n}`||a)+r+i)})),kF(LR,{})]})})]})})),dD=eu({departure:null,index:null}),pD=()=>{let e=Uu(dD);if(!e)throw new Error("useDeparture must be used within a ContextProvider");return e},fD=e=>`0${e}`.slice(-2),gD=(e,t=!1)=>{let r=new Date(e);return!e||Number.isNaN(r)?"unknown":[fD(r.getHours()),fD(r.getMinutes()),t?null:fD(r.getSeconds())].filter((e=>e)).join(":")};var mD=function(e){let t=NR(),{departure:r}=pD();if(!t)return null;let{arrivalTime:i,at_station_ds100:n,departureTime:a,fzo_estimated_time:s,has_fzo:o,last_boarding_time:l,min_arrival_time:h,ris_aimed_time:A,ris_estimated_time:u,state:c,station:d,stations_in_between:p,time:f,train_number:g}=r,m=new Date(A),y=Number.isNaN(m)?"":[m.getFullYear(),fD(m.getMonth()+1),fD(m.getDate())].join("-");return kF("div",{className:"border-b p-4 text-left text-xs",...e,children:["Zugnummer:",kF("a",{href:["https://ris-info.bahn.de/rishttp/risinfo.xml?",`action=zuglauf&evanr=${d?.get("uic")}&`,`zugnummer=${g}&`,`ankunft=${y}T${gD(m,!0)}`].join(""),rel:"noopener noreferrer",target:"_blank",children:g}),kF("div",{children:["  State: ",kF("b",{children:c}),kF("br",{}),`Has fzo: ${o};`,kF("br",{}),`Has realtime: ${r.has_realtime_journey};`,kF("br",{}),`Time: ${gD(f)};`,kF("br",{}),`Arrival time: ${gD(i)};`,kF("br",{}),`Departure time: ${gD(a)};`,kF("br",{}),`FzO-Estimated: ${gD(s)};`,kF("br",{}),`RIS-Aimed: ${gD(A)};`,kF("br",{}),`RIS-Estimated: ${gD(u)};`,kF("br",{}),`Ref-Location: ${n};`,kF("br",{}),`Normalized Distance: ${gD(h)};`,kF("br",{}),`Last Boarding: ${gD(l)};`,kF("br",{}),`Stationen until arrival: ${p};`]})]})};var yD=ec((function({departure:e,index:t,...r}){let{setStationId:i,setTrainId:n}=hT(),a=Mu((()=>({departure:e,index:t})),[e,t]);return kF(dD.Provider,{value:a,children:[kF("button",{className:"w-full border-b",onClick:()=>{n(e.train_id),i()},...r,children:kF("div",{className:"gap-4 py-4",style:{alignItems:"center",display:"flex",overflow:"hidden"},children:[kF("div",{className:"pl-4",children:kF(bR,{departure:e})}),kF("div",{className:"grow text-left",children:[...new Set(e.to)].join("/")}),kF("div",{className:"pr-4",children:sD(e.time)})]})}),kF(mD,{})]})}));var _D=ec((function({children:e,station:t,...r}){let{name:i}=t?.properties||{};return kF("div",{...r,children:[i,e]})}));var vD=ec((function(){let{station:e}=hT();return kF("div",{className:"flex items-center gap-x-4 bg-slate-100 p-4",children:kF("div",{className:"flex grow flex-col",children:[kF("span",{className:"font-bold",children:kF(_D,{station:e})}),kF(rD,{accessibility:!0,airport:!0,barAndRestaurants:!0,bathroom:!0,bikeStorage:!0,className:"flex gap-2",elevator:!0,police:!0,station:e,waitingAreas:!0})]})})}));var wD=ec((function(e){let{realtimeLayer:t,station:r}=hT(),[i,n]=Eu(),a=Pu(),{className:s}=e;return Tu((()=>{if(!r||!t?.api)return;let e=rd((e=>(n(e),null)),!1,180);return t.api.subscribeDepartures(r?.properties?.uid,e),()=>{n(null),t?.api?.unsubscribeDepartures(r?.properties.uid)}}),[r,t?.api]),r?kF(PA,{children:[kF(vD,{}),kF("div",{className:LF("flex flex-col p-2",s),ref:a,...e,children:(i||[]).map(((e,t)=>kF(yD,{departure:e,index:t},e.call_id)))})]}):null}));var bD=ec((function({feature:e,featuresInfo:t,layer:r}){let{linesNetworkPlanLayer:i,notificationsLayer:n,realtimeLayer:a,stationId:s,stationsLayer:o,tenant:l,trainId:h}=hT();return e?kF(PA,{children:[e&&!!a&&r===a&&h&&kF(cD,{}),e&&!!o&&r===o&&l&&s&&kF(wD,{}),e&&!!i&&r===i&&t?.features?.length&&kF(ER,{className:"",features:t?.features||[]}),e&&!!n&&r===n&&kF(FR,{className:"",feature:e})]}):null}));var xD=function(e){return kF(aP,{size:24,...e})};var BD=function(e){let t=cR()[e]||{};return t.title||(t.title=e),t};var CD=ec((function({className:e,feature:t,layer:r,...i}){let n=BD(r?.get("name"));if(!n?.link||!1===n?.link?.show)return null;let a=t?.get("id"),s=t?.get("situation");return s&&(a=JSON.parse(s)?.id||a),kF("div",{...i,className:LF("flex flex-row p-4",e),children:kF(IP,{href:n.link.href.replace("{{id}}",a),target:"_blank",theme:"primary",children:[kF("span",{children:n.link.text||"Mehr erfahren"}),kF(xD,{})]})})}));var SD=function(e){return kF(oP,{size:24,...e})};var ED=ec((function({children:e,className:t,onClose:r,title:i,...n}){return kF("div",{...n,className:LF("flex flex-row items-center justify-between gap-2 border-b p-2 pl-4",t),children:[e||kF("span",{className:"text-base font-bold",children:i}),r&&kF(gP,{className:"!size-[32px] border-none shadow-none",onClick:r,children:kF(SD,{})})]})}));var ID=ec((function({feature:e,layer:t,...r}){let{t:i}=yP(),n=BD(t?.get("name"));return kF(ED,{title:i(n?.title||""),...r})}));var TD=ec((function(){let{featuresInfos:e,realtimeLayer:t,selectedFeature:r,setSelectedFeature:i,setStationId:n,setTrainId:a,stationId:s,stationsLayer:o,trainId:l}=hT(),h=Mu((()=>e?.find((e=>e?.features.includes(r)))),[e,r]),A=Mu((()=>h?.layer?h.layer:l?t:s?o:void 0),[h?.layer,t,s,o,l]);return kF(PA,{children:[kF(ID,{feature:r,layer:A,onClose:()=>{i(null),a(null),n(null)}}),kF(bD,{feature:r,featuresInfo:h,layer:A}),kF(CD,{feature:r,layer:A})]})})),FD=h(A(),1);var PD=function(e){return kF(lP,{size:24,...e})};var LD=function({className:e,...t}){return kF("input",{...t,className:LF("p-2 text-sm read-only:text-gray-400",e)})},MD=e=>e?.properties?.name||"";var kD=ec((function({apikey:e,bbox:t,cancelButtonClassName:r,className:i,countrycode:n,event:a,field:s,inputClassName:o,inputContainerClassName:l,limit:h,mots:A,onselect:u,params:c,prefagencies:d,reflocation:p,resultClassName:f,resultsClassName:g,resultsContainerClassName:m,searchIconContainerClassName:y,url:_="https://api.geops.io/stops/v1/",withResultsClassName:v}){let{t:w}=yP(),[b,x]=Eu(""),[B,C]=Eu(),[S,E]=Eu(),I=Pu();Tu((()=>{I.current?.dispatchEvent(new BT("mwc:attribute",{apikey:e,bbox:t,countrycode:n,event:a,field:s,limit:h,mots:A,onselect:u,params:c,prefagencies:d,reflocation:p,url:_}))}),[e,t,n,a,s,h,A,u,c,d,p,_]);let T=Mu((()=>new Gc({apiKey:e,url:_})),[e,_]),F=ku((e=>{let t=new BT(a||"mwc:stopssearchselect",e,{bubbles:!0});I.current?.dispatchEvent(t),u&&"function"==typeof u&&u(e)}),[a,u]),P=Mu((()=>{let e;return(0,FD.default)((r=>{e?.abort(),e=new AbortController;let i={bbox:t,field:s,limit:h,mots:A,prefagencies:d,q:r,ref_location:p,...JSON.parse(c||"{}")};T.search(i,{signal:e.signal}).then((e=>{E(e.features.filter((e=>!n||e.properties?.country_code===n)))})).catch((e=>{20===e.code||console.error("Failed to fetch stations",e)}))}),150)}),[T,t,n,s,h,A,c,d,p]);return Tu((()=>{if(!B||b!==MD(B))return b?(P(b),()=>{P.cancel()}):void C(void 0)}),[b,B,P]),Tu((()=>{E(void 0),B&&x(MD(B)),F(B)}),[F,B]),kF(PA,{children:[kF("div",{className:LF("flex h-16 items-center gap-4 rounded-md bg-white p-4 pt-3.5 shadow",i,S?v:""),ref:I,children:[kF("div",{className:LF("text-grey flex items-center",y),children:kF(PD,{className:"size-4"})}),kF("div",{className:LF("@container/inputsearch flex grow items-center border-b-2 border-solid",l),children:[kF(LD,{autoComplete:"off",className:LF("h-8 w-1 grow overflow-hidden text-ellipsis placeholder:text-zinc-400",o),onChange:e=>{x(e.target.value)},onKeyUp:e=>{"Enter"===e.key&&S?.length>0&&C(S[0])},placeholder:w("stops_search_placeholder"),type:"text",value:b||""}),b.length>0&&kF(gP,{className:LF("flex !size-[32px] items-center rounded-none border-none bg-transparent shadow-none",r),onClick:()=>{x(""),E(void 0)},children:kF(SD,{})})]})]}),S&&kF("div",{className:LF("flex grow overflow-auto rounded-md rounded-t-none bg-white shadow",m),children:[S&&0===S.length&&kF("div",{className:LF("flex grow gap-3 border border-solid p-3 pt-2 text-zinc-400",g),style:{border:1},children:[kF("div",{className:"size-6"}),kF("div",{children:w("no_stops_found")})]}),S&&S.length>0&&kF("ul",{className:LF("grow rounded-md rounded-t-none border border-solid bg-white p-0",g),style:{border:1},children:S?.map((e=>kF("li",{className:LF("border-b border-dashed border-slate-300 p-3 last:border-0",f),children:kF("button",{className:"flex w-full items-center gap-3 text-left",onClick:()=>{C(e)},children:[kF("div",{className:"size-6"}),kF("div",{className:"grow",children:e.properties.name})]})},e.properties.uid)))})]})]})})),UD=(e,t)=>{let r=e?.geometry?.coordinates;r&&t?.getView()?.animate({center:zf(r),duration:500,zoom:16})};var RD=ec((function(e){let{apikey:t,map:r,stopsurl:i}=hT(),n=ku((e=>UD(e,r)),[r]);return kF(kD,{apikey:t,onselect:n,url:i,...e})})),DD=h(wA()),ND=DD.default.shape({circled:DD.default.bool,height:DD.default.number,rotation:DD.default.oneOfType([DD.default.number,DD.default.func]),src:DD.default.string,width:DD.default.number}),OD=typeof CanvasPattern>"u"?Function:CanvasPattern,QD={autoDownload:DD.default.bool,children:DD.default.node,coordinates:DD.default.arrayOf(DD.default.arrayOf(DD.default.number)),extent:DD.default.arrayOf(DD.default.number),extraData:DD.default.shape({copyright:DD.default.shape({background:DD.default.bool,fillStyle:DD.default.oneOfType([DD.default.string,DD.default.instanceOf(OD)]),font:DD.default.string,maxWidth:DD.default.number,paddingBackground:DD.default.number,paddingBottom:DD.default.number,text:DD.default.oneOfType([DD.default.string,DD.default.func])}),logo:ND,northArrow:ND,qrCode:ND}),format:DD.default.oneOf(["image/jpeg","image/png"]),getDownloadImageName:DD.default.func,map:DD.default.instanceOf(bC),margin:DD.default.number,onSaveEnd:DD.default.func,onSaveStart:DD.default.func,padding:DD.default.number,scale:DD.default.number},zD=e=>{let t="image/jpeg"===e?"jpg":"png";return`${window.document.title.replace(/ /g,"_").toLowerCase()}.${t}`},HD=!1,jD=0,VD=(e,t,r,i,n,a,s)=>{let{background:o,fillStyle:l,font:h,text:A}=i.copyright,{paddingBackground:u=2,paddingBottom:c=s}=i.copyright,d="function"==typeof A?A():A?.trim();Array.isArray(d)&&(d=d.join()),e.save(),e.scale(n,n),e.font=h||"12px Arial",e.font=((e,t,r,i)=>{let n,a;do{n=e.font.match(/[0-9]+(?:\.[0-9]+)?(px)/i),a=parseInt(n[0].replace(n[1],""),10),e.font=e.font.replace(a,a-1),HD=!1,a-1==8&&(HD=!0)}while(a-1>8&&e.measureText(r).width*i>t);return e.font})(e,r,d,n),e.textBaseline="bottom",e.scale(n,n),e.fillStyle=l||"black";let p=d,f=e.measureText(p);if(HD){let t=d.split(" ").length;for(let i=0;i<t&&!(f.width*n<r);i+=1)p=p.substring(0,p.lastIndexOf(" ")),f=e.measureText(p)}let g=[p,d.replace(p,"").trim()].filter((e=>!!e)).reverse(),m=a,y=t.height-c;g.forEach((t=>{let{fontBoundingBoxAscent:r,fontBoundingBoxDescent:i,width:n}=e.measureText(t),s=r+i,l=y-s;if(o){l-=2*u,((e,t,r,i,n,a={})=>{e.save(),e.fillStyle="rgba(255,255,255,.8)","object"==typeof a&&Object.entries(a).forEach((([t,r])=>{e[t]=r})),e.fillRect(t,r,i,n),e.restore()})(e,a,l,n+2*u,s+2*u,o),m+=u,y-=u}e.fillText(t,m,y),y=l})),jD=y,e.restore()},GD=(e,t,r,i,n,a=[0,0],s="right")=>{let o=t.getContext("2d"),{height:l,rotation:h,src:A,width:u}=e;return new Promise((e=>{let c=new Image;c.crossOrigin="Anonymous",c.src=A,c.onload=()=>{o.save();let A=(u||80)*r,d=(l||80)*r,p="left"===s?i+A/2:t.width-i-A/2,f=("left"===s&&jD?jD-n:t.height)-i-d/2-a[1];if(o.translate(p,f),h){let e="function"==typeof h?h():h;o.rotate(e*(Math.PI/180))}o.drawImage(c,-A/2,-d/2,A,d),o.restore(),e([A+2*n,d+2*n])},c.onerror=()=>{e()}}))},KD=(e,t,r)=>{let i,n;if(t?(i=kd(t),n=Td(t)):r&&([i,,n]=r),i&&n){let t=e.getPixelFromCoordinate(i),r=e.getPixelFromCoordinate(n),a=[t[0]<=r[0]?t[0]:r[0],t[1]<=r[1]?t[1]:r[1]],s=[t[0]>r[0]?t[0]:r[0],t[1]>r[1]?t[1]:r[1]];return{h:s[1]-a[1],w:s[0]-a[0],x:a[0],y:a[1]}}return null};function qD({autoDownload:e=!0,children:t=null,coordinates:r=null,extent:i=null,extraData:n=null,format:a="image/png",getDownloadImageName:s=zD,map:o=null,margin:l=null,onSaveEnd:h=()=>{},onSaveStart:A=e=>Promise.resolve(e),padding:u=5,scale:c=1}){let d=ku((t=>{window.navigator.msSaveBlob&&(t.preventDefault(),t.stopPropagation()),HD=!1,jD=0,A(o).then((t=>((e,t,r,i,n,a,s)=>new Promise((o=>{e.once("rendercomplete",(()=>{let l,h,A=e.getTargetElement().getElementsByTagName("canvas");for(let t=0;t<A.length;t+=1){let r=A[t];if(!r.width||!r.height)continue;let a=KD(e,i,n)||{h:r.height,w:r.width,x:0,y:0};l||(l=document.createElement("canvas"),l.width=a.w,l.height=a.h,h=l.getContext("2d")),h.drawImage(r,a.x,a.y,a.w,a.h,0,0,l.width,l.height)}a=a||(e=>e.width/100)(l);let u=Promise.resolve();h&&t&&t.logo&&(u=GD(t.logo,l,r,a,s)),u.then(((e=[0,0])=>{let i=Promise.resolve();h&&t&&t.northArrow&&(i=GD({src:t.northArrow.circled?'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192"><defs><clipPath id="a"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="b"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="c"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="d"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="e"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="f"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="g"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="h"><path d="M192 192H0V0h192v192z"/></clipPath><clipPath id="i"><path d="M36 12v24.125H15.875v152.25h160.25V36.125H156V12h-44v24.125H80V12z" fill="red" stroke-width="23.686"/></clipPath></defs><g fill="none"><circle cx="95.749" cy="96" r="76" clip-path="url(%23i)" stroke="%23000" stroke-width="6"/><path d="M81 8.125h30v27.751H81z"/><path d="M8.082 96h19.335M166.207 96h19.336M95.75 184.167v-19.335" stroke="%23000" stroke-width="6.04" stroke-linecap="round"/></g><g fill="red" stroke="%23000" stroke-linecap="round"><path d="M118 91.8v48.4M74 91.8v48.4" stroke-width="7.92"/><path d="M74 91.8l44 48.4" stroke-width="8.307"/></g><path d="M96 8.7L70.5 70.888l2.414 2.413L96 63.1l23.086 10.2 2.414-2.413z"/></svg>':'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 192 192"><defs><clipPath id="a"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="b"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="c"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="d"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="e"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="f"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="g"><path d="M0 192h192V0H0v192z"/></clipPath><clipPath id="h"><path d="M192 192H0V0h192v192z"/></clipPath><clipPath id="i"><path d="M36 12v24.125H15.875v152.25h160.25V36.125H156V12h-44v24.125H80V12z" fill="red" stroke-width="23.686"/></clipPath></defs><g fill="red" stroke="%23000" stroke-linecap="round"><path d="M118 91.8v48.4M74 91.8v48.4" stroke-width="7.92"/><path d="M74 91.8l44 48.4" stroke-width="8.307"/></g><path d="M96 8.7L70.5 70.888l2.414 2.413L96 63.1l23.086 10.2 2.414-2.413z"/></svg>',...t.northArrow},l,r,a,s,e)),i.then(((i=[0,0])=>{let n=Math.max(e[0],i[0]);if(h&&t&&t.copyright&&t.copyright.text){let e=t.copyright.maxWidth||(n?h.canvas.width-n-a:h.canvas.width);VD(h,l,e,t,r,a,s)}let A=Promise.resolve();h&&t&&t.qrCode&&(A=GD(t.qrCode,l,r,a,s,void 0,"left")),A.then((()=>o(l)))}))}))})),e.renderSync()})))(t||o,n,c,i,r,l,u).then((r=>{e?((e,t,r)=>new Promise((i=>{if(/msie (9|10)/gi.test(window.navigator.userAgent.toLowerCase())){let r=e.toDataURL(t);window.open("about:blank","").document.write(`<img src="${r}" alt="from canvas"/>`),i(r)}if(window.navigator.msSaveBlob){let n;try{n=e.msToBlob()}catch(e){console.log(e)}let a=new Blob([n],{type:t});i(a),window.navigator.msSaveBlob(a,r(t))}else e.toBlob((e=>{let n=document.createElement("a");n.download=r(t),n.href=URL.createObjectURL(e),document.body.appendChild(n),n.click(),i(e)}),t)})))(r,a,s).then((e=>{h(t,r,e)})):h(t,r)})).catch((e=>{e&&console.error(e),h(t,e)}))))}),[e,r,i,n,a,o,l,h,A,u,c,s]);return Lc.createElement(Lc.Fragment,null,Lc.Children.map(t,(e=>Lc.cloneElement(e,{onClick:d}))))}qD.propTypes=QD;var ZD=qD;var WD=function(e){return kF(eP,{size:24,...e})};var $D=function(e){return kF(AP,{size:24,...e})};var XD=function(e){return kF(rP,{size:24,...e})},YD={};var JD=function({containerProps:e=YD,tooltipProps:t=YD,...r}){let[i,n]=Eu(),[a,s]=Eu(!1),o=Du();return kF("div",{...e,className:LF("relative flex items-center",e?.className),children:[kF(LD,{id:o,onFocus:()=>{document.getElementById(o)?.select()},readOnly:!0,type:"text",...r,className:LF("h-full flex-1 border border-r-0",r?.className)}),kF(gP,{className:"h-full rounded-none border p-2 shadow-none",onClick:e=>{n(e.currentTarget.getBoundingClientRect()),navigator.clipboard.writeText(window?.location.href).then((()=>{s(!0),setTimeout((()=>{s(!1)}),1e3)})),document.getElementById(o)?.select()},children:kF(XD,{})}),kF("div",{...t,className:LF("fixed hidden rounded bg-gray-600 p-1 text-sm text-white",a&&"block",t?.className),style:{left:i?.left-30,top:i?.top-30},children:"Kopiert!"})]})},eN={};var tN=ec((function({inputProps:e=eN,...t}){let{t:r}=yP();return kF("div",{...t,children:[kF(JD,{value:window?.location.href,...e}),kF("p",{className:"py-2",children:r("permalink_input_hint")})]})}));var rN=function({className:e="",...t}){let{map:r}=hT(),{t:i}=yP();return kF("div",{className:LF(`flex flex-col gap-4 ${e}`),...t,children:[kF(IP,{className:"w-fit",href:`mailto:?subject=Karte&body=${window?.location.href}`,children:[kF(WD,{}),kF("span",{children:i("share_email_send")})]}),kF(ZD,{map:r,children:kF(IP,{className:"w-fit",children:[kF($D,{}),kF("span",{children:i("share_image_save")})]})}),kF(tN,{})]})};var iN=function({hasDetails:e,hasLayerTree:t,hasPrint:r,hasSearch:i,hasShare:n}){let{isExportMenuOpen:a,isLayerTreeOpen:s,isSearchOpen:o,isShareMenuOpen:l,selectedFeature:h,setIsExportMenuOpen:A,setIsLayerTreeOpen:u,setIsShareMenuOpen:c}=hT(),{t:d}=yP();return kF(PA,{children:[e&&h&&kF(TD,{}),r&&a&&kF(PA,{children:[kF(ED,{onClose:()=>{A(!1)},title:d("print_menu_title")}),kF(XU,{className:LF("relative h-full overflow-x-hidden overflow-y-auto text-base bg-white","flex flex-col gap-4 p-4")})]}),t&&s&&kF(PA,{children:[kF(ED,{onClose:()=>{u(!1)},title:d("layertree_menu_title")}),kF(pR,{className:"relative flex h-full flex-col overflow-x-hidden overflow-y-auto p-2 text-base *:not-last:border-b",treeItemProps:{childContainerClassName:"*:not-last:border-b"}})]}),n&&l&&kF(PA,{children:[kF(ED,{onClose:()=>{c(!1)},title:d("share_menu_title")}),kF(rN,{className:"h-full overflow-x-hidden overflow-y-auto p-4 text-base"})]}),i&&o&&kF(PA,{children:kF(RD,{className:"relative flex h-full flex-col overflow-x-hidden overflow-y-auto p-2 text-base"})})]})};var nN=function({options:e,...t}){let{map:r}=hT(),[i,n]=Eu(),a=Mu((()=>i?new OF({target:i,...e}):null),[e,i]);return Tu((()=>{if(r&&a)return r.addControl(a),()=>{r&&a&&r.removeControl(a)}}),[r,a]),kF("div",{ref:e=>{n(e)},...t,children:kF("style",{children:".ol-scale-line  {\n  position:relative;\n  left: unset;\n  bottom: unset;\n  background:unset;\n}"})})};var aN=ec((function({...e}){let{isSearchOpen:t,setIsSearchOpen:r}=hT(),{t:i}=yP(),n=ku((()=>{r(!t)}),[t,r]);return kF(gP,{title:i("search_menu_title"),...e,onClick:n,selected:t,children:kF(PD,{})})}));var sN=function(e){return kF(dP,{size:24,...e})};var oN=ec((function({...e}){let{isShareMenuOpen:t,setIsShareMenuOpen:r}=hT(),{t:i}=yP(),n=ku((()=>{r(!t)}),[t,r]);return kF(gP,{title:i("share_menu_title"),...e,onClick:n,selected:t,children:kF(sN,{})})}));var lN=function(e){return kF(iP,{size:24,...e})};var hN=function(e){return kF(tP,{size:24,...e})};var AN=ec((function(){let{map:e}=hT(),[t,r]=Eu(!1),[i,n]=Eu(!1),{t:a}=yP(),s=ku((()=>{if(!e?.getView())return;let t=e.getView(),r=t.getZoom();t.setZoom(r+1)}),[e]),o=ku((()=>{if(!e?.getView())return;let t=e.getView(),r=t.getZoom();t.setZoom(r-1)}),[e]);return Tu((()=>{let t=e?.on("moveend",(()=>{let t=e.getView(),i=t.getZoom(),a=t.getMaxZoom(),s=t.getMinZoom();a&&i===Number(a)?r(!0):r(!1),s&&i===Number(s)?n(!0):n(!1)}));return()=>{mp(t)}}),[e]),kF(PA,{children:[kF(gP,{disabled:t,onClick:s,title:a("zoomin"),children:kF(hN,{})}),kF(gP,{disabled:i,onClick:o,title:a("zoomout"),children:kF(lN,{})})]})})),uN={style:{width:"calc(100% - 60px)"}};var cN=ec((function({className:e,...t}){let{hasDetails:r,hasGeolocation:i,hasLayerTree:n,hasPrint:a,hasRealtime:s,hasSearch:o,hasShare:l,hasToolbar:h,isEmbed:A,isOverlayOpen:u,isSearchOpen:c}=hT();return kF("div",{className:LF("relative flex size-full flex-col @lg/main:flex-row-reverse",e),...t,children:[kF(BP,{className:"relative flex-1 overflow-visible",children:[A&&kF(zF,{}),kF("div",{className:"absolute inset-x-2 bottom-2 z-10 flex items-end justify-between gap-2 text-[10px]",children:[kF(nN,{className:"bg-slate-50/70"}),kF(UF,{className:"bg-slate-50/70"})]}),kF("div",{className:"absolute right-2 bottom-10 z-10 flex flex-col justify-between gap-2",children:kF(AN,{})}),i&&kF("div",{className:"absolute top-2 right-2 z-10 flex flex-col gap-2",children:kF(wP,{})}),!h&&o&&kF("div",{className:LF("absolute top-2 right-2 left-2 z-10 max-w-96",u&&"@lg:left-84"),children:kF(RD,{})})]}),kF("div",{className:"pointer-events-none absolute top-2 bottom-2 left-2 z-10 flex flex-col gap-2 *:pointer-events-auto",children:[h&&kF("div",{className:"relative z-10 w-fit rounded-2xl bg-black/10 p-0 backdrop-blur-sm",children:[kF("div",{className:LF("border-grey relative z-10 flex h-[48px] gap-[1px] overflow-hidden rounded-2xl border","*:size-[46px] *:rounded-none *:border-none","*:first:!rounded-l-2xl","*:last:!rounded-r-2xl",c?"@sm:rounded-r-none @sm:border-r-0 @sm:*:last:!rounded-r-none @sm:*:last:border-r-0":""),children:[a&&kF(_P,{}),l&&kF(oN,{}),n&&kF(xP,{}),o&&kF(aN,{})]}),o&&kF("div",{className:LF("absolute top-14 left-0 z-5 w-0 p-0 opacity-0 transition-all @sm:top-0 @sm:left-[calc(100%-47px)]",c?"w-64 opacity-100":""),children:kF(RD,{className:"border-grey @container m-0 h-[48px] gap-4 rounded-2xl border p-2 px-4 text-base @sm/main:rounded-l-none @sm/main:rounded-r-2xl",inputContainerClassName:"border-none",resultClassName:"text-base  **:hover:cursor-pointer p-2",resultsContainerClassName:"@container rounded-b-2xl max-h-[200px] overflow-y-auto border border-t-0 ",withResultsClassName:"text-base !rounded-b-none"})})]}),u&&kF("div",{className:LF("flex w-0 flex-1 flex-col overflow-hidden rounded-2xl @lg:min-w-80"),style:{containerType:"normal"},children:kF(SP,{className:"border-grey @container/overlay pointer-events-auto relative hidden flex-col overflow-hidden rounded-2xl border bg-white text-base shadow-lg @lg:flex",ScrollableHandlerProps:uN,children:kF(iN,{hasDetails:r,hasLayerTree:n,hasPrint:a,hasRealtime:s,hasSearch:!1,hasShare:l})})})]}),u&&kF(SP,{className:"absolute bottom-0 z-20 flex max-h-[70%] min-h-[75px] w-full flex-col border-t bg-white @lg:hidden",ScrollableHandlerProps:uN,children:kF(iN,{hasDetails:r,hasLayerTree:n,hasPrint:a,hasRealtime:s,hasSearch:!1,hasShare:l})})]})}));var dN=ec((function(e){let{apikey:t,baseLayer:r,map:i,mapsetbbox:n,mapsetplanid:a,mapsettenants:s,setMapsetLayer:o}=hT(),l=Mu((()=>r?new DI({apiKey:t,bbox:n?.split(",").map((e=>Number(e.trim()))),name:mT,planId:a??void 0,tenants:s?.split(",").map((e=>e.trim())),...e||{}}):null),[t,r,n,s,a,e]);return Tu((()=>{o?.(l)}),[l,o,i]),Tu((()=>{if(i&&l)return i.addLayer(l),()=>{i.removeLayer(l)}}),[i,l]),null}));var pN=ec((function(e){let{apikey:t,baseLayer:r,map:i,notificationat:n,notificationtenant:a,notificationurl:s,previewNotifications:o,setNotificationsLayer:l}=hT(),h=Mu((()=>{if(!r)return null;let i=new KI({apiKey:t,apiParameters:{contentMedium:!0},date:n?new Date(n):void 0,maplibreLayer:r,name:fT,situations:o,tenant:a,url:s,...e||{},loadAll:!o});return o&&!i.getVisible()&&i.setVisible(!0),i}),[t,r,n,a,s,o,e]);return Tu((()=>{l?.(h)}),[h,l]),Tu((()=>{if(i&&h)return i.addLayer(h),()=>{i.removeLayer(h)}}),[i,h]),null})),fN=h(A(),1),gN=(e,t=new URLSearchParams)=>{let r=e.getView().getZoom(),[i,n]=e.getView().getCenter()||[],a=nd(e.getLayers().getArray()).filter((e=>e.get("name")&&e.getVisible())).map((e=>e.get("name")));return t.set("layers",a.join(",")),i>=0&&t.set("x",i.toFixed(2)),n>=0&&t.set("y",n.toFixed(2)),r>=0&&t.set("z",r.toFixed(1)),t},mN=ec((({replaceState:e=!1})=>{let{map:t,setPermalinkUrlSearchParams:r}=hT(),i=ku((i=>{if(t.get(wT))return;let n=new URLSearchParams(window.location.search),a=gN(i,n);a.set("permalink","true"),r(a),e&&window.history.replaceState(null,null,`?${a.toString()}`)}),[t,e,r]);return Tu((()=>{let e,r,n,a=(0,fN.default)(i,1e3);return t&&(a(t),e=t?.on("moveend",(e=>{a(e.map)})),r=t.once("loadend",(e=>{a(e.map),n=nd(e.map.getLayers().getArray()).map((t=>t.on("change:visible",(()=>{a(e.map)}))))}))),()=>{mp(e),mp(r),mp(n)}}),[t,i]),null})),yN=async(e,t,r=0)=>{if(!e)return Promise.reject(new Error("No vehicle provided"));let{geometry:i,properties:{coordinate:n}}=e,a=t.getView(),s=r||a.getZoom(),o=s>0?a.getResolutionForZoom(s):void 0,l=n;if(!l&&i){let{coord:t}=pm(Date.now(),e,!0);l=t}return l?(a.cancelAnimations(),new Promise((e=>{a.animate({center:l,duration:1e3,easing:gy,resolution:o},(t=>{e(t)}))}))):Promise.reject(new Error("No center found"))},_N=(e,t,r)=>t?r?"#dc2626":"#a0a0a0":null===e?"#a0a0a0":HR(e),vN=e=>`bold ${e}px arial`,wN=(e,t=!1)=>{if(t)return String.fromCodePoint(215);let r=jR(e);return"0"===r?"":`+${r}`};var bN=ec((function(e){let{apikey:t,baseLayer:r,isFollowing:i,isTracking:n,linesNetworkPlanLayer:a,map:s,mots:o,realtimebboxparameters:l,realtimeurl:h,setIsFollowing:A,setIsTracking:u,setRealtimeLayer:c,setStation:d,setStopSequence:p,stationId:f,stopSequence:g,tenant:m,trainId:y}=hT(),[_,v]=Eu([]),[w,b]=Eu(!1),x=Mu((()=>t&&h?new iT({apiKey:t,bboxParameters:l?.split(" ").reduce(((e,t)=>{if(!t)return e;let[r,i]=t.split("=");return e[r]=i,e}),{}),getMotsByZoom:o?()=>o.split(","):void 0,isQueryable:!0,name:dT,tenant:m,url:h,zIndex:1,...e,styleOptions:{getDelayColor:_N,getDelayFont:vN,getDelayText:wN,getText:vR,getTextFont:_R,...e?.styleOptions||{}}}):null),[t,h,l,o,m,e]);return Tu((()=>{if(s&&x)return s.getView()?.getCenter()?s.addLayer(x):s.once("moveend",(()=>{s.addLayer(x)})),c(x),()=>{s.removeLayer(x),c(null)}}),[s,c,x]),Tu((()=>{g||A(!1)}),[g,A]),Tu((()=>{let e=[];return n&&A(!1),()=>{mp(e)}}),[n,A]),Tu((()=>{if(!s)return;let e=null;return e=s.getView().on("change:center",(e=>{e.target.getInteracting()&&(A(!1),u(!1))})),()=>{mp(e)}}),[s,A,u]),Tu((()=>{let e=null;return x&&(x.engine.useThrottle=!i,x.engine.isUpdateBboxOnMoveEnd=!i,x.allowRenderWhenAnimating=!!i),i&&g&&s&&x?(u(!1),(async t=>{let r=t&&x?.trajectories?.[t];r||(r=(await x.api.getTrajectory(g.id,x.mode))?.content),!0===await yN(r,s,16)&&(e=setInterval((()=>{yN(x?.trajectories?.[g.id],s)}),1e3))})(g.id),()=>{clearInterval(e)}):void 0}),[i,s,x,g,u]),Tu((()=>{if(y){let e=x?.trajectories?.[y]?.properties?.coordinate;e&&s.getView().setCenter(e)}}),[s,y,x]),Tu((()=>{if(f&&x?.api)return x?.api?.subscribe(`station ${f}`,(({content:e})=>{e&&d(e)})),()=>{d(null),f&&x?.api?.unsubscribe(`station ${f}`)}}),[f,x?.api,d]),Tu((()=>{if(y&&x?.api)return x.selectedVehicleId=y,x.highlightTrajectory(y).catch((e=>{console.error("Error highlighting trajectory:",e)})),x?.api?.subscribeStopSequence(y,(({content:e})=>{if(e){let[t]=e;t&&p(t)}})),()=>{p(null),y&&x&&(x.api?.unsubscribeStopSequence(y),x.selectedVehicleId=null,x.vectorLayer.getSource().clear())}}),[y,x,x?.api,p]),Tu((()=>{if(!s||!r)return;let e=s.once("rendercomplete",(()=>{let e=r.mapLibreMap?.getStyle()?.metadata,t=[];for(let r=0;r<26;r++)t.push(OI(r,e?.graphs));v(t)}));return()=>{mp(e)}}),[s,r,x]),Tu((()=>{let e=a?.on("change:visible",(()=>{let e=a.getVisible();b(e)}));return b(a?.getVisible()||!1),()=>{mp(e)}}),[a]),Tu((()=>{!x||!_?.length||(x.engine.graphByZoom=[],x.engine.setBbox())}),[w,x,_,a]),null})),xN=h(A(),1);var BN=function({debounceOptions:e,debounceTimeout:t=0,hover:r=!0}){let{map:i,queryablelayers:n,setFeaturesInfos:a,setFeaturesInfosHovered:s}=hT(),o=ku((async e=>{let t=e.map.getAllLayers().filter((e=>n.split(",").includes(e.get("name"))));return await oT(e.coordinate,t,5,!0)}),[n]),l=ku((async e=>{let t=await o(e);s(t);let r=t.flatMap((e=>e.features));e.map.getTargetElement().style.cursor=r?.length?"pointer":"default"}),[o,s]),h=ku((async e=>{let t=await o(e);a(t)}),[o,a]);return Tu((()=>{let e=i?.on("singleclick",h);return()=>{mp(e)}}),[i,h]),Tu((()=>{let n;if(r){let r=l;t&&(r=(0,xN.default)(l,t,e)),n=i?.on("pointermove",r)}return()=>{mp(n)}}),[e,t,r,i,l]),null};var CN=ec((function(e){let{baseLayer:t,map:r,setStationsLayer:i}=hT(),n=Mu((()=>t?new vI({layersFilter:({metadata:e})=>"station"===e?.["tralis.variable"]||"stations"===e?.["general.filter"],maplibreLayer:t,name:pT,...e||{}}):null),[t,e]);return Tu((()=>{if(r&&n)return r.addLayer(n),i(n),()=>{r.removeLayer(n),n.detachFromMap()}}),[r,i,n]),null})),SN=(e,t)=>{if(t.get("name")&&null!=e){let r=e?.split(",")||[],i=t.get("name"),n=r.includes(i);t.getVisible()!==n&&(t.setVisible(n),t.getLayers&&t.getLayers().getArray().forEach((e=>{e.setVisible(n)})))}t.getLayers&&t.getLayers().getArray().forEach((t=>{SN(e,t)}))},EN=SN,IN=(e,t)=>(Tu((()=>{if(!e)return;nd(e.getLayers().getArray()).forEach((e=>{EN(t,e)}));let r=e.getLayers().on("add",(e=>{EN(t,e.element)}));return()=>{mp(r)}}),[e,t]),null),TN=e=>{let t=Pu(null),r=Mu((()=>{if(!e)return null;try{let t,r,i=null;if(e?.startsWith("?")){let n=new URLSearchParams(e),a=[...n.keys()],s=a.find((e=>n.get(e).includes("{{x}}"))),o=a.find((e=>n.get(e).includes("{{y}}"))),l=a.find((e=>n.get(e).includes("{{z}}"))),h=new URLSearchParams(window.location.search);t=h.get(s),r=h.get(o),i=h.get(l)}else if(e?.startsWith("#")){let n=e.substring(1).split("/"),a=window.location.hash.substring(1).split("/"),s=n.findIndex((e=>e.includes("{{x}}"))),o=n.findIndex((e=>e.includes("{{y}}"))),l=n.findIndex((e=>e.includes("{{z}}")));t=s>-1?a[s]:null,r=o>-1?a[o]:null,i=l>-1?a[l]:null}let n={};return t&&r&&(n.center=`${t},${r}`),i&&(n.zoom=i),n}catch(t){console.warn("Impossible to read x,y,z from the url with permalinktemplate",e,t)}return null}),[e]);return!t.current&&r?(t.current=r,r):{}},FN=h(bA(),1),PN=/{{(.*?)}}/g;var LN=function(e){var t="",r=e||{};return{set(e,t){r[e]=Object.assign(r[e]||{},t)},locale:e=>t=e||t,table:e=>r[e],t(e,i,n){var a=(0,FN.default)(r[n||t],e,"");return"function"==typeof a?a(i):"string"==typeof a?function(e,t){return e.replace(PN,((e,r,i)=>{for(e=0,i=t,r=r.trim().split(".");i&&e<r.length;)i=i[r[e++]];return i??""}))}(a,i):a}}}({de:{affected_lines:"Betroffene Linien",affected_stops:"Betroffene Haltestellen",all_line_stops:"Alle Haltestellen auf dieser Strecke",daily_from_to:"Täglich von {{from}} bis {{to}}",download:"Herunterladen",error:"Fehler",export_all_region:"Ganze Region exportieren",export_format_title:"Format",exporting:"Exportieren ...",from_to:"von {{from}} bis {{to}}",geolocation_button_title_off:"Geolokalisierung deaktivieren",geolocation_button_title_on:"Geolokalisierung aktivieren",[yT.linesnetworkplan]:"Liniennetzpläne",[yT.mapset]:"Mapset-Pläne",[yT.notifications]:"Meldungen",[yT.realtime]:"Echtzeit",[yT.stations]:"Stationen",layertree_menu_title:"Ebenen",linesnetworkplan:"plan retea linii",no_details_available:"Keine Details verfügbar",no_stops_found:"Keine Haltestellen gefunden",notifications:"notificari",permalink_input_hint:"Sie können auch den Link aus der Adresszeile des Browsers kopieren.",platform_ferry:"St.",platform_other:"Kan.",platform_rail:"Gl.",print_menu_title:"Drucken",search_menu_title:"Suchen",share_email_send:"E-Mail senden",share_image_save:"Bild speichern",share_menu_title:"Teilen",stops_search_placeholder:"Haltestellen suchen",zoomin:"Hineinzoomen",zoomout:"Herauszoomen"},en:{affected_lines:"Affected lines",affected_stops:"Affected stops",all_line_stops:"All stops on this line",daily_from_to:"Daily from {{from}} to {{to}}",download:"Download",error:"Error",export_all_region:"Export entire region",export_format_title:"Format",exporting:"Exporting ...",from_to:"from {{from}} to {{to}}",geolocation_button_title_off:"Disable geolocation",geolocation_button_title_on:"Enable geolocation",[yT.linesnetworkplan]:"Lines Network Plan",[yT.mapset]:"Mapset plans",[yT.notifications]:"Notifications",[yT.realtime]:"Realtime",[yT.stations]:"Stations",layertree_menu_title:"Layers",no_details_available:"No details available",no_stops_found:"No stops found",permalink_input_hint:"You can also copy the link from the browser address bar.",platform_ferry:"Pier",platform_other:"Std.",platform_rail:"Pl.",print_menu_title:"Print",search_menu_title:"Search",share_email_send:"Send email",share_image_save:"Save image",share_menu_title:"Share",stops_search_placeholder:"Search for stop",zoomin:"Zoom in",zoomout:"Zoom out"},fr:{affected_lines:"Lignes affectées",affected_stops:"Arrêts affectés",all_line_stops:"Tous les arrêts sur cette ligne",daily_from_to:"Tous les jours de {{from}} à {{to}}",download:"Télécharger",error:"Erreur",export_all_region:"Exporter toute la région",export_format_title:"Format",exporting:"Exportation ...",from_to:"de {{from}} à {{to}}",geolocation_button_title_off:"Désactiver la géolocalisation",geolocation_button_title_on:"Activer la géolocalisation",[yT.linesnetworkplan]:"Plans du réseau",[yT.mapset]:"Plans de Mapset",[yT.notifications]:"Notifications",[yT.realtime]:"Temps réel",[yT.stations]:"Stations",layertree_menu_title:"Couches",no_details_available:"Aucun détail disponible",no_stops_found:"Aucun arrêt trouvé",permalink_input_hint:"Vous pouvez aussi copier le lien depuis la barre d'adresse du navigateur.",platform_ferry:"Quai",platform_other:"Quai",platform_rail:"Voie",print_menu_title:"Imprimer",search_menu_title:"Rechercher",share_email_send:"Envoyer un email",share_image_save:"Enregistrer l'image",share_menu_title:"Partager",stops_search_placeholder:"Chercher un arrêt",zoomin:"Zoomer",zoomout:"Dézoomer"},it:{affected_lines:"Linee interessate",affected_stops:"Fermate interessate",all_line_stops:"Tutte le fermate su questa linea",daily_from_to:"Tutti i giorni da {{from}} a {{to}}",download:"Scarica",error:"Errore",export_all_region:"Esporta l'intera regione",export_format_title:"Formato",exporting:"Esportazione ...",from_to:"da {{from}} a {{to}}",geolocation_button_title_off:"Disattiva geolocalizzazione",geolocation_button_title_on:"Attiva geolocalizzazione",[yT.linesnetworkplan]:"Piani della rete",[yT.mapset]:"Piani di Mapset",[yT.notifications]:"Notifiche",[yT.realtime]:"In tempo reale",[yT.stations]:"Stazioni",layertree_menu_title:"Livelli",no_details_available:"Nessun dettaglio disponibile",no_stops_found:"Nessuna fermata trovata",permalink_input_hint:"Puoi anche copiare il link dalla barra degli indirizzi del browser.",platform_ferry:"Imb.",platform_other:"Cor.",platform_rail:"Bin.",print_menu_title:"Stampa",search_menu_title:"Cerca",share_email_send:"Invia email",share_image_save:"Salva immagine",share_menu_title:"Condividi",stops_search_placeholder:"Ricerca delle fermate",zoomin:"Zoom avanti",zoomout:"Zoom indietro"}}),MN=LN,kN=["mwc:permalink","mwc:selectedfeature","mwc:singleclick","mwc:attribute"];var UN=ec((function({eventNode:e}){let{setPreviewNotifications:t}=hT();return Tu((()=>{let e=e=>{e.data.situations&&t(e.data.situations)};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}}),[t]),Tu((()=>{if(!e)return;let t=e=>{"mwc:attribute"===e.type&&delete e.data.children,"mwc:selectedfeature"===e.type&&e.data?.properties?.olGeometry&&delete e.data.properties.olGeometry,window.parent?.postMessage({data:e.data,type:e.type},"*")};return kN.forEach((r=>{e.addEventListener(r,t)})),window.parent?.postMessage({data:!0,type:"mwc:messageready"},"*"),()=>{kN.forEach((r=>{e.removeEventListener(r,t)}))}}),[e]),null})),RN='<a href="https://developer.geops.io/apis/maps">geOps Maps API</a>',DN='<a href="https://geops.com/en/solution/disruption-information">geOps MOCO API</a>',NN='<a href="https://developer.geops.io/apis/realtime">geOps Realtime API</a>',ON={apikey:{description:'Your <a href="https://developer.geops.io/">geOps API key</a>'},baselayer:{defaultValue:"travic_v2",description:`The style's name from the ${RN}. <br/>Ex: base_dark_v2, base_bright_v2, ...`},center:{defaultValue:"831634,5933959",description:"The center of the map in EPSG:3857 coordinates.<br/>Parameter required if extent is not set."},details:{defaultValue:"true",description:"When a feature of a queryable layer is clicked, it displays informations about it.",type:"boolean"},embed:{defaultValue:"false",description:"Toggle the embedded navigation mode.<br/>In this mode zooming with mouse wheel is deactivated and, on touch device, you can only navigate with two finger, a warning message is displayed to warn the user.",type:"boolean"},extent:{description:"The map's extent in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 .<br/>Parameter required if center and zoom are not set."},geolocation:{defaultValue:"true",description:"Toggle the display of the geolocation button or not.",type:"boolean"},lang:{defaultValue:"en",description:"The language to use for the map. Supported languages are : de, en, fr, it."},layers:{defaultValue:_T.toString(),description:`A comma separated list of layers's name to make visible on load, others are hidden. If empty, all layers will be hidden except the baselayer.<br/>Layers available are ${Object.values(yT).join(", ")}.`},layersconfig:{description:`A JSON string to configure the layers and other components associated to it.<br/>\n       The layers available are : ${Object.values(yT).toString()}.<br/>\n       Definition for a layer :\n<pre style="font-size: 12px; overflow: auto;">{\n  "notifications": {\n    "link": {\n      "href": "https://moco.geops.io/situation/{{id}}",\n      "show": true,\n      "text": "Zu MOCO"\n    },\n    "title": "Notifications"\n  }\n</pre>}\n<br/>\nwhere:\n<ul style="list-style-type: disc; padding-left: 20px;">\n  <li><i>link</i> defined a external link displayed at the bottom of the detail view</li>\n    <ul style="list-style-type: disc; padding-left: 40px;">\n      <li><i>href</i> is the target of the link. The <i>href</i> can be template, for example for the meldungen layer you can use {{id}} to insert the id of the notification in the url.</li\n      <li><i>text</i> is the text display as a link</li>\n      <li><i>show</i> show/hide the link in the details view</li>\n    </ul>\n  <li><i>title</i> is the title of the layer used in the details view header and in the layer tree, if not defined the layer name will be used.</li>\n</ul>`},layertree:{defaultValue:"true",description:"Show/hide the layers tree button in the toolbar.",type:"boolean"},lnp:{defaultValue:"false",description:"Add the linesnetworkplans layer to the map. This layer will display lines network plans on the map.",type:"boolean"},mapset:{defaultValue:"false",description:"Add the mapset layer to the map. This layer will display mapset plans on the map.",type:"boolean"},mapsetbbox:{description:"The BBOX to constrain the boundary of the mapset layer in EPSG:3857 coordinates. Mandatory for mapset layer. <br/>Ex: 831634,5933959,940649,6173660 ."},mapsetplanid:{description:"The id of the mapset plan to display."},mapsettenants:{defaultValue:"geopstest",description:'The <a href="https://geops.com/en/solution/mapset">geOps Mapset API</a> tenant to get the mapset from.'},mapsurl:{defaultValue:"https://maps.geops.io",description:`The ${RN} url to use.`},maxextent:{description:"The maximum extent of the map in EPSG:3857 coordinates.<br/>Ex: 831634,5933959,940649,6173660 ."},maxzoom:{description:"The maximal zoom level of the map."},minzoom:{description:"The minimal zoom level of the map."},mots:{description:"Commas separated list of mots to display on the Realtime layer.<br/>Ex: rail,bus,coach,foot,tram,subway,gondola,funicular,ferry,car ."},notification:{defaultValue:"false",description:`Add the notification layer to the map. This layer will display informations about disruptions on the network. Data comes from\n        our ${DN} .`,type:"boolean"},notificationat:{description:"An ISO date string used to display active notification at this date in the notification layer. If not defined the current date will be used.<br/>Ex: 2025-08-01T00:00:00Z ."},notificationtenant:{defaultValue:"geopstest",description:`The ${DN} tenant to get the notification from.`},notificationurl:{defaultValue:"https://moco.geops.io/api/v2/",description:`The ${DN} url to use.`},permalink:{defaultValue:"false",description:"Update some url parameters x,y,z,layers to the current window location. These parameters are used to store the current state of the map. They will be used on page load to configure the web-component.",type:"boolean"},permalinktemplate:{defaultValue:null,description:'A template string to read the current browser url. Hash (starting with #) and URL search parameters (starting with ?) are supported.<br/>\n     The template supports {{x}}, {{y}}, {{z}} variables.<br/> \n     Ex: "?x={{x}}&y={{y}}&z={{z}}" or "#map/{{x}}/{{y}}/{{z}}" .'},print:{defaultValue:"true",description:"Show/hide the print button in the toolbar.",type:"boolean"},queryablelayers:{defaultValue:vT.toString(),description:`A comma separated list of layers's name. The data of these layers will be queryable by click on the map (see selectedfeature event). If empty, all layers will not be queryable.<br/>\n        Layers available are ${Object.values(yT).join(", ")}`},realtime:{defaultValue:"true",description:`Add the realtime layer to the map. Data comes from the ${NN} .`,type:"boolean"},realtimebboxparameters:{description:"A space separated list of parameters to add to the realtime BBOX request to define custom behavior.<br/>Ex: graph=XXX line_tags=XXX."},realtimetenant:{description:`The ${NN} tenant to get the realtime data from.`},realtimeurl:{defaultValue:"wss://api.geops.io/tracker-ws/v1/ws",description:`The ${NN} url to use.`},search:{defaultValue:"true",description:"Toggle the search stops input.",type:"boolean"},share:{defaultValue:"true",description:"Show/hide the share button in the toolbar.",type:"boolean"},stopsurl:{defaultValue:"https://api.geops.io/stops/v1/",description:'The <a href="https://developer.geops.io/apis/stops">geOps Stops API</a> to use.'},tenant:{description:"The tenant to use by default for all geOps APIs (Stops, Realtime, MOCO ...). Can be override for each API by other XXXXtenant parameters."},toolbar:{defaultValue:"true",description:"Show/hide the toolbar on the top left.",type:"boolean"},zoom:{defaultValue:"13",description:"The zoom level of the map."}},QN='/*! tailwindcss v4.1.13 | MIT License | https://tailwindcss.com */\n@layer properties;\n@layer theme, base, components, utilities;\n@layer theme {\n  :root, :host {\n    --font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji",\n      "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";\n    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",\n      "Courier New", monospace;\n    --color-red-600: oklch(57.7% 0.245 27.325);\n    --color-orange-600: oklch(64.6% 0.222 41.116);\n    --color-amber-600: oklch(66.6% 0.179 58.318);\n    --color-yellow-600: oklch(68.1% 0.162 75.834);\n    --color-green-600: oklch(62.7% 0.194 149.214);\n    --color-slate-50: oklch(98.4% 0.003 247.858);\n    --color-slate-100: oklch(96.8% 0.007 247.896);\n    --color-slate-200: oklch(92.9% 0.013 255.508);\n    --color-slate-300: oklch(86.9% 0.022 252.894);\n    --color-slate-800: oklch(27.9% 0.041 260.031);\n    --color-gray-200: oklch(92.8% 0.006 264.531);\n    --color-gray-300: oklch(87.2% 0.01 258.338);\n    --color-gray-400: oklch(70.7% 0.022 261.325);\n    --color-gray-500: oklch(55.1% 0.027 264.364);\n    --color-gray-600: oklch(44.6% 0.03 256.802);\n    --color-gray-700: oklch(37.3% 0.034 259.733);\n    --color-zinc-400: oklch(70.5% 0.015 286.067);\n    --color-black: #000;\n    --color-white: #fff;\n    --spacing: 0.25rem;\n    --text-xs: 0.75rem;\n    --text-xs--line-height: calc(1 / 0.75);\n    --text-sm: 0.875rem;\n    --text-sm--line-height: calc(1.25 / 0.875);\n    --text-base: 1rem;\n    --text-base--line-height: calc(1.5 / 1);\n    --text-lg: 1.125rem;\n    --text-lg--line-height: calc(1.75 / 1.125);\n    --text-xl: 1.25rem;\n    --text-xl--line-height: calc(1.75 / 1.25);\n    --text-3xl: 1.875rem;\n    --text-3xl--line-height: calc(2.25 / 1.875);\n    --font-weight-medium: 500;\n    --font-weight-semibold: 600;\n    --font-weight-bold: 700;\n    --radius-sm: 0.25rem;\n    --radius-md: 0.375rem;\n    --radius-lg: 0.5rem;\n    --radius-2xl: 1rem;\n    --animate-pulse: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;\n    --blur-sm: 8px;\n    --default-transition-duration: 150ms;\n    --default-transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);\n    --default-font-family: var(--font-sans);\n    --default-mono-font-family: var(--font-mono);\n  }\n}\n@layer base {\n  *, ::after, ::before, ::backdrop, ::file-selector-button {\n    box-sizing: border-box;\n    margin: 0;\n    padding: 0;\n    border: 0 solid;\n  }\n  html, :host {\n    line-height: 1.5;\n    -webkit-text-size-adjust: 100%;\n    tab-size: 4;\n    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");\n    font-feature-settings: var(--default-font-feature-settings, normal);\n    font-variation-settings: var(--default-font-variation-settings, normal);\n    -webkit-tap-highlight-color: transparent;\n  }\n  hr {\n    height: 0;\n    color: inherit;\n    border-top-width: 1px;\n  }\n  abbr:where([title]) {\n    -webkit-text-decoration: underline dotted;\n    text-decoration: underline dotted;\n  }\n  h1, h2, h3, h4, h5, h6 {\n    font-size: inherit;\n    font-weight: inherit;\n  }\n  a {\n    color: inherit;\n    -webkit-text-decoration: inherit;\n    text-decoration: inherit;\n  }\n  b, strong {\n    font-weight: bolder;\n  }\n  code, kbd, samp, pre {\n    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);\n    font-feature-settings: var(--default-mono-font-feature-settings, normal);\n    font-variation-settings: var(--default-mono-font-variation-settings, normal);\n    font-size: 1em;\n  }\n  small {\n    font-size: 80%;\n  }\n  sub, sup {\n    font-size: 75%;\n    line-height: 0;\n    position: relative;\n    vertical-align: baseline;\n  }\n  sub {\n    bottom: -0.25em;\n  }\n  sup {\n    top: -0.5em;\n  }\n  table {\n    text-indent: 0;\n    border-color: inherit;\n    border-collapse: collapse;\n  }\n  :-moz-focusring {\n    outline: auto;\n  }\n  progress {\n    vertical-align: baseline;\n  }\n  summary {\n    display: list-item;\n  }\n  ol, ul, menu {\n    list-style: none;\n  }\n  img, svg, video, canvas, audio, iframe, embed, object {\n    display: block;\n    vertical-align: middle;\n  }\n  img, video {\n    max-width: 100%;\n    height: auto;\n  }\n  button, input, select, optgroup, textarea, ::file-selector-button {\n    font: inherit;\n    font-feature-settings: inherit;\n    font-variation-settings: inherit;\n    letter-spacing: inherit;\n    color: inherit;\n    border-radius: 0;\n    background-color: transparent;\n    opacity: 1;\n  }\n  :where(select:is([multiple], [size])) optgroup {\n    font-weight: bolder;\n  }\n  :where(select:is([multiple], [size])) optgroup option {\n    padding-inline-start: 20px;\n  }\n  ::file-selector-button {\n    margin-inline-end: 4px;\n  }\n  ::placeholder {\n    opacity: 1;\n  }\n  @supports (not (-webkit-appearance: -apple-pay-button))  or (contain-intrinsic-size: 1px) {\n    ::placeholder {\n      color: currentcolor;\n      @supports (color: color-mix(in lab, red, red)) {\n        color: color-mix(in oklab, currentcolor 50%, transparent);\n      }\n    }\n  }\n  textarea {\n    resize: vertical;\n  }\n  ::-webkit-search-decoration {\n    -webkit-appearance: none;\n  }\n  ::-webkit-date-and-time-value {\n    min-height: 1lh;\n    text-align: inherit;\n  }\n  ::-webkit-datetime-edit {\n    display: inline-flex;\n  }\n  ::-webkit-datetime-edit-fields-wrapper {\n    padding: 0;\n  }\n  ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {\n    padding-block: 0;\n  }\n  ::-webkit-calendar-picker-indicator {\n    line-height: 1;\n  }\n  :-moz-ui-invalid {\n    box-shadow: none;\n  }\n  button, input:where([type="button"], [type="reset"], [type="submit"]), ::file-selector-button {\n    appearance: button;\n  }\n  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {\n    height: auto;\n  }\n  [hidden]:where(:not([hidden="until-found"])) {\n    display: none !important;\n  }\n}\n@layer utilities {\n  .\\@container\\/inputsearch {\n    container-type: inline-size;\n    container-name: inputsearch;\n  }\n  .\\@container\\/inputsearch {\n    container-type: inline-size;\n    container-name: inputsearch;\n  }\n  .\\@container\\/main {\n    container-type: inline-size;\n    container-name: main;\n  }\n  .\\@container\\/main {\n    container-type: inline-size;\n    container-name: main;\n  }\n  .\\@container\\/overlay {\n    container-type: inline-size;\n    container-name: overlay;\n  }\n  .\\@container\\/overlay {\n    container-type: inline-size;\n    container-name: overlay;\n  }\n  .\\@container {\n    container-type: inline-size;\n  }\n  .\\@container {\n    container-type: inline-size;\n  }\n  .pointer-events-auto {\n    pointer-events: auto;\n  }\n  .pointer-events-none {\n    pointer-events: none;\n  }\n  .visible {\n    visibility: visible;\n  }\n  .absolute {\n    position: absolute;\n  }\n  .fixed {\n    position: fixed;\n  }\n  .relative {\n    position: relative;\n  }\n  .static {\n    position: static;\n  }\n  .sticky {\n    position: sticky;\n  }\n  .inset-0 {\n    inset: calc(var(--spacing) * 0);\n  }\n  .inset-x-2 {\n    inset-inline: calc(var(--spacing) * 2);\n  }\n  .-top-2 {\n    top: calc(var(--spacing) * -2);\n  }\n  .top-0 {\n    top: calc(var(--spacing) * 0);\n  }\n  .top-2 {\n    top: calc(var(--spacing) * 2);\n  }\n  .top-4 {\n    top: calc(var(--spacing) * 4);\n  }\n  .top-14 {\n    top: calc(var(--spacing) * 14);\n  }\n  .top-\\[-5px\\] {\n    top: -5px;\n  }\n  .right-0 {\n    right: calc(var(--spacing) * 0);\n  }\n  .right-2 {\n    right: calc(var(--spacing) * 2);\n  }\n  .right-\\[-5px\\] {\n    right: -5px;\n  }\n  .right-\\[8px\\] {\n    right: 8px;\n  }\n  .bottom-0 {\n    bottom: calc(var(--spacing) * 0);\n  }\n  .bottom-2 {\n    bottom: calc(var(--spacing) * 2);\n  }\n  .bottom-10 {\n    bottom: calc(var(--spacing) * 10);\n  }\n  .bottom-\\[-1px\\] {\n    bottom: -1px;\n  }\n  .-left-1\\.5 {\n    left: calc(var(--spacing) * -1.5);\n  }\n  .-left-2 {\n    left: calc(var(--spacing) * -2);\n  }\n  .left-0 {\n    left: calc(var(--spacing) * 0);\n  }\n  .left-2 {\n    left: calc(var(--spacing) * 2);\n  }\n  .z-5 {\n    z-index: 5;\n  }\n  .z-10 {\n    z-index: 10;\n  }\n  .z-20 {\n    z-index: 20;\n  }\n  .z-50 {\n    z-index: 50;\n  }\n  .z-9000 {\n    z-index: 9000;\n  }\n  .container {\n    width: 100%;\n    @media (width >= 40rem) {\n      max-width: 40rem;\n    }\n    @media (width >= 48rem) {\n      max-width: 48rem;\n    }\n    @media (width >= 64rem) {\n      max-width: 64rem;\n    }\n    @media (width >= 80rem) {\n      max-width: 80rem;\n    }\n    @media (width >= 96rem) {\n      max-width: 96rem;\n    }\n  }\n  .m-0 {\n    margin: calc(var(--spacing) * 0);\n  }\n  .m-0\\! {\n    margin: calc(var(--spacing) * 0) !important;\n  }\n  .m-2 {\n    margin: calc(var(--spacing) * 2);\n  }\n  .m-4 {\n    margin: calc(var(--spacing) * 4);\n  }\n  .mx-auto {\n    margin-inline: auto;\n  }\n  .my-1 {\n    margin-block: calc(var(--spacing) * 1);\n  }\n  .my-4 {\n    margin-block: calc(var(--spacing) * 4);\n  }\n  .my-8 {\n    margin-block: calc(var(--spacing) * 8);\n  }\n  .my-12 {\n    margin-block: calc(var(--spacing) * 12);\n  }\n  .mt-4 {\n    margin-top: calc(var(--spacing) * 4);\n  }\n  .mr-\\[-60px\\] {\n    margin-right: -60px;\n  }\n  .mb-0 {\n    margin-bottom: calc(var(--spacing) * 0);\n  }\n  .mb-48 {\n    margin-bottom: calc(var(--spacing) * 48);\n  }\n  .ml-4 {\n    margin-left: calc(var(--spacing) * 4);\n  }\n  .box-border {\n    box-sizing: border-box;\n  }\n  .block {\n    display: block;\n  }\n  .contents {\n    display: contents;\n  }\n  .flex {\n    display: flex;\n  }\n  .hidden {\n    display: none;\n  }\n  .inline {\n    display: inline;\n  }\n  .inline-block {\n    display: inline-block;\n  }\n  .table {\n    display: table;\n  }\n  .\\!size-\\[32px\\] {\n    width: 32px !important;\n    height: 32px !important;\n  }\n  .size-2\\.5 {\n    width: calc(var(--spacing) * 2.5);\n    height: calc(var(--spacing) * 2.5);\n  }\n  .size-4 {\n    width: calc(var(--spacing) * 4);\n    height: calc(var(--spacing) * 4);\n  }\n  .size-6 {\n    width: calc(var(--spacing) * 6);\n    height: calc(var(--spacing) * 6);\n  }\n  .size-8 {\n    width: calc(var(--spacing) * 8);\n    height: calc(var(--spacing) * 8);\n  }\n  .size-9 {\n    width: calc(var(--spacing) * 9);\n    height: calc(var(--spacing) * 9);\n  }\n  .size-\\[20px\\] {\n    width: 20px;\n    height: 20px;\n  }\n  .size-full {\n    width: 100%;\n    height: 100%;\n  }\n  .h-4 {\n    height: calc(var(--spacing) * 4);\n  }\n  .h-6 {\n    height: calc(var(--spacing) * 6);\n  }\n  .h-8 {\n    height: calc(var(--spacing) * 8);\n  }\n  .h-16 {\n    height: calc(var(--spacing) * 16);\n  }\n  .h-40 {\n    height: calc(var(--spacing) * 40);\n  }\n  .h-96 {\n    height: calc(var(--spacing) * 96);\n  }\n  .h-128 {\n    height: calc(var(--spacing) * 128);\n  }\n  .h-300 {\n    height: calc(var(--spacing) * 300);\n  }\n  .h-\\[32px\\] {\n    height: 32px;\n  }\n  .h-\\[40px\\] {\n    height: 40px;\n  }\n  .h-\\[48px\\] {\n    height: 48px;\n  }\n  .h-\\[65px\\] {\n    height: 65px;\n  }\n  .h-full {\n    height: 100%;\n  }\n  .max-h-\\[58px\\] {\n    max-height: 58px;\n  }\n  .max-h-\\[70\\%\\] {\n    max-height: 70%;\n  }\n  .max-h-\\[200px\\] {\n    max-height: 200px;\n  }\n  .min-h-\\[75px\\] {\n    min-height: 75px;\n  }\n  .w-0 {\n    width: calc(var(--spacing) * 0);\n  }\n  .w-1 {\n    width: calc(var(--spacing) * 1);\n  }\n  .w-1\\/5 {\n    width: calc(1/5 * 100%);\n  }\n  .w-2\\/5 {\n    width: calc(2/5 * 100%);\n  }\n  .w-4\\/5 {\n    width: calc(4/5 * 100%);\n  }\n  .w-8 {\n    width: calc(var(--spacing) * 8);\n  }\n  .w-10 {\n    width: calc(var(--spacing) * 10);\n  }\n  .w-24 {\n    width: calc(var(--spacing) * 24);\n  }\n  .w-64 {\n    width: calc(var(--spacing) * 64);\n  }\n  .w-\\[345px\\] {\n    width: 345px;\n  }\n  .w-fit {\n    width: fit-content;\n  }\n  .w-full {\n    width: 100%;\n  }\n  .w-screen {\n    width: 100vw;\n  }\n  .max-w-3xl {\n    max-width: 48rem;\n  }\n  .max-w-96 {\n    max-width: calc(var(--spacing) * 96);\n  }\n  .max-w-full {\n    max-width: 100%;\n  }\n  .min-w-8 {\n    min-width: calc(var(--spacing) * 8);\n  }\n  .min-w-\\[40px\\] {\n    min-width: 40px;\n  }\n  .min-w-\\[320px\\] {\n    min-width: 320px;\n  }\n  .flex-1 {\n    flex: 1;\n  }\n  .flex-none {\n    flex: none;\n  }\n  .shrink-0 {\n    flex-shrink: 0;\n  }\n  .grow {\n    flex-grow: 1;\n  }\n  .grow-0 {\n    flex-grow: 0;\n  }\n  .table-auto {\n    table-layout: auto;\n  }\n  .rotate-45 {\n    rotate: 45deg;\n  }\n  .transform {\n    transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);\n  }\n  .animate-pulse {\n    animation: var(--animate-pulse);\n  }\n  .cursor-pointer {\n    cursor: pointer;\n  }\n  .touch-none {\n    touch-action: none;\n  }\n  .resize {\n    resize: both;\n  }\n  .scroll-mt-20 {\n    scroll-margin-top: calc(var(--spacing) * 20);\n  }\n  .scroll-mt-\\[50px\\] {\n    scroll-margin-top: 50px;\n  }\n  .list-disc {\n    list-style-type: disc;\n  }\n  .appearance-none {\n    appearance: none;\n  }\n  .flex-col {\n    flex-direction: column;\n  }\n  .flex-row {\n    flex-direction: row;\n  }\n  .flex-wrap {\n    flex-wrap: wrap;\n  }\n  .flex-wrap-reverse {\n    flex-wrap: wrap-reverse;\n  }\n  .items-center {\n    align-items: center;\n  }\n  .items-end {\n    align-items: flex-end;\n  }\n  .items-start {\n    align-items: flex-start;\n  }\n  .items-stretch {\n    align-items: stretch;\n  }\n  .justify-between {\n    justify-content: space-between;\n  }\n  .justify-center {\n    justify-content: center;\n  }\n  .justify-end {\n    justify-content: flex-end;\n  }\n  .justify-start {\n    justify-content: flex-start;\n  }\n  .gap-1 {\n    gap: calc(var(--spacing) * 1);\n  }\n  .gap-2 {\n    gap: calc(var(--spacing) * 2);\n  }\n  .gap-3 {\n    gap: calc(var(--spacing) * 3);\n  }\n  .gap-4 {\n    gap: calc(var(--spacing) * 4);\n  }\n  .gap-\\[1px\\] {\n    gap: 1px;\n  }\n  .space-y-4 {\n    :where(& > :not(:last-child)) {\n      --tw-space-y-reverse: 0;\n      margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));\n      margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));\n    }\n  }\n  .gap-x-4 {\n    column-gap: calc(var(--spacing) * 4);\n  }\n  .space-x-2 {\n    :where(& > :not(:last-child)) {\n      --tw-space-x-reverse: 0;\n      margin-inline-start: calc(calc(var(--spacing) * 2) * var(--tw-space-x-reverse));\n      margin-inline-end: calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-x-reverse)));\n    }\n  }\n  .overflow-auto {\n    overflow: auto;\n  }\n  .overflow-hidden {\n    overflow: hidden;\n  }\n  .overflow-visible {\n    overflow: visible;\n  }\n  .overflow-x-hidden {\n    overflow-x: hidden;\n  }\n  .overflow-y-auto {\n    overflow-y: auto;\n  }\n  .rounded {\n    border-radius: 0.25rem;\n  }\n  .rounded-2xl {\n    border-radius: var(--radius-2xl);\n  }\n  .rounded-\\[12px\\] {\n    border-radius: 12px;\n  }\n  .rounded-\\[16px\\] {\n    border-radius: 16px;\n  }\n  .rounded-full {\n    border-radius: calc(infinity * 1px);\n  }\n  .rounded-lg {\n    border-radius: var(--radius-lg);\n  }\n  .rounded-md {\n    border-radius: var(--radius-md);\n  }\n  .rounded-none {\n    border-radius: 0;\n  }\n  .rounded-sm {\n    border-radius: var(--radius-sm);\n  }\n  .rounded-t-none {\n    border-top-left-radius: 0;\n    border-top-right-radius: 0;\n  }\n  .\\!rounded-b-none {\n    border-bottom-right-radius: 0 !important;\n    border-bottom-left-radius: 0 !important;\n  }\n  .rounded-b-2xl {\n    border-bottom-right-radius: var(--radius-2xl);\n    border-bottom-left-radius: var(--radius-2xl);\n  }\n  .border {\n    border-style: var(--tw-border-style);\n    border-width: 1px;\n  }\n  .border-0 {\n    border-style: var(--tw-border-style);\n    border-width: 0px;\n  }\n  .border-2 {\n    border-style: var(--tw-border-style);\n    border-width: 2px;\n  }\n  .border-t {\n    border-top-style: var(--tw-border-style);\n    border-top-width: 1px;\n  }\n  .border-t-0 {\n    border-top-style: var(--tw-border-style);\n    border-top-width: 0px;\n  }\n  .border-r-0 {\n    border-right-style: var(--tw-border-style);\n    border-right-width: 0px;\n  }\n  .border-b {\n    border-bottom-style: var(--tw-border-style);\n    border-bottom-width: 1px;\n  }\n  .border-b-2 {\n    border-bottom-style: var(--tw-border-style);\n    border-bottom-width: 2px;\n  }\n  .border-dashed {\n    --tw-border-style: dashed;\n    border-style: dashed;\n  }\n  .border-none {\n    --tw-border-style: none;\n    border-style: none;\n  }\n  .border-solid {\n    --tw-border-style: solid;\n    border-style: solid;\n  }\n  .border-current {\n    border-color: currentcolor;\n  }\n  .border-slate-300 {\n    border-color: var(--color-slate-300);\n  }\n  .bg-black {\n    background-color: var(--color-black);\n  }\n  .bg-black\\/10 {\n    background-color: color-mix(in srgb, #000 10%, transparent);\n    @supports (color: color-mix(in lab, red, red)) {\n      background-color: color-mix(in oklab, var(--color-black) 10%, transparent);\n    }\n  }\n  .bg-gray-300 {\n    background-color: var(--color-gray-300);\n  }\n  .bg-gray-600 {\n    background-color: var(--color-gray-600);\n  }\n  .bg-slate-50\\/70 {\n    background-color: color-mix(in srgb, oklch(98.4% 0.003 247.858) 70%, transparent);\n    @supports (color: color-mix(in lab, red, red)) {\n      background-color: color-mix(in oklab, var(--color-slate-50) 70%, transparent);\n    }\n  }\n  .bg-slate-100 {\n    background-color: var(--color-slate-100);\n  }\n  .bg-slate-800 {\n    background-color: var(--color-slate-800);\n  }\n  .bg-transparent {\n    background-color: transparent;\n  }\n  .bg-white {\n    background-color: var(--color-white);\n  }\n  .bg-gradient-to-b {\n    --tw-gradient-position: to bottom in oklab;\n    background-image: linear-gradient(var(--tw-gradient-stops));\n  }\n  .bg-gradient-to-t {\n    --tw-gradient-position: to top in oklab;\n    background-image: linear-gradient(var(--tw-gradient-stops));\n  }\n  .from-transparent {\n    --tw-gradient-from: transparent;\n    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n  }\n  .to-white {\n    --tw-gradient-to: var(--color-white);\n    --tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position));\n  }\n  .bg-\\[length\\:18px\\] {\n    background-size: 18px;\n  }\n  .bg-contain {\n    background-size: contain;\n  }\n  .bg-center {\n    background-position: center;\n  }\n  .p-0 {\n    padding: calc(var(--spacing) * 0);\n  }\n  .p-1 {\n    padding: calc(var(--spacing) * 1);\n  }\n  .p-1\\.5 {\n    padding: calc(var(--spacing) * 1.5);\n  }\n  .p-2 {\n    padding: calc(var(--spacing) * 2);\n  }\n  .p-3 {\n    padding: calc(var(--spacing) * 3);\n  }\n  .p-4 {\n    padding: calc(var(--spacing) * 4);\n  }\n  .p-8 {\n    padding: calc(var(--spacing) * 8);\n  }\n  .px-0\\.5 {\n    padding-inline: calc(var(--spacing) * 0.5);\n  }\n  .px-1 {\n    padding-inline: calc(var(--spacing) * 1);\n  }\n  .px-2 {\n    padding-inline: calc(var(--spacing) * 2);\n  }\n  .px-4 {\n    padding-inline: calc(var(--spacing) * 4);\n  }\n  .px-\\[12px\\] {\n    padding-inline: 12px;\n  }\n  .px-\\[13px\\] {\n    padding-inline: 13px;\n  }\n  .py-1 {\n    padding-block: calc(var(--spacing) * 1);\n  }\n  .py-2 {\n    padding-block: calc(var(--spacing) * 2);\n  }\n  .py-4 {\n    padding-block: calc(var(--spacing) * 4);\n  }\n  .py-\\[9px\\] {\n    padding-block: 9px;\n  }\n  .py-px {\n    padding-block: 1px;\n  }\n  .pt-2 {\n    padding-top: calc(var(--spacing) * 2);\n  }\n  .pt-3\\.5 {\n    padding-top: calc(var(--spacing) * 3.5);\n  }\n  .pr-2 {\n    padding-right: calc(var(--spacing) * 2);\n  }\n  .pr-4 {\n    padding-right: calc(var(--spacing) * 4);\n  }\n  .pl-4 {\n    padding-left: calc(var(--spacing) * 4);\n  }\n  .pl-6 {\n    padding-left: calc(var(--spacing) * 6);\n  }\n  .pl-8 {\n    padding-left: calc(var(--spacing) * 8);\n  }\n  .text-left {\n    text-align: left;\n  }\n  .align-middle {\n    vertical-align: middle;\n  }\n  .font-sans {\n    font-family: var(--font-sans);\n  }\n  .text-3xl {\n    font-size: var(--text-3xl);\n    line-height: var(--tw-leading, var(--text-3xl--line-height));\n  }\n  .text-base {\n    font-size: var(--text-base);\n    line-height: var(--tw-leading, var(--text-base--line-height));\n  }\n  .text-lg {\n    font-size: var(--text-lg);\n    line-height: var(--tw-leading, var(--text-lg--line-height));\n  }\n  .text-sm {\n    font-size: var(--text-sm);\n    line-height: var(--tw-leading, var(--text-sm--line-height));\n  }\n  .text-xl {\n    font-size: var(--text-xl);\n    line-height: var(--tw-leading, var(--text-xl--line-height));\n  }\n  .text-xs {\n    font-size: var(--text-xs);\n    line-height: var(--tw-leading, var(--text-xs--line-height));\n  }\n  .text-\\[0\\.6rem\\] {\n    font-size: 0.6rem;\n  }\n  .text-\\[10px\\] {\n    font-size: 10px;\n  }\n  .text-\\[16px\\] {\n    font-size: 16px;\n  }\n  .leading-\\[22px\\] {\n    --tw-leading: 22px;\n    line-height: 22px;\n  }\n  .leading-none {\n    --tw-leading: 1;\n    line-height: 1;\n  }\n  .font-bold {\n    --tw-font-weight: var(--font-weight-bold);\n    font-weight: var(--font-weight-bold);\n  }\n  .font-medium {\n    --tw-font-weight: var(--font-weight-medium);\n    font-weight: var(--font-weight-medium);\n  }\n  .text-balance {\n    text-wrap: balance;\n  }\n  .text-ellipsis {\n    text-overflow: ellipsis;\n  }\n  .whitespace-normal {\n    white-space: normal;\n  }\n  .text-amber-600 {\n    color: var(--color-amber-600);\n  }\n  .text-gray-500 {\n    color: var(--color-gray-500);\n  }\n  .text-gray-600 {\n    color: var(--color-gray-600);\n  }\n  .text-green-600 {\n    color: var(--color-green-600);\n  }\n  .text-orange-600 {\n    color: var(--color-orange-600);\n  }\n  .text-red-600 {\n    color: var(--color-red-600);\n  }\n  .text-slate-200 {\n    color: var(--color-slate-200);\n  }\n  .text-white {\n    color: var(--color-white);\n  }\n  .text-yellow-600 {\n    color: var(--color-yellow-600);\n  }\n  .text-zinc-400 {\n    color: var(--color-zinc-400);\n  }\n  .uppercase {\n    text-transform: uppercase;\n  }\n  .line-through {\n    text-decoration-line: line-through;\n  }\n  .underline {\n    text-decoration-line: underline;\n  }\n  .antialiased {\n    -webkit-font-smoothing: antialiased;\n    -moz-osx-font-smoothing: grayscale;\n  }\n  .opacity-0 {\n    opacity: 0%;\n  }\n  .opacity-100 {\n    opacity: 100%;\n  }\n  .shadow {\n    --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n  }\n  .shadow-lg {\n    --tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / 0.1));\n    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n  }\n  .shadow-none {\n    --tw-shadow: 0 0 #0000;\n    box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);\n  }\n  .filter {\n    filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);\n  }\n  .backdrop-blur-sm {\n    --tw-backdrop-blur: blur(var(--blur-sm));\n    -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n    backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);\n  }\n  .transition-\\[min-height\\,max-height\\] {\n    transition-property: min-height,max-height;\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\n  }\n  .transition-all {\n    transition-property: all;\n    transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n    transition-duration: var(--tw-duration, var(--default-transition-duration));\n  }\n  .\\*\\:pointer-events-auto {\n    :is(& > *) {\n      pointer-events: auto;\n    }\n  }\n  .\\*\\:inline {\n    :is(& > *) {\n      display: inline;\n    }\n  }\n  .\\*\\:size-\\[46px\\] {\n    :is(& > *) {\n      width: 46px;\n      height: 46px;\n    }\n  }\n  .\\*\\:rounded-none {\n    :is(& > *) {\n      border-radius: 0;\n    }\n  }\n  .\\*\\:border-none {\n    :is(& > *) {\n      --tw-border-style: none;\n      border-style: none;\n    }\n  }\n  .\\*\\:not-last\\:border-b {\n    :is(& > *) {\n      &:not(*:last-child) {\n        border-bottom-style: var(--tw-border-style);\n        border-bottom-width: 1px;\n      }\n    }\n  }\n  .group-hover\\:bg-slate-50 {\n    &:is(:where(.group):hover *) {\n      @media (hover: hover) {\n        background-color: var(--color-slate-50);\n      }\n    }\n  }\n  .placeholder\\:text-zinc-400 {\n    &::placeholder {\n      color: var(--color-zinc-400);\n    }\n  }\n  .\\*\\:before\\:content-\\[\\\'_–\\\'\\] {\n    :is(& > *) {\n      &::before {\n        --tw-content: \' –\';\n        content: var(--tw-content);\n      }\n    }\n  }\n  .\\*\\:first\\:\\!rounded-l-2xl {\n    :is(& > *) {\n      &:first-child {\n        border-top-left-radius: var(--radius-2xl) !important;\n        border-bottom-left-radius: var(--radius-2xl) !important;\n      }\n    }\n  }\n  .\\*\\:first\\:font-semibold {\n    :is(& > *) {\n      &:first-child {\n        --tw-font-weight: var(--font-weight-semibold);\n        font-weight: var(--font-weight-semibold);\n      }\n    }\n  }\n  .\\*\\:first\\:before\\:\\!content-\\[_p\\] {\n    :is(& > *) {\n      &:first-child {\n        &::before {\n          content: var(--tw-content);\n          --tw-content:  p !important;\n          content: var(--tw-content) !important;\n        }\n      }\n    }\n  }\n  .last\\:border-0 {\n    &:last-child {\n      border-style: var(--tw-border-style);\n      border-width: 0px;\n    }\n  }\n  .\\*\\:last\\:\\!rounded-r-2xl {\n    :is(& > *) {\n      &:last-child {\n        border-top-right-radius: var(--radius-2xl) !important;\n        border-bottom-right-radius: var(--radius-2xl) !important;\n      }\n    }\n  }\n  .\\*\\:last\\:font-semibold {\n    :is(& > *) {\n      &:last-child {\n        --tw-font-weight: var(--font-weight-semibold);\n        font-weight: var(--font-weight-semibold);\n      }\n    }\n  }\n  .\\*\\:last\\:before\\:\\!content-\\[_p\\] {\n    :is(& > *) {\n      &:last-child {\n        &::before {\n          content: var(--tw-content);\n          --tw-content:  p !important;\n          content: var(--tw-content) !important;\n        }\n      }\n    }\n  }\n  .read-only\\:text-gray-400 {\n    &:read-only {\n      color: var(--color-gray-400);\n    }\n  }\n  .hover\\:border-black {\n    &:hover {\n      @media (hover: hover) {\n        border-color: var(--color-black);\n      }\n    }\n  }\n  .hover\\:bg-gray-700 {\n    &:hover {\n      @media (hover: hover) {\n        background-color: var(--color-gray-700);\n      }\n    }\n  }\n  .hover\\:bg-slate-100 {\n    &:hover {\n      @media (hover: hover) {\n        background-color: var(--color-slate-100);\n      }\n    }\n  }\n  .\\*\\*\\:hover\\:cursor-pointer {\n    :is(& *) {\n      &:hover {\n        @media (hover: hover) {\n          cursor: pointer;\n        }\n      }\n    }\n  }\n  .hover\\:not-disabled\\:cursor-pointer {\n    &:hover {\n      @media (hover: hover) {\n        &:not(*:disabled) {\n          cursor: pointer;\n        }\n      }\n    }\n  }\n  .disabled\\:cursor-default {\n    &:disabled {\n      cursor: default;\n    }\n  }\n  .\\@sm\\:top-0 {\n    @container (min-width: 24rem) {\n      top: calc(var(--spacing) * 0);\n    }\n  }\n  .\\@sm\\:left-\\[calc\\(100\\%-47px\\)\\] {\n    @container (min-width: 24rem) {\n      left: calc(100% - 47px);\n    }\n  }\n  .\\@sm\\/main\\:h-\\[36px\\] {\n    @container main (min-width: 24rem) {\n      height: 36px;\n    }\n  }\n  .\\@sm\\/main\\:rounded-l-none {\n    @container main (min-width: 24rem) {\n      border-top-left-radius: 0;\n      border-bottom-left-radius: 0;\n    }\n  }\n  .\\@sm\\/main\\:rounded-r-2xl {\n    @container main (min-width: 24rem) {\n      border-top-right-radius: var(--radius-2xl);\n      border-bottom-right-radius: var(--radius-2xl);\n    }\n  }\n  .\\@sm\\:rounded-r-none {\n    @container (min-width: 24rem) {\n      border-top-right-radius: 0;\n      border-bottom-right-radius: 0;\n    }\n  }\n  .\\@sm\\:border-r-0 {\n    @container (min-width: 24rem) {\n      border-right-style: var(--tw-border-style);\n      border-right-width: 0px;\n    }\n  }\n  .\\@sm\\:\\*\\:last\\:\\!rounded-r-none {\n    @container (min-width: 24rem) {\n      :is(& > *) {\n        &:last-child {\n          border-top-right-radius: 0 !important;\n          border-bottom-right-radius: 0 !important;\n        }\n      }\n    }\n  }\n  .\\@sm\\:\\*\\:last\\:border-r-0 {\n    @container (min-width: 24rem) {\n      :is(& > *) {\n        &:last-child {\n          border-right-style: var(--tw-border-style);\n          border-right-width: 0px;\n        }\n      }\n    }\n  }\n  .\\@md\\/main\\:h-\\[40px\\] {\n    @container main (min-width: 28rem) {\n      height: 40px;\n    }\n  }\n  .\\@lg\\:left-84 {\n    @container (min-width: 32rem) {\n      left: calc(var(--spacing) * 84);\n    }\n  }\n  .\\@lg\\/main\\:hidden {\n    @container main (min-width: 32rem) {\n      display: none;\n    }\n  }\n  .\\@lg\\:flex {\n    @container (min-width: 32rem) {\n      display: flex;\n    }\n  }\n  .\\@lg\\:hidden {\n    @container (min-width: 32rem) {\n      display: none;\n    }\n  }\n  .\\@lg\\:min-w-80 {\n    @container (min-width: 32rem) {\n      min-width: calc(var(--spacing) * 80);\n    }\n  }\n  .\\@lg\\/main\\:flex-row-reverse {\n    @container main (min-width: 32rem) {\n      flex-direction: row-reverse;\n    }\n  }\n  .\\@lg\\:transition-\\[width\\] {\n    @container (min-width: 32rem) {\n      transition-property: width;\n      transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));\n      transition-duration: var(--tw-duration, var(--default-transition-duration));\n    }\n  }\n}\n@layer base {\n  *, ::after, ::before, ::backdrop, ::file-selector-button {\n    border-color: var(--color-gray-200, currentColor);\n  }\n}\n::-webkit-scrollbar {\n  width: 3px;\n  height: 3px;\n}\n::-webkit-scrollbar-thumb {\n  background: lightgray;\n  z-index: 5;\n}\n::-webkit-scrollbar-track {\n  background: transparent;\n}\n@property --tw-rotate-x {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-rotate-y {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-rotate-z {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-skew-x {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-skew-y {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-space-y-reverse {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0;\n}\n@property --tw-space-x-reverse {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0;\n}\n@property --tw-border-style {\n  syntax: "*";\n  inherits: false;\n  initial-value: solid;\n}\n@property --tw-gradient-position {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-gradient-from {\n  syntax: "<color>";\n  inherits: false;\n  initial-value: #0000;\n}\n@property --tw-gradient-via {\n  syntax: "<color>";\n  inherits: false;\n  initial-value: #0000;\n}\n@property --tw-gradient-to {\n  syntax: "<color>";\n  inherits: false;\n  initial-value: #0000;\n}\n@property --tw-gradient-stops {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-gradient-via-stops {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-gradient-from-position {\n  syntax: "<length-percentage>";\n  inherits: false;\n  initial-value: 0%;\n}\n@property --tw-gradient-via-position {\n  syntax: "<length-percentage>";\n  inherits: false;\n  initial-value: 50%;\n}\n@property --tw-gradient-to-position {\n  syntax: "<length-percentage>";\n  inherits: false;\n  initial-value: 100%;\n}\n@property --tw-leading {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-font-weight {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-shadow {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0 0 #0000;\n}\n@property --tw-shadow-color {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-shadow-alpha {\n  syntax: "<percentage>";\n  inherits: false;\n  initial-value: 100%;\n}\n@property --tw-inset-shadow {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0 0 #0000;\n}\n@property --tw-inset-shadow-color {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-inset-shadow-alpha {\n  syntax: "<percentage>";\n  inherits: false;\n  initial-value: 100%;\n}\n@property --tw-ring-color {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-ring-shadow {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0 0 #0000;\n}\n@property --tw-inset-ring-color {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-inset-ring-shadow {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0 0 #0000;\n}\n@property --tw-ring-inset {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-ring-offset-width {\n  syntax: "<length>";\n  inherits: false;\n  initial-value: 0px;\n}\n@property --tw-ring-offset-color {\n  syntax: "*";\n  inherits: false;\n  initial-value: #fff;\n}\n@property --tw-ring-offset-shadow {\n  syntax: "*";\n  inherits: false;\n  initial-value: 0 0 #0000;\n}\n@property --tw-blur {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-brightness {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-contrast {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-grayscale {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-hue-rotate {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-invert {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-opacity {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-saturate {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-sepia {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-drop-shadow {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-drop-shadow-color {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-drop-shadow-alpha {\n  syntax: "<percentage>";\n  inherits: false;\n  initial-value: 100%;\n}\n@property --tw-drop-shadow-size {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-blur {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-brightness {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-contrast {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-grayscale {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-hue-rotate {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-invert {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-opacity {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-saturate {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-backdrop-sepia {\n  syntax: "*";\n  inherits: false;\n}\n@property --tw-content {\n  syntax: "*";\n  initial-value: "";\n  inherits: false;\n}\n@keyframes pulse {\n  50% {\n    opacity: 0.5;\n  }\n}\n@layer properties {\n  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {\n    *, ::before, ::after, ::backdrop {\n      --tw-rotate-x: initial;\n      --tw-rotate-y: initial;\n      --tw-rotate-z: initial;\n      --tw-skew-x: initial;\n      --tw-skew-y: initial;\n      --tw-space-y-reverse: 0;\n      --tw-space-x-reverse: 0;\n      --tw-border-style: solid;\n      --tw-gradient-position: initial;\n      --tw-gradient-from: #0000;\n      --tw-gradient-via: #0000;\n      --tw-gradient-to: #0000;\n      --tw-gradient-stops: initial;\n      --tw-gradient-via-stops: initial;\n      --tw-gradient-from-position: 0%;\n      --tw-gradient-via-position: 50%;\n      --tw-gradient-to-position: 100%;\n      --tw-leading: initial;\n      --tw-font-weight: initial;\n      --tw-shadow: 0 0 #0000;\n      --tw-shadow-color: initial;\n      --tw-shadow-alpha: 100%;\n      --tw-inset-shadow: 0 0 #0000;\n      --tw-inset-shadow-color: initial;\n      --tw-inset-shadow-alpha: 100%;\n      --tw-ring-color: initial;\n      --tw-ring-shadow: 0 0 #0000;\n      --tw-inset-ring-color: initial;\n      --tw-inset-ring-shadow: 0 0 #0000;\n      --tw-ring-inset: initial;\n      --tw-ring-offset-width: 0px;\n      --tw-ring-offset-color: #fff;\n      --tw-ring-offset-shadow: 0 0 #0000;\n      --tw-blur: initial;\n      --tw-brightness: initial;\n      --tw-contrast: initial;\n      --tw-grayscale: initial;\n      --tw-hue-rotate: initial;\n      --tw-invert: initial;\n      --tw-opacity: initial;\n      --tw-saturate: initial;\n      --tw-sepia: initial;\n      --tw-drop-shadow: initial;\n      --tw-drop-shadow-color: initial;\n      --tw-drop-shadow-alpha: 100%;\n      --tw-drop-shadow-size: initial;\n      --tw-backdrop-blur: initial;\n      --tw-backdrop-brightness: initial;\n      --tw-backdrop-contrast: initial;\n      --tw-backdrop-grayscale: initial;\n      --tw-backdrop-hue-rotate: initial;\n      --tw-backdrop-invert: initial;\n      --tw-backdrop-opacity: initial;\n      --tw-backdrop-saturate: initial;\n      --tw-backdrop-sepia: initial;\n      --tw-content: "";\n    }\n  }\n}\n';function zN(e){let t=Pu(),[r,i]=Eu(),[n,a]=Eu(!1),[s,o]=Eu(!1),[l,h]=Eu(!1),[A,u]=Eu(!1),[c,d]=Eu(!1),[p,f]=Eu(!1),[g,m]=Eu(!1),[y,_]=Eu(!1),[v,w]=Eu(!1),[b,x]=Eu(!1),[B,C]=Eu(!1),[S,E]=Eu(!1),[I,T]=Eu(!1),[F,P]=Eu(!1),[L,M]=Eu(!1),[k,U]=Eu(!1),[R,D]=Eu(!1),[N,O]=Eu(!1),[Q,z]=Eu(!1),[H,j]=Eu(!1),[V,G]=Eu(!1),[K,q]=Eu(),[Z,W]=Eu(),[$,X]=Eu(),[Y,J]=Eu(),[ee,te]=Eu(),[re,ie]=Eu(),[ne,ae]=Eu(),[se,oe]=Eu(),[le,he]=Eu(),[Ae,ue]=Eu(),[ce,de]=Eu([]),[pe,fe]=Eu([]),[ge,me]=Eu(null),[ye,_e]=Eu([]),[ve,we]=Eu(),[be,xe]=Eu(),{lang:Be,layers:Ce}=e;IN(se,Ce);let Se=Mu((()=>({...e,baseLayer:r,featuresInfos:ce,featuresInfosHovered:pe,hasDetails:p,hasGeolocation:A,hasLayerTree:k,hasLnp:c,hasMapset:g,hasNotification:y,hasPermalink:v,hasPrint:b,hasRealtime:B,hasSearch:S,hasShare:L,hasStations:I,hasToolbar:F,isEmbed:l,isExportMenuOpen:N,isFollowing:n,isLayerTreeOpen:H,isOverlayOpen:R,isSearchOpen:V,isShareMenuOpen:Q,isTracking:s,linesNetworkPlanLayer:ne,map:se,mapsetLayer:re,notificationsLayer:ee,permalinkUrlSearchParams:ve,previewNotifications:be,realtimeLayer:Y,selectedFeature:ge,selectedFeatures:ye,setBaseLayer:i,setFeaturesInfos:de,setFeaturesInfosHovered:fe,setHasDetails:f,setHasGeolocation:u,setHasLayerTree:U,setHasLnp:d,setHasMapset:m,setHasNotification:_,setHasPermalink:w,setHasPrint:x,setHasRealtime:C,setHasSearch:E,setHasShare:M,setHasStations:T,setHasToolbar:P,setIsEmbed:h,setIsExportMenuOpen:O,setIsFollowing:a,setIsLayerTreeOpen:j,setIsOverlayOpen:D,setIsSearchOpen:G,setIsShareMenuOpen:z,setIsTracking:o,setLinesNetworkPlanLayer:ae,setMap:oe,setMapsetLayer:ie,setNotificationsLayer:te,setPermalinkUrlSearchParams:we,setPreviewNotifications:xe,setRealtimeLayer:J,setSelectedFeature:me,setSelectedFeatures:_e,setStation:X,setStationId:he,setStationsLayer:W,setStopSequence:q,setTrainId:ue,station:$,stationId:le,stationsLayer:Z,stopSequence:K,trainId:Ae})),[e,r,ce,pe,p,I,A,k,c,g,y,v,b,B,S,L,F,l,N,n,H,R,V,Q,s,ne,se,ee,re,ve,be,Y,ge,ye,$,le,Z,K,Ae]);return Tu((()=>{MN.locale(Be)}),[Be]),kF(mP.Provider,{value:MN,children:[kF("style",{children:":host {\n            --tw-divide-y-reverse: 0;\n            --tw-border-style: solid;\n            --tw-font-weight: initial;\n            --tw-tracking: initial;\n            --tw-translate-x: 0;\n            --tw-translate-y: 0;\n            --tw-translate-z: 0;\n            --tw-rotate-x: rotateX(0);\n            --tw-rotate-y: rotateY(0);\n            --tw-rotate-z: rotateZ(0);\n            --tw-skew-x: skewX(0);\n            --tw-skew-y: skewY(0);\n            --tw-space-x-reverse: 0;\n            --tw-gradient-position: initial;\n            --tw-gradient-from: #0000;\n            --tw-gradient-via: #0000;\n            --tw-gradient-to: #0000;\n            --tw-gradient-stops: initial;\n            --tw-gradient-via-stops: initial;\n            --tw-gradient-from-position: 0%;\n            --tw-gradient-via-position: 50%;\n            --tw-gradient-to-position: 100%;\n            --tw-shadow: 0 0 #0000;\n            --tw-shadow-color: initial;\n            --tw-inset-shadow: 0 0 #0000;\n            --tw-inset-shadow-color: initial;\n            --tw-ring-color: initial;\n            --tw-ring-shadow: 0 0 #0000;\n            --tw-inset-ring-color: initial;\n            --tw-inset-ring-shadow: 0 0 #0000;\n            --tw-ring-inset: initial;\n            --tw-ring-offset-width: 0px;\n            --tw-ring-offset-color: #fff;\n            --tw-ring-offset-shadow: 0 0 #0000;\n            --tw-blur: initial;\n            --tw-brightness: initial;\n            --tw-contrast: initial;\n            --tw-grayscale: initial;\n            --tw-hue-rotate: initial;\n            --tw-invert: initial;\n            --tw-opacity: initial;\n            --tw-saturate: initial;\n            --tw-sepia: initial;\n            --tw-drop-shadow: initial;\n            --tw-duration: initial;\n            --tw-ease: initial;\n        }"}),kF("style",{children:QN}),kF("style",{children:""}),kF(lT.Provider,{value:Se,children:[kF(cT,{}),kF(mN,{replaceState:v}),kF(ET,{node:t.current,wcAttributes:e}),kF(UN,{eventNode:t.current}),kF(BN,{}),kF(uT,{}),kF(AT,{}),y&&kF(pN,{}),B&&kF(bN,{}),I&&kF(CN,{}),c&&kF(bT,{}),g&&kF(dN,{}),kF("div",{className:"@container/main relative size-full border font-sans",ref:t,children:kF(cN,{})})]})]})}var HN={};Object.entries(ON).forEach((([e])=>{HN[e]=ON[e].defaultValue||null}));var jN=ec((function(e){let{permalinktemplate:t}=e,{permalinktemplate:r}=HN,i=TN(t||r);return kF(zN,{...HN,...e,...i})})),VN='<a href="https://developer.geops.io/apis/stops">geOps Stops API</a>',GN={apikey:{description:'Your <a href="https://developer.geops.io/">geOps API key</a>'},bbox:{description:`The extent where to search the stops (minx,miny,maxx,maxy). See the ${VN} documentation.`},countrycode:{description:"The country code to filter the results (IT, DE, CH ...)"},event:{defaultValue:"mwc:stopssearchselect",description:"The event's name to listen to when a stop is selected."},field:{description:`Which field to look up, default all of them, Possible values:id, name, coords. See the ${VN} documentation.`},limit:{defaultValue:"5",description:`The number of suggestions to show. See the ${VN} documentation.`},mots:{description:`Commas separated list of mots used to filter the results (rail, bus, coach, foot, tram, subway, gondola, funicular, ferry, car). See the ${VN} documentation.`},onselect:{description:null},params:{description:`JSON string with additional parameters to pass to the request to the API. Ex: {"{ 'key': 'value' }"}. See the ${VN} documentation.`},prefagencies:{description:`comma seperated list, order chooses which agency will be preferred as\n        ident_source (for id and code fields). Possible values: sbb, db. See the ${VN} documentation.`},reflocation:{description:`Coordinates in WGS84 (in lat,lon order) used to rank stops close to this position higher. See the ${VN} documentation.`},url:{defaultValue:"https://api.geops.io/stops/v1/",description:`The URL to the ${VN}.`}};function KN(e){return kF(mP.Provider,{value:MN,children:[kF("style",{children:QN}),kF(kD,{...e})]})}var qN={};Object.entries(GN).forEach((([e])=>{qN[e]=GN[e].defaultValue||null}));var ZN=ec((function(e){return kF(KN,{...qN,...e})}));au(jN,"geops-mobility",Object.keys(ON),{mode:"open",shadow:!0}),au(ZN,"geops-mobility-search",Object.keys(GN),{mode:"open",shadow:!0})})();
/*! Bundled license information:

maplibre-gl/dist/maplibre-gl.js:
  (**
   * MapLibre GL JS
   * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v5.8.0/LICENSE.txt
   *)

lodash/lodash.js:
  (**
   * @license
   * Lodash <https://lodash.com/>
   * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
   * Released under MIT license <https://lodash.com/license>
   * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
   * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
   *)

pako/dist/pako.esm.mjs:
  (*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)

html2canvas/dist/html2canvas.js:
  (*!
   * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
   * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
   * Released under MIT License
   *)
  (*! *****************************************************************************
      Copyright (c) Microsoft Corporation.
  
      Permission to use, copy, modify, and/or distribute this software for any
      purpose with or without fee is hereby granted.
  
      THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
      REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
      AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
      INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
      LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
      OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
      PERFORMANCE OF THIS SOFTWARE.
      ***************************************************************************** *)

dompurify/dist/purify.es.mjs:
  (*! @license DOMPurify 3.2.7 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.7/LICENSE *)

svg-pathdata/lib/SVGPathData.module.js:
  (*! *****************************************************************************
  Copyright (c) Microsoft Corporation.
  
  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted.
  
  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
  REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
  INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  PERFORMANCE OF THIS SOFTWARE.
  ***************************************************************************** *)

jspdf/dist/jspdf.es.min.js:
  (** @license
   *
   * jsPDF - PDF Document creation from JavaScript
   * Version 3.0.3 Built on 2025-09-18T08:03:54.261Z
   *                      CommitID 00000000
   *
   * Copyright (c) 2010-2025 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
   *               2015-2025 yWorks GmbH, http://www.yworks.com
   *               2015-2025 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
   *               2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
   *               2010 Aaron Spike, https://github.com/acspike
   *               2012 Willow Systems Corporation, https://github.com/willowsystems
   *               2012 Pablo Hess, https://github.com/pablohess
   *               2012 Florian Jenett, https://github.com/fjenett
   *               2013 Warren Weckesser, https://github.com/warrenweckesser
   *               2013 Youssef Beddad, https://github.com/lifof
   *               2013 Lee Driscoll, https://github.com/lsdriscoll
   *               2013 Stefan Slonevskiy, https://github.com/stefslon
   *               2013 Jeremy Morel, https://github.com/jmorel
   *               2013 Christoph Hartmann, https://github.com/chris-rock
   *               2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
   *               2014 James Makes, https://github.com/dollaruw
   *               2014 Diego Casorran, https://github.com/diegocr
   *               2014 Steven Spungin, https://github.com/Flamenco
   *               2014 Kenneth Glassey, https://github.com/Gavvers
   *
   * Permission is hereby granted, free of charge, to any person obtaining
   * a copy of this software and associated documentation files (the
   * "Software"), to deal in the Software without restriction, including
   * without limitation the rights to use, copy, modify, merge, publish,
   * distribute, sublicense, and/or sell copies of the Software, and to
   * permit persons to whom the Software is furnished to do so, subject to
   * the following conditions:
   *
   * The above copyright notice and this permission notice shall be
   * included in all copies or substantial portions of the Software.
   *
   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
   * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
   * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
   * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
   * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
   * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
   * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
   *
   * Contributor(s):
   *    siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
   *    kim3er, mfo, alnorth, Flamenco
   *)
  (**
   * A class to parse color values
   * @author Stoyan Stefanov <sstoo@gmail.com>
   * {@link   http://www.phpied.com/rgb-color-parser-in-javascript/}
   * @license Use it if you like it
   *)
  (**
   * @license
   * Joseph Myers does not specify a particular license for his work.
   *
   * Author: Joseph Myers
   * Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
   *
   * Modified by: Owen Leong
   *)
  (**
   * @license
   * FPDF is released under a permissive license: there is no usage restriction.
   * You may embed it freely in your application (commercial or not), with or
   * without modifications.
   *
   * Reference: http://www.fpdf.org/en/script/script37.php
   *)
  (**
   * @license
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   * Author: Owen Leong (@owenl131)
   * Date: 15 Oct 2020
   * References:
   * https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
   * https://github.com/foliojs/pdfkit/blob/master/lib/security.js
   * http://www.fpdf.org/en/script/script37.php
   *)
  (**
   * @license
    Copyright (c) 2008, Adobe Systems Incorporated
    All rights reserved.
  
    Redistribution and use in source and binary forms, with or without 
    modification, are permitted provided that the following conditions are
    met:
  
    * Redistributions of source code must retain the above copyright notice, 
      this list of conditions and the following disclaimer.
    
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the 
      documentation and/or other materials provided with the distribution.
    
    * Neither the name of Adobe Systems Incorporated nor the names of its 
      contributors may be used to endorse or promote products derived from 
      this software without specific prior written permission.
  
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 
    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *)
  (**
   * @license
   * Copyright (c) 2017 Aras Abbasi
   *
   * Licensed under the MIT License.
   * http://opensource.org/licenses/mit-license
   *)
*/
//# sourceMappingURL=/sm/b2a7d96674b187437c9a114789d58d80c02c24c44c35c1d0d5e9cce5e0eec9f5.map