(function(P,An){typeof exports=="object"&&typeof module<"u"?module.exports=An(require("vue")):typeof define=="function"&&define.amd?define(["vue"],An):(P=typeof globalThis<"u"?globalThis:P||self,P.bi=An(P.Vue))})(this,function(P){"use strict";var Q_e=Object.defineProperty;var e0e=(P,An,rs)=>An in P?Q_e(P,An,{enumerable:!0,configurable:!0,writable:!0,value:rs}):P[An]=rs;var bn=(P,An,rs)=>e0e(P,typeof An!="symbol"?An+"":An,rs);function An(r,e){return r!=null&&r.value?isNaN(r==null?void 0:r.value)?r==null?void 0:r.value:new Intl.NumberFormat("en",e||{notation:"compact"}).format(r==null?void 0:r.value):isNaN(r)?r:new Intl.NumberFormat("en",e||{notation:"compact"}).format(r)}function rs(r){if(!(r!=null&&r.includes("T")))return r;const[e,t,n]=r.split("T")[0].split("-");return`${n}.${t}.${e}`}function PG(r){return Intl.NumberFormat("en").format(r)}function ED(r,e){return function(){return r.apply(e,arguments)}}const{toString:RG}=Object.prototype,{getPrototypeOf:ox}=Object,{iterator:_m,toStringTag:CD}=Symbol,bm=(r=>e=>{const t=RG.call(e);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())})(Object.create(null)),Ro=r=>(r=r.toLowerCase(),e=>bm(e)===r),xm=r=>e=>typeof e===r,{isArray:Vh}=Array,ep=xm("undefined");function NG(r){return r!==null&&!ep(r)&&r.constructor!==null&&!ep(r.constructor)&&ya(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const AD=Ro("ArrayBuffer");function OG(r){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(r):e=r&&r.buffer&&AD(r.buffer),e}const zG=xm("string"),ya=xm("function"),DD=xm("number"),wm=r=>r!==null&&typeof r=="object",BG=r=>r===!0||r===!1,Sm=r=>{if(bm(r)!=="object")return!1;const e=ox(r);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(CD in r)&&!(_m in r)},VG=Ro("Date"),FG=Ro("File"),$G=Ro("Blob"),GG=Ro("FileList"),UG=r=>wm(r)&&ya(r.pipe),HG=r=>{let e;return r&&(typeof FormData=="function"&&r instanceof FormData||ya(r.append)&&((e=bm(r))==="formdata"||e==="object"&&ya(r.toString)&&r.toString()==="[object FormData]"))},WG=Ro("URLSearchParams"),[qG,ZG,jG,XG]=["ReadableStream","Request","Response","Headers"].map(Ro),YG=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function tp(r,e,{allOwnKeys:t=!1}={}){if(r===null||typeof r>"u")return;let n,i;if(typeof r!="object"&&(r=[r]),Vh(r))for(n=0,i=r.length;n0;)if(i=t[n],e===i.toLowerCase())return i;return null}const Gu=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ID=r=>!ep(r)&&r!==Gu;function sx(){const{caseless:r}=ID(this)&&this||{},e={},t=(n,i)=>{const a=r&&MD(e,i)||i;Sm(e[a])&&Sm(n)?e[a]=sx(e[a],n):Sm(n)?e[a]=sx({},n):Vh(n)?e[a]=n.slice():e[a]=n};for(let n=0,i=arguments.length;n(tp(e,(i,a)=>{t&&ya(i)?r[a]=ED(i,t):r[a]=i},{allOwnKeys:n}),r),JG=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),QG=(r,e,t,n)=>{r.prototype=Object.create(e.prototype,n),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:e.prototype}),t&&Object.assign(r.prototype,t)},eU=(r,e,t,n)=>{let i,a,o;const s={};if(e=e||{},r==null)return e;do{for(i=Object.getOwnPropertyNames(r),a=i.length;a-- >0;)o=i[a],(!n||n(o,r,e))&&!s[o]&&(e[o]=r[o],s[o]=!0);r=t!==!1&&ox(r)}while(r&&(!t||t(r,e))&&r!==Object.prototype);return e},tU=(r,e,t)=>{r=String(r),(t===void 0||t>r.length)&&(t=r.length),t-=e.length;const n=r.indexOf(e,t);return n!==-1&&n===t},rU=r=>{if(!r)return null;if(Vh(r))return r;let e=r.length;if(!DD(e))return null;const t=new Array(e);for(;e-- >0;)t[e]=r[e];return t},nU=(r=>e=>r&&e instanceof r)(typeof Uint8Array<"u"&&ox(Uint8Array)),iU=(r,e)=>{const n=(r&&r[_m]).call(r);let i;for(;(i=n.next())&&!i.done;){const a=i.value;e.call(r,a[0],a[1])}},aU=(r,e)=>{let t;const n=[];for(;(t=r.exec(e))!==null;)n.push(t);return n},oU=Ro("HTMLFormElement"),sU=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,n,i){return n.toUpperCase()+i}),kD=(({hasOwnProperty:r})=>(e,t)=>r.call(e,t))(Object.prototype),lU=Ro("RegExp"),LD=(r,e)=>{const t=Object.getOwnPropertyDescriptors(r),n={};tp(t,(i,a)=>{let o;(o=e(i,a,r))!==!1&&(n[a]=o||i)}),Object.defineProperties(r,n)},uU=r=>{LD(r,(e,t)=>{if(ya(r)&&["arguments","caller","callee"].indexOf(t)!==-1)return!1;const n=r[t];if(ya(n)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+t+"'")})}})},cU=(r,e)=>{const t={},n=i=>{i.forEach(a=>{t[a]=!0})};return Vh(r)?n(r):n(String(r).split(e)),t},hU=()=>{},dU=(r,e)=>r!=null&&Number.isFinite(r=+r)?r:e;function fU(r){return!!(r&&ya(r.append)&&r[CD]==="FormData"&&r[_m])}const pU=r=>{const e=new Array(10),t=(n,i)=>{if(wm(n)){if(e.indexOf(n)>=0)return;if(!("toJSON"in n)){e[i]=n;const a=Vh(n)?[]:{};return tp(n,(o,s)=>{const l=t(o,i+1);!ep(l)&&(a[s]=l)}),e[i]=void 0,a}}return n};return t(r,0)},gU=Ro("AsyncFunction"),vU=r=>r&&(wm(r)||ya(r))&&ya(r.then)&&ya(r.catch),PD=((r,e)=>r?setImmediate:e?((t,n)=>(Gu.addEventListener("message",({source:i,data:a})=>{i===Gu&&a===t&&n.length&&n.shift()()},!1),i=>{n.push(i),Gu.postMessage(t,"*")}))(`axios@${Math.random()}`,[]):t=>setTimeout(t))(typeof setImmediate=="function",ya(Gu.postMessage)),mU=typeof queueMicrotask<"u"?queueMicrotask.bind(Gu):typeof process<"u"&&process.nextTick||PD,We={isArray:Vh,isArrayBuffer:AD,isBuffer:NG,isFormData:HG,isArrayBufferView:OG,isString:zG,isNumber:DD,isBoolean:BG,isObject:wm,isPlainObject:Sm,isReadableStream:qG,isRequest:ZG,isResponse:jG,isHeaders:XG,isUndefined:ep,isDate:VG,isFile:FG,isBlob:$G,isRegExp:lU,isFunction:ya,isStream:UG,isURLSearchParams:WG,isTypedArray:nU,isFileList:GG,forEach:tp,merge:sx,extend:KG,trim:YG,stripBOM:JG,inherits:QG,toFlatObject:eU,kindOf:bm,kindOfTest:Ro,endsWith:tU,toArray:rU,forEachEntry:iU,matchAll:aU,isHTMLForm:oU,hasOwnProperty:kD,hasOwnProp:kD,reduceDescriptors:LD,freezeMethods:uU,toObjectSet:cU,toCamelCase:sU,noop:hU,toFiniteNumber:dU,findKey:MD,global:Gu,isContextDefined:ID,isSpecCompliantForm:fU,toJSONObject:pU,isAsyncFn:gU,isThenable:vU,setImmediate:PD,asap:mU,isIterable:r=>r!=null&&ya(r[_m])};function Er(r,e,t,n,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",e&&(this.code=e),t&&(this.config=t),n&&(this.request=n),i&&(this.response=i,this.status=i.status?i.status:null)}We.inherits(Er,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:We.toJSONObject(this.config),code:this.code,status:this.status}}});const RD=Er.prototype,ND={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{ND[r]={value:r}}),Object.defineProperties(Er,ND),Object.defineProperty(RD,"isAxiosError",{value:!0}),Er.from=(r,e,t,n,i,a)=>{const o=Object.create(RD);return We.toFlatObject(r,o,function(l){return l!==Error.prototype},s=>s!=="isAxiosError"),Er.call(o,r.message,e,t,n,i),o.cause=r,o.name=r.name,a&&Object.assign(o,a),o};const yU=null;function lx(r){return We.isPlainObject(r)||We.isArray(r)}function OD(r){return We.endsWith(r,"[]")?r.slice(0,-2):r}function zD(r,e,t){return r?r.concat(e).map(function(i,a){return i=OD(i),!t&&a?"["+i+"]":i}).join(t?".":""):e}function _U(r){return We.isArray(r)&&!r.some(lx)}const bU=We.toFlatObject(We,{},null,function(e){return/^is[A-Z]/.test(e)});function Tm(r,e,t){if(!We.isObject(r))throw new TypeError("target must be an object");e=e||new FormData,t=We.toFlatObject(t,{metaTokens:!0,dots:!1,indexes:!1},!1,function(x,w){return!We.isUndefined(w[x])});const n=t.metaTokens,i=t.visitor||d,a=t.dots,o=t.indexes,l=(t.Blob||typeof Blob<"u"&&Blob)&&We.isSpecCompliantForm(e);if(!We.isFunction(i))throw new TypeError("visitor must be a function");function u(_){if(_===null)return"";if(We.isDate(_))return _.toISOString();if(We.isBoolean(_))return _.toString();if(!l&&We.isBlob(_))throw new Er("Blob is not supported. Use a Buffer instead.");return We.isArrayBuffer(_)||We.isTypedArray(_)?l&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function d(_,x,w){let C=_;if(_&&!w&&typeof _=="object"){if(We.endsWith(x,"{}"))x=n?x:x.slice(0,-2),_=JSON.stringify(_);else if(We.isArray(_)&&_U(_)||(We.isFileList(_)||We.endsWith(x,"[]"))&&(C=We.toArray(_)))return x=OD(x),C.forEach(function(L,O){!(We.isUndefined(L)||L===null)&&e.append(o===!0?zD([x],O,a):o===null?x:x+"[]",u(L))}),!1}return lx(_)?!0:(e.append(zD(w,x,a),u(_)),!1)}const f=[],g=Object.assign(bU,{defaultVisitor:d,convertValue:u,isVisitable:lx});function m(_,x){if(!We.isUndefined(_)){if(f.indexOf(_)!==-1)throw Error("Circular reference detected in "+x.join("."));f.push(_),We.forEach(_,function(C,A){(!(We.isUndefined(C)||C===null)&&i.call(e,C,We.isString(A)?A.trim():A,x,g))===!0&&m(C,x?x.concat(A):[A])}),f.pop()}}if(!We.isObject(r))throw new TypeError("data must be an object");return m(r),e}function BD(r){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(n){return e[n]})}function ux(r,e){this._pairs=[],r&&Tm(r,this,e)}const VD=ux.prototype;VD.append=function(e,t){this._pairs.push([e,t])},VD.toString=function(e){const t=e?function(n){return e.call(this,n,BD)}:BD;return this._pairs.map(function(i){return t(i[0])+"="+t(i[1])},"").join("&")};function xU(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function FD(r,e,t){if(!e)return r;const n=t&&t.encode||xU;We.isFunction(t)&&(t={serialize:t});const i=t&&t.serialize;let a;if(i?a=i(e,t):a=We.isURLSearchParams(e)?e.toString():new ux(e,t).toString(n),a){const o=r.indexOf("#");o!==-1&&(r=r.slice(0,o)),r+=(r.indexOf("?")===-1?"?":"&")+a}return r}class $D{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:n?n.synchronous:!1,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){We.forEach(this.handlers,function(n){n!==null&&e(n)})}}const GD={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},wU={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:ux,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},cx=typeof window<"u"&&typeof document<"u",hx=typeof navigator=="object"&&navigator||void 0,SU=cx&&(!hx||["ReactNative","NativeScript","NS"].indexOf(hx.product)<0),TU=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",EU=cx&&window.location.href||"http://localhost",Pi={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:cx,hasStandardBrowserEnv:SU,hasStandardBrowserWebWorkerEnv:TU,navigator:hx,origin:EU},Symbol.toStringTag,{value:"Module"})),...wU};function CU(r,e){return Tm(r,new Pi.classes.URLSearchParams,Object.assign({visitor:function(t,n,i,a){return Pi.isNode&&We.isBuffer(t)?(this.append(n,t.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},e))}function AU(r){return We.matchAll(/\w+|\[(\w*)]/g,r).map(e=>e[0]==="[]"?"":e[1]||e[0])}function DU(r){const e={},t=Object.keys(r);let n;const i=t.length;let a;for(n=0;n=t.length;return o=!o&&We.isArray(i)?i.length:o,l?(We.hasOwnProp(i,o)?i[o]=[i[o],n]:i[o]=n,!s):((!i[o]||!We.isObject(i[o]))&&(i[o]=[]),e(t,n,i[o],a)&&We.isArray(i[o])&&(i[o]=DU(i[o])),!s)}if(We.isFormData(r)&&We.isFunction(r.entries)){const t={};return We.forEachEntry(r,(n,i)=>{e(AU(n),i,t,0)}),t}return null}function MU(r,e,t){if(We.isString(r))try{return(e||JSON.parse)(r),We.trim(r)}catch(n){if(n.name!=="SyntaxError")throw n}return(t||JSON.stringify)(r)}const rp={transitional:GD,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",i=n.indexOf("application/json")>-1,a=We.isObject(e);if(a&&We.isHTMLForm(e)&&(e=new FormData(e)),We.isFormData(e))return i?JSON.stringify(UD(e)):e;if(We.isArrayBuffer(e)||We.isBuffer(e)||We.isStream(e)||We.isFile(e)||We.isBlob(e)||We.isReadableStream(e))return e;if(We.isArrayBufferView(e))return e.buffer;if(We.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(a){if(n.indexOf("application/x-www-form-urlencoded")>-1)return CU(e,this.formSerializer).toString();if((s=We.isFileList(e))||n.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return Tm(s?{"files[]":e}:e,l&&new l,this.formSerializer)}}return a||i?(t.setContentType("application/json",!1),MU(e)):e}],transformResponse:[function(e){const t=this.transitional||rp.transitional,n=t&&t.forcedJSONParsing,i=this.responseType==="json";if(We.isResponse(e)||We.isReadableStream(e))return e;if(e&&We.isString(e)&&(n&&!this.responseType||i)){const o=!(t&&t.silentJSONParsing)&&i;try{return JSON.parse(e)}catch(s){if(o)throw s.name==="SyntaxError"?Er.from(s,Er.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Pi.classes.FormData,Blob:Pi.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};We.forEach(["delete","get","head","post","put","patch"],r=>{rp.headers[r]={}});const IU=We.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kU=r=>{const e={};let t,n,i;return r&&r.split(` `).forEach(function(o){i=o.indexOf(":"),t=o.substring(0,i).trim().toLowerCase(),n=o.substring(i+1).trim(),!(!t||e[t]&&IU[t])&&(t==="set-cookie"?e[t]?e[t].push(n):e[t]=[n]:e[t]=e[t]?e[t]+", "+n:n)}),e},HD=Symbol("internals");function np(r){return r&&String(r).trim().toLowerCase()}function Em(r){return r===!1||r==null?r:We.isArray(r)?r.map(Em):String(r)}function LU(r){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=t.exec(r);)e[n[1]]=n[2];return e}const PU=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function dx(r,e,t,n,i){if(We.isFunction(n))return n.call(this,e,t);if(i&&(e=t),!!We.isString(e)){if(We.isString(n))return e.indexOf(n)!==-1;if(We.isRegExp(n))return n.test(e)}}function RU(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}function NU(r,e){const t=We.toCamelCase(" "+e);["get","set","has"].forEach(n=>{Object.defineProperty(r,n+t,{value:function(i,a,o){return this[n].call(this,e,i,a,o)},configurable:!0})})}let _a=class{constructor(e){e&&this.set(e)}set(e,t,n){const i=this;function a(s,l,u){const d=np(l);if(!d)throw new Error("header name must be a non-empty string");const f=We.findKey(i,d);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||l]=Em(s))}const o=(s,l)=>We.forEach(s,(u,d)=>a(u,d,l));if(We.isPlainObject(e)||e instanceof this.constructor)o(e,t);else if(We.isString(e)&&(e=e.trim())&&!PU(e))o(kU(e),t);else if(We.isObject(e)&&We.isIterable(e)){let s={},l,u;for(const d of e){if(!We.isArray(d))throw TypeError("Object iterator must return a key-value pair");s[u=d[0]]=(l=s[u])?We.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}o(s,t)}else e!=null&&a(t,e,n);return this}get(e,t){if(e=np(e),e){const n=We.findKey(this,e);if(n){const i=this[n];if(!t)return i;if(t===!0)return LU(i);if(We.isFunction(t))return t.call(this,i,n);if(We.isRegExp(t))return t.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=np(e),e){const n=We.findKey(this,e);return!!(n&&this[n]!==void 0&&(!t||dx(this,this[n],n,t)))}return!1}delete(e,t){const n=this;let i=!1;function a(o){if(o=np(o),o){const s=We.findKey(n,o);s&&(!t||dx(n,n[s],s,t))&&(delete n[s],i=!0)}}return We.isArray(e)?e.forEach(a):a(e),i}clear(e){const t=Object.keys(this);let n=t.length,i=!1;for(;n--;){const a=t[n];(!e||dx(this,this[a],a,e,!0))&&(delete this[a],i=!0)}return i}normalize(e){const t=this,n={};return We.forEach(this,(i,a)=>{const o=We.findKey(n,a);if(o){t[o]=Em(i),delete t[a];return}const s=e?RU(a):String(a).trim();s!==a&&delete t[a],t[s]=Em(i),n[s]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return We.forEach(this,(n,i)=>{n!=null&&n!==!1&&(t[i]=e&&We.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(i=>n.set(i)),n}static accessor(e){const n=(this[HD]=this[HD]={accessors:{}}).accessors,i=this.prototype;function a(o){const s=np(o);n[s]||(NU(i,o),n[s]=!0)}return We.isArray(e)?e.forEach(a):a(e),this}};_a.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),We.reduceDescriptors(_a.prototype,({value:r},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>r,set(n){this[t]=n}}}),We.freezeMethods(_a);function fx(r,e){const t=this||rp,n=e||t,i=_a.from(n.headers);let a=n.data;return We.forEach(r,function(s){a=s.call(t,a,i.normalize(),e?e.status:void 0)}),i.normalize(),a}function WD(r){return!!(r&&r.__CANCEL__)}function Fh(r,e,t){Er.call(this,r??"canceled",Er.ERR_CANCELED,e,t),this.name="CanceledError"}We.inherits(Fh,Er,{__CANCEL__:!0});function qD(r,e,t){const n=t.config.validateStatus;!t.status||!n||n(t.status)?r(t):e(new Er("Request failed with status code "+t.status,[Er.ERR_BAD_REQUEST,Er.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function OU(r){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(r);return e&&e[1]||""}function zU(r,e){r=r||10;const t=new Array(r),n=new Array(r);let i=0,a=0,o;return e=e!==void 0?e:1e3,function(l){const u=Date.now(),d=n[a];o||(o=u),t[i]=l,n[i]=u;let f=a,g=0;for(;f!==i;)g+=t[f++],f=f%r;if(i=(i+1)%r,i===a&&(a=(a+1)%r),u-o{t=d,i=null,a&&(clearTimeout(a),a=null),r.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-t;f>=n?o(u,d):(i=u,a||(a=setTimeout(()=>{a=null,o(i)},n-f)))},()=>i&&o(i)]}const Cm=(r,e,t=3)=>{let n=0;const i=zU(50,250);return BU(a=>{const o=a.loaded,s=a.lengthComputable?a.total:void 0,l=o-n,u=i(l),d=o<=s;n=o;const f={loaded:o,total:s,progress:s?o/s:void 0,bytes:l,rate:u||void 0,estimated:u&&s&&d?(s-o)/u:void 0,event:a,lengthComputable:s!=null,[e?"download":"upload"]:!0};r(f)},t)},ZD=(r,e)=>{const t=r!=null;return[n=>e[0]({lengthComputable:t,total:r,loaded:n}),e[1]]},jD=r=>(...e)=>We.asap(()=>r(...e)),VU=Pi.hasStandardBrowserEnv?((r,e)=>t=>(t=new URL(t,Pi.origin),r.protocol===t.protocol&&r.host===t.host&&(e||r.port===t.port)))(new URL(Pi.origin),Pi.navigator&&/(msie|trident)/i.test(Pi.navigator.userAgent)):()=>!0,FU=Pi.hasStandardBrowserEnv?{write(r,e,t,n,i,a){const o=[r+"="+encodeURIComponent(e)];We.isNumber(t)&&o.push("expires="+new Date(t).toGMTString()),We.isString(n)&&o.push("path="+n),We.isString(i)&&o.push("domain="+i),a===!0&&o.push("secure"),document.cookie=o.join("; ")},read(r){const e=document.cookie.match(new RegExp("(^|;\\s*)("+r+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(r){this.write(r,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function $U(r){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(r)}function GU(r,e){return e?r.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):r}function XD(r,e,t){let n=!$U(e);return r&&(n||t==!1)?GU(r,e):e}const YD=r=>r instanceof _a?{...r}:r;function Uu(r,e){e=e||{};const t={};function n(u,d,f,g){return We.isPlainObject(u)&&We.isPlainObject(d)?We.merge.call({caseless:g},u,d):We.isPlainObject(d)?We.merge({},d):We.isArray(d)?d.slice():d}function i(u,d,f,g){if(We.isUndefined(d)){if(!We.isUndefined(u))return n(void 0,u,f,g)}else return n(u,d,f,g)}function a(u,d){if(!We.isUndefined(d))return n(void 0,d)}function o(u,d){if(We.isUndefined(d)){if(!We.isUndefined(u))return n(void 0,u)}else return n(void 0,d)}function s(u,d,f){if(f in e)return n(u,d);if(f in r)return n(void 0,u)}const l={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(u,d,f)=>i(YD(u),YD(d),f,!0)};return We.forEach(Object.keys(Object.assign({},r,e)),function(d){const f=l[d]||i,g=f(r[d],e[d],d);We.isUndefined(g)&&f!==s||(t[d]=g)}),t}const KD=r=>{const e=Uu({},r);let{data:t,withXSRFToken:n,xsrfHeaderName:i,xsrfCookieName:a,headers:o,auth:s}=e;e.headers=o=_a.from(o),e.url=FD(XD(e.baseURL,e.url,e.allowAbsoluteUrls),r.params,r.paramsSerializer),s&&o.set("Authorization","Basic "+btoa((s.username||"")+":"+(s.password?unescape(encodeURIComponent(s.password)):"")));let l;if(We.isFormData(t)){if(Pi.hasStandardBrowserEnv||Pi.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if((l=o.getContentType())!==!1){const[u,...d]=l?l.split(";").map(f=>f.trim()).filter(Boolean):[];o.setContentType([u||"multipart/form-data",...d].join("; "))}}if(Pi.hasStandardBrowserEnv&&(n&&We.isFunction(n)&&(n=n(e)),n||n!==!1&&VU(e.url))){const u=i&&a&&FU.read(a);u&&o.set(i,u)}return e},UU=typeof XMLHttpRequest<"u"&&function(r){return new Promise(function(t,n){const i=KD(r);let a=i.data;const o=_a.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,d,f,g,m,_;function x(){m&&m(),_&&_(),i.cancelToken&&i.cancelToken.unsubscribe(d),i.signal&&i.signal.removeEventListener("abort",d)}let w=new XMLHttpRequest;w.open(i.method.toUpperCase(),i.url,!0),w.timeout=i.timeout;function C(){if(!w)return;const L=_a.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),V={data:!s||s==="text"||s==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:L,config:r,request:w};qD(function($){t($),x()},function($){n($),x()},V),w=null}"onloadend"in w?w.onloadend=C:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(C)},w.onabort=function(){w&&(n(new Er("Request aborted",Er.ECONNABORTED,r,w)),w=null)},w.onerror=function(){n(new Er("Network Error",Er.ERR_NETWORK,r,w)),w=null},w.ontimeout=function(){let O=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const V=i.transitional||GD;i.timeoutErrorMessage&&(O=i.timeoutErrorMessage),n(new Er(O,V.clarifyTimeoutError?Er.ETIMEDOUT:Er.ECONNABORTED,r,w)),w=null},a===void 0&&o.setContentType(null),"setRequestHeader"in w&&We.forEach(o.toJSON(),function(O,V){w.setRequestHeader(V,O)}),We.isUndefined(i.withCredentials)||(w.withCredentials=!!i.withCredentials),s&&s!=="json"&&(w.responseType=i.responseType),u&&([g,_]=Cm(u,!0),w.addEventListener("progress",g)),l&&w.upload&&([f,m]=Cm(l),w.upload.addEventListener("progress",f),w.upload.addEventListener("loadend",m)),(i.cancelToken||i.signal)&&(d=L=>{w&&(n(!L||L.type?new Fh(null,r,w):L),w.abort(),w=null)},i.cancelToken&&i.cancelToken.subscribe(d),i.signal&&(i.signal.aborted?d():i.signal.addEventListener("abort",d)));const A=OU(i.url);if(A&&Pi.protocols.indexOf(A)===-1){n(new Er("Unsupported protocol "+A+":",Er.ERR_BAD_REQUEST,r));return}w.send(a||null)})},HU=(r,e)=>{const{length:t}=r=r?r.filter(Boolean):[];if(e||t){let n=new AbortController,i;const a=function(u){if(!i){i=!0,s();const d=u instanceof Error?u:this.reason;n.abort(d instanceof Er?d:new Fh(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,a(new Er(`timeout ${e} of ms exceeded`,Er.ETIMEDOUT))},e);const s=()=>{r&&(o&&clearTimeout(o),o=null,r.forEach(u=>{u.unsubscribe?u.unsubscribe(a):u.removeEventListener("abort",a)}),r=null)};r.forEach(u=>u.addEventListener("abort",a));const{signal:l}=n;return l.unsubscribe=()=>We.asap(s),l}},WU=function*(r,e){let t=r.byteLength;if(t{const i=qU(r,e);let a=0,o,s=l=>{o||(o=!0,n&&n(l))};return new ReadableStream({async pull(l){try{const{done:u,value:d}=await i.next();if(u){s(),l.close();return}let f=d.byteLength;if(t){let g=a+=f;t(g)}l.enqueue(new Uint8Array(d))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},Am=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",QD=Am&&typeof ReadableStream=="function",jU=Am&&(typeof TextEncoder=="function"?(r=>e=>r.encode(e))(new TextEncoder):async r=>new Uint8Array(await new Response(r).arrayBuffer())),eM=(r,...e)=>{try{return!!r(...e)}catch{return!1}},XU=QD&&eM(()=>{let r=!1;const e=new Request(Pi.origin,{body:new ReadableStream,method:"POST",get duplex(){return r=!0,"half"}}).headers.has("Content-Type");return r&&!e}),tM=64*1024,px=QD&&eM(()=>We.isReadableStream(new Response("").body)),Dm={stream:px&&(r=>r.body)};Am&&(r=>{["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!Dm[e]&&(Dm[e]=We.isFunction(r[e])?t=>t[e]():(t,n)=>{throw new Er(`Response type '${e}' is not supported`,Er.ERR_NOT_SUPPORT,n)})})})(new Response);const YU=async r=>{if(r==null)return 0;if(We.isBlob(r))return r.size;if(We.isSpecCompliantForm(r))return(await new Request(Pi.origin,{method:"POST",body:r}).arrayBuffer()).byteLength;if(We.isArrayBufferView(r)||We.isArrayBuffer(r))return r.byteLength;if(We.isURLSearchParams(r)&&(r=r+""),We.isString(r))return(await jU(r)).byteLength},KU=async(r,e)=>{const t=We.toFiniteNumber(r.getContentLength());return t??YU(e)},gx={http:yU,xhr:UU,fetch:Am&&(async r=>{let{url:e,method:t,data:n,signal:i,cancelToken:a,timeout:o,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:g}=KD(r);u=u?(u+"").toLowerCase():"text";let m=HU([i,a&&a.toAbortSignal()],o),_;const x=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let w;try{if(l&&XU&&t!=="get"&&t!=="head"&&(w=await KU(d,n))!==0){let V=new Request(e,{method:"POST",body:n,duplex:"half"}),F;if(We.isFormData(n)&&(F=V.headers.get("content-type"))&&d.setContentType(F),V.body){const[$,H]=ZD(w,Cm(jD(l)));n=JD(V.body,tM,$,H)}}We.isString(f)||(f=f?"include":"omit");const C="credentials"in Request.prototype;_=new Request(e,{...g,signal:m,method:t.toUpperCase(),headers:d.normalize().toJSON(),body:n,duplex:"half",credentials:C?f:void 0});let A=await fetch(_,g);const L=px&&(u==="stream"||u==="response");if(px&&(s||L&&x)){const V={};["status","statusText","headers"].forEach(Z=>{V[Z]=A[Z]});const F=We.toFiniteNumber(A.headers.get("content-length")),[$,H]=s&&ZD(F,Cm(jD(s),!0))||[];A=new Response(JD(A.body,tM,$,()=>{H&&H(),x&&x()}),V)}u=u||"text";let O=await Dm[We.findKey(Dm,u)||"text"](A,r);return!L&&x&&x(),await new Promise((V,F)=>{qD(V,F,{data:O,headers:_a.from(A.headers),status:A.status,statusText:A.statusText,config:r,request:_})})}catch(C){throw x&&x(),C&&C.name==="TypeError"&&/Load failed|fetch/i.test(C.message)?Object.assign(new Er("Network Error",Er.ERR_NETWORK,r,_),{cause:C.cause||C}):Er.from(C,C&&C.code,r,_)}})};We.forEach(gx,(r,e)=>{if(r){try{Object.defineProperty(r,"name",{value:e})}catch{}Object.defineProperty(r,"adapterName",{value:e})}});const rM=r=>`- ${r}`,JU=r=>We.isFunction(r)||r===null||r===!1,nM={getAdapter:r=>{r=We.isArray(r)?r:[r];const{length:e}=r;let t,n;const i={};for(let a=0;a`adapter ${s} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?a.length>1?`since : `+a.map(rM).join(` `):" "+rM(a[0]):"as no adapter specified";throw new Er("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return n},adapters:gx};function vx(r){if(r.cancelToken&&r.cancelToken.throwIfRequested(),r.signal&&r.signal.aborted)throw new Fh(null,r)}function iM(r){return vx(r),r.headers=_a.from(r.headers),r.data=fx.call(r,r.transformRequest),["post","put","patch"].indexOf(r.method)!==-1&&r.headers.setContentType("application/x-www-form-urlencoded",!1),nM.getAdapter(r.adapter||rp.adapter)(r).then(function(n){return vx(r),n.data=fx.call(r,r.transformResponse,n),n.headers=_a.from(n.headers),n},function(n){return WD(n)||(vx(r),n&&n.response&&(n.response.data=fx.call(r,r.transformResponse,n.response),n.response.headers=_a.from(n.response.headers))),Promise.reject(n)})}const aM="1.10.0",Mm={};["object","boolean","number","function","string","symbol"].forEach((r,e)=>{Mm[r]=function(n){return typeof n===r||"a"+(e<1?"n ":" ")+r}});const oM={};Mm.transitional=function(e,t,n){function i(a,o){return"[Axios v"+aM+"] Transitional option '"+a+"'"+o+(n?". "+n:"")}return(a,o,s)=>{if(e===!1)throw new Er(i(o," has been removed"+(t?" in "+t:"")),Er.ERR_DEPRECATED);return t&&!oM[o]&&(oM[o]=!0,console.warn(i(o," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(a,o,s):!0}},Mm.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};function QU(r,e,t){if(typeof r!="object")throw new Er("options must be an object",Er.ERR_BAD_OPTION_VALUE);const n=Object.keys(r);let i=n.length;for(;i-- >0;){const a=n[i],o=e[a];if(o){const s=r[a],l=s===void 0||o(s,a,r);if(l!==!0)throw new Er("option "+a+" must be "+l,Er.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new Er("Unknown option "+a,Er.ERR_BAD_OPTION)}}const Im={assertOptions:QU,validators:Mm},ns=Im.validators;let Hu=class{constructor(e){this.defaults=e||{},this.interceptors={request:new $D,response:new $D}}async request(e,t){try{return await this._request(e,t)}catch(n){if(n instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const a=i.stack?i.stack.replace(/^.+\n/,""):"";try{n.stack?a&&!String(n.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(n.stack+=` `+a):n.stack=a}catch{}}throw n}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=Uu(this.defaults,t);const{transitional:n,paramsSerializer:i,headers:a}=t;n!==void 0&&Im.assertOptions(n,{silentJSONParsing:ns.transitional(ns.boolean),forcedJSONParsing:ns.transitional(ns.boolean),clarifyTimeoutError:ns.transitional(ns.boolean)},!1),i!=null&&(We.isFunction(i)?t.paramsSerializer={serialize:i}:Im.assertOptions(i,{encode:ns.function,serialize:ns.function},!0)),t.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Im.assertOptions(t,{baseUrl:ns.spelling("baseURL"),withXsrfToken:ns.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let o=a&&We.merge(a.common,a[t.method]);a&&We.forEach(["delete","get","head","post","put","patch","common"],_=>{delete a[_]}),t.headers=_a.concat(o,a);const s=[];let l=!0;this.interceptors.request.forEach(function(x){typeof x.runWhen=="function"&&x.runWhen(t)===!1||(l=l&&x.synchronous,s.unshift(x.fulfilled,x.rejected))});const u=[];this.interceptors.response.forEach(function(x){u.push(x.fulfilled,x.rejected)});let d,f=0,g;if(!l){const _=[iM.bind(this),void 0];for(_.unshift.apply(_,s),_.push.apply(_,u),g=_.length,d=Promise.resolve(t);f{if(!n._listeners)return;let a=n._listeners.length;for(;a-- >0;)n._listeners[a](i);n._listeners=null}),this.promise.then=i=>{let a;const o=new Promise(s=>{n.subscribe(s),a=s}).then(i);return o.cancel=function(){n.unsubscribe(a)},o},e(function(a,o,s){n.reason||(n.reason=new Fh(a,o,s),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=n=>{e.abort(n)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new kG(function(i){e=i}),cancel:e}}};function t8(r){return function(t){return r.apply(null,t)}}function r8(r){return We.isObject(r)&&r.isAxiosError===!0}const mx={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(mx).forEach(([r,e])=>{mx[e]=r});function sM(r){const e=new Hu(r),t=ED(Hu.prototype.request,e);return We.extend(t,Hu.prototype,e,{allOwnKeys:!0}),We.extend(t,e,null,{allOwnKeys:!0}),t.create=function(i){return sM(Uu(r,i))},t}const _r=sM(rp);_r.Axios=Hu,_r.CanceledError=Fh,_r.CancelToken=e8,_r.isCancel=WD,_r.VERSION=aM,_r.toFormData=Tm,_r.AxiosError=Er,_r.Cancel=_r.CanceledError,_r.all=function(e){return Promise.all(e)},_r.spread=t8,_r.isAxiosError=r8,_r.mergeConfig=Uu,_r.AxiosHeaders=_a,_r.formToJSON=r=>UD(We.isHTMLForm(r)?new FormData(r):r),_r.getAdapter=nM.getAdapter,_r.HttpStatusCode=mx,_r.default=_r;const{Axios:l0e,AxiosError:u0e,CanceledError:c0e,isCancel:h0e,CancelToken:d0e,VERSION:f0e,all:p0e,Cancel:g0e,isAxiosError:v0e,spread:m0e,toFormData:y0e,AxiosHeaders:_0e,HttpStatusCode:b0e,formToJSON:x0e,getAdapter:w0e,mergeConfig:S0e}=_r;/*! ***************************************************************************** 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. ***************************************************************************** */var yx=function(r,e){return yx=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])},yx(r,e)};function ze(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");yx(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var n8=function(){function r(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return r}(),i8=function(){function r(){this.browser=new n8,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<"u"}return r}(),gr=new i8;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(gr.wxa=!0,gr.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?gr.worker=!0:!gr.hasGlobalWindow||"Deno"in window?(gr.node=!0,gr.svgSupported=!0):a8(navigator.userAgent,gr);function a8(r,e){var t=e.browser,n=r.match(/Firefox\/([\d.]+)/),i=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/.+?rv:(([\d.]+))/),a=r.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(r);n&&(t.firefox=!0,t.version=n[1]),i&&(t.ie=!0,t.version=i[1]),a&&(t.edge=!0,t.version=a[1],t.newEdge=+a[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in s||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var _x=12,lM="sans-serif",Sl=_x+"px "+lM,o8=20,s8=100,l8="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function u8(r){var e={};if(typeof JSON>"u")return e;for(var t=0;t=0)s=o*t.length;else for(var l=0;l>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",i[u]+":0",n[1-l]+":auto",i[1-u]+":auto",""].join("!important;"),r.appendChild(o),t.push(o)}return t}function M8(r,e,t){for(var n=t?"invTrans":"trans",i=e[n],a=e.srcCoords,o=[],s=[],l=!0,u=0;u<4;u++){var d=r[u].getBoundingClientRect(),f=2*u,g=d.left,m=d.top;o.push(g,m),l=l&&a&&g===a[f]&&m===a[f+1],s.push(r[u].offsetLeft,r[u].offsetTop)}return l&&i?i:(e.srcCoords=o,e[n]=t?_M(s,o):_M(o,s))}function xM(r){return r.nodeName.toUpperCase()==="CANVAS"}var I8=/([&<>"'])/g,k8={"&":"&","<":"<",">":">",'"':""","'":"'"};function Yi(r){return r==null?"":(r+"").replace(I8,function(e,t){return k8[t]})}var L8=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Px=[],P8=gr.browser.firefox&&+gr.browser.version.split(".")[0]<39;function Rx(r,e,t,n){return t=t||{},n?wM(r,e,t):P8&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):wM(r,e,t),t}function wM(r,e,t){if(gr.domSupported&&r.getBoundingClientRect){var n=e.clientX,i=e.clientY;if(xM(r)){var a=r.getBoundingClientRect();t.zrX=n-a.left,t.zrY=i-a.top;return}else if(Lx(Px,r,n,i)){t.zrX=Px[0],t.zrY=Px[1];return}}t.zrX=t.zrY=0}function Nx(r){return r||window.event}function ao(r,e,t){if(e=Nx(e),e.zrX!=null)return e;var n=e.type,i=n&&n.indexOf("touch")>=0;if(i){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Rx(r,o,e,t)}else{Rx(r,e,e,t);var a=R8(e);e.zrDelta=a?a/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&L8.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function R8(r){var e=r.wheelDelta;if(e)return e;var t=r.deltaX,n=r.deltaY;if(t==null||n==null)return e;var i=Math.abs(n!==0?n:t),a=n>0?-1:n<0?1:t>0?-1:1;return 3*i*a}function Ox(r,e,t,n){r.addEventListener(e,t,n)}function N8(r,e,t,n){r.removeEventListener(e,t,n)}var Os=function(r){r.preventDefault(),r.stopPropagation(),r.cancelBubble=!0};function SM(r){return r.which===2||r.which===3}var O8=function(){function r(){this._track=[]}return r.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},r.prototype.clear=function(){return this._track.length=0,this},r.prototype._doTrack=function(e,t,n){var i=e.touches;if(i){for(var a={points:[],touches:[],target:t,event:e},o=0,s=i.length;o1&&n&&n.length>1){var a=TM(n)/TM(i);!isFinite(a)&&(a=1),e.pinchScale=a;var o=z8(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:r[0].target,event:e}}}}};function za(){return[1,0,0,1,0,0]}function Fm(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r}function Bx(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4],r[5]=e[5],r}function zs(r,e,t){var n=e[0]*t[0]+e[2]*t[1],i=e[1]*t[0]+e[3]*t[1],a=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],s=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return r[0]=n,r[1]=i,r[2]=a,r[3]=o,r[4]=s,r[5]=l,r}function as(r,e,t){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[4]=e[4]+t[0],r[5]=e[5]+t[1],r}function Yu(r,e,t,n){n===void 0&&(n=[0,0]);var i=e[0],a=e[2],o=e[4],s=e[1],l=e[3],u=e[5],d=Math.sin(t),f=Math.cos(t);return r[0]=i*f+s*d,r[1]=-i*d+s*f,r[2]=a*f+l*d,r[3]=-a*d+f*l,r[4]=f*(o-n[0])+d*(u-n[1])+n[0],r[5]=f*(u-n[1])-d*(o-n[0])+n[1],r}function Vx(r,e,t){var n=t[0],i=t[1];return r[0]=e[0]*n,r[1]=e[1]*i,r[2]=e[2]*n,r[3]=e[3]*i,r[4]=e[4]*n,r[5]=e[5]*i,r}function Hh(r,e){var t=e[0],n=e[2],i=e[4],a=e[1],o=e[3],s=e[5],l=t*o-a*n;return l?(l=1/l,r[0]=o*l,r[1]=-a*l,r[2]=-n*l,r[3]=t*l,r[4]=(n*s-o*i)*l,r[5]=(a*i-t*s)*l,r):null}function B8(r){var e=za();return Bx(e,r),e}var ir=function(){function r(e,t){this.x=e||0,this.y=t||0}return r.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},r.prototype.clone=function(){return new r(this.x,this.y)},r.prototype.set=function(e,t){return this.x=e,this.y=t,this},r.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},r.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},r.prototype.scale=function(e){this.x*=e,this.y*=e},r.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},r.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},r.prototype.dot=function(e){return this.x*e.x+this.y*e.y},r.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},r.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},r.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},r.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},r.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},r.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},r.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},r.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},r.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},r.set=function(e,t,n){e.x=t,e.y=n},r.copy=function(e,t){e.x=t.x,e.y=t.y},r.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},r.lenSquare=function(e){return e.x*e.x+e.y*e.y},r.dot=function(e,t){return e.x*t.x+e.y*t.y},r.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},r.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},r.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},r.scaleAndAdd=function(e,t,n,i){e.x=t.x+n.x*i,e.y=t.y+n.y*i},r.lerp=function(e,t,n,i){var a=1-i;e.x=a*t.x+i*n.x,e.y=a*t.y+i*n.y},r}(),$m=Math.min,Gm=Math.max,Ku=new ir,Ju=new ir,Qu=new ir,ec=new ir,op=new ir,sp=new ir,sr=function(){function r(e,t,n,i){n<0&&(e=e+n,n=-n),i<0&&(t=t+i,i=-i),this.x=e,this.y=t,this.width=n,this.height=i}return r.prototype.union=function(e){var t=$m(e.x,this.x),n=$m(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Gm(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Gm(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=t,this.y=n},r.prototype.applyTransform=function(e){r.applyTransform(this,this,e)},r.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,i=e.height/t.height,a=za();return as(a,a,[-t.x,-t.y]),Vx(a,a,[n,i]),as(a,a,[e.x,e.y]),a},r.prototype.intersect=function(e,t){if(!e)return!1;e instanceof r||(e=r.create(e));var n=this,i=n.x,a=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,u=e.x+e.width,d=e.y,f=e.y+e.height,g=!(a_&&(_=L,x_&&(_=O,C=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},r.prototype.clone=function(){return new r(this.x,this.y,this.width,this.height)},r.prototype.copy=function(e){r.copy(this,e)},r.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},r.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},r.prototype.isZero=function(){return this.width===0||this.height===0},r.create=function(e){return new r(e.x,e.y,e.width,e.height)},r.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},r.applyTransform=function(e,t,n){if(!n){e!==t&&r.copy(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var i=n[0],a=n[3],o=n[4],s=n[5];e.x=t.x*i+o,e.y=t.y*a+s,e.width=t.width*i,e.height=t.height*a,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Ku.x=Qu.x=t.x,Ku.y=ec.y=t.y,Ju.x=ec.x=t.x+t.width,Ju.y=Qu.y=t.y+t.height,Ku.transform(n),ec.transform(n),Ju.transform(n),Qu.transform(n),e.x=$m(Ku.x,Ju.x,Qu.x,ec.x),e.y=$m(Ku.y,Ju.y,Qu.y,ec.y);var l=Gm(Ku.x,Ju.x,Qu.x,ec.x),u=Gm(Ku.y,Ju.y,Qu.y,ec.y);e.width=l-e.x,e.height=u-e.y},r}(),EM="silent";function V8(r,e,t){return{type:r,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:F8}}function F8(){Os(this.event)}var $8=function(r){hn(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e}(io),lp=function(){function r(e,t){this.x=e,this.y=t}return r}(),G8=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Fx=new sr(0,0,0,0),CM=function(r){hn(e,r);function e(t,n,i,a,o){var s=r.call(this)||this;return s._hovered=new lp(0,0),s.storage=t,s.painter=n,s.painterRoot=a,s._pointerSize=o,i=i||new $8,s.proxy=null,s.setHandlerProxy(i),s._draggingMgr=new E8(s),s}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(Q(G8,function(n){t.on&&t.on(n,this[n],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var n=t.zrX,i=t.zrY,a=DM(this,n,i),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=a?new lp(n,i):this.findHover(n,i),u=l.target,d=this.proxy;d.setCursor&&d.setCursor(u?u.cursor:"default"),s&&u!==s&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),u&&u!==s&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var n=t.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new lp(0,0)},e.prototype.dispatch=function(t,n){var i=this[t];i&&i.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var n=this.proxy;n.setCursor&&n.setCursor(t)},e.prototype.dispatchToElement=function(t,n,i){t=t||{};var a=t.target;if(!(a&&a.silent)){for(var o="on"+n,s=V8(n,t,i);a&&(a[o]&&(s.cancelBubble=!!a[o].call(a,s)),a.trigger(n,s),a=a.__hostTarget?a.__hostTarget:a.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(t,n,i){var a=this.storage.getDisplayList(),o=new lp(t,n);if(AM(a,o,t,n,i),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,u=l/2,d=new sr(t-u,n-u,l,l),f=a.length-1;f>=0;f--){var g=a[f];g!==i&&!g.ignore&&!g.ignoreCoarsePointer&&(!g.parent||!g.parent.ignoreCoarsePointer)&&(Fx.copy(g.getBoundingRect()),g.transform&&Fx.applyTransform(g.transform),Fx.intersect(d)&&s.push(g))}if(s.length)for(var m=4,_=Math.PI/12,x=Math.PI*2,w=0;w4)return;this._downPoint=null}this.dispatchToElement(a,r,e)}});function U8(r,e,t){if(r[r.rectHover?"rectContain":"contain"](e,t)){for(var n=r,i=void 0,a=!1;n;){if(n.ignoreClip&&(a=!0),!a){var o=n.getClipPath();if(o&&!o.contain(e,t))return!1}n.silent&&(i=!0);var s=n.__hostTarget;n=s||n.parent}return i?EM:!0}return!1}function AM(r,e,t,n,i){for(var a=r.length-1;a>=0;a--){var o=r[a],s=void 0;if(o!==i&&!o.ignore&&(s=U8(o,t,n))&&(!e.topTarget&&(e.topTarget=o),s!==EM)){e.target=o;break}}}function DM(r,e,t){var n=r.painter;return e<0||e>n.getWidth()||t<0||t>n.getHeight()}var MM=32,up=7;function H8(r){for(var e=0;r>=MM;)e|=r&1,r>>=1;return r+e}function IM(r,e,t,n){var i=e+1;if(i===t)return 1;if(n(r[i++],r[e])<0){for(;i=0;)i++;return i-e}function W8(r,e,t){for(t--;e>>1,i(a,r[l])<0?s=l:o=l+1;var u=n-o;switch(u){case 3:r[o+3]=r[o+2];case 2:r[o+2]=r[o+1];case 1:r[o+1]=r[o];break;default:for(;u>0;)r[o+u]=r[o+u-1],u--}r[o]=a}}function $x(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])>0){for(s=n-i;l0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}else{for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}for(o++;o>>1);a(r,e[t+d])>0?o=d+1:l=d}return l}function Gx(r,e,t,n,i,a){var o=0,s=0,l=1;if(a(r,e[t+i])<0){for(s=i+1;ls&&(l=s);var u=o;o=i-l,l=i-u}else{for(s=n-i;l=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=i,l+=i}for(o++;o>>1);a(r,e[t+d])<0?l=d:o=d+1}return l}function q8(r,e){var t=up,n,i,a=0,o=[];n=[],i=[];function s(m,_){n[a]=m,i[a]=_,a+=1}function l(){for(;a>1;){var m=a-2;if(m>=1&&i[m-1]<=i[m]+i[m+1]||m>=2&&i[m-2]<=i[m]+i[m-1])i[m-1]i[m+1])break;d(m)}}function u(){for(;a>1;){var m=a-2;m>0&&i[m-1]=up||$>=up);if(H)break;V<0&&(V=0),V+=2}if(t=V,t<1&&(t=1),_===1){for(C=0;C=0;C--)r[F+C]=r[V+C];r[O]=o[L];return}for(var $=t;;){var H=0,Z=0,j=!1;do if(e(o[L],r[A])<0){if(r[O--]=r[A--],H++,Z=0,--_===0){j=!0;break}}else if(r[O--]=o[L--],Z++,H=0,--w===1){j=!0;break}while((H|Z)<$);if(j)break;do{if(H=_-Gx(o[L],r,m,_,_-1,e),H!==0){for(O-=H,A-=H,_-=H,F=O+1,V=A+1,C=H-1;C>=0;C--)r[F+C]=r[V+C];if(_===0){j=!0;break}}if(r[O--]=o[L--],--w===1){j=!0;break}if(Z=w-$x(r[A],o,0,w,w-1,e),Z!==0){for(O-=Z,L-=Z,w-=Z,F=O+1,V=L+1,C=0;C=up||Z>=up);if(j)break;$<0&&($=0),$+=2}if(t=$,t<1&&(t=1),w===1){for(O-=_,A-=_,F=O+1,V=A+1,C=_-1;C>=0;C--)r[F+C]=r[V+C];r[O]=o[L]}else{if(w===0)throw new Error;for(V=O-(w-1),C=0;Cs&&(l=s),kM(r,t,t+l,t+a,e),a=l}o.pushRun(t,a),o.mergeRuns(),i-=a,t+=a}while(i!==0);o.forceMergeRuns()}}var Ba=1,cp=2,Wh=4,LM=!1;function Ux(){LM||(LM=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function PM(r,e){return r.zlevel===e.zlevel?r.z===e.z?r.z2-e.z2:r.z-e.z:r.zlevel-e.zlevel}var Z8=function(){function r(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=PM}return r.prototype.traverse=function(e,t){for(var n=0;n0&&(d.__clipPaths=[]),isNaN(d.z)&&(Ux(),d.z=0),isNaN(d.z2)&&(Ux(),d.z2=0),isNaN(d.zlevel)&&(Ux(),d.zlevel=0),this._displayList[this._displayListLen++]=d}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,t,n);var g=e.getTextGuideLine();g&&this._updateAndAddDisplayable(g,t,n);var m=e.getTextContent();m&&this._updateAndAddDisplayable(m,t,n)}},r.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},r.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t=0&&this._roots.splice(i,1)},r.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},r.prototype.getRoots=function(){return this._roots},r.prototype.dispose=function(){this._displayList=null,this._roots=null},r}(),Hm;Hm=gr.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(r){return setTimeout(r,16)};var hp={linear:function(r){return r},quadraticIn:function(r){return r*r},quadraticOut:function(r){return r*(2-r)},quadraticInOut:function(r){return(r*=2)<1?.5*r*r:-.5*(--r*(r-2)-1)},cubicIn:function(r){return r*r*r},cubicOut:function(r){return--r*r*r+1},cubicInOut:function(r){return(r*=2)<1?.5*r*r*r:.5*((r-=2)*r*r+2)},quarticIn:function(r){return r*r*r*r},quarticOut:function(r){return 1- --r*r*r*r},quarticInOut:function(r){return(r*=2)<1?.5*r*r*r*r:-.5*((r-=2)*r*r*r-2)},quinticIn:function(r){return r*r*r*r*r},quinticOut:function(r){return--r*r*r*r*r+1},quinticInOut:function(r){return(r*=2)<1?.5*r*r*r*r*r:.5*((r-=2)*r*r*r*r+2)},sinusoidalIn:function(r){return 1-Math.cos(r*Math.PI/2)},sinusoidalOut:function(r){return Math.sin(r*Math.PI/2)},sinusoidalInOut:function(r){return .5*(1-Math.cos(Math.PI*r))},exponentialIn:function(r){return r===0?0:Math.pow(1024,r-1)},exponentialOut:function(r){return r===1?1:1-Math.pow(2,-10*r)},exponentialInOut:function(r){return r===0?0:r===1?1:(r*=2)<1?.5*Math.pow(1024,r-1):.5*(-Math.pow(2,-10*(r-1))+2)},circularIn:function(r){return 1-Math.sqrt(1-r*r)},circularOut:function(r){return Math.sqrt(1- --r*r)},circularInOut:function(r){return(r*=2)<1?-.5*(Math.sqrt(1-r*r)-1):.5*(Math.sqrt(1-(r-=2)*r)+1)},elasticIn:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)))},elasticOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*r)*Math.sin((r-e)*(2*Math.PI)/n)+1)},elasticInOut:function(r){var e,t=.1,n=.4;return r===0?0:r===1?1:(!t||t<1?(t=1,e=n/4):e=n*Math.asin(1/t)/(2*Math.PI),(r*=2)<1?-.5*(t*Math.pow(2,10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)):t*Math.pow(2,-10*(r-=1))*Math.sin((r-e)*(2*Math.PI)/n)*.5+1)},backIn:function(r){var e=1.70158;return r*r*((e+1)*r-e)},backOut:function(r){var e=1.70158;return--r*r*((e+1)*r+e)+1},backInOut:function(r){var e=2.5949095;return(r*=2)<1?.5*(r*r*((e+1)*r-e)):.5*((r-=2)*r*((e+1)*r+e)+2)},bounceIn:function(r){return 1-hp.bounceOut(1-r)},bounceOut:function(r){return r<1/2.75?7.5625*r*r:r<2/2.75?7.5625*(r-=1.5/2.75)*r+.75:r<2.5/2.75?7.5625*(r-=2.25/2.75)*r+.9375:7.5625*(r-=2.625/2.75)*r+.984375},bounceInOut:function(r){return r<.5?hp.bounceIn(r*2)*.5:hp.bounceOut(r*2-1)*.5+.5}},Wm=Math.pow,Dl=Math.sqrt,qm=1e-8,RM=1e-4,NM=Dl(3),Zm=1/3,os=Zu(),oo=Zu(),qh=Zu();function Ml(r){return r>-qm&&rqm||r<-qm}function ti(r,e,t,n,i){var a=1-i;return a*a*(a*r+3*i*e)+i*i*(i*n+3*a*t)}function zM(r,e,t,n,i){var a=1-i;return 3*(((e-r)*a+2*(t-e)*i)*a+(n-t)*i*i)}function jm(r,e,t,n,i,a){var o=n+3*(e-t)-r,s=3*(t-e*2+r),l=3*(e-r),u=r-i,d=s*s-3*o*l,f=s*l-9*o*u,g=l*l-3*s*u,m=0;if(Ml(d)&&Ml(f))if(Ml(s))a[0]=0;else{var _=-l/s;_>=0&&_<=1&&(a[m++]=_)}else{var x=f*f-4*d*g;if(Ml(x)){var w=f/d,_=-s/o+w,C=-w/2;_>=0&&_<=1&&(a[m++]=_),C>=0&&C<=1&&(a[m++]=C)}else if(x>0){var A=Dl(x),L=d*s+1.5*o*(-f+A),O=d*s+1.5*o*(-f-A);L<0?L=-Wm(-L,Zm):L=Wm(L,Zm),O<0?O=-Wm(-O,Zm):O=Wm(O,Zm);var _=(-s-(L+O))/(3*o);_>=0&&_<=1&&(a[m++]=_)}else{var V=(2*d*s-3*o*f)/(2*Dl(d*d*d)),F=Math.acos(V)/3,$=Dl(d),H=Math.cos(F),_=(-s-2*$*H)/(3*o),C=(-s+$*(H+NM*Math.sin(F)))/(3*o),Z=(-s+$*(H-NM*Math.sin(F)))/(3*o);_>=0&&_<=1&&(a[m++]=_),C>=0&&C<=1&&(a[m++]=C),Z>=0&&Z<=1&&(a[m++]=Z)}}return m}function BM(r,e,t,n,i){var a=6*t-12*e+6*r,o=9*e+3*n-3*r-9*t,s=3*e-3*r,l=0;if(Ml(o)){if(OM(a)){var u=-s/a;u>=0&&u<=1&&(i[l++]=u)}}else{var d=a*a-4*o*s;if(Ml(d))i[0]=-a/(2*o);else if(d>0){var f=Dl(d),u=(-a+f)/(2*o),g=(-a-f)/(2*o);u>=0&&u<=1&&(i[l++]=u),g>=0&&g<=1&&(i[l++]=g)}}return l}function Il(r,e,t,n,i,a){var o=(e-r)*i+r,s=(t-e)*i+e,l=(n-t)*i+t,u=(s-o)*i+o,d=(l-s)*i+s,f=(d-u)*i+u;a[0]=r,a[1]=o,a[2]=u,a[3]=f,a[4]=f,a[5]=d,a[6]=l,a[7]=n}function VM(r,e,t,n,i,a,o,s,l,u,d){var f,g=.005,m=1/0,_,x,w,C;os[0]=l,os[1]=u;for(var A=0;A<1;A+=.05)oo[0]=ti(r,t,i,o,A),oo[1]=ti(e,n,a,s,A),w=Xu(os,oo),w=0&&w=0&&u<=1&&(i[l++]=u)}}else{var d=o*o-4*a*s;if(Ml(d)){var u=-o/(2*a);u>=0&&u<=1&&(i[l++]=u)}else if(d>0){var f=Dl(d),u=(-o+f)/(2*a),g=(-o-f)/(2*a);u>=0&&u<=1&&(i[l++]=u),g>=0&&g<=1&&(i[l++]=g)}}return l}function FM(r,e,t){var n=r+t-2*e;return n===0?.5:(r-e)/n}function dp(r,e,t,n,i){var a=(e-r)*n+r,o=(t-e)*n+e,s=(o-a)*n+a;i[0]=r,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=t}function $M(r,e,t,n,i,a,o,s,l){var u,d=.005,f=1/0;os[0]=o,os[1]=s;for(var g=0;g<1;g+=.05){oo[0]=hi(r,t,i,g),oo[1]=hi(e,n,a,g);var m=Xu(os,oo);m=0&&m=1?1:jm(0,n,a,1,l,s)&&ti(0,i,o,1,s[0])}}}var J8=function(){function r(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||On,this.ondestroy=e.ondestroy||On,this.onrestart=e.onrestart||On,e.easing&&this.setEasing(e.easing)}return r.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var n=this._life,i=e-this._startTime-this._pausedTime,a=i/n;a<0&&(a=0),a=Math.min(a,1);var o=this.easingFunc,s=o?o(a):a;if(this.onframe(s),a===1)if(this.loop){var l=i%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},r.prototype.pause=function(){this._paused=!0},r.prototype.resume=function(){this._paused=!1},r.prototype.setEasing=function(e){this.easing=e,this.easingFunc=It(e)?e:hp[e]||Wx(e)},r}(),GM=function(){function r(e){this.value=e}return r}(),Q8=function(){function r(){this._len=0}return r.prototype.insert=function(e){var t=new GM(e);return this.insertEntry(t),t},r.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},r.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},r.prototype.len=function(){return this._len},r.prototype.clear=function(){this.head=this.tail=null,this._len=0},r}(),fp=function(){function r(e){this._list=new Q8,this._maxSize=10,this._map={},this._maxSize=e}return r.prototype.put=function(e,t){var n=this._list,i=this._map,a=null;if(i[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete i[l.key],a=l.value,this._lastRemovedEntry=l}s?s.value=t:s=new GM(t),s.key=e,n.insertEntry(s),i[e]=s}return a},r.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},r.prototype.clear=function(){this._list.clear(),this._map={}},r.prototype.len=function(){return this._list.len()},r}(),UM={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function zo(r){return r=Math.round(r),r<0?0:r>255?255:r}function eH(r){return r=Math.round(r),r<0?0:r>360?360:r}function pp(r){return r<0?0:r>1?1:r}function qx(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?zo(parseFloat(e)/100*255):zo(parseInt(e,10))}function tc(r){var e=r;return e.length&&e.charAt(e.length-1)==="%"?pp(parseFloat(e)/100):pp(parseFloat(e))}function Zx(r,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?r+(e-r)*t*6:t*2<1?e:t*3<2?r+(e-r)*(2/3-t)*6:r}function kl(r,e,t){return r+(e-r)*t}function so(r,e,t,n,i){return r[0]=e,r[1]=t,r[2]=n,r[3]=i,r}function jx(r,e){return r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r}var HM=new fp(20),Xm=null;function Zh(r,e){Xm&&jx(Xm,e),Xm=HM.put(r,Xm||e.slice())}function Va(r,e){if(r){e=e||[];var t=HM.get(r);if(t)return jx(e,t);r=r+"";var n=r.replace(/ /g,"").toLowerCase();if(n in UM)return jx(e,UM[n]),Zh(r,e),e;var i=n.length;if(n.charAt(0)==="#"){if(i===4||i===5){var a=parseInt(n.slice(1,4),16);if(!(a>=0&&a<=4095)){so(e,0,0,0,1);return}return so(e,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(n.slice(4),16)/15:1),Zh(r,e),e}else if(i===7||i===9){var a=parseInt(n.slice(1,7),16);if(!(a>=0&&a<=16777215)){so(e,0,0,0,1);return}return so(e,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(n.slice(7),16)/255:1),Zh(r,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===i){var l=n.substr(0,o),u=n.substr(o+1,s-(o+1)).split(","),d=1;switch(l){case"rgba":if(u.length!==4)return u.length===3?so(e,+u[0],+u[1],+u[2],1):so(e,0,0,0,1);d=tc(u.pop());case"rgb":if(u.length>=3)return so(e,qx(u[0]),qx(u[1]),qx(u[2]),u.length===3?d:tc(u[3])),Zh(r,e),e;so(e,0,0,0,1);return;case"hsla":if(u.length!==4){so(e,0,0,0,1);return}return u[3]=tc(u[3]),Xx(u,e),Zh(r,e),e;case"hsl":if(u.length!==3){so(e,0,0,0,1);return}return Xx(u,e),Zh(r,e),e;default:return}}so(e,0,0,0,1)}}function Xx(r,e){var t=(parseFloat(r[0])%360+360)%360/360,n=tc(r[1]),i=tc(r[2]),a=i<=.5?i*(n+1):i+n-i*n,o=i*2-a;return e=e||[],so(e,zo(Zx(o,a,t+1/3)*255),zo(Zx(o,a,t)*255),zo(Zx(o,a,t-1/3)*255),1),r.length===4&&(e[3]=r[3]),e}function tH(r){if(r){var e=r[0]/255,t=r[1]/255,n=r[2]/255,i=Math.min(e,t,n),a=Math.max(e,t,n),o=a-i,s=(a+i)/2,l,u;if(o===0)l=0,u=0;else{s<.5?u=o/(a+i):u=o/(2-a-i);var d=((a-e)/6+o/2)/o,f=((a-t)/6+o/2)/o,g=((a-n)/6+o/2)/o;e===a?l=g-f:t===a?l=1/3+d-g:n===a&&(l=2/3+f-d),l<0&&(l+=1),l>1&&(l-=1)}var m=[l*360,u,s];return r[3]!=null&&m.push(r[3]),m}}function Yx(r,e){var t=Va(r);if(t){for(var n=0;n<3;n++)e<0?t[n]=t[n]*(1-e)|0:t[n]=(255-t[n])*e+t[n]|0,t[n]>255?t[n]=255:t[n]<0&&(t[n]=0);return Bs(t,t.length===4?"rgba":"rgb")}}function Kx(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){t=t||[];var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=e[i],s=e[a],l=n-i;return t[0]=zo(kl(o[0],s[0],l)),t[1]=zo(kl(o[1],s[1],l)),t[2]=zo(kl(o[2],s[2],l)),t[3]=pp(kl(o[3],s[3],l)),t}}function rH(r,e,t){if(!(!(e&&e.length)||!(r>=0&&r<=1))){var n=r*(e.length-1),i=Math.floor(n),a=Math.ceil(n),o=Va(e[i]),s=Va(e[a]),l=n-i,u=Bs([zo(kl(o[0],s[0],l)),zo(kl(o[1],s[1],l)),zo(kl(o[2],s[2],l)),pp(kl(o[3],s[3],l))],"rgba");return t?{color:u,leftIndex:i,rightIndex:a,value:n}:u}}function gp(r,e,t,n){var i=Va(r);if(r)return i=tH(i),e!=null&&(i[0]=eH(e)),t!=null&&(i[1]=tc(t)),n!=null&&(i[2]=tc(n)),Bs(Xx(i),"rgba")}function Ym(r,e){var t=Va(r);if(t&&e!=null)return t[3]=pp(e),Bs(t,"rgba")}function Bs(r,e){if(!(!r||!r.length)){var t=r[0]+","+r[1]+","+r[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+r[3]),e+"("+t+")"}}function Km(r,e){var t=Va(r);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}var WM=new fp(100);function Jx(r){if(ut(r)){var e=WM.get(r);return e||(e=Yx(r,-.1),WM.put(r,e)),e}else if(Rm(r)){var t=Ge({},r);return t.colorStops=je(r.colorStops,function(n){return{offset:n.offset,color:Yx(n.color,-.1)}}),t}return r}var nH={},Jm=Math.round;function vp(r){var e;if(!r||r==="transparent")r="none";else if(typeof r=="string"&&r.indexOf("rgba")>-1){var t=Va(r);t&&(r="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:r,opacity:e??1}}var qM=1e-4;function Ll(r){return r-qM}function Qm(r){return Jm(r*1e3)/1e3}function Qx(r){return Jm(r*1e4)/1e4}function iH(r){return"matrix("+Qm(r[0])+","+Qm(r[1])+","+Qm(r[2])+","+Qm(r[3])+","+Qx(r[4])+","+Qx(r[5])+")"}var aH={left:"start",right:"end",center:"middle",middle:"middle"};function oH(r,e,t){return t==="top"?r+=e/2:t==="bottom"&&(r-=e/2),r}function sH(r){return r&&(r.shadowBlur||r.shadowOffsetX||r.shadowOffsetY)}function lH(r){var e=r.style,t=r.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function ZM(r){return r&&!!r.image}function uH(r){return r&&!!r.svgElement}function ew(r){return ZM(r)||uH(r)}function jM(r){return r.type==="linear"}function XM(r){return r.type==="radial"}function YM(r){return r&&(r.type==="linear"||r.type==="radial")}function ey(r){return"url(#"+r+")"}function KM(r){var e=r.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function JM(r){var e=r.x||0,t=r.y||0,n=(r.rotation||0)*zm,i=Zt(r.scaleX,1),a=Zt(r.scaleY,1),o=r.skewX||0,s=r.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),n&&l.push("rotate("+n+")"),(i!==1||a!==1)&&l.push("scale("+i+","+a+")"),(o||s)&&l.push("skew("+Jm(o*zm)+"deg, "+Jm(s*zm)+"deg)"),l.join(" ")}var cH=function(){return gr.hasGlobalWindow&&It(window.btoa)?function(r){return window.btoa(unescape(encodeURIComponent(r)))}:typeof Buffer<"u"?function(r){return Buffer.from(r).toString("base64")}:function(r){return nH.NODE_ENV!=="production"&&No("Base64 isn't natively supported in the current environment."),null}}(),tw=Array.prototype.slice;function Vs(r,e,t){return(e-r)*t+r}function rw(r,e,t,n){for(var i=e.length,a=0;an?e:r,a=Math.min(t,n),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so;if(s)n.length=o;else for(var l=a;l=1},r.prototype.getAdditiveTrack=function(){return this._additiveTrack},r.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var i=this.keyframes,a=i.length,o=!1,s=tI,l=t;if(Ri(t)){var u=pH(t);s=u,(u===1&&!Lr(t[0])||u===2&&!Lr(t[0][0]))&&(o=!0)}else if(Lr(t)&&!qu(t))s=ny;else if(ut(t))if(!isNaN(+t))s=ny;else{var d=Va(t);d&&(l=d,s=yp)}else if(Rm(t)){var f=Ge({},l);f.colorStops=je(t.colorStops,function(m){return{offset:m.offset,color:Va(m.color)}}),jM(t)?s=nw:XM(t)&&(s=iw),l=f}a===0?this.valType=s:(s!==this.valType||s===tI)&&(o=!0),this.discrete=this.discrete||o;var g={time:e,value:l,rawValue:t,percent:0};return n&&(g.easing=n,g.easingFunc=It(n)?n:hp[n]||Wx(n)),i.push(g),g},r.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(x,w){return x.time-w.time});for(var i=this.valType,a=n.length,o=n[a-1],s=this.discrete,l=ay(i),u=rI(i),d=0;d=0&&!(o[d].percent<=t);d--);d=g(d,s-2)}else{for(d=f;dt);d++);d=g(d-1,s-2)}_=o[d+1],m=o[d]}if(m&&_){this._lastFr=d,this._lastFrP=t;var w=_.percent-m.percent,C=w===0?1:g((t-m.percent)/w,1);_.easingFunc&&(C=_.easingFunc(C));var A=n?this._additiveValue:u?_p:e[l];if((ay(a)||u)&&!A&&(A=this._additiveValue=[]),this.discrete)e[l]=C<1?m.rawValue:_.rawValue;else if(ay(a))a===iy?rw(A,m[i],_[i],C):hH(A,m[i],_[i],C);else if(rI(a)){var L=m[i],O=_[i],V=a===nw;e[l]={type:V?"linear":"radial",x:Vs(L.x,O.x,C),y:Vs(L.y,O.y,C),colorStops:je(L.colorStops,function($,H){var Z=O.colorStops[H];return{offset:Vs($.offset,Z.offset,C),color:ry(rw([],$.color,Z.color,C))}}),global:O.global},V?(e[l].x2=Vs(L.x2,O.x2,C),e[l].y2=Vs(L.y2,O.y2,C)):e[l].r=Vs(L.r,O.r,C)}else if(u)rw(A,m[i],_[i],C),n||(e[l]=ry(A));else{var F=Vs(m[i],_[i],C);n?this._additiveValue=F:e[l]=F}n&&this._addToTarget(e)}}},r.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,i=this._additiveValue;t===ny?e[n]=e[n]+i:t===yp?(Va(e[n],_p),ty(_p,_p,i,1),e[n]=ry(_p)):t===iy?ty(e[n],e[n],i,1):t===eI&&QM(e[n],e[n],i,1)},r}(),aw=function(){function r(e,t,n,i){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&i){No("Can' use additive animation on looped animation.");return}this._additiveAnimators=i,this._allowDiscrete=n}return r.prototype.getMaxTime=function(){return this._maxTime},r.prototype.getDelay=function(){return this._delay},r.prototype.getLoop=function(){return this._loop},r.prototype.getTarget=function(){return this._target},r.prototype.changeTarget=function(e){this._target=e},r.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,br(t),n)},r.prototype.whenWithKeys=function(e,t,n,i){for(var a=this._tracks,o=0;o0&&l.addKeyframe(0,mp(u),i),this._trackKeys.push(s)}l.addKeyframe(e,mp(t[s]),i)}return this._maxTime=Math.max(this._maxTime,e),this},r.prototype.pause=function(){this._clip.pause(),this._paused=!0},r.prototype.resume=function(){this._clip.resume(),this._paused=!1},r.prototype.isPaused=function(){return!!this._paused},r.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},r.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],i=this._maxTime||0,a=0;a1){var s=o.pop();a.addKeyframe(s.time,e[i]),a.prepare(this._maxTime,a.getAdditiveTrack())}}}},r}();function jh(){return new Date().getTime()}var vH=function(r){hn(e,r);function e(t){var n=r.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t=t||{},n.stage=t.stage||{},n}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var n=t.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(t){if(t.animation){var n=t.prev,i=t.next;n?n.next=i:this._head=i,i?i.prev=n:this._tail=n,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var n=t.getClip();n&&this.removeClip(n),t.animation=null},e.prototype.update=function(t){for(var n=jh()-this._pausedTime,i=n-this._time,a=this._head;a;){var o=a.next,s=a.step(n,i);s&&(a.ondestroy(),this.removeClip(a)),a=o}this._time=n,t||(this.trigger("frame",i),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function n(){t._running&&(Hm(n),!t._paused&&t.update())}Hm(n)},e.prototype.start=function(){this._running||(this._time=jh(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=jh(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=jh()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var n=t.next;t.prev=t.next=t.animation=null,t=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,n){n=n||{},this.start();var i=new aw(t,n.loop);return this.addAnimator(i),i},e}(io),mH=300,ow=gr.domSupported,sw=function(){var r=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=je(r,function(i){var a=i.replace("mouse","pointer");return t.hasOwnProperty(a)?a:i});return{mouse:r,touch:e,pointer:n}}(),nI={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},iI=!1;function lw(r){var e=r.pointerType;return e==="pen"||e==="touch"}function yH(r){r.touching=!0,r.touchTimer!=null&&(clearTimeout(r.touchTimer),r.touchTimer=null),r.touchTimer=setTimeout(function(){r.touching=!1,r.touchTimer=null},700)}function uw(r){r&&(r.zrByTouch=!0)}function _H(r,e){return ao(r.dom,new bH(r,e),!0)}function aI(r,e){for(var t=e,n=!1;t&&t.nodeType!==9&&!(n=t.domBelongToZr||t!==e&&t===r.painterRoot);)t=t.parentNode;return n}var bH=function(){function r(e,t){this.stopPropagation=On,this.stopImmediatePropagation=On,this.preventDefault=On,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return r}(),Bo={mousedown:function(r){r=ao(this.dom,r),this.__mayPointerCapture=[r.zrX,r.zrY],this.trigger("mousedown",r)},mousemove:function(r){r=ao(this.dom,r);var e=this.__mayPointerCapture;e&&(r.zrX!==e[0]||r.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",r)},mouseup:function(r){r=ao(this.dom,r),this.__togglePointerCapture(!1),this.trigger("mouseup",r)},mouseout:function(r){r=ao(this.dom,r);var e=r.toElement||r.relatedTarget;aI(this,e)||(this.__pointerCapturing&&(r.zrEventControl="no_globalout"),this.trigger("mouseout",r))},wheel:function(r){iI=!0,r=ao(this.dom,r),this.trigger("mousewheel",r)},mousewheel:function(r){iI||(r=ao(this.dom,r),this.trigger("mousewheel",r))},touchstart:function(r){r=ao(this.dom,r),uw(r),this.__lastTouchMoment=new Date,this.handler.processGesture(r,"start"),Bo.mousemove.call(this,r),Bo.mousedown.call(this,r)},touchmove:function(r){r=ao(this.dom,r),uw(r),this.handler.processGesture(r,"change"),Bo.mousemove.call(this,r)},touchend:function(r){r=ao(this.dom,r),uw(r),this.handler.processGesture(r,"end"),Bo.mouseup.call(this,r),+new Date-+this.__lastTouchMomentuI||r<-uI}var nc=[],Xh=[],gw=za(),vw=Math.abs,Fs=function(){function r(){}return r.prototype.getLocalTransform=function(e){return r.getLocalTransform(this,e)},r.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},r.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},r.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},r.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},r.prototype.needLocalTransform=function(){return rc(this.rotation)||rc(this.x)||rc(this.y)||rc(this.scaleX-1)||rc(this.scaleY-1)||rc(this.skewX)||rc(this.skewY)},r.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(lI(n),this.invTransform=null);return}n=n||za(),t?this.getLocalTransform(n):lI(n),e&&(t?zs(n,e,n):Bx(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},r.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(nc);var n=nc[0]<0?-1:1,i=nc[1]<0?-1:1,a=((nc[0]-n)*t+n)/nc[0]||0,o=((nc[1]-i)*t+i)/nc[1]||0;e[0]*=a,e[1]*=a,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||za(),Hh(this.invTransform,e)},r.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},r.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],i=Math.atan2(e[1],e[0]),a=Math.PI/2+i-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(a),t=Math.sqrt(t),this.skewX=a,this.skewY=0,this.rotation=-i,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},r.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||za(),zs(Xh,e.invTransform,t),t=Xh);var n=this.originX,i=this.originY;(n||i)&&(gw[4]=n,gw[5]=i,zs(Xh,t,gw),Xh[4]-=n,Xh[5]-=i,t=Xh),this.setLocalTransform(t)}},r.prototype.getGlobalScale=function(e){var t=this.transform;return e=e||[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},r.prototype.transformCoordToLocal=function(e,t){var n=[e,t],i=this.invTransform;return i&&Si(n,n,i),n},r.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],i=this.transform;return i&&Si(n,n,i),n},r.prototype.getLineScale=function(){var e=this.transform;return e&&vw(e[0]-1)>1e-10&&vw(e[3]-1)>1e-10?Math.sqrt(vw(e[0]*e[3]-e[2]*e[1])):1},r.prototype.copyTransform=function(e){cI(this,e)},r.getLocalTransform=function(e,t){t=t||[];var n=e.originX||0,i=e.originY||0,a=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,u=e.rotation||0,d=e.x,f=e.y,g=e.skewX?Math.tan(e.skewX):0,m=e.skewY?Math.tan(-e.skewY):0;if(n||i||s||l){var _=n+s,x=i+l;t[4]=-_*a-g*x*o,t[5]=-x*o-m*_*a}else t[4]=t[5]=0;return t[0]=a,t[3]=o,t[1]=m*a,t[2]=g*o,u&&Yu(t,t,u),t[4]+=n+d,t[5]+=i+f,t},r.initDefaultProps=function(){var e=r.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0}(),r}(),ss=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function cI(r,e){for(var t=0;t=0?parseFloat(r)/100*e:parseFloat(r):r}function uy(r,e,t){var n=e.position||"inside",i=e.distance!=null?e.distance:5,a=t.height,o=t.width,s=a/2,l=t.x,u=t.y,d="left",f="top";if(n instanceof Array)l+=Vo(n[0],t.width),u+=Vo(n[1],t.height),d=null,f=null;else switch(n){case"left":l-=i,u+=s,d="right",f="middle";break;case"right":l+=i+o,u+=s,f="middle";break;case"top":l+=o/2,u-=i,d="center",f="bottom";break;case"bottom":l+=o/2,u+=a+i,d="center";break;case"inside":l+=o/2,u+=s,d="center",f="middle";break;case"insideLeft":l+=i,u+=s,f="middle";break;case"insideRight":l+=o-i,u+=s,d="right",f="middle";break;case"insideTop":l+=o/2,u+=i,d="center";break;case"insideBottom":l+=o/2,u+=a-i,d="center",f="bottom";break;case"insideTopLeft":l+=i,u+=i;break;case"insideTopRight":l+=o-i,u+=i,d="right";break;case"insideBottomLeft":l+=i,u+=a-i,f="bottom";break;case"insideBottomRight":l+=o-i,u+=a-i,d="right",f="bottom";break}return r=r||{},r.x=l,r.y=u,r.align=d,r.verticalAlign=f,r}var Kh={},mw="__zr_normal__",yw=ss.concat(["ignore"]),EH=is(ss,function(r,e){return r[e]=!0,r},{ignore:!1}),Jh={},CH=new sr(0,0,0,0),cy=function(){function r(e){this.id=dM(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return r.prototype._init=function(e){this.attr(e)},r.prototype.drift=function(e,t,n){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=e,i[5]+=t,this.decomposeTransform(),this.markRedraw()},r.prototype.beforeUpdate=function(){},r.prototype.afterUpdate=function(){},r.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},r.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,i=n.local,a=t.innerTransformable,o=void 0,s=void 0,l=!1;a.parent=i?this:null;var u=!1;if(a.copyTransform(t),n.position!=null){var d=CH;n.layoutRect?d.copy(n.layoutRect):d.copy(this.getBoundingRect()),i||d.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Jh,n,d):uy(Jh,n,d),a.x=Jh.x,a.y=Jh.y,o=Jh.align,s=Jh.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var g=void 0,m=void 0;f==="center"?(g=d.width*.5,m=d.height*.5):(g=Vo(f[0],d.width),m=Vo(f[1],d.height)),u=!0,a.originX=-a.x+g+(i?0:d.x),a.originY=-a.y+m+(i?0:d.y)}}n.rotation!=null&&(a.rotation=n.rotation);var _=n.offset;_&&(a.x+=_[0],a.y+=_[1],u||(a.originX=-_[0],a.originY=-_[1]));var x=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,w=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),C=void 0,A=void 0,L=void 0;x&&this.canBeInsideText()?(C=n.insideFill,A=n.insideStroke,(C==null||C==="auto")&&(C=this.getInsideTextFill()),(A==null||A==="auto")&&(A=this.getInsideTextStroke(C),L=!0)):(C=n.outsideFill,A=n.outsideStroke,(C==null||C==="auto")&&(C=this.getOutsideFill()),(A==null||A==="auto")&&(A=this.getOutsideStroke(C),L=!0)),C=C||"#000",(C!==w.fill||A!==w.stroke||L!==w.autoStroke||o!==w.align||s!==w.verticalAlign)&&(l=!0,w.fill=C,w.stroke=A,w.autoStroke=L,w.align=o,w.verticalAlign=s,t.setDefaultTextStyle(w)),t.__dirty|=Ba,l&&t.dirtyStyle(!0)}},r.prototype.canBeInsideText=function(){return!0},r.prototype.getInsideTextFill=function(){return"#fff"},r.prototype.getInsideTextStroke=function(e){return"#000"},r.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?pw:fw},r.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t=="string"&&Va(t);n||(n=[255,255,255,1]);for(var i=n[3],a=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*i+(a?0:255)*(1-i);return n[3]=1,Bs(n,"rgba")},r.prototype.traverse=function(e,t){},r.prototype.attrKV=function(e,t){e==="textConfig"?this.setTextConfig(t):e==="textContent"?this.setTextContent(t):e==="clipPath"?this.setClipPath(t):e==="extra"?(this.extra=this.extra||{},Ge(this.extra,t)):this[e]=t},r.prototype.hide=function(){this.ignore=!0,this.markRedraw()},r.prototype.show=function(){this.ignore=!1,this.markRedraw()},r.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(Nt(e))for(var n=e,i=br(n),a=0;a0},r.prototype.getState=function(e){return this.states[e]},r.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},r.prototype.clearStates=function(e){this.useState(mw,!1,e)},r.prototype.useState=function(e,t,n,i){var a=e===mw,o=this.hasState();if(!(!o&&a)){var s=this.currentStates,l=this.stateTransition;if(!(hr(s,e)>=0&&(t||s.length===1))){var u;if(this.stateProxy&&!a&&(u=this.stateProxy(e)),u||(u=this.states&&this.states[e]),!u&&!a){No("State "+e+" not exists.");return}a||this.saveCurrentToNormalState(u);var d=!!(u&&u.hoverLayer||i);d&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,u,this._normalState,t,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,g=this._textGuide;return f&&f.useState(e,t,n,d),g&&g.useState(e,t,n,d),a?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Ba),u}}},r.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var i=[],a=this.currentStates,o=e.length,s=o===a.length;if(s){for(var l=0;l0,_);var x=this._textContent,w=this._textGuide;x&&x.useStates(e,t,g),w&&w.useStates(e,t,g),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!g&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Ba)}},r.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},r.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},r.prototype.replaceState=function(e,t,n){var i=this.currentStates.slice(),a=hr(i,e),o=hr(i,t)>=0;a>=0?o?i.splice(a,1):i[a]=t:n&&!o&&i.push(t),this.useStates(i)},r.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},r.prototype._mergeStates=function(e){for(var t={},n,i=0;i=0&&a.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},r.prototype.updateDuringAnimation=function(e){this.markRedraw()},r.prototype.stopAnimation=function(e,t){for(var n=this.animators,i=n.length,a=[],o=0;o0&&t.during&&a[0].during(function(_,x){t.during(x)});for(var g=0;g0||i.force&&!o.length){var H=void 0,Z=void 0,j=void 0;if(s){Z={},g&&(H={});for(var O=0;O=0&&(i.splice(a,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,n){var i=hr(this._children,t);return i>=0&&this.replaceAt(n,i),this},e.prototype.replaceAt=function(t,n){var i=this._children,a=i[n];if(t&&t!==this&&t.parent!==this&&t!==a){i[n]=t,a.parent=null;var o=this.__zr;o&&a.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var n=this.__zr;n&&n!==t.__zr&&t.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(t){var n=this.__zr,i=this._children,a=hr(i,t);return a<0?this:(i.splice(a,1),t.parent=null,n&&t.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,n=this.__zr,i=0;i0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},r.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},r.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},r.prototype.refreshHover=function(){this._needsRefreshHover=!0},r.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},r.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},r.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},r.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},r.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},r.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},r.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},r.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},r.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},r.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},r.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(r<=i)return o;if(r>=a)return s}else{if(r>=i)return o;if(r<=a)return s}else{if(r===i)return o;if(r===a)return s}return(r-i)/l*u+o}function nt(r,e){switch(r){case"center":case"middle":r="50%";break;case"left":case"top":r="0%";break;case"right":case"bottom":r="100%";break}return ut(r)?VH(r).match(/%$/)?parseFloat(r)/100*e:parseFloat(r):r==null?NaN:+r}function Ln(r,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),mI),r=(+r).toFixed(e),t?r:+r}function lo(r){return r.sort(function(e,t){return e-t}),r}function ls(r){if(r=+r,isNaN(r))return 0;if(r>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(r*e)/e===r)return t}return ww(r)}function ww(r){var e=r.toString().toLowerCase(),t=e.indexOf("e"),n=t>0?+e.slice(t+1):0,i=t>0?t:e.length,a=e.indexOf("."),o=a<0?0:i-1-a;return Math.max(0,o-n)}function yI(r,e){var t=Math.log,n=Math.LN10,i=Math.floor(t(r[1]-r[0])/n),a=Math.round(t(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function FH(r,e){var t=is(r,function(m,_){return m+(isNaN(_)?0:_)},0);if(t===0)return[];for(var n=Math.pow(10,e),i=je(r,function(m){return(isNaN(m)?0:m)/t*n*100}),a=n*100,o=je(i,function(m){return Math.floor(m)}),s=is(o,function(m,_){return m+_},0),l=je(i,function(m,_){return m-o[_]});su&&(u=l[f],d=f);++o[d],l[d]=0,++s}return je(o,function(m){return m/n})}function $H(r,e){var t=Math.max(ls(r),ls(e)),n=r+e;return t>mI?n:Ln(n,t)}var _I=9007199254740991;function bI(r){var e=Math.PI*2;return(r%e+e)%e}function Sp(r){return r>-vI&&r=10&&e++,e}function xI(r,e){var t=hy(r),n=Math.pow(10,t),i=r/n,a;return i<1.5?a=1:i<2.5?a=2:i<4?a=3:i<7?a=5:a=10,r=a*n,t>=-20?+r.toFixed(t<0?-t:0):r}function Sw(r,e){var t=(r.length-1)*e+1,n=Math.floor(t),i=+r[n-1],a=t-n;return a?i+a*(r[n]-i):i}function wI(r){r.sort(function(l,u){return s(l,u,0)?-1:1});for(var e=-1/0,t=1,n=0;n=0||a&&hr(a,l)<0)){var u=n.getShallow(l,e);u!=null&&(o[r[s][0]]=u)}}return o}}var vW=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],mW=sc(vW),yW=function(){function r(){}return r.prototype.getAreaStyle=function(e,t){return mW(this,e,t)},r}(),Lw=new fp(50);function _W(r){if(typeof r=="string"){var e=Lw.get(r);return e&&e.image}else return r}function Pw(r,e,t,n,i){if(r)if(typeof r=="string"){if(e&&e.__zrImageSrc===r||!t)return e;var a=Lw.get(r),o={hostEl:t,cb:n,cbPayload:i};return a?(e=a.image,!py(e)&&a.pending.push(o)):(e=Tl.loadImage(r,VI,VI),e.__zrImageSrc=r,Lw.put(r,e.__cachedImgObj={image:e,pending:[o]})),e}else return r;else return e}function VI(){var r=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e=o;l++)s-=o;var u=Fa(t,e);return u>s&&(t="",u=0),s=r-u,i.ellipsis=t,i.ellipsisWidth=u,i.contentWidth=s,i.containerWidth=r,i}function $I(r,e,t){var n=t.containerWidth,i=t.font,a=t.contentWidth;if(!n){r.textLine="",r.isTruncated=!1;return}var o=Fa(e,i);if(o<=n){r.textLine=e,r.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=t.maxIterations){e+=t.ellipsis;break}var l=s===0?xW(e,a,t.ascCharWidth,t.cnCharWidth):o>0?Math.floor(e.length*a/o):0;e=e.substr(0,l),o=Fa(e,i)}e===""&&(e=t.placeholder),r.textLine=e,r.isTruncated=!0}function xW(r,e,t,n){for(var i=0,a=0,o=r.length;a_&&u){var x=Math.floor(_/s);d=d||g.length>x,g=g.slice(0,x)}if(r&&a&&f!=null)for(var w=FI(f,i,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),C={},A=0;As&&Nw(t,r.substring(s,u),e,o),Nw(t,l[2],e,o,l[1]),s=Rw.lastIndex}si){var ae=t.lines.length;F>0?(L.tokens=L.tokens.slice(0,F),C(L,V,O),t.lines=t.lines.slice(0,A+1)):t.lines=t.lines.slice(0,A),t.isTruncated=t.isTruncated||t.lines.length0&&_+n.accumWidth>n.width&&(d=e.split(` `),u=!0),n.accumWidth=_}else{var x=UI(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=x.accumWidth+m,f=x.linesWidths,d=x.lines}}else d=e.split(` `);for(var w=0;w=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var AW=is(",&?/;] ".split(""),function(r,e){return r[e]=!0,r},{});function DW(r){return CW(r)?!!AW[r]:!0}function UI(r,e,t,n,i){for(var a=[],o=[],s="",l="",u=0,d=0,f=0;ft:i+d+m>t){d?(s||l)&&(_?(s||(s=l,l="",u=0,d=u),a.push(s),o.push(d-u),l+=g,u+=m,s="",d=u):(l&&(s+=l,l="",u=0),a.push(s),o.push(d),s=g,d=m)):_?(a.push(l),o.push(u),l=g,u=m):(a.push(g),o.push(m));continue}d+=m,_?(l+=g,u+=m):(l&&(s+=l,l="",u=0),s+=g)}return!a.length&&!s&&(s=r,l="",u=0),l&&(s+=l),s&&(a.push(s),o.push(d)),a.length===1&&(d+=i),{accumWidth:d,lines:a,linesWidths:o}}var Ow="__zr_style_"+Math.round(Math.random()*10),lc={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},gy={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};lc[Ow]=!0;var HI=["z","z2","invisible"],MW=["invisible"],uo=function(r){hn(e,r);function e(t){return r.call(this,t)||this}return e.prototype._init=function(t){for(var n=br(t),i=0;i1e-4){s[0]=r-t,s[1]=e-n,l[0]=r+t,l[1]=e+n;return}if(vy[0]=Fw(i)*t+r,vy[1]=Vw(i)*n+e,my[0]=Fw(a)*t+r,my[1]=Vw(a)*n+e,u(s,vy,my),d(l,vy,my),i=i%uc,i<0&&(i=i+uc),a=a%uc,a<0&&(a=a+uc),i>a&&!o?a+=uc:ii&&(yy[0]=Fw(m)*t+r,yy[1]=Vw(m)*n+e,u(s,yy,s),d(l,yy,l))}var rn={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},cc=[],hc=[],hs=[],Pl=[],ds=[],fs=[],$w=Math.min,Gw=Math.max,dc=Math.cos,fc=Math.sin,Gs=Math.abs,Uw=Math.PI,Rl=Uw*2,Hw=typeof Float32Array<"u",Ap=[];function Ww(r){var e=Math.round(r/Uw*1e8)/1e8;return e%2*Uw}function qw(r,e){var t=Ww(r[0]);t<0&&(t+=Rl);var n=t-r[0],i=r[1];i+=n,!e&&i-t>=Rl?i=t+Rl:e&&t-i>=Rl?i=t-Rl:!e&&t>i?i=t+(Rl-Ww(t-i)):e&&t0&&(this._ux=Gs(n/sy/e)||0,this._uy=Gs(n/sy/t)||0)},r.prototype.setDPR=function(e){this.dpr=e},r.prototype.setContext=function(e){this._ctx=e},r.prototype.getContext=function(){return this._ctx},r.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},r.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},r.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(rn.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},r.prototype.lineTo=function(e,t){var n=Gs(e-this._xi),i=Gs(t-this._yi),a=n>this._ux||i>this._uy;if(this.addData(rn.L,e,t),this._ctx&&a&&this._ctx.lineTo(e,t),a)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var o=n*n+i*i;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=o)}return this},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){return this._drawPendingPt(),this.addData(rn.C,e,t,n,i,a,o),this._ctx&&this._ctx.bezierCurveTo(e,t,n,i,a,o),this._xi=a,this._yi=o,this},r.prototype.quadraticCurveTo=function(e,t,n,i){return this._drawPendingPt(),this.addData(rn.Q,e,t,n,i),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,i),this._xi=n,this._yi=i,this},r.prototype.arc=function(e,t,n,i,a,o){this._drawPendingPt(),Ap[0]=i,Ap[1]=a,qw(Ap,o),i=Ap[0],a=Ap[1];var s=a-i;return this.addData(rn.A,e,t,n,n,i,s,0,o?0:1),this._ctx&&this._ctx.arc(e,t,n,i,a,o),this._xi=dc(a)*n+e,this._yi=fc(a)*n+t,this},r.prototype.arcTo=function(e,t,n,i,a){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,i,a),this},r.prototype.rect=function(e,t,n,i){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,i),this.addData(rn.R,e,t,n,i),this},r.prototype.closePath=function(){this._drawPendingPt(),this.addData(rn.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},r.prototype.fill=function(e){e&&e.fill(),this.toStatic()},r.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},r.prototype.len=function(){return this._len},r.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&Hw&&(this.data=new Float32Array(t));for(var n=0;nd.length&&(this._expandData(),d=this.data);for(var f=0;f0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},r.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},r.prototype.getBoundingRect=function(){hs[0]=hs[1]=ds[0]=ds[1]=Number.MAX_VALUE,Pl[0]=Pl[1]=fs[0]=fs[1]=-Number.MAX_VALUE;var e=this.data,t=0,n=0,i=0,a=0,o;for(o=0;on||Gs(L)>i||g===t-1)&&(x=Math.sqrt(A*A+L*L),a=w,o=C);break}case rn.C:{var O=e[g++],V=e[g++],w=e[g++],C=e[g++],F=e[g++],$=e[g++];x=j8(a,o,O,V,w,C,F,$,10),a=F,o=$;break}case rn.Q:{var O=e[g++],V=e[g++],w=e[g++],C=e[g++];x=Y8(a,o,O,V,w,C,10),a=w,o=C;break}case rn.A:var H=e[g++],Z=e[g++],j=e[g++],Y=e[g++],se=e[g++],ae=e[g++],ue=ae+se;g+=1,_&&(s=dc(se)*j+H,l=fc(se)*Y+Z),x=Gw(j,Y)*$w(Rl,Math.abs(ae)),a=dc(ue)*j+H,o=fc(ue)*Y+Z;break;case rn.R:{s=a=e[g++],l=o=e[g++];var fe=e[g++],le=e[g++];x=fe*2+le*2;break}case rn.Z:{var A=s-a,L=l-o;x=Math.sqrt(A*A+L*L),a=s,o=l;break}}x>=0&&(u[f++]=x,d+=x)}return this._pathLen=d,d},r.prototype.rebuildPath=function(e,t){var n=this.data,i=this._ux,a=this._uy,o=this._len,s,l,u,d,f,g,m=t<1,_,x,w=0,C=0,A,L=0,O,V;if(!(m&&(this._pathSegLen||this._calculateLength(),_=this._pathSegLen,x=this._pathLen,A=t*x,!A)))e:for(var F=0;F0&&(e.lineTo(O,V),L=0),$){case rn.M:s=u=n[F++],l=d=n[F++],e.moveTo(u,d);break;case rn.L:{f=n[F++],g=n[F++];var Z=Gs(f-u),j=Gs(g-d);if(Z>i||j>a){if(m){var Y=_[C++];if(w+Y>A){var se=(A-w)/Y;e.lineTo(u*(1-se)+f*se,d*(1-se)+g*se);break e}w+=Y}e.lineTo(f,g),u=f,d=g,L=0}else{var ae=Z*Z+j*j;ae>L&&(O=f,V=g,L=ae)}break}case rn.C:{var ue=n[F++],fe=n[F++],le=n[F++],ge=n[F++],xe=n[F++],Me=n[F++];if(m){var Y=_[C++];if(w+Y>A){var se=(A-w)/Y;Il(u,ue,le,xe,se,cc),Il(d,fe,ge,Me,se,hc),e.bezierCurveTo(cc[1],hc[1],cc[2],hc[2],cc[3],hc[3]);break e}w+=Y}e.bezierCurveTo(ue,fe,le,ge,xe,Me),u=xe,d=Me;break}case rn.Q:{var ue=n[F++],fe=n[F++],le=n[F++],ge=n[F++];if(m){var Y=_[C++];if(w+Y>A){var se=(A-w)/Y;dp(u,ue,le,se,cc),dp(d,fe,ge,se,hc),e.quadraticCurveTo(cc[1],hc[1],cc[2],hc[2]);break e}w+=Y}e.quadraticCurveTo(ue,fe,le,ge),u=le,d=ge;break}case rn.A:var Ve=n[F++],Fe=n[F++],Xe=n[F++],ot=n[F++],et=n[F++],it=n[F++],kt=n[F++],Ht=!n[F++],lt=Xe>ot?Xe:ot,st=Gs(Xe-ot)>.001,Ct=et+it,rt=!1;if(m){var Y=_[C++];w+Y>A&&(Ct=et+it*(A-w)/Y,rt=!0),w+=Y}if(st&&e.ellipse?e.ellipse(Ve,Fe,Xe,ot,kt,et,Ct,Ht):e.arc(Ve,Fe,lt,et,Ct,Ht),rt)break e;H&&(s=dc(et)*Xe+Ve,l=fc(et)*ot+Fe),u=dc(Ct)*Xe+Ve,d=fc(Ct)*ot+Fe;break;case rn.R:s=u=n[F],l=d=n[F+1],f=n[F++],g=n[F++];var vt=n[F++],Qe=n[F++];if(m){var Y=_[C++];if(w+Y>A){var Ft=A-w;e.moveTo(f,g),e.lineTo(f+$w(Ft,vt),g),Ft-=vt,Ft>0&&e.lineTo(f+vt,g+$w(Ft,Qe)),Ft-=Qe,Ft>0&&e.lineTo(f+Gw(vt-Ft,0),g+Qe),Ft-=vt,Ft>0&&e.lineTo(f,g+Gw(Qe-Ft,0));break e}w+=Y}e.rect(f,g,vt,Qe);break;case rn.Z:if(m){var Y=_[C++];if(w+Y>A){var se=(A-w)/Y;e.lineTo(u*(1-se)+s*se,d*(1-se)+l*se);break e}w+=Y}e.closePath(),u=s,d=l}}},r.prototype.clone=function(){var e=new r,t=this.data;return e.data=t.slice?t.slice():Array.prototype.slice.call(t),e._len=this._len,e},r.CMD=rn,r.initDefaultProps=function(){var e=r.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0}(),r}();function Nl(r,e,t,n,i,a,o){if(i===0)return!1;var s=i,l=0,u=r;if(o>e+s&&o>n+s||or+s&&a>t+s||ae+f&&d>n+f&&d>a+f&&d>s+f||dr+f&&u>t+f&&u>i+f&&u>o+f||ue+u&&l>n+u&&l>a+u||lr+u&&s>t+u&&s>i+u||st||d+ui&&(i+=Dp);var g=Math.atan2(l,s);return g<0&&(g+=Dp),g>=n&&g<=i||g+Dp>=n&&g+Dp<=i}function Us(r,e,t,n,i,a){if(a>e&&a>n||ai?s:0}var Ol=ps.CMD,pc=Math.PI*2,OW=1e-4;function zW(r,e){return Math.abs(r-e)e&&u>n&&u>a&&u>s||u1&&BW(),m=ti(e,n,a,s,co[0]),g>1&&(_=ti(e,n,a,s,co[1]))),g===2?we&&s>n&&s>a||s=0&&u<=1){for(var d=0,f=hi(e,n,a,u),g=0;gt||s<-t)return 0;var l=Math.sqrt(t*t-s*s);Ji[0]=-l,Ji[1]=l;var u=Math.abs(n-i);if(u<1e-4)return 0;if(u>=pc-1e-4){n=0,i=pc;var d=a?1:-1;return o>=Ji[0]+r&&o<=Ji[1]+r?d:0}if(n>i){var f=n;n=i,i=f}n<0&&(n+=pc,i+=pc);for(var g=0,m=0;m<2;m++){var _=Ji[m];if(_+r>o){var x=Math.atan2(s,_),d=a?1:-1;x<0&&(x=pc+x),(x>=n&&x<=i||x+pc>=n&&x+pc<=i)&&(x>Math.PI/2&&x1&&(t||(s+=Us(l,u,d,f,n,i))),w&&(l=a[_],u=a[_+1],d=l,f=u),x){case Ol.M:d=a[_++],f=a[_++],l=d,u=f;break;case Ol.L:if(t){if(Nl(l,u,a[_],a[_+1],e,n,i))return!0}else s+=Us(l,u,a[_],a[_+1],n,i)||0;l=a[_++],u=a[_++];break;case Ol.C:if(t){if(RW(l,u,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],e,n,i))return!0}else s+=VW(l,u,a[_++],a[_++],a[_++],a[_++],a[_],a[_+1],n,i)||0;l=a[_++],u=a[_++];break;case Ol.Q:if(t){if(jI(l,u,a[_++],a[_++],a[_],a[_+1],e,n,i))return!0}else s+=FW(l,u,a[_++],a[_++],a[_],a[_+1],n,i)||0;l=a[_++],u=a[_++];break;case Ol.A:var C=a[_++],A=a[_++],L=a[_++],O=a[_++],V=a[_++],F=a[_++];_+=1;var $=!!(1-a[_++]);g=Math.cos(V)*L+C,m=Math.sin(V)*O+A,w?(d=g,f=m):s+=Us(l,u,g,m,n,i);var H=(n-C)*O/L+C;if(t){if(NW(C,A,O,V,V+F,$,e,H,i))return!0}else s+=$W(C,A,O,V,V+F,$,H,i);l=Math.cos(V+F)*L+C,u=Math.sin(V+F)*O+A;break;case Ol.R:d=l=a[_++],f=u=a[_++];var Z=a[_++],j=a[_++];if(g=d+Z,m=f+j,t){if(Nl(d,f,g,f,e,n,i)||Nl(g,f,g,m,e,n,i)||Nl(g,m,d,m,e,n,i)||Nl(d,m,d,f,e,n,i))return!0}else s+=Us(g,f,g,m,n,i),s+=Us(d,m,d,f,n,i);break;case Ol.Z:if(t){if(Nl(l,u,d,f,e,n,i))return!0}else s+=Us(l,u,d,f,n,i);l=d,u=f;break}}return!t&&!zW(u,f)&&(s+=Us(l,u,d,f,n,i)||0),s!==0}function GW(r,e,t){return YI(r,0,!1,e,t)}function UW(r,e,t,n){return YI(r,e,!0,t,n)}var by=Bt({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},lc),HW={style:Bt({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},gy.style)},Zw=ss.concat(["invisible","culling","z","z2","zlevel","parent"]),vr=function(r){hn(e,r);function e(t){return r.call(this,t)||this}return e.prototype.update=function(){var t=this;r.prototype.update.call(this);var n=this.style;if(n.decal){var i=this._decalEl=this._decalEl||new e;i.buildPath===e.prototype.buildPath&&(i.buildPath=function(l){t.buildPath(l,t.shape)}),i.silent=!0;var a=i.style;for(var o in n)a[o]!==n[o]&&(a[o]=n[o]);a.fill=n.fill?n.decal:null,a.decal=null,a.shadowColor=null,n.strokeFirst&&(a.stroke=null);for(var s=0;s.5?fw:n>.2?TH:pw}else if(t)return pw}return fw},e.prototype.getInsideTextStroke=function(t){var n=this.style.fill;if(ut(n)){var i=this.__zr,a=!!(i&&i.isDarkMode()),o=Km(t,0)0))},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var t=this._rect,n=this.style,i=!t;if(i){var a=!1;this.path||(a=!0,this.createPathProxy());var o=this.path;(a||this.__dirty&Wh)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),t=o.getBoundingRect()}if(this._rect=t,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=t.clone());if(this.__dirty||i){s.copy(t);var l=n.strokeNoScale?this.getLineScale():1,u=n.lineWidth;if(!this.hasFill()){var d=this.strokeContainThreshold;u=Math.max(u,d??4)}l>1e-10&&(s.width+=u/l,s.height+=u/l,s.x-=u/l/2,s.y-=u/l/2)}return s}return t},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect(),o=this.style;if(t=i[0],n=i[1],a.contain(t,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,u=o.strokeNoScale?this.getLineScale():1;if(u>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),UW(s,l/u,t,n)))return!0}if(this.hasFill())return GW(s,t,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Wh,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(t){return this.animate("shape",t)},e.prototype.updateDuringAnimation=function(t){t==="style"?this.dirtyStyle():t==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(t,n){t==="shape"?this.setShape(n):r.prototype.attrKV.call(this,t,n)},e.prototype.setShape=function(t,n){var i=this.shape;return i||(i=this.shape={}),typeof t=="string"?i[t]=n:Ge(i,t),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Wh)},e.prototype.createStyle=function(t){return Om(by,t)},e.prototype._innerSaveToNormal=function(t){r.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=Ge({},this.shape))},e.prototype._applyStateObj=function(t,n,i,a,o,s){r.prototype._applyStateObj.call(this,t,n,i,a,o,s);var l=!(n&&a),u;if(n&&n.shape?o?a?u=n.shape:(u=Ge({},i.shape),Ge(u,n.shape)):(u=Ge({},a?this.shape:i.shape),Ge(u,n.shape)):l&&(u=i.shape),u)if(o){this.shape=Ge({},this.shape);for(var d={},f=br(u),g=0;g0},e.prototype.hasFill=function(){var t=this.style,n=t.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(t){return Om(WW,t)},e.prototype.setBoundingRect=function(t){this._rect=t},e.prototype.getBoundingRect=function(){var t=this.style;if(!this._rect){var n=t.text;n!=null?n+="":n="";var i=bp(n,t.font,t.textAlign,t.textBaseline);if(i.x+=t.x||0,i.y+=t.y||0,this.hasStroke()){var a=t.lineWidth;i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a}this._rect=i}return this._rect},e.initDefaultProps=function(){var t=e.prototype;t.dirtyRectTolerance=10}(),e}(uo);td.prototype.type="tspan";var qW=Bt({x:0,y:0},lc),ZW={style:Bt({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},gy.style)};function jW(r){return!!(r&&typeof r!="string"&&r.width&&r.height)}var di=function(r){hn(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.createStyle=function(t){return Om(qW,t)},e.prototype._getSize=function(t){var n=this.style,i=n[t];if(i!=null)return i;var a=jW(n.image)?n.image:this.__image;if(!a)return 0;var o=t==="width"?"height":"width",s=n[o];return s==null?a[t]:a[t]/a[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return ZW},e.prototype.getBoundingRect=function(){var t=this.style;return this._rect||(this._rect=new sr(t.x||0,t.y||0,this.getWidth(),this.getHeight())),this._rect},e}(uo);di.prototype.type="image";function XW(r,e){var t=e.x,n=e.y,i=e.width,a=e.height,o=e.r,s,l,u,d;i<0&&(t=t+i,i=-i),a<0&&(n=n+a,a=-a),typeof o=="number"?s=l=u=d=o:o instanceof Array?o.length===1?s=l=u=d=o[0]:o.length===2?(s=u=o[0],l=d=o[1]):o.length===3?(s=o[0],l=d=o[1],u=o[2]):(s=o[0],l=o[1],u=o[2],d=o[3]):s=l=u=d=0;var f;s+l>i&&(f=s+l,s*=i/f,l*=i/f),u+d>i&&(f=u+d,u*=i/f,d*=i/f),l+u>a&&(f=l+u,l*=a/f,u*=a/f),s+d>a&&(f=s+d,s*=a/f,d*=a/f),r.moveTo(t+s,n),r.lineTo(t+i-l,n),l!==0&&r.arc(t+i-l,n+l,l,-Math.PI/2,0),r.lineTo(t+i,n+a-u),u!==0&&r.arc(t+i-u,n+a-u,u,0,Math.PI/2),r.lineTo(t+d,n+a),d!==0&&r.arc(t+d,n+a-d,d,Math.PI/2,Math.PI),r.lineTo(t,n+s),s!==0&&r.arc(t+s,n+s,s,Math.PI,Math.PI*1.5)}var rd=Math.round;function KI(r,e,t){if(e){var n=e.x1,i=e.x2,a=e.y1,o=e.y2;r.x1=n,r.x2=i,r.y1=a,r.y2=o;var s=t&&t.lineWidth;return s&&(rd(n*2)===rd(i*2)&&(r.x1=r.x2=gc(n,s,!0)),rd(a*2)===rd(o*2)&&(r.y1=r.y2=gc(a,s,!0))),r}}function JI(r,e,t){if(e){var n=e.x,i=e.y,a=e.width,o=e.height;r.x=n,r.y=i,r.width=a,r.height=o;var s=t&&t.lineWidth;return s&&(r.x=gc(n,s,!0),r.y=gc(i,s,!0),r.width=Math.max(gc(n+a,s,!1)-r.x,a===0?0:1),r.height=Math.max(gc(i+o,s,!1)-r.y,o===0?0:1)),r}}function gc(r,e,t){if(!e)return r;var n=rd(r*2);return(n+rd(e))%2===0?n/2:(n+(t?1:-1))/2}var YW=function(){function r(){this.x=0,this.y=0,this.width=0,this.height=0}return r}(),KW={},Ar=function(r){hn(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new YW},e.prototype.buildPath=function(t,n){var i,a,o,s;if(this.subPixelOptimize){var l=JI(KW,n,this.style);i=l.x,a=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else i=n.x,a=n.y,o=n.width,s=n.height;n.r?XW(t,n):t.rect(i,a,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e}(vr);Ar.prototype.type="rect";var JW={},QI={fill:"#000"},ek=2,QW={style:Bt({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},gy.style)},Dr=function(r){hn(e,r);function e(t){var n=r.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=QI,n.attr(t),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){r.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,se=t.width!=null&&(t.overflow==="truncate"||t.overflow==="break"||t.overflow==="breakAll"),ae=o.calculatedLineHeight,ue=0;ue=0&&(ue=F[ae],ue.align==="right");)this._placeToken(ue,t,H,C,se,"right",L),Z-=ue.width,se-=ue.width,ae--;for(Y+=(a-(Y-w)-(A-se)-Z)/2;j<=ae;)ue=F[j],this._placeToken(ue,t,H,C,Y+ue.width/2,"center",L),Y+=ue.width,j++;C+=H}},e.prototype._placeToken=function(t,n,i,a,o,s,l){var u=n.rich[t.styleName]||{};u.text=t.text;var d=t.verticalAlign,f=a+i/2;d==="top"?f=a+t.height/2:d==="bottom"&&(f=a+i-t.height/2);var g=!t.isLineHolder&&jw(u);g&&this._renderBackground(u,n,s==="right"?o-t.width:s==="center"?o-t.width/2:o,f-t.height/2,t.width,t.height);var m=!!u.backgroundColor,_=t.textPadding;_&&(o=lk(o,s,_),f-=t.height/2-_[0]-t.innerHeight/2);var x=this._getOrCreateChild(td),w=x.createStyle();x.useStyle(w);var C=this._defaultStyle,A=!1,L=0,O=sk("fill"in u?u.fill:"fill"in n?n.fill:(A=!0,C.fill)),V=ok("stroke"in u?u.stroke:"stroke"in n?n.stroke:!m&&!l&&(!C.autoStroke||A)?(L=ek,C.stroke):null),F=u.textShadowBlur>0||n.textShadowBlur>0;w.text=t.text,w.x=o,w.y=f,F&&(w.shadowBlur=u.textShadowBlur||n.textShadowBlur||0,w.shadowColor=u.textShadowColor||n.textShadowColor||"transparent",w.shadowOffsetX=u.textShadowOffsetX||n.textShadowOffsetX||0,w.shadowOffsetY=u.textShadowOffsetY||n.textShadowOffsetY||0),w.textAlign=s,w.textBaseline="middle",w.font=t.font||Sl,w.opacity=no(u.opacity,n.opacity,1),nk(w,u),V&&(w.lineWidth=no(u.lineWidth,n.lineWidth,L),w.lineDash=Zt(u.lineDash,n.lineDash),w.lineDashOffset=n.lineDashOffset||0,w.stroke=V),O&&(w.fill=O);var $=t.contentWidth,H=t.contentHeight;x.setBoundingRect(new sr(xp(w.x,$,w.textAlign),Yh(w.y,H,w.textBaseline),$,H))},e.prototype._renderBackground=function(t,n,i,a,o,s){var l=t.backgroundColor,u=t.borderWidth,d=t.borderColor,f=l&&l.image,g=l&&!f,m=t.borderRadius,_=this,x,w;if(g||t.lineHeight||u&&d){x=this._getOrCreateChild(Ar),x.useStyle(x.createStyle()),x.style.fill=null;var C=x.shape;C.x=i,C.y=a,C.width=o,C.height=s,C.r=m,x.dirtyShape()}if(g){var A=x.style;A.fill=l||null,A.fillOpacity=Zt(t.fillOpacity,1)}else if(f){w=this._getOrCreateChild(di),w.onload=function(){_.dirtyStyle()};var L=w.style;L.image=l.image,L.x=i,L.y=a,L.width=o,L.height=s}if(u&&d){var A=x.style;A.lineWidth=u,A.stroke=d,A.strokeOpacity=Zt(t.strokeOpacity,1),A.lineDash=t.borderDash,A.lineDashOffset=t.borderDashOffset||0,x.strokeContainThreshold=0,x.hasFill()&&x.hasStroke()&&(A.strokeFirst=!0,A.lineWidth*=2)}var O=(x||w).style;O.shadowBlur=t.shadowBlur||0,O.shadowColor=t.shadowColor||"transparent",O.shadowOffsetX=t.shadowOffsetX||0,O.shadowOffsetY=t.shadowOffsetY||0,O.opacity=no(t.opacity,n.opacity,1)},e.makeFont=function(t){var n="";return ik(t)&&(n=[t.fontStyle,t.fontWeight,rk(t.fontSize),t.fontFamily||"sans-serif"].join(" ")),n&&Oo(n)||t.textFont||t.font},e}(uo),e9={left:!0,right:1,center:1},t9={top:1,bottom:1,middle:1},tk=["fontStyle","fontWeight","fontSize","fontFamily"];function rk(r){return typeof r=="string"&&(r.indexOf("px")!==-1||r.indexOf("rem")!==-1||r.indexOf("em")!==-1)?r:isNaN(+r)?_x+"px":r+"px"}function nk(r,e){for(var t=0;t=0,a=!1;if(r instanceof vr){var o=dk(r),s=i&&o.selectFill||o.normalFill,l=i&&o.selectStroke||o.normalStroke;if(id(s)||id(l)){n=n||{};var u=n.style||{};u.fill==="inherit"?(a=!0,n=Ge({},n),u=Ge({},u),u.fill=s):!id(u.fill)&&id(s)?(a=!0,n=Ge({},n),u=Ge({},u),u.fill=Jx(s)):!id(u.stroke)&&id(l)&&(a||(n=Ge({},n),u=Ge({},u)),u.stroke=Jx(l)),n.style=u}}if(n&&n.z2==null){a||(n=Ge({},n));var d=r.z2EmphasisLift;n.z2=r.z2+(d??nd)}return n}function l9(r,e,t){if(t&&t.z2==null){t=Ge({},t);var n=r.z2SelectLift;t.z2=r.z2+(n??n9)}return t}function u9(r,e,t){var n=hr(r.currentStates,e)>=0,i=r.style.opacity,a=n?null:o9(r,["opacity"],e,{opacity:1});t=t||{};var o=t.style||{};return o.opacity==null&&(t=Ge({},t),o=Ge({opacity:n?i:a.opacity*.1},o),t.style=o),t}function Qw(r,e){var t=this.states[r];if(this.style){if(r==="emphasis")return s9(this,r,e,t);if(r==="blur")return u9(this,r,t);if(r==="select")return l9(this,r,t)}return t}function mc(r){r.stateProxy=Qw;var e=r.getTextContent(),t=r.getTextGuideLine();e&&(e.stateProxy=Qw),t&&(t.stateProxy=Qw)}function mk(r,e){!wk(r,e)&&!r.__highByOuter&&Hs(r,fk)}function yk(r,e){!wk(r,e)&&!r.__highByOuter&&Hs(r,pk)}function Ws(r,e){r.__highByOuter|=1<<(e||0),Hs(r,fk)}function qs(r,e){!(r.__highByOuter&=~(1<<(e||0)))&&Hs(r,pk)}function _k(r){Hs(r,Jw)}function e1(r){Hs(r,gk)}function bk(r){Hs(r,i9)}function xk(r){Hs(r,a9)}function wk(r,e){return r.__highDownSilentOnTouch&&e.zrByTouch}function Sk(r){var e=r.getModel(),t=[],n=[];e.eachComponent(function(i,a){var o=Yw(a),s=i==="series",l=s?r.getViewOfSeriesModel(a):r.getViewOfComponentModel(a);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(u){gk(u)}),s&&t.push(a)),o.isBlured=!1}),Q(n,function(i){i&&i.toggleBlurSeries&&i.toggleBlurSeries(t,!1,e)})}function t1(r,e,t,n){var i=n.getModel();t=t||"coordinateSystem";function a(u,d){for(var f=0;f0){var s={dataIndex:o,seriesIndex:t.seriesIndex};a!=null&&(s.dataType=a),e.push(s)}})}),e}function yc(r,e,t){_c(r,!0),Hs(r,mc),i1(r,e,t)}function g9(r){_c(r,!1)}function Sn(r,e,t,n){n?g9(r):yc(r,e,t)}function i1(r,e,t){var n=jt(r);e!=null?(n.focus=e,n.blurScope=t):n.focus&&(n.focus=null)}var Ek=["emphasis","blur","select"],v9={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function Ei(r,e,t,n){t=t||"itemStyle";for(var i=0;i1&&(o*=o1(_),s*=o1(_));var x=(i===a?-1:1)*o1((o*o*(s*s)-o*o*(m*m)-s*s*(g*g))/(o*o*(m*m)+s*s*(g*g)))||0,w=x*o*m/s,C=x*-s*g/o,A=(r+t)/2+Dy(f)*w-Ay(f)*C,L=(e+n)/2+Ay(f)*w+Dy(f)*C,O=Ik([1,0],[(g-w)/o,(m-C)/s]),V=[(g-w)/o,(m-C)/s],F=[(-1*g-w)/o,(-1*m-C)/s],$=Ik(V,F);if(s1(V,F)<=-1&&($=Pp),s1(V,F)>=1&&($=0),$<0){var H=Math.round($/Pp*1e6)/1e6;$=Pp*2+H%2*Pp}d.addData(u,A,L,o,s,O,$,f,a)}var w9=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,S9=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function T9(r){var e=new ps;if(!r)return e;var t=0,n=0,i=t,a=n,o,s=ps.CMD,l=r.match(w9);if(!l)return e;for(var u=0;uue*ue+fe*fe&&(H=j,Z=Y),{cx:H,cy:Z,x0:-d,y0:-f,x1:H*(i/V-1),y1:Z*(i/V-1)}}function k9(r){var e;if(Ze(r)){var t=r.length;if(!t)return r;t===1?e=[r[0],r[0],0,0]:t===2?e=[r[0],r[0],r[1],r[1]]:t===3?e=r.concat(r[2]):e=r}else e=[r,r,r,r];return e}function L9(r,e){var t,n=Np(e.r,0),i=Np(e.r0||0,0),a=n>0,o=i>0;if(!(!a&&!o)){if(a||(n=i,i=0),i>n){var s=n;n=i,i=s}var l=e.startAngle,u=e.endAngle;if(!(isNaN(l)||isNaN(u))){var d=e.cx,f=e.cy,g=!!e.clockwise,m=zk(u-l),_=m>u1&&m%u1;if(_>$o&&(m=_),!(n>$o))r.moveTo(d,f);else if(m>u1-$o)r.moveTo(d+n*od(l),f+n*bc(l)),r.arc(d,f,n,l,u,!g),i>$o&&(r.moveTo(d+i*od(u),f+i*bc(u)),r.arc(d,f,i,u,l,g));else{var x=void 0,w=void 0,C=void 0,A=void 0,L=void 0,O=void 0,V=void 0,F=void 0,$=void 0,H=void 0,Z=void 0,j=void 0,Y=void 0,se=void 0,ae=void 0,ue=void 0,fe=n*od(l),le=n*bc(l),ge=i*od(u),xe=i*bc(u),Me=m>$o;if(Me){var Ve=e.cornerRadius;Ve&&(t=k9(Ve),x=t[0],w=t[1],C=t[2],A=t[3]);var Fe=zk(n-i)/2;if(L=gs(Fe,C),O=gs(Fe,A),V=gs(Fe,x),F=gs(Fe,w),Z=$=Np(L,O),j=H=Np(V,F),($>$o||H>$o)&&(Y=n*od(u),se=n*bc(u),ae=i*od(l),ue=i*bc(l),m$o){var st=gs(C,Z),Ct=gs(A,Z),rt=Iy(ae,ue,fe,le,n,st,g),vt=Iy(Y,se,ge,xe,n,Ct,g);r.moveTo(d+rt.cx+rt.x0,f+rt.cy+rt.y0),Z<$&&st===Ct?r.arc(d+rt.cx,f+rt.cy,Z,Ni(rt.y0,rt.x0),Ni(vt.y0,vt.x0),!g):(st>0&&r.arc(d+rt.cx,f+rt.cy,st,Ni(rt.y0,rt.x0),Ni(rt.y1,rt.x1),!g),r.arc(d,f,n,Ni(rt.cy+rt.y1,rt.cx+rt.x1),Ni(vt.cy+vt.y1,vt.cx+vt.x1),!g),Ct>0&&r.arc(d+vt.cx,f+vt.cy,Ct,Ni(vt.y1,vt.x1),Ni(vt.y0,vt.x0),!g))}else r.moveTo(d+fe,f+le),r.arc(d,f,n,l,u,!g);if(!(i>$o)||!Me)r.lineTo(d+ge,f+xe);else if(j>$o){var st=gs(x,j),Ct=gs(w,j),rt=Iy(ge,xe,Y,se,i,-Ct,g),vt=Iy(fe,le,ae,ue,i,-st,g);r.lineTo(d+rt.cx+rt.x0,f+rt.cy+rt.y0),j0&&r.arc(d+rt.cx,f+rt.cy,Ct,Ni(rt.y0,rt.x0),Ni(rt.y1,rt.x1),!g),r.arc(d,f,i,Ni(rt.cy+rt.y1,rt.cx+rt.x1),Ni(vt.cy+vt.y1,vt.cx+vt.x1),g),st>0&&r.arc(d+vt.cx,f+vt.cy,st,Ni(vt.y1,vt.x1),Ni(vt.y0,vt.x0),!g))}else r.lineTo(d+ge,f+xe),r.arc(d,f,i,u,l,g)}r.closePath()}}}var P9=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return r}(),ea=function(r){hn(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new P9},e.prototype.buildPath=function(t,n){L9(t,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e}(vr);ea.prototype.type="sector";var R9=function(){function r(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return r}(),Op=function(r){hn(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new R9},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.PI*2;t.moveTo(i+n.r,a),t.arc(i,a,n.r,0,o,!1),t.moveTo(i+n.r0,a),t.arc(i,a,n.r0,0,o,!0)},e}(vr);Op.prototype.type="ring";function N9(r,e,t,n){var i=[],a=[],o=[],s=[],l,u,d,f;if(n){d=[1/0,1/0],f=[-1/0,-1/0];for(var g=0,m=r.length;g=2){if(n){var a=N9(i,n,t,e.smoothConstraint);r.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(t?o:o-1);s++){var l=a[s*2],u=a[s*2+1],d=i[(s+1)%o];r.bezierCurveTo(l[0],l[1],u[0],u[1],d[0],d[1])}}else{r.moveTo(i[0][0],i[0][1]);for(var s=1,f=i.length;swc[1]){if(s=!1,a)return s;var d=Math.abs(wc[0]-xc[1]),f=Math.abs(xc[0]-wc[1]);Math.min(d,f)>i.len()&&(d0){var f=d.duration,g=d.delay,m=d.easing,_={duration:f,delay:g||0,easing:m,done:a,force:!!a||!!o,setToFinal:!u,scope:r,during:o};s?e.animateFrom(t,_):e.animateTo(t,_)}else e.stopAnimation(),!s&&e.attr(t),o&&o(1),a&&a()}function Or(r,e,t,n,i,a){h1("update",r,e,t,n,i,a)}function yn(r,e,t,n,i,a){h1("enter",r,e,t,n,i,a)}function ld(r){if(!r.__zr)return!0;for(var e=0;eMath.abs(a[1])?a[0]>0?"right":"left":a[1]>0?"bottom":"top"}function Zk(r){return!r.isGroup}function X9(r){return r.shape!=null}function Fp(r,e,t){if(!r||!e)return;function n(o){var s={};return o.traverse(function(l){Zk(l)&&l.anid&&(s[l.anid]=l)}),s}function i(o){var s={x:o.x,y:o.y,rotation:o.rotation};return X9(o)&&(s.shape=Ge({},o.shape)),s}var a=n(r);e.traverse(function(o){if(Zk(o)&&o.anid){var s=a[o.anid];if(s){var l=i(o);o.attr(i(s)),Or(o,l,t,jt(o).dataIndex)}}})}function jk(r,e){return je(r,function(t){var n=t[0];n=Ny(n,e.x),n=Oy(n,e.x+e.width);var i=t[1];return i=Ny(i,e.y),i=Oy(i,e.y+e.height),[n,i]})}function Y9(r,e){var t=Ny(r.x,e.x),n=Oy(r.x+r.width,e.x+e.width),i=Ny(r.y,e.y),a=Oy(r.y+r.height,e.y+e.height);if(n>=t&&a>=i)return{x:t,y:i,width:n-t,height:a-i}}function $p(r,e,t){var n=Ge({rectHover:!0},e),i=n.style={strokeNoScale:!0};if(t=t||{x:-1,y:-1,width:2,height:2},r)return r.indexOf("image://")===0?(i.image=r.slice(8),Bt(i,t),new di(n)):zy(r.replace("path://",""),n,t,"center")}function Gp(r,e,t,n,i){for(var a=0,o=i[i.length-1];a1)return!1;var w=p1(m,_,d,f)/g;return!(w<0||w>1)}function p1(r,e,t,n){return r*n-t*e}function K9(r){return r<=1e-6&&r>=-1e-6}function Tc(r){var e=r.itemTooltipOption,t=r.componentModel,n=r.itemName,i=ut(e)?{formatter:e}:e,a=t.mainType,o=t.componentIndex,s={componentType:a,name:n,$vars:["name"]};s[a+"Index"]=o;var l=r.formatterParamsExtra;l&&Q(br(l),function(d){gt(s,d)||(s[d]=l[d],s.$vars.push(d))});var u=jt(r.el);u.componentMainType=a,u.componentIndex=o,u.tooltipConfig={name:n,option:Bt({content:n,encodeHTMLContent:!0,formatterParams:s},i)}}function Yk(r,e){var t;r.isGroup&&(t=e(r)),t||r.traverse(e)}function Vl(r,e){if(r)if(Ze(r))for(var t=0;t=0&&s.push(l)}),s}}function Fl(r,e){return rr(rr({},r,!0),e,!0)}const cq={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},hq={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var Uy="ZH",_1="EN",dd=_1,Hy={},b1={},oL=gr.domSupported?function(){var r=(document.documentElement.lang||navigator.language||navigator.browserLanguage||dd).toUpperCase();return r.indexOf(Uy)>-1?Uy:dd}():dd;function sL(r,e){r=r.toUpperCase(),b1[r]=new qr(e),Hy[r]=e}function dq(r){if(ut(r)){var e=Hy[r.toUpperCase()]||{};return r===Uy||r===_1?Ut(e):rr(Ut(e),Ut(Hy[dd]),!1)}else return rr(Ut(r),Ut(Hy[dd]),!1)}function x1(r){return b1[r]}function fq(){return b1[dd]}sL(_1,cq),sL(Uy,hq);var w1=1e3,S1=w1*60,Up=S1*60,fo=Up*24,lL=fo*365,Hp={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Wy="{yyyy}-{MM}-{dd}",uL={year:"{yyyy}",month:"{yyyy}-{MM}",day:Wy,hour:Wy+" "+Hp.hour,minute:Wy+" "+Hp.minute,second:Wy+" "+Hp.second,millisecond:Hp.none},T1=["year","month","day","hour","minute","second","millisecond"],cL=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function $l(r,e){return r+="","0000".substr(0,e-r.length)+r}function fd(r){switch(r){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return r}}function pq(r){return r===fd(r)}function gq(r){switch(r){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function qy(r,e,t,n){var i=us(r),a=i[E1(t)](),o=i[pd(t)]()+1,s=Math.floor((o-1)/3)+1,l=i[Zy(t)](),u=i["get"+(t?"UTC":"")+"Day"](),d=i[Wp(t)](),f=(d-1)%12+1,g=i[jy(t)](),m=i[Xy(t)](),_=i[Yy(t)](),x=d>=12?"pm":"am",w=x.toUpperCase(),C=n instanceof qr?n:x1(n||oL)||fq(),A=C.getModel("time"),L=A.get("month"),O=A.get("monthAbbr"),V=A.get("dayOfWeek"),F=A.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,x+"").replace(/{A}/g,w+"").replace(/{yyyy}/g,a+"").replace(/{yy}/g,$l(a%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,L[o-1]).replace(/{MMM}/g,O[o-1]).replace(/{MM}/g,$l(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,$l(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,V[u]).replace(/{ee}/g,F[u]).replace(/{e}/g,u+"").replace(/{HH}/g,$l(d,2)).replace(/{H}/g,d+"").replace(/{hh}/g,$l(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,$l(g,2)).replace(/{m}/g,g+"").replace(/{ss}/g,$l(m,2)).replace(/{s}/g,m+"").replace(/{SSS}/g,$l(_,3)).replace(/{S}/g,_+"")}function vq(r,e,t,n,i){var a=null;if(ut(t))a=t;else if(It(t))a=t(r.value,e,{level:r.level});else{var o=Ge({},Hp);if(r.level>0)for(var s=0;s=0;--s)if(l[u]){a=l[u];break}a=a||o.none}if(Ze(a)){var f=r.level==null?0:r.level>=0?r.level:a.length+r.level;f=Math.min(f,a.length-1),a=a[f]}}return qy(new Date(r.value),a,i,n)}function hL(r,e){var t=us(r),n=t[pd(e)]()+1,i=t[Zy(e)](),a=t[Wp(e)](),o=t[jy(e)](),s=t[Xy(e)](),l=t[Yy(e)](),u=l===0,d=u&&s===0,f=d&&o===0,g=f&&a===0,m=g&&i===1,_=m&&n===1;return _?"year":m?"month":g?"day":f?"hour":d?"minute":u?"second":"millisecond"}function dL(r,e,t){var n=Lr(r)?us(r):r;switch(e=e||hL(r,t),e){case"year":return n[E1(t)]();case"half-year":return n[pd(t)]()>=6?1:0;case"quarter":return Math.floor((n[pd(t)]()+1)/4);case"month":return n[pd(t)]();case"day":return n[Zy(t)]();case"half-day":return n[Wp(t)]()/24;case"hour":return n[Wp(t)]();case"minute":return n[jy(t)]();case"second":return n[Xy(t)]();case"millisecond":return n[Yy(t)]()}}function E1(r){return r?"getUTCFullYear":"getFullYear"}function pd(r){return r?"getUTCMonth":"getMonth"}function Zy(r){return r?"getUTCDate":"getDate"}function Wp(r){return r?"getUTCHours":"getHours"}function jy(r){return r?"getUTCMinutes":"getMinutes"}function Xy(r){return r?"getUTCSeconds":"getSeconds"}function Yy(r){return r?"getUTCMilliseconds":"getMilliseconds"}function mq(r){return r?"setUTCFullYear":"setFullYear"}function fL(r){return r?"setUTCMonth":"setMonth"}function pL(r){return r?"setUTCDate":"setDate"}function gL(r){return r?"setUTCHours":"setHours"}function vL(r){return r?"setUTCMinutes":"setMinutes"}function mL(r){return r?"setUTCSeconds":"setSeconds"}function yL(r){return r?"setUTCMilliseconds":"setMilliseconds"}function _L(r){if(!Tw(r))return ut(r)?r:"-";var e=(r+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function bL(r,e){return r=(r||"").toLowerCase().replace(/-(.)/g,function(t,n){return n.toUpperCase()}),e&&r&&(r=r.charAt(0).toUpperCase()+r.slice(1)),r}var gd=Ex;function C1(r,e,t){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function i(d){return d&&Oo(d)?d:"-"}function a(d){return!!(d!=null&&!isNaN(d)&&isFinite(d))}var o=e==="time",s=r instanceof Date;if(o||s){var l=o?us(r):r;if(isNaN(+l)){if(s)return"-"}else return qy(l,n,t)}if(e==="ordinal")return Pm(r)?i(r):Lr(r)&&a(r)?r+"":"-";var u=$s(r);return a(u)?_L(u):Pm(r)?i(r):typeof r=="boolean"?r+"":"-"}var xL=["a","b","c","d","e","f","g"],A1=function(r,e){return"{"+r+(e??"")+"}"};function wL(r,e,t){Ze(e)||(e=[e]);var n=e.length;if(!n)return"";for(var i=e[0].$vars||[],a=0;a':'';var o=t.markerId||"markerX";return{renderMode:a,content:"{"+o+"|} ",style:i==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function Cc(r,e){return e=e||"transparent",ut(r)?r:Nt(r)&&r.colorStops&&(r.colorStops[0]||{}).color||e}function Ky(r,e){if(e==="_blank"||e==="blank"){var t=window.open();t.opener=null,t.location.href=r}else window.open(r,e)}var Jy=Q,SL=["left","right","top","bottom","width","height"],Ac=[["width","left","right"],["height","top","bottom"]];function D1(r,e,t,n,i){var a=0,o=0;n==null&&(n=1/0),i==null&&(i=1/0);var s=0;e.eachChild(function(l,u){var d=l.getBoundingRect(),f=e.childAt(u+1),g=f&&f.getBoundingRect(),m,_;if(r==="horizontal"){var x=d.width+(g?-g.x+d.x:0);m=a+x,m>n||l.newline?(a=0,m=x,o+=s+t,s=d.height):s=Math.max(s,d.height)}else{var w=d.height+(g?-g.y+d.y:0);_=o+w,_>i||l.newline?(a+=s+t,o=0,_=w,s=d.width):s=Math.max(s,d.width)}l.newline||(l.x=a,l.y=o,l.markRedraw(),r==="horizontal"?a=m+t:o=_+t)})}var Dc=D1;er(D1,"vertical"),er(D1,"horizontal");function bq(r,e,t){var n=e.width,i=e.height,a=nt(r.left,n),o=nt(r.top,i),s=nt(r.right,n),l=nt(r.bottom,i);return(isNaN(a)||isNaN(parseFloat(r.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(r.right)))&&(s=n),(isNaN(o)||isNaN(parseFloat(r.top)))&&(o=0),(isNaN(l)||isNaN(parseFloat(r.bottom)))&&(l=i),t=gd(t||0),{width:Math.max(s-a-t[1]-t[3],0),height:Math.max(l-o-t[0]-t[2],0)}}function Xn(r,e,t){t=gd(t||0);var n=e.width,i=e.height,a=nt(r.left,n),o=nt(r.top,i),s=nt(r.right,n),l=nt(r.bottom,i),u=nt(r.width,n),d=nt(r.height,i),f=t[2]+t[0],g=t[1]+t[3],m=r.aspect;switch(isNaN(u)&&(u=n-s-g-a),isNaN(d)&&(d=i-l-f-o),m!=null&&(isNaN(u)&&isNaN(d)&&(m>n/i?u=n*.8:d=i*.8),isNaN(u)&&(u=m*d),isNaN(d)&&(d=u/m)),isNaN(a)&&(a=n-s-u-g),isNaN(o)&&(o=i-l-d-f),r.left||r.right){case"center":a=n/2-u/2-t[3];break;case"right":a=n-u-g;break}switch(r.top||r.bottom){case"middle":case"center":o=i/2-d/2-t[0];break;case"bottom":o=i-d-f;break}a=a||0,o=o||0,isNaN(u)&&(u=n-g-a-(s||0)),isNaN(d)&&(d=i-f-o-(l||0));var _=new sr(a+t[3],o+t[0],u,d);return _.margin=t,_}function Qy(r,e,t,n,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],l=i&&i.boundingMode||"all";if(a=a||r,a.x=r.x,a.y=r.y,!o&&!s)return!1;var u;if(l==="raw")u=r.type==="group"?new sr(0,0,+e.width||0,+e.height||0):r.getBoundingRect();else if(u=r.getBoundingRect(),r.needLocalTransform()){var d=r.getLocalTransform();u=u.clone(),u.applyTransform(d)}var f=Xn(Bt({width:u.width,height:u.height},e),t,n),g=o?f.x-u.x:0,m=s?f.y-u.y:0;return l==="raw"?(a.x=g,a.y=m):(a.x+=g,a.y+=m),a===r&&r.markRedraw(),!0}function xq(r,e){return r[Ac[e][0]]!=null||r[Ac[e][1]]!=null&&r[Ac[e][2]]!=null}function qp(r){var e=r.layoutMode||r.constructor.layoutMode;return Nt(e)?e:e?{type:e}:null}function Gl(r,e,t){var n=t&&t.ignoreSize;!Ze(n)&&(n=[n,n]);var i=o(Ac[0],0),a=o(Ac[1],1);u(Ac[0],r,i),u(Ac[1],r,a);function o(d,f){var g={},m=0,_={},x=0,w=2;if(Jy(d,function(L){_[L]=r[L]}),Jy(d,function(L){s(e,L)&&(g[L]=_[L]=e[L]),l(g,L)&&m++,l(_,L)&&x++}),n[f])return l(e,d[1])?_[d[2]]=null:l(e,d[2])&&(_[d[1]]=null),_;if(x===w||!m)return _;if(m>=w)return g;for(var C=0;C=0;l--)s=rr(s,i[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(t,n){var i=t+"Index",a=t+"Id";return Cp(this.ecModel,t,{index:this.get(i,!0),id:this.get(a,!0)},n)},e.prototype.getBoxLayoutParams=function(){var t=this;return{left:t.get("left"),top:t.get("top"),right:t.get("right"),bottom:t.get("bottom"),width:t.get("width"),height:t.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(t){this.option.zlevel=t},e.protoInitialize=function(){var t=e.prototype;t.type="component",t.id="",t.name="",t.mainType="",t.subType="",t.componentIndex=0}(),e}(qr);BI(mr,qr),fy(mr),lq(mr),uq(mr,Sq);function Sq(r){var e=[];return Q(mr.getClassesByMainType(r),function(t){e=e.concat(t.dependencies||t.prototype.dependencies||[])}),e=je(e,function(t){return cs(t).main}),r!=="dataset"&&hr(e,"dataset")<=0&&e.unshift("dataset"),e}var EL="";typeof navigator<"u"&&(EL=navigator.platform||"");var md="rgba(0, 0, 0, 0.2)";const Tq={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:md,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:md,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:md,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:md,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:md,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:md,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:EL.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var M1=Tt(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),po="original",Oi="arrayRows",go="objectRows",vs="keyedColumns",js="typedArray",CL="unknown",ms="column",yd="row",Ai={Must:1,Might:2,Not:3},AL=Cr();function Eq(r){AL(r).datasetMap=Tt()}function DL(r,e,t){var n={},i=k1(e);if(!i||!r)return n;var a=[],o=[],s=e.ecModel,l=AL(s).datasetMap,u=i.uid+"_"+t.seriesLayoutBy,d,f;r=r.slice(),Q(r,function(x,w){var C=Nt(x)?x:r[w]={name:x};C.type==="ordinal"&&d==null&&(d=w,f=_(C)),n[C.name]=[]});var g=l.get(u)||l.set(u,{categoryWayDim:f,valueWayDim:0});Q(r,function(x,w){var C=x.name,A=_(x);if(d==null){var L=g.valueWayDim;m(n[C],L,A),m(o,L,A),g.valueWayDim+=A}else if(d===w)m(n[C],0,A),m(a,0,A);else{var L=g.categoryWayDim;m(n[C],L,A),m(o,L,A),g.categoryWayDim+=A}});function m(x,w,C){for(var A=0;Ae)return r[n];return r[t-1]}function LL(r,e,t,n,i,a,o){a=a||r;var s=e(a),l=s.paletteIdx||0,u=s.paletteNameMap=s.paletteNameMap||{};if(u.hasOwnProperty(i))return u[i];var d=o==null||!n?t:kq(n,o);if(d=d||t,!(!d||!d.length)){var f=d[l];return i&&(u[i]=f),s.paletteIdx=(l+1)%d.length,f}}function Lq(r,e){e(r).paletteIdx=0,e(r).paletteNameMap={}}var _d={},e_,Zp,PL,N1="\0_ec_inner",RL=1,Pq={grid:"GridComponent",polar:"PolarComponent",geo:"GeoComponent",singleAxis:"SingleAxisComponent",parallel:"ParallelComponent",calendar:"CalendarComponent",graphic:"GraphicComponent",toolbox:"ToolboxComponent",tooltip:"TooltipComponent",axisPointer:"AxisPointerComponent",brush:"BrushComponent",title:"TitleComponent",timeline:"TimelineComponent",markPoint:"MarkPointComponent",markLine:"MarkLineComponent",markArea:"MarkAreaComponent",legend:"LegendComponent",dataZoom:"DataZoomComponent",visualMap:"VisualMapComponent",xAxis:"GridComponent",yAxis:"GridComponent",angleAxis:"PolarComponent",radiusAxis:"PolarComponent"},Rq={line:"LineChart",bar:"BarChart",pie:"PieChart",scatter:"ScatterChart",radar:"RadarChart",map:"MapChart",tree:"TreeChart",treemap:"TreemapChart",graph:"GraphChart",gauge:"GaugeChart",funnel:"FunnelChart",parallel:"ParallelChart",sankey:"SankeyChart",boxplot:"BoxplotChart",candlestick:"CandlestickChart",effectScatter:"EffectScatterChart",lines:"LinesChart",heatmap:"HeatmapChart",pictorialBar:"PictorialBarChart",themeRiver:"ThemeRiverChart",sunburst:"SunburstChart",custom:"CustomChart"},t_={};function Nq(r){Q(r,function(e,t){if(!mr.hasClass(t)){var n=Pq[t];n&&!t_[n]&&(Ti("Component "+t+` is used but not imported. import { `+n+` } from 'echarts/components'; echarts.use([`+n+"]);"),t_[n]=!0)}})}var O1=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t,n,i,a,o,s){a=a||{},this.option=null,this._theme=new qr(a),this._locale=new qr(o),this._optionManager=s},e.prototype.setOption=function(t,n,i){_d.NODE_ENV!=="production"&&(Ot(t!=null,"option is null/undefined"),Ot(t[N1]!==RL,"please use chart.getOption()"));var a=zL(n);this._optionManager.setOption(t,i,a),this._resetOption(null,a)},e.prototype.resetOption=function(t,n){return this._resetOption(t,zL(n))},e.prototype._resetOption=function(t,n){var i=!1,a=this._optionManager;if(!t||t==="recreate"){var o=a.mountOption(t==="recreate");_d.NODE_ENV!=="production"&&Nq(o),!this.option||t==="recreate"?PL(this,o):(this.restoreData(),this._mergeOption(o,n)),i=!0}if((t==="timeline"||t==="media")&&this.restoreData(),!t||t==="recreate"||t==="timeline"){var s=a.getTimelineOption(this);s&&(i=!0,this._mergeOption(s,n))}if(!t||t==="recreate"||t==="media"){var l=a.getMediaOption(this);l.length&&Q(l,function(u){i=!0,this._mergeOption(u,n)},this)}return i},e.prototype.mergeOption=function(t){this._mergeOption(t,null)},e.prototype._mergeOption=function(t,n){var i=this.option,a=this._componentsMap,o=this._componentsCount,s=[],l=Tt(),u=n&&n.replaceMergeMainTypeMap;Eq(this),Q(t,function(f,g){f!=null&&(mr.hasClass(g)?g&&(s.push(g),l.set(g,!0)):i[g]=i[g]==null?Ut(f):rr(i[g],f,!0))}),u&&u.each(function(f,g){mr.hasClass(g)&&!l.get(g)&&(s.push(g),l.set(g,!0))}),mr.topologicalTravel(s,mr.getAllClassMainTypes(),d,this);function d(f){var g=Mq(this,f,Xr(t[f])),m=a.get(f),_=m?u&&u.get(f)?"replaceMerge":"normalMerge":"replaceAll",x=kI(m,g,_);tW(x,f,mr),i[f]=null,a.set(f,null),o.set(f,0);var w=[],C=[],A=0,L,O;Q(x,function(V,F){var $=V.existing,H=V.newOption;if(!H)$&&($.mergeOption({},this),$.optionUpdated({},!1));else{var Z=f==="series",j=mr.getClass(f,V.keyInfo.subType,!Z);if(!j){if(_d.NODE_ENV!=="production"){var Y=V.keyInfo.subType,se=Rq[Y];t_[Y]||(t_[Y]=!0,Ti(se?"Series "+Y+` is used but not imported. import { `+se+` } from 'echarts/charts'; echarts.use([`+se+"]);":"Unknown series "+Y))}return}if(f==="tooltip"){if(L){_d.NODE_ENV!=="production"&&(O||(wn("Currently only one tooltip component is allowed."),O=!0));return}L=!0}if($&&$.constructor===j)$.name=V.keyInfo.name,$.mergeOption(H,this),$.optionUpdated(H,!1);else{var ae=Ge({componentIndex:F},V.keyInfo);$=new j(H,this,this,ae),Ge($,ae),V.brandNew&&($.__requireNewView=!0),$.init(H,this,this),$.optionUpdated(null,!0)}}$?(w.push($.option),C.push($),A++):(w.push(void 0),C.push(void 0))},this),i[f]=w,a.set(f,C),o.set(f,A),f==="series"&&e_(this)}this._seriesIndices||e_(this)},e.prototype.getOption=function(){var t=Ut(this.option);return Q(t,function(n,i){if(mr.hasClass(i)){for(var a=Xr(n),o=a.length,s=!1,l=o-1;l>=0;l--)a[l]&&!ed(a[l])?s=!0:(a[l]=null,!s&&o--);a.length=o,t[i]=a}}),delete t[N1],t},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(t){this._payload=t},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(t,n){var i=this._componentsMap.get(t);if(i){var a=i[n||0];if(a)return a;if(n==null){for(var o=0;o=e:t==="max"?r<=e:r===e}function Hq(r,e){return r.join(",")===e.join(",")}var Ul={},vo=Q,jp=Nt,FL=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function B1(r){var e=r&&r.itemStyle;if(e)for(var t=0,n=FL.length;t=0;w--){var C=r[w];if(s||(_=C.data.rawIndexOf(C.stackedByDimension,m)),_>=0){var A=C.data.getByRawIndex(C.stackResultDimension,_);if(l==="all"||l==="positive"&&A>0||l==="negative"&&A<0||l==="samesign"&&g>=0&&A>0||l==="samesign"&&g<=0&&A<0){g=$H(g,A),x=A;break}}}return n[0]=g,n[1]=x,n})})}var eZ={},r_=function(){function r(e){this.data=e.data||(e.sourceFormat===vs?{}:[]),this.sourceFormat=e.sourceFormat||CL,this.seriesLayoutBy=e.seriesLayoutBy||ms,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;nx&&(x=L)}m[0]=_,m[1]=x}},i=function(){return this._data?this._data.length/this._dimSize:0};KL=(e={},e[Oi+"_"+ms]={pure:!0,appendData:a},e[Oi+"_"+yd]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[go]={pure:!0,appendData:a},e[vs]={pure:!0,appendData:function(o){var s=this._data;Q(o,function(l,u){for(var d=s[u]||(s[u]=[]),f=0;f<(l||[]).length;f++)d.push(l[f])})}},e[po]={appendData:a},e[js]={persistent:!1,pure:!0,appendData:function(o){Hl.NODE_ENV!=="production"&&Ot(ji(o),"Added data must be TypedArray if data in initialization is TypedArray"),this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function a(o){for(var s=0;s=0&&(x=o.interpolatedValue[w])}return x!=null?x+"":""})}},r.prototype.getRawValue=function(e,t){return xd(this.getData(t),e)},r.prototype.formatTooltip=function(e,t,n){},r}();function oP(r){var e,t;return Nt(r)?r.type?t=r:aP.NODE_ENV!=="production"&&console.warn("The return type of `formatTooltip` is not supported: "+Ki(r)):e=r,{text:e,frag:t}}var i_={};function Kp(r){return new lZ(r)}var lZ=function(){function r(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return r.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var i=this.context;i.data=i.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var a;this._plan&&!n&&(a=this._plan(this.context));var o=d(this._modBy),s=this._modDataCount||0,l=d(e&&e.modBy),u=e&&e.modDataCount||0;(o!==l||s!==u)&&(a="reset");function d(A){return!(A>=1)&&(A=1),A}var f;(this._dirty||a==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=u;var g=e&&e.step;if(t?(i_.NODE_ENV!=="production"&&Ot(t._outputDueEnd!=null),this._dueEnd=t._outputDueEnd):(i_.NODE_ENV!=="production"&&Ot(!this._progress||this._count),this._dueEnd=this._count?this._count(this.context):1/0),this._progress){var m=this._dueIndex,_=Math.min(g!=null?this._dueIndex+g:1/0,this._dueEnd);if(!n&&(f||m<_)){var x=this._progress;if(Ze(x))for(var w=0;w=this._outputDueEnd),this._outputDueEnd=C}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},r.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},r.prototype._doProgress=function(e,t,n,i,a){sP.reset(t,n,i,a),this._callingProgress=e,this._callingProgress({start:t,end:n,count:n-t,next:sP.next},this.context)},r.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var t,n;!e&&this._reset&&(t=this._reset(this.context),t&&t.progress&&(n=t.forceFirstProgress,t=t.progress),Ze(t)&&!t.length&&(t=null)),this._progress=t,this._modBy=this._modDataCount=null;var i=this._downstream;return i&&i.dirty(),n},r.prototype.unfinished=function(){return this._progress&&this._dueIndex1&&n>0?s:o}};return a;function o(){return e=r?null:le},gte:function(r,e){return r>=e}},hZ=function(){function r(e,t){if(!Lr(t)){var n="";uZ.NODE_ENV!=="production"&&(n='rvalue of "<", ">", "<=", ">=" can only be number in filter.'),Gr(n)}this._opFn=uP[e],this._rvalFloat=$s(t)}return r.prototype.evaluate=function(e){return Lr(e)?this._opFn(e,this._rvalFloat):this._opFn($s(e),this._rvalFloat)},r}(),cP=function(){function r(e,t){var n=e==="desc";this._resultLT=n?1:-1,t==null&&(t=n?"min":"max"),this._incomparable=t==="min"?-1/0:1/0}return r.prototype.evaluate=function(e,t){var n=Lr(e)?e:$s(e),i=Lr(t)?t:$s(t),a=isNaN(n),o=isNaN(i);if(a&&(n=this._incomparable),o&&(i=this._incomparable),a&&o){var s=ut(e),l=ut(t);s&&(n=l?e:0),l&&(i=s?t:0)}return ni?-this._resultLT:0},r}(),dZ=function(){function r(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=$s(t)}return r.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n==="number"||this._rvalTypeof==="number")&&(t=$s(e)===this._rvalFloat)}return this._isEQ?t:!t},r}();function fZ(r,e){return r==="eq"||r==="ne"?new dZ(r==="eq",e):gt(uP,r)?new hZ(r,e):null}var Sa={},pZ=function(){function r(){}return r.prototype.getRawData=function(){throw new Error("not supported")},r.prototype.getRawDataItem=function(e){throw new Error("not supported")},r.prototype.cloneRawData=function(){},r.prototype.getDimensionInfo=function(e){},r.prototype.cloneAllDimensionInfo=function(){},r.prototype.count=function(){},r.prototype.retrieveValue=function(e,t){},r.prototype.retrieveValueFromItem=function(e,t){},r.prototype.convertValue=function(e,t){return Wl(e,t)},r}();function gZ(r,e){var t=new pZ,n=r.data,i=t.sourceFormat=r.sourceFormat,a=r.startIndex,o="";r.seriesLayoutBy!==ms&&(Sa.NODE_ENV!=="production"&&(o='`seriesLayoutBy` of upstream dataset can only be "column" in data transform.'),Gr(o));var s=[],l={},u=r.dimensionsDefine;if(u)Q(u,function(x,w){var C=x.name,A={index:w,name:C,displayName:x.displayName};if(s.push(A),C!=null){var L="";gt(l,C)&&(Sa.NODE_ENV!=="production"&&(L='dimension name "'+C+'" duplicated.'),Gr(L)),l[C]=A}});else for(var d=0;d65535?SZ:TZ}function Sd(){return[1/0,-1/0]}function EZ(r){var e=r.constructor;return e===Array?r.slice():new e(r)}function gP(r,e,t,n,i){var a=pP[t||"float"];if(i){var o=r[e],s=o&&o.length;if(s!==n){for(var l=new a(n),u=0;uw[1]&&(w[1]=x)}return this._rawCount=this._count=l,{start:s,end:l}},r.prototype._initDataFromProvider=function(e,t,n){for(var i=this._provider,a=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,u=je(o,function(A){return A.property}),d=0;dC[1]&&(C[1]=w)}}!i.persistent&&i.clean&&i.clean(),this._rawCount=this._count=t,this._extent=[]},r.prototype.count=function(){return this._count},r.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)a=o-1;else return o}return-1},r.prototype.indicesOfNearest=function(e,t,n){var i=this._chunks,a=i[e],o=[];if(!a)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,u=0,d=0,f=this.count();d=0&&l<0)&&(s=_,l=m,u=0),m===l&&(o[u++]=d))}return o.length=u,o},r.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,i=this._count;if(n===Array){e=new n(i);for(var a=0;a=f&&A<=g||isNaN(A))&&(l[u++]=x),x++}_=!0}else if(a===2){for(var w=m[i[0]],L=m[i[1]],O=e[i[1]][0],V=e[i[1]][1],C=0;C=f&&A<=g||isNaN(A))&&(F>=O&&F<=V||isNaN(F))&&(l[u++]=x),x++}_=!0}}if(!_)if(a===1)for(var C=0;C=f&&A<=g||isNaN(A))&&(l[u++]=$)}else for(var C=0;Ce[j][1])&&(H=!1)}H&&(l[u++]=t.getRawIndex(C))}return uC[1]&&(C[1]=w)}}}},r.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),i=n._chunks,a=i[e],o=this.count(),s=0,l=Math.floor(1/t),u=this.getRawIndex(0),d,f,g,m=new(wd(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));m[s++]=u;for(var _=1;_d&&(d=f,g=O)}Y>0&&Y<$-F&&(m[s++]=Math.min(j,g),g=Math.max(j,g)),m[s++]=g,u=g}return m[s++]=this.getRawIndex(o-1),n._count=s,n._indices=m,n.getRawIndex=this._getRawIdx,n},r.prototype.minmaxDownSample=function(e,t){for(var n=this.clone([e],!0),i=n._chunks,a=Math.floor(1/t),o=i[e],s=this.count(),l=new(wd(this._rawCount))(Math.ceil(s/a)*2),u=0,d=0;ds&&(x=s-d);for(var w=0;w_&&(_=A,m=d+w)}var L=this.getRawIndex(f),O=this.getRawIndex(m);fd-_&&(l=d-_,s.length=l);for(var x=0;xf[1]&&(f[1]=C),g[m++]=A}return a._count=m,a._indices=g,a._updateGetRawIdx(),a},r.prototype.each=function(e,t){if(this._count)for(var n=e.length,i=this._chunks,a=0,o=this.count();al&&(l=f)}return o=[s,l],this._extent[e]=o,o},r.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],i=this._chunks,a=0;a=0?this._indices[e]:-1},r.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},r.internalField=function(){function e(t,n,i,a){return Wl(t[a],this._dimensions[a])}Z1={arrayRows:e,objectRows:function(t,n,i,a){return Wl(t[n],this._dimensions[a])},keyedColumns:e,original:function(t,n,i,a){var o=t&&(t.value==null?t:t.value);return Wl(o instanceof Array?o[a]:o,this._dimensions[a])},typedArray:function(t,n,i,a){return t[a]}}}(),r}(),Jp={},vP=function(){function r(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return r.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},r.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},r.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},r.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},r.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,i,a;if(Qp(e)){var o=e,s=void 0,l=void 0,u=void 0;if(n){var d=t[0];d.prepareSource(),u=d.getSource(),s=u.data,l=u.sourceFormat,a=[d._getVersionSign()]}else s=o.get("data",!0),l=ji(s)?js:po,a=[];var f=this._getSourceMetaRawOption()||{},g=u&&u.metaRawOption||{},m=Zt(f.seriesLayoutBy,g.seriesLayoutBy)||null,_=Zt(f.sourceHeader,g.sourceHeader),x=Zt(f.dimensions,g.dimensions),w=m!==g.seriesLayoutBy||!!_!=!!g.sourceHeader||x;i=w?[$1(s,{seriesLayoutBy:m,sourceHeader:_,dimensions:x},l)]:[]}else{var C=e;if(n){var A=this._applyTransform(t);i=A.sourceList,a=A.upstreamSignList}else{var L=C.get("source",!0);i=[$1(L,this._getSourceMetaRawOption(),null)],a=[]}}Jp.NODE_ENV!=="production"&&Ot(i&&a),this._setLocalSource(i,a)},r.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get("transform",!0),i=t.get("fromTransformResult",!0);if(Jp.NODE_ENV!=="production"&&Ot(i!=null||n!=null),i!=null){var a="";e.length!==1&&(Jp.NODE_ENV!=="production"&&(a="When using `fromTransformResult`, there should be only one upstream dataset"),yP(a))}var o,s=[],l=[];return Q(e,function(u){u.prepareSource();var d=u.getSource(i||0),f="";i!=null&&!d&&(Jp.NODE_ENV!=="production"&&(f="Can not retrieve result by `fromTransformResult`: "+i),yP(f)),s.push(d),l.push(u._getVersionSign())}),n?o=xZ(n,s,{datasetIndex:t.componentIndex}):i!=null&&(o=[tZ(s[0])]),{sourceList:o,upstreamSignList:l}},r.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||t>0&&!r.noHeader;return Q(r.blocks,function(i){var a=wP(i);a>=e&&(e=a+ +(n&&(!a||X1(i)&&!i.noHeader)))}),e}return 0}function IZ(r,e,t,n){var i=e.noHeader,a=LZ(wP(e)),o=[],s=e.blocks||[];Ot(!s||Ze(s)),s=s||[];var l=r.orderMode;if(e.sortBlocks&&l){s=s.slice();var u={valueAsc:"asc",valueDesc:"desc"};if(gt(u,l)){var d=new cP(u[l],null);s.sort(function(x,w){return d.evaluate(x.sortParam,w.sortParam)})}else l==="seriesDesc"&&s.reverse()}Q(s,function(x,w){var C=e.valueFormatter,A=xP(x)(C?Ge(Ge({},r),{valueFormatter:C}):r,x,w>0?a.html:0,n);A!=null&&o.push(A)});var f=r.renderMode==="richText"?o.join(a.richText):Y1(n,o.join(""),i?t:a.html);if(i)return f;var g=C1(e.header,"ordinal",r.useUTC),m=bP(n,r.renderMode).nameStyle,_=_P(n);return r.renderMode==="richText"?TP(r,g,m)+a.richText+f:Y1(n,'
'+Yi(g)+"
"+f,t)}function kZ(r,e,t,n){var i=r.renderMode,a=e.noName,o=e.noValue,s=!e.markerType,l=e.name,u=r.useUTC,d=e.valueFormatter||r.valueFormatter||function(O){return O=Ze(O)?O:[O],je(O,function(V,F){return C1(V,Ze(m)?m[F]:m,u)})};if(!(a&&o)){var f=s?"":r.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",i),g=a?"":C1(l,"ordinal",u),m=e.valueType,_=o?[]:d(e.value,e.dataIndex),x=!s||!a,w=!s&&a,C=bP(n,i),A=C.nameStyle,L=C.valueStyle;return i==="richText"?(s?"":f)+(a?"":TP(r,g,A))+(o?"":NZ(r,_,x,w,L)):Y1(n,(s?"":f)+(a?"":PZ(g,!s,A))+(o?"":RZ(_,x,w,L)),t)}}function SP(r,e,t,n,i,a){if(r){var o=xP(r),s={useUTC:i,renderMode:t,orderMode:n,markupStyleCreator:e,valueFormatter:r.valueFormatter};return o(s,r,0,a)}}function LZ(r){return{html:DZ[r],richText:MZ[r]}}function Y1(r,e,t){var n='
',i="margin: "+t+"px 0 0",a=_P(r);return'
'+e+n+"
"}function PZ(r,e,t){var n=e?"margin-left:2px":"";return''+Yi(r)+""}function RZ(r,e,t,n){var i=t?"10px":"20px",a=e?"float:right;margin-left:"+i:"";return r=Ze(r)?r:[r],''+je(r,function(o){return Yi(o)}).join("  ")+""}function TP(r,e,t){return r.markupStyleCreator.wrapRichTextStyle(e,t)}function NZ(r,e,t,n,i){var a=[i],o=n?10:20;return t&&a.push({padding:[0,0,0,o],align:"right"}),r.markupStyleCreator.wrapRichTextStyle(Ze(e)?e.join(" "):e,a)}function EP(r,e){var t=r.getData().getItemVisual(e,"style"),n=t[r.visualDrawType];return Cc(n)}function CP(r,e){var t=r.get("padding");return t??(e==="richText"?[8,10]:10)}var K1=function(){function r(){this.richTextStyles={},this._nextStyleNameId=SI()}return r.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},r.prototype.makeTooltipMarker=function(e,t,n){var i=n==="richText"?this._generateStyleName():null,a=_q({color:t,type:e,renderMode:n,markerId:i});return ut(a)?a:(CZ.NODE_ENV!=="production"&&Ot(i),this.richTextStyles[i]=a.style,a.content)},r.prototype.wrapRichTextStyle=function(e,t){var n={};Ze(t)?Q(t,function(a){return Ge(n,a)}):Ge(n,t);var i=this._generateStyleName();return this.richTextStyles[i]=n,"{"+i+"|"+e+"}"},r}();function AP(r){var e=r.series,t=r.dataIndex,n=r.multipleSeries,i=e.getData(),a=i.mapDimensionsAll("defaultedTooltip"),o=a.length,s=e.getRawValue(t),l=Ze(s),u=EP(e,t),d,f,g,m;if(o>1||l&&!o){var _=OZ(s,e,t,a,u);d=_.inlineValues,f=_.inlineValueTypes,g=_.blocks,m=_.inlineValues[0]}else if(o){var x=i.getDimensionInfo(a[0]);m=d=xd(i,t,a[0]),f=x.type}else m=d=l?s[0]:s;var w=Aw(e),C=w&&e.name||"",A=i.getName(t),L=n?C:A;return ii("section",{header:C,noHeader:n||!w,sortParam:m,blocks:[ii("nameValue",{markerType:"item",markerColor:u,name:L,noName:!Oo(L),value:d,valueType:f,dataIndex:t})].concat(g||[])})}function OZ(r,e,t,n,i){var a=e.getData(),o=is(r,function(f,g,m){var _=a.getDimensionInfo(m);return f=f||_&&_.tooltip!==!1&&_.displayName!=null},!1),s=[],l=[],u=[];n.length?Q(n,function(f){d(xd(a,t,f),f)}):Q(r,d);function d(f,g){var m=a.getDimensionInfo(g);!m||m.otherDims.tooltip===!1||(o?u.push(ii("nameValue",{markerType:"subItem",markerColor:i,name:m.displayName,value:f,valueType:m.type})):(s.push(f),l.push(m.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:u}}var zZ={},ql=Cr();function o_(r,e){return r.getName(e)||r.getId(e)}var s_="__universalTransitionEnabled",on=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return e.prototype.init=function(t,n,i){this.seriesIndex=this.componentIndex,this.dataTask=Kp({count:VZ,reset:FZ}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(t,i);var a=ql(this).sourceManager=new vP(this);a.prepareSource();var o=this.getInitialData(t,i);MP(o,this),this.dataTask.context.data=o,zZ.NODE_ENV!=="production"&&Ot(o,"getInitialData returned invalid data."),ql(this).dataBeforeProcessed=o,DP(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(t,n){var i=qp(this),a=i?vd(t):{},o=this.subType;mr.hasClass(o)&&(o+="Series"),rr(t,n.getTheme().get(this.subType)),rr(t,this.getDefaultOption()),ic(t,"label",["show"]),this.fillDataTextStyle(t.data),i&&Gl(t,a,i)},e.prototype.mergeOption=function(t,n){t=rr(this.option,t,!0),this.fillDataTextStyle(t.data);var i=qp(this);i&&Gl(this.option,t,i);var a=ql(this).sourceManager;a.dirty(),a.prepareSource();var o=this.getInitialData(t,n);MP(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,ql(this).dataBeforeProcessed=o,DP(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(t){if(t&&!ji(t))for(var n=["show"],i=0;ithis.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(t,n,i){var a=this.ecModel,o=P1.prototype.getColorFromPalette.call(this,t,n,i);return o||(o=a.getColorFromPalette(t,n,i)),o},e.prototype.coordDimToDataDim=function(t){return this.getRawData().mapDimensionsAll(t)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(t,n){this._innerSelect(this.getData(n),t)},e.prototype.unselect=function(t,n){var i=this.option.selectedMap;if(i){var a=this.option.selectedMode,o=this.getData(n);if(a==="series"||i==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s=0&&i.push(o)}return i},e.prototype.isSelected=function(t,n){var i=this.option.selectedMap;if(!i)return!1;var a=this.getData(n);return(i==="all"||i[o_(a,t)])&&!a.getItemModel(t).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[s_])return!0;var t=this.option.universalTransition;return t?t===!0?!0:t&&t.enabled:!1},e.prototype._innerSelect=function(t,n){var i,a,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){Nt(o.selectedMap)||(o.selectedMap={});for(var u=o.selectedMap,d=0;d0&&this._innerSelect(t,n)}},e.registerClass=function(t){return mr.registerClass(t)},e.protoInitialize=function(){var t=e.prototype;t.type="series.__base__",t.seriesIndex=0,t.ignoreStyleOnData=!1,t.hasSymbolVisual=!1,t.defaultSymbol="circle",t.visualStyleAccessPath="itemStyle",t.visualDrawType="fill"}(),e}(mr);$n(on,n_),$n(on,P1),BI(on,mr);function DP(r){var e=r.name;Aw(r)||(r.name=BZ(r)||e)}function BZ(r){var e=r.getRawData(),t=e.mapDimensionsAll("seriesName"),n=[];return Q(t,function(i){var a=e.getDimensionInfo(i);a.displayName&&n.push(a.displayName)}),n.join(" ")}function VZ(r){return r.model.getRawData().count()}function FZ(r){var e=r.model;return e.setData(e.getRawData().cloneShallow()),$Z}function $Z(r,e){e.outputData&&r.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function MP(r,e){Q(ap(r.CHANGABLE_METHODS,r.DOWNSAMPLE_METHODS),function(t){r.wrapMethod(t,er(GZ,e))})}function GZ(r,e){var t=J1(r);return t&&t.setOutputEnd((e||this).count()),e}function J1(r){var e=(r.ecModel||{}).scheduler,t=e&&e.getPipeline(r.uid);if(t){var n=t.currentTask;if(n){var i=n.agentStubMap;i&&(n=i.get(r.uid))}return n}}var xn=function(){function r(){this.group=new qt,this.uid=hd("viewComponent")}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){},r.prototype.updateLayout=function(e,t,n,i){},r.prototype.updateVisual=function(e,t,n,i){},r.prototype.toggleBlurSeries=function(e,t,n){},r.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},r}();kw(xn),fy(xn);function Td(){var r=Cr();return function(e){var t=r(e),n=e.pipelineContext,i=!!t.large,a=!!t.progressiveRender,o=t.large=!!(n&&n.large),s=t.progressiveRender=!!(n&&n.progressiveRender);return(i!==o||a!==s)&&"reset"}}var Q1={},IP=Cr(),UZ=Td(),Jr=function(){function r(){this.group=new qt,this.uid=hd("viewChart"),this.renderTask=Kp({plan:HZ,reset:WZ}),this.renderTask.context={view:this}}return r.prototype.init=function(e,t){},r.prototype.render=function(e,t,n,i){if(Q1.NODE_ENV!=="production")throw new Error("render method must been implemented")},r.prototype.highlight=function(e,t,n,i){var a=e.getData(i&&i.dataType);if(!a){Q1.NODE_ENV!=="production"&&Ti("Unknown dataType "+i.dataType);return}LP(a,i,"emphasis")},r.prototype.downplay=function(e,t,n,i){var a=e.getData(i&&i.dataType);if(!a){Q1.NODE_ENV!=="production"&&Ti("Unknown dataType "+i.dataType);return}LP(a,i,"normal")},r.prototype.remove=function(e,t){this.group.removeAll()},r.prototype.dispose=function(e,t){},r.prototype.updateView=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateLayout=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.updateVisual=function(e,t,n,i){this.render(e,t,n,i)},r.prototype.eachRendered=function(e){Vl(this.group,e)},r.markUpdateMethod=function(e,t){IP(e).updateMethod=t},r.protoInitialize=function(){var e=r.prototype;e.type="chart"}(),r}();function kP(r,e,t){r&&zl(r)&&(e==="emphasis"?Ws:qs)(r,t)}function LP(r,e,t){var n=ac(r,e),i=e&&e.highlightKey!=null?y9(e.highlightKey):null;n!=null?Q(Xr(n),function(a){kP(r.getItemGraphicEl(a),t,i)}):r.eachItemGraphicEl(function(a){kP(a,t,i)})}kw(Jr,["dispose"]),fy(Jr);function HZ(r){return UZ(r.model)}function WZ(r){var e=r.model,t=r.ecModel,n=r.api,i=r.payload,a=e.pipelineContext.progressiveRender,o=r.view,s=i&&IP(i).updateMethod,l=a?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,t,n,i),qZ[l]}var qZ={incrementalPrepareRender:{progress:function(r,e){e.view.incrementalRender(r,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(r,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}},l_="\0__throttleOriginMethod",PP="\0__throttleRate",RP="\0__throttleType";function eS(r,e,t){var n,i=0,a=0,o=null,s,l,u,d;e=e||0;function f(){a=new Date().getTime(),o=null,r.apply(l,u||[])}var g=function(){for(var m=[],_=0;_=0?f():o=setTimeout(f,-s),i=n};return g.clear=function(){o&&(clearTimeout(o),o=null)},g.debounceNextCall=function(m){d=m},g}function Ed(r,e,t,n){var i=r[e];if(i){var a=i[l_]||i,o=i[RP],s=i[PP];if(s!==t||o!==n){if(t==null||!n)return r[e]=a;i=r[e]=eS(a,t,n==="debounce"),i[l_]=a,i[RP]=n,i[PP]=t}return i}}function eg(r,e){var t=r[e];t&&t[l_]&&(t.clear&&t.clear(),r[e]=t[l_])}var NP=Cr(),OP={itemStyle:sc(aL,!0),lineStyle:sc(iL,!0)},ZZ={lineStyle:"stroke",itemStyle:"fill"};function zP(r,e){var t=r.visualStyleMapper||OP[e];return t||(console.warn("Unknown style type '"+e+"'."),OP.itemStyle)}function BP(r,e){var t=r.visualDrawType||ZZ[e];return t||(console.warn("Unknown style type '"+e+"'."),"fill")}var jZ={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=r.getModel(n),a=zP(r,n),o=a(i),s=i.getShallow("decal");s&&(t.setVisual("decal",s),s.dirty=!0);var l=BP(r,n),u=o[l],d=It(u)?u:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||d||f){var g=r.getColorFromPalette(r.name,null,e.getSeriesCount());o[l]||(o[l]=g,t.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||It(o.fill)?g:o.fill,o.stroke=o.stroke==="auto"||It(o.stroke)?g:o.stroke}if(t.setVisual("style",o),t.setVisual("drawType",l),!e.isSeriesFiltered(r)&&d)return t.setVisual("colorFromPalette",!1),{dataEach:function(m,_){var x=r.getDataParams(_),w=Ge({},o);w[l]=d(x),m.setItemVisual(_,"style",w)}}}},tg=new qr,XZ={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){if(!(r.ignoreStyleOnData||e.isSeriesFiltered(r))){var t=r.getData(),n=r.visualStyleAccessPath||"itemStyle",i=zP(r,n),a=t.getVisual("drawType");return{dataEach:t.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){tg.option=l[n];var u=i(tg),d=o.ensureUniqueItemVisual(s,"style");Ge(d,u),tg.option.decal&&(o.setItemVisual(s,"decal",tg.option.decal),tg.option.decal.dirty=!0),a in u&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},YZ={performRawSeries:!0,overallReset:function(r){var e=Tt();r.eachSeries(function(t){var n=t.getColorBy();if(!t.isColorBySeries()){var i=t.type+"-"+n,a=e.get(i);a||(a={},e.set(i,a)),NP(t).scope=a}}),r.eachSeries(function(t){if(!(t.isColorBySeries()||r.isSeriesFiltered(t))){var n=t.getRawData(),i={},a=t.getData(),o=NP(t).scope,s=t.visualStyleAccessPath||"itemStyle",l=BP(t,s);a.each(function(u){var d=a.getRawIndex(u);i[d]=u}),n.each(function(u){var d=i[u],f=a.getItemVisual(d,"colorFromPalette");if(f){var g=a.ensureUniqueItemVisual(d,"style"),m=n.getName(u)||u+"",_=n.count();g[l]=t.getColorFromPalette(m,o,_)}})}})}},u_=Math.PI;function KZ(r,e){e=e||{},Bt(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var t=new qt,n=new Ar({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});t.add(n);var i=new Dr({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),a=new Ar({style:{fill:"none"},textContent:i,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});t.add(a);var o;return e.showSpinner&&(o=new ky({shape:{startAngle:-u_/2,endAngle:-u_/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:u_*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:u_*3/2}).delay(300).start("circularInOut"),t.add(o)),t.resize=function(){var s=i.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,u=(r.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),d=r.getHeight()/2;e.showSpinner&&o.setShape({cx:u,cy:d}),a.setShape({x:u-l,y:d-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:r.getWidth(),height:r.getHeight()})},t.resize(),t}var VP={},FP=function(){function r(e,t,n,i){this._stageTaskMap=Tt(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),i=this._visualHandlers=i.slice(),this._allHandlers=n.concat(i)}return r.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(n){var i=n.overallTask;i&&i.dirty()})},r.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),i=n.context,a=!t&&n.progressiveEnabled&&(!i||i.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=a?n.step:null,s=i&&i.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},r.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},r.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),i=e.getData(),a=i.count(),o=n.progressiveEnabled&&t.incrementalPrepareRender&&a>=n.threshold,s=e.get("large")&&a>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?a:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},r.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=Tt();e.eachSeries(function(i){var a=i.getProgressive(),o=i.uid;n.set(o,{id:o,head:null,tail:null,threshold:i.getProgressiveThreshold(),progressiveEnabled:a&&!(i.preventIncremental&&i.preventIncremental()),blockIndex:-1,step:Math.round(a||700),count:0}),t._pipe(i,i.dataTask)})},r.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;Q(this._allHandlers,function(i){var a=e.get(i.uid)||e.set(i.uid,{}),o="";VP.NODE_ENV!=="production"&&(o='"reset" and "overallReset" must not be both specified.'),Ot(!(i.reset&&i.overallReset),o),i.reset&&this._createSeriesStageTask(i,a,t,n),i.overallReset&&this._createOverallStageTask(i,a,t,n)},this)},r.prototype.prepareView=function(e,t,n,i){var a=e.renderTask,o=a.context;o.model=t,o.ecModel=n,o.api=i,a.__block=!e.incrementalPrepareRender,this._pipe(t,a)},r.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},r.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},r.prototype._performStageTasks=function(e,t,n,i){i=i||{};var a=!1,o=this;Q(e,function(l,u){if(!(i.visualType&&i.visualType!==l.visualType)){var d=o._stageTaskMap.get(l.uid),f=d.seriesTaskMap,g=d.overallTask;if(g){var m,_=g.agentStubMap;_.each(function(w){s(i,w)&&(w.dirty(),m=!0)}),m&&g.dirty(),o.updatePayload(g,n);var x=o.getPerformArgs(g,i.block);_.each(function(w){w.perform(x)}),g.perform(x)&&(a=!0)}else f&&f.each(function(w,C){s(i,w)&&w.dirty();var A=o.getPerformArgs(w,i.block);A.skip=!l.performRawSeries&&t.isSeriesFiltered(w.context.model),o.updatePayload(w,n),w.perform(A)&&(a=!0)})}});function s(l,u){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(u.__pipeline.id))}this.unfinished=a||this.unfinished},r.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(n){t=n.dataTask.perform()||t}),this.unfinished=t||this.unfinished},r.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},r.prototype.updatePayload=function(e,t){t!=="remain"&&(e.context.payload=t)},r.prototype._createSeriesStageTask=function(e,t,n,i){var a=this,o=t.seriesTaskMap,s=t.seriesTaskMap=Tt(),l=e.seriesType,u=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(d):l?n.eachRawSeriesByType(l,d):u&&u(n,i).each(d);function d(f){var g=f.uid,m=s.set(g,o&&o.get(g)||Kp({plan:r7,reset:n7,count:a7}));m.context={model:f,ecModel:n,api:i,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:a},a._pipe(f,m)}},r.prototype._createOverallStageTask=function(e,t,n,i){var a=this,o=t.overallTask=t.overallTask||Kp({reset:JZ});o.context={ecModel:n,api:i,overallReset:e.overallReset,scheduler:a};var s=o.agentStubMap,l=o.agentStubMap=Tt(),u=e.seriesType,d=e.getTargetSeries,f=!0,g=!1,m="";VP.NODE_ENV!=="production"&&(m='"createOnAllSeries" is not supported for "overallReset", because it will block all streams.'),Ot(!e.createOnAllSeries,m),u?n.eachRawSeriesByType(u,_):d?d(n,i).each(_):(f=!1,Q(n.getSeries(),_));function _(x){var w=x.uid,C=l.set(w,s&&s.get(w)||(g=!0,Kp({reset:QZ,onDirty:t7})));C.context={model:x,overallProgress:f},C.agent=o,C.__block=f,a._pipe(x,C)}g&&o.dirty()},r.prototype._pipe=function(e,t){var n=e.uid,i=this._pipelineMap.get(n);!i.head&&(i.head=t),i.tail&&i.tail.pipe(t),i.tail=t,t.__idxInPipeline=i.count++,t.__pipeline=i},r.wrapStageHandler=function(e,t){return It(e)&&(e={overallReset:e,seriesType:o7(e)}),e.uid=hd("stageHandler"),t&&(e.visualType=t),e},r}();function JZ(r){r.overallReset(r.ecModel,r.api,r.payload)}function QZ(r){return r.overallProgress&&e7}function e7(){this.agent.dirty(),this.getDownstream().dirty()}function t7(){this.agent&&this.agent.dirty()}function r7(r){return r.plan?r.plan(r.model,r.ecModel,r.api,r.payload):null}function n7(r){r.useClearVisual&&r.data.clearAllVisual();var e=r.resetDefines=Xr(r.reset(r.model,r.ecModel,r.api,r.payload));return e.length>1?je(e,function(t,n){return $P(n)}):i7}var i7=$P(0);function $P(r){return function(e,t){var n=t.data,i=t.resetDefines[r];if(i&&i.dataEach)for(var a=e.start;a0&&m===u.length-g.length){var _=u.slice(0,m);_!=="data"&&(t.mainType=_,t[g.toLowerCase()]=l,d=!0)}}s.hasOwnProperty(u)&&(n[u]=l,d=!0),d||(i[u]=l)})}return{cptQuery:t,dataQuery:n,otherQuery:i}},r.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var i=n.targetEl,a=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=t.cptQuery,u=t.dataQuery;return d(l,o,"mainType")&&d(l,o,"subType")&&d(l,o,"index","componentIndex")&&d(l,o,"name")&&d(l,o,"id")&&d(u,a,"name")&&d(u,a,"dataIndex")&&d(u,a,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,t.otherQuery,i,a));function d(f,g,m,_){return f[m]==null||g[_||m]===f[m]}},r.prototype.afterTrigger=function(){this.eventInfo=null},r}(),tS=["symbol","symbolSize","symbolRotate","symbolOffset"],jP=tS.concat(["symbolKeepAspect"]),u7={createOnAllSeries:!0,performRawSeries:!0,reset:function(r,e){var t=r.getData();if(r.legendIcon&&t.setVisual("legendIcon",r.legendIcon),!r.hasSymbolVisual)return;for(var n={},i={},a=!1,o=0;o=0&&Rc(l)?l:.5;var u=r.createRadialGradient(o,s,0,o,s,l);return u}function iS(r,e,t){for(var n=e.type==="radial"?T7(r,e,t):S7(r,e,t),i=e.colorStops,a=0;a0)?null:r==="dashed"?[4*e,2*e]:r==="dotted"?[e]:Lr(r)?[r]:Ze(r)?r:null}function aS(r){var e=r.style,t=e.lineDash&&e.lineWidth>0&&C7(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(t){var i=e.strokeNoScale&&r.getLineScale?r.getLineScale():1;i&&i!==1&&(t=je(t,function(a){return a/i}),n/=i)}return[t,n]}var A7=new ps(!0);function p_(r){var e=r.stroke;return!(e==null||e==="none"||!(r.lineWidth>0))}function JP(r){return typeof r=="string"&&r!=="none"}function g_(r){var e=r.fill;return e!=null&&e!=="none"}function QP(r,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.fillOpacity*e.opacity,r.fill(),r.globalAlpha=t}else r.fill()}function eR(r,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var t=r.globalAlpha;r.globalAlpha=e.strokeOpacity*e.opacity,r.stroke(),r.globalAlpha=t}else r.stroke()}function oS(r,e,t){var n=Pw(e.image,e.__image,t);if(py(n)){var i=r.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(e.x||0,e.y||0),a.rotateSelf(0,0,(e.rotation||0)*zm),a.scaleSelf(e.scaleX||1,e.scaleY||1),i.setTransform(a)}return i}}function D7(r,e,t,n){var i,a=p_(t),o=g_(t),s=t.strokePercent,l=s<1,u=!e.path;(!e.silent||l)&&u&&e.createPathProxy();var d=e.path||A7,f=e.__dirty;if(!n){var g=t.fill,m=t.stroke,_=o&&!!g.colorStops,x=a&&!!m.colorStops,w=o&&!!g.image,C=a&&!!m.image,A=void 0,L=void 0,O=void 0,V=void 0,F=void 0;(_||x)&&(F=e.getBoundingRect()),_&&(A=f?iS(r,g,F):e.__canvasFillGradient,e.__canvasFillGradient=A),x&&(L=f?iS(r,m,F):e.__canvasStrokeGradient,e.__canvasStrokeGradient=L),w&&(O=f||!e.__canvasFillPattern?oS(r,g,e):e.__canvasFillPattern,e.__canvasFillPattern=O),C&&(V=f||!e.__canvasStrokePattern?oS(r,m,e):e.__canvasStrokePattern,e.__canvasStrokePattern=O),_?r.fillStyle=A:w&&(O?r.fillStyle=O:o=!1),x?r.strokeStyle=L:C&&(V?r.strokeStyle=V:a=!1)}var $=e.getGlobalScale();d.setScale($[0],$[1],e.segmentIgnoreThreshold);var H,Z;r.setLineDash&&t.lineDash&&(i=aS(e),H=i[0],Z=i[1]);var j=!0;(u||f&Wh)&&(d.setDPR(r.dpr),l?d.setContext(null):(d.setContext(r),j=!1),d.reset(),e.buildPath(d,e.shape,n),d.toStatic(),e.pathUpdated()),j&&d.rebuildPath(r,l?s:1),H&&(r.setLineDash(H),r.lineDashOffset=Z),n||(t.strokeFirst?(a&&eR(r,t),o&&QP(r,t)):(o&&QP(r,t),a&&eR(r,t))),H&&r.setLineDash([])}function M7(r,e,t){var n=e.__image=Pw(t.image,e.__image,e,e.onload);if(!(!n||!py(n))){var i=t.x||0,a=t.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),t.sWidth&&t.sHeight){var u=t.sx||0,d=t.sy||0;r.drawImage(n,u,d,t.sWidth,t.sHeight,i,a,o,s)}else if(t.sx&&t.sy){var u=t.sx,d=t.sy,f=o-u,g=s-d;r.drawImage(n,u,d,f,g,i,a,o,s)}else r.drawImage(n,i,a,o,s)}}function I7(r,e,t){var n,i=t.text;if(i!=null&&(i+=""),i){r.font=t.font||Sl,r.textAlign=t.textAlign,r.textBaseline=t.textBaseline;var a=void 0,o=void 0;r.setLineDash&&t.lineDash&&(n=aS(e),a=n[0],o=n[1]),a&&(r.setLineDash(a),r.lineDashOffset=o),t.strokeFirst?(p_(t)&&r.strokeText(i,t.x,t.y),g_(t)&&r.fillText(i,t.x,t.y)):(g_(t)&&r.fillText(i,t.x,t.y),p_(t)&&r.strokeText(i,t.x,t.y)),a&&r.setLineDash([])}}var tR=["shadowBlur","shadowOffsetX","shadowOffsetY"],rR=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function nR(r,e,t,n,i){var a=!1;if(!n&&(t=t||{},e===t))return!1;if(n||e.opacity!==t.opacity){Ta(r,i),a=!0;var o=Math.max(Math.min(e.opacity,1),0);r.globalAlpha=isNaN(o)?lc.opacity:o}(n||e.blend!==t.blend)&&(a||(Ta(r,i),a=!0),r.globalCompositeOperation=e.blend||lc.blend);for(var s=0;so.maxTileWidth&&le("maxTileWidth"),fe>o.maxTileHeight&&le("maxTileHeight")}return{width:Math.max(1,Math.min(Y,o.maxTileWidth)),height:Math.max(1,Math.min(fe,o.maxTileHeight))}}function j(){H&&(H.clearRect(0,0,V.width,V.height),o.backgroundColor&&(H.fillStyle=o.backgroundColor,H.fillRect(0,0,V.width,V.height)));for(var Y=0,se=0;se0&&t.unfinished);t.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(t,n,i){if(this[Vi]){ai.NODE_ENV!=="production"&&Ti("`setOption` should not be called during main process.");return}if(this._disposed){Ga(this.id);return}var a,o,s;if(Nt(n)&&(i=n.lazyUpdate,a=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[Vi]=!0,!this._model||n){var l=new Fq(this._api),u=this._theme,d=this._model=new O1;d.scheduler=this._scheduler,d.ssr=this._ssr,d.init(null,null,null,u,this._locale,l)}this._model.setOption(t,{replaceMerge:o},yS);var f={seriesTransition:s,optionChanged:!0};if(i)this[Ea]={silent:a,updateParams:f},this[Vi]=!1,this.getZr().wakeUp();else{try{Id(this),Zl.update.call(this,null,f)}catch(g){throw this[Ea]=null,this[Vi]=!1,g}this._ssr||this._zr.flush(),this[Ea]=null,this[Vi]=!1,ag.call(this,a),og.call(this,a)}},e.prototype.setTheme=function(){Fo("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||gr.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(t){return ai.NODE_ENV!=="production"&&Un("getRenderedCanvas","renderToCanvas"),this.renderToCanvas(t)},e.prototype.renderToCanvas=function(t){t=t||{};var n=this._zr.painter;if(ai.NODE_ENV!=="production"&&n.type!=="canvas")throw new Error("renderToCanvas can only be used in the canvas renderer.");return n.getRenderedCanvas({backgroundColor:t.backgroundColor||this._model.get("backgroundColor"),pixelRatio:t.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(t){t=t||{};var n=this._zr.painter;if(ai.NODE_ENV!=="production"&&n.type!=="svg")throw new Error("renderToSVGString can only be used in the svg renderer.");return n.renderToString({useViewBox:t.useViewBox})},e.prototype.getSvgDataURL=function(){if(gr.svgSupported){var t=this._zr,n=t.storage.getDisplayList();return Q(n,function(i){i.stopAnimation(null,!0)}),t.painter.toDataURL()}},e.prototype.getDataURL=function(t){if(this._disposed){Ga(this.id);return}t=t||{};var n=t.excludeComponents,i=this._model,a=[],o=this;Q(n,function(l){i.eachComponent({mainType:l},function(u){var d=o._componentsMap[u.__viewId];d.group.ignore||(a.push(d),d.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(t).toDataURL("image/"+(t&&t.type||"png"));return Q(a,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(t){if(this._disposed){Ga(this.id);return}var n=t.type==="svg",i=this.group,a=Math.min,o=Math.max,s=1/0;if(NR[i]){var l=s,u=s,d=-s,f=-s,g=[],m=t&&t.pixelRatio||this.getDevicePixelRatio();Q(lg,function(L,O){if(L.group===i){var V=n?L.getZr().painter.getSvgDom().innerHTML:L.renderToCanvas(Ut(t)),F=L.getDom().getBoundingClientRect();l=a(F.left,l),u=a(F.top,u),d=o(F.right,d),f=o(F.bottom,f),g.push({dom:V,left:F.left,top:F.top})}}),l*=m,u*=m,d*=m,f*=m;var _=d-l,x=f-u,w=Tl.createCanvas(),C=gI(w,{renderer:n?"svg":"canvas"});if(C.resize({width:_,height:x}),n){var A="";return Q(g,function(L){var O=L.left-l,V=L.top-u;A+=''+L.dom+""}),C.painter.getSvgRoot().innerHTML=A,t.connectedBackgroundColor&&C.painter.setBackgroundColor(t.connectedBackgroundColor),C.refreshImmediately(),C.painter.toDataURL()}else return t.connectedBackgroundColor&&C.add(new Ar({shape:{x:0,y:0,width:_,height:x},style:{fill:t.connectedBackgroundColor}})),Q(g,function(L){var O=new di({style:{x:L.left*m-l,y:L.top*m-u,image:L.dom}});C.add(O)}),C.refreshImmediately(),w.toDataURL("image/"+(t&&t.type||"png"))}else return this.getDataURL(t)},e.prototype.convertToPixel=function(t,n){return dS(this,"convertToPixel",t,n)},e.prototype.convertFromPixel=function(t,n){return dS(this,"convertFromPixel",t,n)},e.prototype.containPixel=function(t,n){if(this._disposed){Ga(this.id);return}var i=this._model,a,o=Ep(i,t);return Q(o,function(s,l){l.indexOf("Models")>=0&&Q(s,function(u){var d=u.coordinateSystem;if(d&&d.containPoint)a=a||!!d.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[u.__viewId];f&&f.containPoint?a=a||f.containPoint(n,u):ai.NODE_ENV!=="production"&&wn(l+": "+(f?"The found component do not support containPoint.":"No view mapping to the found component."))}else ai.NODE_ENV!=="production"&&wn(l+": containPoint is not supported")},this)},this),!!a},e.prototype.getVisual=function(t,n){var i=this._model,a=Ep(i,t,{defaultMainType:"series"}),o=a.seriesModel;ai.NODE_ENV!=="production"&&(o||wn("There is no specified series model"));var s=o.getData(),l=a.hasOwnProperty("dataIndexInside")?a.dataIndexInside:a.hasOwnProperty("dataIndex")?s.indexOfRawIndex(a.dataIndex):null;return l!=null?nS(s,l,n):ng(s,n)},e.prototype.getViewOfComponentModel=function(t){return this._componentsMap[t.__viewId]},e.prototype.getViewOfSeriesModel=function(t){return this._chartsMap[t.__viewId]},e.prototype._initEvents=function(){var t=this;Q(rj,function(n){var i=function(a){var o=t.getModel(),s=a.target,l,u=n==="globalout";if(u?l={}:s&&Lc(s,function(_){var x=jt(_);if(x&&x.dataIndex!=null){var w=x.dataModel||o.getSeriesByIndex(x.seriesIndex);return l=w&&w.getDataParams(x.dataIndex,x.dataType,s)||{},!0}else if(x.eventData)return l=Ge({},x.eventData),!0},!0),l){var d=l.componentType,f=l.componentIndex;(d==="markLine"||d==="markPoint"||d==="markArea")&&(d="series",f=l.seriesIndex);var g=d&&f!=null&&o.getComponent(d,f),m=g&&t[g.mainType==="series"?"_chartsMap":"_componentsMap"][g.__viewId];ai.NODE_ENV!=="production"&&!u&&!(g&&m)&&wn("model or view can not be found by params"),l.event=a,l.type=n,t._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:g,view:m},t.trigger(n,l)}};i.zrEventfulCallAtLast=!0,t._zr.on(n,i,t)}),Q(sg,function(n,i){t._messageCenter.on(i,function(a){this.trigger(i,a)},t)}),Q(["selectchanged"],function(n){t._messageCenter.on(n,function(i){this.trigger(n,i)},t)}),h7(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){Ga(this.id);return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){Ga(this.id);return}this._disposed=!0;var t=this.getDom();t&&NI(this.getDom(),bS,"");var n=this,i=n._api,a=n._model;Q(n._componentsViews,function(o){o.dispose(a,i)}),Q(n._chartsViews,function(o){o.dispose(a,i)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete lg[n.id]},e.prototype.resize=function(t){if(this[Vi]){ai.NODE_ENV!=="production"&&Ti("`resize` should not be called during main process.");return}if(this._disposed){Ga(this.id);return}this._zr.resize(t);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var i=n.resetOption("media"),a=t&&t.silent;this[Ea]&&(a==null&&(a=this[Ea].silent),i=!0,this[Ea]=null),this[Vi]=!0;try{i&&Id(this),Zl.update.call(this,{type:"resize",animation:Ge({duration:0},t&&t.animation)})}catch(o){throw this[Vi]=!1,o}this[Vi]=!1,ag.call(this,a),og.call(this,a)}},e.prototype.showLoading=function(t,n){if(this._disposed){Ga(this.id);return}if(Nt(t)&&(n=t,t=""),t=t||"default",this.hideLoading(),!_S[t]){ai.NODE_ENV!=="production"&&wn("Loading effects "+t+" not exists.");return}var i=_S[t](this._api,n),a=this._zr;this._loadingFX=i,a.add(i)},e.prototype.hideLoading=function(){if(this._disposed){Ga(this.id);return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(t){var n=Ge({},t);return n.type=sg[t.type],n},e.prototype.dispatchAction=function(t,n){if(this._disposed){Ga(this.id);return}if(Nt(n)||(n={silent:!!n}),!!b_[t.type]&&this._model){if(this[Vi]){this._pendingActions.push(t);return}var i=n.silent;pS.call(this,t,i);var a=n.flush;a?this._zr.flush():a!==!1&&gr.browser.weChat&&this._throttledZrFlush(),ag.call(this,i),og.call(this,i)}},e.prototype.updateLabelLayout=function(){qo.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(t){if(this._disposed){Ga(this.id);return}var n=t.seriesIndex,i=this.getModel(),a=i.getSeriesByIndex(n);ai.NODE_ENV!=="production"&&Ot(t.data&&a),a.appendData(t),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=function(){Id=function(f){var g=f._scheduler;g.restorePipelines(f._model),g.prepareStageTasks(),hS(f,!0),hS(f,!1),g.plan()},hS=function(f,g){for(var m=f._model,_=f._scheduler,x=g?f._componentsViews:f._chartsViews,w=g?f._componentsMap:f._chartsMap,C=f._zr,A=f._api,L=0;Lg.get("hoverLayerThreshold")&&!gr.node&&!gr.worker&&g.eachSeries(function(w){if(!w.preventUsingHoverLayer){var C=f._chartsMap[w.__viewId];C.__alive&&C.eachRendered(function(A){A.states.emphasis&&(A.states.emphasis.hoverLayer=!0)})}})}function o(f,g){var m=f.get("blendMode")||null;g.eachRendered(function(_){_.isGroup||(_.style.blend=m)})}function s(f,g){if(!f.preventAutoZ){var m=f.get("z")||0,_=f.get("zlevel")||0;g.eachRendered(function(x){return l(x,m,_,-1/0),!0})}}function l(f,g,m,_){var x=f.getTextContent(),w=f.getTextGuideLine(),C=f.isGroup;if(C)for(var A=f.childrenRef(),L=0;L0?{duration:x,delay:m.get("delay"),easing:m.get("easing")}:null;g.eachRendered(function(C){if(C.states&&C.states.emphasis){if(ld(C))return;if(C instanceof vr&&_9(C),C.__dirty){var A=C.prevStates;A&&C.useStates(A)}if(_){C.stateTransition=w;var L=C.getTextContent(),O=C.getTextGuideLine();L&&(L.stateTransition=w),O&&(O.stateTransition=w)}C.__dirty&&i(C)}})}IR=function(f){return new(function(g){ze(m,g);function m(){return g!==null&&g.apply(this,arguments)||this}return m.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},m.prototype.getComponentByElement=function(_){for(;_;){var x=_.__ecComponentInfo;if(x!=null)return f._model.getComponent(x.mainType,x.index);_=_.parent}},m.prototype.enterEmphasis=function(_,x){Ws(_,x),yo(f)},m.prototype.leaveEmphasis=function(_,x){qs(_,x),yo(f)},m.prototype.enterBlur=function(_){_k(_),yo(f)},m.prototype.leaveBlur=function(_){e1(_),yo(f)},m.prototype.enterSelect=function(_){bk(_),yo(f)},m.prototype.leaveSelect=function(_){xk(_),yo(f)},m.prototype.getModel=function(){return f.getModel()},m.prototype.getViewOfComponentModel=function(_){return f.getViewOfComponentModel(_)},m.prototype.getViewOfSeriesModel=function(_){return f.getViewOfSeriesModel(_)},m}(BL))(f)},kR=function(f){function g(m,_){for(var x=0;x=0)){VR.push(t);var a=FP.wrapStageHandler(t,i);a.__prio=e,a.__raw=t,r.push(a)}}function FR(r,e){_S[r]=e}function lj(r,e,t){var n=$7("registerMap");n&&n(r,e,t)}var uj=bZ;Oc(lS,jZ),Oc(m_,XZ),Oc(m_,YZ),Oc(lS,u7),Oc(m_,c7),Oc(_R,V7),zR(qL),BR(H7,Jq),FR("default",KZ),ys({type:vc,event:vc,update:vc},On),ys({type:Sy,event:Sy,update:Sy},On),ys({type:kp,event:kp,update:kp},On),ys({type:Ty,event:Ty,update:Ty},On),ys({type:Lp,event:Lp,update:Lp},On),OR("light",s7),OR("dark",ZP);var $R=[],cj={registerPreprocessor:zR,registerProcessor:BR,registerPostInit:ij,registerPostUpdate:aj,registerUpdateLifecycle:wS,registerAction:ys,registerCoordinateSystem:oj,registerLayout:sj,registerVisual:Oc,registerTransform:uj,registerLoading:FR,registerMap:lj,registerImpl:F7,PRIORITY:Q7,ComponentModel:mr,ComponentView:xn,SeriesModel:on,ChartView:Jr,registerComponentModel:function(r){mr.registerClass(r)},registerComponentView:function(r){xn.registerClass(r)},registerSeriesModel:function(r){on.registerClass(r)},registerChartView:function(r){Jr.registerClass(r)},registerSubTypeDefaulter:function(r,e){mr.registerSubTypeDefaulter(r,e)},registerPainter:function(r,e){OH(r,e)}};function dr(r){if(Ze(r)){Q(r,function(e){dr(e)});return}hr($R,r)>=0||($R.push(r),It(r)&&(r={install:r}),r.install(cj))}function ug(r){return r==null?0:r.length||1}function GR(r){return r}var Ys=function(){function r(e,t,n,i,a,o){this._old=e,this._new=t,this._oldKeyGetter=n||GR,this._newKeyGetter=i||GR,this.context=a,this._diffModeMultiple=o==="multiple"}return r.prototype.add=function(e){return this._add=e,this},r.prototype.update=function(e){return this._update=e,this},r.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},r.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},r.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},r.prototype.remove=function(e){return this._remove=e,this},r.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},r.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},i=new Array(e.length),a=new Array(t.length);this._initIndexMap(e,null,i,"_oldKeyGetter"),this._initIndexMap(t,n,a,"_newKeyGetter");for(var o=0;o1){var d=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(d,o)}else u===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(a,n)},r.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},i={},a=[],o=[];this._initIndexMap(e,n,a,"_oldKeyGetter"),this._initIndexMap(t,i,o,"_newKeyGetter");for(var s=0;s1&&g===1)this._updateManyToOne&&this._updateManyToOne(d,u),i[l]=null;else if(f===1&&g>1)this._updateOneToMany&&this._updateOneToMany(d,u),i[l]=null;else if(f===1&&g===1)this._update&&this._update(d,u),i[l]=null;else if(f>1&&g>1)this._updateManyToMany&&this._updateManyToMany(d,u),i[l]=null;else if(f>1)for(var m=0;m1)for(var s=0;s30}var E_={},cg=Nt,jl=je,mj=typeof Int32Array>"u"?Array:Int32Array,yj="e\0\0",jR=-1,_j=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],bj=["_approximateExtent"],XR,C_,hg,kd,ES,dg,CS,na=function(){function r(e,t){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,i=!1;HR(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(i=!0,n=e),n=n||["x","y"];for(var a={},o=[],s={},l=!1,u={},d=0;d=0),i&&(g.storeDimIndex=d)}if(this.dimensions=o,this._dimInfos=a,this._initGetDimensionInfo(l),this.hostModel=t,this._invertedIndicesMap=s,this._dimOmitted){var x=this._dimIdxToName=Tt();Q(o,function(w){x.set(a[w].storeDimIndex,w)})}}return r.prototype.getDimension=function(e){var t=this._recognizeDimIndex(e);if(t==null)return e;if(t=e,!this._dimOmitted)return this.dimensions[t];var n=this._dimIdxToName.get(t);if(n!=null)return n;var i=this._schema.getSourceDimension(t);if(i)return i.name},r.prototype.getDimensionIndex=function(e){var t=this._recognizeDimIndex(e);if(t!=null)return t;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},r.prototype._recognizeDimIndex=function(e){if(Lr(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},r.prototype._getStoreDimIndex=function(e){var t=this.getDimensionIndex(e);if(E_.NODE_ENV!=="production"&&t==null)throw new Error("Unknown dimension "+e);return t},r.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},r.prototype._initGetDimensionInfo=function(e){var t=this._dimInfos;this._getDimInfo=e?function(n){return t.hasOwnProperty(n)?t[n]:void 0}:function(n){return t[n]}},r.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},r.prototype.mapDimension=function(e,t){var n=this._dimSummary;if(t==null)return n.encodeFirstDimNotExtra[e];var i=n.encode[e];return i?i[t]:null},r.prototype.mapDimensionsAll=function(e){var t=this._dimSummary,n=t.encode[e];return(n||[]).slice()},r.prototype.getStore=function(){return this._store},r.prototype.initData=function(e,t,n){var i=this,a;if(e instanceof j1&&(a=e),!a){var o=this.dimensions,s=F1(e)||Ri(e)?new QL(e,o.length):e;a=new j1;var l=jl(o,function(u){return{type:i._dimInfos[u].type,property:u}});a.initData(s,l,n)}this._store=a,this._nameList=(t||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,a.count()),this._dimSummary=fj(this,this._schema),this.userOutput=this._dimSummary.userOutput},r.prototype.appendData=function(e){var t=this._store.appendData(e);this._doInit(t[0],t[1])},r.prototype.appendValues=function(e,t){var n=this._store.appendValues(e,t&&t.length),i=n.start,a=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),t)for(var s=i;s=t)){var n=this._store,i=n.getProvider();this._updateOrdinalMeta();var a=this._nameList,o=this._idList,s=i.getSource().sourceFormat,l=s===po;if(l&&!i.pure)for(var u=[],d=e;d0},r.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,i=n[e];i||(i=n[e]={});var a=i[t];return a==null&&(a=this.getVisual(t),Ze(a)?a=a.slice():cg(a)&&(a=Ge({},a)),i[t]=a),a},r.prototype.setItemVisual=function(e,t,n){var i=this._itemVisuals[e]||{};this._itemVisuals[e]=i,cg(t)?Ge(i,t):i[t]=n},r.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},r.prototype.setLayout=function(e,t){cg(e)?Ge(this._layout,e):this._layout[e]=t},r.prototype.getLayout=function(e){return this._layout[e]},r.prototype.getItemLayout=function(e){return this._itemLayouts[e]},r.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?Ge(this._itemLayouts[e]||{},t):t},r.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},r.prototype.setItemGraphicEl=function(e,t){var n=this.hostModel&&this.hostModel.seriesIndex;Xw(n,this.dataType,e,t),this._graphicEls[e]=t},r.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},r.prototype.eachItemGraphicEl=function(e,t){Q(this._graphicEls,function(n,i){n&&e&&e.call(t,n,i)})},r.prototype.cloneShallow=function(e){return e||(e=new r(this._schema?this._schema:jl(this.dimensions,this._getDimInfo,this),this.hostModel)),ES(e,this),e._store=this._store,e},r.prototype.wrapMethod=function(e,t){var n=this[e];It(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var i=n.apply(this,arguments);return t.apply(this,[i].concat(Tx(arguments)))})},r.internalField=function(){XR=function(e){var t=e._invertedIndicesMap;Q(t,function(n,i){var a=e._dimInfos[i],o=a.ordinalMeta,s=e._store;if(o){n=t[i]=new mj(o.categories.length);for(var l=0;l1&&(l+="__ec__"+d),i[t]=l}}}(),r}();function fg(r,e){F1(r)||(r=G1(r)),e=e||{};var t=e.coordDimensions||[],n=e.dimensionsDefine||r.dimensionsDefine||[],i=Tt(),a=[],o=wj(r,t,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&ZR(o),l=n===r.dimensionsDefine,u=l?qR(r):WR(n),d=e.encodeDefine;!d&&e.encodeDefaulter&&(d=e.encodeDefaulter(r,o));for(var f=Tt(d),g=new dP(o),m=0;m0&&(n.name=i+(a-1)),a++,e.set(i,a)}}function wj(r,e,t,n){var i=Math.max(r.dimensionsDetectedCount||1,e.length,t.length,n||0);return Q(e,function(a){var o;Nt(a)&&(o=a.dimsDef)&&(i=Math.max(i,o.length))}),i}function Sj(r,e,t){if(t||e.hasKey(r)){for(var n=0;e.hasKey(r+n);)n++;r+=n}return e.set(r,!0),r}var AS={},Tj=function(){function r(e){this.coordSysDims=[],this.axisMap=Tt(),this.categoryAxisMap=Tt(),this.coordSysName=e}return r}();function Ej(r){var e=r.get("coordinateSystem"),t=new Tj(e),n=Cj[e];if(n)return n(r,t,t.axisMap,t.categoryAxisMap),t}var Cj={cartesian2d:function(r,e,t,n){var i=r.getReferringComponents("xAxis",Hn).models[0],a=r.getReferringComponents("yAxis",Hn).models[0];if(AS.NODE_ENV!=="production"){if(!i)throw new Error('xAxis "'+Gn(r.get("xAxisIndex"),r.get("xAxisId"),0)+'" not found');if(!a)throw new Error('yAxis "'+Gn(r.get("xAxisIndex"),r.get("yAxisId"),0)+'" not found')}e.coordSysDims=["x","y"],t.set("x",i),t.set("y",a),Ld(i)&&(n.set("x",i),e.firstCategoryDimIndex=0),Ld(a)&&(n.set("y",a),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(r,e,t,n){var i=r.getReferringComponents("singleAxis",Hn).models[0];if(AS.NODE_ENV!=="production"&&!i)throw new Error("singleAxis should be specified.");e.coordSysDims=["single"],t.set("single",i),Ld(i)&&(n.set("single",i),e.firstCategoryDimIndex=0)},polar:function(r,e,t,n){var i=r.getReferringComponents("polar",Hn).models[0],a=i.findAxisModel("radiusAxis"),o=i.findAxisModel("angleAxis");if(AS.NODE_ENV!=="production"){if(!o)throw new Error("angleAxis option not found");if(!a)throw new Error("radiusAxis option not found")}e.coordSysDims=["radius","angle"],t.set("radius",a),t.set("angle",o),Ld(a)&&(n.set("radius",a),e.firstCategoryDimIndex=0),Ld(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(r,e,t,n){e.coordSysDims=["lng","lat"]},parallel:function(r,e,t,n){var i=r.ecModel,a=i.getComponent("parallel",r.get("parallelIndex")),o=e.coordSysDims=a.dimensions.slice();Q(a.parallelAxisIndex,function(s,l){var u=i.getComponent("parallelAxis",s),d=o[l];t.set(d,u),Ld(u)&&(n.set(d,u),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Ld(r){return r.get("type")==="category"}function Aj(r,e,t){t=t||{};var n=t.byIndex,i=t.stackedCoordDimension,a,o,s;Dj(e)?a=e:(o=e.schema,a=o.dimensions,s=e.store);var l=!!(r&&r.get("stack")),u,d,f,g;if(Q(a,function(A,L){ut(A)&&(a[L]=A={name:A}),l&&!A.isExtraCoord&&(!n&&!u&&A.ordinalMeta&&(u=A),!d&&A.type!=="ordinal"&&A.type!=="time"&&(!i||i===A.coordDim)&&(d=A))}),d&&!n&&!u&&(n=!0),d){f="__\0ecstackresult_"+r.id,g="__\0ecstackedover_"+r.id,u&&(u.createInvertedIndices=!0);var m=d.coordDim,_=d.type,x=0;Q(a,function(A){A.coordDim===m&&x++});var w={name:f,coordDim:m,coordDimIndex:x,type:_,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},C={name:g,coordDim:g,coordDimIndex:x+1,type:_,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(w.storeDimIndex=s.ensureCalculationDimension(g,_),C.storeDimIndex=s.ensureCalculationDimension(f,_)),o.appendCalculationDimension(w),o.appendCalculationDimension(C)):(a.push(w),a.push(C))}return{stackedDimension:d&&d.name,stackedByDimension:u&&u.name,isStackedByIndex:n,stackedOverDimension:g,stackResultDimension:f}}function Dj(r){return!HR(r.schema)}function Xl(r,e){return!!e&&e===r.getCalculationInfo("stackedDimension")}function YR(r,e){return Xl(r,e)?r.getCalculationInfo("stackResultDimension"):e}function Mj(r,e){var t=r.get("coordinateSystem"),n=bd.get(t),i;return e&&e.coordSysDims&&(i=je(e.coordSysDims,function(a){var o={name:a},s=e.axisMap.get(a);if(s){var l=s.get("type");o.type=S_(l)}return o})),i||(i=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),i}function Ij(r,e,t){var n,i;return t&&Q(r,function(a,o){var s=a.coordDim,l=t.categoryAxisMap.get(s);l&&(n==null&&(n=o),a.ordinalMeta=l.getOrdinalMeta(),e&&(a.createInvertedIndices=!0)),a.otherDims.itemName!=null&&(i=!0)}),!i&&n!=null&&(r[n].otherDims.itemName=0),n}function Ks(r,e,t){t=t||{};var n=e.getSourceManager(),i,a=!1;r?(a=!0,i=G1(r)):(i=n.getSource(),a=i.sourceFormat===po);var o=Ej(e),s=Mj(e,o),l=t.useEncodeDefaulter,u=It(l)?l:l?er(DL,s,e):null,d={coordDimensions:s,generateCoord:t.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:u,canOmitUnusedDimensions:!a},f=fg(i,d),g=Ij(f.dimensions,t.createInvertedIndices,o),m=a?null:n.getSharedDataStore(f),_=Aj(e,{schema:f,store:m}),x=new na(f,e);x.setCalculationInfo(_);var w=g!=null&&kj(i)?function(C,A,L,O){return O===g?L:this.defaultDimValueGetter(C,A,L,O)}:null;return x.hasItemOption=!1,x.initData(a?i:m,null,w),x}function kj(r){if(r.sourceFormat===po){var e=Lj(r.data||[]);return!Ze(Qh(e))}}function Lj(r){for(var e=0;et[1]&&(t[1]=e[1])},r.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},r.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},r.prototype.isBlank=function(){return this._isBlank},r.prototype.setBlank=function(e){this._isBlank=e},r}();fy(_s);var Pj=0,DS=function(){function r(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++Pj}return r.createByAxisModel=function(e){var t=e.option,n=t.data,i=n&&je(n,Rj);return new r({categories:i,needCollect:!i,deduplication:t.dedplication!==!1})},r.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},r.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!ut(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var i=this._getOrCreateMap();return t=i.get(e),t==null&&(n?(t=this.categories.length,this.categories[t]=e,i.set(e,t)):t=NaN),t},r.prototype._getOrCreateMap=function(){return this._map||(this._map=Tt(this.categories))},r}();function Rj(r){return Nt(r)&&r.value!=null?r.value:r+""}function Nj(r){var e=Math.pow(10,hy(Math.abs(r))),t=Math.abs(r/e);return t===0||t===1||t===2||t===3||t===5}function MS(r){return r.type==="interval"||r.type==="log"}function Oj(r,e,t,n){var i={},a=r[1]-r[0],o=i.interval=xI(a/e);t!=null&&on&&(o=i.interval=n);var s=i.intervalPrecision=KR(o),l=i.niceTickExtent=[Ln(Math.ceil(r[0]/o)*o,s),Ln(Math.floor(r[1]/o)*o,s)];return zj(l,r),i}function IS(r){var e=Math.pow(10,hy(r)),t=r/e;return t?t===2?t=3:t===3?t=5:t*=2:t=1,Ln(t*e)}function KR(r){return ls(r)+2}function JR(r,e,t){r[e]=Math.max(Math.min(r[e],t[1]),t[0])}function zj(r,e){!isFinite(r[0])&&(r[0]=e[0]),!isFinite(r[1])&&(r[1]=e[1]),JR(r,0,e),JR(r,1,e),r[0]>r[1]&&(r[0]=r[1])}function A_(r,e){return r>=e[0]&&r<=e[1]}function D_(r,e){return e[1]===e[0]?.5:(r-e[0])/(e[1]-e[0])}function M_(r,e){return r*(e[1]-e[0])+e[0]}var I_=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;n.type="ordinal";var i=n.getSetting("ordinalMeta");return i||(i=new DS({})),Ze(i)&&(i=new DS({categories:je(i,function(a){return Nt(a)?a.value:a})})),n._ordinalMeta=i,n._extent=n.getSetting("extent")||[0,i.categories.length-1],n}return e.prototype.parse=function(t){return t==null?NaN:ut(t)?this._ordinalMeta.getOrdinal(t):Math.round(t)},e.prototype.contain=function(t){return t=this.parse(t),A_(t,this._extent)&&this._ordinalMeta.categories[t]!=null},e.prototype.normalize=function(t){return t=this._getTickNumber(this.parse(t)),D_(t,this._extent)},e.prototype.scale=function(t){return t=Math.round(M_(t,this._extent)),this.getRawOrdinalNumber(t)},e.prototype.getTicks=function(){for(var t=[],n=this._extent,i=n[0];i<=n[1];)t.push({value:i}),i++;return t},e.prototype.getMinorTicks=function(t){},e.prototype.setSortInfo=function(t){if(t==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=t.ordinalNumbers,i=this._ordinalNumbersByTick=[],a=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o=0&&t=0&&t=t},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e}(_s);_s.registerClass(I_);var zc=Ln,Js=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="interval",t._interval=0,t._intervalPrecision=2,t}return e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return A_(t,this._extent)},e.prototype.normalize=function(t){return D_(t,this._extent)},e.prototype.scale=function(t){return M_(t,this._extent)},e.prototype.setExtent=function(t,n){var i=this._extent;isNaN(t)||(i[0]=parseFloat(t)),isNaN(n)||(i[1]=parseFloat(n))},e.prototype.unionExtent=function(t){var n=this._extent;t[0]n[1]&&(n[1]=t[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(t){this._interval=t,this._niceExtent=this._extent.slice(),this._intervalPrecision=KR(t)},e.prototype.getTicks=function(t){var n=this._interval,i=this._extent,a=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;i[0]l)return[];var d=s.length?s[s.length-1].value:a[1];return i[1]>d&&(t?s.push({value:zc(d+n,o)}):s.push({value:i[1]})),s},e.prototype.getMinorTicks=function(t){for(var n=this.getTicks(!0),i=[],a=this.getExtent(),o=1;oa[0]&&m0&&(a=a===null?s:Math.min(a,s))}t[n]=a}}return t}function rN(r){var e=Fj(r),t=[];return Q(r,function(n){var i=n.coordinateSystem,a=i.getBaseAxis(),o=a.getExtent(),s;if(a.type==="category")s=a.getBandWidth();else if(a.type==="value"||a.type==="time"){var l=a.dim+"_"+a.index,u=e[l],d=Math.abs(o[1]-o[0]),f=a.scale.getExtent(),g=Math.abs(f[1]-f[0]);s=u?d/g*u:d}else{var m=n.getData();s=Math.abs(o[1]-o[0])/m.count()}var _=nt(n.get("barWidth"),s),x=nt(n.get("barMaxWidth"),s),w=nt(n.get("barMinWidth")||(sN(n)?.5:1),s),C=n.get("barGap"),A=n.get("barCategoryGap");t.push({bandWidth:s,barWidth:_,barMaxWidth:x,barMinWidth:w,barGap:C,barCategoryGap:A,axisKey:LS(a),stackId:eN(n)})}),nN(t)}function nN(r){var e={};Q(r,function(n,i){var a=n.axisKey,o=n.bandWidth,s=e[a]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[a]=s;var u=n.stackId;l[u]||s.autoWidthCount++,l[u]=l[u]||{width:0,maxWidth:0};var d=n.barWidth;d&&!l[u].width&&(l[u].width=d,d=Math.min(s.remainedWidth,d),s.remainedWidth-=d);var f=n.barMaxWidth;f&&(l[u].maxWidth=f);var g=n.barMinWidth;g&&(l[u].minWidth=g);var m=n.barGap;m!=null&&(s.gap=m);var _=n.barCategoryGap;_!=null&&(s.categoryGap=_)});var t={};return Q(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=br(a).length;s=Math.max(35-l*4,15)+"%"}var u=nt(s,o),d=nt(n.gap,1),f=n.remainedWidth,g=n.autoWidthCount,m=(f-u)/(g+(g-1)*d);m=Math.max(m,0),Q(a,function(C){var A=C.maxWidth,L=C.minWidth;if(C.width){var O=C.width;A&&(O=Math.min(O,A)),L&&(O=Math.max(O,L)),C.width=O,f-=O+d*O,g--}else{var O=m;A&&AO&&(O=L),O!==m&&(C.width=O,f-=O+d*O,g--)}}),m=(f-u)/(g+(g-1)*d),m=Math.max(m,0);var _=0,x;Q(a,function(C,A){C.width||(C.width=m),x=C,_+=C.width*(1+d)}),x&&(_-=x.width*d);var w=-_/2;Q(a,function(C,A){t[i][A]=t[i][A]||{bandWidth:o,offset:w,width:C.width},w+=C.width*(1+d)})}),t}function $j(r,e,t){if(r&&e){var n=r[LS(e)];return n}}function iN(r,e){var t=tN(r,e),n=rN(t);Q(t,function(i){var a=i.getData(),o=i.coordinateSystem,s=o.getBaseAxis(),l=eN(i),u=n[LS(s)][l],d=u.offset,f=u.width;a.setLayout({bandWidth:u.bandWidth,offset:d,size:f})})}function aN(r){return{seriesType:r,plan:Td(),reset:function(e){if(oN(e)){var t=e.getData(),n=e.coordinateSystem,i=n.getBaseAxis(),a=n.getOtherAxis(i),o=t.getDimensionIndex(t.mapDimension(a.dim)),s=t.getDimensionIndex(t.mapDimension(i.dim)),l=e.get("showBackground",!0),u=t.mapDimension(a.dim),d=t.getCalculationInfo("stackResultDimension"),f=Xl(t,u)&&!!t.getCalculationInfo("stackedOnSeries"),g=a.isHorizontal(),m=Gj(i,a),_=sN(e),x=e.get("barMinHeight")||0,w=d&&t.getDimensionIndex(d),C=t.getLayout("size"),A=t.getLayout("offset");return{progress:function(L,O){for(var V=L.count,F=_&&bs(V*3),$=_&&l&&bs(V*3),H=_&&bs(V),Z=n.master.getRect(),j=g?Z.width:Z.height,Y,se=O.getStore(),ae=0;(Y=L.next())!=null;){var ue=se.get(f?w:o,Y),fe=se.get(s,Y),le=m,ge=void 0;f&&(ge=+ue-se.get(o,Y));var xe=void 0,Me=void 0,Ve=void 0,Fe=void 0;if(g){var Xe=n.dataToPoint([ue,fe]);if(f){var ot=n.dataToPoint([ge,fe]);le=ot[0]}xe=le,Me=Xe[1]+A,Ve=Xe[0]-le,Fe=C,Math.abs(Ve)0?t:1:t))}var Uj={},Hj=function(r,e,t,n){for(;t>>1;r[i][1]i&&(this._approxInterval=i);var s=k_.length,l=Math.min(Hj(k_,this._approxInterval,0,s),s-1);this._interval=k_[l][1],this._minLevelUnit=k_[Math.max(l-1,0)][0]},e.prototype.parse=function(t){return Lr(t)?t:+us(t)},e.prototype.contain=function(t){return A_(this.parse(t),this._extent)},e.prototype.normalize=function(t){return D_(this.parse(t),this._extent)},e.prototype.scale=function(t){return M_(t,this._extent)},e.type="time",e}(Js),k_=[["second",w1],["minute",S1],["hour",Up],["quarter-day",Up*6],["half-day",Up*12],["day",fo*1.2],["half-week",fo*3.5],["week",fo*7],["month",fo*31],["quarter",fo*95],["half-year",lL/2],["year",lL]];function Wj(r,e,t,n){var i=us(e),a=us(t),o=function(_){return dL(i,_,n)===dL(a,_,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},u=function(){return l()&&o("day")},d=function(){return u()&&o("hour")},f=function(){return d()&&o("minute")},g=function(){return f()&&o("second")},m=function(){return g()&&o("millisecond")};switch(r){case"year":return s();case"month":return l();case"day":return u();case"hour":return d();case"minute":return f();case"second":return g();case"millisecond":return m()}}function qj(r,e){return r/=fo,r>16?16:r>7.5?7:r>3.5?4:r>1.5?2:1}function Zj(r){var e=30*fo;return r/=e,r>6?6:r>3?3:r>2?2:1}function jj(r){return r/=Up,r>12?12:r>6?6:r>3.5?4:r>2?2:1}function lN(r,e){return r/=e?S1:w1,r>30?30:r>20?20:r>15?15:r>10?10:r>5?5:r>2?2:1}function Xj(r){return xI(r)}function Yj(r,e,t){var n=new Date(r);switch(fd(e)){case"year":case"month":n[fL(t)](0);case"day":n[pL(t)](1);case"hour":n[gL(t)](0);case"minute":n[vL(t)](0);case"second":n[mL(t)](0),n[yL(t)](0)}return n.getTime()}function Kj(r,e,t,n){var i=1e4,a=cL,o=0;function s(j,Y,se,ae,ue,fe,le){for(var ge=new Date(Y),xe=Y,Me=ge[ae]();xe1&&fe===0&&se.unshift({value:se[0].value-xe})}}for(var fe=0;fe=n[0]&&A<=n[1]&&f++)}var L=(n[1]-n[0])/e;if(f>L*1.5&&g>L/1.5||(u.push(w),f>L||r===a[m]))break}d=[]}}}Uj.NODE_ENV!=="production"&&o>=i&&wn("Exceed safe limit.");for(var O=$r(je(u,function(j){return $r(j,function(Y){return Y.value>=n[0]&&Y.value<=n[1]&&!Y.notAdd})}),function(j){return j.length>0}),V=[],F=O.length-1,m=0;m0;)a*=10;var s=[Ln(eX(n[0]/a)*a),Ln(Qj(n[1]/a)*a)];this._interval=a,this._niceExtent=s}},e.prototype.calcNiceExtent=function(t){pg.calcNiceExtent.call(this,t),this._fixMin=t.fixMin,this._fixMax=t.fixMax},e.prototype.parse=function(t){return t},e.prototype.contain=function(t){return t=Zo(t)/Zo(this.base),A_(t,this._extent)},e.prototype.normalize=function(t){return t=Zo(t)/Zo(this.base),D_(t,this._extent)},e.prototype.scale=function(t){return t=M_(t,this._extent),L_(this.base,t)},e.type="log",e}(_s),cN=RS.prototype;cN.getMinorTicks=pg.getMinorTicks,cN.getLabel=pg.getLabel;function P_(r,e){return Jj(r,ls(e))}_s.registerClass(RS);var NS={},tX=function(){function r(e,t,n){this._prepareParams(e,t,n)}return r.prototype._prepareParams=function(e,t,n){n[1]0&&l>0&&!u&&(s=0),s<0&&l<0&&!d&&(l=0));var g=this._determinedMin,m=this._determinedMax;return g!=null&&(s=g,u=!0),m!=null&&(l=m,d=!0),{min:s,max:l,minFixed:u,maxFixed:d,isBlank:f}},r.prototype.modifyDataMinMax=function(e,t){NS.NODE_ENV!=="production"&&Ot(!this.frozen),this[nX[e]]=t},r.prototype.setDeterminedMinMax=function(e,t){var n=rX[e];NS.NODE_ENV!=="production"&&Ot(!this.frozen&&this[n]==null),this[n]=t},r.prototype.freeze=function(){this.frozen=!0},r}(),rX={min:"_determinedMin",max:"_determinedMax"},nX={min:"_dataMin",max:"_dataMax"};function hN(r,e,t){var n=r.rawExtentInfo;return n||(n=new tX(r,e,t),r.rawExtentInfo=n,n)}function R_(r,e){return e==null?null:qu(e)?NaN:r.parse(e)}function dN(r,e){var t=r.type,n=hN(r,e,r.getExtent()).calculate();r.setBlank(n.isBlank);var i=n.min,a=n.max,o=e.ecModel;if(o&&t==="time"){var s=tN("bar",o),l=!1;if(Q(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var u=rN(s),d=iX(i,a,e,u);i=d.min,a=d.max}}return{extent:[i,a],fixMin:n.minFixed,fixMax:n.maxFixed}}function iX(r,e,t,n){var i=t.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=$j(n,t.axis);if(o===void 0)return{min:r,max:e};var s=1/0;Q(o,function(m){s=Math.min(m.offset,s)});var l=-1/0;Q(o,function(m){l=Math.max(m.offset+m.width,l)}),s=Math.abs(s),l=Math.abs(l);var u=s+l,d=e-r,f=1-(s+l)/a,g=d/f-d;return e+=g*(l/u),r-=g*(s/u),{min:r,max:e}}function Pd(r,e){var t=e,n=dN(r,t),i=n.extent,a=t.get("splitNumber");r instanceof RS&&(r.base=t.get("logBase"));var o=r.type,s=t.get("interval"),l=o==="interval"||o==="time";r.setExtent(i[0],i[1]),r.calcNiceExtent({splitNumber:a,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?t.get("minInterval"):null,maxInterval:l?t.get("maxInterval"):null}),s!=null&&r.setInterval&&r.setInterval(s)}function N_(r,e){if(e=e||r.get("type"),e)switch(e){case"category":return new I_({ordinalMeta:r.getOrdinalMeta?r.getOrdinalMeta():r.getCategories(),extent:[1/0,-1/0]});case"time":return new PS({locale:r.ecModel.getLocaleModel(),useUTC:r.ecModel.get("useUTC")});default:return new(_s.getClass(e)||Js)}}function aX(r){var e=r.scale.getExtent(),t=e[0],n=e[1];return!(t>0&&n>0||t<0&&n<0)}function Rd(r){var e=r.getLabelModel().get("formatter"),t=r.type==="category"?r.scale.getExtent()[0]:null;return r.scale.type==="time"?function(n){return function(i,a){return r.scale.getFormattedLabel(i,a,n)}}(e):ut(e)?function(n){return function(i){var a=r.scale.getLabel(i),o=n.replace("{value}",a??"");return o}}(e):It(e)?function(n){return function(i,a){return t!=null&&(a=i.value-t),n(OS(r,i),a,i.level!=null?{level:i.level}:null)}}(e):function(n){return r.scale.getLabel(n)}}function OS(r,e){return r.type==="category"?r.scale.getLabel(e):e.value}function oX(r){var e=r.model,t=r.scale;if(!(!e.get(["axisLabel","show"])||t.isBlank())){var n,i,a=t.getExtent();t instanceof I_?i=t.count():(n=t.getTicks(),i=n.length);var o=r.getLabelModel(),s=Rd(r),l,u=1;i>40&&(u=Math.ceil(i/40));for(var d=0;dr[1]&&(r[1]=i[1])})}var gg=function(){function r(){}return r.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},r.prototype.getCoordSysModel=function(){},r}(),uX=1e-8;function pN(r,e){return Math.abs(r-e)i&&(n=o,i=l)}if(n)return hX(n.exterior);var u=this.getBoundingRect();return[u.x+u.width/2,u.y+u.height/2]},e.prototype.getBoundingRect=function(t){var n=this._rect;if(n&&!t)return n;var i=[1/0,1/0],a=[-1/0,-1/0],o=this.geometries;return Q(o,function(s){s.type==="polygon"?gN(s.exterior,i,a,t):Q(s.points,function(l){gN(l,i,a,t)})}),isFinite(i[0])&&isFinite(i[1])&&isFinite(a[0])&&isFinite(a[1])||(i[0]=i[1]=a[0]=a[1]=0),n=new sr(i[0],i[1],a[0]-i[0],a[1]-i[1]),t||(this._rect=n),n},e.prototype.contain=function(t){var n=this.getBoundingRect(),i=this.geometries;if(!n.contain(t[0],t[1]))return!1;e:for(var a=0,o=i.length;a>1^-(s&1),l=l>>1^-(l&1),s+=i,l+=a,i=s,a=l,n.push([s/t,l/t])}return n}function pX(r,e){return r=fX(r),je($r(r.features,function(t){return t.geometry&&t.properties&&t.geometry.coordinates.length>0}),function(t){var n=t.properties,i=t.geometry,a=[];switch(i.type){case"Polygon":var o=i.coordinates;a.push(new mN(o[0],o.slice(1)));break;case"MultiPolygon":Q(i.coordinates,function(l){l[0]&&a.push(new mN(l[0],l.slice(1)))});break;case"LineString":a.push(new yN([i.coordinates]));break;case"MultiLineString":a.push(new yN(i.coordinates))}var s=new _N(n[e||"name"],a,n.cp);return s.properties=n,s})}var vg=Cr();function xN(r,e){var t=je(e,function(n){return r.scale.parse(n)});return r.type==="time"&&t.length>0&&(t.sort(),t.unshift(t[0]),t.push(t[t.length-1])),t}function gX(r){var e=r.getLabelModel().get("customValues");if(e){var t=Rd(r),n=r.scale.getExtent(),i=xN(r,e),a=$r(i,function(o){return o>=n[0]&&o<=n[1]});return{labels:je(a,function(o){var s={value:o};return{formattedLabel:t(s),rawLabel:r.scale.getLabel(s),tickValue:o}})}}return r.type==="category"?mX(r):_X(r)}function vX(r,e){var t=r.getTickModel().get("customValues");if(t){var n=r.scale.getExtent(),i=xN(r,t);return{ticks:$r(i,function(a){return a>=n[0]&&a<=n[1]})}}return r.type==="category"?yX(r,e):{ticks:je(r.scale.getTicks(),function(a){return a.value})}}function mX(r){var e=r.getLabelModel(),t=wN(r,e);return!e.get("show")||r.scale.isBlank()?{labels:[],labelCategoryInterval:t.labelCategoryInterval}:t}function wN(r,e){var t=SN(r,"labels"),n=zS(e),i=TN(t,n);if(i)return i;var a,o;return It(n)?a=AN(r,n):(o=n==="auto"?bX(r):n,a=CN(r,o)),EN(t,n,{labels:a,labelCategoryInterval:o})}function yX(r,e){var t=SN(r,"ticks"),n=zS(e),i=TN(t,n);if(i)return i;var a,o;if((!e.get("show")||r.scale.isBlank())&&(a=[]),It(n))a=AN(r,n,!0);else if(n==="auto"){var s=wN(r,r.getLabelModel());o=s.labelCategoryInterval,a=je(s.labels,function(l){return l.tickValue})}else o=n,a=CN(r,o,!0);return EN(t,n,{ticks:a,tickCategoryInterval:o})}function _X(r){var e=r.scale.getTicks(),t=Rd(r);return{labels:je(e,function(n,i){return{level:n.level,formattedLabel:t(n,i),rawLabel:r.scale.getLabel(n),tickValue:n.value}})}}function SN(r,e){return vg(r)[e]||(vg(r)[e]=[])}function TN(r,e){for(var t=0;t40&&(s=Math.max(1,Math.floor(o/40)));for(var l=a[0],u=r.dataToCoord(l+1)-r.dataToCoord(l),d=Math.abs(u*Math.cos(n)),f=Math.abs(u*Math.sin(n)),g=0,m=0;l<=a[1];l+=s){var _=0,x=0,w=bp(t({value:l}),e.font,"center","top");_=w.width*1.3,x=w.height*1.3,g=Math.max(g,_,7),m=Math.max(m,x,7)}var C=g/d,A=m/f;isNaN(C)&&(C=1/0),isNaN(A)&&(A=1/0);var L=Math.max(0,Math.floor(Math.min(C,A))),O=vg(r.model),V=r.getExtent(),F=O.lastAutoInterval,$=O.lastTickCount;return F!=null&&$!=null&&Math.abs(F-L)<=1&&Math.abs($-o)<=1&&F>L&&O.axisExtent0===V[0]&&O.axisExtent1===V[1]?L=F:(O.lastTickCount=o,O.lastAutoInterval=L,O.axisExtent0=V[0],O.axisExtent1=V[1]),L}function wX(r){var e=r.getLabelModel();return{axisRotate:r.getRotate?r.getRotate():r.isHorizontal&&!r.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function CN(r,e,t){var n=Rd(r),i=r.scale,a=i.getExtent(),o=r.getLabelModel(),s=[],l=Math.max((e||0)+1,1),u=a[0],d=i.count();u!==0&&l>1&&d/l>2&&(u=Math.round(Math.ceil(u/l)*l));var f=fN(r),g=o.get("showMinLabel")||f,m=o.get("showMaxLabel")||f;g&&u!==a[0]&&x(a[0]);for(var _=u;_<=a[1];_+=l)x(_);m&&_-l!==a[1]&&x(a[1]);function x(w){var C={value:w};s.push(t?w:{formattedLabel:n(C),rawLabel:i.getLabel(C),tickValue:w})}return s}function AN(r,e,t){var n=r.scale,i=Rd(r),a=[];return Q(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&a.push(t?l:{formattedLabel:i(o),rawLabel:s,tickValue:l})}),a}var DN=[0,1],jo=function(){function r(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return r.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),i=Math.max(t[0],t[1]);return e>=n&&e<=i},r.prototype.containData=function(e){return this.scale.contain(e)},r.prototype.getExtent=function(){return this._extent.slice()},r.prototype.getPixelPrecision=function(e){return yI(e||this.scale.getExtent(),this._extent)},r.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},r.prototype.dataToCoord=function(e,t){var n=this._extent,i=this.scale;return e=i.normalize(e),this.onBand&&i.type==="ordinal"&&(n=n.slice(),MN(n,i.count())),Wr(e,DN,n,t)},r.prototype.coordToData=function(e,t){var n=this._extent,i=this.scale;this.onBand&&i.type==="ordinal"&&(n=n.slice(),MN(n,i.count()));var a=Wr(e,n,DN,t);return this.scale.scale(a)},r.prototype.pointToData=function(e,t){},r.prototype.getTicksCoords=function(e){e=e||{};var t=e.tickModel||this.getTickModel(),n=vX(this,t),i=n.ticks,a=je(i,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=t.get("alignWithLabel");return SX(this,a,o,e.clamp),a},r.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),t=e.get("splitNumber");t>0&&t<100||(t=5);var n=this.scale.getMinorTicks(t),i=je(n,function(a){return je(a,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return i},r.prototype.getViewLabels=function(){return gX(this).labels},r.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},r.prototype.getTickModel=function(){return this.model.getModel("axisTick")},r.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+(this.onBand?1:0);n===0&&(n=1);var i=Math.abs(e[1]-e[0]);return Math.abs(i)/n},r.prototype.calculateCategoryInterval=function(){return xX(this)},r}();function MN(r,e){var t=r[1]-r[0],n=e,i=t/n/2;r[0]+=i,r[1]-=i}function SX(r,e,t,n){var i=e.length;if(!r.onBand||t||!i)return;var a=r.getExtent(),o,s;if(i===1)e[0].coord=a[0],o=e[1]={coord:a[1],tickValue:e[0].tickValue};else{var l=e[i-1].tickValue-e[0].tickValue,u=(e[i-1].coord-e[0].coord)/l;Q(e,function(m){m.coord-=u/2});var d=r.scale.getExtent();s=1+d[1]-e[i-1].tickValue,o={coord:e[i-1].coord+u*s,tickValue:d[1]+1},e.push(o)}var f=a[0]>a[1];g(e[0].coord,a[0])&&(n?e[0].coord=a[0]:e.shift()),n&&g(a[0],e[0].coord)&&e.unshift({coord:a[0]}),g(a[1],o.coord)&&(n?o.coord=a[1]:e.pop()),n&&g(o.coord,a[1])&&e.push({coord:a[1]});function g(m,_){return m=Ln(m),_=Ln(_),f?m>_:m<_}}var mg=Math.PI*2,Vc=ps.CMD,TX=["top","right","bottom","left"];function EX(r,e,t,n,i){var a=t.width,o=t.height;switch(r){case"top":n.set(t.x+a/2,t.y-e),i.set(0,-1);break;case"bottom":n.set(t.x+a/2,t.y+o+e),i.set(0,1);break;case"left":n.set(t.x-e,t.y+o/2),i.set(-1,0);break;case"right":n.set(t.x+a+e,t.y+o/2),i.set(1,0);break}}function CX(r,e,t,n,i,a,o,s,l){o-=r,s-=e;var u=Math.sqrt(o*o+s*s);o/=u,s/=u;var d=o*t+r,f=s*t+e;if(Math.abs(n-i)%mg<1e-4)return l[0]=d,l[1]=f,u-t;if(a){var g=n;n=$a(i),i=$a(g)}else n=$a(n),i=$a(i);n>i&&(i+=mg);var m=Math.atan2(s,o);if(m<0&&(m+=mg),m>=n&&m<=i||m+mg>=n&&m+mg<=i)return l[0]=d,l[1]=f,u-t;var _=t*Math.cos(n)+r,x=t*Math.sin(n)+e,w=t*Math.cos(i)+r,C=t*Math.sin(i)+e,A=(_-o)*(_-o)+(x-s)*(x-s),L=(w-o)*(w-o)+(C-s)*(C-s);return A0){e=e/180*Math.PI,Yo.fromArray(r[0]),sn.fromArray(r[1]),zn.fromArray(r[2]),ir.sub(xs,Yo,sn),ir.sub(ws,zn,sn);var t=xs.len(),n=ws.len();if(!(t<.001||n<.001)){xs.scale(1/t),ws.scale(1/n);var i=xs.dot(ws),a=Math.cos(e);if(a1&&ir.copy(ia,zn),ia.toArray(r[1])}}}}function MX(r,e,t){if(t<=180&&t>0){t=t/180*Math.PI,Yo.fromArray(r[0]),sn.fromArray(r[1]),zn.fromArray(r[2]),ir.sub(xs,sn,Yo),ir.sub(ws,zn,sn);var n=xs.len(),i=ws.len();if(!(n<.001||i<.001)){xs.scale(1/n),ws.scale(1/i);var a=xs.dot(e),o=Math.cos(t);if(a=l)ir.copy(ia,zn);else{ia.scaleAndAdd(ws,s/Math.tan(Math.PI/2-d));var f=zn.x!==sn.x?(ia.x-sn.x)/(zn.x-sn.x):(ia.y-sn.y)/(zn.y-sn.y);if(isNaN(f))return;f<0?ir.copy(ia,sn):f>1&&ir.copy(ia,zn)}ia.toArray(r[1])}}}}function FS(r,e,t,n){var i=t==="normal",a=i?r:r.ensureState(t);a.ignore=e;var o=n.get("smooth");o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=n.getModel("lineStyle").getLineStyle();i?r.useStyle(s):a.style=s}function IX(r,e){var t=e.smooth,n=e.points;if(n)if(r.moveTo(n[0][0],n[0][1]),t>0&&n.length>=3){var i=El(n[0],n[1]),a=El(n[1],n[2]);if(!i||!a){r.lineTo(n[1][0],n[1][1]),r.lineTo(n[2][0],n[2][1]);return}var o=Math.min(i,a)*t,s=Vm([],n[1],n[0],o/i),l=Vm([],n[1],n[2],o/a),u=Vm([],s,l,.5);r.bezierCurveTo(s[0],s[1],s[0],s[1],u[0],u[1]),r.bezierCurveTo(l[0],l[1],l[0],l[1],n[2][0],n[2][1])}else for(var d=1;d0){L(Z*H,0,o);var j=Z+F;j<0&&O(-j*H,1)}else O(-F*H,1)}}function L(F,$,H){F!==0&&(u=!0);for(var Z=$;Z0)for(var j=0;j0;j--){var ue=H[j-1]*ae;L(-ue,j,o)}}}function V(F){var $=F<0?-1:1;F=Math.abs(F);for(var H=Math.ceil(F/(o-1)),Z=0;Z0?L(H,0,Z+1):L(-H,o-Z-1,o),F-=H,F<=0)return}return u}function kX(r,e,t,n){return RN(r,"x","width",e,t)}function NN(r,e,t,n){return RN(r,"y","height",e,t)}function ON(r){var e=[];r.sort(function(x,w){return w.priority-x.priority});var t=new sr(0,0,0,0);function n(x){if(!x.ignore){var w=x.ensureState("emphasis");w.ignore==null&&(w.ignore=!1)}x.ignore=!0}for(var i=0;i=0&&n.attr(a.oldLayoutSelect),hr(g,"emphasis")>=0&&n.attr(a.oldLayoutEmphasis)),Or(n,u,t,l)}else if(n.attr(u),!cd(n).valueAnimation){var f=Zt(n.style.opacity,1);n.style.opacity=0,yn(n,{style:{opacity:f}},t,l)}if(a.oldLayout=u,n.states.select){var m=a.oldLayoutSelect={};V_(m,u,F_),V_(m,n.states.select,F_)}if(n.states.emphasis){var _=a.oldLayoutEmphasis={};V_(_,u,F_),V_(_,n.states.emphasis,F_)}nL(n,l,d,t,t)}if(i&&!i.ignore&&!i.invisible){var a=RX(i),o=a.oldLayout,x={points:i.shape.points};o?(i.attr({shape:o}),Or(i,{shape:x},t)):(i.setShape(x),i.style.strokePercent=0,yn(i,{style:{strokePercent:1}},t)),a.oldLayout=x}},r}(),HS=Cr();function OX(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){var i=HS(t).labelManager;i||(i=HS(t).labelManager=new NX),i.clearLabels()}),r.registerUpdateLifecycle("series:layoutlabels",function(e,t,n){var i=HS(t).labelManager;n.updatedSeries.forEach(function(a){i.addLabelsOfSeries(t.getViewOfSeriesModel(a))}),i.updateLayoutConfig(t),i.layout(t),i.processLabelsOverall()})}var WS=Math.sin,qS=Math.cos,BN=Math.PI,Fc=Math.PI*2,zX=180/BN,VN=function(){function r(){}return r.prototype.reset=function(e){this._start=!0,this._d=[],this._str="",this._p=Math.pow(10,e||4)},r.prototype.moveTo=function(e,t){this._add("M",e,t)},r.prototype.lineTo=function(e,t){this._add("L",e,t)},r.prototype.bezierCurveTo=function(e,t,n,i,a,o){this._add("C",e,t,n,i,a,o)},r.prototype.quadraticCurveTo=function(e,t,n,i){this._add("Q",e,t,n,i)},r.prototype.arc=function(e,t,n,i,a,o){this.ellipse(e,t,n,n,0,i,a,o)},r.prototype.ellipse=function(e,t,n,i,a,o,s,l){var u=s-o,d=!l,f=Math.abs(u),g=Ll(f-Fc)||(d?u>=Fc:-u>=Fc),m=u>0?u%Fc:u%Fc+Fc,_=!1;g?_=!0:Ll(f)?_=!1:_=m>=BN==!!d;var x=e+n*qS(o),w=t+i*WS(o);this._start&&this._add("M",x,w);var C=Math.round(a*zX);if(g){var A=1/this._p,L=(d?1:-1)*(Fc-A);this._add("A",n,i,C,1,+d,e+n*qS(o+L),t+i*WS(o+L)),A>.01&&this._add("A",n,i,C,0,+d,x,w)}else{var O=e+n*qS(s),V=t+i*WS(s);this._add("A",n,i,C,+_,+d,O,V)}},r.prototype.rect=function(e,t,n,i){this._add("M",e,t),this._add("l",n,0),this._add("l",0,i),this._add("l",-n,0),this._add("Z")},r.prototype.closePath=function(){this._d.length>0&&this._add("Z")},r.prototype._add=function(e,t,n,i,a,o,s,l,u){for(var d=[],f=this._p,g=1;g"}function qX(r){return""}function XS(r,e){e=e||{};var t=e.newline?` `:"";function n(i){var a=i.children,o=i.tag,s=i.attrs,l=i.text;return WX(o,s)+(o!=="style"?Yi(l):l||"")+(a?""+t+je(a,function(u){return n(u)}).join(t)+t:"")+qX(o)}return n(r)}function ZX(r,e,t){t=t||{};var n=t.newline?` `:"",i=" {"+n,a=n+"}",o=je(br(r),function(l){return l+i+je(br(r[l]),function(u){return u+":"+r[l][u]+";"}).join(n)+a}).join(n),s=je(br(e),function(l){return"@keyframes "+l+i+je(br(e[l]),function(u){return u+i+je(br(e[l][u]),function(d){var f=e[l][u][d];return d==="d"&&(f='path("'+f+'")'),d+":"+f+";"}).join(n)+a}).join(n)+a}).join(n);return!o&&!s?"":[""].join(n)}function YS(r){return{zrId:r,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function HN(r,e,t,n){return oi("svg","root",{width:r,height:e,xmlns:FN,"xmlns:xlink":$N,version:"1.1",baseProfile:"full",viewBox:n?"0 0 "+r+" "+e:!1},t)}var jX=0;function WN(){return jX++}var qN={cubicIn:"0.32,0,0.67,0",cubicOut:"0.33,1,0.68,1",cubicInOut:"0.65,0,0.35,1",quadraticIn:"0.11,0,0.5,0",quadraticOut:"0.5,1,0.89,1",quadraticInOut:"0.45,0,0.55,1",quarticIn:"0.5,0,0.75,0",quarticOut:"0.25,1,0.5,1",quarticInOut:"0.76,0,0.24,1",quinticIn:"0.64,0,0.78,0",quinticOut:"0.22,1,0.36,1",quinticInOut:"0.83,0,0.17,1",sinusoidalIn:"0.12,0,0.39,0",sinusoidalOut:"0.61,1,0.88,1",sinusoidalInOut:"0.37,0,0.63,1",exponentialIn:"0.7,0,0.84,0",exponentialOut:"0.16,1,0.3,1",exponentialInOut:"0.87,0,0.13,1",circularIn:"0.55,0,1,0.45",circularOut:"0,0.55,0.45,1",circularInOut:"0.85,0,0.15,1"},$c="transform-origin";function XX(r,e,t){var n=Ge({},r.shape);Ge(n,e),r.buildPath(t,n);var i=new VN;return i.reset(KM(r)),t.rebuildPath(i,1),i.generateStr(),i.getStr()}function YX(r,e){var t=e.originX,n=e.originY;(t||n)&&(r[$c]=t+"px "+n+"px")}var KX={fill:"fill",opacity:"opacity",lineWidth:"stroke-width",lineDashOffset:"stroke-dashoffset"};function ZN(r,e){var t=e.zrId+"-ani-"+e.cssAnimIdx++;return e.cssAnims[t]=r,t}function JX(r,e,t){var n=r.shape.paths,i={},a,o;if(Q(n,function(l){var u=YS(t.zrId);u.animation=!0,$_(l,{},u,!0);var d=u.cssAnims,f=u.cssNodes,g=br(d),m=g.length;if(m){o=g[m-1];var _=d[o];for(var x in _){var w=_[x];i[x]=i[x]||{d:""},i[x].d+=w.d||""}for(var C in f){var A=f[C].animation;A.indexOf(o)>=0&&(a=A)}}}),!!a){e.d=!1;var s=ZN(i,t);return a.replace(o,s)}}function jN(r){return ut(r)?qN[r]?"cubic-bezier("+qN[r]+")":Wx(r)?r:"":""}function $_(r,e,t,n){var i=r.animators,a=i.length,o=[];if(r instanceof c1){var s=JX(r,e,t);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var l={},u=0;u0}).length){var Ht=ZN($,t);return Ht+" "+A[0]+" both"}}for(var w in l){var s=x(l[w]);s&&o.push(s)}if(o.length){var C=t.zrId+"-cls-"+WN();t.cssNodes["."+C]={animation:o.join(",")},e.class=C}}function QX(r,e,t){if(!r.ignore)if(r.isSilent()){var n={"pointer-events":"none"};XN(n,e,t)}else{var i=r.states.emphasis&&r.states.emphasis.style?r.states.emphasis.style:{},a=i.fill;if(!a){var o=r.style&&r.style.fill,s=r.states.select&&r.states.select.style&&r.states.select.style.fill,l=r.currentStates.indexOf("select")>=0&&s||o;l&&(a=Jx(l))}var u=i.lineWidth;if(u){var d=!i.strokeNoScale&&r.transform?r.transform[0]:1;u=u/d}var n={cursor:"pointer"};a&&(n.fill=a),i.stroke&&(n.stroke=i.stroke),u&&(n["stroke-width"]=u),XN(n,e,t)}}function XN(r,e,t,n){var i=JSON.stringify(r),a=t.cssStyleCache[i];a||(a=t.zrId+"-cls-"+WN(),t.cssStyleCache[i]=a,t.cssNodes["."+a+":hover"]=r),e.class=e.class?e.class+" "+a:a}var eY={},yg=Math.round;function YN(r){return r&&ut(r.src)}function KN(r){return r&&It(r.toDataURL)}function KS(r,e,t,n){GX(function(i,a){var o=i==="fill"||i==="stroke";o&&YM(a)?nO(e,r,i,n):o&&ew(a)?iO(t,r,i,n):r[i]=a,o&&n.ssr&&a==="none"&&(r["pointer-events"]="visible")},e,t,!1),sY(t,r,n)}function JS(r,e){var t=zH(e);t&&(t.each(function(n,i){n!=null&&(r[(GN+i).toLowerCase()]=n+"")}),e.isSilent()&&(r[GN+"silent"]="true"))}function JN(r){return Ll(r[0]-1)&&Ll(r[1])&&Ll(r[2])&&Ll(r[3]-1)}function tY(r){return Ll(r[4])&&Ll(r[5])}function QS(r,e,t){if(e&&!(tY(e)&&JN(e))){var n=1e4;r.transform=JN(e)?"translate("+yg(e[4]*n)/n+" "+yg(e[5]*n)/n+")":iH(e)}}function QN(r,e,t){for(var n=r.points,i=[],a=0;a"u"){var w="Image width/height must been given explictly in svg-ssr renderer.";Ot(g,w),Ot(m,w)}else if(g==null||m==null){var C=function(j,Y){if(j){var se=j.elm,ae=g||Y.width,ue=m||Y.height;j.tag==="pattern"&&(u?(ue=1,ae/=a.width):d&&(ae=1,ue/=a.height)),j.attrs.width=ae,j.attrs.height=ue,se&&(se.setAttribute("width",ae),se.setAttribute("height",ue))}},A=Pw(_,null,r,function(j){l||C(F,j),C(f,j)});A&&A.width&&A.height&&(g=g||A.width,m=m||A.height)}f=oi("image","img",{href:_,width:g,height:m}),o.width=g,o.height=m}else i.svgElement&&(f=Ut(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(f){var L,O;l?L=O=1:u?(O=1,L=o.width/a.width):d?(L=1,O=o.height/a.height):o.patternUnits="userSpaceOnUse",L!=null&&!isNaN(L)&&(o.width=L),O!=null&&!isNaN(O)&&(o.height=O);var V=JM(i);V&&(o.patternTransform=V);var F=oi("pattern","",o,[f]),$=XS(F),H=n.patternCache,Z=H[$];Z||(Z=n.zrId+"-p"+n.patternIdx++,H[$]=Z,o.id=Z,F=n.defs[Z]=oi("pattern",Z,o,[f])),e[t]=ey(Z)}}function lY(r,e,t){var n=t.clipPathCache,i=t.defs,a=n[r.id];if(!a){a=t.zrId+"-c"+t.clipPathIdx++;var o={id:a};n[r.id]=a,i[a]=oi("clipPath",a,o,[tO(r,t)])}e["clip-path"]=ey(a)}function aO(r){return document.createTextNode(r)}function Gc(r,e,t){r.insertBefore(e,t)}function oO(r,e){r.removeChild(e)}function sO(r,e){r.appendChild(e)}function lO(r){return r.parentNode}function uO(r){return r.nextSibling}function eT(r,e){r.textContent=e}var uY={},cO=58,cY=120,hY=oi("","");function tT(r){return r===void 0}function Ss(r){return r!==void 0}function dY(r,e,t){for(var n={},i=e;i<=t;++i){var a=r[i].key;a!==void 0&&(uY.NODE_ENV!=="production"&&n[a]!=null&&console.error("Duplicate key "+a),n[a]=i)}return n}function _g(r,e){var t=r.key===e.key,n=r.tag===e.tag;return n&&t}function bg(r){var e,t=r.children,n=r.tag;if(Ss(n)){var i=r.elm=UN(n);if(rT(hY,r),Ze(t))for(e=0;ea?(_=t[l+1]==null?null:t[l+1].elm,hO(r,_,t,i,l)):G_(r,e,n,a))}function Nd(r,e){var t=e.elm=r.elm,n=r.children,i=e.children;r!==e&&(rT(r,e),tT(e.text)?Ss(n)&&Ss(i)?n!==i&&fY(t,n,i):Ss(i)?(Ss(r.text)&&eT(t,""),hO(t,null,i,0,i.length-1)):Ss(n)?G_(t,n,0,n.length-1):Ss(r.text)&&eT(t,""):r.text!==e.text&&(Ss(n)&&G_(t,n,0,n.length-1),eT(t,e.text)))}function pY(r,e){if(_g(r,e))Nd(r,e);else{var t=r.elm,n=lO(t);bg(e),n!==null&&(Gc(n,e.elm,uO(t)),G_(n,[r],0,0))}return e}var gY={},vY=0,mY=function(){function r(e,t,n){if(this.type="svg",this.refreshHover=dO("refreshHover"),this.configLayer=dO("configLayer"),this.storage=t,this._opts=n=Ge({},n),this.root=e,this._id="zr"+vY++,this._oldVNode=HN(n.width,n.height),e&&!n.ssr){var i=this._viewport=document.createElement("div");i.style.cssText="position:relative;overflow:hidden";var a=this._svgDom=this._oldVNode.elm=UN("svg");rT(null,this._oldVNode),i.appendChild(a),e.appendChild(i)}this.resize(n.width,n.height)}return r.prototype.getType=function(){return this.type},r.prototype.getViewportRoot=function(){return this._viewport},r.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},r.prototype.getSvgDom=function(){return this._svgDom},r.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style="position:absolute;left:0;top:0;user-select:none",pY(this._oldVNode,e),this._oldVNode=e}},r.prototype.renderOneToVNode=function(e){return rO(e,YS(this._id))},r.prototype.renderToVNode=function(e){e=e||{};var t=this.storage.getDisplayList(!0),n=this._width,i=this._height,a=YS(this._id);a.animation=e.animation,a.willUpdate=e.willUpdate,a.compress=e.compress,a.emphasis=e.emphasis,a.ssr=this._opts.ssr;var o=[],s=this._bgVNode=yY(n,i,this._backgroundColor,a);s&&o.push(s);var l=e.compress?null:this._mainVNode=oi("g","main",{},[]);this._paintList(t,a,l?l.children:o),l&&o.push(l);var u=je(br(a.defs),function(g){return a.defs[g]});if(u.length&&o.push(oi("defs","defs",{},u)),e.animation){var d=ZX(a.cssNodes,a.cssAnims,{newline:!0});if(d){var f=oi("style","stl",{},[],d);o.push(f)}}return HN(n,i,o,e.useViewBox)},r.prototype.renderToString=function(e){return e=e||{},XS(this.renderToVNode({animation:Zt(e.cssAnimation,!0),emphasis:Zt(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:Zt(e.useViewBox,!0)}),{newline:!0})},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e},r.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},r.prototype._paintList=function(e,t,n){for(var i=e.length,a=[],o=0,s,l,u=0,d=0;d=0&&!(g&&l&&g[x]===l[x]);x--);for(var w=_-1;w>x;w--)o--,s=a[o-1];for(var C=x+1;C=s)}}for(var f=this.__startIndex;f15)break}}ue.prevElClipPaths&&C.restore()};if(A)if(A.length===0)H=w.__endIndex;else for(var j=m.dpr,Y=0;Y0&&e>i[0]){for(l=0;le);l++);s=n[i[l]]}if(i.splice(l+1,0,e),n[e]=t,!t.virtual)if(s){var u=s.dom;u.nextSibling?o.insertBefore(t.dom,u.nextSibling):o.appendChild(t.dom)}else o.firstChild?o.insertBefore(t.dom,o.firstChild):o.appendChild(t.dom);t.painter||(t.painter=this)},r.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,i=0;i0?U_:0),this._needsManuallyCompositing),d.__builtin__||No("ZLevel "+u+" has been used by unkown layer "+d.id),d!==a&&(d.__used=!0,d.__startIndex!==l&&(d.__dirty=!0),d.__startIndex=l,d.incremental?d.__drawIndex=-1:d.__drawIndex=l,t(l),a=d),i.__dirty&Ba&&!i.__inHover&&(d.__dirty=!0,d.incremental&&d.__drawIndex<0&&(d.__drawIndex=l))}t(l),this.eachBuiltinLayer(function(f,g){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},r.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},r.prototype._clearLayer=function(e){e.clear()},r.prototype.setBackgroundColor=function(e){this._backgroundColor=e,Q(this._layers,function(t){t.setUnpainted()})},r.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?rr(n[e],t,!0):n[e]=t;for(var i=0;i-1&&(u.style.stroke=u.style.fill,u.style.fill="#fff",u.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e}(on);function Od(r,e){var t=r.mapDimensionsAll("defaultedLabel"),n=t.length;if(n===1){var i=xd(r,e,t[0]);return i!=null?i+"":null}else if(n){for(var a=[],o=0;o=0&&n.push(e[a])}return n.join(" ")}var xg=function(r){ze(e,r);function e(t,n,i,a){var o=r.call(this)||this;return o.updateData(t,n,i,a),o}return e.prototype._createSymbol=function(t,n,i,a,o){this.removeAll();var s=qn(t,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:a[0]/2,scaleY:a[1]/2}),s.drift=AY,this._symbolType=t,this.add(s)},e.prototype.stopSymbolAnimation=function(t){this.childAt(0).stopAnimation(null,t)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Ws(this.childAt(0))},e.prototype.downplay=function(){qs(this.childAt(0))},e.prototype.setZ=function(t,n){var i=this.childAt(0);i.zlevel=t,i.z=n},e.prototype.setDraggable=function(t,n){var i=this.childAt(0);i.draggable=t,i.cursor=!n&&t?"move":i.cursor},e.prototype.updateData=function(t,n,i,a){this.silent=!1;var o=t.getItemVisual(n,"symbol")||"circle",s=t.hostModel,l=e.getSymbolSize(t,n),u=o!==this._symbolType,d=a&&a.disableAnimation;if(u){var f=t.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,t,n,l,f)}else{var g=this.childAt(0);g.silent=!1;var m={scaleX:l[0]/2,scaleY:l[1]/2};d?g.attr(m):Or(g,m,s,n),Go(g)}if(this._updateCommon(t,n,l,i,a),u){var g=this.childAt(0);if(!d){var m={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:g.style.opacity}};g.scaleX=g.scaleY=0,g.style.opacity=0,yn(g,m,s,n)}}d&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(t,n,i,a,o){var s=this.childAt(0),l=t.hostModel,u,d,f,g,m,_,x,w,C;if(a&&(u=a.emphasisItemStyle,d=a.blurItemStyle,f=a.selectItemStyle,g=a.focus,m=a.blurScope,x=a.labelStatesModels,w=a.hoverScale,C=a.cursorStyle,_=a.emphasisDisabled),!a||t.hasItemOption){var A=a&&a.itemModel?a.itemModel:t.getItemModel(n),L=A.getModel("emphasis");u=L.getModel("itemStyle").getItemStyle(),f=A.getModel(["select","itemStyle"]).getItemStyle(),d=A.getModel(["blur","itemStyle"]).getItemStyle(),g=L.get("focus"),m=L.get("blurScope"),_=L.get("disabled"),x=ni(A),w=L.getShallow("scale"),C=A.getShallow("cursor")}var O=t.getItemVisual(n,"symbolRotate");s.attr("rotation",(O||0)*Math.PI/180||0);var V=Pc(t.getItemVisual(n,"symbolOffset"),i);V&&(s.x=V[0],s.y=V[1]),C&&s.attr("cursor",C);var F=t.getItemVisual(n,"style"),$=F.fill;if(s instanceof di){var H=s.style;s.useStyle(Ge({image:H.image,x:H.x,y:H.y,width:H.width,height:H.height},F))}else s.__isEmptyBrush?s.useStyle(Ge({},F)):s.useStyle(F),s.style.decal=null,s.setColor($,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var Z=t.getItemVisual(n,"liftZ"),j=this._z2;Z!=null?j==null&&(this._z2=s.z2,s.z2+=Z):j!=null&&(s.z2=j,this._z2=null);var Y=o&&o.useNameLabel;Ci(s,x,{labelFetcher:l,labelDataIndex:n,defaultText:se,inheritColor:$,defaultOpacity:F.opacity});function se(fe){return Y?t.getName(fe):Od(t,fe)}this._sizeX=i[0]/2,this._sizeY=i[1]/2;var ae=s.ensureState("emphasis");ae.style=u,s.ensureState("select").style=f,s.ensureState("blur").style=d;var ue=w==null||w===!0?Math.max(1.1,3/this._sizeY):isFinite(w)&&w>0?+w:1;ae.scaleX=this._sizeX*ue,ae.scaleY=this._sizeY*ue,this.setSymbolScale(1),Sn(this,g,m,_)},e.prototype.setSymbolScale=function(t){this.scaleX=this.scaleY=t},e.prototype.fadeOut=function(t,n,i){var a=this.childAt(0),o=jt(this).dataIndex,s=i&&i.animation;if(this.silent=a.silent=!0,i&&i.fadeLabel){var l=a.getTextContent();l&&Bl(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){a.removeTextContent()}})}else a.removeTextContent();Bl(a,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:t,removeOpt:s})},e.getSymbolSize=function(t,n){return Ad(t.getItemVisual(n,"symbolSize"))},e}(qt);function AY(r,e){this.parent.drift(r,e)}function iT(r,e,t,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(t))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&r.getItemVisual(t,"symbol")!=="none"}function mO(r){return r!=null&&!Nt(r)&&(r={isIgnore:r}),r||{}}function yO(r){var e=r.hostModel,t=e.getModel("emphasis");return{emphasisItemStyle:t.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:t.get("focus"),blurScope:t.get("blurScope"),emphasisDisabled:t.get("disabled"),hoverScale:t.get("scale"),labelStatesModels:ni(e),cursorStyle:e.get("cursor")}}var wg=function(){function r(e){this.group=new qt,this._SymbolCtor=e||xg}return r.prototype.updateData=function(e,t){this._progressiveEls=null,t=mO(t);var n=this.group,i=e.hostModel,a=this._data,o=this._SymbolCtor,s=t.disableAnimation,l=yO(e),u={disableAnimation:s},d=t.getSymbolPoint||function(f){return e.getItemLayout(f)};a||n.removeAll(),e.diff(a).add(function(f){var g=d(f);if(iT(e,g,f,t)){var m=new o(e,f,l,u);m.setPosition(g),e.setItemGraphicEl(f,m),n.add(m)}}).update(function(f,g){var m=a.getItemGraphicEl(g),_=d(f);if(!iT(e,_,f,t)){n.remove(m);return}var x=e.getItemVisual(f,"symbol")||"circle",w=m&&m.getSymbolType&&m.getSymbolType();if(!m||w&&w!==x)n.remove(m),m=new o(e,f,l,u),m.setPosition(_);else{m.updateData(e,f,l,u);var C={x:_[0],y:_[1]};s?m.attr(C):Or(m,C,i)}n.add(m),e.setItemGraphicEl(f,m)}).remove(function(f){var g=a.getItemGraphicEl(f);g&&g.fadeOut(function(){n.remove(g)},i)}).execute(),this._getSymbolPoint=d,this._data=e},r.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(n,i){var a=e._getSymbolPoint(i);n.setPosition(a),n.markRedraw()})},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=yO(e),this._data=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[],n=mO(n);function i(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var a=e.start;a0?t=n[0]:n[1]<0&&(t=n[1]),t}function bO(r,e,t,n){var i=NaN;r.stacked&&(i=t.get(t.getCalculationInfo("stackedOverDimension"),n)),isNaN(i)&&(i=r.valueStart);var a=r.baseDataOffset,o=[];return o[a]=t.get(r.baseDim,n),o[1-a]=i,e.dataToPoint(o)}function MY(r,e){var t=[];return e.diff(r).add(function(n){t.push({cmd:"+",idx:n})}).update(function(n,i){t.push({cmd:"=",idx:i,idx1:n})}).remove(function(n){t.push({cmd:"-",idx:n})}).execute(),t}function IY(r,e,t,n,i,a,o,s){for(var l=MY(r,e),u=[],d=[],f=[],g=[],m=[],_=[],x=[],w=_O(i,e,o),C=r.getLayout("points")||[],A=e.getLayout("points")||[],L=0;L=i||x<0)break;if(Hc(C,A)){if(l){x+=a;continue}break}if(x===t)r[a>0?"moveTo":"lineTo"](C,A),f=C,g=A;else{var L=C-u,O=A-d;if(L*L+O*O<.5){x+=a;continue}if(o>0){for(var V=x+a,F=e[V*2],$=e[V*2+1];F===C&&$===A&&w=n||Hc(F,$))m=C,_=A;else{j=F-u,Y=$-d;var ue=C-u,fe=F-C,le=A-d,ge=$-A,xe=void 0,Me=void 0;if(s==="x"){xe=Math.abs(ue),Me=Math.abs(fe);var Ve=j>0?1:-1;m=C-Ve*xe*o,_=A,se=C+Ve*Me*o,ae=A}else if(s==="y"){xe=Math.abs(le),Me=Math.abs(ge);var Fe=Y>0?1:-1;m=C,_=A-Fe*xe*o,se=C,ae=A+Fe*Me*o}else xe=Math.sqrt(ue*ue+le*le),Me=Math.sqrt(fe*fe+ge*ge),Z=Me/(Me+xe),m=C-j*o*(1-Z),_=A-Y*o*(1-Z),se=C+j*o*Z,ae=A+Y*o*Z,se=Yl(se,Kl(F,C)),ae=Yl(ae,Kl($,A)),se=Kl(se,Yl(F,C)),ae=Kl(ae,Yl($,A)),j=se-C,Y=ae-A,m=C-j*xe/Me,_=A-Y*xe/Me,m=Yl(m,Kl(u,C)),_=Yl(_,Kl(d,A)),m=Kl(m,Yl(u,C)),_=Kl(_,Yl(d,A)),j=C-m,Y=A-_,se=C+j*Me/xe,ae=A+Y*Me/xe}r.bezierCurveTo(f,g,m,_,C,A),f=se,g=ae}else r.lineTo(C,A)}u=C,d=A,x+=a}return w}var xO=function(){function r(){this.smooth=0,this.smoothConstraint=!0}return r}(),kY=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new xO},e.prototype.buildPath=function(t,n){var i=n.points,a=0,o=i.length/2;if(n.connectNulls){for(;o>0&&Hc(i[o*2-2],i[o*2-1]);o--);for(;a=0){var O=u?(_-l)*L+l:(m-s)*L+s;return u?[t,O]:[O,t]}s=m,l=_;break;case o.C:m=a[f++],_=a[f++],x=a[f++],w=a[f++],C=a[f++],A=a[f++];var V=u?jm(s,m,x,C,t,d):jm(l,_,w,A,t,d);if(V>0)for(var F=0;F=0){var O=u?ti(l,_,w,A,$):ti(s,m,x,C,$);return u?[t,O]:[O,t]}}s=C,l=A;break}}},e}(vr),LY=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e}(xO),wO=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new LY},e.prototype.buildPath=function(t,n){var i=n.points,a=n.stackedOnPoints,o=0,s=i.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&Hc(i[s*2-2],i[s*2-1]);s--);for(;oe){a?t.push(o(a,l,e)):i&&t.push(o(i,l,0),o(i,l,e));break}else i&&(t.push(o(i,l,0)),i=null),t.push(l),a=l}return t}function NY(r,e,t){var n=r.getVisual("visualMeta");if(!(!n||!n.length||!r.count())){if(e.type!=="cartesian2d"){oT.NODE_ENV!=="production"&&console.warn("Visual map on line style is only supported on cartesian2d.");return}for(var i,a,o=n.length-1;o>=0;o--){var s=r.getDimensionInfo(n[o].dimension);if(i=s&&s.coordDim,i==="x"||i==="y"){a=n[o];break}}if(!a){oT.NODE_ENV!=="production"&&console.warn("Visual map on line style only support x or y dimension.");return}var l=e.getAxis(i),u=je(a.stops,function(L){return{coord:l.toGlobalCoord(l.dataToCoord(L.value)),color:L.color}}),d=u.length,f=a.outerColors.slice();d&&u[0].coord>u[d-1].coord&&(u.reverse(),f.reverse());var g=RY(u,i==="x"?t.getWidth():t.getHeight()),m=g.length;if(!m&&d)return u[0].coord<0?f[1]?f[1]:u[d-1].color:f[0]?f[0]:u[0].color;var _=10,x=g[0].coord-_,w=g[m-1].coord+_,C=w-x;if(C<.001)return"transparent";Q(g,function(L){L.offset=(L.coord-x)/C}),g.push({offset:m?g[m-1].offset:.5,color:f[1]||"transparent"}),g.unshift({offset:m?g[0].offset:.5,color:f[0]||"transparent"});var A=new Bp(0,0,0,0,g,!0);return A[i]=x,A[i+"2"]=w,A}}function OY(r,e,t){var n=r.get("showAllSymbol"),i=n==="auto";if(!(n&&!i)){var a=t.getAxesByScale("ordinal")[0];if(a&&!(i&&zY(a,e))){var o=e.mapDimension(a.dim),s={};return Q(a.getViewLabels(),function(l){var u=a.scale.getRawOrdinalNumber(l.tickValue);s[u]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function zY(r,e){var t=r.getExtent(),n=Math.abs(t[1]-t[0])/r.scale.count();isNaN(n)&&(n=0);for(var i=e.count(),a=Math.max(1,Math.round(i/5)),o=0;on)return!1;return!0}function BY(r,e){return isNaN(r)||isNaN(e)}function VY(r){for(var e=r.length/2;e>0&&BY(r[e*2-2],r[e*2-1]);e--);return e-1}function MO(r,e){return[r[e*2],r[e*2+1]]}function FY(r,e,t){for(var n=r.length/2,i=t==="x"?0:1,a,o,s=0,l=-1,u=0;u=e||a>=e&&o<=e){l=u;break}s=u,a=o}return{range:[s,l],t:(e-a)/(o-a)}}function IO(r){if(r.get(["endLabel","show"]))return!0;for(var e=0;e0&&t.get(["emphasis","lineStyle","width"])==="bolder"){var Me=_.getState("emphasis").style;Me.lineWidth=+_.style.lineWidth+1}jt(_).seriesIndex=t.seriesIndex,Sn(_,le,ge,xe);var Ve=DO(t.get("smooth")),Fe=t.get("smoothMonotone");if(_.setShape({smooth:Ve,smoothMonotone:Fe,connectNulls:$}),x){var Xe=s.getCalculationInfo("stackedOnSeries"),ot=0;x.useStyle(Bt(u.getAreaStyle(),{fill:se,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),Xe&&(ot=DO(Xe.get("smooth"))),x.setShape({smooth:Ve,stackedOnSmooth:ot,smoothMonotone:Fe,connectNulls:$}),Ei(x,t,"areaStyle"),jt(x).seriesIndex=t.seriesIndex,Sn(x,le,ge,xe)}var et=this._changePolyState;s.eachItemGraphicEl(function(it){it&&(it.onHoverStateChange=et)}),this._polyline.onHoverStateChange=et,this._data=s,this._coordSys=a,this._stackedOnPoints=V,this._points=d,this._step=j,this._valueOrigin=L,t.get("triggerLineEvent")&&(this.packEventData(t,_),x&&this.packEventData(t,x))},e.prototype.packEventData=function(t,n){jt(n).eventData={componentType:"series",componentSubType:"line",componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:"line"}},e.prototype.highlight=function(t,n,i,a){var o=t.getData(),s=ac(o,a);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),u=o.getItemGraphicEl(s);if(!u){var d=l[s*2],f=l[s*2+1];if(isNaN(d)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(d,f))return;var g=t.get("zlevel")||0,m=t.get("z")||0;u=new xg(o,s),u.x=d,u.y=f,u.setZ(g,m);var _=u.getSymbolPath().getTextContent();_&&(_.zlevel=g,_.z=m,_.z2=this._polyline.z2+1),u.__temp=!0,o.setItemGraphicEl(s,u),u.stopSymbolAnimation(!0),this.group.add(u)}u.highlight()}else Jr.prototype.highlight.call(this,t,n,i,a)},e.prototype.downplay=function(t,n,i,a){var o=t.getData(),s=ac(o,a);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else Jr.prototype.downplay.call(this,t,n,i,a)},e.prototype._changePolyState=function(t){var n=this._polygon;Cy(this._polyline,t),n&&Cy(n,t)},e.prototype._newPolyline=function(t){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new kY({shape:{points:t},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(t,n){var i=this._polygon;return i&&this._lineGroup.remove(i),i=new wO({shape:{points:t,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(i),this._polygon=i,i},e.prototype._initSymbolLabelAnimation=function(t,n,i){var a,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(a=s.isHorizontal(),o=!1):n.type==="polar"&&(a=s.dim==="angle",o=!0);var u=t.hostModel,d=u.get("animationDuration");It(d)&&(d=d(null));var f=u.get("animationDelay")||0,g=It(f)?f(null):f;t.eachItemGraphicEl(function(m,_){var x=m;if(x){var w=[m.x,m.y],C=void 0,A=void 0,L=void 0;if(i)if(o){var O=i,V=n.pointToCoord(w);a?(C=O.startAngle,A=O.endAngle,L=-V[1]/180*Math.PI):(C=O.r0,A=O.r,L=V[0])}else{var F=i;a?(C=F.x,A=F.x+F.width,L=m.x):(C=F.y+F.height,A=F.y,L=m.y)}var $=A===C?0:(L-C)/(A-C);l&&($=1-$);var H=It(f)?f(_):d*$+g,Z=x.getSymbolPath(),j=Z.getTextContent();x.attr({scaleX:0,scaleY:0}),x.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:H}),j&&j.animateFrom({style:{opacity:0}},{duration:300,delay:H}),Z.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(t,n,i){var a=t.getModel("endLabel");if(IO(t)){var o=t.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var u=this._endLabel;u||(u=this._endLabel=new Dr({z2:200}),u.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var d=VY(l);d>=0&&(Ci(s,ni(t,"endLabel"),{inheritColor:i,labelFetcher:t,labelDataIndex:d,defaultText:function(f,g,m){return m!=null?vO(o,m):Od(o,f)},enableTextSetter:!0},$Y(a,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(t,n,i,a,o,s,l){var u=this._endLabel,d=this._polyline;if(u){t<1&&a.originalX==null&&(a.originalX=u.x,a.originalY=u.y);var f=i.getLayout("points"),g=i.hostModel,m=g.get("connectNulls"),_=s.get("precision"),x=s.get("distance")||0,w=l.getBaseAxis(),C=w.isHorizontal(),A=w.inverse,L=n.shape,O=A?C?L.x:L.y+L.height:C?L.x+L.width:L.y,V=(C?x:0)*(A?-1:1),F=(C?0:-x)*(A?-1:1),$=C?"x":"y",H=FY(f,O,$),Z=H.range,j=Z[1]-Z[0],Y=void 0;if(j>=1){if(j>1&&!m){var se=MO(f,Z[0]);u.attr({x:se[0]+V,y:se[1]+F}),o&&(Y=g.getRawValue(Z[0]))}else{var se=d.getPointOn(O,$);se&&u.attr({x:se[0]+V,y:se[1]+F});var ae=g.getRawValue(Z[0]),ue=g.getRawValue(Z[1]);o&&(Y=OI(i,_,ae,ue,H.t))}a.lastFrameIndex=Z[0]}else{var fe=t===1||a.lastFrameIndex>0?Z[0]:0,se=MO(f,fe);o&&(Y=g.getRawValue(fe)),u.attr({x:se[0]+V,y:se[1]+F})}if(o){var le=cd(u);typeof le.setLabelText=="function"&&le.setLabelText(Y)}}},e.prototype._doUpdateAnimation=function(t,n,i,a,o,s,l){var u=this._polyline,d=this._polygon,f=t.hostModel,g=IY(this._data,t,this._stackedOnPoints,n,this._coordSys,i,this._valueOrigin),m=g.current,_=g.stackedOnCurrent,x=g.next,w=g.stackedOnNext;if(o&&(_=Jl(g.stackedOnCurrent,g.current,i,o,l),m=Jl(g.current,null,i,o,l),w=Jl(g.stackedOnNext,g.next,i,o,l),x=Jl(g.next,null,i,o,l)),AO(m,x)>3e3||d&&AO(_,w)>3e3){u.stopAnimation(),u.setShape({points:x}),d&&(d.stopAnimation(),d.setShape({points:x,stackedOnPoints:w}));return}u.shape.__points=g.current,u.shape.points=m;var C={shape:{points:x}};g.current!==m&&(C.shape.__points=g.next),u.stopAnimation(),Or(u,C,f),d&&(d.setShape({points:m,stackedOnPoints:_}),d.stopAnimation(),Or(d,{shape:{stackedOnPoints:w}},f),u.shape.points!==d.shape.points&&(d.shape.points=u.shape.points));for(var A=[],L=g.status,O=0;Oe&&(e=r[t]);return isFinite(e)?e:NaN},min:function(r){for(var e=1/0,t=0;t10&&o.type==="cartesian2d"&&a){var l=o.getBaseAxis(),u=o.getOtherAxis(l),d=l.getExtent(),f=n.getDevicePixelRatio(),g=Math.abs(d[1]-d[0])*(f||1),m=Math.round(s/g);if(isFinite(m)&&m>1){a==="lttb"?e.setData(i.lttbDownSample(i.mapDimension(u.dim),1/m)):a==="minmax"&&e.setData(i.minmaxDownSample(i.mapDimension(u.dim),1/m));var _=void 0;ut(a)?_=UY[a]:It(a)&&(_=a),_&&e.setData(i.downSample(i.mapDimension(u.dim),1/m,_,HY))}}}}}function WY(r){r.registerChartView(GY),r.registerSeriesModel(CY),r.registerLayout(Tg("line",!0)),r.registerVisual({seriesType:"line",reset:function(e){var t=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual("style").fill),t.setVisual("legendLineStyle",n)}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,kO("line"))}var Eg=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Ks(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(t,n,i){var a=this.coordinateSystem;if(a&&a.clampData){var o=a.clampData(t),s=a.dataToPoint(o);if(i)Q(a.getAxes(),function(g,m){if(g.type==="category"&&n!=null){var _=g.getTicksCoords(),x=g.getTickModel().get("alignWithLabel"),w=o[m],C=n[m]==="x1"||n[m]==="y1";if(C&&!x&&(w+=1),_.length<2)return;if(_.length===2){s[m]=g.toGlobalCoord(g.getExtent()[C?1:0]);return}for(var A=void 0,L=void 0,O=1,V=0;V<_.length;V++){var F=_[V].coord,$=V===_.length-1?_[V-1].tickValue+O:_[V].tickValue;if($===w){L=F;break}else if($w){L=(F+A)/2;break}V===1&&(O=$-_[0].tickValue)}L==null&&(A?A&&(L=_[_.length-1].coord):L=_[0].coord),s[m]=g.toGlobalCoord(L)}});else{var l=this.getData(),u=l.getLayout("offset"),d=l.getLayout("size"),f=a.getBaseAxis().isHorizontal()?0:1;s[f]+=u+d/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e}(on);on.registerClass(Eg);var qY=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(){return Ks(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var t=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>t&&(t=n),t},e.prototype.brushSelector=function(t,n,i){return i.rect(n.getItemLayout(t))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Fl(Eg.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e}(Eg),ZY=function(){function r(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return r}(),H_=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new ZY},e.prototype.buildPath=function(t,n){var i=n.cx,a=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,u=o+l,d=n.startAngle,f=n.endAngle,g=n.clockwise,m=Math.PI*2,_=g?f-dMath.PI/2&&ds)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(t,n){for(var i=n.scale,a=i.getExtent(),o=Math.max(0,a[0]),s=Math.min(a[1],i.getOrdinalMeta().categories.length-1);o<=s;++o)if(t.ordinalNumbers[o]!==i.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(t,n,i,a){if(this._isOrderChangedWithinSameData(t,n,i)){var o=this._dataSort(t,i,n);this._isOrderDifferentInView(o,i)&&(this._removeOnRenderedListener(a),a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",axisId:i.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(t,n,i){var a=n.baseAxis,o=this._dataSort(t,a,function(s){return t.get(t.mapDimension(n.otherAxis.dim),s)});i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",isInitSort:!0,axisId:a.index,sortInfo:o})},e.prototype.remove=function(t,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(t,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(t){this._onRendered&&(t.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(t){var n=this.group,i=this._data;t&&t.isAnimationEnabled()&&i&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],i.eachItemGraphicEl(function(a){Vp(a,t,jt(a).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e}(Jr),PO={cartesian2d:function(r,e){var t=e.width<0?-1:1,n=e.height<0?-1:1;t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var i=r.x+r.width,a=r.y+r.height,o=lT(e.x,r.x),s=uT(e.x+e.width,i),l=lT(e.y,r.y),u=uT(e.y+e.height,a),d=si?s:o,e.y=f&&l>a?u:l,e.width=d?0:s-o,e.height=f?0:u-l,t<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),d||f},polar:function(r,e){var t=e.r0<=e.r?1:-1;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}var i=uT(e.r,r.r),a=lT(e.r0,r.r0);e.r=i,e.r0=a;var o=i-a<0;if(t<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},RO={cartesian2d:function(r,e,t,n,i,a,o,s,l){var u=new Ar({shape:Ge({},n),z2:1});if(u.__dataIndex=t,u.name="item",a){var d=u.shape,f=i?"height":"width";d[f]=0}return u},polar:function(r,e,t,n,i,a,o,s,l){var u=!i&&l?H_:ea,d=new u({shape:n,z2:1});d.name="item";var f=BO(i);if(d.calculateTextPosition=jY(f,{isRoundCap:u===H_}),a){var g=d.shape,m=i?"r":"endAngle",_={};g[m]=i?n.r0:n.startAngle,_[m]=n[m],(s?Or:yn)(d,{shape:_},a)}return d}};function JY(r,e){var t=r.get("realtimeSort",!0),n=e.getBaseAxis();if(LO.NODE_ENV!=="production"&&t&&(n.type!=="category"&&wn("`realtimeSort` will not work because this bar series is not based on a category axis."),e.type!=="cartesian2d"&&wn("`realtimeSort` will not work because this bar series is not on cartesian2d.")),t&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function NO(r,e,t,n,i,a,o,s){var l,u;a?(u={x:n.x,width:n.width},l={y:n.y,height:n.height}):(u={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?Or:yn)(t,{shape:l},e,i,null);var d=e?r.baseAxis.model:null;(o?Or:yn)(t,{shape:u},d,i)}function OO(r,e){for(var t=0;t0?1:-1,o=n.height>0?1:-1;return{x:n.x+a*i/2,y:n.y+o*i/2,width:n.width-a*i,height:n.height-o*i}},polar:function(r,e,t){var n=r.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function tK(r){return r.startAngle!=null&&r.endAngle!=null&&r.startAngle===r.endAngle}function BO(r){return function(e){var t=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+t;default:return n}}}(r)}function VO(r,e,t,n,i,a,o,s){var l=e.getItemVisual(t,"style");if(s){if(!a.get("roundCap")){var d=r.shape,f=qc(n.getModel("itemStyle"),d,!0);Ge(d,f),r.setShape(d)}}else{var u=n.get(["itemStyle","borderRadius"])||0;r.setShape("r",u)}r.useStyle(l);var g=n.getShallow("cursor");g&&r.attr("cursor",g);var m=s?o?i.r>=i.r0?"endArc":"startArc":i.endAngle>=i.startAngle?"endAngle":"startAngle":o?i.height>=0?"bottom":"top":i.width>=0?"right":"left",_=ni(n);Ci(r,_,{labelFetcher:a,labelDataIndex:t,defaultText:Od(a.getData(),t),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:m});var x=r.getTextContent();if(s&&x){var w=n.get(["label","position"]);r.textConfig.inside=w==="middle"?!0:null,XY(r,w==="outside"?m:w,BO(o),n.get(["label","rotate"]))}rL(x,_,a.getRawValue(t),function(A){return vO(e,A)});var C=n.getModel(["emphasis"]);Sn(r,C.get("focus"),C.get("blurScope"),C.get("disabled")),Ei(r,n),tK(i)&&(r.style.fill="none",r.style.stroke="none",Q(r.states,function(A){A.style&&(A.style.fill=A.style.stroke="none")}))}function rK(r,e){var t=r.get(["itemStyle","borderColor"]);if(!t||t==="none")return 0;var n=r.get(["itemStyle","borderWidth"])||0,i=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),a=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,i,a)}var nK=function(){function r(){}return r}(),FO=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new nK},e.prototype.buildPath=function(t,n){for(var i=n.points,a=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],u=this.barWidth,d=0;d=0?t:null},30,!1);function iK(r,e,t){for(var n=r.baseDimIdx,i=1-n,a=r.shape.points,o=r.largeDataIndices,s=[],l=[],u=r.barWidth,d=0,f=a.length/3;d=s[0]&&e<=s[0]+l[0]&&t>=s[1]&&t<=s[1]+l[1])return o[d]}return-1}function UO(r,e,t){if(Wc(t,"cartesian2d")){var n=e,i=t.getArea();return{x:r?n.x:i.x,y:r?i.y:n.y,width:r?n.width:i.width,height:r?i.height:n.height}}else{var i=t.getArea(),a=e;return{cx:i.cx,cy:i.cy,r0:r?i.r0:a.r0,r:r?i.r:a.r,startAngle:r?a.startAngle:0,endAngle:r?a.endAngle:Math.PI*2}}}function aK(r,e,t){var n=r.type==="polar"?ea:Ar;return new n({shape:UO(e,t,r),silent:!0,z2:0})}function oK(r){r.registerChartView(KY),r.registerSeriesModel(qY),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,er(iN,"bar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,aN("bar")),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,kO("bar")),r.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,t){var n=e.componentType||"series";t.eachComponent({mainType:n,query:e},function(i){e.sortInfo&&i.axis.setCategorySortInfo(e.sortInfo)})})}var HO=Math.PI*2,j_=Math.PI/180;function WO(r,e){return Xn(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function qO(r,e){var t=WO(r,e),n=r.get("center"),i=r.get("radius");Ze(i)||(i=[0,i]);var a=nt(t.width,e.getWidth()),o=nt(t.height,e.getHeight()),s=Math.min(a,o),l=nt(i[0],s/2),u=nt(i[1],s/2),d,f,g=r.coordinateSystem;if(g){var m=g.dataToPoint(n);d=m[0]||0,f=m[1]||0}else Ze(n)||(n=[n,n]),d=nt(n[0],a)+t.x,f=nt(n[1],o)+t.y;return{cx:d,cy:f,r0:l,r:u}}function sK(r,e,t){e.eachSeriesByType(r,function(n){var i=n.getData(),a=i.mapDimension("value"),o=WO(n,t),s=qO(n,t),l=s.cx,u=s.cy,d=s.r,f=s.r0,g=-n.get("startAngle")*j_,m=n.get("endAngle"),_=n.get("padAngle")*j_;m=m==="auto"?g-HO:-m*j_;var x=n.get("minAngle")*j_,w=x+_,C=0;i.each(a,function(ge){!isNaN(ge)&&C++});var A=i.getSum(a),L=Math.PI/(A||C)*2,O=n.get("clockwise"),V=n.get("roseType"),F=n.get("stillShowZeroSum"),$=i.getDataExtent(a);$[0]=0;var H=O?1:-1,Z=[g,m],j=H*_/2;qw(Z,!O),g=Z[0],m=Z[1];var Y=ZO(n);Y.startAngle=g,Y.endAngle=m,Y.clockwise=O;var se=Math.abs(m-g),ae=se,ue=0,fe=g;if(i.setLayout({viewRect:o,r:d}),i.each(a,function(ge,xe){var Me;if(isNaN(ge)){i.setItemLayout(xe,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:O,cx:l,cy:u,r0:f,r:V?NaN:d});return}V!=="area"?Me=A===0&&F?L:ge*L:Me=se/C,MeMe?(Fe=fe+H*Me/2,Xe=Fe):(Fe=fe+j,Xe=Ve-j),i.setItemLayout(xe,{angle:Me,startAngle:Fe,endAngle:Xe,clockwise:O,cx:l,cy:u,r0:f,r:V?Wr(ge,$,[f,d]):d}),fe=Ve}),aet?C:w,V=Math.abs(L.label.y-t);if(V>=O.maxY){var F=L.label.x-e-L.len2*i,$=n+L.len,H=Math.abs(F)<$?Math.sqrt(V*V/(1-F*F/$/$)):$;O.rB=H,O.maxY=V}O.list.push(L)}d(w),d(C)}for(var g=r.length,m=0;mr.unconstrainedWidth?null:m:null;n.setStyle("width",_)}var x=n.getBoundingRect();a.width=x.width;var w=(n.style.margin||0)+2.1;a.height=x.height+w,a.y-=(a.height-f)/2}}}function cT(r){return r.position==="center"}function cK(r){var e=r.getData(),t=[],n,i,a=!1,o=(r.get("minShowLabelAngle")||0)*lK,s=e.getLayout("viewRect"),l=e.getLayout("r"),u=s.width,d=s.x,f=s.y,g=s.height;function m(F){F.ignore=!0}function _(F){if(!F.ignore)return!0;for(var $ in F.states)if(F.states[$].ignore===!1)return!0;return!1}e.each(function(F){var $=e.getItemGraphicEl(F),H=$.shape,Z=$.getTextContent(),j=$.getTextGuideLine(),Y=e.getItemModel(F),se=Y.getModel("label"),ae=se.get("position")||Y.get(["emphasis","label","position"]),ue=se.get("distanceToLabelLine"),fe=se.get("alignTo"),le=nt(se.get("edgeDistance"),u),ge=se.get("bleedMargin"),xe=Y.getModel("labelLine"),Me=xe.get("length");Me=nt(Me,u);var Ve=xe.get("length2");if(Ve=nt(Ve,u),Math.abs(H.endAngle-H.startAngle)0?"right":"left":Xe>0?"left":"right"}var Kt=Math.PI,Le=0,Mr=se.get("rotate");if(Lr(Mr))Le=Mr*(Kt/180);else if(ae==="center")Le=0;else if(Mr==="radial"||Mr===!0){var Lt=Xe<0?-Fe+Kt:-Fe;Le=Lt}else if(Mr==="tangential"&&ae!=="outside"&&ae!=="outer"){var Xt=Math.atan2(Xe,ot);Xt<0&&(Xt=Kt*2+Xt);var nr=ot>0;nr&&(Xt=Kt+Xt),Le=Xt-Kt}if(a=!!Le,Z.x=et,Z.y=it,Z.rotation=Le,Z.setStyle({verticalAlign:"middle"}),lt){Z.setStyle({align:Ht});var Tn=Z.states.select;Tn&&(Tn.x+=Z.x,Tn.y+=Z.y)}else{var lr=Z.getBoundingRect().clone();lr.applyTransform(Z.getComputedTransform());var Yn=(Z.style.margin||0)+2.1;lr.y-=Yn/2,lr.height+=Yn,t.push({label:Z,labelLine:j,position:ae,len:Me,len2:Ve,minTurnAngle:xe.get("minTurnAngle"),maxSurfaceAngle:xe.get("maxSurfaceAngle"),surfaceNormal:new ir(Xe,ot),linePoints:kt,textAlign:Ht,labelDistance:ue,labelAlignTo:fe,edgeDistance:le,bleedMargin:ge,rect:lr,unconstrainedWidth:lr.width,labelStyleWidth:Z.style.width})}$.setTextConfig({inside:lt})}}),!a&&r.get("avoidLabelOverlap")&&uK(t,n,i,l,u,g,d,f);for(var x=0;x0){for(var d=o.getItemLayout(0),f=1;isNaN(d&&d.startAngle)&&f=a.r0}},e.type="pie",e}(Jr);function zd(r,e,t){e=Ze(e)&&{coordDimensions:e}||Ge({encodeDefine:r.getEncode()},e);var n=r.getSource(),i=fg(n,e).dimensions,a=new na(i,r);return a.initData(n,t),a}var Ag=function(){function r(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return r.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},r.prototype.containName=function(e){var t=this._getRawData();return t.indexOfName(e)>=0},r.prototype.indexOfName=function(e){var t=this._getDataWithEncodedVisual();return t.indexOfName(e)},r.prototype.getItemVisual=function(e,t){var n=this._getDataWithEncodedVisual();return n.getItemVisual(e,t)},r}(),fK=Cr(),pK=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ag(pt(this.getData,this),pt(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.mergeOption=function(){r.prototype.mergeOption.apply(this,arguments)},e.prototype.getInitialData=function(){return zd(this,{coordDimensions:["value"],encodeDefaulter:er(I1,this)})},e.prototype.getDataParams=function(t){var n=this.getData(),i=fK(n),a=i.seats;if(!a){var o=[];n.each(n.mapDimension("value"),function(l){o.push(l)}),a=i.seats=FH(o,n.hostModel.get("percentPrecision"))}var s=r.prototype.getDataParams.call(this,t);return s.percent=a[t]||0,s.$vars.push("percent"),s},e.prototype._defaultLabelLine=function(t){ic(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.type="series.pie",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,endAngle:"auto",padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:"truncate",position:"outer",alignTo:"none",edgeDistance:"25%",bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:"solid"}},itemStyle:{borderWidth:1,borderJoin:"round"},showEmptyCircle:!0,emptyCircleStyle:{color:"lightgray",opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:"expansion",animationDuration:1e3,animationTypeUpdate:"transition",animationEasingUpdate:"cubicInOut",animationDurationUpdate:500,animationEasing:"cubicInOut"},e}(on);function gK(r){return{seriesType:r,reset:function(e,t){var n=e.getData();n.filterSelf(function(i){var a=n.mapDimension("value"),o=n.get(a,i);return!(Lr(o)&&!isNaN(o)&&o<0)})}}}function vK(r){r.registerChartView(dK),r.registerSeriesModel(pK),KP("pie",r.registerAction),r.registerLayout(er(sK,"pie")),r.registerProcessor(Cg("pie")),r.registerProcessor(gK("pie"))}var mK=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.getInitialData=function(t,n){return Ks(null,this,{useEncodeDefaulter:!0})},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?5e3:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?1e4:this.get("progressiveThreshold"))},e.prototype.brushSelector=function(t,n,i){return i.point(n.getItemLayout(t))},e.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:""},e.type="series.scatter",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:"#212121"}},universalTransition:{divideShape:"clone"}},e}(on),YO=4,yK=function(){function r(){}return r}(),_K=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.getDefaultShape=function(){return new yK},e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.buildPath=function(t,n){var i=n.points,a=n.size,o=this.symbolProxy,s=o.shape,l=t.getContext?t.getContext():t,u=l&&a[0]=0;u--){var d=u*2,f=a[d]-s/2,g=a[d+1]-l/2;if(t>=f&&n>=g&&t<=f+s&&n<=g+l)return u}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.points,a=n.size,o=a[0],s=a[1],l=1/0,u=1/0,d=-1/0,f=-1/0,g=0;g=0&&(u.dataIndex=f+(e.startIndex||0))})},r.prototype.remove=function(){this._clear()},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),xK=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.updateData(a,{clipShape:this._getClipShape(t)}),this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateSymbolDraw(a,t);o.incrementalPrepareUpdate(a),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._symbolDraw.incrementalUpdate(t,n.getData(),{clipShape:this._getClipShape(n)}),this._finished=t.end===n.getData().count()},e.prototype.updateTransform=function(t,n,i){var a=t.getData();if(this.group.dirty(),!this._finished||a.count()>1e4)return{update:!0};var o=Tg("").reset(t,n,i);o.progress&&o.progress({start:0,end:a.count(),count:a.count()},a),this._symbolDraw.updateLayout(a)},e.prototype.eachRendered=function(t){this._symbolDraw&&this._symbolDraw.eachRendered(t)},e.prototype._getClipShape=function(t){if(t.get("clip",!0)){var n=t.coordinateSystem;return n&&n.getArea&&n.getArea(.1)}},e.prototype._updateSymbolDraw=function(t,n){var i=this._symbolDraw,a=n.pipelineContext,o=a.large;return(!i||o!==this._isLargeDraw)&&(i&&i.remove(),i=this._symbolDraw=o?new bK:new wg,this._isLargeDraw=o,this.group.removeAll()),this.group.add(i.group),i},e.prototype.remove=function(t,n){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},e.prototype.dispose=function(){},e.type="scatter",e}(Jr),wK=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e}(mr),hT=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Hn).models[0]},e.type="cartesian2dAxis",e}(mr);$n(hT,gg);var KO={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},SK=rr({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},KO),dT=rr({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},KO),TK=rr({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},dT),EK=Bt({logBase:10},dT);const JO={category:SK,value:dT,time:TK,log:EK};var CK={value:1,category:1,time:1,log:1};function Bd(r,e,t,n){Q(CK,function(i,a){var o=rr(rr({},JO[a],!0),n,!0),s=function(l){ze(u,l);function u(){var d=l!==null&&l.apply(this,arguments)||this;return d.type=e+"Axis."+a,d}return u.prototype.mergeDefaultAndTheme=function(d,f){var g=qp(this),m=g?vd(d):{},_=f.getTheme();rr(d,_.get(a+"Axis")),rr(d,this.getDefaultOption()),d.type=QO(d),g&&Gl(d,m,g)},u.prototype.optionUpdated=function(){var d=this.option;d.type==="category"&&(this.__ordinalMeta=DS.createByAxisModel(this))},u.prototype.getCategories=function(d){var f=this.option;if(f.type==="category")return d?f.data:this.__ordinalMeta.categories},u.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},u.type=e+"Axis."+a,u.defaultOption=o,u}(t);r.registerComponentModel(s)}),r.registerSubTypeDefaulter(e+"Axis",QO)}function QO(r){return r.type||(r.data?"category":"value")}var AK=function(){function r(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return r.prototype.getAxis=function(e){return this._axes[e]},r.prototype.getAxes=function(){return je(this._dimList,function(e){return this._axes[e]},this)},r.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),$r(this.getAxes(),function(t){return t.scale.type===e})},r.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},r}(),fT=["x","y"];function ez(r){return r.type==="interval"||r.type==="time"}var DK=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="cartesian2d",t.dimensions=fT,t}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var t=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!ez(t)||!ez(n))){var i=t.getExtent(),a=n.getExtent(),o=this.dataToPoint([i[0],a[0]]),s=this.dataToPoint([i[1],a[1]]),l=i[1]-i[0],u=a[1]-a[0];if(!(!l||!u)){var d=(s[0]-o[0])/l,f=(s[1]-o[1])/u,g=o[0]-i[0]*d,m=o[1]-a[0]*f,_=this._transform=[d,0,0,f,g,m];this._invTransform=Hh([],_)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(t){var n=this.getAxis("x"),i=this.getAxis("y");return n.contain(n.toLocalCoord(t[0]))&&i.contain(i.toLocalCoord(t[1]))},e.prototype.containData=function(t){return this.getAxis("x").containData(t[0])&&this.getAxis("y").containData(t[1])},e.prototype.containZone=function(t,n){var i=this.dataToPoint(t),a=this.dataToPoint(n),o=this.getArea(),s=new sr(i[0],i[1],a[0]-i[0],a[1]-i[1]);return o.intersect(s)},e.prototype.dataToPoint=function(t,n,i){i=i||[];var a=t[0],o=t[1];if(this._transform&&a!=null&&isFinite(a)&&o!=null&&isFinite(o))return Si(i,t,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return i[0]=s.toGlobalCoord(s.dataToCoord(a,n)),i[1]=l.toGlobalCoord(l.dataToCoord(o,n)),i},e.prototype.clampData=function(t,n){var i=this.getAxis("x").scale,a=this.getAxis("y").scale,o=i.getExtent(),s=a.getExtent(),l=i.parse(t[0]),u=a.parse(t[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),u),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(t,n){var i=[];if(this._invTransform)return Si(i,t,this._invTransform);var a=this.getAxis("x"),o=this.getAxis("y");return i[0]=a.coordToData(a.toLocalCoord(t[0]),n),i[1]=o.coordToData(o.toLocalCoord(t[1]),n),i},e.prototype.getOtherAxis=function(t){return this.getAxis(t.dim==="x"?"y":"x")},e.prototype.getArea=function(t){t=t||0;var n=this.getAxis("x").getGlobalExtent(),i=this.getAxis("y").getGlobalExtent(),a=Math.min(n[0],n[1])-t,o=Math.min(i[0],i[1])-t,s=Math.max(n[0],n[1])-a+t,l=Math.max(i[0],i[1])-o+t;return new sr(a,o,s,l)},e}(AK),MK=function(r){ze(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.index=0,s.type=a||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var t=this.position;return t==="top"||t==="bottom"},e.prototype.getGlobalExtent=function(t){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),t&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(t,n){return this.coordToData(this.toLocalCoord(t[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(t){if(this.type!=="category")return!1;this.model.option.categorySortInfo=t,this.scale.setSortInfo(t)},e}(jo),IK={};function pT(r,e,t){t=t||{};var n=r.coordinateSystem,i=e.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,l=o?"onZero":s,u=i.dim,d=n.getRect(),f=[d.x,d.x+d.width,d.y,d.y+d.height],g={left:0,right:1,top:0,bottom:1,onZero:2},m=e.get("offset")||0,_=u==="x"?[f[2]-m,f[3]+m]:[f[0]-m,f[1]+m];if(o){var x=o.toGlobalCoord(o.dataToCoord(0));_[g.onZero]=Math.max(Math.min(x,_[1]),_[0])}a.position=[u==="y"?_[g[l]]:f[0],u==="x"?_[g[l]]:f[3]],a.rotation=Math.PI/2*(u==="x"?0:1);var w={top:-1,bottom:1,left:-1,right:1};a.labelDirection=a.tickDirection=a.nameDirection=w[s],a.labelOffset=o?_[g[s]]-_[g.onZero]:0,e.get(["axisTick","inside"])&&(a.tickDirection=-a.tickDirection),Gn(t.labelInside,e.get(["axisLabel","inside"]))&&(a.labelDirection=-a.labelDirection);var C=e.get(["axisLabel","rotate"]);return a.labelRotate=l==="top"?-C:C,a.z2=1,a}function tz(r){return r.get("coordinateSystem")==="cartesian2d"}function rz(r){var e={xAxisModel:null,yAxisModel:null};return Q(e,function(t,n){var i=n.replace(/Model$/,""),a=r.getReferringComponents(i,Hn).models[0];if(IK.NODE_ENV!=="production"&&!a)throw new Error(i+' "'+no(r.get(i+"Index"),r.get(i+"Id"),0)+'" not found');e[n]=a}),e}var kK={},gT=Math.log;function nz(r,e,t){var n=Js.prototype,i=n.getTicks.call(t),a=n.getTicks.call(t,!0),o=i.length-1,s=n.getInterval.call(t),l=dN(r,e),u=l.extent,d=l.fixMin,f=l.fixMax;if(r.type==="log"){var g=gT(r.base);u=[gT(u[0])/g,gT(u[1])/g]}r.setExtent(u[0],u[1]),r.calcNiceExtent({splitNumber:o,fixMin:d,fixMax:f});var m=n.getExtent.call(r);d&&(u[0]=m[0]),f&&(u[1]=m[1]);var _=n.getInterval.call(r),x=u[0],w=u[1];if(d&&f)_=(w-x)/o;else if(d)for(w=u[0]+_*o;wu[0]&&isFinite(x)&&isFinite(u[0]);)_=IS(_),x=u[1]-_*o;else{var C=r.getTicks().length-1;C>o&&(_=IS(_));var A=_*o;w=Math.ceil(u[1]/_)*_,x=Ln(w-A),x<0&&u[0]>=0?(x=0,w=Ln(A)):w>0&&u[1]<=0&&(w=0,x=-Ln(A))}var L=(i[0].value-a[0].value)/s,O=(i[o].value-a[o].value)/s;if(n.setExtent.call(r,x+_*L,w+_*O),n.setInterval.call(r,_),(L||O)&&n.setNiceExtent.call(r,x+_,w-_),kK.NODE_ENV!=="production"){var V=n.getTicks.call(r);V[1]&&(!Nj(_)||ww(V[1].value)>ww(_))&&wn("The ticks may be not readable when set min: "+e.get("min")+", max: "+e.get("max")+" and alignTicks: true")}}var LK={},PK=function(){function r(e,t,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=fT,this._initCartesian(e,t,n),this.model=e}return r.prototype.getRect=function(){return this._rect},r.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model);function i(o){var s,l=br(o),u=l.length;if(u){for(var d=[],f=u-1;f>=0;f--){var g=+l[f],m=o[g],_=m.model,x=m.scale;MS(x)&&_.get("alignTicks")&&_.get("interval")==null?d.push(m):(Pd(x,_),MS(x)&&(s=m))}d.length&&(s||(s=d.pop(),Pd(s.scale,s.model)),Q(d,function(w){nz(w.scale,w.model,s.scale)}))}}i(n.x),i(n.y);var a={};Q(n.x,function(o){iz(n,"y",o,a)}),Q(n.y,function(o){iz(n,"x",o,a)}),this.resize(this.model,t)},r.prototype.resize=function(e,t,n){var i=e.getBoxLayoutParams(),a=!n&&e.get("containLabel"),o=Xn(i,{width:t.getWidth(),height:t.getHeight()});this._rect=o;var s=this._axesList;l(),a&&(Q(s,function(u){if(!u.model.get(["axisLabel","inside"])){var d=oX(u);if(d){var f=u.isHorizontal()?"height":"width",g=u.model.get(["axisLabel","margin"]);o[f]-=d[f]+g,u.position==="top"?o.y+=d.height+g:u.position==="left"&&(o.x+=d.width+g)}}}),l()),Q(this._coordsList,function(u){u.calcAffineTransform()});function l(){Q(s,function(u){var d=u.isHorizontal(),f=d?[0,o.width]:[0,o.height],g=u.inverse?1:0;u.setExtent(f[g],f[1-g]),RK(u,d?o.x:o.y)})}},r.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},r.prototype.getAxes=function(){return this._axesList.slice()},r.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n="x"+e+"y"+t;return this._coordsMap[n]}Nt(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var i=0,a=this._coordsList;i0?"top":"bottom",a="center"):Sp(i-Ql)?(o=n>0?"bottom":"top",a="center"):(o="middle",i>0&&i0?"right":"left":a=n>0?"left":"right"),{rotation:i,textAlign:a,textVerticalAlign:o}},r.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+"Index"]=e.componentIndex,t},r.isLabelSilent=function(e){var t=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||t&&t.show)},r}(),oz={axisLine:function(r,e,t,n){var i=e.get(["axisLine","show"]);if(i==="auto"&&r.handleAutoShown&&(i=r.handleAutoShown("axisLine")),!!i){var a=e.axis.getExtent(),o=n.transform,s=[a[0],0],l=[a[1],0],u=s[0]>l[0];o&&(Si(s,s,o),Si(l,l,o));var d=Ge({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new ri({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:d,strokeContainThreshold:r.strokeContainThreshold||5,silent:!0,z2:1});ud(f.shape,f.style.lineWidth),f.anid="line",t.add(f);var g=e.get(["axisLine","symbol"]);if(g!=null){var m=e.get(["axisLine","symbolSize"]);ut(g)&&(g=[g,g]),(ut(m)||Lr(m))&&(m=[m,m]);var _=Pc(e.get(["axisLine","symbolOffset"])||0,m),x=m[0],w=m[1];Q([{rotate:r.rotation+Math.PI/2,offset:_[0],r:0},{rotate:r.rotation-Math.PI/2,offset:_[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(C,A){if(g[A]!=="none"&&g[A]!=null){var L=qn(g[A],-x/2,-w/2,x,w,d.stroke,!0),O=C.r+C.offset,V=u?l:s;L.attr({rotation:C.rotate,x:V[0]+O*Math.cos(r.rotation),y:V[1]-O*Math.sin(r.rotation),silent:!0,z2:11}),t.add(L)}})}}},axisTickLabel:function(r,e,t,n){var i=zK(t,n,e,r),a=VK(t,n,e,r);if(OK(e,a,i),BK(t,n,e,r.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=PN(je(a,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));ON(o)}},axisName:function(r,e,t,n){var i=Gn(r.axisName,e.get("name"));if(i){var a=e.get("nameLocation"),o=r.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,u=e.axis.getExtent(),d=u[0]>u[1]?-1:1,f=[a==="start"?u[0]-d*l:a==="end"?u[1]+d*l:(u[0]+u[1])/2,lz(a)?r.labelOffset+o*l:0],g,m=e.get("nameRotate");m!=null&&(m=m*Ql/180);var _;lz(a)?g=oa.innerTextLayout(r.rotation,m??r.rotation,o):(g=NK(r.rotation,a,m||0,u),_=r.axisNameAvailableWidth,_!=null&&(_=Math.abs(_/Math.sin(g.rotation)),!isFinite(_)&&(_=null)));var x=s.getFont(),w=e.get("nameTruncate",!0)||{},C=w.ellipsis,A=Gn(r.nameTruncateMaxWidth,w.maxWidth,_),L=new Dr({x:f[0],y:f[1],rotation:g.rotation,silent:oa.isLabelSilent(e),style:an(s,{text:i,font:x,overflow:"truncate",width:A,ellipsis:C,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||g.textAlign,verticalAlign:s.get("verticalAlign")||g.textVerticalAlign}),z2:1});if(Tc({el:L,componentModel:e,itemName:i}),L.__fullText=i,L.anid="name",e.get("triggerEvent")){var O=oa.makeAxisEventDataBase(e);O.targetType="axisName",O.name=i,jt(L).eventData=O}n.add(L),L.updateTransform(),t.add(L),L.decomposeTransform()}}};function NK(r,e,t,n){var i=bI(t-r),a,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return Sp(i-Ql/2)?(o=l?"bottom":"top",a="center"):Sp(i-Ql*1.5)?(o=l?"top":"bottom",a="center"):(o="middle",iQl/2?a=l?"left":"right":a=l?"right":"left"),{rotation:i,textAlign:a,textVerticalAlign:o}}function OK(r,e,t){if(!fN(r.axis)){var n=r.get(["axisLabel","showMinLabel"]),i=r.get(["axisLabel","showMaxLabel"]);e=e||[],t=t||[];var a=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],u=t[0],d=t[1],f=t[t.length-1],g=t[t.length-2];n===!1?(_o(a),_o(u)):sz(a,o)&&(n?(_o(o),_o(d)):(_o(a),_o(u))),i===!1?(_o(s),_o(f)):sz(l,s)&&(i?(_o(l),_o(g)):(_o(s),_o(f)))}}function _o(r){r&&(r.ignore=!0)}function sz(r,e){var t=r&&r.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!t||!n)){var i=Fm([]);return Yu(i,i,-r.rotation),t.applyTransform(zs([],i,r.getLocalTransform())),n.applyTransform(zs([],i,e.getLocalTransform())),t.intersect(n)}}function lz(r){return r==="middle"||r==="center"}function uz(r,e,t,n,i){for(var a=[],o=[],s=[],l=0;l=0||r===e}function WK(r){var e=yT(r);if(e){var t=e.axisPointerModel,n=e.axis.scale,i=t.option,a=t.get("status"),o=t.get("value");o!=null&&(o=n.parse(o));var s=_T(t);a==null&&(i.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o0&&!_.min?_.min=0:_.min!=null&&_.min<0&&!_.max&&(_.max=0);var x=l;_.color!=null&&(x=Bt({color:_.color},l));var w=rr(Ut(_),{boundaryGap:t,splitNumber:n,scale:i,axisLine:a,axisTick:o,axisLabel:s,name:_.text,showName:u,nameLocation:"end",nameGap:f,nameTextStyle:x,triggerEvent:g},!1);if(ut(d)){var C=w.name;w.name=d.replace("{value}",C??"")}else It(d)&&(w.name=d(w.name,w));var A=new qr(w,null,this.ecModel);return $n(A,gg.prototype),A.mainType="radar",A.componentIndex=this.componentIndex,A},this);this._indicatorModels=m},e.prototype.getIndicatorModels=function(){return this._indicatorModels},e.type="radar",e.defaultOption={z:0,center:["50%","50%"],radius:"75%",startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:"polygon",axisLine:rr({lineStyle:{color:"#bbb"}},Mg.axisLine),axisLabel:X_(Mg.axisLabel,!1),axisTick:X_(Mg.axisTick,!1),splitLine:X_(Mg.splitLine,!0),splitArea:X_(Mg.splitArea,!0),indicator:[]},e}(mr),aJ={},oJ=["axisLine","axisTickLabel","axisName"],sJ=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll(),this._buildAxes(t),this._buildSplitLineAndArea(t)},e.prototype._buildAxes=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes(),a=je(i,function(o){var s=o.model.get("showName")?o.name:"",l=new oa(o.model,{axisName:s,position:[n.cx,n.cy],rotation:o.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return l});Q(a,function(o){Q(oJ,o.add,o),this.group.add(o.getGroup())},this)},e.prototype._buildSplitLineAndArea=function(t){var n=t.coordinateSystem,i=n.getIndicatorAxes();if(!i.length)return;var a=t.get("shape"),o=t.getModel("splitLine"),s=t.getModel("splitArea"),l=o.getModel("lineStyle"),u=s.getModel("areaStyle"),d=o.get("show"),f=s.get("show"),g=l.get("color"),m=u.get("color"),_=Ze(g)?g:[g],x=Ze(m)?m:[m],w=[],C=[];function A(fe,le,ge){var xe=ge%le.length;return fe[xe]=fe[xe]||[],xe}if(a==="circle")for(var L=i[0].getTicksCoords(),O=n.cx,V=n.cy,F=0;F3?1.4:o>1?1.2:1.1,d=a>0?u:1/u;ST(this,"zoom","zoomOnMouseWheel",t,{scale:d,originX:s,originY:l,isAvailableBehavior:null})}if(i){var f=Math.abs(a),g=(a>0?1:-1)*(f>3?.4:f>1?.15:.05);ST(this,"scrollMove","moveOnMouseWheel",t,{scrollDelta:g,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(t){if(!_z(this._zr,"globalPan")){var n=t.pinchScale>1?1.1:1/1.1;ST(this,"zoom",null,t,{scale:n,originX:t.pinchX,originY:t.pinchY,isAvailableBehavior:null})}},e}(io);function ST(r,e,t,n,i){r.pointerChecker&&r.pointerChecker(n,i.originX,i.originY)&&(Os(n.event),bz(r,e,t,n,i))}function bz(r,e,t,n,i){i.isAvailableBehavior=pt(Y_,null,t,n),r.trigger(e,i)}function Y_(r,e,t){var n=t[r];return!r||n&&(!ut(n)||e.event[n+"Key"])}function TT(r,e,t){var n=r.target;n.x+=e,n.y+=t,n.dirty()}function ET(r,e,t,n){var i=r.target,a=r.zoomLimit,o=r.zoom=r.zoom||1;if(o*=e,a){var s=a.min||0,l=a.max||1/0;o=Math.max(Math.min(l,o),s)}var u=o/r.zoom;r.zoom=o,i.x-=(t-i.x)*(u-1),i.y-=(n-i.y)*(u-1),i.scaleX*=u,i.scaleY*=u,i.dirty()}var pJ={axisPointer:1,tooltip:1,brush:1};function K_(r,e,t){var n=e.getComponentByElement(r.topTarget),i=n&&n.coordinateSystem;return n&&n!==t&&!pJ.hasOwnProperty(n.mainType)&&i&&i.model!==t}function xz(r){if(ut(r)){var e=new DOMParser;r=e.parseFromString(r,"text/xml")}var t=r;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!=="svg"||t.nodeType!==1;)t=t.nextSibling;return t}var gJ={},CT,J_={fill:"fill",stroke:"stroke","stroke-width":"lineWidth",opacity:"opacity","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-miterlimit":"miterLimit","font-family":"fontFamily","font-size":"fontSize","font-style":"fontStyle","font-weight":"fontWeight","text-anchor":"textAlign",visibility:"visibility",display:"display"},wz=br(J_),Q_={"alignment-baseline":"textBaseline","stop-color":"stopColor"},Sz=br(Q_),vJ=function(){function r(){this._defs={},this._root=null}return r.prototype.parse=function(e,t){t=t||{};var n=xz(e);if(gJ.NODE_ENV!=="production"&&!n)throw new Error("Illegal svg");this._defsUsePending=[];var i=new qt;this._root=i;var a=[],o=n.getAttribute("viewBox")||"",s=parseFloat(n.getAttribute("width")||t.width),l=parseFloat(n.getAttribute("height")||t.height);isNaN(s)&&(s=null),isNaN(l)&&(l=null),Ua(n,i,null,!0,!1);for(var u=n.firstChild;u;)this._parseNode(u,i,a,null,!1,!1),u=u.nextSibling;_J(this._defs,this._defsUsePending),this._defsUsePending=[];var d,f;if(o){var g=e0(o);g.length>=4&&(d={x:parseFloat(g[0]||0),y:parseFloat(g[1]||0),width:parseFloat(g[2]),height:parseFloat(g[3])})}if(d&&s!=null&&l!=null&&(f=kz(d,{x:0,y:0,width:s,height:l}),!t.ignoreViewBox)){var m=i;i=new qt,i.add(m),m.scaleX=m.scaleY=f.scale,m.x=f.x,m.y=f.y}return!t.ignoreRootClip&&s!=null&&l!=null&&i.setClipPath(new Ar({shape:{x:0,y:0,width:s,height:l}})),{root:i,width:s,height:l,viewBoxRect:d,viewBoxTransform:f,named:a}},r.prototype._parseNode=function(e,t,n,i,a,o){var s=e.nodeName.toLowerCase(),l,u=i;if(s==="defs"&&(a=!0),s==="text"&&(o=!0),s==="defs"||s==="switch")l=t;else{if(!a){var d=CT[s];if(d&>(CT,s)){l=d.call(this,e,t);var f=e.getAttribute("name");if(f){var g={name:f,namedFrom:null,svgNodeTagLower:s,el:l};n.push(g),s==="g"&&(u=g)}else i&&n.push({name:i.name,namedFrom:i,svgNodeTagLower:s,el:l});t.add(l)}}var m=Tz[s];if(m&>(Tz,s)){var _=m.call(this,e),x=e.getAttribute("id");x&&(this._defs[x]=_)}}if(l&&l.isGroup)for(var w=e.firstChild;w;)w.nodeType===1?this._parseNode(w,l,n,u,a,o):w.nodeType===3&&o&&this._parseText(w,l),w=w.nextSibling},r.prototype._parseText=function(e,t){var n=new td({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),mJ(n,t);var i=n.style,a=i.fontSize;a&&a<9&&(i.fontSize=9,n.scaleX*=a/9,n.scaleY*=a/9);var o=(i.fontSize||i.fontFamily)&&[i.fontStyle,i.fontWeight,(i.fontSize||12)+"px",i.fontFamily||"sans-serif"].join(" ");i.font=o;var s=n.getBoundingRect();return this._textX+=s.width,t.add(n),n},r.internalField=function(){CT={g:function(e,t){var n=new qt;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new Ar;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute("x")||"0"),y:parseFloat(e.getAttribute("y")||"0"),width:parseFloat(e.getAttribute("width")||"0"),height:parseFloat(e.getAttribute("height")||"0")}),n.silent=!0,n},circle:function(e,t){var n=new Zs;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),r:parseFloat(e.getAttribute("r")||"0")}),n.silent=!0,n},line:function(e,t){var n=new ri;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute("x1")||"0"),y1:parseFloat(e.getAttribute("y1")||"0"),x2:parseFloat(e.getAttribute("x2")||"0"),y2:parseFloat(e.getAttribute("y2")||"0")}),n.silent=!0,n},ellipse:function(e,t){var n=new My;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute("cx")||"0"),cy:parseFloat(e.getAttribute("cy")||"0"),rx:parseFloat(e.getAttribute("rx")||"0"),ry:parseFloat(e.getAttribute("ry")||"0")}),n.silent=!0,n},polygon:function(e,t){var n=e.getAttribute("points"),i;n&&(i=Az(n));var a=new ta({shape:{points:i||[]},silent:!0});return bo(t,a),Ua(e,a,this._defsUsePending,!1,!1),a},polyline:function(e,t){var n=e.getAttribute("points"),i;n&&(i=Az(n));var a=new ra({shape:{points:i||[]},silent:!0});return bo(t,a),Ua(e,a,this._defsUsePending,!1,!1),a},image:function(e,t){var n=new di;return bo(t,n),Ua(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute("xlink:href")||e.getAttribute("href"),x:+e.getAttribute("x"),y:+e.getAttribute("y"),width:+e.getAttribute("width"),height:+e.getAttribute("height")}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute("x")||"0",i=e.getAttribute("y")||"0",a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0";this._textX=parseFloat(n)+parseFloat(a),this._textY=parseFloat(i)+parseFloat(o);var s=new qt;return bo(t,s),Ua(e,s,this._defsUsePending,!1,!0),s},tspan:function(e,t){var n=e.getAttribute("x"),i=e.getAttribute("y");n!=null&&(this._textX=parseFloat(n)),i!=null&&(this._textY=parseFloat(i));var a=e.getAttribute("dx")||"0",o=e.getAttribute("dy")||"0",s=new qt;return bo(t,s),Ua(e,s,this._defsUsePending,!1,!0),this._textX+=parseFloat(a),this._textY+=parseFloat(o),s},path:function(e,t){var n=e.getAttribute("d")||"",i=Nk(n);return bo(t,i),Ua(e,i,this._defsUsePending,!1,!1),i.silent=!0,i}}}(),r}(),Tz={lineargradient:function(r){var e=parseInt(r.getAttribute("x1")||"0",10),t=parseInt(r.getAttribute("y1")||"0",10),n=parseInt(r.getAttribute("x2")||"10",10),i=parseInt(r.getAttribute("y2")||"0",10),a=new Bp(e,t,n,i);return Ez(r,a),Cz(r,a),a},radialgradient:function(r){var e=parseInt(r.getAttribute("cx")||"0",10),t=parseInt(r.getAttribute("cy")||"0",10),n=parseInt(r.getAttribute("r")||"0",10),i=new $k(e,t,n);return Ez(r,i),Cz(r,i),i}};function Ez(r,e){var t=r.getAttribute("gradientUnits");t==="userSpaceOnUse"&&(e.global=!0)}function Cz(r,e){for(var t=r.firstChild;t;){if(t.nodeType===1&&t.nodeName.toLocaleLowerCase()==="stop"){var n=t.getAttribute("offset"),i=void 0;n&&n.indexOf("%")>0?i=parseInt(n,10)/100:n?i=parseFloat(n):i=0;var a={};Iz(t,a,a);var o=a.stopColor||t.getAttribute("stop-color")||"#000000";e.colorStops.push({offset:i,color:o})}t=t.nextSibling}}function bo(r,e){r&&r.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),Bt(e.__inheritedStyle,r.__inheritedStyle))}function Az(r){for(var e=e0(r),t=[],n=0;n0;a-=2){var o=n[a],s=n[a-1],l=e0(o);switch(i=i||za(),s){case"translate":as(i,i,[parseFloat(l[0]),parseFloat(l[1]||"0")]);break;case"scale":Vx(i,i,[parseFloat(l[0]),parseFloat(l[1]||l[0])]);break;case"rotate":Yu(i,i,-parseFloat(l[0])*AT,[parseFloat(l[1]||"0"),parseFloat(l[2]||"0")]);break;case"skewX":var u=Math.tan(parseFloat(l[0])*AT);zs(i,[1,0,u,1,0,0],i);break;case"skewY":var d=Math.tan(parseFloat(l[0])*AT);zs(i,[1,d,0,1,0,0],i);break;case"matrix":i[0]=parseFloat(l[0]),i[1]=parseFloat(l[1]),i[2]=parseFloat(l[2]),i[3]=parseFloat(l[3]),i[4]=parseFloat(l[4]),i[5]=parseFloat(l[5]);break}}e.setLocalTransform(i)}}var Mz=/([^\s:;]+)\s*:\s*([^:;]+)/g;function Iz(r,e,t){var n=r.getAttribute("style");if(n){Mz.lastIndex=0;for(var i;(i=Mz.exec(n))!=null;){var a=i[1],o=gt(J_,a)?J_[a]:null;o&&(e[o]=i[2]);var s=gt(Q_,a)?Q_[a]:null;s&&(t[s]=i[2])}}}function SJ(r,e,t){for(var n=0;n0,w={api:n,geo:l,mapOrGeoModel:e,data:s,isVisualEncodedByVisualMap:x,isGeo:o,transformInfoRaw:g};l.resourceType==="geoJSON"?this._buildGeoJSON(w):l.resourceType==="geoSVG"&&this._buildSVG(w),this._updateController(e,t,n),this._updateMapSelectHandler(e,u,n,i)},r.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=Tt(),n=Tt(),i=this._regionsGroup,a=e.transformInfoRaw,o=e.mapOrGeoModel,s=e.data,l=e.geo.projection,u=l&&l.stream;function d(m,_){return _&&(m=_(m)),m&&[m[0]*a.scaleX+a.x,m[1]*a.scaleY+a.y]}function f(m){for(var _=[],x=!u&&l&&l.project,w=0;w=0)&&(g=i);var m=o?{normal:{align:"center",verticalAlign:"middle"}}:null;Ci(e,ni(n),{labelFetcher:g,labelDataIndex:f,defaultText:t},m);var _=e.getTextContent();if(_&&(Pz(_).ignore=_.ignore,e.textConfig&&o)){var x=e.getBoundingRect().clone();e.textConfig.layoutRect=x,e.textConfig.position=[(o[0]-x.x)/x.width*100+"%",(o[1]-x.y)/x.height*100+"%"]}e.disableLabelAnimation=!0}else e.removeTextContent(),e.removeTextConfig(),e.disableLabelAnimation=null}function Bz(r,e,t,n,i,a){r.data?r.data.setItemGraphicEl(a,e):jt(e).eventData={componentType:"geo",componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:t,region:n&&n.option||{}}}function Vz(r,e,t,n,i){r.data||Tc({el:e,componentModel:i,itemName:t,itemTooltipOption:n.get("tooltip")})}function Fz(r,e,t,n,i){e.highDownSilentOnTouch=!!i.get("selectedMode");var a=n.getModel("emphasis"),o=a.get("focus");return Sn(e,o,a.get("blurScope"),a.get("disabled")),r.isGeo&&m9(e,i,t),o}function $z(r,e,t){var n=[],i;function a(){i=[]}function o(){i.length&&(n.push(i),i=[])}var s=e({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(l,u){isFinite(l)&&isFinite(u)&&i.push([l,u])},sphere:function(){}});return!t&&s.polygonStart(),Q(r,function(l){s.lineStart();for(var u=0;u-1&&(i.style.stroke=i.style.fill,i.style.fill="#fff",i.style.lineWidth=2),i},e.type="series.map",e.dependencies=["geo"],e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},select:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},nameProperty:"name"},e}(on);function HJ(r,e){var t={};return Q(r,function(n){n.each(n.mapDimension("value"),function(i,a){var o="ec-"+n.getName(a);t[o]=t[o]||[],isNaN(i)||t[o].push(i)})}),r[0].map(r[0].mapDimension("value"),function(n,i){for(var a="ec-"+r[0].getName(i),o=0,s=1/0,l=-1/0,u=t[a].length,d=0;d1?(O.width=L,O.height=L/w):(O.height=L,O.width=L*w),O.y=A[1]-O.height/2,O.x=A[0]-O.width/2;else{var V=r.getBoxLayoutParams();V.aspect=w,O=Xn(V,{width:_,height:x})}this.setViewRect(O.x,O.y,O.width,O.height),this.setCenter(r.get("center"),e),this.setZoom(r.get("zoom"))}function jJ(r,e){Q(e.get("geoCoord"),function(t,n){r.addGeoCoord(n,t)})}var XJ=function(){function r(){this.dimensions=Hz}return r.prototype.create=function(e,t){var n=[];function i(o){return{nameProperty:o.get("nameProperty"),aspectScale:o.get("aspectScale"),projection:o.get("projection")}}e.eachComponent("geo",function(o,s){var l=o.get("map"),u=new kT(l+s,l,Ge({nameMap:o.get("nameMap")},i(o)));u.zoomLimit=o.get("scaleLimit"),n.push(u),o.coordinateSystem=u,u.model=o,u.resize=Zz,u.resize(o,t)}),e.eachSeries(function(o){var s=o.get("coordinateSystem");if(s==="geo"){var l=o.get("geoIndex")||0;o.coordinateSystem=n[l]}});var a={};return e.eachSeriesByType("map",function(o){if(!o.getHostGeoModel()){var s=o.getMapType();a[s]=a[s]||[],a[s].push(o)}}),Q(a,function(o,s){var l=je(o,function(d){return d.get("nameMap")}),u=new kT(s,s,Ge({nameMap:Sx(l)},i(o[0])));u.zoomLimit=Gn.apply(null,je(o,function(d){return d.get("scaleLimit")})),n.push(u),u.resize=Zz,u.resize(o[0],t),Q(o,function(d){d.coordinateSystem=u,jJ(u,d)})}),n},r.prototype.getFilledRegions=function(e,t,n,i){for(var a=(e||[]).slice(),o=Tt(),s=0;s=0;o--){var s=i[o];s.hierNode={defaultAncestor:null,ancestor:s,prelim:0,modifier:0,change:0,shift:0,i:o,thread:null},t.push(s)}}function tQ(r,e){var t=r.isExpand?r.children:[],n=r.parentNode.children,i=r.hierNode.i?n[r.hierNode.i-1]:null;if(t.length){iQ(r);var a=(t[0].hierNode.prelim+t[t.length-1].hierNode.prelim)/2;i?(r.hierNode.prelim=i.hierNode.prelim+e(r,i),r.hierNode.modifier=r.hierNode.prelim-a):r.hierNode.prelim=a}else i&&(r.hierNode.prelim=i.hierNode.prelim+e(r,i));r.parentNode.hierNode.defaultAncestor=aQ(r,i,r.parentNode.hierNode.defaultAncestor||n[0],e)}function rQ(r){var e=r.hierNode.prelim+r.parentNode.hierNode.modifier;r.setLayout({x:e},!0),r.hierNode.modifier+=r.parentNode.hierNode.modifier}function Kz(r){return arguments.length?r:lQ}function Pg(r,e){return r-=Math.PI/2,{x:e*Math.cos(r),y:e*Math.sin(r)}}function nQ(r,e){return Xn(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function iQ(r){for(var e=r.children,t=e.length,n=0,i=0;--t>=0;){var a=e[t];a.hierNode.prelim+=n,a.hierNode.modifier+=n,i+=a.hierNode.change,n+=a.hierNode.shift+i}}function aQ(r,e,t,n){if(e){for(var i=r,a=r,o=a.parentNode.children[0],s=e,l=i.hierNode.modifier,u=a.hierNode.modifier,d=o.hierNode.modifier,f=s.hierNode.modifier;s=PT(s),a=RT(a),s&&a;){i=PT(i),o=RT(o),i.hierNode.ancestor=r;var g=s.hierNode.prelim+f-a.hierNode.prelim-u+n(s,a);g>0&&(sQ(oQ(s,r,t),r,g),u+=g,l+=g),f+=s.hierNode.modifier,u+=a.hierNode.modifier,l+=i.hierNode.modifier,d+=o.hierNode.modifier}s&&!PT(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=f-l),a&&!RT(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=u-d,t=r)}return t}function PT(r){var e=r.children;return e.length&&r.isExpand?e[e.length-1]:r.hierNode.thread}function RT(r){var e=r.children;return e.length&&r.isExpand?e[0]:r.hierNode.thread}function oQ(r,e,t){return r.hierNode.ancestor.parentNode===e.parentNode?r.hierNode.ancestor:t}function sQ(r,e,t){var n=t/(e.hierNode.i-r.hierNode.i);e.hierNode.change-=n,e.hierNode.shift+=t,e.hierNode.modifier+=t,e.hierNode.prelim+=t,r.hierNode.change+=n}function lQ(r,e){return r.parentNode===e.parentNode?1:2}var uQ={},cQ=function(){function r(){this.parentPoint=[],this.childPoints=[]}return r}(),hQ=function(r){ze(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new cQ},e.prototype.buildPath=function(t,n){var i=n.childPoints,a=i.length,o=n.parentPoint,s=i[0],l=i[a-1];if(a===1){t.moveTo(o[0],o[1]),t.lineTo(s[0],s[1]);return}var u=n.orient,d=u==="TB"||u==="BT"?0:1,f=1-d,g=nt(n.forkPosition,1),m=[];m[d]=o[d],m[f]=o[f]+(l[f]-o[f])*g,t.moveTo(o[0],o[1]),t.lineTo(m[0],m[1]),t.moveTo(s[0],s[1]),m[d]=s[d],t.lineTo(m[0],m[1]),m[d]=l[d],t.lineTo(m[0],m[1]),t.lineTo(l[0],l[1]);for(var _=1;_A.x,V||(O=O-Math.PI));var $=V?"left":"right",H=s.getModel("label"),Z=H.get("rotate"),j=Z*(Math.PI/180),Y=w.getTextContent();Y&&(w.setTextConfig({position:H.get("position")||$,rotation:Z==null?-O:j,origin:"center"}),Y.setStyle("verticalAlign","middle"))}var se=s.get(["emphasis","focus"]),ae=se==="relative"?ap(o.getAncestorsIndices(),o.getDescendantIndices()):se==="ancestor"?o.getAncestorsIndices():se==="descendant"?o.getDescendantIndices():null;ae&&(jt(t).focus=ae),fQ(i,o,d,t,_,m,x,n),t.__edge&&(t.onHoverStateChange=function(ue){if(ue!=="blur"){var fe=o.parentNode&&r.getItemGraphicEl(o.parentNode.dataIndex);fe&&fe.hoverState===Mp||Cy(t.__edge,ue)}})}function fQ(r,e,t,n,i,a,o,s){var l=e.getModel(),u=r.get("edgeShape"),d=r.get("layout"),f=r.getOrient(),g=r.get(["lineStyle","curveness"]),m=r.get("edgeForkPosition"),_=l.getModel("lineStyle").getLineStyle(),x=n.__edge;if(u==="curve")e.parentNode&&e.parentNode!==t&&(x||(x=n.__edge=new zp({shape:NT(d,f,g,i,i)})),Or(x,{shape:NT(d,f,g,a,o)},r));else if(u==="polyline"){if(d==="orthogonal"){if(e!==t&&e.children&&e.children.length!==0&&e.isExpand===!0){for(var w=e.children,C=[],A=0;At&&(t=i.height)}this.height=t+1},r.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,i=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},r.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},r.prototype.getModel=function(e){if(!(this.dataIndex<0)){var t=this.hostTree,n=t.data.getItemModel(this.dataIndex);return n.getModel(e)}},r.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},r.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},r.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},r.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},r.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},r.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var n=t.getData().tree.root,i=r.targetNode;if(ut(i)&&(i=n.getNodeById(i)),i&&n.contains(i))return{node:i};var a=r.targetNodeId;if(a!=null&&(i=n.getNodeById(a)))return{node:i}}}function aB(r){for(var e=[];r;)r=r.parentNode,r&&e.push(r);return e.reverse()}function BT(r,e){var t=aB(r);return hr(t,e)>=0}function r0(r,e){for(var t=[];r;){var n=r.dataIndex;t.push({name:r.name,dataIndex:n,value:e.getRawValue(n)}),r=r.parentNode}return t.reverse(),t}var wQ=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t){var n={name:t.name,children:t.data},i=t.leaves||{},a=new qr(i,this,this.ecModel),o=zT.createTree(n,this,s);function s(f){f.wrapMethod("getItemModel",function(g,m){var _=o.getNodeByDataIndex(m);return _&&_.children.length&&_.isExpand||(g.parentModel=a),g})}var l=0;o.eachNode("preorder",function(f){f.depth>l&&(l=f.depth)});var u=t.expandAndCollapse,d=u&&t.initialTreeDepth>=0?t.initialTreeDepth:l;return o.root.eachNode("preorder",function(f){var g=f.hostTree.data.getRawDataItem(f.dataIndex);f.isExpand=g&&g.collapsed!=null?!g.collapsed:f.depth<=d}),o.data},e.prototype.getOrient=function(){var t=this.get("orient");return t==="horizontal"?t="LR":t==="vertical"&&(t="TB"),t},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.formatTooltip=function(t,n,i){for(var a=this.getData().tree,o=a.root.children[0],s=a.getNodeByDataIndex(t),l=s.getValue(),u=s.name;s&&s!==o;)u=s.parentNode.name+"."+u,s=s.parentNode;return ii("nameValue",{name:u,value:l,noValue:isNaN(l)||l==null})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=r0(i,this),n.collapsed=!i.isExpand,n},e.type="series.tree",e.layoutMode="box",e.defaultOption={z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderWidth:1.5},label:{show:!0},animationEasing:"linear",animationDuration:700,animationDurationUpdate:500},e}(on);function SQ(r,e,t){for(var n=[r],i=[],a;a=n.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)t.push(i[a])}}function TQ(r,e){r.eachSeriesByType("tree",function(t){EQ(t,e)})}function EQ(r,e){var t=nQ(r,e);r.layoutInfo=t;var n=r.get("layout"),i=0,a=0,o=null;n==="radial"?(i=2*Math.PI,a=Math.min(t.height,t.width)/2,o=Kz(function(L,O){return(L.parentNode===O.parentNode?1:2)/L.depth})):(i=t.width,a=t.height,o=Kz());var s=r.getData().tree.root,l=s.children[0];if(l){eQ(s),SQ(l,tQ,o),s.hierNode.modifier=-l.hierNode.prelim,Ng(l,rQ);var u=l,d=l,f=l;Ng(l,function(L){var O=L.getLayout().x;Od.getLayout().x&&(d=L),L.depth>f.depth&&(f=L)});var g=u===d?1:o(u,d)/2,m=g-u.getLayout().x,_=0,x=0,w=0,C=0;if(n==="radial")_=i/(d.getLayout().x+g+m),x=a/(f.depth-1||1),Ng(l,function(L){w=(L.getLayout().x+m)*_,C=(L.depth-1)*x;var O=Pg(w,C);L.setLayout({x:O.x,y:O.y,rawX:w,rawY:C},!0)});else{var A=r.getOrient();A==="RL"||A==="LR"?(x=a/(d.getLayout().x+g+m),_=i/(f.depth-1||1),Ng(l,function(L){C=(L.getLayout().x+m)*x,w=A==="LR"?(L.depth-1)*_:i-(L.depth-1)*_,L.setLayout({x:w,y:C},!0)})):(A==="TB"||A==="BT")&&(_=i/(d.getLayout().x+g+m),x=a/(f.depth-1||1),Ng(l,function(L){w=(L.getLayout().x+m)*_,C=A==="TB"?(L.depth-1)*x:a-(L.depth-1)*x,L.setLayout({x:w,y:C},!0)}))}}}function CQ(r){r.eachSeriesByType("tree",function(e){var t=e.getData(),n=t.tree;n.eachNode(function(i){var a=i.getModel(),o=a.getModel("itemStyle").getItemStyle(),s=t.ensureUniqueItemVisual(i.dataIndex,"style");Ge(s,o)})})}function AQ(r){r.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"tree",query:e},function(n){var i=e.dataIndex,a=n.getData().tree,o=a.getNodeByDataIndex(i);o.isExpand=!o.isExpand})}),r.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(e,t,n){t.eachComponent({mainType:"series",subType:"tree",query:e},function(i){var a=i.coordinateSystem,o=LT(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}function DQ(r){r.registerChartView(dQ),r.registerSeriesModel(wQ),r.registerLayout(TQ),r.registerVisual(CQ),AQ(r)}var oB=["treemapZoomToNode","treemapRender","treemapMove"];function MQ(r){for(var e=0;e1;)a=a.parentNode;var o=R1(r.ecModel,a.name||a.dataIndex+"",n);i.setVisual("decal",o)})}var IQ=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.preventUsingHoverLayer=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};lB(i);var a=t.levels||[],o=this.designatedVisualItemStyle={},s=new qr({itemStyle:o},this,n);a=t.levels=kQ(a,n);var l=je(a||[],function(f){return new qr(f,s,n)},this),u=zT.createTree(i,this,d);function d(f){f.wrapMethod("getItemModel",function(g,m){var _=u.getNodeByDataIndex(m),x=_?l[_.depth]:null;return g.parentModel=x||s,g})}return u.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.formatTooltip=function(t,n,i){var a=this.getData(),o=this.getRawValue(t),s=a.getName(t);return ii("nameValue",{name:s,value:o})},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=r0(i,this),n.treePathInfo=n.treeAncestors,n},e.prototype.setLayoutInfo=function(t){this.layoutInfo=this.layoutInfo||{},Ge(this.layoutInfo,t)},e.prototype.mapIdToIndex=function(t){var n=this._idIndexMap;n||(n=this._idIndexMap=Tt(),this._idIndexMapCount=0);var i=n.get(t);return i==null&&n.set(t,i=this._idIndexMapCount++),i},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){sB(this)},e.type="series.treemap",e.layoutMode="box",e.defaultOption={progressive:0,left:"center",top:"middle",width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"▶",zoomToNodeRatio:.32*.32,scaleLimit:null,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",textStyle:{color:"#fff"}},emphasis:{itemStyle:{color:"rgba(0,0,0,0.9)"}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",overflow:"truncate"},upperLabel:{show:!1,position:[0,"50%"],height:20,overflow:"truncate",verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],overflow:"truncate",verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},e}(on);function lB(r){var e=0;Q(r.children,function(n){lB(n);var i=n.value;Ze(i)&&(i=i[0]),e+=i});var t=r.value;Ze(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Ze(r.value)?r.value[0]=t:r.value=t}function kQ(r,e){var t=Xr(e.get("color")),n=Xr(e.get(["aria","decal","decals"]));if(t){r=r||[];var i,a;Q(r,function(s){var l=new qr(s),u=l.get("color"),d=l.get("decal");(l.get(["itemStyle","color"])||u&&u!=="none")&&(i=!0),(l.get(["itemStyle","decal"])||d&&d!=="none")&&(a=!0)});var o=r[0]||(r[0]={});return i||(o.color=t.slice()),!a&&n&&(o.decal=n.slice()),r}}var LQ=8,uB=8,VT=5,PQ=function(){function r(e){this.group=new qt,e.add(this.group)}return r.prototype.render=function(e,t,n,i){var a=e.getModel("breadcrumb"),o=this.group;if(o.removeAll(),!(!a.get("show")||!n)){var s=a.getModel("itemStyle"),l=a.getModel("emphasis"),u=s.getModel("textStyle"),d=l.getModel(["itemStyle","textStyle"]),f={pos:{left:a.get("left"),right:a.get("right"),top:a.get("top"),bottom:a.get("bottom")},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:a.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(n,f,u),this._renderContent(e,f,s,l,u,d,i),Qy(o,f.pos,f.box)}},r.prototype._prepare=function(e,t,n){for(var i=e;i;i=i.parentNode){var a=jn(i.getModel().get("name"),""),o=n.getTextRect(a),s=Math.max(o.width+LQ*2,t.emptyItemWidth);t.totalWidth+=s+uB,t.renderList.push({node:i,text:a,width:s})}},r.prototype._renderContent=function(e,t,n,i,a,o,s){for(var l=0,u=t.emptyItemWidth,d=e.get(["breadcrumb","height"]),f=bq(t.pos,t.box),g=t.totalWidth,m=t.renderList,_=i.getModel("itemStyle").getItemStyle(),x=m.length-1;x>=0;x--){var w=m[x],C=w.node,A=w.width,L=w.text;g>f.width&&(g-=A-u,A=u,L=null);var O=new ta({shape:{points:RQ(l,0,A,d,x===m.length-1,x===0)},style:Bt(n.getItemStyle(),{lineJoin:"bevel"}),textContent:new Dr({style:an(a,{text:L})}),textConfig:{position:"inside"},z2:nd*1e4,onclick:er(s,C)});O.disableLabelAnimation=!0,O.getTextContent().ensureState("emphasis").style=an(o,{text:L}),O.ensureState("emphasis").style=_,Sn(O,i.get("focus"),i.get("blurScope"),i.get("disabled")),this.group.add(O),NQ(O,e,C),l+=A+uB}},r.prototype.remove=function(){this.group.removeAll()},r}();function RQ(r,e,t,n,i,a){var o=[[i?r:r-VT,e],[r+t,e],[r+t,e+n],[i?r:r-VT,e+n]];return!a&&o.splice(2,0,[r+t+VT,e+n/2]),!i&&o.push([r,e+n/2]),o}function NQ(r,e,t){jt(r).eventData={componentType:"series",componentSubType:"treemap",componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:t&&t.dataIndex,name:t&&t.name},treePathInfo:t&&r0(t,e)}}var OQ=function(){function r(){this._storage=[],this._elExistsMap={}}return r.prototype.add=function(e,t,n,i,a){return this._elExistsMap[e.id]?!1:(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:i,easing:a}),!0)},r.prototype.finished=function(e){return this._finishedCallback=e,this},r.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},i=0,a=this._storage.length;ihB||Math.abs(t.dy)>hB)){var n=this.seriesModel.getData().tree.root;if(!n)return;var i=n.getLayout();if(!i)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:i.x+t.dx,y:i.y+t.dy,width:i.width,height:i.height}})}},e.prototype._onZoom=function(t){var n=t.originX,i=t.originY,a=t.scale;if(this._state!=="animating"){var o=this.seriesModel.getData().tree.root;if(!o)return;var s=o.getLayout();if(!s)return;var l=new sr(s.x,s.y,s.width,s.height),u=null,d=this._controllerHost;u=d.zoomLimit;var f=d.zoom=d.zoom||1;if(f*=a,u){var g=u.min||0,m=u.max||1/0;f=Math.max(Math.min(m,f),g)}var _=f/d.zoom;d.zoom=f;var x=this.seriesModel.layoutInfo;n-=x.x,i-=x.y;var w=za();as(w,w,[-n,-i]),Vx(w,w,[_,_]),as(w,w,[n,i]),l.applyTransform(w),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:l.x,y:l.y,width:l.width,height:l.height}})}},e.prototype._initEvents=function(t){var n=this;t.on("click",function(i){if(n._state==="ready"){var a=n.seriesModel.get("nodeClick",!0);if(a){var o=n.findTarget(i.offsetX,i.offsetY);if(o){var s=o.node;if(s.getLayout().isLeafRoot)n._rootToNode(o);else if(a==="zoomToNode")n._zoomToNode(o);else if(a==="link"){var l=s.hostTree.data.getItemModel(s.dataIndex),u=l.get("link",!0),d=l.get("target",!0)||"blank";u&&Ky(u,d)}}}}},this)},e.prototype._renderBreadcrumb=function(t,n,i){var a=this;i||(i=t.get("leafDepth",!0)!=null?{node:t.getViewRoot()}:this.findTarget(n.getWidth()/2,n.getHeight()/2),i||(i={node:t.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new PQ(this.group))).render(t,n,i.node,function(o){a._state!=="animating"&&(BT(t.getViewRoot(),o)?a._rootToNode({node:o}):a._zoomToNode({node:o}))})},e.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=Og(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},e.prototype.dispose=function(){this._clearController()},e.prototype._zoomToNode=function(t){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype._rootToNode=function(t){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:t.node})},e.prototype.findTarget=function(t,n){var i,a=this.seriesModel.getViewRoot();return a.eachNode({attr:"viewChildren",order:"preorder"},function(o){var s=this._storage.background[o.getRawIndex()];if(s){var l=s.transformCoordToLocal(t,n),u=s.shape;if(u.x<=l[0]&&l[0]<=u.x+u.width&&u.y<=l[1]&&l[1]<=u.y+u.height)i={node:o,offsetX:l[0],offsetY:l[1]};else return!1}},this),i},e.type="treemap",e}(Jr);function Og(){return{nodeGroup:[],background:[],content:[]}}function GQ(r,e,t,n,i,a,o,s,l,u){if(!o)return;var d=o.getLayout(),f=r.getData(),g=o.getModel();if(f.setItemGraphicEl(o.dataIndex,null),!d||!d.isInView)return;var m=d.width,_=d.height,x=d.borderWidth,w=d.invisible,C=o.getRawIndex(),A=s&&s.getRawIndex(),L=o.viewChildren,O=d.upperHeight,V=L&&L.length,F=g.getModel("itemStyle"),$=g.getModel(["emphasis","itemStyle"]),H=g.getModel(["blur","itemStyle"]),Z=g.getModel(["select","itemStyle"]),j=F.get("borderRadius")||0,Y=it("nodeGroup",FT);if(!Y)return;if(l.add(Y),Y.x=d.x||0,Y.y=d.y||0,Y.markRedraw(),n0(Y).nodeWidth=m,n0(Y).nodeHeight=_,d.isAboveViewRoot)return Y;var se=it("background",cB,u,VQ);se&&Ve(Y,se,V&&d.upperLabelHeight);var ae=g.getModel("emphasis"),ue=ae.get("focus"),fe=ae.get("blurScope"),le=ae.get("disabled"),ge=ue==="ancestor"?o.getAncestorsIndices():ue==="descendant"?o.getDescendantIndices():ue;if(V)zl(Y)&&_c(Y,!1),se&&(_c(se,!le),f.setItemGraphicEl(o.dataIndex,se),i1(se,ge,fe));else{var xe=it("content",cB,u,FQ);xe&&Fe(Y,xe),se.disableMorphing=!0,se&&zl(se)&&_c(se,!1),_c(Y,!le),f.setItemGraphicEl(o.dataIndex,Y);var Me=g.getShallow("cursor");Me&&xe.attr("cursor",Me),i1(Y,ge,fe)}return Y;function Ve(lt,st,Ct){var rt=jt(st);if(rt.dataIndex=o.dataIndex,rt.seriesIndex=r.seriesIndex,st.setShape({x:0,y:0,width:m,height:_,r:j}),w)Xe(st);else{st.invisible=!1;var vt=o.getVisual("style"),Qe=vt.stroke,Ft=pB(F);Ft.fill=Qe;var Kt=Yc($);Kt.fill=$.get("borderColor");var Le=Yc(H);Le.fill=H.get("borderColor");var Mr=Yc(Z);if(Mr.fill=Z.get("borderColor"),Ct){var Lt=m-2*x;ot(st,Qe,vt.opacity,{x,y:0,width:Lt,height:O})}else st.removeTextContent();st.setStyle(Ft),st.ensureState("emphasis").style=Kt,st.ensureState("blur").style=Le,st.ensureState("select").style=Mr,mc(st)}lt.add(st)}function Fe(lt,st){var Ct=jt(st);Ct.dataIndex=o.dataIndex,Ct.seriesIndex=r.seriesIndex;var rt=Math.max(m-2*x,0),vt=Math.max(_-2*x,0);if(st.culling=!0,st.setShape({x,y:x,width:rt,height:vt,r:j}),w)Xe(st);else{st.invisible=!1;var Qe=o.getVisual("style"),Ft=Qe.fill,Kt=pB(F);Kt.fill=Ft,Kt.decal=Qe.decal;var Le=Yc($),Mr=Yc(H),Lt=Yc(Z);ot(st,Ft,Qe.opacity,null),st.setStyle(Kt),st.ensureState("emphasis").style=Le,st.ensureState("blur").style=Mr,st.ensureState("select").style=Lt,mc(st)}lt.add(st)}function Xe(lt){!lt.invisible&&a.push(lt)}function ot(lt,st,Ct,rt){var vt=g.getModel(rt?fB:dB),Qe=jn(g.get("name"),null),Ft=vt.getShallow("show");Ci(lt,ni(g,rt?fB:dB),{defaultText:Ft?Qe:null,inheritColor:st,defaultOpacity:Ct,labelFetcher:r,labelDataIndex:o.dataIndex});var Kt=lt.getTextContent();if(Kt){var Le=Kt.style,Mr=Ex(Le.padding||0);rt&&(lt.setTextConfig({layoutRect:rt}),Kt.disableLabelLayout=!0),Kt.beforeUpdate=function(){var Xt=Math.max((rt?rt.width:lt.shape.width)-Mr[1]-Mr[3],0),nr=Math.max((rt?rt.height:lt.shape.height)-Mr[0]-Mr[2],0);(Le.width!==Xt||Le.height!==nr)&&Kt.setStyle({width:Xt,height:nr})},Le.truncateMinChar=2,Le.lineOverflow="truncate",et(Le,rt,d);var Lt=Kt.getState("emphasis");et(Lt?Lt.style:null,rt,d)}}function et(lt,st,Ct){var rt=lt?lt.text:null;if(!st&&Ct.isLeafRoot&&rt!=null){var vt=r.get("drillDownIcon",!0);lt.text=vt?vt+" "+rt:rt}}function it(lt,st,Ct,rt){var vt=A!=null&&t[lt][A],Qe=i[lt];return vt?(t[lt][A]=null,kt(Qe,vt)):w||(vt=new st,vt instanceof uo&&(vt.z2=UQ(Ct,rt)),Ht(Qe,vt)),e[lt][C]=vt}function kt(lt,st){var Ct=lt[C]={};st instanceof FT?(Ct.oldX=st.x,Ct.oldY=st.y):Ct.oldShape=Ge({},st.shape)}function Ht(lt,st){var Ct=lt[C]={},rt=o.parentNode,vt=st instanceof qt;if(rt&&(!n||n.direction==="drillDown")){var Qe=0,Ft=0,Kt=i.background[rt.getRawIndex()];!n&&Kt&&Kt.oldShape&&(Qe=Kt.oldShape.width,Ft=Kt.oldShape.height),vt?(Ct.oldX=0,Ct.oldY=Ft):Ct.oldShape={x:Qe,y:Ft,width:0,height:0}}Ct.fadein=!vt}}function UQ(r,e){return r*BQ+e}var HQ={},zg=Q,WQ=Nt,i0=-1,si=function(){function r(e){var t=e.mappingMethod,n=e.type,i=this.option=Ut(e);this.type=n,this.mappingMethod=t,this._normalizeData=jQ[t];var a=r.visualHandlers[n];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[t],t==="piecewise"?($T(i),qQ(i)):t==="category"?i.categories?ZQ(i):$T(i,!0):(Ot(t!=="linear"||i.dataExtent),$T(i))}return r.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},r.prototype.getNormalizer=function(){return pt(this._normalizeData,this)},r.listVisualTypes=function(){return br(r.visualHandlers)},r.isValidType=function(e){return r.visualHandlers.hasOwnProperty(e)},r.eachVisual=function(e,t,n){Nt(e)?Q(e,t,n):t.call(n,e)},r.mapVisual=function(e,t,n){var i,a=Ze(e)?[]:Nt(e)?{}:(i=!0,null);return r.eachVisual(e,function(o,s){var l=t.call(n,o,s);i?a=l:a[s]=l}),a},r.retrieveVisuals=function(e){var t={},n;return e&&zg(r.visualHandlers,function(i,a){e.hasOwnProperty(a)&&(t[a]=e[a],n=!0)}),n?t:null},r.prepareVisualTypes=function(e){if(Ze(e))e=e.slice();else if(WQ(e)){var t=[];zg(e,function(n,i){t.push(i)}),e=t}else return[];return e.sort(function(n,i){return i==="color"&&n!=="color"&&n.indexOf("color")===0?1:-1}),e},r.dependsOn=function(e,t){return t==="color"?!!(e&&e.indexOf(t)===0):e===t},r.findPieceIndex=function(e,t,n){for(var i,a=1/0,o=0,s=t.length;o=0;a--)n[a]==null&&(delete t[e[a]],e.pop())}function $T(r,e){var t=r.visual,n=[];Nt(t)?zg(t,function(a){n.push(a)}):t!=null&&n.push(t);var i={color:1,symbol:1};!e&&n.length===1&&!i.hasOwnProperty(r.type)&&(n[1]=n[0]),vB(r,n)}function a0(r){return{applyVisual:function(e,t,n){var i=this.mapValueToVisual(e);n("color",r(t("color"),i))},_normalizedToVisual:GT([0,1])}}function gB(r){var e=this.option.visual;return e[Math.round(Wr(r,[0,1],[0,e.length-1],!0))]||{}}function Bg(r){return function(e,t,n){n(r,this.mapValueToVisual(e))}}function Vg(r){var e=this.option.visual;return e[this.option.loop&&r!==i0?r%e.length:r]}function Kc(){return this.option.visual[0]}function GT(r){return{linear:function(e){return Wr(e,r,this.option.visual,!0)},category:Vg,piecewise:function(e,t){var n=UT.call(this,t);return n==null&&(n=Wr(e,r,this.option.visual,!0)),n},fixed:Kc}}function UT(r){var e=this.option,t=e.pieceList;if(e.hasSpecialVisual){var n=si.findPieceIndex(r,t),i=t[n];if(i&&i.visual)return i.visual[this.type]}}function vB(r,e){return r.visual=e,r.type==="color"&&(r.parsedVisual=je(e,function(t){var n=Va(t);return!n&&HQ.NODE_ENV!=="production"&&wn("'"+t+"' is an illegal color, fallback to '#000000'",!0),n||[0,0,0,1]})),e}var jQ={linear:function(r){return Wr(r,this.option.dataExtent,[0,1],!0)},piecewise:function(r){var e=this.option.pieceList,t=si.findPieceIndex(r,e,!0);if(t!=null)return Wr(t,[0,e.length-1],[0,1],!0)},category:function(r){var e=this.option.categories?this.option.categoryMap[r]:r;return e??i0},fixed:On};function o0(r,e,t){return r?e<=t:e=t.length||x===t[x.depth]){var C=eee(i,l,x,w,_,n);yB(x,C,t,n)}})}}}function KQ(r,e,t){var n=Ge({},e),i=t.designatedVisualItemStyle;return Q(["color","colorAlpha","colorSaturation"],function(a){i[a]=e[a];var o=r.get(a);i[a]=null,o!=null&&(n[a]=o)}),n}function _B(r){var e=HT(r,"color");if(e){var t=HT(r,"colorAlpha"),n=HT(r,"colorSaturation");return n&&(e=gp(e,null,null,n)),t&&(e=Ym(e,t)),e}}function JQ(r,e){return e!=null?gp(e,null,null,r):null}function HT(r,e){var t=r[e];if(t!=null&&t!=="none")return t}function QQ(r,e,t,n,i,a){if(!(!a||!a.length)){var o=WT(e,"color")||i.color!=null&&i.color!=="none"&&(WT(e,"colorAlpha")||WT(e,"colorSaturation"));if(o){var s=e.get("visualMin"),l=e.get("visualMax"),u=t.dataExtent.slice();s!=null&&su[1]&&(u[1]=l);var d=e.get("colorMappingBy"),f={type:o.name,dataExtent:u,visual:o.range};f.type==="color"&&(d==="index"||d==="id")?(f.mappingMethod="category",f.loop=!0):f.mappingMethod="linear";var g=new si(f);return mB(g).drColorMappingBy=d,g}}}function WT(r,e){var t=r.get(e);return Ze(t)&&t.length?{name:e,range:t}:null}function eee(r,e,t,n,i,a){var o=Ge({},e);if(i){var s=i.type,l=s==="color"&&mB(i).drColorMappingBy,u=l==="index"?n:l==="id"?a.mapIdToIndex(t.getId()):t.getValue(r.get("visualDimension"));o[s]=i.mapValueToVisual(u)}return o}var Fg=Math.max,s0=Math.min,bB=Gn,qT=Q,xB=["itemStyle","borderWidth"],tee=["itemStyle","gapWidth"],ree=["upperLabel","show"],nee=["upperLabel","height"];const iee={seriesType:"treemap",reset:function(r,e,t,n){var i=t.getWidth(),a=t.getHeight(),o=r.option,s=Xn(r.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),l=o.size||[],u=nt(bB(s.width,l[0]),i),d=nt(bB(s.height,l[1]),a),f=n&&n.type,g=["treemapZoomToNode","treemapRootToNode"],m=Rg(n,g,r),_=f==="treemapRender"||f==="treemapMove"?n.rootRect:null,x=r.getViewRoot(),w=aB(x);if(f!=="treemapMove"){var C=f==="treemapZoomToNode"?cee(r,m,x,u,d):_?[_.width,_.height]:[u,d],A=o.sort;A&&A!=="asc"&&A!=="desc"&&(A="desc");var L={squareRatio:o.squareRatio,sort:A,leafDepth:o.leafDepth};x.hostTree.clearLayouts();var O={x:0,y:0,width:C[0],height:C[1],area:C[0]*C[1]};x.setLayout(O),wB(x,L,!1,0),O=x.getLayout(),qT(w,function(F,$){var H=(w[$+1]||x).getValue();F.setLayout(Ge({dataExtent:[H,H],borderWidth:0,upperHeight:0},O))})}var V=r.getData().tree.root;V.setLayout(hee(s,_,m),!0),r.setLayoutInfo(s),TB(V,new sr(-s.x,-s.y,i,a),w,x,0)}};function wB(r,e,t,n){var i,a;if(!r.isRemoved()){var o=r.getLayout();i=o.width,a=o.height;var s=r.getModel(),l=s.get(xB),u=s.get(tee)/2,d=EB(s),f=Math.max(l,d),g=l-u,m=f-u;r.setLayout({borderWidth:l,upperHeight:f,upperLabelHeight:d},!0),i=Fg(i-2*g,0),a=Fg(a-g-m,0);var _=i*a,x=aee(r,s,_,e,t,n);if(x.length){var w={x:g,y:m,width:i,height:a},C=s0(i,a),A=1/0,L=[];L.area=0;for(var O=0,V=x.length;O=0;l--){var u=i[n==="asc"?o-l-1:l].getValue();u/t*es[1]&&(s[1]=u)})),{sum:n,dataExtent:s}}function uee(r,e,t){for(var n=0,i=1/0,a=0,o=void 0,s=r.length;an&&(n=o));var l=r.area*r.area,u=e*e*t;return l?Fg(u*n/l,l/(u*i)):1/0}function SB(r,e,t,n,i){var a=e===t.width?0:1,o=1-a,s=["x","y"],l=["width","height"],u=t[s[a]],d=e?r.area/e:0;(i||d>t[l[o]])&&(d=t[l[o]]);for(var f=0,g=r.length;f_I&&(u=_I),a=s}un&&(n=e);var a=n%2?n+2:n+3;i=[];for(var o=0;o0&&(V[0]=-V[0],V[1]=-V[1]);var $=O[0]<0?-1:1;if(a.__position!=="start"&&a.__position!=="end"){var H=-Math.atan2(O[1],O[0]);f[0].8?"left":g[0]<-.8?"right":"center",x=g[1]>.8?"top":g[1]<-.8?"bottom":"middle";break;case"start":a.x=-g[0]*C+d[0],a.y=-g[1]*A+d[1],_=g[0]>.8?"right":g[0]<-.8?"left":"center",x=g[1]>.8?"bottom":g[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":a.x=C*$+d[0],a.y=d[1]+Z,_=O[0]<0?"right":"left",a.originX=-C*$,a.originY=-Z;break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":a.x=F[0],a.y=F[1]+Z,_="center",a.originY=-Z;break;case"insideEndTop":case"insideEnd":case"insideEndBottom":a.x=-C*$+f[0],a.y=f[1]+Z,_=O[0]>=0?"right":"left",a.originX=C*$,a.originY=-Z;break}a.scaleX=a.scaleY=o,a.setStyle({verticalAlign:a.__verticalAlign||x,align:a.__align||_})}},e}(qt),iE=function(){function r(e){this.group=new qt,this._LineCtor=e||nE}return r.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,i=n.group,a=n._lineData;n._lineData=e,a||i.removeAll();var o=OB(e);e.diff(a).add(function(s){t._doAdd(e,s,o)}).update(function(s,l){t._doUpdate(a,e,l,s,o)}).remove(function(s){i.remove(a.getItemGraphicEl(s))}).execute()},r.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},r.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=OB(e),this._lineData=null,this.group.removeAll()},r.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function n(s){!s.isGroup&&!Mee(s)&&(s.incremental=!0,s.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i0}function OB(r){var e=r.hostModel,t=e.getModel("emphasis");return{lineStyle:e.getModel("lineStyle").getLineStyle(),emphasisLineStyle:t.getModel(["lineStyle"]).getLineStyle(),blurLineStyle:e.getModel(["blur","lineStyle"]).getLineStyle(),selectLineStyle:e.getModel(["select","lineStyle"]).getLineStyle(),emphasisDisabled:t.get("disabled"),blurScope:t.get("blurScope"),focus:t.get("focus"),labelStatesModels:ni(e)}}function zB(r){return isNaN(r[0])||isNaN(r[1])}function aE(r){return r&&!zB(r[0])&&!zB(r[1])}var oE=[],sE=[],lE=[],$d=hi,uE=Xu,BB=Math.abs;function VB(r,e,t){for(var n=r[0],i=r[1],a=r[2],o=1/0,s,l=t*t,u=.1,d=.1;d<=.9;d+=.1){oE[0]=$d(n[0],i[0],a[0],d),oE[1]=$d(n[1],i[1],a[1],d);var f=BB(uE(oE,e)-l);f=0?s=s+u:s=s-u:_>=0?s=s-u:s=s+u}return s}function cE(r,e){var t=[],n=dp,i=[[],[],[]],a=[[],[]],o=[];e/=2,r.eachEdge(function(s,l){var u=s.getLayout(),d=s.getVisual("fromSymbol"),f=s.getVisual("toSymbol");u.__original||(u.__original=[Ns(u[0]),Ns(u[1])],u[2]&&u.__original.push(Ns(u[2])));var g=u.__original;if(u[2]!=null){if(Xi(i[0],g[0]),Xi(i[1],g[2]),Xi(i[2],g[1]),d&&d!=="none"){var m=Ug(s.node1),_=VB(i,g[0],m*e);n(i[0][0],i[1][0],i[2][0],_,t),i[0][0]=t[3],i[1][0]=t[4],n(i[0][1],i[1][1],i[2][1],_,t),i[0][1]=t[3],i[1][1]=t[4]}if(f&&f!=="none"){var m=Ug(s.node2),_=VB(i,g[1],m*e);n(i[0][0],i[1][0],i[2][0],_,t),i[1][0]=t[1],i[2][0]=t[2],n(i[0][1],i[1][1],i[2][1],_,t),i[1][1]=t[1],i[2][1]=t[2]}Xi(u[0],i[0]),Xi(u[1],i[2]),Xi(u[2],i[1])}else{if(Xi(a[0],g[0]),Xi(a[1],g[1]),ju(o,a[1],a[0]),Gh(o,o),d&&d!=="none"){var m=Ug(s.node1);Ax(a[0],a[0],o,m*e)}if(f&&f!=="none"){var m=Ug(s.node2);Ax(a[1],a[1],o,-m*e)}Xi(u[0],a[0]),Xi(u[1],a[1])}})}function FB(r){return r.type==="view"}var Iee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){var i=new wg,a=new iE,o=this.group;this._controller=new Ig(n.getZr()),this._controllerHost={target:o},o.add(i.group),o.add(a.group),this._symbolDraw=i,this._lineDraw=a,this._firstRender=!0},e.prototype.render=function(t,n,i){var a=this,o=t.coordinateSystem;this._model=t;var s=this._symbolDraw,l=this._lineDraw,u=this.group;if(FB(o)){var d={x:o.x,y:o.y,scaleX:o.scaleX,scaleY:o.scaleY};this._firstRender?u.attr(d):Or(u,d,t)}cE(t.getGraph(),Gg(t));var f=t.getData();s.updateData(f);var g=t.getEdgeData();l.updateData(g),this._updateNodeAndLinkScale(),this._updateController(t,n,i),clearTimeout(this._layoutTimeout);var m=t.forceLayout,_=t.get(["force","layoutAnimation"]);m&&this._startForceLayoutIteration(m,_);var x=t.get("layout");f.graph.eachNode(function(L){var O=L.dataIndex,V=L.getGraphicEl(),F=L.getModel();if(V){V.off("drag").off("dragend");var $=F.get("draggable");$&&V.on("drag",function(Z){switch(x){case"force":m.warmUp(),!a._layouting&&a._startForceLayoutIteration(m,_),m.setFixed(O),f.setItemLayout(O,[V.x,V.y]);break;case"circular":f.setItemLayout(O,[V.x,V.y]),L.setLayout({fixed:!0},!0),JT(t,"symbolSize",L,[Z.offsetX,Z.offsetY]),a.updateLayout(t);break;case"none":default:f.setItemLayout(O,[V.x,V.y]),YT(t.getGraph(),t),a.updateLayout(t);break}}).on("dragend",function(){m&&m.setUnfixed(O)}),V.setDraggable($,!!F.get("cursor"));var H=F.get(["emphasis","focus"]);H==="adjacency"&&(jt(V).focus=L.getAdjacentDataIndices())}}),f.graph.eachEdge(function(L){var O=L.getGraphicEl(),V=L.getModel().get(["emphasis","focus"]);O&&V==="adjacency"&&(jt(O).focus={edge:[L.dataIndex],node:[L.node1.dataIndex,L.node2.dataIndex]})});var w=t.get("layout")==="circular"&&t.get(["circular","rotateLabel"]),C=f.getLayout("cx"),A=f.getLayout("cy");f.graph.eachNode(function(L){IB(L,w,C,A)}),this._firstRender=!1},e.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},e.prototype._startForceLayoutIteration=function(t,n){var i=this;(function a(){t.step(function(o){i.updateLayout(i._model),(i._layouting=!o)&&(n?i._layoutTimeout=setTimeout(a,16):a())})})()},e.prototype._updateController=function(t,n,i){var a=this,o=this._controller,s=this._controllerHost,l=this.group;if(o.setPointerChecker(function(u,d,f){var g=l.getBoundingRect();return g.applyTransform(l.transform),g.contain(d,f)&&!K_(u,i,t)}),!FB(t.coordinateSystem)){o.disable();return}o.enable(t.get("roam")),s.zoomLimit=t.get("scaleLimit"),s.zoom=t.coordinateSystem.getZoom(),o.off("pan").off("zoom").on("pan",function(u){TT(s,u.dx,u.dy),i.dispatchAction({seriesId:t.id,type:"graphRoam",dx:u.dx,dy:u.dy})}).on("zoom",function(u){ET(s,u.scale,u.originX,u.originY),i.dispatchAction({seriesId:t.id,type:"graphRoam",zoom:u.scale,originX:u.originX,originY:u.originY}),a._updateNodeAndLinkScale(),cE(t.getGraph(),Gg(t)),a._lineDraw.updateLayout(),i.updateLabelLayout()})},e.prototype._updateNodeAndLinkScale=function(){var t=this._model,n=t.getData(),i=Gg(t);n.eachItemGraphicEl(function(a,o){a&&a.setSymbolScale(i)})},e.prototype.updateLayout=function(t){cE(t.getGraph(),Gg(t)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},e.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},e.type="graph",e}(Jr),kee={};function Gd(r){return"_EC_"+r}var Lee=function(){function r(e){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return r.prototype.isDirected=function(){return this._directed},r.prototype.addNode=function(e,t){e=e==null?""+t:""+e;var n=this._nodesMap;if(n[Gd(e)]){kee.NODE_ENV!=="production"&&console.error("Graph nodes have duplicate name or id");return}var i=new Jc(e,t);return i.hostGraph=this,this.nodes.push(i),n[Gd(e)]=i,i},r.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},r.prototype.getNodeById=function(e){return this._nodesMap[Gd(e)]},r.prototype.addEdge=function(e,t,n){var i=this._nodesMap,a=this._edgesMap;if(Lr(e)&&(e=this.nodes[e]),Lr(t)&&(t=this.nodes[t]),e instanceof Jc||(e=i[Gd(e)]),t instanceof Jc||(t=i[Gd(t)]),!(!e||!t)){var o=e.id+"-"+t.id,s=new $B(e,t,n);return s.hostGraph=this,this._directed&&(e.outEdges.push(s),t.inEdges.push(s)),e.edges.push(s),e!==t&&t.edges.push(s),this.edges.push(s),a[o]=s,s}},r.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},r.prototype.getEdge=function(e,t){e instanceof Jc&&(e=e.id),t instanceof Jc&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+"-"+t]:n[e+"-"+t]||n[t+"-"+e]},r.prototype.eachNode=function(e,t){for(var n=this.nodes,i=n.length,a=0;a=0&&e.call(t,n[a],a)},r.prototype.eachEdge=function(e,t){for(var n=this.edges,i=n.length,a=0;a=0&&n[a].node1.dataIndex>=0&&n[a].node2.dataIndex>=0&&e.call(t,n[a],a)},r.prototype.breadthFirstTraverse=function(e,t,n,i){if(t instanceof Jc||(t=this._nodesMap[Gd(t)]),!!t){for(var a=n==="out"?"outEdges":n==="in"?"inEdges":"edges",o=0;o=0&&l.node2.dataIndex>=0});for(var a=0,o=i.length;a=0&&this[r][e].setItemVisual(this.dataIndex,t,n)},getVisual:function(t){return this[r][e].getItemVisual(this.dataIndex,t)},setLayout:function(t,n){this.dataIndex>=0&&this[r][e].setItemLayout(this.dataIndex,t,n)},getLayout:function(){return this[r][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[r][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[r][e].getRawIndex(this.dataIndex)}}}$n(Jc,GB("hostGraph","data")),$n($B,GB("hostGraph","edgeData"));function UB(r,e,t,n,i){for(var a=new Lee(n),o=0;o "+g)),u++)}var m=t.get("coordinateSystem"),_;if(m==="cartesian2d"||m==="polar")_=Ks(r,t);else{var x=bd.get(m),w=x?x.dimensions||[]:[];hr(w,"value")<0&&w.concat(["value"]);var C=fg(r,{coordDimensions:w,encodeDefine:t.getEncode()}).dimensions;_=new na(C,t),_.initData(r)}var A=new na(["value"],t);return A.initData(l,s),i&&i(_,A),nB({mainData:_,struct:a,structAttr:"graph",datas:{node:_,edge:A},datasAttr:{node:"data",edge:"edgeData"}}),a.update(),a}var Pee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments);var n=this;function i(){return n._categoriesData}this.legendVisualProvider=new Ag(i,i),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},e.prototype.mergeDefaultAndTheme=function(t){r.prototype.mergeDefaultAndTheme.apply(this,arguments),ic(t,"edgeLabel",["show"])},e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=this;if(a&&i){yee(this);var s=UB(a,i,this,!0,l);return Q(s.edges,function(u){_ee(u.node1,u.node2,this,u.dataIndex)},this),s.data}function l(u,d){u.wrapMethod("getItemModel",function(_){var x=o._categoriesModels,w=_.getShallow("category"),C=x[w];return C&&(C.parentModel=_.parentModel,_.parentModel=C),_});var f=qr.prototype.getModel;function g(_,x){var w=f.call(this,_,x);return w.resolveParentPath=m,w}d.wrapMethod("getItemModel",function(_){return _.resolveParentPath=m,_.getModel=g,_});function m(_){if(_&&(_[0]==="label"||_[1]==="label")){var x=_.slice();return _[0]==="label"?x[0]="edgeLabel":_[1]==="label"&&(x[1]="edgeLabel"),x}return _}}},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.getCategoriesData=function(){return this._categoriesData},e.prototype.formatTooltip=function(t,n,i){if(i==="edge"){var a=this.getData(),o=this.getDataParams(t,i),s=a.graph.getEdgeByIndex(t),l=a.getName(s.node1.dataIndex),u=a.getName(s.node2.dataIndex),d=[];return l!=null&&d.push(l),u!=null&&d.push(u),ii("nameValue",{name:d.join(" > "),value:o.value,noValue:o.value==null})}var f=AP({series:this,dataIndex:t,multipleSeries:n});return f},e.prototype._updateCategoriesData=function(){var t=je(this.option.categories||[],function(i){return i.value!=null?i:Ge({value:0},i)}),n=new na(["value"],this);n.initData(t),this._categoriesData=n,this._categoriesModels=n.mapArray(function(i){return n.getItemModel(i)})},e.prototype.setZoom=function(t){this.option.zoom=t},e.prototype.setCenter=function(t){this.option.center=t},e.prototype.isAnimationEnabled=function(){return r.prototype.isAnimationEnabled.call(this)&&!(this.get("layout")==="force"&&this.get(["force","layoutAnimation"]))},e.type="series.graph",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={z:2,coordinateSystem:"view",legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(on),Ree={type:"graphRoam",event:"graphRoam",update:"none"};function Nee(r){r.registerChartView(Iee),r.registerSeriesModel(Pee),r.registerProcessor(fee),r.registerVisual(pee),r.registerVisual(gee),r.registerLayout(bee),r.registerLayout(r.PRIORITY.VISUAL.POST_CHART_LAYOUT,wee),r.registerLayout(Tee),r.registerCoordinateSystem("graphView",{dimensions:Lg.dimensions,create:Cee}),r.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},On),r.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},On),r.registerAction(Ree,function(e,t,n){t.eachComponent({mainType:"series",query:e},function(i){var a=i.coordinateSystem,o=LT(a,e,void 0,n);i.setCenter&&i.setCenter(o.center),i.setZoom&&i.setZoom(o.zoom)})})}var Oee=function(){function r(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return r}(),zee=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="pointer",n}return e.prototype.getDefaultShape=function(){return new Oee},e.prototype.buildPath=function(t,n){var i=Math.cos,a=Math.sin,o=n.r,s=n.width,l=n.angle,u=n.x-i(l)*s*(s>=o/3?1:2),d=n.y-a(l)*s*(s>=o/3?1:2);l=n.angle-Math.PI/2,t.moveTo(u,d),t.lineTo(n.x+i(l)*s,n.y+a(l)*s),t.lineTo(n.x+i(n.angle)*o,n.y+a(n.angle)*o),t.lineTo(n.x-i(l)*s,n.y-a(l)*s),t.lineTo(u,d)},e}(vr);function Bee(r,e){var t=r.get("center"),n=e.getWidth(),i=e.getHeight(),a=Math.min(n,i),o=nt(t[0],e.getWidth()),s=nt(t[1],e.getHeight()),l=nt(r.get("radius"),a/2);return{cx:o,cy:s,r:l}}function c0(r,e){var t=r==null?"":r+"";return e&&(ut(e)?t=e.replace("{value}",t):It(e)&&(t=e(r))),t}var Vee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeAll();var a=t.get(["axisLine","lineStyle","color"]),o=Bee(t,i);this._renderMain(t,n,i,a,o),this._data=t.getData()},e.prototype.dispose=function(){},e.prototype._renderMain=function(t,n,i,a,o){var s=this.group,l=t.get("clockwise"),u=-t.get("startAngle")/180*Math.PI,d=-t.get("endAngle")/180*Math.PI,f=t.getModel("axisLine"),g=f.get("roundCap"),m=g?H_:ea,_=f.get("show"),x=f.getModel("lineStyle"),w=x.get("width"),C=[u,d];qw(C,!l),u=C[0],d=C[1];for(var A=d-u,L=u,O=[],V=0;_&&V=Z&&(j===0?0:a[j-1][0])Math.PI/2&&(et+=Math.PI)):ot==="tangential"?et=-H-Math.PI/2:Lr(ot)&&(et=ot*Math.PI/180),et===0?f.add(new Dr({style:an(L,{text:Me,x:Fe,y:Xe,verticalAlign:fe<-.8?"top":fe>.8?"bottom":"middle",align:ue<-.4?"left":ue>.4?"right":"center"},{inheritColor:Ve}),silent:!0})):f.add(new Dr({style:an(L,{text:Me,x:Fe,y:Xe,verticalAlign:"middle",align:"center"},{inheritColor:Ve}),silent:!0,originX:Fe,originY:Xe,rotation:et}))}if(A.get("show")&&le!==O){var ge=A.get("distance");ge=ge?ge+d:d;for(var it=0;it<=V;it++){ue=Math.cos(H),fe=Math.sin(H);var kt=new ri({shape:{x1:ue*(_-ge)+g,y1:fe*(_-ge)+m,x2:ue*(_-$-ge)+g,y2:fe*(_-$-ge)+m},silent:!0,style:se});se.stroke==="auto"&&kt.setStyle({stroke:a((le+it/V)/O)}),f.add(kt),H+=j}H-=j}else H+=Z}},e.prototype._renderPointer=function(t,n,i,a,o,s,l,u,d){var f=this.group,g=this._data,m=this._progressEls,_=[],x=t.get(["pointer","show"]),w=t.getModel("progress"),C=w.get("show"),A=t.getData(),L=A.mapDimension("value"),O=+t.get("min"),V=+t.get("max"),F=[O,V],$=[s,l];function H(j,Y){var se=A.getItemModel(j),ae=se.getModel("pointer"),ue=nt(ae.get("width"),o.r),fe=nt(ae.get("length"),o.r),le=t.get(["pointer","icon"]),ge=ae.get("offsetCenter"),xe=nt(ge[0],o.r),Me=nt(ge[1],o.r),Ve=ae.get("keepAspect"),Fe;return le?Fe=qn(le,xe-ue/2,Me-fe,ue,fe,null,Ve):Fe=new zee({shape:{angle:-Math.PI/2,width:ue,r:fe,x:xe,y:Me}}),Fe.rotation=-(Y+Math.PI/2),Fe.x=o.cx,Fe.y=o.cy,Fe}function Z(j,Y){var se=w.get("roundCap"),ae=se?H_:ea,ue=w.get("overlap"),fe=ue?w.get("width"):d/A.count(),le=ue?o.r-fe:o.r-(j+1)*fe,ge=ue?o.r:o.r-j*fe,xe=new ae({shape:{startAngle:s,endAngle:Y,cx:o.cx,cy:o.cy,clockwise:u,r0:le,r:ge}});return ue&&(xe.z2=Wr(A.get(L,j),[O,V],[100,0],!0)),xe}(C||x)&&(A.diff(g).add(function(j){var Y=A.get(L,j);if(x){var se=H(j,s);yn(se,{rotation:-((isNaN(+Y)?$[0]:Wr(Y,F,$,!0))+Math.PI/2)},t),f.add(se),A.setItemGraphicEl(j,se)}if(C){var ae=Z(j,s),ue=w.get("clip");yn(ae,{shape:{endAngle:Wr(Y,F,$,ue)}},t),f.add(ae),Xw(t.seriesIndex,A.dataType,j,ae),_[j]=ae}}).update(function(j,Y){var se=A.get(L,j);if(x){var ae=g.getItemGraphicEl(Y),ue=ae?ae.rotation:s,fe=H(j,ue);fe.rotation=ue,Or(fe,{rotation:-((isNaN(+se)?$[0]:Wr(se,F,$,!0))+Math.PI/2)},t),f.add(fe),A.setItemGraphicEl(j,fe)}if(C){var le=m[Y],ge=le?le.shape.endAngle:s,xe=Z(j,ge),Me=w.get("clip");Or(xe,{shape:{endAngle:Wr(se,F,$,Me)}},t),f.add(xe),Xw(t.seriesIndex,A.dataType,j,xe),_[j]=xe}}).execute(),A.each(function(j){var Y=A.getItemModel(j),se=Y.getModel("emphasis"),ae=se.get("focus"),ue=se.get("blurScope"),fe=se.get("disabled");if(x){var le=A.getItemGraphicEl(j),ge=A.getItemVisual(j,"style"),xe=ge.fill;if(le instanceof di){var Me=le.style;le.useStyle(Ge({image:Me.image,x:Me.x,y:Me.y,width:Me.width,height:Me.height},ge))}else le.useStyle(ge),le.type!=="pointer"&&le.setColor(xe);le.setStyle(Y.getModel(["pointer","itemStyle"]).getItemStyle()),le.style.fill==="auto"&&le.setStyle("fill",a(Wr(A.get(L,j),F,[0,1],!0))),le.z2EmphasisLift=0,Ei(le,Y),Sn(le,ae,ue,fe)}if(C){var Ve=_[j];Ve.useStyle(A.getItemVisual(j,"style")),Ve.setStyle(Y.getModel(["progress","itemStyle"]).getItemStyle()),Ve.z2EmphasisLift=0,Ei(Ve,Y),Sn(Ve,ae,ue,fe)}}),this._progressEls=_)},e.prototype._renderAnchor=function(t,n){var i=t.getModel("anchor"),a=i.get("show");if(a){var o=i.get("size"),s=i.get("icon"),l=i.get("offsetCenter"),u=i.get("keepAspect"),d=qn(s,n.cx-o/2+nt(l[0],n.r),n.cy-o/2+nt(l[1],n.r),o,o,null,u);d.z2=i.get("showAbove")?1:0,d.setStyle(i.getModel("itemStyle").getItemStyle()),this.group.add(d)}},e.prototype._renderTitleAndDetail=function(t,n,i,a,o){var s=this,l=t.getData(),u=l.mapDimension("value"),d=+t.get("min"),f=+t.get("max"),g=new qt,m=[],_=[],x=t.isAnimationEnabled(),w=t.get(["pointer","showAbove"]);l.diff(this._data).add(function(C){m[C]=new Dr({silent:!0}),_[C]=new Dr({silent:!0})}).update(function(C,A){m[C]=s._titleEls[A],_[C]=s._detailEls[A]}).execute(),l.each(function(C){var A=l.getItemModel(C),L=l.get(u,C),O=new qt,V=a(Wr(L,[d,f],[0,1],!0)),F=A.getModel("title");if(F.get("show")){var $=F.get("offsetCenter"),H=o.cx+nt($[0],o.r),Z=o.cy+nt($[1],o.r),j=m[C];j.attr({z2:w?0:2,style:an(F,{x:H,y:Z,text:l.getName(C),align:"center",verticalAlign:"middle"},{inheritColor:V})}),O.add(j)}var Y=A.getModel("detail");if(Y.get("show")){var se=Y.get("offsetCenter"),ae=o.cx+nt(se[0],o.r),ue=o.cy+nt(se[1],o.r),fe=nt(Y.get("width"),o.r),le=nt(Y.get("height"),o.r),ge=t.get(["progress","show"])?l.getItemVisual(C,"style").fill:V,j=_[C],xe=Y.get("formatter");j.attr({z2:w?0:2,style:an(Y,{x:ae,y:ue,text:c0(L,xe),width:isNaN(fe)?null:fe,height:isNaN(le)?null:le,align:"center",verticalAlign:"middle"},{inheritColor:ge})}),rL(j,{normal:Y},L,function(Ve){return c0(Ve,xe)}),x&&nL(j,C,l,t,{getFormattedLabel:function(Ve,Fe,Xe,ot,et,it){return c0(it?it.interpolatedValue:L,xe)}}),O.add(j)}g.add(O)}),this.group.add(g),this._titleEls=m,this._detailEls=_},e.type="gauge",e}(Jr),Fee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="itemStyle",t}return e.prototype.getInitialData=function(t,n){return zd(this,["value"])},e.type="series.gauge",e.defaultOption={z:2,colorBy:"data",center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,"#E6EBF8"]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:"#63677A",width:3,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:"#63677A",width:1,type:"solid"}},axisLabel:{show:!0,distance:15,color:"#464646",fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:"60%",width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:"circle",offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:"#fff",borderWidth:0,borderColor:"#5470c6"}},title:{show:!0,offsetCenter:[0,"20%"],color:"#464646",fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"#464646",fontSize:30,fontWeight:"bold",lineHeight:30,valueAnimation:!1}},e}(on);function $ee(r){r.registerChartView(Vee),r.registerSeriesModel(Fee)}var Gee=["itemStyle","opacity"],Uee=function(r){ze(e,r);function e(t,n){var i=r.call(this)||this,a=i,o=new ra,s=new Dr;return a.setTextContent(s),i.setTextGuideLine(o),i.updateData(t,n,!0),i}return e.prototype.updateData=function(t,n,i){var a=this,o=t.hostModel,s=t.getItemModel(n),l=t.getItemLayout(n),u=s.getModel("emphasis"),d=s.get(Gee);d=d??1,i||Go(a),a.useStyle(t.getItemVisual(n,"style")),a.style.lineJoin="round",i?(a.setShape({points:l.points}),a.style.opacity=0,yn(a,{style:{opacity:d}},o,n)):Or(a,{style:{opacity:d},shape:{points:l.points}},o,n),Ei(a,s),this._updateLabel(t,n),Sn(this,u.get("focus"),u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t,n){var i=this,a=this.getTextGuideLine(),o=i.getTextContent(),s=t.hostModel,l=t.getItemModel(n),u=t.getItemLayout(n),d=u.label,f=t.getItemVisual(n,"style"),g=f.fill;Ci(o,ni(l),{labelFetcher:t.hostModel,labelDataIndex:n,defaultOpacity:f.opacity,defaultText:t.getName(n)},{normal:{align:d.textAlign,verticalAlign:d.verticalAlign}}),i.setTextConfig({local:!0,inside:!!d.inside,insideStroke:g,outsideFill:g});var m=d.linePoints;a.setShape({points:m}),i.textGuideLineConfig={anchor:m?new ir(m[0][0],m[0][1]):null},Or(o,{style:{x:d.x,y:d.y}},s,n),o.attr({rotation:d.rotation,originX:d.x,originY:d.y,z2:10}),$S(i,GS(l),{stroke:g})},e}(ta),Hee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreLabelLineUpdate=!0,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this._data,s=this.group;a.diff(o).add(function(l){var u=new Uee(a,l);a.setItemGraphicEl(l,u),s.add(u)}).update(function(l,u){var d=o.getItemGraphicEl(u);d.updateData(a,l),s.add(d),a.setItemGraphicEl(l,d)}).remove(function(l){var u=o.getItemGraphicEl(l);Vp(u,t,l)}).execute(),this._data=a},e.prototype.remove=function(){this.group.removeAll(),this._data=null},e.prototype.dispose=function(){},e.type="funnel",e}(Jr),Wee=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ag(pt(this.getData,this),pt(this.getRawData,this)),this._defaultLabelLine(t)},e.prototype.getInitialData=function(t,n){return zd(this,{coordDimensions:["value"],encodeDefaulter:er(I1,this)})},e.prototype._defaultLabelLine=function(t){ic(t,"labelLine",["show"]);var n=t.labelLine,i=t.emphasis.labelLine;n.show=n.show&&t.label.show,i.show=i.show&&t.emphasis.label.show},e.prototype.getDataParams=function(t){var n=this.getData(),i=r.prototype.getDataParams.call(this,t),a=n.mapDimension("value"),o=n.getSum(a);return i.percent=o?+(n.get(a,t)/o*100).toFixed(2):0,i.$vars.push("percent"),i},e.type="series.funnel",e.defaultOption={z:2,legendHoverLink:!0,colorBy:"data",left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",orient:"vertical",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:"#212121"}}},e}(on),qee={};function Zee(r,e){return Xn(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function jee(r,e){for(var t=r.mapDimension("value"),n=r.mapArray(t,function(l){return l}),i=[],a=e==="ascending",o=0,s=r.count();o-1&&(o="left",console.warn("Position error: Funnel chart on vertical orient dose not support top and bottom.")),t==="horizontal"&&["left","right"].indexOf(o)>-1&&(o="bottom",console.warn("Position error: Funnel chart on horizontal orient dose not support left and right."))),o==="left"?(x=(u[3][0]+u[0][0])/2,w=(u[3][1]+u[0][1])/2,C=x-L,g=C-5,f="right"):o==="right"?(x=(u[1][0]+u[2][0])/2,w=(u[1][1]+u[2][1])/2,C=x+L,g=C+5,f="left"):o==="top"?(x=(u[3][0]+u[0][0])/2,w=(u[3][1]+u[0][1])/2,A=w-L,m=A-5,f="center"):o==="bottom"?(x=(u[1][0]+u[2][0])/2,w=(u[1][1]+u[2][1])/2,A=w+L,m=A+5,f="center"):o==="rightTop"?(x=t==="horizontal"?u[3][0]:u[1][0],w=t==="horizontal"?u[3][1]:u[1][1],t==="horizontal"?(A=w-L,m=A-5,f="center"):(C=x+L,g=C+5,f="top")):o==="rightBottom"?(x=u[2][0],w=u[2][1],t==="horizontal"?(A=w+L,m=A+5,f="center"):(C=x+L,g=C+5,f="bottom")):o==="leftTop"?(x=u[0][0],w=t==="horizontal"?u[0][1]:u[1][1],t==="horizontal"?(A=w-L,m=A-5,f="center"):(C=x-L,g=C-5,f="right")):o==="leftBottom"?(x=t==="horizontal"?u[1][0]:u[3][0],w=t==="horizontal"?u[1][1]:u[2][1],t==="horizontal"?(A=w+L,m=A+5,f="center"):(C=x-L,g=C-5,f="right")):(x=(u[1][0]+u[2][0])/2,w=(u[1][1]+u[2][1])/2,t==="horizontal"?(A=w+L,m=A+5,f="center"):(C=x+L,g=C+5,f="left")),t==="horizontal"?(C=x,g=C):(A=w,m=A),_=[[x,w],[C,A]]}l.label={linePoints:_,x:g,y:m,verticalAlign:"middle",textAlign:f,inside:d}})}function Yee(r,e){r.eachSeriesByType("funnel",function(t){var n=t.getData(),i=n.mapDimension("value"),a=t.get("sort"),o=Zee(t,e),s=t.get("orient"),l=o.width,u=o.height,d=jee(n,a),f=o.x,g=o.y,m=s==="horizontal"?[nt(t.get("minSize"),u),nt(t.get("maxSize"),u)]:[nt(t.get("minSize"),l),nt(t.get("maxSize"),l)],_=n.getDataExtent(i),x=t.get("min"),w=t.get("max");x==null&&(x=Math.min(_[0],0)),w==null&&(w=_[1]);var C=t.get("funnelAlign"),A=t.get("gap"),L=s==="horizontal"?l:u,O=(L-A*(n.count()-1))/n.count(),V=function(ue,fe){if(s==="horizontal"){var le=n.get(i,ue)||0,ge=Wr(le,[x,w],m,!0),xe=void 0;switch(C){case"top":xe=g;break;case"center":xe=g+(u-ge)/2;break;case"bottom":xe=g+(u-ge);break}return[[fe,xe],[fe,xe+ge]]}var Me=n.get(i,ue)||0,Ve=Wr(Me,[x,w],m,!0),Fe;switch(C){case"left":Fe=f;break;case"center":Fe=f+(l-Ve)/2;break;case"right":Fe=f+l-Ve;break}return[[Fe,fe],[Fe+Ve,fe]]};a==="ascending"&&(O=-O,A=-A,s==="horizontal"?f+=l:g+=u,d=d.reverse());for(var F=0;Fcte)return;var i=this._model.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]);i.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:i.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(r){if(!(this._mouseDownPoint||!dE(this,"mousemove"))){var e=this._model,t=e.coordinateSystem.getSlidedAxisExpandWindow([r.offsetX,r.offsetY]),n=t.behavior;n==="jump"&&this._throttledDispatchExpand.debounceNextCall(e.get("axisExpandDebounce")),this._throttledDispatchExpand(n==="none"?null:{axisExpandWindow:t.axisExpandWindow,animation:n==="jump"?null:{duration:0}})}}};function dE(r,e){var t=r._model;return t.get("axisExpandable")&&t.get("axisExpandTriggerOn")===e}var fte=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){r.prototype.init.apply(this,arguments),this.mergeOption({})},e.prototype.mergeOption=function(t){var n=this.option;t&&rr(n,t,!0),this._initDimensions()},e.prototype.contains=function(t,n){var i=t.get("parallelIndex");return i!=null&&n.getComponent("parallel",i)===this},e.prototype.setAxisExpand=function(t){Q(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(n){t.hasOwnProperty(n)&&(this.option[n]=t[n])},this)},e.prototype._initDimensions=function(){var t=this.dimensions=[],n=this.parallelAxisIndex=[],i=$r(this.ecModel.queryComponents({mainType:"parallelAxis"}),function(a){return(a.get("parallelIndex")||0)===this.componentIndex},this);Q(i,function(a){t.push("dim"+a.get("dim")),n.push(a.componentIndex)})},e.type="parallel",e.dependencies=["parallelAxis"],e.layoutMode="box",e.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},e}(mr),pte=function(r){ze(e,r);function e(t,n,i,a,o){var s=r.call(this,t,n,i)||this;return s.type=a||"value",s.axisIndex=o,s}return e.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"},e}(jo);function Qc(r,e,t,n,i,a){r=r||0;var o=t[1]-t[0];if(i!=null&&(i=Ud(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=Ud(s,[0,o]),i=a=Ud(s,[i,a]),n=0}e[0]=Ud(e[0],t),e[1]=Ud(e[1],t);var l=fE(e,n);e[n]+=r;var u=i||0,d=t.slice();l.sign<0?d[0]+=u:d[1]-=u,e[n]=Ud(e[n],d);var f;return f=fE(e,n),i!=null&&(f.sign!==l.sign||f.spana&&(e[1-n]=e[n]+f.sign*a),e}function fE(r,e){var t=r[e]-r[1-e];return{span:Math.abs(t),sign:t>0?-1:t<0?1:e?-1:1}}function Ud(r,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,r))}var pE=Q,ZB=Math.min,jB=Math.max,XB=Math.floor,gte=Math.ceil,YB=Ln,vte=Math.PI,mte=function(){function r(e,t,n){this.type="parallel",this._axesMap=Tt(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return r.prototype._init=function(e,t,n){var i=e.dimensions,a=e.parallelAxisIndex;pE(i,function(o,s){var l=a[s],u=t.getComponent("parallelAxis",l),d=this._axesMap.set(o,new pte(o,N_(u),[0,0],u.get("type"),l)),f=d.type==="category";d.onBand=f&&u.get("boundaryGap"),d.inverse=u.get("inverse"),u.axis=d,d.model=u,d.coordinateSystem=u.coordinateSystem=this},this)},r.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},r.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,i=t.layoutBase,a=t.pixelDimIndex,o=e[1-a],s=e[a];return o>=n&&o<=n+t.axisLength&&s>=i&&s<=i+t.layoutLength},r.prototype.getModel=function(){return this._model},r.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(n){if(e.contains(n,t)){var i=n.getData();pE(this.dimensions,function(a){var o=this._axesMap.get(a);o.scale.unionExtentFromData(i,i.mapDimension(a)),Pd(o.scale,o.model)},this)}},this)},r.prototype.resize=function(e,t){this._rect=Xn(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},r.prototype.getRect=function(){return this._rect},r.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,n=["x","y"],i=["width","height"],a=e.get("layout"),o=a==="horizontal"?0:1,s=t[i[o]],l=[0,s],u=this.dimensions.length,d=h0(e.get("axisExpandWidth"),l),f=h0(e.get("axisExpandCount")||0,[0,u]),g=e.get("axisExpandable")&&u>3&&u>f&&f>1&&d>0&&s>0,m=e.get("axisExpandWindow"),_;if(m)_=h0(m[1]-m[0],l),m[1]=m[0]+_;else{_=h0(d*(f-1),l);var x=e.get("axisExpandCenter")||XB(u/2);m=[d*x-_/2],m[1]=m[0]+_}var w=(s-_)/(u-f);w<3&&(w=0);var C=[XB(YB(m[0]/d,1))+1,gte(YB(m[1]/d,1))-1],A=w/d*m[0];return{layout:a,pixelDimIndex:o,layoutBase:t[n[o]],layoutLength:s,axisBase:t[n[1-o]],axisLength:t[i[1-o]],axisExpandable:g,axisExpandWidth:d,axisCollapseWidth:w,axisExpandWindow:m,axisCount:u,winInnerIndices:C,axisExpandWindow0Pos:A}},r.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,i=this._makeLayoutInfo(),a=i.layout;t.each(function(o){var s=[0,i.axisLength],l=o.inverse?1:0;o.setExtent(s[l],s[1-l])}),pE(n,function(o,s){var l=(i.axisExpandable?_te:yte)(s,i),u={horizontal:{x:l.position,y:i.axisLength},vertical:{x:0,y:l.position}},d={horizontal:vte/2,vertical:0},f=[u[a].x+e.x,u[a].y+e.y],g=d[a],m=za();Yu(m,m,g),as(m,m,f),this._axesLayout[o]={position:f,rotation:g,transform:m,axisNameAvailableWidth:l.axisNameAvailableWidth,axisLabelShow:l.axisLabelShow,nameTruncateMaxWidth:l.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},r.prototype.getAxis=function(e){return this._axesMap.get(e)},r.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},r.prototype.eachActiveState=function(e,t,n,i){n==null&&(n=0),i==null&&(i=e.count());var a=this._axesMap,o=this.dimensions,s=[],l=[];Q(o,function(w){s.push(e.mapDimension(w)),l.push(a.get(w).model)});for(var u=this.hasAxisBrushed(),d=n;da*(1-f[0])?(u="jump",l=s-a*(1-f[2])):(l=s-a*f[1])>=0&&(l=s-a*(1-f[1]))<=0&&(l=0),l*=t.axisExpandWidth/d,l?Qc(l,i,o,"all"):u="none";else{var m=i[1]-i[0],_=o[1]*s/m;i=[jB(0,_-m/2)],i[1]=ZB(o[1],i[0]+m),i[0]=i[1]-m}return{axisExpandWindow:i,behavior:u}},r}();function h0(r,e){return ZB(jB(r,e[0]),e[1])}function yte(r,e){var t=e.layoutLength/(e.axisCount-1);return{position:t*r,axisNameAvailableWidth:t,axisLabelShow:!0}}function _te(r,e){var t=e.layoutLength,n=e.axisExpandWidth,i=e.axisCount,a=e.axisCollapseWidth,o=e.winInnerIndices,s,l=a,u=!1,d;return r=0;i--)lo(n[i])},e.prototype.getActiveState=function(t){var n=this.activeIntervals;if(!n.length)return"normal";if(t==null||isNaN(+t))return"inactive";if(n.length===1){var i=n[0];if(i[0]<=t&&t<=i[1])return"active"}else for(var a=0,o=n.length;aTte}function iV(r){var e=r.length-1;return e<0&&(e=0),[r[0],r[e]]}function aV(r,e,t,n){var i=new qt;return i.add(new Ar({name:"main",style:wE(t),silent:!0,draggable:!0,cursor:"move",drift:er(lV,r,e,i,["n","s","w","e"]),ondragend:er(rh,e,{isEnd:!0})})),Q(n,function(a){i.add(new Ar({name:a.join(""),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:er(lV,r,e,i,a),ondragend:er(rh,e,{isEnd:!0})}))}),i}function oV(r,e,t,n){var i=n.brushStyle.lineWidth||0,a=Hd(i,Ete),o=t[0][0],s=t[1][0],l=o-i/2,u=s-i/2,d=t[0][1],f=t[1][1],g=d-a+i/2,m=f-a+i/2,_=d-o,x=f-s,w=_+i,C=x+i;el(r,e,"main",o,s,_,x),n.transformable&&(el(r,e,"w",l,u,a,C),el(r,e,"e",g,u,a,C),el(r,e,"n",l,u,w,a),el(r,e,"s",l,m,w,a),el(r,e,"nw",l,u,a,a),el(r,e,"ne",g,u,a,a),el(r,e,"sw",l,m,a,a),el(r,e,"se",g,m,a,a))}function xE(r,e){var t=e.__brushOption,n=t.transformable,i=e.childAt(0);i.useStyle(wE(t)),i.attr({silent:!n,cursor:n?"move":"default"}),Q([["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]],function(a){var o=e.childOfName(a.join("")),s=a.length===1?SE(r,a[0]):kte(r,a);o&&o.attr({silent:!n,invisible:!n,cursor:n?Ate[s]+"-resize":null})})}function el(r,e,t,n,i,a,o){var s=e.childOfName(t);s&&s.setShape(Pte(TE(r,e,[[n,i],[n+a,i+o]])))}function wE(r){return Bt({strokeNoScale:!0},r.brushStyle)}function sV(r,e,t,n){var i=[Hg(r,t),Hg(e,n)],a=[Hd(r,t),Hd(e,n)];return[[i[0],a[0]],[i[1],a[1]]]}function Ite(r){return Sc(r.group)}function SE(r,e){var t={w:"left",e:"right",n:"top",s:"bottom"},n={left:"w",right:"e",top:"n",bottom:"s"},i=Vy(t[e],Ite(r));return n[i]}function kte(r,e){var t=[SE(r,e[0]),SE(r,e[1])];return(t[0]==="e"||t[0]==="w")&&t.reverse(),t.join("")}function lV(r,e,t,n,i,a){var o=t.__brushOption,s=r.toRectRange(o.range),l=uV(e,i,a);Q(n,function(u){var d=Cte[u];s[d[0]][d[1]]+=l[d[0]]}),o.range=r.fromRectRange(sV(s[0][0],s[1][0],s[0][1],s[1][1])),mE(e,t),rh(e,{isEnd:!1})}function Lte(r,e,t,n){var i=e.__brushOption.range,a=uV(r,t,n);Q(i,function(o){o[0]+=a[0],o[1]+=a[1]}),mE(r,e),rh(r,{isEnd:!1})}function uV(r,e,t){var n=r.group,i=n.transformCoordToLocal(e,t),a=n.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function TE(r,e,t){var n=nV(r,e);return n&&n!==th?n.clipPath(t,r._transform):Ut(t)}function Pte(r){var e=Hg(r[0][0],r[1][0]),t=Hg(r[0][1],r[1][1]),n=Hd(r[0][0],r[1][0]),i=Hd(r[0][1],r[1][1]);return{x:e,y:t,width:n-e,height:i-t}}function Rte(r,e,t){if(!(!r._brushType||Ote(r,e.offsetX,e.offsetY))){var n=r._zr,i=r._covers,a=_E(r,e,t);if(!r._dragging)for(var o=0;on.getWidth()||t<0||t>n.getHeight()}var d0={lineX:fV(0),lineY:fV(1),rect:{createCover:function(r,e){function t(n){return n}return aV({toRectRange:t,fromRectRange:t},r,e,[["w"],["e"],["n"],["s"],["s","e"],["s","w"],["n","e"],["n","w"]])},getCreatingRange:function(r){var e=iV(r);return sV(e[1][0],e[1][1],e[0][0],e[0][1])},updateCoverShape:function(r,e,t,n){oV(r,e,t,n)},updateCommon:xE,contain:CE},polygon:{createCover:function(r,e){var t=new qt;return t.add(new ra({name:"main",style:wE(e),silent:!0})),t},getCreatingRange:function(r){return r},endCreating:function(r,e){e.remove(e.childAt(0)),e.add(new ta({name:"main",draggable:!0,drift:er(Lte,r,e),ondragend:er(rh,r,{isEnd:!0})}))},updateCoverShape:function(r,e,t,n){e.childAt(0).setShape({points:TE(r,e,t)})},updateCommon:xE,contain:CE}};function fV(r){return{createCover:function(e,t){return aV({toRectRange:function(n){var i=[n,[0,100]];return r&&i.reverse(),i},fromRectRange:function(n){return n[r]}},e,t,[[["w"],["e"]],[["n"],["s"]]][r])},getCreatingRange:function(e){var t=iV(e),n=Hg(t[0][r],t[1][r]),i=Hd(t[0][r],t[1][r]);return[n,i]},updateCoverShape:function(e,t,n,i){var a,o=nV(e,t);if(o!==th&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(r);else{var s=e._zr;a=[0,[s.getWidth(),s.getHeight()][1-r]]}var l=[n,a];r&&l.reverse(),oV(e,t,l,i)},updateCommon:xE,contain:CE}}function pV(r){return r=AE(r),function(e){return jk(e,r)}}function gV(r,e){return r=AE(r),function(t){var n=e??t,i=n?r.width:r.height,a=n?r.x:r.y;return[a,a+(i||0)]}}function vV(r,e,t){var n=AE(r);return function(i,a){return n.contain(a[0],a[1])&&!K_(i,e,t)}}function AE(r){return sr.create(r)}var zte=["axisLine","axisTickLabel","axisName"],Bte=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){r.prototype.init.apply(this,arguments),(this._brushController=new vE(n.getZr())).on("brush",pt(this._onBrush,this))},e.prototype.render=function(t,n,i,a){if(!Vte(t,n,a)){this.axisModel=t,this.api=i,this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new qt,this.group.add(this._axisGroup),!!t.get("show")){var s=$te(t,n),l=s.coordinateSystem,u=t.getAreaSelectStyle(),d=u.width,f=t.axis.dim,g=l.getAxisLayout(f),m=Ge({strokeContainThreshold:d},g),_=new oa(t,m);Q(zte,_.add,_),this._axisGroup.add(_.getGroup()),this._refreshBrushController(m,u,t,s,d,i),Fp(o,this._axisGroup,t)}}},e.prototype._refreshBrushController=function(t,n,i,a,o,s){var l=i.axis.getExtent(),u=l[1]-l[0],d=Math.min(30,Math.abs(u)*.1),f=sr.create({x:l[0],y:-o/2,width:u,height:o});f.x-=d,f.width+=2*d,this._brushController.mount({enableGlobalPan:!0,rotation:t.rotation,x:t.position[0],y:t.position[1]}).setPanels([{panelId:"pl",clipPath:pV(f),isTargetByCursor:vV(f,s,a),getLinearBrushOtherExtent:gV(f,0)}]).enableBrush({brushType:"lineX",brushStyle:n,removeOnClick:!0}).updateCovers(Fte(i))},e.prototype._onBrush=function(t){var n=t.areas,i=this.axisModel,a=i.axis,o=je(n,function(s){return[a.coordToData(s.range[0],!0),a.coordToData(s.range[1],!0)]});(!i.option.realtime===t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:i.id,intervals:o})},e.prototype.dispose=function(){this._brushController.dispose()},e.type="parallelAxis",e}(xn);function Vte(r,e,t){return t&&t.type==="axisAreaSelect"&&e.findComponents({mainType:"parallelAxis",query:t})[0]===r}function Fte(r){var e=r.axis;return je(r.activeIntervals,function(t){return{brushType:"lineX",panelId:"pl",range:[e.dataToCoord(t[0],!0),e.dataToCoord(t[1],!0)]}})}function $te(r,e){return e.getComponent("parallel",r.get("parallelIndex"))}var Gte={type:"axisAreaSelect",event:"axisAreaSelected"};function Ute(r){r.registerAction(Gte,function(e,t){t.eachComponent({mainType:"parallelAxis",query:e},function(n){n.axis.model.setActiveIntervals(e.intervals)})}),r.registerAction("parallelAxisExpand",function(e,t){t.eachComponent({mainType:"parallel",query:e},function(n){n.setAxisExpand(e)})})}var Hte={type:"value",areaSelectStyle:{width:20,borderWidth:1,borderColor:"rgba(160,197,232)",color:"rgba(160,197,232)",opacity:.3},realtime:!0,z:10};function mV(r){r.registerComponentView(hte),r.registerComponentModel(fte),r.registerCoordinateSystem("parallel",xte),r.registerPreprocessor(ste),r.registerComponentModel(gE),r.registerComponentView(Bte),Bd(r,"parallel",gE,Hte),Ute(r)}function Wte(r){dr(mV),r.registerChartView(Qee),r.registerSeriesModel(rte),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,ote)}var qte=function(){function r(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return r}(),Zte=function(r){ze(e,r);function e(t){return r.call(this,t)||this}return e.prototype.getDefaultShape=function(){return new qte},e.prototype.buildPath=function(t,n){var i=n.extent;t.moveTo(n.x1,n.y1),t.bezierCurveTo(n.cpx1,n.cpy1,n.cpx2,n.cpy2,n.x2,n.y2),n.orient==="vertical"?(t.lineTo(n.x2+i,n.y2),t.bezierCurveTo(n.cpx2+i,n.cpy2,n.cpx1+i,n.cpy1,n.x1+i,n.y1)):(t.lineTo(n.x2,n.y2+i),t.bezierCurveTo(n.cpx2,n.cpy2+i,n.cpx1,n.cpy1+i,n.x1,n.y1+i)),t.closePath()},e.prototype.highlight=function(){Ws(this)},e.prototype.downplay=function(){qs(this)},e}(vr),jte=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._focusAdjacencyDisabled=!1,t}return e.prototype.render=function(t,n,i){var a=this,o=t.getGraph(),s=this.group,l=t.layoutInfo,u=l.width,d=l.height,f=t.getData(),g=t.getData("edge"),m=t.get("orient");this._model=t,s.removeAll(),s.x=l.x,s.y=l.y,o.eachEdge(function(_){var x=new Zte,w=jt(x);w.dataIndex=_.dataIndex,w.seriesIndex=t.seriesIndex,w.dataType="edge";var C=_.getModel(),A=C.getModel("lineStyle"),L=A.get("curveness"),O=_.node1.getLayout(),V=_.node1.getModel(),F=V.get("localX"),$=V.get("localY"),H=_.node2.getLayout(),Z=_.node2.getModel(),j=Z.get("localX"),Y=Z.get("localY"),se=_.getLayout(),ae,ue,fe,le,ge,xe,Me,Ve;x.shape.extent=Math.max(1,se.dy),x.shape.orient=m,m==="vertical"?(ae=(F!=null?F*u:O.x)+se.sy,ue=($!=null?$*d:O.y)+O.dy,fe=(j!=null?j*u:H.x)+se.ty,le=Y!=null?Y*d:H.y,ge=ae,xe=ue*(1-L)+le*L,Me=fe,Ve=ue*L+le*(1-L)):(ae=(F!=null?F*u:O.x)+O.dx,ue=($!=null?$*d:O.y)+se.sy,fe=j!=null?j*u:H.x,le=(Y!=null?Y*d:H.y)+se.ty,ge=ae*(1-L)+fe*L,xe=ue,Me=ae*L+fe*(1-L),Ve=le),x.setShape({x1:ae,y1:ue,x2:fe,y2:le,cpx1:ge,cpy1:xe,cpx2:Me,cpy2:Ve}),x.useStyle(A.getItemStyle()),yV(x.style,m,_);var Fe=""+C.get("value"),Xe=ni(C,"edgeLabel");Ci(x,Xe,{labelFetcher:{getFormattedLabel:function(it,kt,Ht,lt,st,Ct){return t.getFormattedLabel(it,kt,"edge",lt,no(st,Xe.normal&&Xe.normal.get("formatter"),Fe),Ct)}},labelDataIndex:_.dataIndex,defaultText:Fe}),x.setTextConfig({position:"inside"});var ot=C.getModel("emphasis");Ei(x,C,"lineStyle",function(it){var kt=it.getItemStyle();return yV(kt,m,_),kt}),s.add(x),g.setItemGraphicEl(_.dataIndex,x);var et=ot.get("focus");Sn(x,et==="adjacency"?_.getAdjacentDataIndices():et==="trajectory"?_.getTrajectoryDataIndices():et,ot.get("blurScope"),ot.get("disabled"))}),o.eachNode(function(_){var x=_.getLayout(),w=_.getModel(),C=w.get("localX"),A=w.get("localY"),L=w.getModel("emphasis"),O=w.get(["itemStyle","borderRadius"])||0,V=new Ar({shape:{x:C!=null?C*u:x.x,y:A!=null?A*d:x.y,width:x.dx,height:x.dy,r:O},style:w.getModel("itemStyle").getItemStyle(),z2:10});Ci(V,ni(w),{labelFetcher:{getFormattedLabel:function($,H){return t.getFormattedLabel($,H,"node")}},labelDataIndex:_.dataIndex,defaultText:_.id}),V.disableLabelAnimation=!0,V.setStyle("fill",_.getVisual("color")),V.setStyle("decal",_.getVisual("style").decal),Ei(V,w),s.add(V),f.setItemGraphicEl(_.dataIndex,V),jt(V).dataType="node";var F=L.get("focus");Sn(V,F==="adjacency"?_.getAdjacentDataIndices():F==="trajectory"?_.getTrajectoryDataIndices():F,L.get("blurScope"),L.get("disabled"))}),f.eachItemGraphicEl(function(_,x){var w=f.getItemModel(x);w.get("draggable")&&(_.drift=function(C,A){a._focusAdjacencyDisabled=!0,this.shape.x+=C,this.shape.y+=A,this.dirty(),i.dispatchAction({type:"dragNode",seriesId:t.id,dataIndex:f.getRawIndex(x),localX:this.shape.x/u,localY:this.shape.y/d})},_.ondragend=function(){a._focusAdjacencyDisabled=!1},_.draggable=!0,_.cursor="move")}),!this._data&&t.isAnimationEnabled()&&s.setClipPath(Xte(s.getBoundingRect(),t,function(){s.removeClipPath()})),this._data=t.getData()},e.prototype.dispose=function(){},e.type="sankey",e}(Jr);function yV(r,e,t){switch(r.fill){case"source":r.fill=t.node1.getVisual("color"),r.decal=t.node1.getVisual("style").decal;break;case"target":r.fill=t.node2.getVisual("color"),r.decal=t.node2.getVisual("style").decal;break;case"gradient":var n=t.node1.getVisual("color"),i=t.node2.getVisual("color");ut(n)&&ut(i)&&(r.fill=new Bp(0,0,+(e==="horizontal"),+(e==="vertical"),[{color:n,offset:0},{color:i,offset:1}]))}}function Xte(r,e,t){var n=new Ar({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return yn(n,{shape:{width:r.width+20}},e,t),n}var Yte={},Kte=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){var i=t.edges||t.links||[],a=t.data||t.nodes||[],o=t.levels||[];this.levelModels=[];for(var s=this.levelModels,l=0;l=0)s[o[l].depth]=new qr(o[l],this,n);else if(Yte.NODE_ENV!=="production")throw new Error("levels[i].depth is mandatory and should be natural number");var u=UB(a,i,this,!0,d);return u.data;function d(f,g){f.wrapMethod("getItemModel",function(m,_){var x=m.parentModel,w=x.getData().getItemLayout(_);if(w){var C=w.depth,A=x.levelModels[C];A&&(m.parentModel=A)}return m}),g.wrapMethod("getItemModel",function(m,_){var x=m.parentModel,w=x.getGraph().getEdgeByIndex(_),C=w.node1.getLayout();if(C){var A=C.depth,L=x.levelModels[A];L&&(m.parentModel=L)}return m})}},e.prototype.setNodePosition=function(t,n){var i=this.option.data||this.option.nodes,a=i[t];a.localX=n[0],a.localY=n[1]},e.prototype.getGraph=function(){return this.getData().graph},e.prototype.getEdgeData=function(){return this.getGraph().edgeData},e.prototype.formatTooltip=function(t,n,i){function a(m){return isNaN(m)||m==null}if(i==="edge"){var o=this.getDataParams(t,i),s=o.data,l=o.value,u=s.source+" -- "+s.target;return ii("nameValue",{name:u,value:l,noValue:a(l)})}else{var d=this.getGraph().getNodeByIndex(t),f=d.getLayout().value,g=this.getDataParams(t,i).data.name;return ii("nameValue",{name:g!=null?g+"":null,value:f,noValue:a(f)})}},e.prototype.optionUpdated=function(){},e.prototype.getDataParams=function(t,n){var i=r.prototype.getDataParams.call(this,t,n);if(i.value==null&&n==="node"){var a=this.getGraph().getNodeByIndex(t),o=a.getLayout().value;i.value=o}return i},e.type="series.sankey",e.defaultOption={z:2,coordinateSystem:"view",left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:"right",fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:"justify",lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:"#212121"}},animationEasing:"linear",animationDuration:1e3},e}(on);function Jte(r,e){r.eachSeriesByType("sankey",function(t){var n=t.get("nodeWidth"),i=t.get("nodeGap"),a=Qte(t,e);t.layoutInfo=a;var o=a.width,s=a.height,l=t.getGraph(),u=l.nodes,d=l.edges;tre(u);var f=$r(u,function(x){return x.getLayout().value===0}),g=f.length!==0?0:t.get("layoutIterations"),m=t.get("orient"),_=t.get("nodeAlign");ere(u,d,n,i,o,s,g,m,_)})}function Qte(r,e){return Xn(r.getBoxLayoutParams(),{width:e.getWidth(),height:e.getHeight()})}function ere(r,e,t,n,i,a,o,s,l){rre(r,e,t,i,a,s,l),ore(r,e,a,i,n,o,s),gre(r,s)}function tre(r){Q(r,function(e){var t=tu(e.outEdges,f0),n=tu(e.inEdges,f0),i=e.getValue()||0,a=Math.max(t,n,i);e.setLayout({value:a},!0)})}function rre(r,e,t,n,i,a,o){for(var s=[],l=[],u=[],d=[],f=0,g=0;g=0;C&&w.depth>m&&(m=w.depth),x.setLayout({depth:C?w.depth:f},!0),a==="vertical"?x.setLayout({dy:t},!0):x.setLayout({dx:t},!0);for(var A=0;Af-1?m:f-1;o&&o!=="left"&&nre(r,o,a,$);var H=a==="vertical"?(i-t)/$:(n-t)/$;are(r,H,a)}function _V(r){var e=r.hostGraph.data.getRawDataItem(r.dataIndex);return e.depth!=null&&e.depth>=0}function nre(r,e,t,n){if(e==="right"){for(var i=[],a=r,o=0;a.length;){for(var s=0;s0;a--)l*=.99,ure(s,l,o),DE(s,i,t,n,o),pre(s,l,o),DE(s,i,t,n,o)}function sre(r,e){var t=[],n=e==="vertical"?"y":"x",i=Mw(r,function(a){return a.getLayout()[n]});return i.keys.sort(function(a,o){return a-o}),Q(i.keys,function(a){t.push(i.buckets.get(a))}),t}function lre(r,e,t,n,i,a){var o=1/0;Q(r,function(s){var l=s.length,u=0;Q(s,function(f){u+=f.getLayout().value});var d=a==="vertical"?(n-(l-1)*i)/u:(t-(l-1)*i)/u;d0&&(s=l.getLayout()[a]+u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]+l.getLayout()[g]+e;var _=i==="vertical"?n:t;if(u=d-e-_,u>0){s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0),d=s;for(var m=f-2;m>=0;--m)l=o[m],u=l.getLayout()[a]+l.getLayout()[g]+e-d,u>0&&(s=l.getLayout()[a]-u,i==="vertical"?l.setLayout({x:s},!0):l.setLayout({y:s},!0)),d=l.getLayout()[a]}})}function ure(r,e,t){Q(r.slice().reverse(),function(n){Q(n,function(i){if(i.outEdges.length){var a=tu(i.outEdges,cre,t)/tu(i.outEdges,f0);if(isNaN(a)){var o=i.outEdges.length;a=o?tu(i.outEdges,hre,t)/o:0}if(t==="vertical"){var s=i.getLayout().x+(a-eu(i,t))*e;i.setLayout({x:s},!0)}else{var l=i.getLayout().y+(a-eu(i,t))*e;i.setLayout({y:l},!0)}}})})}function cre(r,e){return eu(r.node2,e)*r.getValue()}function hre(r,e){return eu(r.node2,e)}function dre(r,e){return eu(r.node1,e)*r.getValue()}function fre(r,e){return eu(r.node1,e)}function eu(r,e){return e==="vertical"?r.getLayout().x+r.getLayout().dx/2:r.getLayout().y+r.getLayout().dy/2}function f0(r){return r.getValue()}function tu(r,e,t){for(var n=0,i=r.length,a=-1;++ao&&(o=l)}),Q(n,function(s){var l=new si({type:"color",mappingMethod:"linear",dataExtent:[a,o],visual:e.get("color")}),u=l.mapValueToVisual(s.getLayout().value),d=s.getModel().get(["itemStyle","color"]);d!=null?(s.setVisual("color",d),s.setVisual("style",{fill:d})):(s.setVisual("color",u),s.setVisual("style",{fill:u}))})}i.length&&Q(i,function(s){var l=s.getModel().get("lineStyle");s.setVisual("style",l)})})}function mre(r){r.registerChartView(jte),r.registerSeriesModel(Kte),r.registerLayout(Jte),r.registerVisual(vre),r.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(e,t){t.eachComponent({mainType:"series",subType:"sankey",query:e},function(n){n.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var bV=function(){function r(){}return r.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},r.prototype.getInitialData=function(e,t){var n,i=t.getComponent("xAxis",this.get("xAxisIndex")),a=t.getComponent("yAxis",this.get("yAxisIndex")),o=i.get("type"),s=a.get("type"),l;o==="category"?(e.layout="horizontal",n=i.getOrdinalMeta(),l=!this._hasEncodeRule("x")):s==="category"?(e.layout="vertical",n=a.getOrdinalMeta(),l=!this._hasEncodeRule("y")):e.layout=e.layout||"horizontal";var u=["x","y"],d=e.layout==="horizontal"?0:1,f=this._baseAxisDim=u[d],g=u[1-d],m=[i,a],_=m[d].get("type"),x=m[1-d].get("type"),w=e.data;if(w&&l){var C=[];Q(w,function(O,V){var F;Ze(O)?(F=O.slice(),O.unshift(V)):Ze(O.value)?(F=Ge({},O),F.value=F.value.slice(),O.value.unshift(V)):F=O,C.push(F)}),e.data=C}var A=this.defaultValueDimensions,L=[{name:f,type:S_(_),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:g,type:S_(x),dimsDef:A.slice()}];return zd(this,{coordDimensions:L,dimensionsCount:A.length+1,encodeDefaulter:er(DL,L,this)})},r.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+"Axis",this.get(e+"AxisIndex")).axis},r}(),xV=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.defaultValueDimensions=[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],t.visualDrawType="stroke",t}return e.type="series.boxplot",e.dependencies=["xAxis","yAxis","grid"],e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0,0,0,0.2)"}},animationDuration:800},e}(on);$n(xV,bV,!0);var yre=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this.group,s=this._data;this._data||o.removeAll();var l=t.get("layout")==="horizontal"?1:0;a.diff(s).add(function(u){if(a.hasValue(u)){var d=a.getItemLayout(u),f=wV(d,a,u,l,!0);a.setItemGraphicEl(u,f),o.add(f)}}).update(function(u,d){var f=s.getItemGraphicEl(d);if(!a.hasValue(u)){o.remove(f);return}var g=a.getItemLayout(u);f?(Go(f),SV(g,f,a,u)):f=wV(g,a,u,l),o.add(f),a.setItemGraphicEl(u,f)}).remove(function(u){var d=s.getItemGraphicEl(u);d&&o.remove(d)}).execute(),this._data=a},e.prototype.remove=function(t){var n=this.group,i=this._data;this._data=null,i&&i.eachItemGraphicEl(function(a){a&&n.remove(a)})},e.type="boxplot",e}(Jr),_re=function(){function r(){}return r}(),bre=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="boxplotBoxPath",n}return e.prototype.getDefaultShape=function(){return new _re},e.prototype.buildPath=function(t,n){var i=n.points,a=0;for(t.moveTo(i[a][0],i[a][1]),a++;a<4;a++)t.lineTo(i[a][0],i[a][1]);for(t.closePath();ax){var O=[C,L];n.push(O)}}}return{boxData:t,outliers:n}}var Are={},Dre={type:"echarts:boxplot",transform:function(e){var t=e.upstream;if(t.sourceFormat!==Oi){var n="";Are.NODE_ENV!=="production"&&(n=Ki("source data is not applicable for this boxplot transform. Expect number[][].")),Gr(n)}var i=Cre(t.getRawData(),e.config);return[{dimensions:["ItemName","Low","Q1","Q2","Q3","High"],data:i.boxData},{data:i.outliers}]}};function Mre(r){r.registerSeriesModel(xV),r.registerChartView(yre),r.registerLayout(wre),r.registerTransform(Dre)}var Ire=["itemStyle","borderColor"],kre=["itemStyle","borderColor0"],Lre=["itemStyle","borderColorDoji"],Pre=["itemStyle","color"],Rre=["itemStyle","color0"];function ME(r,e){return e.get(r>0?Pre:Rre)}function IE(r,e){return e.get(r===0?Lre:r>0?Ire:kre)}var Nre={seriesType:"candlestick",plan:Td(),performRawSeries:!0,reset:function(r,e){if(!e.isSeriesFiltered(r)){var t=r.pipelineContext.large;return!t&&{progress:function(n,i){for(var a;(a=n.next())!=null;){var o=i.getItemModel(a),s=i.getItemLayout(a).sign,l=o.getItemStyle();l.fill=ME(s,o),l.stroke=IE(s,o)||l.fill;var u=i.ensureUniqueItemVisual(a,"style");Ge(u,l)}}}}}},Ore=["color","borderColor"],zre=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(t),this._isLargeDraw?this._renderLarge(t):this._renderNormal(t)},e.prototype.incrementalPrepareRender=function(t,n,i){this._clear(),this._updateDrawMode(t)},e.prototype.incrementalRender=function(t,n,i,a){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(t,n):this._incrementalRenderNormal(t,n)},e.prototype.eachRendered=function(t){Vl(this._progressiveEls||this.group,t)},e.prototype._updateDrawMode=function(t){var n=t.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(t){var n=t.getData(),i=this._data,a=this.group,o=n.getLayout("isSimpleBox"),s=t.get("clip",!0),l=t.coordinateSystem,u=l.getArea&&l.getArea();this._data||a.removeAll(),n.diff(i).add(function(d){if(n.hasValue(d)){var f=n.getItemLayout(d);if(s&&TV(u,f))return;var g=kE(f,d,!0);yn(g,{shape:{points:f.ends}},t,d),LE(g,n,d,o),a.add(g),n.setItemGraphicEl(d,g)}}).update(function(d,f){var g=i.getItemGraphicEl(f);if(!n.hasValue(d)){a.remove(g);return}var m=n.getItemLayout(d);if(s&&TV(u,m)){a.remove(g);return}g?(Or(g,{shape:{points:m.ends}},t,d),Go(g)):g=kE(m),LE(g,n,d,o),a.add(g),n.setItemGraphicEl(d,g)}).remove(function(d){var f=i.getItemGraphicEl(d);f&&a.remove(f)}).execute(),this._data=n},e.prototype._renderLarge=function(t){this._clear(),EV(t,this.group);var n=t.get("clip",!0)?Sg(t.coordinateSystem,!1,t):null;n?this.group.setClipPath(n):this.group.removeClipPath()},e.prototype._incrementalRenderNormal=function(t,n){for(var i=n.getData(),a=i.getLayout("isSimpleBox"),o;(o=t.next())!=null;){var s=i.getItemLayout(o),l=kE(s);LE(l,i,o,a),l.incremental=!0,this.group.add(l),this._progressiveEls.push(l)}},e.prototype._incrementalRenderLarge=function(t,n){EV(n,this.group,this._progressiveEls,!0)},e.prototype.remove=function(t){this._clear()},e.prototype._clear=function(){this.group.removeAll(),this._data=null},e.type="candlestick",e}(Jr),Bre=function(){function r(){}return r}(),Vre=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n.type="normalCandlestickBox",n}return e.prototype.getDefaultShape=function(){return new Bre},e.prototype.buildPath=function(t,n){var i=n.points;this.__simpleBox?(t.moveTo(i[4][0],i[4][1]),t.lineTo(i[6][0],i[6][1])):(t.moveTo(i[0][0],i[0][1]),t.lineTo(i[1][0],i[1][1]),t.lineTo(i[2][0],i[2][1]),t.lineTo(i[3][0],i[3][1]),t.closePath(),t.moveTo(i[4][0],i[4][1]),t.lineTo(i[5][0],i[5][1]),t.moveTo(i[6][0],i[6][1]),t.lineTo(i[7][0],i[7][1]))},e}(vr);function kE(r,e,t){var n=r.ends;return new Vre({shape:{points:t?Fre(n,r):n},z2:100})}function TV(r,e){for(var t=!0,n=0;nV?Y[a]:j[a],ends:ue,brushRect:Me(F,$,L)})}function ge(Fe,Xe){var ot=[];return ot[i]=Xe,ot[a]=Fe,isNaN(Xe)||isNaN(Fe)?[NaN,NaN]:e.dataToPoint(ot)}function xe(Fe,Xe,ot){var et=Xe.slice(),it=Xe.slice();et[i]=By(et[i]+n/2,1,!1),it[i]=By(it[i]-n/2,1,!0),ot?Fe.push(et,it):Fe.push(it,et)}function Me(Fe,Xe,ot){var et=ge(Fe,ot),it=ge(Xe,ot);return et[i]-=n/2,it[i]-=n/2,{x:et[0],y:et[1],width:n,height:it[1]-et[1]}}function Ve(Fe){return Fe[i]=By(Fe[i],1),Fe}}function _(x,w){for(var C=bs(x.count*4),A=0,L,O=[],V=[],F,$=w.getStore(),H=!!r.get(["itemStyle","borderColorDoji"]);(F=x.next())!=null;){var Z=$.get(s,F),j=$.get(u,F),Y=$.get(d,F),se=$.get(f,F),ae=$.get(g,F);if(isNaN(Z)||isNaN(se)||isNaN(ae)){C[A++]=NaN,A+=3;continue}C[A++]=AV($,F,j,Y,d,H),O[i]=Z,O[a]=se,L=e.dataToPoint(O,null,V),C[A++]=L?L[0]:NaN,C[A++]=L?L[1]:NaN,O[a]=ae,L=e.dataToPoint(O,null,V),C[A++]=L?L[1]:NaN}w.setLayout("largePoints",C)}}};function AV(r,e,t,n,i,a){var o;return t>n?o=-1:t0?r.get(i,e-1)<=n?1:-1:1,o}function Hre(r,e){var t=r.getBaseAxis(),n,i=t.type==="category"?t.getBandWidth():(n=t.getExtent(),Math.abs(n[1]-n[0])/e.count()),a=nt(Zt(r.get("barMaxWidth"),i),i),o=nt(Zt(r.get("barMinWidth"),1),i),s=r.get("barWidth");return s!=null?nt(s,i):Math.max(Math.min(i/2,a),o)}function Wre(r){r.registerChartView(zre),r.registerSeriesModel(CV),r.registerPreprocessor(Gre),r.registerVisual(Nre),r.registerLayout(Ure)}function DV(r,e){var t=e.rippleEffectColor||e.color;r.eachChild(function(n){n.attr({z:e.z,zlevel:e.zlevel,style:{stroke:e.brushType==="stroke"?t:null,fill:e.brushType==="fill"?t:null}})})}var qre=function(r){ze(e,r);function e(t,n){var i=r.call(this)||this,a=new xg(t,n),o=new qt;return i.add(a),i.add(o),i.updateData(t,n),i}return e.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},e.prototype.startEffectAnimation=function(t){for(var n=t.symbolType,i=t.color,a=t.rippleNumber,o=this.childAt(1),s=0;s0&&(s=this._getLineLength(a)/d*1e3),s!==this._period||l!==this._loop||u!==this._roundTrip){a.stopAnimation();var g=void 0;It(f)?g=f(i):g=f,a.__t>0&&(g=-s*a.__t),this._animateSymbol(a,s,g,l,u)}this._period=s,this._loop=l,this._roundTrip=u}},e.prototype._animateSymbol=function(t,n,i,a,o){if(n>0){t.__t=0;var s=this,l=t.animate("",a).when(o?n*2:n,{__t:o?2:1}).delay(i).during(function(){s._updateSymbolPosition(t)});a||l.done(function(){s.remove(t)}),l.start()}},e.prototype._getLineLength=function(t){return El(t.__p1,t.__cp1)+El(t.__cp1,t.__p2)},e.prototype._updateAnimationPoints=function(t,n){t.__p1=n[0],t.__p2=n[1],t.__cp1=n[2]||[(n[0][0]+n[1][0])/2,(n[0][1]+n[1][1])/2]},e.prototype.updateData=function(t,n,i){this.childAt(0).updateData(t,n,i),this._updateEffectSymbol(t,n)},e.prototype._updateSymbolPosition=function(t){var n=t.__p1,i=t.__p2,a=t.__cp1,o=t.__t<1?t.__t:2-t.__t,s=[t.x,t.y],l=s.slice(),u=hi,d=Hx;s[0]=u(n[0],a[0],i[0],o),s[1]=u(n[1],a[1],i[1],o);var f=t.__t<1?d(n[0],a[0],i[0],o):d(i[0],a[0],n[0],1-o),g=t.__t<1?d(n[1],a[1],i[1],o):d(i[1],a[1],n[1],1-o);t.rotation=-Math.atan2(g,f)-Math.PI/2,(this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")&&(t.__lastT!==void 0&&t.__lastT=0&&!(a[l]<=n);l--);l=Math.min(l,o-2)}else{for(l=s;ln);l++);l=Math.min(l-1,o-2)}var d=(n-a[l])/(a[l+1]-a[l]),f=i[l],g=i[l+1];t.x=f[0]*(1-d)+d*g[0],t.y=f[1]*(1-d)+d*g[1];var m=t.__t<1?g[0]-f[0]:f[0]-g[0],_=t.__t<1?g[1]-f[1]:f[1]-g[1];t.rotation=-Math.atan2(_,m)-Math.PI/2,this._lastFrame=l,this._lastFramePercent=n,t.ignore=!1}},e}(MV),Kre=function(){function r(){this.polyline=!1,this.curveness=0,this.segs=[]}return r}(),Jre=function(r){ze(e,r);function e(t){var n=r.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return e.prototype.reset=function(){this.notClear=!1,this._off=0},e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Kre},e.prototype.buildPath=function(t,n){var i=n.segs,a=n.curveness,o;if(n.polyline)for(o=this._off;o0){t.moveTo(i[o++],i[o++]);for(var l=1;l0){var m=(u+f)/2-(d-g)*a,_=(d+g)/2-(f-u)*a;t.quadraticCurveTo(m,_,f,g)}else t.lineTo(f,g)}this.incremental&&(this._off=o,this.notClear=!0)},e.prototype.findDataIndex=function(t,n){var i=this.shape,a=i.segs,o=i.curveness,s=this.style.lineWidth;if(i.polyline)for(var l=0,u=0;u0)for(var f=a[u++],g=a[u++],m=1;m0){var w=(f+_)/2-(g-x)*o,C=(g+x)/2-(_-f)*o;if(jI(f,g,w,C,_,x,s,t,n))return l}else if(Nl(f,g,_,x,s,t,n))return l;l++}return-1},e.prototype.contain=function(t,n){var i=this.transformCoordToLocal(t,n),a=this.getBoundingRect();if(t=i[0],n=i[1],a.contain(t,n)){var o=this.hoverDataIdx=this.findDataIndex(t,n);return o>=0}return this.hoverDataIdx=-1,!1},e.prototype.getBoundingRect=function(){var t=this._rect;if(!t){for(var n=this.shape,i=n.segs,a=1/0,o=1/0,s=-1/0,l=-1/0,u=0;u0&&(o.dataIndex=l+e.__startIndex)})},r.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},r}(),ene={},kV={seriesType:"lines",plan:Td(),reset:function(r){var e=r.coordinateSystem;if(!e){ene.NODE_ENV!=="production"&&Ti("The lines series must have a coordinate system.");return}var t=r.get("polyline"),n=r.pipelineContext.large;return{progress:function(i,a){var o=[];if(n){var s=void 0,l=i.end-i.start;if(t){for(var u=0,d=i.start;d0&&(d?LV.NODE_ENV!=="production"&&console.warn("SVG render mode doesn't support lines with trail effect"):u.configLayer(s,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(l/10+.9,1),0)})),o.updateData(a);var f=t.get("clip",!0)&&Sg(t.coordinateSystem,!1,t);f?this.group.setClipPath(f):this.group.removeClipPath(),this._lastZlevel=s,this._finished=!0},e.prototype.incrementalPrepareRender=function(t,n,i){var a=t.getData(),o=this._updateLineDraw(a,t);o.incrementalPrepareUpdate(a),this._clearLayer(i),this._finished=!1},e.prototype.incrementalRender=function(t,n,i){this._lineDraw.incrementalUpdate(t,n.getData()),this._finished=t.end===n.getData().count()},e.prototype.eachRendered=function(t){this._lineDraw&&this._lineDraw.eachRendered(t)},e.prototype.updateTransform=function(t,n,i){var a=t.getData(),o=t.pipelineContext;if(!this._finished||o.large||o.progressiveRender)return{update:!0};var s=kV.reset(t,n,i);s.progress&&s.progress({start:0,end:a.count(),count:a.count()},a),this._lineDraw.updateLayout(),this._clearLayer(i)},e.prototype._updateLineDraw=function(t,n){var i=this._lineDraw,a=this._showEffect(n),o=!!n.get("polyline"),s=n.pipelineContext,l=s.large;return LV.NODE_ENV!=="production"&&a&&l&&console.warn("Large lines not support effect"),(!i||a!==this._hasEffet||o!==this._isPolyline||l!==this._isLargeDraw)&&(i&&i.remove(),i=this._lineDraw=l?new Qre:new iE(o?a?Yre:IV:a?MV:nE),this._hasEffet=a,this._isPolyline=o,this._isLargeDraw=l),this.group.add(i.group),i},e.prototype._showEffect=function(t){return!!t.get(["effect","show"])},e.prototype._clearLayer=function(t){var n=t.getZr(),i=n.painter.getType()==="svg";!i&&this._lastZlevel!=null&&n.painter.getLayer(this._lastZlevel).clear(!0)},e.prototype.remove=function(t,n){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(n)},e.prototype.dispose=function(t,n){this.remove(t,n)},e.type="lines",e}(Jr),p0={},rne=typeof Uint32Array>"u"?Array:Uint32Array,nne=typeof Float64Array>"u"?Array:Float64Array;function PV(r){var e=r.data;e&&e[0]&&e[0][0]&&e[0][0].coord&&(p0.NODE_ENV!=="production"&&console.warn("Lines data configuration has been changed to { coords:[[1,2],[2,3]] }"),r.data=je(e,function(t){var n=[t[0].coord,t[1].coord],i={coords:n};return t[0].name&&(i.fromName=t[0].name),t[1].name&&(i.toName=t[1].name),Sx([i,t[0],t[1]])}))}var ine=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.visualStyleAccessPath="lineStyle",t.visualDrawType="stroke",t}return e.prototype.init=function(t){t.data=t.data||[],PV(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),r.prototype.init.apply(this,arguments)},e.prototype.mergeOption=function(t){if(PV(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}r.prototype.mergeOption.apply(this,arguments)},e.prototype.appendData=function(t){var n=this._processFlatCoordsArray(t.data);n.flatCoords&&(this._flatCoords?(this._flatCoords=ap(this._flatCoords,n.flatCoords),this._flatCoordsOffset=ap(this._flatCoordsOffset,n.flatCoordsOffset)):(this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset),t.data=new Float32Array(n.count)),this.getRawData().appendData(t.data)},e.prototype._getCoordsFromItemModel=function(t){var n=this.getData().getItemModel(t),i=n.option instanceof Array?n.option:n.getShallow("coords");if(p0.NODE_ENV!=="production"&&!(i instanceof Array&&i.length>0&&i[0]instanceof Array))throw new Error("Invalid coords "+JSON.stringify(i)+". Lines must have 2d coords array in data item.");return i},e.prototype.getLineCoordsCount=function(t){return this._flatCoordsOffset?this._flatCoordsOffset[t*2+1]:this._getCoordsFromItemModel(t).length},e.prototype.getLineCoords=function(t,n){if(this._flatCoordsOffset){for(var i=this._flatCoordsOffset[t*2],a=this._flatCoordsOffset[t*2+1],o=0;oi&&p0.NODE_ENV!=="production")throw new Error("Invalid data format.")}}return{flatCoordsOffset:new Uint32Array(a.buffer,0,l),flatCoords:o,count:u}}return{flatCoordsOffset:null,flatCoords:null,count:t.length}},e.prototype.getInitialData=function(t,n){if(p0.NODE_ENV!=="production"){var i=bd.get(t.coordinateSystem);if(!i)throw new Error("Unknown coordinate system "+t.coordinateSystem)}var a=new na(["value"],this);return a.hasItemOption=!1,a.initData(t.data,[],function(o,s,l,u){if(o instanceof Array)return NaN;a.hasItemOption=!0;var d=o.value;if(d!=null)return d instanceof Array?d[u]:d}),a},e.prototype.formatTooltip=function(t,n,i){var a=this.getData(),o=a.getItemModel(t),s=o.get("name");if(s)return s;var l=o.get("fromName"),u=o.get("toName"),d=[];return l!=null&&d.push(l),u!=null&&d.push(u),ii("nameValue",{name:d.join(" > ")})},e.prototype.preventIncremental=function(){return!!this.get(["effect","show"])},e.prototype.getProgressive=function(){var t=this.option.progressive;return t??(this.option.large?1e4:this.get("progressive"))},e.prototype.getProgressiveThreshold=function(){var t=this.option.progressiveThreshold;return t??(this.option.large?2e4:this.get("progressiveThreshold"))},e.prototype.getZLevelKey=function(){var t=this.getModel("effect"),n=t.get("trailLength");return this.getData().count()>this.getProgressiveThreshold()?this.id:t.get("show")&&n>0?n+"":""},e.type="series.lines",e.dependencies=["grid","polar","geo","calendar"],e.defaultOption={coordinateSystem:"geo",z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}},e}(on);function g0(r){return r instanceof Array||(r=[r,r]),r}var ane={seriesType:"lines",reset:function(r){var e=g0(r.get("symbol")),t=g0(r.get("symbolSize")),n=r.getData();n.setVisual("fromSymbol",e&&e[0]),n.setVisual("toSymbol",e&&e[1]),n.setVisual("fromSymbolSize",t&&t[0]),n.setVisual("toSymbolSize",t&&t[1]);function i(a,o){var s=a.getItemModel(o),l=g0(s.getShallow("symbol",!0)),u=g0(s.getShallow("symbolSize",!0));l[0]&&a.setItemVisual(o,"fromSymbol",l[0]),l[1]&&a.setItemVisual(o,"toSymbol",l[1]),u[0]&&a.setItemVisual(o,"fromSymbolSize",u[0]),u[1]&&a.setItemVisual(o,"toSymbolSize",u[1])}return{dataEach:n.hasItemOption?i:null}}};function one(r){r.registerChartView(tne),r.registerSeriesModel(ine),r.registerLayout(kV),r.registerVisual(ane)}var sne=256,lne=function(){function r(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=Tl.createCanvas();this.canvas=e}return r.prototype.update=function(e,t,n,i,a,o){var s=this._getBrush(),l=this._getGradient(a,"inRange"),u=this._getGradient(a,"outOfRange"),d=this.pointSize+this.blurSize,f=this.canvas,g=f.getContext("2d"),m=e.length;f.width=t,f.height=n;for(var _=0;_0){var se=o(L)?l:u;L>0&&(L=L*j+H),V[F++]=se[Y],V[F++]=se[Y+1],V[F++]=se[Y+2],V[F++]=se[Y+3]*L*256}else F+=4}return g.putImageData(O,0,0),f},r.prototype._getBrush=function(){var e=this._brushCanvas||(this._brushCanvas=Tl.createCanvas()),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var i=e.getContext("2d");return i.clearRect(0,0,n,n),i.shadowOffsetX=n,i.shadowBlur=this.blurSize,i.shadowColor="#000",i.beginPath(),i.arc(-t,t,this.pointSize,0,Math.PI*2,!0),i.closePath(),i.fill(),e},r.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,i=n[t]||(n[t]=new Uint8ClampedArray(256*4)),a=[0,0,0,0],o=0,s=0;s<256;s++)e[t](s/255,!0,a),i[o++]=a[0],i[o++]=a[1],i[o++]=a[2],i[o++]=a[3];return i},r}(),RV={};function une(r,e,t){var n=r[1]-r[0];e=je(e,function(o){return{interval:[(o.interval[0]-r[0])/n,(o.interval[1]-r[0])/n]}});var i=e.length,a=0;return function(o){var s;for(s=a;s=0;s--){var l=e[s].interval;if(l[0]<=o&&o<=l[1]){a=s;break}}return s>=0&&s=e[0]&&n<=e[1]}}function NV(r){var e=r.dimensions;return e[0]==="lng"&&e[1]==="lat"}var hne=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a;if(n.eachComponent("visualMap",function(s){s.eachTargetSeries(function(l){l===t&&(a=s)})}),RV.NODE_ENV!=="production"&&!a)throw new Error("Heatmap must use with visualMap");this._progressiveEls=null,this.group.removeAll();var o=t.coordinateSystem;o.type==="cartesian2d"||o.type==="calendar"?this._renderOnCartesianAndCalendar(t,i,0,t.getData().count()):NV(o)&&this._renderOnGeo(o,t,a,i)},e.prototype.incrementalPrepareRender=function(t,n,i){this.group.removeAll()},e.prototype.incrementalRender=function(t,n,i,a){var o=n.coordinateSystem;o&&(NV(o)?this.render(n,i,a):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(n,a,t.start,t.end,!0)))},e.prototype.eachRendered=function(t){Vl(this._progressiveEls||this.group,t)},e.prototype._renderOnCartesianAndCalendar=function(t,n,i,a,o){var s=t.coordinateSystem,l=Wc(s,"cartesian2d"),u,d,f,g;if(l){var m=s.getAxis("x"),_=s.getAxis("y");if(RV.NODE_ENV!=="production"){if(!(m.type==="category"&&_.type==="category"))throw new Error("Heatmap on cartesian must have two category axes");if(!(m.onBand&&_.onBand))throw new Error("Heatmap on cartesian must have two axes with boundaryGap true")}u=m.getBandWidth()+.5,d=_.getBandWidth()+.5,f=m.scale.getExtent(),g=_.scale.getExtent()}for(var x=this.group,w=t.getData(),C=t.getModel(["emphasis","itemStyle"]).getItemStyle(),A=t.getModel(["blur","itemStyle"]).getItemStyle(),L=t.getModel(["select","itemStyle"]).getItemStyle(),O=t.get(["itemStyle","borderRadius"]),V=ni(t),F=t.getModel("emphasis"),$=F.get("focus"),H=F.get("blurScope"),Z=F.get("disabled"),j=l?[w.mapDimension("x"),w.mapDimension("y"),w.mapDimension("value")]:[w.mapDimension("time"),w.mapDimension("value")],Y=i;Yf[1]||feg[1])continue;var le=s.dataToPoint([ue,fe]);se=new Ar({shape:{x:le[0]-u/2,y:le[1]-d/2,width:u,height:d},style:ae})}else{if(isNaN(w.get(j[1],Y)))continue;se=new Ar({z2:1,shape:s.dataToRect([w.get(j[0],Y)]).contentShape,style:ae})}if(w.hasItemOption){var ge=w.getItemModel(Y),xe=ge.getModel("emphasis");C=xe.getModel("itemStyle").getItemStyle(),A=ge.getModel(["blur","itemStyle"]).getItemStyle(),L=ge.getModel(["select","itemStyle"]).getItemStyle(),O=ge.get(["itemStyle","borderRadius"]),$=xe.get("focus"),H=xe.get("blurScope"),Z=xe.get("disabled"),V=ni(ge)}se.shape.r=O;var Me=t.getRawValue(Y),Ve="-";Me&&Me[2]!=null&&(Ve=Me[2]+""),Ci(se,V,{labelFetcher:t,labelDataIndex:Y,defaultOpacity:ae.opacity,defaultText:Ve}),se.ensureState("emphasis").style=C,se.ensureState("blur").style=A,se.ensureState("select").style=L,Sn(se,$,H,Z),se.incremental=o,o&&(se.states.emphasis.hoverLayer=!0),x.add(se),w.setItemGraphicEl(Y,se),this._progressiveEls&&this._progressiveEls.push(se)}},e.prototype._renderOnGeo=function(t,n,i,a){var o=i.targetVisuals.inRange,s=i.targetVisuals.outOfRange,l=n.getData(),u=this._hmLayer||this._hmLayer||new lne;u.blurSize=n.get("blurSize"),u.pointSize=n.get("pointSize"),u.minOpacity=n.get("minOpacity"),u.maxOpacity=n.get("maxOpacity");var d=t.getViewRect().clone(),f=t.getRoamTransform();d.applyTransform(f);var g=Math.max(d.x,0),m=Math.max(d.y,0),_=Math.min(d.width+d.x,a.getWidth()),x=Math.min(d.height+d.y,a.getHeight()),w=_-g,C=x-m,A=[l.mapDimension("lng"),l.mapDimension("lat"),l.mapDimension("value")],L=l.mapArray(A,function($,H,Z){var j=t.dataToPoint([$,H]);return j[0]-=g,j[1]-=m,j.push(Z),j}),O=i.getExtent(),V=i.type==="visualMap.continuous"?cne(O,i.option.range):une(O,i.getPieceList(),i.option.selected);u.update(L,w,C,o.color.getNormalizer(),{inRange:o.color.getColorMapper(),outOfRange:s.color.getColorMapper()},V);var F=new di({style:{width:w,height:C,x:g,y:m,image:u.canvas},silent:!0});this.group.add(F)},e.type="heatmap",e}(Jr),dne=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.getInitialData=function(t,n){return Ks(null,this,{generateCoord:"value"})},e.prototype.preventIncremental=function(){var t=bd.get(this.get("coordinateSystem"));if(t&&t.dimensions)return t.dimensions[0]==="lng"&&t.dimensions[1]==="lat"},e.type="series.heatmap",e.dependencies=["grid","geo","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:"#212121"}}},e}(on);function fne(r){r.registerChartView(hne),r.registerSeriesModel(dne)}var pne=["itemStyle","borderWidth"],OV=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],NE=new Zs,gne=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group,o=t.getData(),s=this._data,l=t.coordinateSystem,u=l.getBaseAxis(),d=u.isHorizontal(),f=l.master.getRect(),g={ecSize:{width:i.getWidth(),height:i.getHeight()},seriesModel:t,coordSys:l,coordSysExtent:[[f.x,f.x+f.width],[f.y,f.y+f.height]],isHorizontal:d,valueDim:OV[+d],categoryDim:OV[1-+d]};o.diff(s).add(function(_){if(o.hasValue(_)){var x=UV(o,_),w=zV(o,_,x,g),C=HV(o,g,w);o.setItemGraphicEl(_,C),a.add(C),ZV(C,g,w)}}).update(function(_,x){var w=s.getItemGraphicEl(x);if(!o.hasValue(_)){a.remove(w);return}var C=UV(o,_),A=zV(o,_,C,g),L=qV(o,A);w&&L!==w.__pictorialShapeStr&&(a.remove(w),o.setItemGraphicEl(_,null),w=null),w?wne(w,g,A):w=HV(o,g,A,!0),o.setItemGraphicEl(_,w),w.__pictorialSymbolMeta=A,a.add(w),ZV(w,g,A)}).remove(function(_){var x=s.getItemGraphicEl(_);x&&WV(s,_,x.__pictorialSymbolMeta.animationModel,x)}).execute();var m=t.get("clip",!0)?Sg(t.coordinateSystem,!1,t):null;return m?a.setClipPath(m):a.removeClipPath(),this._data=o,this.group},e.prototype.remove=function(t,n){var i=this.group,a=this._data;t.get("animation")?a&&a.eachItemGraphicEl(function(o){WV(a,jt(o).dataIndex,t,o)}):i.removeAll()},e.type="pictorialBar",e}(Jr);function zV(r,e,t,n){var i=r.getItemLayout(e),a=t.get("symbolRepeat"),o=t.get("symbolClip"),s=t.get("symbolPosition")||"start",l=t.get("symbolRotate"),u=(l||0)*Math.PI/180||0,d=t.get("symbolPatternSize")||2,f=t.isAnimationEnabled(),g={dataIndex:e,layout:i,itemModel:t,symbolType:r.getItemVisual(e,"symbol")||"circle",style:r.getItemVisual(e,"style"),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:t.get("symbolRepeatDirection"),symbolPatternSize:d,rotation:u,animationModel:f?t:null,hoverScale:f&&t.get(["emphasis","scale"]),z2:t.getShallow("z",!0)||0};vne(t,a,i,n,g),mne(r,e,i,a,o,g.boundingLength,g.pxSign,d,n,g),yne(t,g.symbolScale,u,n,g);var m=g.symbolSize,_=Pc(t.get("symbolOffset"),m);return _ne(t,m,i,a,o,_,s,g.valueLineWidth,g.boundingLength,g.repeatCutLength,n,g),g}function vne(r,e,t,n,i){var a=n.valueDim,o=r.get("symbolBoundingData"),s=n.coordSys.getOtherAxis(n.coordSys.getBaseAxis()),l=s.toGlobalCoord(s.dataToCoord(0)),u=1-+(t[a.wh]<=0),d;if(Ze(o)){var f=[OE(s,o[0])-l,OE(s,o[1])-l];f[1]=0?1:-1:d>0?1:-1}function OE(r,e){return r.toGlobalCoord(r.dataToCoord(r.scale.parse(e)))}function mne(r,e,t,n,i,a,o,s,l,u){var d=l.valueDim,f=l.categoryDim,g=Math.abs(t[f.wh]),m=r.getItemVisual(e,"symbolSize"),_;Ze(m)?_=m.slice():m==null?_=["100%","100%"]:_=[m,m],_[f.index]=nt(_[f.index],g),_[d.index]=nt(_[d.index],n?g:Math.abs(a)),u.symbolSize=_;var x=u.symbolScale=[_[0]/s,_[1]/s];x[d.index]*=(l.isHorizontal?-1:1)*o}function yne(r,e,t,n,i){var a=r.get(pne)||0;a&&(NE.attr({scaleX:e[0],scaleY:e[1],rotation:t}),NE.updateTransform(),a/=NE.getLineScale(),a*=e[n.valueDim.index]),i.valueLineWidth=a||0}function _ne(r,e,t,n,i,a,o,s,l,u,d,f){var g=d.categoryDim,m=d.valueDim,_=f.pxSign,x=Math.max(e[m.index]+s,0),w=x;if(n){var C=Math.abs(l),A=Gn(r.get("symbolMargin"),"15%")+"",L=!1;A.lastIndexOf("!")===A.length-1&&(L=!0,A=A.slice(0,A.length-1));var O=nt(A,e[m.index]),V=Math.max(x+O*2,0),F=L?0:O*2,$=Tw(n),H=$?n:jV((C+F)/V),Z=C-H*x;O=Z/2/(L?H:Math.max(H-1,1)),V=x+O*2,F=L?0:O*2,!$&&n!=="fixed"&&(H=u?jV((Math.abs(u)+F)/V):0),w=H*V-F,f.repeatTimes=H,f.symbolMargin=O}var j=_*(w/2),Y=f.pathPosition=[];Y[g.index]=t[g.wh]/2,Y[m.index]=o==="start"?j:o==="end"?l-j:l/2,a&&(Y[0]+=a[0],Y[1]+=a[1]);var se=f.bundlePosition=[];se[g.index]=t[g.xy],se[m.index]=t[m.xy];var ae=f.barRectShape=Ge({},t);ae[m.wh]=_*Math.max(Math.abs(t[m.wh]),Math.abs(Y[m.index]+j)),ae[g.wh]=t[g.wh];var ue=f.clipShape={};ue[g.xy]=-t[g.xy],ue[g.wh]=d.ecSize[g.wh],ue[m.xy]=0,ue[m.wh]=t[m.wh]}function BV(r){var e=r.symbolPatternSize,t=qn(r.symbolType,-e/2,-e/2,e,e);return t.attr({culling:!0}),t.type!=="image"&&t.setStyle({strokeNoScale:!0}),t}function VV(r,e,t,n){var i=r.__pictorialBundle,a=t.symbolSize,o=t.valueLineWidth,s=t.pathPosition,l=e.valueDim,u=t.repeatTimes||0,d=0,f=a[e.valueDim.index]+o+t.symbolMargin*2;for(zE(r,function(x){x.__pictorialAnimationIndex=d,x.__pictorialRepeatTimes=u,d0:C<0)&&(A=u-1-x),w[l.index]=f*(A-u/2+.5)+s[l.index],{x:w[0],y:w[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation}}}function FV(r,e,t,n){var i=r.__pictorialBundle,a=r.__pictorialMainPath;a?Wd(a,null,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:t.symbolScale[0],scaleY:t.symbolScale[1],rotation:t.rotation},t,n):(a=r.__pictorialMainPath=BV(t),i.add(a),Wd(a,{x:t.pathPosition[0],y:t.pathPosition[1],scaleX:0,scaleY:0,rotation:t.rotation},{scaleX:t.symbolScale[0],scaleY:t.symbolScale[1]},t,n))}function $V(r,e,t){var n=Ge({},e.barRectShape),i=r.__pictorialBarRect;i?Wd(i,null,{shape:n},e,t):(i=r.__pictorialBarRect=new Ar({z2:2,shape:n,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),i.disableMorphing=!0,r.add(i))}function GV(r,e,t,n){if(t.symbolClip){var i=r.__pictorialClipPath,a=Ge({},t.clipShape),o=e.valueDim,s=t.animationModel,l=t.dataIndex;if(i)Or(i,{shape:a},s,l);else{a[o.wh]=0,i=new Ar({shape:a}),r.__pictorialBundle.setClipPath(i),r.__pictorialClipPath=i;var u={};u[o.wh]=t.clipShape[o.wh],Ec[n?"updateProps":"initProps"](i,{shape:u},s,l)}}}function UV(r,e){var t=r.getItemModel(e);return t.getAnimationDelayParams=bne,t.isAnimationEnabled=xne,t}function bne(r){return{index:r.__pictorialAnimationIndex,count:r.__pictorialRepeatTimes}}function xne(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function HV(r,e,t,n){var i=new qt,a=new qt;return i.add(a),i.__pictorialBundle=a,a.x=t.bundlePosition[0],a.y=t.bundlePosition[1],t.symbolRepeat?VV(i,e,t):FV(i,e,t),$V(i,t,n),GV(i,e,t,n),i.__pictorialShapeStr=qV(r,t),i.__pictorialSymbolMeta=t,i}function wne(r,e,t){var n=t.animationModel,i=t.dataIndex,a=r.__pictorialBundle;Or(a,{x:t.bundlePosition[0],y:t.bundlePosition[1]},n,i),t.symbolRepeat?VV(r,e,t,!0):FV(r,e,t,!0),$V(r,t,!0),GV(r,e,t,!0)}function WV(r,e,t,n){var i=n.__pictorialBarRect;i&&i.removeTextContent();var a=[];zE(n,function(o){a.push(o)}),n.__pictorialMainPath&&a.push(n.__pictorialMainPath),n.__pictorialClipPath&&(t=null),Q(a,function(o){Bl(o,{scaleX:0,scaleY:0},t,e,function(){n.parent&&n.parent.remove(n)})}),r.setItemGraphicEl(e,null)}function qV(r,e){return[r.getItemVisual(e.dataIndex,"symbol")||"none",!!e.symbolRepeat,!!e.symbolClip].join(":")}function zE(r,e,t){Q(r.__pictorialBundle.children(),function(n){n!==r.__pictorialBarRect&&e.call(t,n)})}function Wd(r,e,t,n,i,a){e&&r.attr(e),n.symbolClip&&!i?t&&r.attr(t):t&&Ec[i?"updateProps":"initProps"](r,t,n.animationModel,n.dataIndex,a)}function ZV(r,e,t){var n=t.dataIndex,i=t.itemModel,a=i.getModel("emphasis"),o=a.getModel("itemStyle").getItemStyle(),s=i.getModel(["blur","itemStyle"]).getItemStyle(),l=i.getModel(["select","itemStyle"]).getItemStyle(),u=i.getShallow("cursor"),d=a.get("focus"),f=a.get("blurScope"),g=a.get("scale");zE(r,function(x){if(x instanceof di){var w=x.style;x.useStyle(Ge({image:w.image,x:w.x,y:w.y,width:w.width,height:w.height},t.style))}else x.useStyle(t.style);var C=x.ensureState("emphasis");C.style=o,g&&(C.scaleX=x.scaleX*1.1,C.scaleY=x.scaleY*1.1),x.ensureState("blur").style=s,x.ensureState("select").style=l,u&&(x.cursor=u),x.z2=t.z2});var m=e.valueDim.posDesc[+(t.boundingLength>0)],_=r.__pictorialBarRect;_.ignoreClip=!0,Ci(_,ni(i),{labelFetcher:e.seriesModel,labelDataIndex:n,defaultText:Od(e.seriesModel.getData(),n),inheritColor:t.style.fill,defaultOpacity:t.style.opacity,defaultOutsidePosition:m}),Sn(r,d,f,a.get("disabled"))}function jV(r){var e=Math.round(r);return Math.abs(r-e)<1e-4?e:Math.ceil(r)}var Sne=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.hasSymbolVisual=!0,t.defaultSymbol="roundRect",t}return e.prototype.getInitialData=function(t){return t.stack=null,r.prototype.getInitialData.apply(this,arguments)},e.type="series.pictorialBar",e.dependencies=["grid"],e.defaultOption=Fl(Eg.defaultOption,{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:"#212121"}}}),e}(Eg);function Tne(r){r.registerChartView(gne),r.registerSeriesModel(Sne),r.registerLayout(r.PRIORITY.VISUAL.LAYOUT,er(iN,"pictorialBar")),r.registerLayout(r.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,aN("pictorialBar"))}var Ene=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._layers=[],t}return e.prototype.render=function(t,n,i){var a=t.getData(),o=this,s=this.group,l=t.getLayerSeries(),u=a.getLayout("layoutInfo"),d=u.rect,f=u.boundaryGap;s.x=0,s.y=d.y+f[0];function g(w){return w.name}var m=new Ys(this._layersSeries||[],l,g,g),_=[];m.add(pt(x,this,"add")).update(pt(x,this,"update")).remove(pt(x,this,"remove")).execute();function x(w,C,A){var L=o._layers;if(w==="remove"){s.remove(L[C]);return}for(var O=[],V=[],F,$=l[C].indices,H=0;H<$.length;H++){var Z=a.getItemLayout($[H]),j=Z.x,Y=Z.y0,se=Z.y;O.push(j,Y),V.push(j,Y+se),F=a.getItemVisual($[H],"style")}var ae,ue=a.getItemLayout($[0]),fe=t.getModel("label"),le=fe.get("margin"),ge=t.getModel("emphasis");if(w==="add"){var xe=_[C]=new qt;ae=new wO({shape:{points:O,stackedOnPoints:V,smooth:.4,stackedOnSmooth:.4,smoothConstraint:!1},z2:0}),xe.add(ae),s.add(xe),t.isAnimationEnabled()&&ae.setClipPath(Cne(ae.getBoundingRect(),t,function(){ae.removeClipPath()}))}else{var xe=L[A];ae=xe.childAt(0),s.add(xe),_[C]=xe,Or(ae,{shape:{points:O,stackedOnPoints:V}},t),Go(ae)}Ci(ae,ni(t),{labelDataIndex:$[H-1],defaultText:a.getName($[H-1]),inheritColor:F.fill},{normal:{verticalAlign:"middle"}}),ae.setTextConfig({position:null,local:!0});var Me=ae.getTextContent();Me&&(Me.x=ue.x-le,Me.y=ue.y0+ue.y/2),ae.useStyle(F),a.setItemGraphicEl(C,ae),Ei(ae,t),Sn(ae,ge.get("focus"),ge.get("blurScope"),ge.get("disabled"))}this._layersSeries=l,this._layers=_},e.type="themeRiver",e}(Jr);function Cne(r,e,t){var n=new Ar({shape:{x:r.x-10,y:r.y-10,width:0,height:r.height+20}});return yn(n,{shape:{x:r.x-50,width:r.width+100,height:r.height+20}},e,t),n}var BE=2,Ane=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t){r.prototype.init.apply(this,arguments),this.legendVisualProvider=new Ag(pt(this.getData,this),pt(this.getRawData,this))},e.prototype.fixData=function(t){var n=t.length,i={},a=Mw(t,function(g){return i.hasOwnProperty(g[0]+"")||(i[g[0]+""]=-1),g[2]}),o=[];a.buckets.each(function(g,m){o.push({name:m,dataList:g})});for(var s=o.length,l=0;la&&(a=s),n.push(s)}for(var u=0;ua&&(a=f)}return{y0:i,max:a}}function Ine(r){r.registerChartView(Ene),r.registerSeriesModel(Ane),r.registerLayout(Dne),r.registerProcessor(Cg("themeRiver"))}var kne=2,Lne=4,YV=function(r){ze(e,r);function e(t,n,i,a){var o=r.call(this)||this;o.z2=kne,o.textConfig={inside:!0},jt(o).seriesIndex=n.seriesIndex;var s=new Dr({z2:Lne,silent:t.getModel().get(["label","silent"])});return o.setTextContent(s),o.updateData(!0,t,n,i,a),o}return e.prototype.updateData=function(t,n,i,a,o){this.node=n,n.piece=this,i=i||this._seriesModel,a=a||this._ecModel;var s=this;jt(s).dataIndex=n.dataIndex;var l=n.getModel(),u=l.getModel("emphasis"),d=n.getLayout(),f=Ge({},d);f.label=null;var g=n.getVisual("style");g.lineJoin="bevel";var m=n.getVisual("decal");m&&(g.decal=Md(m,o));var _=qc(l.getModel("itemStyle"),f,!0);Ge(f,_),Q(Qi,function(A){var L=s.ensureState(A),O=l.getModel([A,"itemStyle"]);L.style=O.getItemStyle();var V=qc(O,f);V&&(L.shape=V)}),t?(s.setShape(f),s.shape.r=d.r0,yn(s,{shape:{r:d.r}},i,n.dataIndex)):(Or(s,{shape:f},i),Go(s)),s.useStyle(g),this._updateLabel(i);var x=l.getShallow("cursor");x&&s.attr("cursor",x),this._seriesModel=i||this._seriesModel,this._ecModel=a||this._ecModel;var w=u.get("focus"),C=w==="relative"?ap(n.getAncestorsIndices(),n.getDescendantIndices()):w==="ancestor"?n.getAncestorsIndices():w==="descendant"?n.getDescendantIndices():w;Sn(this,C,u.get("blurScope"),u.get("disabled"))},e.prototype._updateLabel=function(t){var n=this,i=this.node.getModel(),a=i.getModel("label"),o=this.node.getLayout(),s=o.endAngle-o.startAngle,l=(o.startAngle+o.endAngle)/2,u=Math.cos(l),d=Math.sin(l),f=this,g=f.getTextContent(),m=this.node.dataIndex,_=a.get("minAngle")/180*Math.PI,x=a.get("show")&&!(_!=null&&Math.abs(s)<_);g.ignore=!x,Q(Ip,function(C){var A=C==="normal"?i.getModel("label"):i.getModel([C,"label"]),L=C==="normal",O=L?g:g.ensureState(C),V=t.getFormattedLabel(m,C);L&&(V=V||n.node.name),O.style=an(A,{},null,C!=="normal",!0),V&&(O.style.text=V);var F=A.get("show");F!=null&&!L&&(O.ignore=!F);var $=w(A,"position"),H=L?f:f.states[C],Z=H.style.fill;H.textConfig={outsideFill:A.get("color")==="inherit"?Z:null,inside:$!=="outside"};var j,Y=w(A,"distance")||0,se=w(A,"align"),ae=w(A,"rotate"),ue=Math.PI*.5,fe=Math.PI*1.5,le=$a(ae==="tangential"?Math.PI/2-l:l),ge=le>ue&&!Sp(le-ue)&&le0?(o.virtualPiece?o.virtualPiece.updateData(!1,A,t,n,i):(o.virtualPiece=new YV(A,t,n,i),d.add(o.virtualPiece)),L.piece.off("click"),o.virtualPiece.on("click",function(O){o._rootToNode(L.parentNode)})):o.virtualPiece&&(d.remove(o.virtualPiece),o.virtualPiece=null)}},e.prototype._initEvents=function(){var t=this;this.group.off("click"),this.group.on("click",function(n){var i=!1,a=t.seriesModel.getViewRoot();a.eachNode(function(o){if(!i&&o.piece&&o.piece===n.target){var s=o.getModel().get("nodeClick");if(s==="rootToNode")t._rootToNode(o);else if(s==="link"){var l=o.getModel(),u=l.get("link");if(u){var d=l.get("target",!0)||"_blank";Ky(u,d)}}i=!0}})})},e.prototype._rootToNode=function(t){t!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:VE,from:this.uid,seriesId:this.seriesModel.id,targetNode:t})},e.prototype.containPoint=function(t,n){var i=n.getData(),a=i.getItemLayout(0);if(a){var o=t[0]-a.cx,s=t[1]-a.cy,l=Math.sqrt(o*o+s*s);return l<=a.r&&l>=a.r0}},e.type="sunburst",e}(Jr),One=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.ignoreStyleOnData=!0,t}return e.prototype.getInitialData=function(t,n){var i={name:t.name,children:t.data};QV(i);var a=this._levelModels=je(t.levels||[],function(l){return new qr(l,this,n)},this),o=zT.createTree(i,this,s);function s(l){l.wrapMethod("getItemModel",function(u,d){var f=o.getNodeByDataIndex(d),g=a[f.depth];return g&&(u.parentModel=g),u})}return o.data},e.prototype.optionUpdated=function(){this.resetViewRoot()},e.prototype.getDataParams=function(t){var n=r.prototype.getDataParams.apply(this,arguments),i=this.getData().tree.getNodeByDataIndex(t);return n.treePathInfo=r0(i,this),n},e.prototype.getLevelModel=function(t){return this._levelModels&&this._levelModels[t.depth]},e.prototype.getViewRoot=function(){return this._viewRoot},e.prototype.resetViewRoot=function(t){t?this._viewRoot=t:t=this._viewRoot;var n=this.getRawData().tree.root;(!t||t!==n&&!n.contains(t))&&(this._viewRoot=n)},e.prototype.enableAriaDecal=function(){sB(this)},e.type="series.sunburst",e.defaultOption={z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:"descendant"},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,data:[],sort:"desc"},e}(on);function QV(r){var e=0;Q(r.children,function(n){QV(n);var i=n.value;Ze(i)&&(i=i[0]),e+=i});var t=r.value;Ze(t)&&(t=t[0]),(t==null||isNaN(t))&&(t=e),t<0&&(t=0),Ze(r.value)?r.value[0]=t:r.value=t}var eF=Math.PI/180;function zne(r,e,t){e.eachSeriesByType(r,function(n){var i=n.get("center"),a=n.get("radius");Ze(a)||(a=[0,a]),Ze(i)||(i=[i,i]);var o=t.getWidth(),s=t.getHeight(),l=Math.min(o,s),u=nt(i[0],o),d=nt(i[1],s),f=nt(a[0],l/2),g=nt(a[1],l/2),m=-n.get("startAngle")*eF,_=n.get("minAngle")*eF,x=n.getData().tree.root,w=n.getViewRoot(),C=w.depth,A=n.get("sort");A!=null&&tF(w,A);var L=0;Q(w.children,function(le){!isNaN(le.getValue())&&L++});var O=w.getValue(),V=Math.PI/(O||L)*2,F=w.depth>0,$=w.height-(F?-1:1),H=(g-f)/($||1),Z=n.get("clockwise"),j=n.get("stillShowZeroSum"),Y=Z?1:-1,se=function(le,ge){if(le){var xe=ge;if(le!==x){var Me=le.getValue(),Ve=O===0&&j?V:Me*V;Ve<_&&(Ve=_),xe=ge+Y*Ve;var Fe=le.depth-C-(F?-1:1),Xe=f+H*Fe,ot=f+H*(Fe+1),et=n.getLevelModel(le);if(et){var it=et.get("r0",!0),kt=et.get("r",!0),Ht=et.get("radius",!0);Ht!=null&&(it=Ht[0],kt=Ht[1]),it!=null&&(Xe=nt(it,l/2)),kt!=null&&(ot=nt(kt,l/2))}le.setLayout({angle:Ve,startAngle:ge,endAngle:xe,clockwise:Z,cx:u,cy:d,r0:Xe,r:ot})}if(le.children&&le.children.length){var lt=0;Q(le.children,function(st){lt+=se(st,ge+lt)})}return xe-ge}};if(F){var ae=f,ue=f+H,fe=Math.PI*2;x.setLayout({angle:fe,startAngle:m,endAngle:m+fe,clockwise:Z,cx:u,cy:d,r0:ae,r:ue})}se(w,m)})}function tF(r,e){var t=r.children||[];r.children=Bne(t,e),t.length&&Q(r.children,function(n){tF(n,e)})}function Bne(r,e){if(It(e)){var t=je(r,function(i,a){var o=i.getValue();return{params:{depth:i.depth,height:i.height,dataIndex:i.dataIndex,getValue:function(){return o}},index:a}});return t.sort(function(i,a){return e(i.params,a.params)}),je(t,function(i){return r[i.index]})}else{var n=e==="asc";return r.sort(function(i,a){var o=(i.getValue()-a.getValue())*(n?1:-1);return o===0?(i.dataIndex-a.dataIndex)*(n?-1:1):o})}}function Vne(r){var e={};function t(n,i,a){for(var o=n;o&&o.depth>1;)o=o.parentNode;var s=i.getColorFromPalette(o.name||o.dataIndex+"",e);return n.depth>1&&ut(s)&&(s=Yx(s,(n.depth-1)/(a-1)*.5)),s}r.eachSeriesByType("sunburst",function(n){var i=n.getData(),a=i.tree;a.eachNode(function(o){var s=o.getModel(),l=s.getModel("itemStyle").getItemStyle();l.fill||(l.fill=t(o,n,a.root.height));var u=i.ensureUniqueItemVisual(o.dataIndex,"style");Ge(u,l)})})}function Fne(r){r.registerChartView(Nne),r.registerSeriesModel(One),r.registerLayout(er(zne,"sunburst")),r.registerProcessor(er(Cg,"sunburst")),r.registerVisual(Vne),Rne(r)}var rF={color:"fill",borderColor:"stroke"},$ne={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},tl=Cr(),Gne=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){this.currentZLevel=this.get("zlevel",!0),this.currentZ=this.get("z",!0)},e.prototype.getInitialData=function(t,n){return Ks(null,this)},e.prototype.getDataParams=function(t,n,i){var a=r.prototype.getDataParams.call(this,t,n);return i&&(a.info=tl(i).info),a},e.type="series.custom",e.dependencies=["grid","polar","geo","singleAxis","calendar"],e.defaultOption={coordinateSystem:"cartesian2d",z:2,legendHoverLink:!0,clip:!1},e}(on);function Une(r,e){return e=e||[0,0],je(["x","y"],function(t,n){var i=this.getAxis(t),a=e[n],o=r[n]/2;return i.type==="category"?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function Hne(r){var e=r.master.getRect();return{coordSys:{type:"cartesian2d",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:pt(Une,r)}}}function Wne(r,e){return e=e||[0,0],je([0,1],function(t){var n=e[t],i=r[t]/2,a=[],o=[];return a[t]=n-i,o[t]=n+i,a[1-t]=o[1-t]=e[1-t],Math.abs(this.dataToPoint(a)[t]-this.dataToPoint(o)[t])},this)}function qne(r){var e=r.getBoundingRect();return{coordSys:{type:"geo",x:e.x,y:e.y,width:e.width,height:e.height,zoom:r.getZoom()},api:{coord:function(t){return r.dataToPoint(t)},size:pt(Wne,r)}}}function Zne(r,e){var t=this.getAxis(),n=e instanceof Array?e[0]:e,i=(r instanceof Array?r[0]:r)/2;return t.type==="category"?t.getBandWidth():Math.abs(t.dataToCoord(n-i)-t.dataToCoord(n+i))}function jne(r){var e=r.getRect();return{coordSys:{type:"singleAxis",x:e.x,y:e.y,width:e.width,height:e.height},api:{coord:function(t){return r.dataToPoint(t)},size:pt(Zne,r)}}}function Xne(r,e){return e=e||[0,0],je(["Radius","Angle"],function(t,n){var i="get"+t+"Axis",a=this[i](),o=e[n],s=r[n]/2,l=a.type==="category"?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return t==="Angle"&&(l=l*Math.PI/180),l},this)}function Yne(r){var e=r.getRadiusAxis(),t=r.getAngleAxis(),n=e.getExtent();return n[0]>n[1]&&n.reverse(),{coordSys:{type:"polar",cx:r.cx,cy:r.cy,r:n[1],r0:n[0]},api:{coord:function(i){var a=e.dataToRadius(i[0]),o=t.dataToAngle(i[1]),s=r.coordToPoint([a,o]);return s.push(a,o*Math.PI/180),s},size:pt(Xne,r)}}}function Kne(r){var e=r.getRect(),t=r.getRangeInfo();return{coordSys:{type:"calendar",x:e.x,y:e.y,width:e.width,height:e.height,cellWidth:r.getCellWidth(),cellHeight:r.getCellHeight(),rangeInfo:{start:t.start,end:t.end,weeks:t.weeks,dayCount:t.allDay}},api:{coord:function(n,i){return r.dataToPoint(n,i)}}}}var Jne={},nF={};function iF(r,e,t,n){return r&&(r.legacy||r.legacy!==!1&&!t&&!n&&e!=="tspan"&&(e==="text"||gt(r,"text")))}function aF(r,e,t){var n=r,i,a,o;if(e==="text")o=n;else{o={},gt(n,"text")&&(o.text=n.text),gt(n,"rich")&&(o.rich=n.rich),gt(n,"textFill")&&(o.fill=n.textFill),gt(n,"textStroke")&&(o.stroke=n.textStroke),gt(n,"fontFamily")&&(o.fontFamily=n.fontFamily),gt(n,"fontSize")&&(o.fontSize=n.fontSize),gt(n,"fontStyle")&&(o.fontStyle=n.fontStyle),gt(n,"fontWeight")&&(o.fontWeight=n.fontWeight),a={type:"text",style:o,silent:!0},i={};var s=gt(n,"textPosition");t?i.position=s?n.textPosition:"inside":s&&(i.position=n.textPosition),gt(n,"textPosition")&&(i.position=n.textPosition),gt(n,"textOffset")&&(i.offset=n.textOffset),gt(n,"textRotation")&&(i.rotation=n.textRotation),gt(n,"textDistance")&&(i.distance=n.textDistance)}return oF(o,r),Q(o.rich,function(l){oF(l,l)}),{textConfig:i,textContent:a}}function oF(r,e){e&&(e.font=e.textFont||e.font,gt(e,"textStrokeWidth")&&(r.lineWidth=e.textStrokeWidth),gt(e,"textAlign")&&(r.align=e.textAlign),gt(e,"textVerticalAlign")&&(r.verticalAlign=e.textVerticalAlign),gt(e,"textLineHeight")&&(r.lineHeight=e.textLineHeight),gt(e,"textWidth")&&(r.width=e.textWidth),gt(e,"textHeight")&&(r.height=e.textHeight),gt(e,"textBackgroundColor")&&(r.backgroundColor=e.textBackgroundColor),gt(e,"textPadding")&&(r.padding=e.textPadding),gt(e,"textBorderColor")&&(r.borderColor=e.textBorderColor),gt(e,"textBorderWidth")&&(r.borderWidth=e.textBorderWidth),gt(e,"textBorderRadius")&&(r.borderRadius=e.textBorderRadius),gt(e,"textBoxShadowColor")&&(r.shadowColor=e.textBoxShadowColor),gt(e,"textBoxShadowBlur")&&(r.shadowBlur=e.textBoxShadowBlur),gt(e,"textBoxShadowOffsetX")&&(r.shadowOffsetX=e.textBoxShadowOffsetX),gt(e,"textBoxShadowOffsetY")&&(r.shadowOffsetY=e.textBoxShadowOffsetY))}function sF(r,e,t){var n=r;n.textPosition=n.textPosition||t.position||"inside",t.offset!=null&&(n.textOffset=t.offset),t.rotation!=null&&(n.textRotation=t.rotation),t.distance!=null&&(n.textDistance=t.distance);var i=n.textPosition.indexOf("inside")>=0,a=r.fill||"#000";lF(n,e);var o=n.textFill==null;return i?o&&(n.textFill=t.insideFill||"#fff",!n.textStroke&&t.insideStroke&&(n.textStroke=t.insideStroke),!n.textStroke&&(n.textStroke=a),n.textStrokeWidth==null&&(n.textStrokeWidth=2)):(o&&(n.textFill=r.fill||t.outsideFill||"#000"),!n.textStroke&&t.outsideStroke&&(n.textStroke=t.outsideStroke)),n.text=e.text,n.rich=e.rich,Q(e.rich,function(s){lF(s,s)}),n}function lF(r,e){e&&(gt(e,"fill")&&(r.textFill=e.fill),gt(e,"stroke")&&(r.textStroke=e.fill),gt(e,"lineWidth")&&(r.textStrokeWidth=e.lineWidth),gt(e,"font")&&(r.font=e.font),gt(e,"fontStyle")&&(r.fontStyle=e.fontStyle),gt(e,"fontWeight")&&(r.fontWeight=e.fontWeight),gt(e,"fontSize")&&(r.fontSize=e.fontSize),gt(e,"fontFamily")&&(r.fontFamily=e.fontFamily),gt(e,"align")&&(r.textAlign=e.align),gt(e,"verticalAlign")&&(r.textVerticalAlign=e.verticalAlign),gt(e,"lineHeight")&&(r.textLineHeight=e.lineHeight),gt(e,"width")&&(r.textWidth=e.width),gt(e,"height")&&(r.textHeight=e.height),gt(e,"backgroundColor")&&(r.textBackgroundColor=e.backgroundColor),gt(e,"padding")&&(r.textPadding=e.padding),gt(e,"borderColor")&&(r.textBorderColor=e.borderColor),gt(e,"borderWidth")&&(r.textBorderWidth=e.borderWidth),gt(e,"borderRadius")&&(r.textBorderRadius=e.borderRadius),gt(e,"shadowColor")&&(r.textBoxShadowColor=e.shadowColor),gt(e,"shadowBlur")&&(r.textBoxShadowBlur=e.shadowBlur),gt(e,"shadowOffsetX")&&(r.textBoxShadowOffsetX=e.shadowOffsetX),gt(e,"shadowOffsetY")&&(r.textBoxShadowOffsetY=e.shadowOffsetY),gt(e,"textShadowColor")&&(r.textShadowColor=e.textShadowColor),gt(e,"textShadowBlur")&&(r.textShadowBlur=e.textShadowBlur),gt(e,"textShadowOffsetX")&&(r.textShadowOffsetX=e.textShadowOffsetX),gt(e,"textShadowOffsetY")&&(r.textShadowOffsetY=e.textShadowOffsetY))}function uF(r,e){if(Jne.NODE_ENV!=="production"){var t=r+"^_^"+e;nF[t]||(console.warn('[ECharts] DEPRECATED: "'+r+'" has been deprecated. '+e),nF[t]=!0)}}var wo={},cF={position:["x","y"],scale:["scaleX","scaleY"],origin:["originX","originY"]},hF=br(cF),v0=is(ss,function(r,e){return r[e]=1,r},{}),dF=ss.join(", "),m0=["","style","shape","extra"],qd=Cr();function FE(r,e,t,n,i){var a=r+"Animation",o=sd(r,n,i)||{},s=qd(e).userDuring;return o.duration>0&&(o.during=s?pt(nie,{el:e,userDuring:s}):null,o.setToFinal=!0,o.scope=r),Ge(o,t[a]),o}function y0(r,e,t,n){n=n||{};var i=n.dataIndex,a=n.isInit,o=n.clearStyle,s=t.isAnimationEnabled(),l=qd(r),u=e.style;l.userDuring=e.during;var d={},f={};if(aie(r,e,f),gF("shape",e,f),gF("extra",e,f),!a&&s&&(iie(r,e,d),pF("shape",r,e,d),pF("extra",r,e,d),oie(r,e,u,d)),f.style=u,Qne(r,f,o),tie(r,e),s)if(a){var g={};Q(m0,function(_){var x=_?e[_]:e;x&&x.enterFrom&&(_&&(g[_]=g[_]||{}),Ge(_?g[_]:g,x.enterFrom))});var m=FE("enter",r,e,t,i);m.duration>0&&r.animateFrom(g,m)}else eie(r,e,i||0,t,d);fF(r,e),u?r.dirty():r.markRedraw()}function fF(r,e){for(var t=qd(r).leaveToProps,n=0;n0&&r.animateFrom(i,a)}}function tie(r,e){gt(e,"silent")&&(r.silent=e.silent),gt(e,"ignore")&&(r.ignore=e.ignore),r instanceof uo&>(e,"invisible")&&(r.invisible=e.invisible),r instanceof vr&>(e,"autoBatch")&&(r.autoBatch=e.autoBatch)}var Ts={},rie={setTransform:function(r,e){return wo.NODE_ENV!=="production"&&Ot(gt(v0,r),"Only "+dF+" available in `setTransform`."),Ts.el[r]=e,this},getTransform:function(r){return wo.NODE_ENV!=="production"&&Ot(gt(v0,r),"Only "+dF+" available in `getTransform`."),Ts.el[r]},setShape:function(r,e){wo.NODE_ENV!=="production"&&Zd(r);var t=Ts.el,n=t.shape||(t.shape={});return n[r]=e,t.dirtyShape&&t.dirtyShape(),this},getShape:function(r){wo.NODE_ENV!=="production"&&Zd(r);var e=Ts.el.shape;if(e)return e[r]},setStyle:function(r,e){wo.NODE_ENV!=="production"&&Zd(r);var t=Ts.el,n=t.style;return n&&(wo.NODE_ENV!=="production"&&qu(e)&&wn("style."+r+" must not be assigned with NaN."),n[r]=e,t.dirtyStyle&&t.dirtyStyle()),this},getStyle:function(r){wo.NODE_ENV!=="production"&&Zd(r);var e=Ts.el.style;if(e)return e[r]},setExtra:function(r,e){wo.NODE_ENV!=="production"&&Zd(r);var t=Ts.el.extra||(Ts.el.extra={});return t[r]=e,this},getExtra:function(r){wo.NODE_ENV!=="production"&&Zd(r);var e=Ts.el.extra;if(e)return e[r]}};function Zd(r){if(wo.NODE_ENV!=="production"&&(r==="transition"||r==="enterFrom"||r==="leaveTo"))throw new Error('key must not be "'+r+'"')}function nie(){var r=this,e=r.el;if(e){var t=qd(e).userDuring,n=r.userDuring;if(t!==n){r.el=r.userDuring=null;return}Ts.el=e,n(rie)}}function pF(r,e,t,n){var i=t[r];if(i){var a=e[r],o;if(a){var s=t.transition,l=i.transition;if(l)if(!o&&(o=n[r]={}),nh(l))Ge(o,a);else for(var u=Xr(l),d=0;d=0){!o&&(o=n[r]={});for(var m=br(a),d=0;d=0)){var g=r.getAnimationStyleProps(),m=g?g.style:null;if(m){!a&&(a=n.style={});for(var _=br(t),u=0;u<_.length;u++){var d=_[u];if(m[d]){var f=i[d];a[d]=f}}}}}}}function sie(r,e){return Ri(r)?r!==e:r!=null&&isFinite(r)}var vF;wo.NODE_ENV!=="production"&&(vF=function(r,e){gt(v0,r)||wn("Prop `"+r+"` is not a permitted in `"+e+"`. Only `"+br(v0).join("`, `")+"` are permitted.")});var mF={},yF=Cr(),lie=["percent","easing","shape","style","extra"];function _F(r){r.stopAnimation("keyframe"),r.attr(yF(r))}function b0(r,e,t){if(!(!t.isAnimationEnabled()||!e)){if(Ze(e)){Q(e,function(s){b0(r,s,t)});return}var n=e.keyframes,i=e.duration;if(t&&i==null){var a=sd("enter",t,0);i=a&&a.duration}if(!(!n||!i)){var o=yF(r);Q(m0,function(s){if(!(s&&!r[s])){var l,u=!1;n.sort(function(d,f){return d.percent-f.percent}),Q(n,function(d){var f=r.animators,g=s?d[s]:d;if(mF.NODE_ENV!=="production"&&d.percent>=1&&(u=!0),!!g){var m=br(g);if(s||(m=$r(m,function(w){return hr(lie,w)<0})),!!m.length){l||(l=r.animate(s,e.loop,!0),l.scope="keyframe");for(var _=0;_=0?e.getStore().get(ge,fe):void 0}var xe=e.get(le.name,fe),Me=le&&le.ordinalMeta;return Me?Me.categories[xe]:xe}function F(ue,fe){ru.NODE_ENV!=="production"&&uF("api.style","Please write literal style directly instead."),fe==null&&(fe=u);var le=e.getItemVisual(fe,"style"),ge=le&&le.fill,xe=le&&le.opacity,Me=A(fe,nu).getItemStyle();ge!=null&&(Me.fill=ge),xe!=null&&(Me.opacity=xe);var Ve={inheritColor:ut(ge)?ge:"#000"},Fe=L(fe,nu),Xe=an(Fe,null,Ve,!1,!0);Xe.text=Fe.getShallow("show")?Zt(r.getFormattedLabel(fe,nu),Od(e,fe)):null;var ot=Gy(Fe,Ve,!1);return Z(ue,Me),Me=sF(Me,Xe,ot),ue&&H(Me,ue),Me.legacy=!0,Me}function $(ue,fe){ru.NODE_ENV!=="production"&&uF("api.styleEmphasis","Please write literal style directly instead."),fe==null&&(fe=u);var le=A(fe,rl).getItemStyle(),ge=L(fe,rl),xe=an(ge,null,null,!0,!0);xe.text=ge.getShallow("show")?no(r.getFormattedLabel(fe,rl),r.getFormattedLabel(fe,nu),Od(e,fe)):null;var Me=Gy(ge,null,!0);return Z(ue,le),le=sF(le,xe,Me),ue&&H(le,ue),le.legacy=!0,le}function H(ue,fe){for(var le in fe)gt(fe,le)&&(ue[le]=fe[le])}function Z(ue,fe){ue&&(ue.textFill&&(fe.textFill=ue.textFill),ue.textPosition&&(fe.textPosition=ue.textPosition))}function j(ue,fe){if(fe==null&&(fe=u),gt(rF,ue)){var le=e.getItemVisual(fe,"style");return le?le[rF[ue]]:null}if(gt($ne,ue))return e.getItemVisual(fe,ue)}function Y(ue){if(a.type==="cartesian2d"){var fe=a.getBaseAxis();return Vj(Bt({axis:fe},ue))}}function se(){return t.getCurrentSeriesIndices()}function ae(ue){return v1(ue,t)}}function gie(r){var e={};return Q(r.dimensions,function(t){var n=r.getDimensionInfo(t);if(!n.isExtraCoord){var i=n.coordDim,a=e[i]=e[i]||[];a[n.coordDimIndex]=r.getDimensionIndex(t)}}),e}function jE(r,e,t,n,i,a,o){if(!n){a.remove(e);return}var s=XE(r,e,t,n,i,a);return s&&o.setItemGraphicEl(t,s),s&&Sn(s,n.focus,n.blurScope,n.emphasisDisabled),s}function XE(r,e,t,n,i,a){ru.NODE_ENV!=="production"&&Ot(n,"should not have an null/undefined element setting");var o=-1,s=e;e&&SF(e,n,i)&&(o=hr(a.childrenRef(),e),e=null);var l=!e,u=e;u?u.clearStates():(u=qE(n),s&&hie(s,u)),n.morph===!1?u.disableMorphing=!0:u.disableMorphing&&(u.disableMorphing=!1),So.normal.cfg=So.normal.conOpt=So.emphasis.cfg=So.emphasis.conOpt=So.blur.cfg=So.blur.conOpt=So.select.cfg=So.select.conOpt=null,So.isLegacy=!1,mie(u,t,n,i,l,So),vie(u,t,n,i,l),ZE(r,u,t,n,So,i,l),gt(n,"info")&&(tl(u).info=n.info);for(var d=0;d=0?a.replaceAt(u,o):a.add(u),u}function SF(r,e,t){var n=tl(r),i=e.type,a=e.shape,o=e.style;return t.isUniversalTransitionEnabled()||i!=null&&i!==n.customGraphicType||i==="path"&&wie(a)&&AF(a)!==n.customPathData||i==="image"&>(o,"image")&&o.image!==n.customImagePath}function vie(r,e,t,n,i){var a=t.clipPath;if(a===!1)r&&r.getClipPath()&&r.removeClipPath();else if(a){var o=r.getClipPath();o&&SF(o,a,n)&&(o=null),o||(o=qE(a),ru.NODE_ENV!=="production"&&Ot(x0(o),"Only any type of `path` can be used in `clipPath`, rather than "+o.type+"."),r.setClipPath(o)),ZE(null,o,e,a,null,n,i)}}function mie(r,e,t,n,i,a){if(!r.isGroup){TF(t,null,a),TF(t,rl,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,l=a.blur.conOpt,u=a.select.conOpt;if(o!=null||s!=null||u!=null||l!=null){var d=r.getTextContent();if(o===!1)d&&r.removeTextContent();else{o=a.normal.conOpt=o||{type:"text"},d?d.clearStates():(d=qE(o),r.setTextContent(d)),ZE(null,d,e,o,null,n,i);for(var f=o&&o.style,g=0;g=d;m--){var _=e.childAt(m);_ie(e,_,i)}}}function _ie(r,e,t){e&&_0(e,tl(r).option,t)}function bie(r){new Ys(r.oldChildren,r.newChildren,EF,EF,r).add(CF).update(CF).remove(xie).execute()}function EF(r,e){var t=r&&r.name;return t??cie+e}function CF(r,e){var t=this.context,n=r!=null?t.newChildren[r]:null,i=e!=null?t.oldChildren[e]:null;XE(t.api,i,t.dataIndex,n,t.seriesModel,t.group)}function xie(r){var e=this.context,t=e.oldChildren[r];t&&_0(t,tl(t).option,e.seriesModel)}function AF(r){return r&&(r.pathData||r.d)}function wie(r){return r&&(gt(r,"pathData")||gt(r,"d"))}function Sie(r){r.registerChartView(die),r.registerSeriesModel(Gne)}var ih=Cr(),DF=Ut,KE=pt,JE=function(){function r(){this._dragging=!1,this.animationThreshold=15}return r.prototype.render=function(e,t,n,i){var a=t.get("value"),o=t.get("status");if(this._axisModel=e,this._axisPointerModel=t,this._api=n,!(!i&&this._lastValue===a&&this._lastStatus===o)){this._lastValue=a,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var u={};this.makeElOption(u,a,e,t,n);var d=u.graphicKey;d!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=d;var f=this._moveAnimation=this.determineAnimation(e,t);if(!s)s=this._group=new qt,this.createPointerEl(s,u,e,t),this.createLabelEl(s,u,e,t),n.getZr().add(s);else{var g=er(MF,t,f);this.updatePointerEl(s,u,g),this.updateLabelEl(s,u,g,t)}LF(s,t,!0),this._renderHandle(a)}},r.prototype.remove=function(e){this.clear(e)},r.prototype.dispose=function(e){this.clear(e)},r.prototype.determineAnimation=function(e,t){var n=t.get("animation"),i=e.axis,a=i.type==="category",o=t.get("snap");if(!o&&!a)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(a&&i.getBandWidth()>s)return!0;if(o){var l=yT(e).seriesDataCount,u=i.getExtent();return Math.abs(u[0]-u[1])/l>s}return!1}return n===!0},r.prototype.makeElOption=function(e,t,n,i,a){},r.prototype.createPointerEl=function(e,t,n,i){var a=t.pointer;if(a){var o=ih(e).pointerEl=new Ec[a.type](DF(t.pointer));e.add(o)}},r.prototype.createLabelEl=function(e,t,n,i){if(t.label){var a=ih(e).labelEl=new Dr(DF(t.label));e.add(a),kF(a,i)}},r.prototype.updatePointerEl=function(e,t,n){var i=ih(e).pointerEl;i&&t.pointer&&(i.setStyle(t.pointer.style),n(i,{shape:t.pointer.shape}))},r.prototype.updateLabelEl=function(e,t,n,i){var a=ih(e).labelEl;a&&(a.setStyle(t.label.style),n(a,{x:t.label.x,y:t.label.y}),kF(a,i))},r.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,n=this._api.getZr(),i=this._handle,a=t.getModel("handle"),o=t.get("status");if(!a.get("show")||!o||o==="hide"){i&&n.remove(i),this._handle=null;return}var s;this._handle||(s=!0,i=this._handle=$p(a.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(u){Os(u.event)},onmousedown:KE(this._onHandleDragMove,this,0,0),drift:KE(this._onHandleDragMove,this),ondragend:KE(this._onHandleDragEnd,this)}),n.add(i)),LF(i,t,!1),i.setStyle(a.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=a.get("size");Ze(l)||(l=[l,l]),i.scaleX=l[0]/2,i.scaleY=l[1]/2,Ed(this,"_doDispatchAxisPointer",a.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},r.prototype._moveHandleToValue=function(e,t){MF(this._axisPointerModel,!t&&this._moveAnimation,this._handle,QE(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},r.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var i=this.updateHandleTransform(QE(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=i,n.stopAnimation(),n.attr(QE(i)),ih(n).lastProp=null,this._doDispatchAxisPointer()}},r.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var t=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:t.cursorPoint[0],y:t.cursorPoint[1],tooltipOption:t.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},r.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var t=this._axisPointerModel.get("value");this._moveHandleToValue(t),this._api.dispatchAction({type:"hideTip"})}},r.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,i=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),i&&t.remove(i),this._group=null,this._handle=null,this._payloadInfo=null),eg(this,"_doDispatchAxisPointer")},r.prototype.doClear=function(){},r.prototype.buildLabel=function(e,t,n){return n=n||0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},r}();function MF(r,e,t,n){IF(ih(t).lastProp,n)||(ih(t).lastProp=n,e?Or(t,n,r):(t.stopAnimation(),t.attr(n)))}function IF(r,e){if(Nt(r)&&Nt(e)){var t=!0;return Q(e,function(n,i){t=t&&IF(r[i],n)}),!!t}else return r===e}function kF(r,e){r[e.get(["label","show"])?"show":"hide"]()}function QE(r){return{x:r.x||0,y:r.y||0,rotation:r.rotation||0}}function LF(r,e,t){var n=e.get("z"),i=e.get("zlevel");r&&r.traverse(function(a){a.type!=="group"&&(n!=null&&(a.z=n),i!=null&&(a.zlevel=i),a.silent=t)})}function e2(r){var e=r.get("type"),t=r.getModel(e+"Style"),n;return e==="line"?(n=t.getLineStyle(),n.fill=null):e==="shadow"&&(n=t.getAreaStyle(),n.stroke=null),n}function PF(r,e,t,n,i){var a=t.get("value"),o=RF(a,e.axis,e.ecModel,t.get("seriesDataIndices"),{precision:t.get(["label","precision"]),formatter:t.get(["label","formatter"])}),s=t.getModel("label"),l=gd(s.get("padding")||0),u=s.getFont(),d=bp(o,u),f=i.position,g=d.width+l[1]+l[3],m=d.height+l[0]+l[2],_=i.align;_==="right"&&(f[0]-=g),_==="center"&&(f[0]-=g/2);var x=i.verticalAlign;x==="bottom"&&(f[1]-=m),x==="middle"&&(f[1]-=m/2),Tie(f,g,m,n);var w=s.get("backgroundColor");(!w||w==="auto")&&(w=e.get(["axisLine","lineStyle","color"])),r.label={x:f[0],y:f[1],style:an(s,{text:o,font:u,fill:s.getTextColor(),padding:l,backgroundColor:w}),z2:10}}function Tie(r,e,t,n){var i=n.getWidth(),a=n.getHeight();r[0]=Math.min(r[0]+e,i)-e,r[1]=Math.min(r[1]+t,a)-t,r[0]=Math.max(r[0],0),r[1]=Math.max(r[1],0)}function RF(r,e,t,n,i){r=e.scale.parse(r);var a=e.scale.getLabel({value:r},{precision:i.precision}),o=i.formatter;if(o){var s={value:OS(e,{value:r}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};Q(n,function(l){var u=t.getSeriesByIndex(l.seriesIndex),d=l.dataIndexInside,f=u&&u.getDataParams(d);f&&s.seriesData.push(f)}),ut(o)?a=o.replace("{value}",a):It(o)&&(a=o(s))}return a}function t2(r,e,t){var n=za();return Yu(n,n,t.rotation),as(n,n,t.position),Ho([r.dataToCoord(e),(t.labelOffset||0)+(t.labelDirection||1)*(t.labelMargin||0)],n)}function NF(r,e,t,n,i,a){var o=oa.innerTextLayout(t.rotation,0,t.labelDirection);t.labelMargin=i.get(["label","margin"]),PF(e,n,i,a,{position:t2(n.axis,r,t),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function r2(r,e,t){return t=t||0,{x1:r[t],y1:r[1-t],x2:e[t],y2:e[1-t]}}function OF(r,e,t){return t=t||0,{x:r[t],y:r[1-t],width:e[t],height:e[1-t]}}function zF(r,e,t,n,i,a){return{cx:r,cy:e,r0:t,r:n,startAngle:i,endAngle:a,clockwise:!0}}var Eie=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.grid,u=a.get("type"),d=BF(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(u&&u!=="none"){var g=e2(a),m=Cie[u](s,f,d);m.style=g,t.graphicKey=m.type,t.pointer=m}var _=pT(l.model,i);NF(n,t,_,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=pT(n.axis.grid.model,n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=t2(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.grid,l=o.getGlobalExtent(!0),u=BF(s,o).getOtherAxis(o).getGlobalExtent(),d=o.dim==="x"?0:1,f=[t.x,t.y];f[d]+=n[d],f[d]=Math.min(l[1],f[d]),f[d]=Math.max(l[0],f[d]);var g=(u[1]+u[0])/2,m=[g,g];m[d]=f[d];var _=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:t.rotation,cursorPoint:m,tooltipOption:_[d]}},e}(JE);function BF(r,e){var t={};return t[e.dim+"AxisIndex"]=e.index,r.getCartesian(t)}var Cie={line:function(r,e,t){var n=r2([e,t[0]],[e,t[1]],VF(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=Math.max(1,r.getBandWidth()),i=t[1]-t[0];return{type:"Rect",shape:OF([e-n/2,t[0]],[n,i],VF(r))}}};function VF(r){return r.dim==="x"?0:1}var Aie=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e}(mr),nl=Cr(),Die=Q;function FF(r,e,t){if(!gr.node){var n=e.getZr();nl(n).records||(nl(n).records={}),Mie(n,e);var i=nl(n).records[r]||(nl(n).records[r]={});i.handler=t}}function Mie(r,e){if(nl(r).initialized)return;nl(r).initialized=!0,t("click",er($F,"click")),t("mousemove",er($F,"mousemove")),t("globalout",kie);function t(n,i){r.on(n,function(a){var o=Lie(e);Die(nl(r).records,function(s){s&&i(s,a,o.dispatchAction)}),Iie(o.pendings,e)})}}function Iie(r,e){var t=r.showTip.length,n=r.hideTip.length,i;t?i=r.showTip[t-1]:n&&(i=r.hideTip[n-1]),i&&(i.dispatchAction=null,e.dispatchAction(i))}function kie(r,e,t){r.handler("leave",null,t)}function $F(r,e,t,n){e.handler(r,t,n)}function Lie(r){var e={showTip:[],hideTip:[]},t=function(n){var i=e[n.type];i?i.push(n):(n.dispatchAction=t,r.dispatchAction(n))};return{dispatchAction:t,pendings:e}}function n2(r,e){if(!gr.node){var t=e.getZr(),n=(nl(t).records||{})[r];n&&(nl(t).records[r]=null)}}var Pie=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=n.getComponent("tooltip"),o=t.get("triggerOn")||a&&a.get("triggerOn")||"mousemove|click";FF("axisPointer",i,function(s,l,u){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&u({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(t,n){n2("axisPointer",n)},e.prototype.dispose=function(t,n){n2("axisPointer",n)},e.type="axisPointer",e}(xn);function GF(r,e){var t=[],n=r.seriesIndex,i;if(n==null||!(i=e.getSeriesByIndex(n)))return{point:[]};var a=i.getData(),o=ac(a,r);if(o==null||o<0||Ze(o))return{point:[]};var s=a.getItemGraphicEl(o),l=i.coordinateSystem;if(i.getTooltipPosition)t=i.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(r.isStacked){var u=l.getBaseAxis(),d=l.getOtherAxis(u),f=d.dim,g=u.dim,m=f==="x"||f==="radius"?1:0,_=a.mapDimension(g),x=[];x[m]=a.get(_,o),x[1-m]=a.get(a.getCalculationInfo("stackResultDimension"),o),t=l.dataToPoint(x)||[]}else t=l.dataToPoint(a.getValues(je(l.dimensions,function(C){return a.mapDimension(C)}),o))||[];else if(s){var w=s.getBoundingRect().clone();w.applyTransform(s.transform),t=[w.x+w.width/2,w.y+w.height/2]}return{point:t,el:s}}var UF=Cr();function Rie(r,e,t){var n=r.currTrigger,i=[r.x,r.y],a=r,o=r.dispatchAction||pt(t.dispatchAction,t),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){S0(i)&&(i=GF({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},e).point);var l=S0(i),u=a.axesInfo,d=s.axesInfo,f=n==="leave"||S0(i),g={},m={},_={list:[],map:{}},x={showPointer:er(Oie,m),showTooltip:er(zie,_)};Q(s.coordSysMap,function(C,A){var L=l||C.containPoint(i);Q(s.coordSysAxesInfo[A],function(O,V){var F=O.axis,$=$ie(u,O);if(!f&&L&&(!u||$)){var H=$&&$.value;H==null&&!l&&(H=F.pointToData(i)),H!=null&&HF(O,H,x,!1,g)}})});var w={};return Q(d,function(C,A){var L=C.linkGroup;L&&!m[A]&&Q(L.axesInfo,function(O,V){var F=m[V];if(O!==C&&F){var $=F.value;L.mapper&&($=C.axis.scale.parse(L.mapper($,WF(O),WF(C)))),w[C.key]=$}})}),Q(w,function(C,A){HF(d[A],C,x,!0,g)}),Bie(m,d,g),Vie(_,i,r,o),Fie(d,o,t),g}}function HF(r,e,t,n,i){var a=r.axis;if(!(a.scale.isBlank()||!a.containData(e))){if(!r.involveSeries){t.showPointer(r,e);return}var o=Nie(e,r),s=o.payloadBatch,l=o.snapToValue;s[0]&&i.seriesIndex==null&&Ge(i,s[0]),!n&&r.snap&&a.containData(l)&&l!=null&&(e=l),t.showPointer(r,e,s),t.showTooltip(r,o,l)}}function Nie(r,e){var t=e.axis,n=t.dim,i=r,a=[],o=Number.MAX_VALUE,s=-1;return Q(e.seriesModels,function(l,u){var d=l.getData().mapDimensionsAll(n),f,g;if(l.getAxisTooltipData){var m=l.getAxisTooltipData(d,r,t);g=m.dataIndices,f=m.nestestValue}else{if(g=l.getData().indicesOfNearest(d[0],r,t.type==="category"?.5:null),!g.length)return;f=l.getData().get(d[0],g[0])}if(!(f==null||!isFinite(f))){var _=r-f,x=Math.abs(_);x<=o&&((x=0&&s<0)&&(o=x,s=_,i=f,a.length=0),Q(g,function(w){a.push({seriesIndex:l.seriesIndex,dataIndexInside:w,dataIndex:l.getData().getRawIndex(w)})}))}}),{payloadBatch:a,snapToValue:i}}function Oie(r,e,t,n){r[e.key]={value:t,payloadBatch:n}}function zie(r,e,t,n){var i=t.payloadBatch,a=e.axis,o=a.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!i.length)){var l=e.coordSys.model,u=Dg(l),d=r.map[u];d||(d=r.map[u]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},r.list.push(d)),d.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:i.slice()})}}function Bie(r,e,t){var n=t.axesInfo=[];Q(e,function(i,a){var o=i.axisPointerModel.option,s=r[a];s?(!i.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!i.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:i.axis.dim,axisIndex:i.axis.model.componentIndex,value:o.value})})}function Vie(r,e,t,n){if(S0(e)||!r.list.length){n({type:"hideTip"});return}var i=((r.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:t.tooltipOption,position:t.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:r.list})}function Fie(r,e,t){var n=t.getZr(),i="axisPointerLastHighlights",a=UF(n)[i]||{},o=UF(n)[i]={};Q(r,function(u,d){var f=u.axisPointerModel.option;f.status==="show"&&u.triggerEmphasis&&Q(f.seriesDataIndices,function(g){var m=g.seriesIndex+" | "+g.dataIndex;o[m]=g})});var s=[],l=[];Q(a,function(u,d){!o[d]&&l.push(u)}),Q(o,function(u,d){!a[d]&&s.push(u)}),l.length&&t.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&t.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function $ie(r,e){for(var t=0;t<(r||[]).length;t++){var n=r[t];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function WF(r){var e=r.axis.model,t={},n=t.axisDim=r.axis.dim;return t.axisIndex=t[n+"AxisIndex"]=e.componentIndex,t.axisName=t[n+"AxisName"]=e.name,t.axisId=t[n+"AxisId"]=e.id,t}function S0(r){return!r||r[0]==null||isNaN(r[0])||r[1]==null||isNaN(r[1])}function qg(r){Zc.registerAxisPointerClass("CartesianAxisPointer",Eie),r.registerComponentModel(Aie),r.registerComponentView(Pie),r.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!Ze(t)&&(e.axisPointer.link=[t])}}),r.registerProcessor(r.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent("axisPointer").coordSysAxesInfo=FK(e,t)}),r.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},Rie)}function Gie(r){dr(gz),dr(qg)}var Uie=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis;s.dim==="angle"&&(this.animationThreshold=Math.PI/18);var l=s.polar,u=l.getOtherAxis(s),d=u.getExtent(),f=s.dataToCoord(n),g=a.get("type");if(g&&g!=="none"){var m=e2(a),_=Wie[g](s,l,f,d);_.style=m,t.graphicKey=_.type,t.pointer=_}var x=a.get(["label","margin"]),w=Hie(n,i,a,l,x);PF(t,i,a,o,w)},e}(JE);function Hie(r,e,t,n,i){var a=e.axis,o=a.dataToCoord(r),s=n.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var l=n.getRadiusAxis().getExtent(),u,d,f;if(a.dim==="radius"){var g=za();Yu(g,g,s),as(g,g,[n.cx,n.cy]),u=Ho([o,-i],g);var m=e.getModel("axisLabel").get("rotate")||0,_=oa.innerTextLayout(s,m*Math.PI/180,-1);d=_.textAlign,f=_.textVerticalAlign}else{var x=l[1];u=n.coordToPoint([x+i,o]);var w=n.cx,C=n.cy;d=Math.abs(u[0]-w)/x<.3?"center":u[0]>w?"left":"right",f=Math.abs(u[1]-C)/x<.3?"middle":u[1]>C?"top":"bottom"}return{position:u,align:d,verticalAlign:f}}var Wie={line:function(r,e,t,n){return r.dim==="angle"?{type:"Line",shape:r2(e.coordToPoint([n[0],t]),e.coordToPoint([n[1],t]))}:{type:"Circle",shape:{cx:e.cx,cy:e.cy,r:t}}},shadow:function(r,e,t,n){var i=Math.max(1,r.getBandWidth()),a=Math.PI/180;return r.dim==="angle"?{type:"Sector",shape:zF(e.cx,e.cy,n[0],n[1],(-t-i/2)*a,(-t+i/2)*a)}:{type:"Sector",shape:zF(e.cx,e.cy,t-i/2,t+i/2,0,Math.PI*2)}}},qie=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.findAxisModel=function(t){var n,i=this.ecModel;return i.eachComponent(t,function(a){a.getCoordSysModel()===this&&(n=a)},this),n},e.type="polar",e.dependencies=["radiusAxis","angleAxis"],e.defaultOption={z:0,center:["50%","50%"],radius:"80%"},e}(mr),i2=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("polar",Hn).models[0]},e.type="polarAxis",e}(mr);$n(i2,gg);var Zie=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="angleAxis",e}(i2),jie=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="radiusAxis",e}(i2),a2=function(r){ze(e,r);function e(t,n){return r.call(this,"radius",t,n)||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e}(jo);a2.prototype.dataToRadius=jo.prototype.dataToCoord,a2.prototype.radiusToData=jo.prototype.coordToData;var Xie=Cr(),o2=function(r){ze(e,r);function e(t,n){return r.call(this,"angle",t,n||[0,360])||this}return e.prototype.pointToData=function(t,n){return this.polar.pointToData(t,n)[this.dim==="radius"?0:1]},e.prototype.calculateCategoryInterval=function(){var t=this,n=t.getLabelModel(),i=t.scale,a=i.getExtent(),o=i.count();if(a[1]-a[0]<1)return 0;var s=a[0],l=t.dataToCoord(s+1)-t.dataToCoord(s),u=Math.abs(l),d=bp(s==null?"":s+"",n.getFont(),"center","top"),f=Math.max(d.height,7),g=f/u;isNaN(g)&&(g=1/0);var m=Math.max(0,Math.floor(g)),_=Xie(t.model),x=_.lastAutoInterval,w=_.lastTickCount;return x!=null&&w!=null&&Math.abs(x-m)<=1&&Math.abs(w-o)<=1&&x>m?m=x:(_.lastTickCount=o,_.lastAutoInterval=m),m},e}(jo);o2.prototype.dataToAngle=jo.prototype.dataToCoord,o2.prototype.angleToData=jo.prototype.coordToData;var qF=["radius","angle"],Yie=function(){function r(e){this.dimensions=qF,this.type="polar",this.cx=0,this.cy=0,this._radiusAxis=new a2,this._angleAxis=new o2,this.axisPointerEnabled=!0,this.name=e||"",this._radiusAxis.polar=this._angleAxis.polar=this}return r.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},r.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},r.prototype.getAxis=function(e){var t="_"+e+"Axis";return this[t]},r.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},r.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,i=this._radiusAxis;return n.scale.type===e&&t.push(n),i.scale.type===e&&t.push(i),t},r.prototype.getAngleAxis=function(){return this._angleAxis},r.prototype.getRadiusAxis=function(){return this._radiusAxis},r.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},r.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},r.prototype.getTooltipAxes=function(e){var t=e!=null&&e!=="auto"?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},r.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},r.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},r.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,i=this.getAngleAxis(),a=i.getExtent(),o=Math.min(a[0],a[1]),s=Math.max(a[0],a[1]);i.inverse?o=s-360:s=o+360;var l=Math.sqrt(t*t+n*n);t/=l,n/=l;for(var u=Math.atan2(-n,t)/Math.PI*180,d=us;)u+=d*360;return[l,u]},r.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI,i=Math.cos(n)*t+this.cx,a=-Math.sin(n)*t+this.cy;return[i,a]},r.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis(),n=t.getExtent().slice();n[0]>n[1]&&n.reverse();var i=e.getExtent(),a=Math.PI/180,o=1e-4;return{cx:this.cx,cy:this.cy,r0:n[0],r:n[1],startAngle:-i[0]*a,endAngle:-i[1]*a,clockwise:e.inverse,contain:function(s,l){var u=s-this.cx,d=l-this.cy,f=u*u+d*d,g=this.r,m=this.r0;return g!==m&&f-o<=g*g&&f+o>=m*m}}},r.prototype.convertToPixel=function(e,t,n){var i=ZF(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=ZF(t);return i===this?this.pointToData(n):null},r}();function ZF(r){var e=r.seriesModel,t=r.polarModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}var Kie={};function Jie(r,e,t){var n=e.get("center"),i=t.getWidth(),a=t.getHeight();r.cx=nt(n[0],i),r.cy=nt(n[1],a);var o=r.getRadiusAxis(),s=Math.min(i,a)/2,l=e.get("radius");l==null?l=[0,"100%"]:Ze(l)||(l=[0,l]);var u=[nt(l[0],s),nt(l[1],s)];o.inverse?o.setExtent(u[1],u[0]):o.setExtent(u[0],u[1])}function Qie(r,e){var t=this,n=t.getAngleAxis(),i=t.getRadiusAxis();if(n.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),r.eachSeries(function(s){if(s.coordinateSystem===t){var l=s.getData();Q(O_(l,"radius"),function(u){i.scale.unionExtentFromData(l,u)}),Q(O_(l,"angle"),function(u){n.scale.unionExtentFromData(l,u)})}}),Pd(n.scale,n.model),Pd(i.scale,i.model),n.type==="category"&&!n.onBand){var a=n.getExtent(),o=360/n.scale.count();n.inverse?a[1]+=o:a[1]-=o,n.setExtent(a[0],a[1])}}function eae(r){return r.mainType==="angleAxis"}function jF(r,e){var t;if(r.type=e.get("type"),r.scale=N_(e),r.onBand=e.get("boundaryGap")&&r.type==="category",r.inverse=e.get("inverse"),eae(e)){r.inverse=r.inverse!==e.get("clockwise");var n=e.get("startAngle"),i=(t=e.get("endAngle"))!==null&&t!==void 0?t:n+(r.inverse?-360:360);r.setExtent(n,i)}e.axis=r,r.model=e}var tae={dimensions:qF,create:function(r,e){var t=[];return r.eachComponent("polar",function(n,i){var a=new Yie(i+"");a.update=Qie;var o=a.getRadiusAxis(),s=a.getAngleAxis(),l=n.findAxisModel("radiusAxis"),u=n.findAxisModel("angleAxis");jF(o,l),jF(s,u),Jie(a,n,e),t.push(a),n.coordinateSystem=a,a.model=n}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="polar"){var i=n.getReferringComponents("polar",Hn).models[0];if(Kie.NODE_ENV!=="production"&&!i)throw new Error('Polar "'+Gn(n.get("polarIndex"),n.get("polarId"),0)+'" not found');n.coordinateSystem=i.coordinateSystem}}),t}},rae=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function T0(r,e,t){e[1]>e[0]&&(e=e.slice().reverse());var n=r.coordToPoint([e[0],t]),i=r.coordToPoint([e[1],t]);return{x1:n[0],y1:n[1],x2:i[0],y2:i[1]}}function E0(r){var e=r.getRadiusAxis();return e.inverse?0:1}function XF(r){var e=r[0],t=r[r.length-1];e&&t&&Math.abs(Math.abs(e.coord-t.coord)-360)<1e-4&&r.pop()}var nae=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.axisPointerClass="PolarAxisPointer",t}return e.prototype.render=function(t,n){if(this.group.removeAll(),!!t.get("show")){var i=t.axis,a=i.polar,o=a.getRadiusAxis().getExtent(),s=i.getTicksCoords(),l=i.getMinorTicksCoords(),u=je(i.getViewLabels(),function(d){d=Ut(d);var f=i.scale,g=f.type==="ordinal"?f.getRawOrdinalNumber(d.tickValue):d.tickValue;return d.coord=i.dataToCoord(g),d});XF(u),XF(s),Q(rae,function(d){t.get([d,"show"])&&(!i.scale.isBlank()||d==="axisLine")&&iae[d](this.group,t,a,s,l,o,u)},this)}},e.type="angleAxis",e}(Zc),iae={axisLine:function(r,e,t,n,i,a){var o=e.getModel(["axisLine","lineStyle"]),s=t.getAngleAxis(),l=Math.PI/180,u=s.getExtent(),d=E0(t),f=d?0:1,g,m=Math.abs(u[1]-u[0])===360?"Circle":"Arc";a[f]===0?g=new Ec[m]({shape:{cx:t.cx,cy:t.cy,r:a[d],startAngle:-u[0]*l,endAngle:-u[1]*l,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):g=new Op({shape:{cx:t.cx,cy:t.cy,r:a[d],r0:a[f]},style:o.getLineStyle(),z2:1,silent:!0}),g.style.fill=null,r.add(g)},axisTick:function(r,e,t,n,i,a){var o=e.getModel("axisTick"),s=(o.get("inside")?-1:1)*o.get("length"),l=a[E0(t)],u=je(n,function(d){return new ri({shape:T0(t,[l,l+s],d.coord)})});r.add(ho(u,{style:Bt(o.getModel("lineStyle").getLineStyle(),{stroke:e.get(["axisLine","lineStyle","color"])})}))},minorTick:function(r,e,t,n,i,a){if(i.length){for(var o=e.getModel("axisTick"),s=e.getModel("minorTick"),l=(o.get("inside")?-1:1)*s.get("length"),u=a[E0(t)],d=[],f=0;fC?"left":"right",O=Math.abs(w[1]-A)/x<.3?"middle":w[1]>A?"top":"bottom";if(s&&s[_]){var V=s[_];Nt(V)&&V.textStyle&&(m=new qr(V.textStyle,l,l.ecModel))}var F=new Dr({silent:oa.isLabelSilent(e),style:an(m,{x:w[0],y:w[1],fill:m.getTextColor()||e.get(["axisLine","lineStyle","color"]),text:f.formattedLabel,align:L,verticalAlign:O})});if(r.add(F),d){var $=oa.makeAxisEventDataBase(e);$.targetType="axisLabel",$.value=f.rawLabel,jt(F).eventData=$}},this)},splitLine:function(r,e,t,n,i,a){var o=e.getModel("splitLine"),s=o.getModel("lineStyle"),l=s.get("color"),u=0;l=l instanceof Array?l:[l];for(var d=[],f=0;f=0?"p":"n",fe=Z;V&&(n[d][ae]||(n[d][ae]={p:Z,n:Z}),fe=n[d][ae][ue]);var le=void 0,ge=void 0,xe=void 0,Me=void 0;if(_.dim==="radius"){var Ve=_.dataToCoord(se)-Z,Fe=l.dataToCoord(ae);Math.abs(Ve)=Me})}}})}function hae(r){var e={};Q(r,function(n,i){var a=n.getData(),o=n.coordinateSystem,s=o.getBaseAxis(),l=KF(o,s),u=s.getExtent(),d=s.type==="category"?s.getBandWidth():Math.abs(u[1]-u[0])/a.count(),f=e[l]||{bandWidth:d,remainedWidth:d,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},g=f.stacks;e[l]=f;var m=YF(n);g[m]||f.autoWidthCount++,g[m]=g[m]||{width:0,maxWidth:0};var _=nt(n.get("barWidth"),d),x=nt(n.get("barMaxWidth"),d),w=n.get("barGap"),C=n.get("barCategoryGap");_&&!g[m].width&&(_=Math.min(f.remainedWidth,_),g[m].width=_,f.remainedWidth-=_),x&&(g[m].maxWidth=x),w!=null&&(f.gap=w),C!=null&&(f.categoryGap=C)});var t={};return Q(e,function(n,i){t[i]={};var a=n.stacks,o=n.bandWidth,s=nt(n.categoryGap,o),l=nt(n.gap,1),u=n.remainedWidth,d=n.autoWidthCount,f=(u-s)/(d+(d-1)*l);f=Math.max(f,0),Q(a,function(x,w){var C=x.maxWidth;C&&C=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},r.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient==="horizontal"?0:1]))]},r.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),i=[],a=t.orient==="horizontal"?0:1;return e instanceof Array&&(e=e[0]),i[a]=t.toGlobalCoord(t.dataToCoord(+e)),i[1-a]=a===0?n.y+n.height/2:n.x+n.width/2,i},r.prototype.convertToPixel=function(e,t,n){var i=QF(t);return i===this?this.dataToPoint(n):null},r.prototype.convertFromPixel=function(e,t,n){var i=QF(t);return i===this?this.pointToData(n):null},r}();function QF(r){var e=r.seriesModel,t=r.singleAxisModel;return t&&t.coordinateSystem||e&&e.coordinateSystem}function wae(r,e){var t=[];return r.eachComponent("singleAxis",function(n,i){var a=new xae(n,r,e);a.name="single_"+i,a.resize(n,e),n.coordinateSystem=a,t.push(a)}),r.eachSeries(function(n){if(n.get("coordinateSystem")==="singleAxis"){var i=n.getReferringComponents("singleAxis",Hn).models[0];n.coordinateSystem=i&&i.coordinateSystem}}),t}var Sae={create:wae,dimensions:JF},e5=["x","y"],Tae=["width","height"],Eae=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.makeElOption=function(t,n,i,a,o){var s=i.axis,l=s.coordinateSystem,u=l2(l,1-A0(s)),d=l.dataToPoint(n)[0],f=a.get("type");if(f&&f!=="none"){var g=e2(a),m=Cae[f](s,d,u);m.style=g,t.graphicKey=m.type,t.pointer=m}var _=s2(i);NF(n,t,_,i,a,o)},e.prototype.getHandleTransform=function(t,n,i){var a=s2(n,{labelInside:!1});a.labelMargin=i.get(["handle","margin"]);var o=t2(n.axis,t,a);return{x:o[0],y:o[1],rotation:a.rotation+(a.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(t,n,i,a){var o=i.axis,s=o.coordinateSystem,l=A0(o),u=l2(s,l),d=[t.x,t.y];d[l]+=n[l],d[l]=Math.min(u[1],d[l]),d[l]=Math.max(u[0],d[l]);var f=l2(s,1-l),g=(f[1]+f[0])/2,m=[g,g];return m[l]=d[l],{x:d[0],y:d[1],rotation:t.rotation,cursorPoint:m,tooltipOption:{verticalAlign:"middle"}}},e}(JE),Cae={line:function(r,e,t){var n=r2([e,t[0]],[e,t[1]],A0(r));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(r,e,t){var n=r.getBandWidth(),i=t[1]-t[0];return{type:"Rect",shape:OF([e-n/2,t[0]],[n,i],A0(r))}}};function A0(r){return r.isHorizontal()?0:1}function l2(r,e){var t=r.getRect();return[t[e5[e]],t[e5[e]]+t[Tae[e]]]}var Aae=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="single",e}(xn);function Dae(r){dr(qg),Zc.registerAxisPointerClass("SingleAxisPointer",Eae),r.registerComponentView(Aae),r.registerComponentView(yae),r.registerComponentModel(C0),Bd(r,"single",C0,C0.defaultOption),r.registerCoordinateSystem("single",Sae)}var Mae=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n,i){var a=vd(t);r.prototype.init.apply(this,arguments),t5(t,a)},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),t5(this.option,t)},e.prototype.getCellSize=function(){return this.option.cellSize},e.type="calendar",e.defaultOption={z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},e}(mr);function t5(r,e){var t=r.cellSize,n;Ze(t)?n=t:n=r.cellSize=[t,t],n.length===1&&(n[1]=n[0]);var i=je([0,1],function(a){return xq(e,a)&&(n[a]="auto"),n[a]!=null&&n[a]!=="auto"});Gl(r,e,{type:"box",ignoreSize:i})}var Iae=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){var a=this.group;a.removeAll();var o=t.coordinateSystem,s=o.getRangeInfo(),l=o.getOrient(),u=n.getLocaleModel();this._renderDayRect(t,s,a),this._renderLines(t,s,l,a),this._renderYearText(t,s,l,a),this._renderMonthText(t,u,l,a),this._renderWeekText(t,u,s,l,a)},e.prototype._renderDayRect=function(t,n,i){for(var a=t.coordinateSystem,o=t.getModel("itemStyle").getItemStyle(),s=a.getCellWidth(),l=a.getCellHeight(),u=n.start.time;u<=n.end.time;u=a.getNextNDay(u,1).time){var d=a.dataToRect([u],!1).tl,f=new Ar({shape:{x:d[0],y:d[1],width:s,height:l},cursor:"default",style:o});i.add(f)}},e.prototype._renderLines=function(t,n,i,a){var o=this,s=t.coordinateSystem,l=t.getModel(["splitLine","lineStyle"]).getLineStyle(),u=t.get(["splitLine","show"]),d=l.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var f=n.start,g=0;f.time<=n.end.time;g++){_(f.formatedDate),g===0&&(f=s.getDateInfo(n.start.y+"-"+n.start.m));var m=f.date;m.setMonth(m.getMonth()+1),f=s.getDateInfo(m)}_(s.getNextNDay(n.end.time,1).formatedDate);function _(x){o._firstDayOfMonth.push(s.getDateInfo(x)),o._firstDayPoints.push(s.dataToRect([x],!1).tl);var w=o._getLinePointsOfOneWeek(t,x,i);o._tlpoints.push(w[0]),o._blpoints.push(w[w.length-1]),u&&o._drawSplitline(w,l,a)}u&&this._drawSplitline(o._getEdgesPoints(o._tlpoints,d,i),l,a),u&&this._drawSplitline(o._getEdgesPoints(o._blpoints,d,i),l,a)},e.prototype._getEdgesPoints=function(t,n,i){var a=[t[0].slice(),t[t.length-1].slice()],o=i==="horizontal"?0:1;return a[0][o]=a[0][o]-n/2,a[1][o]=a[1][o]+n/2,a},e.prototype._drawSplitline=function(t,n,i){var a=new ra({z2:20,shape:{points:t},style:n});i.add(a)},e.prototype._getLinePointsOfOneWeek=function(t,n,i){for(var a=t.coordinateSystem,o=a.getDateInfo(n),s=[],l=0;l<7;l++){var u=a.getNextNDay(o.time,l),d=a.dataToRect([u.time],!1);s[2*u.day]=d.tl,s[2*u.day+1]=d[i==="horizontal"?"bl":"tr"]}return s},e.prototype._formatterLabel=function(t,n){return ut(t)&&t?yq(t,n):It(t)?t(n):n.nameMap},e.prototype._yearTextPositionControl=function(t,n,i,a,o){var s=n[0],l=n[1],u=["center","bottom"];a==="bottom"?(l+=o,u=["center","top"]):a==="left"?s-=o:a==="right"?(s+=o,u=["center","top"]):l-=o;var d=0;return(a==="left"||a==="right")&&(d=Math.PI/2),{rotation:d,x:s,y:l,style:{align:u[0],verticalAlign:u[1]}}},e.prototype._renderYearText=function(t,n,i,a){var o=t.getModel("yearLabel");if(o.get("show")){var s=o.get("margin"),l=o.get("position");l||(l=i!=="horizontal"?"top":"left");var u=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],d=(u[0][0]+u[1][0])/2,f=(u[0][1]+u[1][1])/2,g=i==="horizontal"?0:1,m={top:[d,u[g][1]],bottom:[d,u[1-g][1]],left:[u[1-g][0],f],right:[u[g][0],f]},_=n.start.y;+n.end.y>+n.start.y&&(_=_+"-"+n.end.y);var x=o.get("formatter"),w={start:n.start.y,end:n.end.y,nameMap:_},C=this._formatterLabel(x,w),A=new Dr({z2:30,style:an(o,{text:C}),silent:o.get("silent")});A.attr(this._yearTextPositionControl(A,m[l],i,l,s)),a.add(A)}},e.prototype._monthTextPositionControl=function(t,n,i,a,o){var s="left",l="top",u=t[0],d=t[1];return i==="horizontal"?(d=d+o,n&&(s="center"),a==="start"&&(l="bottom")):(u=u+o,n&&(l="middle"),a==="start"&&(s="right")),{x:u,y:d,align:s,verticalAlign:l}},e.prototype._renderMonthText=function(t,n,i,a){var o=t.getModel("monthLabel");if(o.get("show")){var s=o.get("nameMap"),l=o.get("margin"),u=o.get("position"),d=o.get("align"),f=[this._tlpoints,this._blpoints];(!s||ut(s))&&(s&&(n=x1(s)||n),s=n.get(["time","monthAbbr"])||[]);var g=u==="start"?0:1,m=i==="horizontal"?0:1;l=u==="start"?-l:l;for(var _=d==="center",x=o.get("silent"),w=0;w=i.start.time&&n.times.end.time&&t.reverse(),t},r.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var i=Math.floor(t[1].time/u2)-Math.floor(t[0].time/u2)+1,a=new Date(t[0].time),o=a.getDate(),s=t[1].date.getDate();a.setDate(o+i-1);var l=a.getDate();if(l!==s)for(var u=a.getTime()-t[1].time>0?1:-1;(l=a.getDate())!==s&&(a.getTime()-t[1].time)*u>0;)i-=u,a.setDate(l-u);var d=Math.floor((i+t[0].day+6)/7),f=n?-d+1:d-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:i,weeks:d,nthWeek:f,fweek:t[0].day,lweek:t[1].day}},r.prototype._getDateByWeeksAndDay=function(e,t,n){var i=this._getRangeInfo(n);if(e>i.weeks||e===0&&ti.lweek)return null;var a=(e-1)*7-i.fweek+t,o=new Date(i.start.time);return o.setDate(+i.start.d+a),this.getDateInfo(o)},r.create=function(e,t){var n=[];return e.eachComponent("calendar",function(i){var a=new r(i);n.push(a),i.coordinateSystem=a}),e.eachSeries(function(i){i.get("coordinateSystem")==="calendar"&&(i.coordinateSystem=n[i.get("calendarIndex")||0])}),n},r.dimensions=["time","value"],r}();function r5(r){var e=r.calendarModel,t=r.seriesModel,n=e?e.coordinateSystem:t?t.coordinateSystem:null;return n}function Pae(r){r.registerComponentModel(Mae),r.registerComponentView(Iae),r.registerCoordinateSystem("calendar",Lae)}var n5={};function Rae(r,e){var t=r.existing;if(e.id=r.keyInfo.id,!e.type&&t&&(e.type=t.type),e.parentId==null){var n=e.parentOption;n?e.parentId=n.id:t&&(e.parentId=t.parentId)}e.parentOption=null}function i5(r,e){var t;return Q(e,function(n){r[n]!=null&&r[n]!=="auto"&&(t=!0)}),t}function Nae(r,e,t){var n=Ge({},t),i=r[e],a=t.$action||"merge";if(a==="merge")if(i){if(n5.NODE_ENV!=="production"){var o=t.type;Ot(!o||i.type===o,'Please set $action: "replace" to change `type`')}rr(i,n,!0),Gl(i,n,{ignoreSize:!0}),TL(t,i),D0(t,i),D0(t,i,"shape"),D0(t,i,"style"),D0(t,i,"extra"),t.clipPath=i.clipPath}else r[e]=n;else a==="replace"?r[e]=n:a==="remove"&&i&&(r[e]=null)}var a5=["transition","enterFrom","leaveTo"],Oae=a5.concat(["enterAnimation","updateAnimation","leaveAnimation"]);function D0(r,e,t){if(t&&(!r[t]&&e[t]&&(r[t]={}),r=r[t],e=e[t]),!(!r||!e))for(var n=t?a5:Oae,i=0;i=0;d--){var f=i[d],g=jn(f.id,null),m=g!=null?o.get(g):null;if(m){var _=m.parent,C=To(_),A=_===a?{width:s,height:l}:{width:C.width,height:C.height},L={},O=Qy(m,f,A,null,{hv:f.hv,boundingMode:f.bounding},L);if(!To(m).isNew&&O){for(var V=f.transition,F={},$=0;$=0)?F[H]=Z:m[H]=Z}Or(m,F,t,0)}else m.attr(L)}}},e.prototype._clear=function(){var t=this,n=this._elMap;n.each(function(i){M0(i,To(i).option,n,t._lastGraphicModel)}),this._elMap=Tt()},e.prototype.dispose=function(){this._clear()},e.type="graphic",e}(xn);function h2(r){c2.NODE_ENV!=="production"&&Ot(r,"graphic type MUST be set");var e=gt(o5,r)?o5[r]:f1(r);c2.NODE_ENV!=="production"&&Ot(e,"graphic type "+r+" can not be found");var t=new e({});return To(t).type=r,t}function s5(r,e,t,n){var i=h2(t);return e.add(i),n.set(r,i),To(i).id=r,To(i).isNew=!0,i}function M0(r,e,t,n){var i=r&&r.parent;i&&(r.type==="group"&&r.traverse(function(a){M0(a,e,t,n)}),_0(r,e,n),t.removeKey(To(r).id))}function l5(r,e,t,n){r.isGroup||Q([["cursor",uo.prototype.cursor],["zlevel",n||0],["z",t||0],["z2",0]],function(i){var a=i[0];gt(e,a)?r[a]=Zt(e[a],i[1]):r[a]==null&&(r[a]=i[1])}),Q(br(e),function(i){if(i.indexOf("on")===0){var a=e[i];r[i]=It(a)?a:null}}),gt(e,"draggable")&&(r.draggable=e.draggable),e.name!=null&&(r.name=e.name),e.id!=null&&(r.id=e.id)}function Fae(r){return r=Ge({},r),Q(["id","parentId","$action","hv","bounding","textContent","clipPath"].concat(SL),function(e){delete r[e]}),r}function $ae(r,e,t){var n=jt(r).eventData;!r.silent&&!r.ignore&&!n&&(n=jt(r).eventData={componentType:"graphic",componentIndex:e.componentIndex,name:r.name}),n&&(n.info=t.info)}function Gae(r){r.registerComponentModel(Bae),r.registerComponentView(Vae),r.registerPreprocessor(function(e){var t=e.graphic;Ze(t)?!t[0]||!t[0].elements?e.graphic=[{elements:t}]:e.graphic=[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var Uae={},u5=["x","y","radius","angle","single"],Hae=["cartesian2d","polar","singleAxis"];function Wae(r){var e=r.get("coordinateSystem");return hr(Hae,e)>=0}function au(r){return Uae.NODE_ENV!=="production"&&Ot(r),r+"Axis"}function qae(r,e){var t=Tt(),n=[],i=Tt();r.eachComponent({mainType:"dataZoom",query:e},function(d){i.get(d.uid)||s(d)});var a;do a=!1,r.eachComponent("dataZoom",o);while(a);function o(d){!i.get(d.uid)&&l(d)&&(s(d),a=!0)}function s(d){i.set(d.uid,!0),n.push(d),u(d)}function l(d){var f=!1;return d.eachTargetAxis(function(g,m){var _=t.get(g);_&&_[m]&&(f=!0)}),f}function u(d){d.eachTargetAxis(function(f,g){(t.get(f)||t.set(f,[]))[g]=!0})}return n}function c5(r){var e=r.ecModel,t={infoList:[],infoMap:Tt()};return r.eachTargetAxis(function(n,i){var a=e.getComponent(au(n),i);if(a){var o=a.getCoordSysModel();if(o){var s=o.uid,l=t.infoMap.get(s);l||(l={model:o,axisModels:[]},t.infoList.push(l),t.infoMap.set(s,l)),l.axisModels.push(a)}}}),t}var h5={},d2=function(){function r(){this.indexList=[],this.indexMap=[]}return r.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},r}(),Zg=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._autoThrottle=!0,t._noTarget=!0,t._rangePropMode=["percent","percent"],t}return e.prototype.init=function(t,n,i){var a=d5(t);this.settledOption=a,this.mergeDefaultAndTheme(t,i),this._doInit(a)},e.prototype.mergeOption=function(t){var n=d5(t);rr(this.option,t,!0),rr(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(t){var n=this.option;this._setDefaultThrottle(t),this._updateRangeUse(t);var i=this.settledOption;Q([["start","startValue"],["end","endValue"]],function(a,o){this._rangePropMode[o]==="value"&&(n[a[0]]=i[a[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var t=this.get("orient",!0),n=this._targetAxisInfoMap=Tt(),i=this._fillSpecifiedTargetAxis(n);i?this._orient=t||this._makeAutoOrientByTargetAxis():(this._orient=t||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(a){a.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(t){var n=!1;return Q(u5,function(i){var a=this.getReferringComponents(au(i),aW);if(a.specified){n=!0;var o=new d2;Q(a.models,function(s){o.add(s.componentIndex)}),t.set(i,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(t,n){var i=this.ecModel,a=!0;if(a){var o=n==="vertical"?"y":"x",s=i.findComponents({mainType:o+"Axis"});l(s,o)}if(a){var s=i.findComponents({mainType:"singleAxis",filter:function(d){return d.get("orient",!0)===n}});l(s,"single")}function l(u,d){var f=u[0];if(f){var g=new d2;if(g.add(f.componentIndex),t.set(d,g),a=!1,d==="x"||d==="y"){var m=f.getReferringComponents("grid",Hn).models[0];m&&Q(u,function(_){f.componentIndex!==_.componentIndex&&m===_.getReferringComponents("grid",Hn).models[0]&&g.add(_.componentIndex)})}}}a&&Q(u5,function(u){if(a){var d=i.findComponents({mainType:au(u),filter:function(g){return g.get("type",!0)==="category"}});if(d[0]){var f=new d2;f.add(d[0].componentIndex),t.set(u,f),a=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var t;return this.eachTargetAxis(function(n){!t&&(t=n)},this),t==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(t){if(t.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(t){var n=this._rangePropMode,i=this.get("rangeMode");Q([["start","startValue"],["end","endValue"]],function(a,o){var s=t[a[0]]!=null,l=t[a[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":i?n[o]=i[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var t;return this.eachTargetAxis(function(n,i){t==null&&(t=this.ecModel.getComponent(au(n),i))},this),t},e.prototype.eachTargetAxis=function(t,n){this._targetAxisInfoMap.each(function(i,a){Q(i.indexList,function(o){t.call(n,a,o)})})},e.prototype.getAxisProxy=function(t,n){var i=this.getAxisModel(t,n);if(i)return i.__dzAxisProxy},e.prototype.getAxisModel=function(t,n){h5.NODE_ENV!=="production"&&Ot(t&&n!=null);var i=this._targetAxisInfoMap.get(t);if(i&&i.indexMap[n])return this.ecModel.getComponent(au(t),n)},e.prototype.setRawRange=function(t){var n=this.option,i=this.settledOption;Q([["start","startValue"],["end","endValue"]],function(a){(t[a[0]]!=null||t[a[1]]!=null)&&(n[a[0]]=i[a[0]]=t[a[0]],n[a[1]]=i[a[1]]=t[a[1]])},this),this._updateRangeUse(t)},e.prototype.setCalculatedRange=function(t){var n=this.option;Q(["start","startValue","end","endValue"],function(i){n[i]=t[i]})},e.prototype.getPercentRange=function(){var t=this.findRepresentativeAxisProxy();if(t)return t.getDataPercentWindow()},e.prototype.getValueRange=function(t,n){if(t==null&&n==null){var i=this.findRepresentativeAxisProxy();if(i)return i.getDataValueWindow()}else return this.getAxisProxy(t,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(t){if(t)return t.__dzAxisProxy;for(var n,i=this._targetAxisInfoMap.keys(),a=0;ao[1];if(L&&!O&&!V)return!0;L&&(w=!0),O&&(_=!0),V&&(x=!0)}return w&&_&&x})}else jd(d,function(m){if(a==="empty")l.setData(u=u.map(m,function(x){return s(x)?x:NaN}));else{var _={};_[m]=o,u.selectRange(_)}});jd(d,function(m){u.setApproximateExtent(o,m)})}});function s(l){return l>=o[0]&&l<=o[1]}},r.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;jd(["min","max"],function(i){var a=t.get(i+"Span"),o=t.get(i+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?a=Wr(n[0]+o,n,[0,100],!0):a!=null&&(o=Wr(a,[0,100],n,!0)-n[0]),e[i+"Span"]=a,e[i+"ValueSpan"]=o},this)},r.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var i=yI(n,[0,500]);i=Math.min(i,20);var a=e.axis.scale.rawExtentInfo;t[0]!==0&&a.setDeterminedMinMax("min",+n[0].toFixed(i)),t[1]!==100&&a.setDeterminedMinMax("max",+n[1].toFixed(i)),a.freeze()}},r}();function Yae(r,e,t){var n=[1/0,-1/0];jd(t,function(o){lX(n,o.getData(),e)});var i=r.getAxisModel(),a=hN(i.axis.scale,i,n).calculate();return[a.min,a.max]}var Kae={getTargetSeries:function(r){function e(i){r.eachComponent("dataZoom",function(a){a.eachTargetAxis(function(o,s){var l=r.getComponent(au(o),s);i(o,s,l,a)})})}e(function(i,a,o,s){o.__dzAxisProxy=null});var t=[];e(function(i,a,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new Xae(i,a,s,r),t.push(o.__dzAxisProxy))});var n=Tt();return Q(t,function(i){Q(i.getTargetSeriesModels(),function(a){n.set(a.uid,a)})}),n},overallReset:function(r,e){r.eachComponent("dataZoom",function(t){t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).reset(t)}),t.eachTargetAxis(function(n,i){t.getAxisProxy(n,i).filterData(t,e)})}),r.eachComponent("dataZoom",function(t){var n=t.findRepresentativeAxisProxy();if(n){var i=n.getDataPercentWindow(),a=n.getDataValueWindow();t.setCalculatedRange({start:i[0],end:i[1],startValue:a[0],endValue:a[1]})}})}};function Jae(r){r.registerAction("dataZoom",function(e,t){var n=qae(t,e);Q(n,function(i){i.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var p5=!1;function p2(r){p5||(p5=!0,r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,Kae),Jae(r),r.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function Qae(r){r.registerComponentModel(Zae),r.registerComponentView(jae),p2(r)}var Eo=function(){function r(){}return r}(),g5={};function Xd(r,e){g5[r]=e}function v5(r){return g5[r]}var eoe=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(){r.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;Q(this.option.feature,function(n,i){var a=v5(i);a&&(a.getDefaultOption&&(a.defaultOption=a.getDefaultOption(t)),rr(n,a.defaultOption))})},e.type="toolbox",e.layoutMode={type:"box",ignoreSize:!0},e.defaultOption={show:!0,z:6,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1,position:"bottom"}},e}(mr);function toe(r,e,t){var n=e.getBoxLayoutParams(),i=e.get("padding"),a={width:t.getWidth(),height:t.getHeight()},o=Xn(n,a,i);Dc(e.get("orient"),r,e.get("itemGap"),o.width,o.height),Qy(r,n,a,i)}function m5(r,e){var t=gd(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),r=new Ar({shape:{x:r.x-t[3],y:r.y-t[0],width:r.width+t[1]+t[3],height:r.height+t[0]+t[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),r}var roe=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){var o=this.group;if(o.removeAll(),!t.get("show"))return;var s=+t.get("itemSize"),l=t.get("orient")==="vertical",u=t.get("feature")||{},d=this._features||(this._features={}),f=[];Q(u,function(_,x){f.push(x)}),new Ys(this._featureNames||[],f).add(g).update(g).remove(er(g,null)).execute(),this._featureNames=f;function g(_,x){var w=f[_],C=f[x],A=u[w],L=new qr(A,t,t.ecModel),O;if(a&&a.newTitle!=null&&a.featureName===w&&(A.title=a.newTitle),w&&!C){if(noe(w))O={onclick:L.option.onclick,featureName:w};else{var V=v5(w);if(!V)return;O=new V}d[w]=O}else if(O=d[C],!O)return;O.uid=hd("toolbox-feature"),O.model=L,O.ecModel=n,O.api=i;var F=O instanceof Eo;if(!w&&C){F&&O.dispose&&O.dispose(n,i);return}if(!L.get("show")||F&&O.unusable){F&&O.remove&&O.remove(n,i);return}m(L,O,w),L.setIconStatus=function($,H){var Z=this.option,j=this.iconPaths;Z.iconStatus=Z.iconStatus||{},Z.iconStatus[$]=H,j[$]&&(H==="emphasis"?Ws:qs)(j[$])},O instanceof Eo&&O.render&&O.render(L,n,i,a)}function m(_,x,w){var C=_.getModel("iconStyle"),A=_.getModel(["emphasis","iconStyle"]),L=x instanceof Eo&&x.getIcons?x.getIcons():_.get("icon"),O=_.get("title")||{},V,F;ut(L)?(V={},V[w]=L):V=L,ut(O)?(F={},F[w]=O):F=O;var $=_.iconPaths={};Q(V,function(H,Z){var j=$p(H,{},{x:-s/2,y:-s/2,width:s,height:s});j.setStyle(C.getItemStyle());var Y=j.ensureState("emphasis");Y.style=A.getItemStyle();var se=new Dr({style:{text:F[Z],align:A.get("textAlign"),borderRadius:A.get("textBorderRadius"),padding:A.get("textPadding"),fill:null,font:v1({fontStyle:A.get("textFontStyle"),fontFamily:A.get("textFontFamily"),fontSize:A.get("textFontSize"),fontWeight:A.get("textFontWeight")},n)},ignore:!0});j.setTextContent(se),Tc({el:j,componentModel:t,itemName:Z,formatterParamsExtra:{title:F[Z]}}),j.__title=F[Z],j.on("mouseover",function(){var ae=A.getItemStyle(),ue=l?t.get("right")==null&&t.get("left")!=="right"?"right":"left":t.get("bottom")==null&&t.get("top")!=="bottom"?"bottom":"top";se.setStyle({fill:A.get("textFill")||ae.fill||ae.stroke||"#000",backgroundColor:A.get("textBackgroundColor")}),j.setTextConfig({position:A.get("textPosition")||ue}),se.ignore=!t.get("showTitle"),i.enterEmphasis(this)}).on("mouseout",function(){_.get(["iconStatus",Z])!=="emphasis"&&i.leaveEmphasis(this),se.hide()}),(_.get(["iconStatus",Z])==="emphasis"?Ws:qs)(j),o.add(j),j.on("click",pt(x.onclick,x,n,i,Z)),$[Z]=j})}toe(o,t,i),o.add(m5(o.getBoundingRect(),t)),l||o.eachChild(function(_){var x=_.__title,w=_.ensureState("emphasis"),C=w.textConfig||(w.textConfig={}),A=_.getTextContent(),L=A&&A.ensureState("emphasis");if(L&&!It(L)&&x){var O=L.style||(L.style={}),V=bp(x,Dr.makeFont(O)),F=_.x+o.x,$=_.y+o.y+s,H=!1;$+V.height>i.getHeight()&&(C.position="top",H=!0);var Z=H?-5-V.height:s+10;F+V.width/2>i.getWidth()?(C.position=["100%",Z],O.align="right"):F-V.width/2<0&&(C.position=[0,Z],O.align="left")}})},e.prototype.updateView=function(t,n,i,a){Q(this._features,function(o){o instanceof Eo&&o.updateView&&o.updateView(o.model,n,i,a)})},e.prototype.remove=function(t,n){Q(this._features,function(i){i instanceof Eo&&i.remove&&i.remove(t,n)}),this.group.removeAll()},e.prototype.dispose=function(t,n){Q(this._features,function(i){i instanceof Eo&&i.dispose&&i.dispose(t,n)})},e.type="toolbox",e}(xn);function noe(r){return r.indexOf("my")===0}var ioe=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){var i=this.model,a=i.get("name")||t.get("title.0.text")||"echarts",o=n.getZr().painter.getType()==="svg",s=o?"svg":i.get("type",!0)||"png",l=n.getConnectedDataURL({type:s,backgroundColor:i.get("backgroundColor",!0)||t.get("backgroundColor")||"#fff",connectedBackgroundColor:i.get("connectedBackgroundColor"),excludeComponents:i.get("excludeComponents"),pixelRatio:i.get("pixelRatio")}),u=gr.browser;if(typeof MouseEvent=="function"&&(u.newEdge||!u.ie&&!u.edge)){var d=document.createElement("a");d.download=a+"."+s,d.target="_blank",d.href=l;var f=new MouseEvent("click",{view:document.defaultView,bubbles:!0,cancelable:!1});d.dispatchEvent(f)}else if(window.navigator.msSaveOrOpenBlob||o){var g=l.split(","),m=g[0].indexOf("base64")>-1,_=o?decodeURIComponent(g[1]):g[1];m&&(_=window.atob(_));var x=a+"."+s;if(window.navigator.msSaveOrOpenBlob){for(var w=_.length,C=new Uint8Array(w);w--;)C[w]=_.charCodeAt(w);var A=new Blob([C]);window.navigator.msSaveOrOpenBlob(A,x)}else{var L=document.createElement("iframe");document.body.appendChild(L);var O=L.contentWindow,V=O.document;V.open("image/svg+xml","replace"),V.write(_),V.close(),O.focus(),V.execCommand("SaveAs",!0,x),document.body.removeChild(L)}}else{var F=i.get("lang"),$='',H=window.open();H.document.write($),H.document.title=a}},e.getDefaultOption=function(t){var n={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:t.getLocaleModel().get(["toolbox","saveAsImage","title"]),type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],lang:t.getLocaleModel().get(["toolbox","saveAsImage","lang"])};return n},e}(Eo),y5="__ec_magicType_stack__",aoe=[["line","bar"],["stack"]],ooe=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.getIcons=function(){var t=this.model,n=t.get("icon"),i={};return Q(t.get("type"),function(a){n[a]&&(i[a]=n[a])}),i},e.getDefaultOption=function(t){var n={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:t.getLocaleModel().get(["toolbox","magicType","title"]),option:{},seriesIndex:{}};return n},e.prototype.onclick=function(t,n,i){var a=this.model,o=a.get(["seriesIndex",i]);if(_5[i]){var s={series:[]},l=function(f){var g=f.subType,m=f.id,_=_5[i](g,m,f,a);_&&(Bt(_,f.option),s.series.push(_));var x=f.coordinateSystem;if(x&&x.type==="cartesian2d"&&(i==="line"||i==="bar")){var w=x.getAxesByScale("ordinal")[0];if(w){var C=w.dim,A=C+"Axis",L=f.getReferringComponents(A,Hn).models[0],O=L.componentIndex;s[A]=s[A]||[];for(var V=0;V<=O;V++)s[A][O]=s[A][O]||{};s[A][O].boundaryGap=i==="bar"}}};Q(aoe,function(f){hr(f,i)>=0&&Q(f,function(g){a.setIconStatus(g,"normal")})}),a.setIconStatus(i,"emphasis"),t.eachComponent({mainType:"series",query:o==null?null:{seriesIndex:o}},l);var u,d=i;i==="stack"&&(u=rr({stack:a.option.title.tiled,tiled:a.option.title.stack},a.option.title),a.get(["iconStatus",i])!=="emphasis"&&(d="tiled")),n.dispatchAction({type:"changeMagicType",currentType:d,newOption:s,newTitle:u,featureName:"magicType"})}},e}(Eo),_5={line:function(r,e,t,n){if(r==="bar")return rr({id:e,type:"line",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","line"])||{},!0)},bar:function(r,e,t,n){if(r==="line")return rr({id:e,type:"bar",data:t.get("data"),stack:t.get("stack"),markPoint:t.get("markPoint"),markLine:t.get("markLine")},n.get(["option","bar"])||{},!0)},stack:function(r,e,t,n){var i=t.get("stack")===y5;if(r==="line"||r==="bar")return n.setIconStatus("stack",i?"normal":"emphasis"),rr({id:e,stack:i?"":y5},n.get(["option","stack"])||{},!0)}};ys({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(r,e){e.mergeOption(r.newOption)});var soe={},I0=new Array(60).join("-"),Yd=" ";function loe(r){var e={},t=[],n=[];return r.eachRawSeries(function(i){var a=i.coordinateSystem;if(a&&(a.type==="cartesian2d"||a.type==="polar")){var o=a.getBaseAxis();if(o.type==="category"){var s=o.dim+"_"+o.index;e[s]||(e[s]={categoryAxis:o,valueAxis:a.getOtherAxis(o),series:[]},n.push({axisDim:o.dim,axisIndex:o.index})),e[s].series.push(i)}else t.push(i)}else t.push(i)}),{seriesGroupByCategoryAxis:e,other:t,meta:n}}function uoe(r){var e=[];return Q(r,function(t,n){var i=t.categoryAxis,a=t.valueAxis,o=a.dim,s=[" "].concat(je(t.series,function(m){return m.name})),l=[i.model.getCategories()];Q(t.series,function(m){var _=m.getRawData();l.push(m.getRawData().mapArray(_.mapDimension(o),function(x){return x}))});for(var u=[s.join(Yd)],d=0;d=0)return!0}var g2=new RegExp("["+Yd+"]+","g");function foe(r){for(var e=r.split(/\n+/g),t=k0(e.shift()).split(g2),n=[],i=je(t,function(l){return{name:l,data:[]}}),a=0;a=0;a--){var o=t[a];if(o[i])break}if(a<0){var s=r.queryComponents({mainType:"dataZoom",subType:"select",id:i})[0];if(s){var l=s.getPercentRange();t[0][i]={dataZoomId:i,start:l[0],end:l[1]}}}}),t.push(e)}function _oe(r){var e=v2(r),t=e[e.length-1];e.length>1&&e.pop();var n={};return b5(t,function(i,a){for(var o=e.length-1;o>=0;o--)if(i=e[o][a],i){n[a]=i;break}}),n}function boe(r){x5(r).snapshots=null}function xoe(r){return v2(r).length}function v2(r){var e=x5(r);return e.snapshots||(e.snapshots=[{}]),e.snapshots}var woe=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.onclick=function(t,n){boe(t),n.dispatchAction({type:"restore",from:this.uid})},e.getDefaultOption=function(t){var n={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:t.getLocaleModel().get(["toolbox","restore","title"])};return n},e}(Eo);ys({type:"restore",event:"restore",update:"prepareAndUpdate"},function(r,e){e.resetOption("recreate")});var w5={},Soe=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"],m2=function(){function r(e,t,n){var i=this;this._targetInfoList=[];var a=S5(t,e);Q(Toe,function(o,s){(!n||!n.include||hr(n.include,s)>=0)&&o(a,i._targetInfoList)})}return r.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(n,i,a){if((n.coordRanges||(n.coordRanges=[])).push(i),!n.coordRange){n.coordRange=i;var o=_2[n.brushType](0,a,i);n.__rangeOffset={offset:A5[n.brushType](o.values,n.range,[1,1]),xyMinMax:o.xyMinMax}}}),e},r.prototype.matchOutputRanges=function(e,t,n){Q(e,function(i){var a=this.findTargetInfo(i,t);a&&a!==!0&&Q(a.coordSyses,function(o){var s=_2[i.brushType](1,o,i.range,!0);n(i,s.values,o,t)})},this)},r.prototype.setInputRanges=function(e,t){Q(e,function(n){var i=this.findTargetInfo(n,t);if(w5.NODE_ENV!=="production"&&(Ot(!i||i===!0||n.coordRange,"coordRange must be specified when coord index specified."),Ot(!i||i!==!0||n.range,"range must be specified in global brush.")),n.range=n.range||[],i&&i!==!0){n.panelId=i.panelId;var a=_2[n.brushType](0,i.coordSys,n.coordRange),o=n.__rangeOffset;n.range=o?A5[n.brushType](a.values,o.offset,Eoe(a.xyMinMax,o.xyMinMax)):a.values}},this)},r.prototype.makePanelOpts=function(e,t){return je(this._targetInfoList,function(n){var i=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:pV(i),isTargetByCursor:vV(i,e,n.coordSysModel),getLinearBrushOtherExtent:gV(i)}})},r.prototype.controlSeries=function(e,t,n){var i=this.findTargetInfo(e,n);return i===!0||i&&hr(i.coordSyses,t.coordinateSystem)>=0},r.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,i=S5(t,e),a=0;ar[1]&&r.reverse(),r}function S5(r,e){return Ep(r,e,{includeMainTypes:Soe})}var Toe={grid:function(r,e){var t=r.xAxisModels,n=r.yAxisModels,i=r.gridModels,a=Tt(),o={},s={};!t&&!n&&!i||(Q(t,function(l){var u=l.axis.grid.model;a.set(u.id,u),o[u.id]=!0}),Q(n,function(l){var u=l.axis.grid.model;a.set(u.id,u),s[u.id]=!0}),Q(i,function(l){a.set(l.id,l),o[l.id]=!0,s[l.id]=!0}),a.each(function(l){var u=l.coordinateSystem,d=[];Q(u.getCartesians(),function(f,g){(hr(t,f.getAxis("x").model)>=0||hr(n,f.getAxis("y").model)>=0)&&d.push(f)}),e.push({panelId:"grid--"+l.id,gridModel:l,coordSysModel:l,coordSys:d[0],coordSyses:d,getPanelRect:E5.grid,xAxisDeclared:o[l.id],yAxisDeclared:s[l.id]})}))},geo:function(r,e){Q(r.geoModels,function(t){var n=t.coordinateSystem;e.push({panelId:"geo--"+t.id,geoModel:t,coordSysModel:t,coordSys:n,coordSyses:[n],getPanelRect:E5.geo})})}},T5=[function(r,e){var t=r.xAxisModel,n=r.yAxisModel,i=r.gridModel;return!i&&t&&(i=t.axis.grid.model),!i&&n&&(i=n.axis.grid.model),i&&i===e.gridModel},function(r,e){var t=r.geoModel;return t&&t===e.geoModel}],E5={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var r=this.coordSys,e=r.getBoundingRect().clone();return e.applyTransform(Sc(r)),e}},_2={lineX:er(C5,0),lineY:er(C5,1),rect:function(r,e,t,n){var i=r?e.pointToData([t[0][0],t[1][0]],n):e.dataToPoint([t[0][0],t[1][0]],n),a=r?e.pointToData([t[0][1],t[1][1]],n):e.dataToPoint([t[0][1],t[1][1]],n),o=[y2([i[0],a[0]]),y2([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(r,e,t,n){var i=[[1/0,-1/0],[1/0,-1/0]],a=je(t,function(o){var s=r?e.pointToData(o,n):e.dataToPoint(o,n);return i[0][0]=Math.min(i[0][0],s[0]),i[1][0]=Math.min(i[1][0],s[1]),i[0][1]=Math.max(i[0][1],s[0]),i[1][1]=Math.max(i[1][1],s[1]),s});return{values:a,xyMinMax:i}}};function C5(r,e,t,n){w5.NODE_ENV!=="production"&&Ot(t.type==="cartesian2d","lineX/lineY brush is available only in cartesian2d.");var i=t.getAxis(["x","y"][r]),a=y2(je([0,1],function(s){return e?i.coordToData(i.toLocalCoord(n[s]),!0):i.toGlobalCoord(i.dataToCoord(n[s]))})),o=[];return o[r]=a,o[1-r]=[NaN,NaN],{values:a,xyMinMax:o}}var A5={lineX:er(D5,0),lineY:er(D5,1),rect:function(r,e,t){return[[r[0][0]-t[0]*e[0][0],r[0][1]-t[0]*e[0][1]],[r[1][0]-t[1]*e[1][0],r[1][1]-t[1]*e[1][1]]]},polygon:function(r,e,t){return je(r,function(n,i){return[n[0]-t[0]*e[i][0],n[1]-t[1]*e[i][1]]})}};function D5(r,e,t,n){return[e[0]-n[r]*t[0],e[1]-n[r]*t[1]]}function Eoe(r,e){var t=M5(r),n=M5(e),i=[t[0]/n[0],t[1]/n[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function M5(r){return r?[r[0][1]-r[0][0],r[1][1]-r[1][0]]:[NaN,NaN]}var b2=Q,Coe=eW("toolbox-dataZoom_"),Aoe=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i,a){this._brushController||(this._brushController=new vE(i.getZr()),this._brushController.on("brush",pt(this._onBrush,this)).mount()),Ioe(t,n,this,a,i),Moe(t,n)},e.prototype.onclick=function(t,n,i){Doe[i].call(this)},e.prototype.remove=function(t,n){this._brushController&&this._brushController.unmount()},e.prototype.dispose=function(t,n){this._brushController&&this._brushController.dispose()},e.prototype._onBrush=function(t){var n=t.areas;if(!t.isEnd||!n.length)return;var i={},a=this.ecModel;this._brushController.updateCovers([]);var o=new m2(x2(this.model),a,{include:["grid"]});o.matchOutputRanges(n,a,function(u,d,f){if(f.type==="cartesian2d"){var g=u.brushType;g==="rect"?(s("x",f,d[0]),s("y",f,d[1])):s({lineX:"x",lineY:"y"}[g],f,d)}}),yoe(a,i),this._dispatchZoomAction(i);function s(u,d,f){var g=d.getAxis(u),m=g.model,_=l(u,m,a),x=_.findRepresentativeAxisProxy(m).getMinMaxSpan();(x.minValueSpan!=null||x.maxValueSpan!=null)&&(f=Qc(0,f.slice(),g.scale.getExtent(),0,x.minValueSpan,x.maxValueSpan)),_&&(i[_.id]={dataZoomId:_.id,startValue:f[0],endValue:f[1]})}function l(u,d,f){var g;return f.eachComponent({mainType:"dataZoom",subType:"select"},function(m){var _=m.getAxisModel(u,d.componentIndex);_&&(g=m)}),g}},e.prototype._dispatchZoomAction=function(t){var n=[];b2(t,function(i,a){n.push(Ut(i))}),n.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:n})},e.getDefaultOption=function(t){var n={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:t.getLocaleModel().get(["toolbox","dataZoom","title"]),brushStyle:{borderWidth:0,color:"rgba(210,219,238,0.2)"}};return n},e}(Eo),Doe={zoom:function(){var r=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:r})},back:function(){this._dispatchZoomAction(_oe(this.ecModel))}};function x2(r){var e={xAxisIndex:r.get("xAxisIndex",!0),yAxisIndex:r.get("yAxisIndex",!0),xAxisId:r.get("xAxisId",!0),yAxisId:r.get("yAxisId",!0)};return e.xAxisIndex==null&&e.xAxisId==null&&(e.xAxisIndex="all"),e.yAxisIndex==null&&e.yAxisId==null&&(e.yAxisIndex="all"),e}function Moe(r,e){r.setIconStatus("back",xoe(e)>1?"emphasis":"normal")}function Ioe(r,e,t,n,i){var a=t._isZoomActive;n&&n.type==="takeGlobalCursor"&&(a=n.key==="dataZoomSelect"?n.dataZoomSelectActive:!1),t._isZoomActive=a,r.setIconStatus("zoom",a?"emphasis":"normal");var o=new m2(x2(r),e,{include:["grid"]}),s=o.makePanelOpts(i,function(l){return l.xAxisDeclared&&!l.yAxisDeclared?"lineX":!l.xAxisDeclared&&l.yAxisDeclared?"lineY":"rect"});t._brushController.setPanels(s).enableBrush(a&&s.length?{brushType:"auto",brushStyle:r.getModel("brushStyle").getItemStyle()}:!1)}Dq("dataZoom",function(r){var e=r.getComponent("toolbox",0),t=["feature","dataZoom"];if(!e||e.get(t)==null)return;var n=e.getModel(t),i=[],a=x2(n),o=Ep(r,a);b2(o.xAxisModels,function(l){return s(l,"xAxis","xAxisIndex")}),b2(o.yAxisModels,function(l){return s(l,"yAxis","yAxisIndex")});function s(l,u,d){var f=l.componentIndex,g={type:"select",$fromToolbox:!0,filterMode:n.get("filterMode",!0)||"filter",id:Coe+u+f};g[d]=f,i.push(g)}return i});function koe(r){r.registerComponentModel(eoe),r.registerComponentView(roe),Xd("saveAsImage",ioe),Xd("magicType",ooe),Xd("dataView",voe),Xd("dataZoom",Aoe),Xd("restore",woe),dr(Qae)}var Loe=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e}(mr);function I5(r){var e=r.get("confine");return e!=null?!!e:r.get("renderMode")==="richText"}function k5(r){if(gr.domSupported){for(var e=document.documentElement.style,t=0,n=r.length;t-1?(s+="top:50%",l+="translateY(-50%) rotate("+(u=a==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(u=a==="top"?225:45)+"deg)");var d=u*Math.PI/180,f=o+i,g=f*Math.abs(Math.cos(d))+f*Math.abs(Math.sin(d)),m=Math.round(((g-Math.SQRT2*i)/2+Math.SQRT2*i-(g-f)/2)*100)/100;s+=";"+a+":-"+m+"px";var _=e+" solid "+i+"px;",x=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+_,"border-right:"+_,"background-color:"+n+";"];return'
'}function Voe(r,e){var t="cubic-bezier(0.23,1,0.32,1)",n=" "+r/2+"s "+t,i="opacity"+n+",visibility"+n;return e||(n=" "+r+"s "+t,i+=gr.transformSupported?","+w2+n:",left"+n+",top"+n),Noe+":"+i}function R5(r,e,t){var n=r.toFixed(0)+"px",i=e.toFixed(0)+"px";if(!gr.transformSupported)return t?"top:"+i+";left:"+n+";":[["top",i],["left",n]];var a=gr.transform3dSupported,o="translate"+(a?"3d":"")+"("+n+","+i+(a?",0":"")+")";return t?"top:0;left:0;"+w2+":"+o+";":[["top",0],["left",0],[L5,o]]}function Foe(r){var e=[],t=r.get("fontSize"),n=r.getTextColor();n&&e.push("color:"+n),e.push("font:"+r.getFont());var i=Zt(r.get("lineHeight"),Math.round(t*3/2));t&&e.push("line-height:"+i+"px");var a=r.get("textShadowColor"),o=r.get("textShadowBlur")||0,s=r.get("textShadowOffsetX")||0,l=r.get("textShadowOffsetY")||0;return a&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+a),Q(["decoration","align"],function(u){var d=r.get(u);d&&e.push("text-"+u+":"+d)}),e.join(";")}function $oe(r,e,t){var n=[],i=r.get("transitionDuration"),a=r.get("backgroundColor"),o=r.get("shadowBlur"),s=r.get("shadowColor"),l=r.get("shadowOffsetX"),u=r.get("shadowOffsetY"),d=r.getModel("textStyle"),f=CP(r,"html"),g=l+"px "+u+"px "+o+"px "+s;return n.push("box-shadow:"+g),e&&i&&n.push(Voe(i,t)),a&&n.push("background-color:"+a),Q(["width","color","radius"],function(m){var _="border-"+m,x=bL(_),w=r.get(x);w!=null&&n.push(_+":"+w+(m==="color"?"":"px"))}),n.push(Foe(d)),f!=null&&n.push("padding:"+gd(f).join("px ")+"px"),n.join(";")+";"}function N5(r,e,t,n,i){var a=e&&e.painter;if(t){var o=a&&a.getViewportRoot();o&&A8(r,o,t,n,i)}else{r[0]=n,r[1]=i;var s=a&&a.getViewportRootOffset();s&&(r[0]+=s.offsetLeft,r[1]+=s.offsetTop)}r[2]=r[0]/e.getWidth(),r[3]=r[1]/e.getHeight()}var Goe=function(){function r(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,gr.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var i=this._zr=e.getZr(),a=t.appendTo,o=a&&(ut(a)?document.querySelector(a):Wu(a)?a:It(a)&&a(e.getDom()));N5(this._styleCoord,i,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var u=i.handler,d=i.painter.getViewportRoot();ao(d,l,!0),u.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return r.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=Roe(t,"position"),i=t.style;i.position!=="absolute"&&n!=="absolute"&&(i.position="relative")}var a=e.get("alwaysShowContent");a&&this._moveIfResized(),this._alwaysShowContent=a,this.el.className=e.get("className")||""},r.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,i=n.style,a=this._styleCoord;n.innerHTML?i.cssText=Ooe+$oe(e,!this._firstShow,this._longHide)+R5(a[0],a[1],!0)+("border-color:"+Cc(t)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):i.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},r.prototype.setContent=function(e,t,n,i,a){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(ut(a)&&n.get("trigger")==="item"&&!I5(n)&&(s=Boe(n,i,a)),ut(e))o.innerHTML=e+s;else if(e){o.innerHTML="",Ze(e)||(e=[e]);for(var l=0;l=0?this._tryShow(a,o):i==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var t=this._tooltipModel,n=this._ecModel,i=this._api,a=t.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&a!=="none"&&a!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!i.isDisposed()&&o.manuallyShowTip(t,n,i,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(t,n,i,a){if(!(a.from===this.uid||gr.node||!i.getDom())){var o=B5(a,i);this._ticket="";var s=a.dataByCoordSys,l=Yoe(a,n,i);if(l){var u=l.el.getBoundingRect().clone();u.applyTransform(l.el.transform),this._tryShow({offsetX:u.x+u.width/2,offsetY:u.y+u.height/2,target:l.el,position:a.position,positionDefault:"bottom"},o)}else if(a.tooltip&&a.x!=null&&a.y!=null){var d=Woe;d.x=a.x,d.y=a.y,d.update(),jt(d).tooltipConfig={name:null,option:a.tooltip},this._tryShow({offsetX:a.x,offsetY:a.y,target:d},o)}else if(s)this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,dataByCoordSys:s,tooltipOption:a.tooltipOption},o);else if(a.seriesIndex!=null){if(this._manuallyAxisShowTip(t,n,i,a))return;var f=GF(a,n),g=f.point[0],m=f.point[1];g!=null&&m!=null&&this._tryShow({offsetX:g,offsetY:m,target:f.el,position:a.position,positionDefault:"bottom"},o)}else a.x!=null&&a.y!=null&&(i.dispatchAction({type:"updateAxisPointer",x:a.x,y:a.y}),this._tryShow({offsetX:a.x,offsetY:a.y,position:a.position,target:i.getZr().findHover(a.x,a.y).target},o))}},e.prototype.manuallyHideTip=function(t,n,i,a){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,a.from!==this.uid&&this._hide(B5(a,i))},e.prototype._manuallyAxisShowTip=function(t,n,i,a){var o=a.seriesIndex,s=a.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var u=n.getSeriesByIndex(o);if(u){var d=u.getData(),f=jg([d.getItemModel(s),u,(u.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return i.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:a.position}),!0}}},e.prototype._tryShow=function(t,n){var i=t.target,a=this._tooltipModel;if(a){this._lastX=t.offsetX,this._lastY=t.offsetY;var o=t.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,t);else if(i){var s=jt(i);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,u;Lc(i,function(d){if(jt(d).dataIndex!=null)return l=d,!0;if(jt(d).tooltipConfig!=null)return u=d,!0},!0),l?this._showSeriesItemTooltip(t,l,n):u?this._showComponentItemTooltip(t,u,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(t,n){var i=t.get("showDelay");n=pt(n,this),clearTimeout(this._showTimout),i>0?this._showTimout=setTimeout(n,i):n()},e.prototype._showAxisTooltip=function(t,n){var i=this._ecModel,a=this._tooltipModel,o=[n.offsetX,n.offsetY],s=jg([n.tooltipOption],a),l=this._renderMode,u=[],d=ii("section",{blocks:[],noHeader:!0}),f=[],g=new K1;Q(t,function(A){Q(A.dataByAxis,function(L){var O=i.getComponent(L.axisDim+"Axis",L.axisIndex),V=L.value;if(!(!O||V==null)){var F=RF(V,O.axis,i,L.seriesDataIndices,L.valueLabelOpt),$=ii("section",{header:F,noHeader:!Oo(F),sortBlocks:!0,blocks:[]});d.blocks.push($),Q(L.seriesDataIndices,function(H){var Z=i.getSeriesByIndex(H.seriesIndex),j=H.dataIndexInside,Y=Z.getDataParams(j);if(!(Y.dataIndex<0)){Y.axisDim=L.axisDim,Y.axisIndex=L.axisIndex,Y.axisType=L.axisType,Y.axisId=L.axisId,Y.axisValue=OS(O.axis,{value:V}),Y.axisValueLabel=F,Y.marker=g.makeTooltipMarker("item",Cc(Y.color),l);var se=oP(Z.formatTooltip(j,!0,null)),ae=se.frag;if(ae){var ue=jg([Z],a).get("valueFormatter");$.blocks.push(ue?Ge({valueFormatter:ue},ae):ae)}se.text&&f.push(se.text),u.push(Y)}})}})}),d.blocks.reverse(),f.reverse();var m=n.position,_=s.get("order"),x=SP(d,g,l,_,i.get("useUTC"),s.get("textStyle"));x&&f.unshift(x);var w=l==="richText"?` `:"
",C=f.join(w);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(t,u)?this._updatePosition(s,m,o[0],o[1],this._tooltipContent,u):this._showTooltipContent(s,C,u,Math.random()+"",o[0],o[1],m,null,g)})},e.prototype._showSeriesItemTooltip=function(t,n,i){var a=this._ecModel,o=jt(n),s=o.seriesIndex,l=a.getSeriesByIndex(s),u=o.dataModel||l,d=o.dataIndex,f=o.dataType,g=u.getData(f),m=this._renderMode,_=t.positionDefault,x=jg([g.getItemModel(d),u,l&&(l.coordinateSystem||{}).model],this._tooltipModel,_?{position:_}:null),w=x.get("trigger");if(!(w!=null&&w!=="item")){var C=u.getDataParams(d,f),A=new K1;C.marker=A.makeTooltipMarker("item",Cc(C.color),m);var L=oP(u.formatTooltip(d,!1,f)),O=x.get("order"),V=x.get("valueFormatter"),F=L.frag,$=F?SP(V?Ge({valueFormatter:V},F):F,A,m,O,a.get("useUTC"),x.get("textStyle")):L.text,H="item_"+u.name+"_"+d;this._showOrMove(x,function(){this._showTooltipContent(x,$,C,H,t.offsetX,t.offsetY,t.position,t.target,A)}),i({type:"showTip",dataIndexInside:d,dataIndex:g.getRawIndex(d),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(t,n,i){var a=this._renderMode==="html",o=jt(n),s=o.tooltipConfig,l=s.option||{},u=l.encodeHTMLContent;if(ut(l)){var d=l;l={content:d,formatter:d},u=!0}u&&a&&l.content&&(l=Ut(l),l.content=Yi(l.content));var f=[l],g=this._ecModel.getComponent(o.componentMainType,o.componentIndex);g&&f.push(g),f.push({formatter:l.content});var m=t.positionDefault,_=jg(f,this._tooltipModel,m?{position:m}:null),x=_.get("content"),w=Math.random()+"",C=new K1;this._showOrMove(_,function(){var A=Ut(_.get("formatterParams")||{});this._showTooltipContent(_,x,A,w,t.offsetX,t.offsetY,t.position,n,C)}),i({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(t,n,i,a,o,s,l,u,d){if(this._ticket="",!(!t.get("showContent")||!t.get("show"))){var f=this._tooltipContent;f.setEnterable(t.get("enterable"));var g=t.get("formatter");l=l||t.get("position");var m=n,_=this._getNearestPoint([o,s],i,t.get("trigger"),t.get("borderColor")),x=_.color;if(g)if(ut(g)){var w=t.ecModel.get("useUTC"),C=Ze(i)?i[0]:i,A=C&&C.axisType&&C.axisType.indexOf("time")>=0;m=g,A&&(m=qy(C.axisValue,m,w)),m=wL(m,i,!0)}else if(It(g)){var L=pt(function(O,V){O===this._ticket&&(f.setContent(V,d,t,x,l),this._updatePosition(t,l,o,s,f,i,u))},this);this._ticket=a,m=g(i,a,L)}else m=g;f.setContent(m,d,t,x,l),f.show(t,x),this._updatePosition(t,l,o,s,f,i,u)}},e.prototype._getNearestPoint=function(t,n,i,a){if(i==="axis"||Ze(n))return{color:a||(this._renderMode==="html"?"#fff":"none")};if(!Ze(n))return{color:a||n.color||n.borderColor}},e.prototype._updatePosition=function(t,n,i,a,o,s,l){var u=this._api.getWidth(),d=this._api.getHeight();n=n||t.get("position");var f=o.getSize(),g=t.get("align"),m=t.get("verticalAlign"),_=l&&l.getBoundingRect().clone();if(l&&_.applyTransform(l.transform),It(n)&&(n=n([i,a],s,o.el,_,{viewSize:[u,d],contentSize:f.slice()})),Ze(n))i=nt(n[0],u),a=nt(n[1],d);else if(Nt(n)){var x=n;x.width=f[0],x.height=f[1];var w=Xn(x,{width:u,height:d});i=w.x,a=w.y,g=null,m=null}else if(ut(n)&&l){var C=Xoe(n,_,f,t.get("borderWidth"));i=C[0],a=C[1]}else{var C=Zoe(i,a,o,u,d,g?null:20,m?null:20);i=C[0],a=C[1]}if(g&&(i-=V5(g)?f[0]/2:g==="right"?f[0]:0),m&&(a-=V5(m)?f[1]/2:m==="bottom"?f[1]:0),I5(t)){var C=joe(i,a,o,u,d);i=C[0],a=C[1]}o.moveTo(i,a)},e.prototype._updateContentNotChangedOnAxis=function(t,n){var i=this._lastDataByCoordSys,a=this._cbParamsList,o=!!i&&i.length===t.length;return o&&Q(i,function(s,l){var u=s.dataByAxis||[],d=t[l]||{},f=d.dataByAxis||[];o=o&&u.length===f.length,o&&Q(u,function(g,m){var _=f[m]||{},x=g.seriesDataIndices||[],w=_.seriesDataIndices||[];o=o&&g.value===_.value&&g.axisType===_.axisType&&g.axisId===_.axisId&&x.length===w.length,o&&Q(x,function(C,A){var L=w[A];o=o&&C.seriesIndex===L.seriesIndex&&C.dataIndex===L.dataIndex}),a&&Q(g.seriesDataIndices,function(C){var A=C.seriesIndex,L=n[A],O=a[A];L&&O&&O.data!==L.data&&(o=!1)})})}),this._lastDataByCoordSys=t,this._cbParamsList=n,!!o},e.prototype._hide=function(t){this._lastDataByCoordSys=null,t({type:"hideTip",from:this.uid})},e.prototype.dispose=function(t,n){gr.node||!n.getDom()||(eg(this,"_updatePosition"),this._tooltipContent.dispose(),n2("itemTooltip",n))},e.type="tooltip",e}(xn);function jg(r,e,t){var n=e.ecModel,i;t?(i=new qr(t,n,n),i=new qr(e.option,i,n)):i=e;for(var a=r.length-1;a>=0;a--){var o=r[a];o&&(o instanceof qr&&(o=o.get("tooltip",!0)),ut(o)&&(o={formatter:o}),o&&(i=new qr(o,i,n)))}return i}function B5(r,e){return r.dispatchAction||pt(e.dispatchAction,e)}function Zoe(r,e,t,n,i,a,o){var s=t.getSize(),l=s[0],u=s[1];return a!=null&&(r+l+a+2>n?r-=l+a:r+=a),o!=null&&(e+u+o>i?e-=u+o:e+=o),[r,e]}function joe(r,e,t,n,i){var a=t.getSize(),o=a[0],s=a[1];return r=Math.min(r+o,n)-o,e=Math.min(e+s,i)-s,r=Math.max(r,0),e=Math.max(e,0),[r,e]}function Xoe(r,e,t,n){var i=t[0],a=t[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,u=e.width,d=e.height;switch(r){case"inside":s=e.x+u/2-i/2,l=e.y+d/2-a/2;break;case"top":s=e.x+u/2-i/2,l=e.y-a-o;break;case"bottom":s=e.x+u/2-i/2,l=e.y+d+o;break;case"left":s=e.x-i-o,l=e.y+d/2-a/2;break;case"right":s=e.x+u+o,l=e.y+d/2-a/2}return[s,l]}function V5(r){return r==="center"||r==="middle"}function Yoe(r,e,t){var n=Dw(r).queryOptionMap,i=n.keys()[0];if(!(!i||i==="series")){var a=Cp(e,i,n.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}),o=a.models[0];if(o){var s=t.getViewOfComponentModel(o),l;if(s.group.traverse(function(u){var d=jt(u).tooltipConfig;if(d&&d.name===r.name)return l=u,!0}),l)return{componentMainType:i,componentIndex:o.componentIndex,el:l}}}}function Koe(r){dr(qg),r.registerComponentModel(Loe),r.registerComponentView(qoe),r.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},On),r.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},On)}var Joe=["rect","polygon","keep","clear"];function Qoe(r,e){var t=Xr(r?r.brush:[]);if(t.length){var n=[];Q(t,function(l){var u=l.hasOwnProperty("toolbox")?l.toolbox:[];u instanceof Array&&(n=n.concat(u))});var i=r&&r.toolbox;Ze(i)&&(i=i[0]),i||(i={feature:{}},r.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||(a.brush={}),s=o.type||(o.type=[]);s.push.apply(s,n),ese(s),e&&!s.length&&s.push.apply(s,Joe)}}function ese(r){var e={};Q(r,function(t){e[t]=1}),r.length=0,Q(e,function(t,n){r.push(n)})}var F5=Q;function $5(r){if(r){for(var e in r)if(r.hasOwnProperty(e))return!0}}function S2(r,e,t){var n={};return F5(e,function(a){var o=n[a]=i();F5(r[a],function(s,l){if(si.isValidType(l)){var u={type:l,visual:s};t&&t(u,a),o[l]=new si(u),l==="opacity"&&(u=Ut(u),u.type="colorAlpha",o.__hidden.__alphaForOpacity=new si(u))}})}),n;function i(){var a=function(){};a.prototype.__hidden=a.prototype;var o=new a;return o}}function G5(r,e,t){var n;Q(t,function(i){e.hasOwnProperty(i)&&$5(e[i])&&(n=!0)}),n&&Q(t,function(i){e.hasOwnProperty(i)&&$5(e[i])?r[i]=Ut(e[i]):delete r[i]})}function tse(r,e,t,n,i,a){var o={};Q(r,function(f){var g=si.prepareVisualTypes(e[f]);o[f]=g});var s;function l(f){return nS(t,s,f)}function u(f,g){XP(t,s,f,g)}t.each(d);function d(f,g){s=f;var m=t.getRawDataItem(s);if(!(m&&m.visualMap===!1))for(var _=n.call(i,f),x=e[_],w=o[_],C=0,A=w.length;Ce[0][1]&&(e[0][1]=a[0]),a[1]e[1][1]&&(e[1][1]=a[1])}return e&&j5(e)}};function j5(r){return new sr(r[0][0],r[1][0],r[0][1]-r[0][0],r[1][1]-r[1][0])}var use=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.ecModel=t,this.api=n,this.model,(this._brushController=new vE(n.getZr())).on("brush",pt(this._onBrush,this)).mount()},e.prototype.render=function(t,n,i,a){this.model=t,this._updateController(t,n,i,a)},e.prototype.updateTransform=function(t,n,i,a){q5(n),this._updateController(t,n,i,a)},e.prototype.updateVisual=function(t,n,i,a){this.updateTransform(t,n,i,a)},e.prototype.updateView=function(t,n,i,a){this._updateController(t,n,i,a)},e.prototype._updateController=function(t,n,i,a){(!a||a.$from!==t.id)&&this._brushController.setPanels(t.brushTargetManager.makePanelOpts(i)).enableBrush(t.brushOption).updateCovers(t.areas.slice())},e.prototype.dispose=function(){this._brushController.dispose()},e.prototype._onBrush=function(t){var n=this.model.id,i=this.model.brushTargetManager.setOutputRanges(t.areas,this.ecModel);(!t.isEnd||t.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:n,areas:Ut(i),$from:n}),t.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:n,areas:Ut(i),$from:n})},e.type="brush",e}(xn),cse={},hse="#ddd",dse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.areas=[],t.brushOption={},t}return e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&G5(i,t,["inBrush","outOfBrush"]);var a=i.inBrush=i.inBrush||{};i.outOfBrush=i.outOfBrush||{color:hse},a.hasOwnProperty("liftZ")||(a.liftZ=5)},e.prototype.setAreas=function(t){cse.NODE_ENV!=="production"&&(Ot(Ze(t)),Q(t,function(n){Ot(n.brushType,"Illegal areas")})),t&&(this.areas=je(t,function(n){return X5(this.option,n)},this))},e.prototype.setBrushOption=function(t){this.brushOption=X5(this.option,t),this.brushType=this.brushOption.brushType},e.type="brush",e.dependencies=["geo","grid","xAxis","yAxis","parallel","series"],e.defaultOption={seriesIndex:"all",brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(210,219,238,0.3)",borderColor:"#D2DBEE"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},e}(mr);function X5(r,e){return rr({brushType:r.brushType,brushMode:r.brushMode,transformable:r.transformable,brushStyle:new qr(r.brushStyle).getItemStyle(),removeOnClick:r.removeOnClick,z:r.z},e,!0)}var fse=["rect","polygon","lineX","lineY","keep","clear"],pse=function(r){ze(e,r);function e(){return r!==null&&r.apply(this,arguments)||this}return e.prototype.render=function(t,n,i){var a,o,s;n.eachComponent({mainType:"brush"},function(l){a=l.brushType,o=l.brushOption.brushMode||"single",s=s||!!l.areas.length}),this._brushType=a,this._brushMode=o,Q(t.get("type",!0),function(l){t.setIconStatus(l,(l==="keep"?o==="multiple":l==="clear"?s:l===a)?"emphasis":"normal")})},e.prototype.updateView=function(t,n,i){this.render(t,n,i)},e.prototype.getIcons=function(){var t=this.model,n=t.get("icon",!0),i={};return Q(t.get("type",!0),function(a){n[a]&&(i[a]=n[a])}),i},e.prototype.onclick=function(t,n,i){var a=this._brushType,o=this._brushMode;i==="clear"?(n.dispatchAction({type:"axisAreaSelect",intervals:[]}),n.dispatchAction({type:"brush",command:"clear",areas:[]})):n.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:i==="keep"?a:a===i?!1:i,brushMode:i==="keep"?o==="multiple"?"single":"multiple":o}})},e.getDefaultOption=function(t){var n={show:!0,type:fse.slice(),icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:t.getLocaleModel().get(["toolbox","brush","title"])};return n},e}(Eo);function gse(r){r.registerComponentView(use),r.registerComponentModel(dse),r.registerPreprocessor(Qoe),r.registerVisual(r.PRIORITY.VISUAL.BRUSH,ise),r.registerAction({type:"brush",event:"brush",update:"updateVisual"},function(e,t){t.eachComponent({mainType:"brush",query:e},function(n){n.setAreas(e.areas)})}),r.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},On),r.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},On),Xd("brush",pse)}var vse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode={type:"box",ignoreSize:!0},t}return e.type="title",e.defaultOption={z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bold",color:"#464646"},subtextStyle:{fontSize:12,color:"#6E7079"}},e}(mr),mse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.render=function(t,n,i){if(this.group.removeAll(),!!t.get("show")){var a=this.group,o=t.getModel("textStyle"),s=t.getModel("subtextStyle"),l=t.get("textAlign"),u=Zt(t.get("textBaseline"),t.get("textVerticalAlign")),d=new Dr({style:an(o,{text:t.get("text"),fill:o.getTextColor()},{disableBox:!0}),z2:10}),f=d.getBoundingRect(),g=t.get("subtext"),m=new Dr({style:an(s,{text:g,fill:s.getTextColor(),y:f.height+t.get("itemGap"),verticalAlign:"top"},{disableBox:!0}),z2:10}),_=t.get("link"),x=t.get("sublink"),w=t.get("triggerEvent",!0);d.silent=!_&&!w,m.silent=!x&&!w,_&&d.on("click",function(){Ky(_,"_"+t.get("target"))}),x&&m.on("click",function(){Ky(x,"_"+t.get("subtarget"))}),jt(d).eventData=jt(m).eventData=w?{componentType:"title",componentIndex:t.componentIndex}:null,a.add(d),g&&a.add(m);var C=a.getBoundingRect(),A=t.getBoxLayoutParams();A.width=C.width,A.height=C.height;var L=Xn(A,{width:i.getWidth(),height:i.getHeight()},t.get("padding"));l||(l=t.get("left")||t.get("right"),l==="middle"&&(l="center"),l==="right"?L.x+=L.width:l==="center"&&(L.x+=L.width/2)),u||(u=t.get("top")||t.get("bottom"),u==="center"&&(u="middle"),u==="bottom"?L.y+=L.height:u==="middle"&&(L.y+=L.height/2),u=u||"top"),a.x=L.x,a.y=L.y,a.markRedraw();var O={align:l,verticalAlign:u};d.setStyle(O),m.setStyle(O),C=a.getBoundingRect();var V=L.margin,F=t.getItemStyle(["color","opacity"]);F.fill=t.get("backgroundColor");var $=new Ar({shape:{x:C.x-V[3],y:C.y-V[0],width:C.width+V[1]+V[3],height:C.height+V[0]+V[2],r:t.get("borderRadius")},style:F,subPixelOptimize:!0,silent:!0});a.add($)}},e.type="title",e}(xn);function yse(r){r.registerComponentModel(vse),r.registerComponentView(mse)}var Y5=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.layoutMode="box",t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i),this._initData()},e.prototype.mergeOption=function(t){r.prototype.mergeOption.apply(this,arguments),this._initData()},e.prototype.setCurrentIndex=function(t){t==null&&(t=this.option.currentIndex);var n=this._data.count();this.option.loop?t=(t%n+n)%n:(t>=n&&(t=n-1),t<0&&(t=0)),this.option.currentIndex=t},e.prototype.getCurrentIndex=function(){return this.option.currentIndex},e.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},e.prototype.setPlayState=function(t){this.option.autoPlay=!!t},e.prototype.getPlayState=function(){return!!this.option.autoPlay},e.prototype._initData=function(){var t=this.option,n=t.data||[],i=t.axisType,a=this._names=[],o;i==="category"?(o=[],Q(n,function(u,d){var f=jn(Qh(u),""),g;Nt(u)?(g=Ut(u),g.value=d):g=d,o.push(g),a.push(f)})):o=n;var s={category:"ordinal",time:"time",value:"number"}[i]||"number",l=this._data=new na([{name:"value",type:s}],this);l.initData(o,a)},e.prototype.getData=function(){return this._data},e.prototype.getCategories=function(){if(this.get("axisType")==="category")return this._names.slice()},e.type="timeline",e.defaultOption={z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},e}(mr),K5=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline.slider",e.defaultOption=Fl(Y5.defaultOption,{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"circle",symbolSize:12,lineStyle:{show:!0,width:2,color:"#DAE1F5"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#A4B1D7"},itemStyle:{color:"#A4B1D7",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:15,color:"#316bf3",borderColor:"#fff",borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:"rgba(0, 0, 0, 0.3)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z",prevIcon:"M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z",prevBtnSize:18,nextBtnSize:18,color:"#A4B1D7",borderColor:"#A4B1D7",borderWidth:1},emphasis:{label:{show:!0,color:"#6f778d"},itemStyle:{color:"#316BF3"},controlStyle:{color:"#316BF3",borderColor:"#316BF3",borderWidth:2}},progress:{lineStyle:{color:"#316BF3"},itemStyle:{color:"#316BF3"},label:{color:"#6f778d"}},data:[]}),e}(Y5);$n(K5,n_.prototype);var _se=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="timeline",e}(xn),bse=function(r){ze(e,r);function e(t,n,i,a){var o=r.call(this,t,n,i)||this;return o.type=a||"value",o}return e.prototype.getLabelModel=function(){return this.model.getModel("label")},e.prototype.isHorizontal=function(){return this.model.get("orient")==="horizontal"},e}(jo),C2=Math.PI,J5=Cr(),xse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(t,n){this.api=n},e.prototype.render=function(t,n,i){if(this.model=t,this.api=i,this.ecModel=n,this.group.removeAll(),t.get("show",!0)){var a=this._layout(t,i),o=this._createGroup("_mainGroup"),s=this._createGroup("_labelGroup"),l=this._axis=this._createAxis(a,t);t.formatTooltip=function(u){var d=l.scale.getLabel({value:u});return ii("nameValue",{noName:!0,value:d})},Q(["AxisLine","AxisTick","Control","CurrentPointer"],function(u){this["_render"+u](a,o,l,t)},this),this._renderAxisLabel(a,s,l,t),this._position(a,t)}this._doPlayStop(),this._updateTicksStatus()},e.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},e.prototype.dispose=function(){this._clearTimer()},e.prototype._layout=function(t,n){var i=t.get(["label","position"]),a=t.get("orient"),o=Sse(t,n),s;i==null||i==="auto"?s=a==="horizontal"?o.y+o.height/2=0||s==="+"?"left":"right"},u={horizontal:s>=0||s==="+"?"top":"bottom",vertical:"middle"},d={horizontal:0,vertical:C2/2},f=a==="vertical"?o.height:o.width,g=t.getModel("controlStyle"),m=g.get("show",!0),_=m?g.get("itemSize"):0,x=m?g.get("itemGap"):0,w=_+x,C=t.get(["label","rotate"])||0;C=C*C2/180;var A,L,O,V=g.get("position",!0),F=m&&g.get("showPlayBtn",!0),$=m&&g.get("showPrevBtn",!0),H=m&&g.get("showNextBtn",!0),Z=0,j=f;V==="left"||V==="bottom"?(F&&(A=[0,0],Z+=w),$&&(L=[Z,0],Z+=w),H&&(O=[j-_,0],j-=w)):(F&&(A=[j-_,0],j-=w),$&&(L=[0,0],Z+=w),H&&(O=[j-_,0],j-=w));var Y=[Z,j];return t.get("inverse")&&Y.reverse(),{viewRect:o,mainLength:f,orient:a,rotation:d[a],labelRotation:C,labelPosOpt:s,labelAlign:t.get(["label","align"])||l[a],labelBaseline:t.get(["label","verticalAlign"])||t.get(["label","baseline"])||u[a],playPosition:A,prevBtnPosition:L,nextBtnPosition:O,axisExtent:Y,controlSize:_,controlGap:x}},e.prototype._position=function(t,n){var i=this._mainGroup,a=this._labelGroup,o=t.viewRect;if(t.orient==="vertical"){var s=za(),l=o.x,u=o.y+o.height;as(s,s,[-l,-u]),Yu(s,s,-C2/2),as(s,s,[l,u]),o=o.clone(),o.applyTransform(s)}var d=A(o),f=A(i.getBoundingRect()),g=A(a.getBoundingRect()),m=[i.x,i.y],_=[a.x,a.y];_[0]=m[0]=d[0][0];var x=t.labelPosOpt;if(x==null||ut(x)){var w=x==="+"?0:1;L(m,f,d,1,w),L(_,g,d,1,1-w)}else{var w=x>=0?0:1;L(m,f,d,1,w),_[1]=m[1]+x}i.setPosition(m),a.setPosition(_),i.rotation=a.rotation=t.rotation,C(i),C(a);function C(O){O.originX=d[0][0]-O.x,O.originY=d[1][0]-O.y}function A(O){return[[O.x,O.x+O.width],[O.y,O.y+O.height]]}function L(O,V,F,$,H){O[$]+=F[$][H]-V[$][H]}},e.prototype._createAxis=function(t,n){var i=n.getData(),a=n.get("axisType"),o=wse(n,a);o.getTicks=function(){return i.mapArray(["value"],function(u){return{value:u}})};var s=i.getDataExtent("value");o.setExtent(s[0],s[1]),o.calcNiceTicks();var l=new bse("value",o,t.axisExtent,a);return l.model=n,l},e.prototype._createGroup=function(t){var n=this[t]=new qt;return this.group.add(n),n},e.prototype._renderAxisLine=function(t,n,i,a){var o=i.getExtent();if(a.get(["lineStyle","show"])){var s=new ri({shape:{x1:o[0],y1:0,x2:o[1],y2:0},style:Ge({lineCap:"round"},a.getModel("lineStyle").getLineStyle()),silent:!0,z2:1});n.add(s);var l=this._progressLine=new ri({shape:{x1:o[0],x2:this._currentPointer?this._currentPointer.x:o[0],y1:0,y2:0},style:Bt({lineCap:"round",lineWidth:s.style.lineWidth},a.getModel(["progress","lineStyle"]).getLineStyle()),silent:!0,z2:1});n.add(l)}},e.prototype._renderAxisTick=function(t,n,i,a){var o=this,s=a.getData(),l=i.scale.getTicks();this._tickSymbols=[],Q(l,function(u){var d=i.dataToCoord(u.value),f=s.getItemModel(u.value),g=f.getModel("itemStyle"),m=f.getModel(["emphasis","itemStyle"]),_=f.getModel(["progress","itemStyle"]),x={x:d,y:0,onclick:pt(o._changeTimeline,o,u.value)},w=Q5(f,g,n,x);w.ensureState("emphasis").style=m.getItemStyle(),w.ensureState("progress").style=_.getItemStyle(),yc(w);var C=jt(w);f.get("tooltip")?(C.dataIndex=u.value,C.dataModel=a):C.dataIndex=C.dataModel=null,o._tickSymbols.push(w)})},e.prototype._renderAxisLabel=function(t,n,i,a){var o=this,s=i.getLabelModel();if(s.get("show")){var l=a.getData(),u=i.getViewLabels();this._tickLabels=[],Q(u,function(d){var f=d.tickValue,g=l.getItemModel(f),m=g.getModel("label"),_=g.getModel(["emphasis","label"]),x=g.getModel(["progress","label"]),w=i.dataToCoord(d.tickValue),C=new Dr({x:w,y:0,rotation:t.labelRotation-t.rotation,onclick:pt(o._changeTimeline,o,f),silent:!1,style:an(m,{text:d.formattedLabel,align:t.labelAlign,verticalAlign:t.labelBaseline})});C.ensureState("emphasis").style=an(_),C.ensureState("progress").style=an(x),n.add(C),yc(C),J5(C).dataIndex=f,o._tickLabels.push(C)})}},e.prototype._renderControl=function(t,n,i,a){var o=t.controlSize,s=t.rotation,l=a.getModel("controlStyle").getItemStyle(),u=a.getModel(["emphasis","controlStyle"]).getItemStyle(),d=a.getPlayState(),f=a.get("inverse",!0);g(t.nextBtnPosition,"next",pt(this._changeTimeline,this,f?"-":"+")),g(t.prevBtnPosition,"prev",pt(this._changeTimeline,this,f?"+":"-")),g(t.playPosition,d?"stop":"play",pt(this._handlePlayClick,this,!d),!0);function g(m,_,x,w){if(m){var C=Vo(Zt(a.get(["controlStyle",_+"BtnSize"]),o),o),A=[0,-C/2,C,C],L=Tse(a,_+"Icon",A,{x:m[0],y:m[1],originX:o/2,originY:0,rotation:w?-s:0,rectHover:!0,style:l,onclick:x});L.ensureState("emphasis").style=u,n.add(L),yc(L)}}},e.prototype._renderCurrentPointer=function(t,n,i,a){var o=a.getData(),s=a.getCurrentIndex(),l=o.getItemModel(s).getModel("checkpointStyle"),u=this,d={onCreate:function(f){f.draggable=!0,f.drift=pt(u._handlePointerDrag,u),f.ondragend=pt(u._handlePointerDragend,u),e3(f,u._progressLine,s,i,a,!0)},onUpdate:function(f){e3(f,u._progressLine,s,i,a)}};this._currentPointer=Q5(l,l,this._mainGroup,{},this._currentPointer,d)},e.prototype._handlePlayClick=function(t){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:t,from:this.uid})},e.prototype._handlePointerDrag=function(t,n,i){this._clearTimer(),this._pointerChangeTimeline([i.offsetX,i.offsetY])},e.prototype._handlePointerDragend=function(t){this._pointerChangeTimeline([t.offsetX,t.offsetY],!0)},e.prototype._pointerChangeTimeline=function(t,n){var i=this._toAxisCoord(t)[0],a=this._axis,o=lo(a.getExtent().slice());i>o[1]&&(i=o[1]),i=0&&(o[a]=+o[a].toFixed(g)),[o,f]}var M2={min:er(R0,"min"),max:er(R0,"max"),average:er(R0,"average"),median:er(R0,"median")};function Yg(r,e){if(e){var t=r.getData(),n=r.coordinateSystem,i=n&&n.dimensions;if(!kse(e)&&!Ze(e.coord)&&Ze(i)){var a=r3(e,t,n,r);if(e=Ut(e),e.type&&M2[e.type]&&a.baseAxis&&a.valueAxis){var o=hr(i,a.baseAxis.dim),s=hr(i,a.valueAxis.dim),l=M2[e.type](t,a.baseDataDim,a.valueDataDim,o,s);e.coord=l[0],e.value=l[1]}else e.coord=[e.xAxis!=null?e.xAxis:e.radiusAxis,e.yAxis!=null?e.yAxis:e.angleAxis]}if(e.coord==null||!Ze(i))e.coord=[];else for(var u=e.coord,d=0;d<2;d++)M2[u[d]]&&(u[d]=I2(t,t.mapDimension(i[d]),u[d]));return e}}function r3(r,e,t,n){var i={};return r.valueIndex!=null||r.valueDim!=null?(i.valueDataDim=r.valueIndex!=null?e.getDimension(r.valueIndex):r.valueDim,i.valueAxis=t.getAxis(Lse(n,i.valueDataDim)),i.baseAxis=t.getOtherAxis(i.valueAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim)):(i.baseAxis=n.getBaseAxis(),i.valueAxis=t.getOtherAxis(i.baseAxis),i.baseDataDim=e.mapDimension(i.baseAxis.dim),i.valueDataDim=e.mapDimension(i.valueAxis.dim)),i}function Lse(r,e){var t=r.getData().getDimensionInfo(e);return t&&t.coordDim}function Kg(r,e){return r&&r.containData&&e.coord&&!D2(e)?r.containData(e.coord):!0}function Pse(r,e,t){return r&&r.containZone&&e.coord&&t.coord&&!D2(e)&&!D2(t)?r.containZone(e.coord,t.coord):!0}function n3(r,e){return r?function(t,n,i,a){var o=a<2?t.coord&&t.coord[a]:t.value;return Wl(o,e[a])}:function(t,n,i,a){return Wl(t.value,e[a])}}function I2(r,e,t){if(t==="average"){var n=0,i=0;return r.each(e,function(a,o){isNaN(a)||(n+=a,i++)}),n/i}else return t==="median"?r.getMedian(e):r.getDataExtent(e)[t==="max"?1:0]}var k2=Cr(),L2=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.init=function(){this.markerGroupMap=Tt()},e.prototype.render=function(t,n,i){var a=this,o=this.markerGroupMap;o.each(function(s){k2(s).keep=!1}),n.eachSeries(function(s){var l=il.getMarkerModelFromSeries(s,a.type);l&&a.renderSeries(s,l,n,i)}),o.each(function(s){!k2(s).keep&&a.group.remove(s.group)})},e.prototype.markKeep=function(t){k2(t).keep=!0},e.prototype.toggleBlurSeries=function(t,n){var i=this;Q(t,function(a){var o=il.getMarkerModelFromSeries(a,i.type);if(o){var s=o.getData();s.eachItemGraphicEl(function(l){l&&(n?_k(l):e1(l))})}})},e.type="marker",e}(xn);function i3(r,e,t){var n=e.coordinateSystem;r.each(function(i){var a=r.getItemModel(i),o,s=nt(a.get("x"),t.getWidth()),l=nt(a.get("y"),t.getHeight());if(!isNaN(s)&&!isNaN(l))o=[s,l];else if(e.getMarkerPosition)o=e.getMarkerPosition(r.getValues(r.dimensions,i));else if(n){var u=r.get(n.dimensions[0],i),d=r.get(n.dimensions[1],i);o=n.dataToPoint([u,d])}isNaN(s)||(o[0]=s),isNaN(l)||(o[1]=l),r.setItemLayout(i,o)})}var Rse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=il.getMarkerModelFromSeries(a,"markPoint");o&&(i3(o.getData(),a,i),this.markerGroupMap.get(a.id).updateLayout())},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,d=u.get(s)||u.set(s,new wg),f=Nse(o,t,n);n.setData(f),i3(n.getData(),t,a),f.each(function(g){var m=f.getItemModel(g),_=m.getShallow("symbol"),x=m.getShallow("symbolSize"),w=m.getShallow("symbolRotate"),C=m.getShallow("symbolOffset"),A=m.getShallow("symbolKeepAspect");if(It(_)||It(x)||It(w)||It(C)){var L=n.getRawValue(g),O=n.getDataParams(g);It(_)&&(_=_(L,O)),It(x)&&(x=x(L,O)),It(w)&&(w=w(L,O)),It(C)&&(C=C(L,O))}var V=m.getModel("itemStyle").getItemStyle(),F=ng(l,"color");V.fill||(V.fill=F),f.setItemVisual(g,{symbol:_,symbolSize:x,symbolRotate:w,symbolOffset:C,symbolKeepAspect:A,style:V})}),d.updateData(f),this.group.add(d.group),f.eachItemGraphicEl(function(g){g.traverse(function(m){jt(m).dataModel=n})}),this.markKeep(d),d.group.silent=n.get("silent")||t.get("silent")},e.type="markPoint",e}(L2);function Nse(r,e,t){var n;r?n=je(r&&r.dimensions,function(s){var l=e.getData().getDimensionInfo(e.getData().mapDimension(s))||{};return Ge(Ge({},l),{name:s,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new na(n,t),a=je(t.get("data"),er(Yg,e));r&&(a=$r(a,er(Kg,r)));var o=n3(!!r,n);return i.initData(a,null,o),i}function Ose(r){r.registerComponentModel(Ise),r.registerComponentView(Rse),r.registerPreprocessor(function(e){A2(e.series,"markPoint")&&(e.markPoint=e.markPoint||{})})}var zse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markLine",e.defaultOption={z:5,symbol:["circle","arrow"],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"},e}(il),Bse={},N0=Cr(),Vse=function(r,e,t,n){var i=r.getData(),a;if(Ze(n))a=n;else{var o=n.type;if(o==="min"||o==="max"||o==="average"||o==="median"||n.xAxis!=null||n.yAxis!=null){var s=void 0,l=void 0;if(n.yAxis!=null||n.xAxis!=null)s=e.getAxis(n.yAxis!=null?"y":"x"),l=Gn(n.yAxis,n.xAxis);else{var u=r3(n,i,e,r);s=u.valueAxis;var d=YR(i,u.valueDataDim);l=I2(i,d,o)}var f=s.dim==="x"?0:1,g=1-f,m=Ut(n),_={coord:[]};m.type=null,m.coord=[],m.coord[g]=-1/0,_.coord[g]=1/0;var x=t.get("precision");x>=0&&Lr(l)&&(l=+l.toFixed(Math.min(x,20))),m.coord[f]=_.coord[f]=l,a=[m,_,{type:o,valueIndex:n.valueIndex,value:l}]}else Bse.NODE_ENV!=="production"&&No("Invalid markLine data."),a=[]}var w=[Yg(r,a[0]),Yg(r,a[1]),Ge({},a[2])];return w[2].type=w[2].type||null,rr(w[2],w[0]),rr(w[2],w[1]),w};function O0(r){return!isNaN(r)&&!isFinite(r)}function a3(r,e,t,n){var i=1-r,a=n.dimensions[r];return O0(e[i])&&O0(t[i])&&e[r]===t[r]&&n.getAxis(a).containData(e[r])}function Fse(r,e){if(r.type==="cartesian2d"){var t=e[0].coord,n=e[1].coord;if(t&&n&&(a3(1,t,n,r)||a3(0,t,n,r)))return!0}return Kg(r,e[0])&&Kg(r,e[1])}function P2(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=nt(o.get("x"),i.getWidth()),u=nt(o.get("y"),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition)s=n.getMarkerPosition(r.getValues(r.dimensions,e));else{var d=a.dimensions,f=r.get(d[0],e),g=r.get(d[1],e);s=a.dataToPoint([f,g])}if(Wc(a,"cartesian2d")){var m=a.getAxis("x"),_=a.getAxis("y"),d=a.dimensions;O0(r.get(d[0],e))?s[0]=m.toGlobalCoord(m.getExtent()[t?0:1]):O0(r.get(d[1],e))&&(s[1]=_.toGlobalCoord(_.getExtent()[t?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}r.setItemLayout(e,s)}var $se=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=il.getMarkerModelFromSeries(a,"markLine");if(o){var s=o.getData(),l=N0(o).from,u=N0(o).to;l.each(function(d){P2(l,d,!0,a,i),P2(u,d,!1,a,i)}),s.each(function(d){s.setItemLayout(d,[l.getItemLayout(d),u.getItemLayout(d)])}),this.markerGroupMap.get(a.id).updateLayout()}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,d=u.get(s)||u.set(s,new iE);this.group.add(d.group);var f=Gse(o,t,n),g=f.from,m=f.to,_=f.line;N0(n).from=g,N0(n).to=m,n.setData(_);var x=n.get("symbol"),w=n.get("symbolSize"),C=n.get("symbolRotate"),A=n.get("symbolOffset");Ze(x)||(x=[x,x]),Ze(w)||(w=[w,w]),Ze(C)||(C=[C,C]),Ze(A)||(A=[A,A]),f.from.each(function(O){L(g,O,!0),L(m,O,!1)}),_.each(function(O){var V=_.getItemModel(O).getModel("lineStyle").getLineStyle();_.setItemLayout(O,[g.getItemLayout(O),m.getItemLayout(O)]),V.stroke==null&&(V.stroke=g.getItemVisual(O,"style").fill),_.setItemVisual(O,{fromSymbolKeepAspect:g.getItemVisual(O,"symbolKeepAspect"),fromSymbolOffset:g.getItemVisual(O,"symbolOffset"),fromSymbolRotate:g.getItemVisual(O,"symbolRotate"),fromSymbolSize:g.getItemVisual(O,"symbolSize"),fromSymbol:g.getItemVisual(O,"symbol"),toSymbolKeepAspect:m.getItemVisual(O,"symbolKeepAspect"),toSymbolOffset:m.getItemVisual(O,"symbolOffset"),toSymbolRotate:m.getItemVisual(O,"symbolRotate"),toSymbolSize:m.getItemVisual(O,"symbolSize"),toSymbol:m.getItemVisual(O,"symbol"),style:V})}),d.updateData(_),f.line.eachItemGraphicEl(function(O){jt(O).dataModel=n,O.traverse(function(V){jt(V).dataModel=n})});function L(O,V,F){var $=O.getItemModel(V);P2(O,V,F,t,a);var H=$.getModel("itemStyle").getItemStyle();H.fill==null&&(H.fill=ng(l,"color")),O.setItemVisual(V,{symbolKeepAspect:$.get("symbolKeepAspect"),symbolOffset:Zt($.get("symbolOffset",!0),A[F?0:1]),symbolRotate:Zt($.get("symbolRotate",!0),C[F?0:1]),symbolSize:Zt($.get("symbolSize"),w[F?0:1]),symbol:Zt($.get("symbol",!0),x[F?0:1]),style:H})}this.markKeep(d),d.group.silent=n.get("silent")||t.get("silent")},e.type="markLine",e}(L2);function Gse(r,e,t){var n;r?n=je(r&&r.dimensions,function(u){var d=e.getData().getDimensionInfo(e.getData().mapDimension(u))||{};return Ge(Ge({},d),{name:u,ordinalMeta:null})}):n=[{name:"value",type:"float"}];var i=new na(n,t),a=new na(n,t),o=new na([],t),s=je(t.get("data"),er(Vse,e,r,t));r&&(s=$r(s,er(Fse,r)));var l=n3(!!r,n);return i.initData(je(s,function(u){return u[0]}),null,l),a.initData(je(s,function(u){return u[1]}),null,l),o.initData(je(s,function(u){return u[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function Use(r){r.registerComponentModel(zse),r.registerComponentView($se),r.registerPreprocessor(function(e){A2(e.series,"markLine")&&(e.markLine=e.markLine||{})})}var Hse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.createMarkerModelFromSeries=function(t,n,i){return new e(t,n,i)},e.type="markArea",e.defaultOption={z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}},e}(il),z0=Cr(),Wse=function(r,e,t,n){var i=n[0],a=n[1];if(!(!i||!a)){var o=Yg(r,i),s=Yg(r,a),l=o.coord,u=s.coord;l[0]=Gn(l[0],-1/0),l[1]=Gn(l[1],-1/0),u[0]=Gn(u[0],1/0),u[1]=Gn(u[1],1/0);var d=Sx([{},o,s]);return d.coord=[o.coord,s.coord],d.x0=o.x,d.y0=o.y,d.x1=s.x,d.y1=s.y,d}};function B0(r){return!isNaN(r)&&!isFinite(r)}function o3(r,e,t,n){var i=1-r;return B0(e[i])&&B0(t[i])}function qse(r,e){var t=e.coord[0],n=e.coord[1],i={coord:t,x:e.x0,y:e.y0},a={coord:n,x:e.x1,y:e.y1};return Wc(r,"cartesian2d")?t&&n&&(o3(1,t,n)||o3(0,t,n))?!0:Pse(r,i,a):Kg(r,i)||Kg(r,a)}function s3(r,e,t,n,i){var a=n.coordinateSystem,o=r.getItemModel(e),s,l=nt(o.get(t[0]),i.getWidth()),u=nt(o.get(t[1]),i.getHeight());if(!isNaN(l)&&!isNaN(u))s=[l,u];else{if(n.getMarkerPosition){var d=r.getValues(["x0","y0"],e),f=r.getValues(["x1","y1"],e),g=a.clampData(d),m=a.clampData(f),_=[];t[0]==="x0"?_[0]=g[0]>m[0]?f[0]:d[0]:_[0]=g[0]>m[0]?d[0]:f[0],t[1]==="y0"?_[1]=g[1]>m[1]?f[1]:d[1]:_[1]=g[1]>m[1]?d[1]:f[1],s=n.getMarkerPosition(_,t,!0)}else{var x=r.get(t[0],e),w=r.get(t[1],e),C=[x,w];a.clampData&&a.clampData(C,C),s=a.dataToPoint(C,!0)}if(Wc(a,"cartesian2d")){var A=a.getAxis("x"),L=a.getAxis("y"),x=r.get(t[0],e),w=r.get(t[1],e);B0(x)?s[0]=A.toGlobalCoord(A.getExtent()[t[0]==="x0"?0:1]):B0(w)&&(s[1]=L.toGlobalCoord(L.getExtent()[t[1]==="y0"?0:1]))}isNaN(l)||(s[0]=l),isNaN(u)||(s[1]=u)}return s}var l3=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]],Zse=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.updateTransform=function(t,n,i){n.eachSeries(function(a){var o=il.getMarkerModelFromSeries(a,"markArea");if(o){var s=o.getData();s.each(function(l){var u=je(l3,function(f){return s3(s,l,f,a,i)});s.setItemLayout(l,u);var d=s.getItemGraphicEl(l);d.setShape("points",u)})}},this)},e.prototype.renderSeries=function(t,n,i,a){var o=t.coordinateSystem,s=t.id,l=t.getData(),u=this.markerGroupMap,d=u.get(s)||u.set(s,{group:new qt});this.group.add(d.group),this.markKeep(d);var f=jse(o,t,n);n.setData(f),f.each(function(g){var m=je(l3,function(H){return s3(f,g,H,t,a)}),_=o.getAxis("x").scale,x=o.getAxis("y").scale,w=_.getExtent(),C=x.getExtent(),A=[_.parse(f.get("x0",g)),_.parse(f.get("x1",g))],L=[x.parse(f.get("y0",g)),x.parse(f.get("y1",g))];lo(A),lo(L);var O=!(w[0]>A[1]||w[1]L[1]||C[1]=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e}(mr),Kse={},Kd=er,N2=Q,V0=qt,u3=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.newlineDisabled=!1,t}return e.prototype.init=function(){this.group.add(this._contentGroup=new V0),this.group.add(this._selectorGroup=new V0),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(t,n,i){var a=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!t.get("show",!0)){var o=t.get("align"),s=t.get("orient");(!o||o==="auto")&&(o=t.get("left")==="right"&&s==="vertical"?"right":"left");var l=t.get("selector",!0),u=t.get("selectorPosition",!0);l&&(!u||u==="auto")&&(u=s==="horizontal"?"end":"start"),this.renderInner(o,t,n,i,l,s,u);var d=t.getBoxLayoutParams(),f={width:i.getWidth(),height:i.getHeight()},g=t.get("padding"),m=Xn(d,f,g),_=this.layoutInner(t,o,m,a,l,u),x=Xn(Bt({width:_.width,height:_.height},d),f,g);this.group.x=x.x-_.x,this.group.y=x.y-_.y,this.group.markRedraw(),this.group.add(this._backgroundEl=m5(_,t))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(t,n,i,a,o,s,l){var u=this.getContentGroup(),d=Tt(),f=n.get("selectedMode"),g=[];i.eachRawSeries(function(m){!m.get("legendHoverLink")&&g.push(m.id)}),N2(n.getData(),function(m,_){var x=m.get("name");if(!this.newlineDisabled&&(x===""||x===` `)){var w=new V0;w.newline=!0,u.add(w);return}var C=i.getSeriesByName(x)[0];if(!d.get(x)){if(C){var A=C.getData(),L=A.getVisual("legendLineStyle")||{},O=A.getVisual("legendIcon"),V=A.getVisual("style"),F=this._createItem(C,x,_,m,n,t,L,V,O,f,a);F.on("click",Kd(c3,x,null,a,g)).on("mouseover",Kd(O2,C.name,null,a,g)).on("mouseout",Kd(z2,C.name,null,a,g)),i.ssr&&F.eachChild(function($){var H=jt($);H.seriesIndex=C.seriesIndex,H.dataIndex=_,H.ssrType="legend"}),d.set(x,!0)}else i.eachRawSeries(function($){if(!d.get(x)&&$.legendVisualProvider){var H=$.legendVisualProvider;if(!H.containName(x))return;var Z=H.indexOfName(x),j=H.getItemVisual(Z,"style"),Y=H.getItemVisual(Z,"legendIcon"),se=Va(j.fill);se&&se[3]===0&&(se[3]=.2,j=Ge(Ge({},j),{fill:Bs(se,"rgba")}));var ae=this._createItem($,x,_,m,n,t,{},j,Y,f,a);ae.on("click",Kd(c3,null,x,a,g)).on("mouseover",Kd(O2,null,x,a,g)).on("mouseout",Kd(z2,null,x,a,g)),i.ssr&&ae.eachChild(function(ue){var fe=jt(ue);fe.seriesIndex=$.seriesIndex,fe.dataIndex=_,fe.ssrType="legend"}),d.set(x,!0)}},this);Kse.NODE_ENV!=="production"&&(d.get(x)||console.warn(x+" series not exists. Legend data should be same with series name or data name."))}},this),o&&this._createSelector(o,n,a,s,l)},e.prototype._createSelector=function(t,n,i,a,o){var s=this.getSelectorGroup();N2(t,function(u){var d=u.type,f=new Dr({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){i.dispatchAction({type:d==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var g=n.getModel("selectorLabel"),m=n.getModel(["emphasis","selectorLabel"]);Ci(f,{normal:g,emphasis:m},{defaultText:u.title}),yc(f)})},e.prototype._createItem=function(t,n,i,a,o,s,l,u,d,f,g){var m=t.visualDrawType,_=o.get("itemWidth"),x=o.get("itemHeight"),w=o.isSelected(n),C=a.get("symbolRotate"),A=a.get("symbolKeepAspect"),L=a.get("icon");d=L||d||"roundRect";var O=Jse(d,a,l,u,m,w,g),V=new V0,F=a.getModel("textStyle");if(It(t.getLegendIcon)&&(!L||L==="inherit"))V.add(t.getLegendIcon({itemWidth:_,itemHeight:x,icon:d,iconRotate:C,itemStyle:O.itemStyle,lineStyle:O.lineStyle,symbolKeepAspect:A}));else{var $=L==="inherit"&&t.getData().getVisual("symbol")?C==="inherit"?t.getData().getVisual("symbolRotate"):C:0;V.add(Qse({itemWidth:_,itemHeight:x,icon:d,iconRotate:$,itemStyle:O.itemStyle,symbolKeepAspect:A}))}var H=s==="left"?_+5:-5,Z=s,j=o.get("formatter"),Y=n;ut(j)&&j?Y=j.replace("{name}",n??""):It(j)&&(Y=j(n));var se=w?F.getTextColor():a.get("inactiveColor");V.add(new Dr({style:an(F,{text:Y,x:H,y:x/2,fill:se,align:Z,verticalAlign:"middle"},{inheritColor:se})}));var ae=new Ar({shape:V.getBoundingRect(),style:{fill:"transparent"}}),ue=a.getModel("tooltip");return ue.get("show")&&Tc({el:ae,componentModel:o,itemName:n,itemTooltipOption:ue.option}),V.add(ae),V.eachChild(function(fe){fe.silent=!0}),ae.silent=!f,this.getContentGroup().add(V),yc(V),V.__legendDataIndex=i,V},e.prototype.layoutInner=function(t,n,i,a,o,s){var l=this.getContentGroup(),u=this.getSelectorGroup();Dc(t.get("orient"),l,t.get("itemGap"),i.width,i.height);var d=l.getBoundingRect(),f=[-d.x,-d.y];if(u.markRedraw(),l.markRedraw(),o){Dc("horizontal",u,t.get("selectorItemGap",!0));var g=u.getBoundingRect(),m=[-g.x,-g.y],_=t.get("selectorButtonGap",!0),x=t.getOrient().index,w=x===0?"width":"height",C=x===0?"height":"width",A=x===0?"y":"x";s==="end"?m[x]+=d[w]+_:f[x]+=g[w]+_,m[1-x]+=d[C]/2-g[C]/2,u.x=m[0],u.y=m[1],l.x=f[0],l.y=f[1];var L={x:0,y:0};return L[w]=d[w]+_+g[w],L[C]=Math.max(d[C],g[C]),L[A]=Math.min(0,g[A]+m[1-x]),L}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e}(xn);function Jse(r,e,t,n,i,a,o){function s(w,C){w.lineWidth==="auto"&&(w.lineWidth=C.lineWidth>0?2:0),N2(w,function(A,L){w[L]==="inherit"&&(w[L]=C[L])})}var l=e.getModel("itemStyle"),u=l.getItemStyle(),d=r.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");u.decal=!f||f==="inherit"?n.decal:Md(f,o),u.fill==="inherit"&&(u.fill=n[i]),u.stroke==="inherit"&&(u.stroke=n[d]),u.opacity==="inherit"&&(u.opacity=(i==="fill"?n:t).opacity),s(u,n);var g=e.getModel("lineStyle"),m=g.getLineStyle();if(s(m,t),u.fill==="auto"&&(u.fill=n.fill),u.stroke==="auto"&&(u.stroke=n.fill),m.stroke==="auto"&&(m.stroke=n.fill),!a){var _=e.get("inactiveBorderWidth"),x=u[d];u.lineWidth=_==="auto"?n.lineWidth>0&&x?2:0:u.lineWidth,u.fill=e.get("inactiveColor"),u.stroke=e.get("inactiveBorderColor"),m.stroke=g.get("inactiveColor"),m.lineWidth=g.get("inactiveWidth")}return{itemStyle:u,lineStyle:m}}function Qse(r){var e=r.icon||"roundRect",t=qn(e,0,0,r.itemWidth,r.itemHeight,r.itemStyle.fill,r.symbolKeepAspect);return t.setStyle(r.itemStyle),t.rotation=(r.iconRotate||0)*Math.PI/180,t.setOrigin([r.itemWidth/2,r.itemHeight/2]),e.indexOf("empty")>-1&&(t.style.stroke=t.style.fill,t.style.fill="#fff",t.style.lineWidth=2),t}function c3(r,e,t,n){z2(r,e,t,n),t.dispatchAction({type:"legendToggleSelect",name:r??e}),O2(r,e,t,n)}function h3(r){for(var e=r.getZr().storage.getDisplayList(),t,n=0,i=e.length;ni[o],w=[-m.x,-m.y];n||(w[a]=d[u]);var C=[0,0],A=[-_.x,-_.y],L=Zt(t.get("pageButtonGap",!0),t.get("itemGap",!0));if(x){var O=t.get("pageButtonPosition",!0);O==="end"?A[a]+=i[o]-_[o]:C[a]+=_[o]+L}A[1-a]+=m[s]/2-_[s]/2,d.setPosition(w),f.setPosition(C),g.setPosition(A);var V={x:0,y:0};if(V[o]=x?i[o]:m[o],V[s]=Math.max(m[s],_[s]),V[l]=Math.min(0,_[l]+A[1-a]),f.__rectSize=i[o],x){var F={x:0,y:0};F[o]=Math.max(i[o]-_[o]-L,0),F[s]=V[s],f.setClipPath(new Ar({shape:F})),f.__rectSize=F[o]}else g.eachChild(function(H){H.attr({invisible:!0,silent:!0})});var $=this._getPageInfo(t);return $.pageIndex!=null&&Or(d,{x:$.contentPosition[0],y:$.contentPosition[1]},x?t:null),this._updatePageInfoView(t,$),V},e.prototype._pageGo=function(t,n,i){var a=this._getPageInfo(n)[t];a!=null&&i.dispatchAction({type:"legendScroll",scrollDataIndex:a,legendId:n.id})},e.prototype._updatePageInfoView=function(t,n){var i=this._controllerGroup;Q(["pagePrev","pageNext"],function(d){var f=d+"DataIndex",g=n[f]!=null,m=i.childOfName(d);m&&(m.setStyle("fill",g?t.get("pageIconColor",!0):t.get("pageIconInactiveColor",!0)),m.cursor=g?"pointer":"default")});var a=i.childOfName("pageText"),o=t.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,u=n.pageCount;a&&o&&a.setStyle("text",ut(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",u==null?"":u+""):o({current:l,total:u}))},e.prototype._getPageInfo=function(t){var n=t.get("scrollDataIndex",!0),i=this.getContentGroup(),a=this._containerGroup.__rectSize,o=t.getOrient().index,s=B2[o],l=V2[o],u=this._findTargetItemIndex(n),d=i.children(),f=d[u],g=d.length,m=g?1:0,_={contentPosition:[i.x,i.y],pageCount:m,pageIndex:m-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return _;var x=O(f);_.contentPosition[o]=-x.s;for(var w=u+1,C=x,A=x,L=null;w<=g;++w)L=O(d[w]),(!L&&A.e>C.s+a||L&&!V(L,C.s))&&(A.i>C.i?C=A:C=L,C&&(_.pageNextDataIndex==null&&(_.pageNextDataIndex=C.i),++_.pageCount)),A=L;for(var w=u-1,C=x,A=x,L=null;w>=-1;--w)L=O(d[w]),(!L||!V(A,L.s))&&C.i=$&&F.s<=$+a}},e.prototype._findTargetItemIndex=function(t){if(!this._showController)return 0;var n,i=this.getContentGroup(),a;return i.eachChild(function(o,s){var l=o.__legendDataIndex;a==null&&l!=null&&(a=s),l===t&&(n=s)}),n??a},e.type="legend.scroll",e}(u3);function ile(r){r.registerAction("legendScroll","legendscroll",function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:"legend",subType:"scroll",query:e},function(i){i.setScrollDataIndex(n)})})}function ale(r){dr(f3),r.registerComponentModel(rle),r.registerComponentView(nle),ile(r)}function ole(r){dr(f3),dr(ale)}var sle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.inside",e.defaultOption=Fl(Zg.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e}(Zg),F2=Cr();function lle(r,e,t){F2(r).coordSysRecordMap.each(function(n){var i=n.dataZoomInfoMap.get(e.uid);i&&(i.getRange=t)})}function ule(r,e){for(var t=F2(r).coordSysRecordMap,n=t.keys(),i=0;in[t+e]&&(e=s),i=i&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function ple(r){r.registerProcessor(r.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=F2(t),i=n.coordSysRecordMap||(n.coordSysRecordMap=Tt());i.each(function(a){a.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(a){var o=c5(a);Q(o.infoList,function(s){var l=s.model.uid,u=i.get(l)||i.set(l,cle(t,s.model)),d=u.dataZoomInfoMap||(u.dataZoomInfoMap=Tt());d.set(a.uid,{dzReferCoordSysInfo:s,model:a,getRange:null})})}),i.each(function(a){var o=a.controller,s,l=a.dataZoomInfoMap;if(l){var u=l.keys()[0];u!=null&&(s=l.get(u))}if(!s){v3(i,a);return}var d=fle(l);o.enable(d.controlType,d.opt),o.setPointerChecker(a.containsPoint),Ed(a,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var gle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type="dataZoom.inside",t}return e.prototype.render=function(t,n,i){if(r.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),lle(i,t,{pan:pt($2.pan,this),zoom:pt($2.zoom,this),scrollMove:pt($2.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){ule(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e}(f2),$2={zoom:function(r,e,t,n){var i=this.range,a=i.slice(),o=r.axisModels[0];if(o){var s=G2[e](null,[n.originX,n.originY],o,t,r),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],u=Math.max(1/n.scale,0);a[0]=(a[0]-l)*u+l,a[1]=(a[1]-l)*u+l;var d=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Qc(0,a,[0,100],0,d.minSpan,d.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:m3(function(r,e,t,n,i,a){var o=G2[n]([a.oldX,a.oldY],[a.newX,a.newY],e,i,t);return o.signal*(r[1]-r[0])*o.pixel/o.pixelLength}),scrollMove:m3(function(r,e,t,n,i,a){var o=G2[n]([0,0],[a.scrollDelta,a.scrollDelta],e,i,t);return o.signal*(r[1]-r[0])*a.scrollDelta})};function m3(r){return function(e,t,n,i){var a=this.range,o=a.slice(),s=e.axisModels[0];if(s){var l=r(o,s,e,t,n,i);if(Qc(l,o,[0,100],"all"),this.range=o,a[0]!==o[0]||a[1]!==o[1])return o}}}var G2={grid:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem.getRect();return r=r||[0,0],a.dim==="x"?(o.pixel=e[0]-r[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(r,e,t,n,i){var a=t.axis,o={},s=i.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),u=s.getAngleAxis().getExtent();return r=r?s.pointToCoord(r):[0,0],e=s.pointToCoord(e),t.mainType==="radiusAxis"?(o.pixel=e[0]-r[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?1:-1):(o.pixel=e[1]-r[1],o.pixelLength=u[1]-u[0],o.pixelStart=u[0],o.signal=a.inverse?-1:1),o},singleAxis:function(r,e,t,n,i){var a=t.axis,o=i.model.coordinateSystem.getRect(),s={};return r=r||[0,0],a.orient==="horizontal"?(s.pixel=e[0]-r[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=e[1]-r[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function y3(r){p2(r),r.registerComponentModel(sle),r.registerComponentView(gle),ple(r)}var vle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.type="dataZoom.slider",e.layoutMode="box",e.defaultOption=Fl(Zg.defaultOption,{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,borderColor:"#d2dbee",borderRadius:3,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#d2dbee",width:.5},areaStyle:{color:"#d2dbee",opacity:.2}},selectedDataBackground:{lineStyle:{color:"#8fb0f7",width:.5},areaStyle:{color:"#8fb0f7",opacity:.2}},fillerColor:"rgba(135,175,274,0.2)",handleIcon:"path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z",handleSize:"100%",handleStyle:{color:"#fff",borderColor:"#ACB8D1"},moveHandleSize:7,moveHandleIcon:"path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z",moveHandleStyle:{color:"#D2DBEE",opacity:.7},showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#6E7079"},brushSelect:!0,brushStyle:{color:"rgba(135,175,274,0.15)"},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:"#8FB0F7"},moveHandleStyle:{color:"#8FB0F7"}}}),e}(Zg),mle={},Qg=Ar,_3=7,yle=1,U2=30,_le=7,ev="horizontal",b3="vertical",ble=5,xle=["line","bar","candlestick","scatter"],wle={easing:"cubicOut",duration:100,delay:0},Sle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._displayables={},t}return e.prototype.init=function(t,n){this.api=n,this._onBrush=pt(this._onBrush,this),this._onBrushEnd=pt(this._onBrushEnd,this)},e.prototype.render=function(t,n,i,a){if(r.prototype.render.apply(this,arguments),Ed(this,"_dispatchZoomAction",t.get("throttle"),"fixRate"),this._orient=t.getOrient(),t.get("show")===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!a||a.type!=="dataZoom"||a.from!==this.uid)&&this._buildView(),this._updateView()},e.prototype.dispose=function(){this._clear(),r.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){eg(this,"_dispatchZoomAction");var t=this.api.getZr();t.off("mousemove",this._onBrush),t.off("mouseup",this._onBrushEnd)},e.prototype._buildView=function(){var t=this.group;t.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var n=this._displayables.sliderGroup=new qt;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),t.add(n),this._positionGroup()},e.prototype._resetLocation=function(){var t=this.dataZoomModel,n=this.api,i=t.get("brushSelect"),a=i?_le:0,o=this._findCoordRect(),s={width:n.getWidth(),height:n.getHeight()},l=this._orient===ev?{right:s.width-o.x-o.width,top:s.height-U2-_3-a,width:o.width,height:U2}:{right:_3,top:o.y,width:U2,height:o.height},u=vd(t.option);Q(["right","top","width","height"],function(f){u[f]==="ph"&&(u[f]=l[f])});var d=Xn(u,s);this._location={x:d.x,y:d.y},this._size=[d.width,d.height],this._orient===b3&&this._size.reverse()},e.prototype._positionGroup=function(){var t=this.group,n=this._location,i=this._orient,a=this.dataZoomModel.getFirstTargetAxisModel(),o=a&&a.get("inverse"),s=this._displayables.sliderGroup,l=(this._dataShadowInfo||{}).otherAxisInverse;s.attr(i===ev&&!o?{scaleY:l?1:-1,scaleX:1}:i===ev&&o?{scaleY:l?1:-1,scaleX:-1}:i===b3&&!o?{scaleY:l?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:l?-1:1,scaleX:-1,rotation:Math.PI/2});var u=t.getBoundingRect([s]);t.x=n.x-u.x,t.y=n.y-u.y,t.markRedraw()},e.prototype._getViewExtent=function(){return[0,this._size[0]]},e.prototype._renderBackground=function(){var t=this.dataZoomModel,n=this._size,i=this._displayables.sliderGroup,a=t.get("brushSelect");i.add(new Qg({silent:!0,shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:t.get("backgroundColor")},z2:-40}));var o=new Qg({shape:{x:0,y:0,width:n[0],height:n[1]},style:{fill:"transparent"},z2:0,onclick:pt(this._onClickPanel,this)}),s=this.api.getZr();a?(o.on("mousedown",this._onBrushStart,this),o.cursor="crosshair",s.on("mousemove",this._onBrush),s.on("mouseup",this._onBrushEnd)):(s.off("mousemove",this._onBrush),s.off("mouseup",this._onBrushEnd)),i.add(o)},e.prototype._renderDataShadow=function(){var t=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!t)return;var n=this._size,i=this._shadowSize||[],a=t.series,o=a.getRawData(),s=a.getShadowDim&&a.getShadowDim(),l=s&&o.getDimensionInfo(s)?a.getShadowDim():t.otherDim;if(l==null)return;var u=this._shadowPolygonPts,d=this._shadowPolylinePts;if(o!==this._shadowData||l!==this._shadowDim||n[0]!==i[0]||n[1]!==i[1]){var f=o.getDataExtent(l),g=(f[1]-f[0])*.3;f=[f[0]-g,f[1]+g];var m=[0,n[1]],_=[0,n[0]],x=[[n[0],0],[0,0]],w=[],C=_[1]/(o.count()-1),A=0,L=Math.round(o.count()/n[0]),O;o.each([l],function(Z,j){if(L>0&&j%L){A+=C;return}var Y=Z==null||isNaN(Z)||Z==="",se=Y?0:Wr(Z,f,m,!0);Y&&!O&&j?(x.push([x[x.length-1][0],0]),w.push([w[w.length-1][0],0])):!Y&&O&&(x.push([A,0]),w.push([A,0])),x.push([A,se]),w.push([A,se]),A+=C,O=Y}),u=this._shadowPolygonPts=x,d=this._shadowPolylinePts=w}this._shadowData=o,this._shadowDim=l,this._shadowSize=[n[0],n[1]];var V=this.dataZoomModel;function F(Z){var j=V.getModel(Z?"selectedDataBackground":"dataBackground"),Y=new qt,se=new ta({shape:{points:u},segmentIgnoreThreshold:1,style:j.getModel("areaStyle").getAreaStyle(),silent:!0,z2:-20}),ae=new ra({shape:{points:d},segmentIgnoreThreshold:1,style:j.getModel("lineStyle").getLineStyle(),silent:!0,z2:-19});return Y.add(se),Y.add(ae),Y}for(var $=0;$<3;$++){var H=F($===1);this._displayables.sliderGroup.add(H),this._displayables.dataShadowSegs.push(H)}},e.prototype._prepareDataShadowInfo=function(){var t=this.dataZoomModel,n=t.get("showDataShadow");if(n!==!1){var i,a=this.ecModel;return t.eachTargetAxis(function(o,s){var l=t.getAxisProxy(o,s).getTargetSeriesModels();Q(l,function(u){if(!i&&!(n!==!0&&hr(xle,u.get("type"))<0)){var d=a.getComponent(au(o),s).axis,f=Tle(o),g,m=u.coordinateSystem;f!=null&&m.getOtherAxis&&(g=m.getOtherAxis(d).inverse),f=u.getData().mapDimension(f),i={thisAxis:d,series:u,thisDim:o,otherDim:f,otherAxisInverse:g}}},this)},this),i}},e.prototype._renderHandle=function(){var t=this.group,n=this._displayables,i=n.handles=[null,null],a=n.handleLabels=[null,null],o=this._displayables.sliderGroup,s=this._size,l=this.dataZoomModel,u=this.api,d=l.get("borderRadius")||0,f=l.get("brushSelect"),g=n.filler=new Qg({silent:f,style:{fill:l.get("fillerColor")},textConfig:{position:"inside"}});o.add(g),o.add(new Qg({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:s[0],height:s[1],r:d},style:{stroke:l.get("dataBackgroundColor")||l.get("borderColor"),lineWidth:yle,fill:"rgba(0,0,0,0)"}})),Q([0,1],function(L){var O=l.get("handleIcon");!d_[O]&&O.indexOf("path://")<0&&O.indexOf("image://")<0&&(O="path://"+O,mle.NODE_ENV!=="production"&&Fo("handleIcon now needs 'path://' prefix when using a path string"));var V=qn(O,-1,0,2,2,null,!0);V.attr({cursor:x3(this._orient),draggable:!0,drift:pt(this._onDragMove,this,L),ondragend:pt(this._onDragEnd,this),onmouseover:pt(this._showDataInfo,this,!0),onmouseout:pt(this._showDataInfo,this,!1),z2:5});var F=V.getBoundingRect(),$=l.get("handleSize");this._handleHeight=nt($,this._size[1]),this._handleWidth=F.width/F.height*this._handleHeight,V.setStyle(l.getModel("handleStyle").getItemStyle()),V.style.strokeNoScale=!0,V.rectHover=!0,V.ensureState("emphasis").style=l.getModel(["emphasis","handleStyle"]).getItemStyle(),yc(V);var H=l.get("handleColor");H!=null&&(V.style.fill=H),o.add(i[L]=V);var Z=l.getModel("textStyle"),j=l.get("handleLabel")||{},Y=j.show||!1;t.add(a[L]=new Dr({silent:!0,invisible:!Y,style:an(Z,{x:0,y:0,text:"",verticalAlign:"middle",align:"center",fill:Z.getTextColor(),font:Z.getFont()}),z2:10}))},this);var m=g;if(f){var _=nt(l.get("moveHandleSize"),s[1]),x=n.moveHandle=new Ar({style:l.getModel("moveHandleStyle").getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:s[1]-.5,height:_}}),w=_*.8,C=n.moveHandleIcon=qn(l.get("moveHandleIcon"),-w/2,-w/2,w,w,"#fff",!0);C.silent=!0,C.y=s[1]+_/2-.5,x.ensureState("emphasis").style=l.getModel(["emphasis","moveHandleStyle"]).getItemStyle();var A=Math.min(s[1]/2,Math.max(_,10));m=n.moveZone=new Ar({invisible:!0,shape:{y:s[1]-A,height:_+A}}),m.on("mouseover",function(){u.enterEmphasis(x)}).on("mouseout",function(){u.leaveEmphasis(x)}),o.add(x),o.add(C),o.add(m)}m.attr({draggable:!0,cursor:x3(this._orient),drift:pt(this._onDragMove,this,"all"),ondragstart:pt(this._showDataInfo,this,!0),ondragend:pt(this._onDragEnd,this),onmouseover:pt(this._showDataInfo,this,!0),onmouseout:pt(this._showDataInfo,this,!1)})},e.prototype._resetInterval=function(){var t=this._range=this.dataZoomModel.getPercentRange(),n=this._getViewExtent();this._handleEnds=[Wr(t[0],[0,100],n,!0),Wr(t[1],[0,100],n,!0)]},e.prototype._updateInterval=function(t,n){var i=this.dataZoomModel,a=this._handleEnds,o=this._getViewExtent(),s=i.findRepresentativeAxisProxy().getMinMaxSpan(),l=[0,100];Qc(n,a,o,i.get("zoomLock")?"all":t,s.minSpan!=null?Wr(s.minSpan,l,o,!0):null,s.maxSpan!=null?Wr(s.maxSpan,l,o,!0):null);var u=this._range,d=this._range=lo([Wr(a[0],o,l,!0),Wr(a[1],o,l,!0)]);return!u||u[0]!==d[0]||u[1]!==d[1]},e.prototype._updateView=function(t){var n=this._displayables,i=this._handleEnds,a=lo(i.slice()),o=this._size;Q([0,1],function(m){var _=n.handles[m],x=this._handleHeight;_.attr({scaleX:x/2,scaleY:x/2,x:i[m]+(m?-1:1),y:o[1]/2-x/2})},this),n.filler.setShape({x:a[0],y:0,width:a[1]-a[0],height:o[1]});var s={x:a[0],width:a[1]-a[0]};n.moveHandle&&(n.moveHandle.setShape(s),n.moveZone.setShape(s),n.moveZone.getBoundingRect(),n.moveHandleIcon&&n.moveHandleIcon.attr("x",s.x+s.width/2));for(var l=n.dataShadowSegs,u=[0,a[0],a[1],o[0]],d=0;dn[0]||i[1]<0||i[1]>n[1])){var a=this._handleEnds,o=(a[0]+a[1])/2,s=this._updateInterval("all",i[0]-o);this._updateView(),s&&this._dispatchZoomAction(!1)}},e.prototype._onBrushStart=function(t){var n=t.offsetX,i=t.offsetY;this._brushStart=new ir(n,i),this._brushing=!0,this._brushStartTime=+new Date},e.prototype._onBrushEnd=function(t){if(this._brushing){var n=this._displayables.brushRect;if(this._brushing=!1,!!n){n.attr("ignore",!0);var i=n.shape,a=+new Date;if(!(a-this._brushStartTime<200&&Math.abs(i.width)<5)){var o=this._getViewExtent(),s=[0,100];this._range=lo([Wr(i.x,o,s,!0),Wr(i.x+i.width,o,s,!0)]),this._handleEnds=[i.x,i.x+i.width],this._updateView(),this._dispatchZoomAction(!1)}}}},e.prototype._onBrush=function(t){this._brushing&&(Os(t.event),this._updateBrushRect(t.offsetX,t.offsetY))},e.prototype._updateBrushRect=function(t,n){var i=this._displayables,a=this.dataZoomModel,o=i.brushRect;o||(o=i.brushRect=new Qg({silent:!0,style:a.getModel("brushStyle").getItemStyle()}),i.sliderGroup.add(o)),o.attr("ignore",!1);var s=this._brushStart,l=this._displayables.sliderGroup,u=l.transformCoordToLocal(t,n),d=l.transformCoordToLocal(s.x,s.y),f=this._size;u[0]=Math.max(Math.min(f[0],u[0]),0),o.setShape({x:d[0],y:0,width:u[0]-d[0],height:f[1]})},e.prototype._dispatchZoomAction=function(t){var n=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,animation:t?wle:null,start:n[0],end:n[1]})},e.prototype._findCoordRect=function(){var t,n=c5(this.dataZoomModel).infoList;if(!t&&n.length){var i=n[0].model.coordinateSystem;t=i.getRect&&i.getRect()}if(!t){var a=this.api.getWidth(),o=this.api.getHeight();t={x:a*.2,y:o*.2,width:a*.6,height:o*.6}}return t},e.type="dataZoom.slider",e}(f2);function Tle(r){var e={x:"y",y:"x",radius:"angle",angle:"radius"};return e[r]}function x3(r){return r==="vertical"?"ns-resize":"ew-resize"}function w3(r){r.registerComponentModel(vle),r.registerComponentView(Sle),p2(r)}function Ele(r){dr(y3),dr(w3)}var S3={get:function(r,e,t){var n=Ut((Cle[r]||{})[e]);return t&&Ze(n)?n[n.length-1]:n}},Cle={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},T3=si.mapVisual,Ale=si.eachVisual,Dle=Ze,E3=Q,Mle=lo,Ile=Wr,F0=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t.stateList=["inRange","outOfRange"],t.replacableOptionKeys=["inRange","outOfRange","target","controller","color"],t.layoutMode={type:"box",ignoreSize:!0},t.dataBound=[-1/0,1/0],t.targetVisuals={},t.controllerVisuals={},t}return e.prototype.init=function(t,n,i){this.mergeDefaultAndTheme(t,i)},e.prototype.optionUpdated=function(t,n){var i=this.option;!n&&G5(i,t,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},e.prototype.resetVisual=function(t){var n=this.stateList;t=pt(t,this),this.controllerVisuals=S2(this.option.controller,n,t),this.targetVisuals=S2(this.option.target,n,t)},e.prototype.getItemSymbol=function(){return null},e.prototype.getTargetSeriesIndices=function(){var t=this.option.seriesIndex,n=[];return t==null||t==="all"?this.ecModel.eachSeries(function(i,a){n.push(a)}):n=Xr(t),n},e.prototype.eachTargetSeries=function(t,n){Q(this.getTargetSeriesIndices(),function(i){var a=this.ecModel.getSeriesByIndex(i);a&&t.call(n,a)},this)},e.prototype.isTargetSeries=function(t){var n=!1;return this.eachTargetSeries(function(i){i===t&&(n=!0)}),n},e.prototype.formatValueText=function(t,n,i){var a=this.option,o=a.precision,s=this.dataBound,l=a.formatter,u;i=i||["<",">"],Ze(t)&&(t=t.slice(),u=!0);var d=n?t:u?[f(t[0]),f(t[1])]:f(t);if(ut(l))return l.replace("{value}",u?d[0]:d).replace("{value2}",u?d[1]:d);if(It(l))return u?l(t[0],t[1]):l(t);if(u)return t[0]===s[0]?i[0]+" "+d[1]:t[1]===s[1]?i[1]+" "+d[0]:d[0]+" - "+d[1];return d;function f(g){return g===s[0]?"min":g===s[1]?"max":(+g).toFixed(Math.min(o,20))}},e.prototype.resetExtent=function(){var t=this.option,n=Mle([t.min,t.max]);this._dataExtent=n},e.prototype.getDataDimensionIndex=function(t){var n=this.option.dimension;if(n!=null)return t.getDimensionIndex(n);for(var i=t.dimensions,a=i.length-1;a>=0;a--){var o=i[a],s=t.getDimensionInfo(o);if(!s.isCalculationCoord)return s.storeDimIndex}},e.prototype.getExtent=function(){return this._dataExtent.slice()},e.prototype.completeVisualOption=function(){var t=this.ecModel,n=this.option,i={inRange:n.inRange,outOfRange:n.outOfRange},a=n.target||(n.target={}),o=n.controller||(n.controller={});rr(a,i),rr(o,i);var s=this.isCategory();l.call(this,a),l.call(this,o),u.call(this,a,"inRange","outOfRange"),d.call(this,o);function l(f){Dle(n.color)&&!f.inRange&&(f.inRange={color:n.color.slice().reverse()}),f.inRange=f.inRange||{color:t.get("gradientColor")}}function u(f,g,m){var _=f[g],x=f[m];_&&!x&&(x=f[m]={},E3(_,function(w,C){if(si.isValidType(C)){var A=S3.get(C,"inactive",s);A!=null&&(x[C]=A,C==="color"&&!x.hasOwnProperty("opacity")&&!x.hasOwnProperty("colorAlpha")&&(x.opacity=[0,0]))}}))}function d(f){var g=(f.inRange||{}).symbol||(f.outOfRange||{}).symbol,m=(f.inRange||{}).symbolSize||(f.outOfRange||{}).symbolSize,_=this.get("inactiveColor"),x=this.getItemSymbol(),w=x||"roundRect";E3(this.stateList,function(C){var A=this.itemSize,L=f[C];L||(L=f[C]={color:s?_:[_]}),L.symbol==null&&(L.symbol=g&&Ut(g)||(s?w:[w])),L.symbolSize==null&&(L.symbolSize=m&&Ut(m)||(s?A[0]:[A[0],A[0]])),L.symbol=T3(L.symbol,function(F){return F==="none"?w:F});var O=L.symbolSize;if(O!=null){var V=-1/0;Ale(O,function(F){F>V&&(V=F)}),L.symbolSize=T3(O,function(F){return Ile(F,[0,V],[0,A[0]],!0)})}},this)}},e.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},e.prototype.isCategory=function(){return!!this.option.categories},e.prototype.setSelected=function(t){},e.prototype.getSelected=function(){return null},e.prototype.getValueState=function(t){return null},e.prototype.getVisualMeta=function(t){return null},e.type="visualMap",e.dependencies=["series"],e.defaultOption={show:!0,z:4,seriesIndex:"all",min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:"#333"}},e}(mr),C3=[20,140],kle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(i){i.mappingMethod="linear",i.dataExtent=this.getExtent()}),this._resetRange()},e.prototype.resetItemSize=function(){r.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=C3[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=C3[1])},e.prototype._resetRange=function(){var t=this.getExtent(),n=this.option.range;!n||n.auto?(t.auto=1,this.option.range=t):Ze(n)&&(n[0]>n[1]&&n.reverse(),n[0]=Math.max(n[0],t[0]),n[1]=Math.min(n[1],t[1]))},e.prototype.completeVisualOption=function(){r.prototype.completeVisualOption.apply(this,arguments),Q(this.stateList,function(t){var n=this.option.controller[t].symbolSize;n&&n[0]!==n[1]&&(n[0]=n[1]/3)},this)},e.prototype.setSelected=function(t){this.option.range=t.slice(),this._resetRange()},e.prototype.getSelected=function(){var t=this.getExtent(),n=lo((this.get("range")||[]).slice());return n[0]>t[1]&&(n[0]=t[1]),n[1]>t[1]&&(n[1]=t[1]),n[0]=i[1]||t<=n[1])?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[];return this.eachTargetSeries(function(i){var a=[],o=i.getData();o.each(this.getDataDimensionIndex(o),function(s,l){t[0]<=s&&s<=t[1]&&a.push(l)},this),n.push({seriesId:i.id,dataIndex:a})},this),n},e.prototype.getVisualMeta=function(t){var n=A3(this,"outOfRange",this.getExtent()),i=A3(this,"inRange",this.option.range.slice()),a=[];function o(m,_){a.push({value:m,color:t(m,_)})}for(var s=0,l=0,u=i.length,d=n.length;lt[1])break;a.push({color:this.getControllerVisual(l,"color",n),offset:s/i})}return a.push({color:this.getControllerVisual(t[1],"color",n),offset:1}),a},e.prototype._createBarPoints=function(t,n){var i=this.visualMapModel.itemSize;return[[i[0]-n[0],t[0]],[i[0],t[0]],[i[0],t[1]],[i[0]-n[1],t[1]]]},e.prototype._createBarGroup=function(t){var n=this._orient,i=this.visualMapModel.get("inverse");return new qt(n==="horizontal"&&!i?{scaleX:t==="bottom"?1:-1,rotation:Math.PI/2}:n==="horizontal"&&i?{scaleX:t==="bottom"?-1:1,rotation:-Math.PI/2}:n==="vertical"&&!i?{scaleX:t==="left"?1:-1,scaleY:-1}:{scaleX:t==="left"?1:-1})},e.prototype._updateHandle=function(t,n){if(this._useHandle){var i=this._shapes,a=this.visualMapModel,o=i.handleThumbs,s=i.handleLabels,l=a.itemSize,u=a.getExtent(),d=this._applyTransform("left",i.mainGroup);Lle([0,1],function(f){var g=o[f];g.setStyle("fill",n.handlesColor[f]),g.y=t[f];var m=Es(t[f],[0,l[1]],u,!0),_=this.getControllerVisual(m,"symbolSize");g.scaleX=g.scaleY=_/l[0],g.x=l[0]-_/2;var x=Ho(i.handleLabelPoints[f],Sc(g,this.group));if(this._orient==="horizontal"){var w=d==="left"||d==="top"?(l[0]-_)/2:(l[0]-_)/-2;x[1]+=w}s[f].setStyle({x:x[0],y:x[1],text:a.formatValueText(this._dataInterval[f]),verticalAlign:"middle",align:this._orient==="vertical"?this._applyTransform("left",i.mainGroup):"center"})},this)}},e.prototype._showIndicator=function(t,n,i,a){var o=this.visualMapModel,s=o.getExtent(),l=o.itemSize,u=[0,l[1]],d=this._shapes,f=d.indicator;if(f){f.attr("invisible",!1);var g={convertOpacityToAlpha:!0},m=this.getControllerVisual(t,"color",g),_=this.getControllerVisual(t,"symbolSize"),x=Es(t,s,u,!0),w=l[0]-_/2,C={x:f.x,y:f.y};f.y=x,f.x=w;var A=Ho(d.indicatorLabelPoint,Sc(f,this.group)),L=d.indicatorLabel;L.attr("invisible",!1);var O=this._applyTransform("left",d.mainGroup),V=this._orient,F=V==="horizontal";L.setStyle({text:(i||"")+o.formatValueText(n),verticalAlign:F?O:"middle",align:F?"center":O});var $={x:w,y:x,style:{fill:m}},H={style:{x:A[0],y:A[1]}};if(o.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var Z={duration:100,easing:"cubicInOut",additive:!0};f.x=C.x,f.y=C.y,f.animateTo($,Z),L.animateTo(H,Z)}else f.attr($),L.attr(H);this._firstShowIndicator=!1;var j=this._shapes.handleLabels;if(j)for(var Y=0;Yo[1]&&(f[1]=1/0),n&&(f[0]===-1/0?this._showIndicator(d,f[1],"< ",l):f[1]===1/0?this._showIndicator(d,f[0],"> ",l):this._showIndicator(d,d,"≈ ",l));var g=this._hoverLinkDataIndices,m=[];(n||P3(i))&&(m=this._hoverLinkDataIndices=i.findTargetDataIndices(f));var _=nW(g,m);this._dispatchHighDown("downplay",$0(_[0],i)),this._dispatchHighDown("highlight",$0(_[1],i))}},e.prototype._hoverLinkFromSeriesMouseOver=function(t){var n;if(Lc(t.target,function(l){var u=jt(l);if(u.dataIndex!=null)return n=u,!0},!0),!!n){var i=this.ecModel.getSeriesByIndex(n.seriesIndex),a=this.visualMapModel;if(a.isTargetSeries(i)){var o=i.getData(n.dataType),s=o.getStore().get(a.getDataDimensionIndex(o),n.dataIndex);isNaN(s)||this._showIndicator(s,s)}}},e.prototype._hideIndicator=function(){var t=this._shapes;t.indicator&&t.indicator.attr("invisible",!0),t.indicatorLabel&&t.indicatorLabel.attr("invisible",!0);var n=this._shapes.handleLabels;if(n)for(var i=0;i=0&&(a.dimension=o,n.push(a))}}),r.getData().setVisual("visualMeta",n)}}];function Fle(r,e,t,n){for(var i=e.targetVisuals[n],a=si.prepareVisualTypes(i),o={color:ng(r.getData(),"color")},s=0,l=a.length;s0:e.splitNumber>0)||e.calculable)?"continuous":"piecewise"}),r.registerAction(zle,Ble),Q(Vle,function(e){r.registerVisual(r.PRIORITY.VISUAL.COMPONENT,e)}),r.registerPreprocessor($le))}function B3(r){r.registerComponentModel(kle),r.registerComponentView(Nle),z3(r)}var Gle={},Ule=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t._pieceList=[],t}return e.prototype.optionUpdated=function(t,n){r.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var i=this._mode=this._determineMode();this._pieceList=[],Hle[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var a=this.option.categories;this.resetVisual(function(o,s){i==="categories"?(o.mappingMethod="category",o.categories=Ut(a)):(o.dataExtent=this.getExtent(),o.mappingMethod="piecewise",o.pieceList=je(this._pieceList,function(l){return l=Ut(l),s!=="inRange"&&(l.visual=null),l}))})},e.prototype.completeVisualOption=function(){var t=this.option,n={},i=si.listVisualTypes(),a=this.isCategory();Q(t.pieces,function(s){Q(i,function(l){s.hasOwnProperty(l)&&(n[l]=1)})}),Q(n,function(s,l){var u=!1;Q(this.stateList,function(d){u=u||o(t,d,l)||o(t.target,d,l)},this),!u&&Q(this.stateList,function(d){(t[d]||(t[d]={}))[l]=S3.get(l,d==="inRange"?"active":"inactive",a)})},this);function o(s,l,u){return s&&s[l]&&s[l].hasOwnProperty(u)}r.prototype.completeVisualOption.apply(this,arguments)},e.prototype._resetSelected=function(t,n){var i=this.option,a=this._pieceList,o=(n?i:t).selected||{};if(i.selected=o,Q(a,function(l,u){var d=this.getSelectedMapKey(l);o.hasOwnProperty(d)||(o[d]=!0)},this),i.selectedMode==="single"){var s=!1;Q(a,function(l,u){var d=this.getSelectedMapKey(l);o[d]&&(s?o[d]=!1:s=!0)},this)}},e.prototype.getItemSymbol=function(){return this.get("itemSymbol")},e.prototype.getSelectedMapKey=function(t){return this._mode==="categories"?t.value+"":t.index+""},e.prototype.getPieceList=function(){return this._pieceList},e.prototype._determineMode=function(){var t=this.option;return t.pieces&&t.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},e.prototype.setSelected=function(t){this.option.selected=Ut(t)},e.prototype.getValueState=function(t){var n=si.findPieceIndex(t,this._pieceList);return n!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[n])]?"inRange":"outOfRange"},e.prototype.findTargetDataIndices=function(t){var n=[],i=this._pieceList;return this.eachTargetSeries(function(a){var o=[],s=a.getData();s.each(this.getDataDimensionIndex(s),function(l,u){var d=si.findPieceIndex(l,i);d===t&&o.push(u)},this),n.push({seriesId:a.id,dataIndex:o})},this),n},e.prototype.getRepresentValue=function(t){var n;if(this.isCategory())n=t.value;else if(t.value!=null)n=t.value;else{var i=t.interval||[];n=i[0]===-1/0&&i[1]===1/0?0:(i[0]+i[1])/2}return n},e.prototype.getVisualMeta=function(t){if(this.isCategory())return;var n=[],i=["",""],a=this;function o(d,f){var g=a.getRepresentValue({interval:d});f||(f=a.getValueState(g));var m=t(g,f);d[0]===-1/0?i[0]=m:d[1]===1/0?i[1]=m:n.push({value:d[0],color:m},{value:d[1],color:m})}var s=this._pieceList.slice();if(!s.length)s.push({interval:[-1/0,1/0]});else{var l=s[0].interval[0];l!==-1/0&&s.unshift({interval:[-1/0,l]}),l=s[s.length-1].interval[1],l!==1/0&&s.push({interval:[l,1/0]})}var u=-1/0;return Q(s,function(d){var f=d.interval;f&&(f[0]>u&&o([u,f[0]],"outOfRange"),o(f.slice()),u=f[1])},this),{stops:n,outerColors:i}},e.type="visualMap.piecewise",e.defaultOption=Fl(F0.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieces:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0}),e}(F0),Hle={splitNumber:function(r){var e=this.option,t=Math.min(e.precision,20),n=this.getExtent(),i=e.splitNumber;i=Math.max(parseInt(i,10),1),e.splitNumber=i;for(var a=(n[1]-n[0])/i;+a.toFixed(t)!==a&&t<5;)t++;e.precision=t,a=+a.toFixed(t),e.minOpen&&r.push({interval:[-1/0,n[0]],close:[0,0]});for(var o=0,s=n[0];oo[1]&&console.warn("Piece "+n+"is illegal: "+o+" lower bound should not greater then uppper bound."),o[0]===o[1]&&s[0]&&s[1]&&(i.value=o[0])}i.visual=si.retrieveVisuals(t),r.push(i)},this),V3(e,r),wI(r),Q(r,function(t){var n=t.close,i=[["<","≤"][n[1]],[">","≥"][n[0]]];t.text=t.text||this.formatValueText(t.value!=null?t.value:t.interval,!1,i)},this)}};function V3(r,e){var t=r.inverse;(r.orient==="vertical"?!t:t)&&e.reverse()}var Wle=function(r){ze(e,r);function e(){var t=r!==null&&r.apply(this,arguments)||this;return t.type=e.type,t}return e.prototype.doRender=function(){var t=this.group;t.removeAll();var n=this.visualMapModel,i=n.get("textGap"),a=n.textStyleModel,o=a.getFont(),s=a.getTextColor(),l=this._getItemAlign(),u=n.itemSize,d=this._getViewData(),f=d.endsText,g=Gn(n.get("showLabel",!0),!f),m=!n.get("selectedMode");f&&this._renderEndsText(t,f[0],u,g,l),Q(d.viewPieceList,function(_){var x=_.piece,w=new qt;w.onclick=pt(this._onItemClick,this,x),this._enableHoverLink(w,_.indexInModelPieceList);var C=n.getRepresentValue(x);if(this._createItemSymbol(w,C,[0,0,u[0],u[1]],m),g){var A=this.visualMapModel.getValueState(C);w.add(new Dr({style:{x:l==="right"?-i:u[0]+i,y:u[1]/2,text:x.text,verticalAlign:"middle",align:l,font:o,fill:s,opacity:A==="outOfRange"?.5:1},silent:m}))}t.add(w)},this),f&&this._renderEndsText(t,f[1],u,g,l),Dc(n.get("orient"),t,n.get("itemGap")),this.renderBackground(t),this.positionGroup(t)},e.prototype._enableHoverLink=function(t,n){var i=this;t.on("mouseover",function(){return a("highlight")}).on("mouseout",function(){return a("downplay")});var a=function(o){var s=i.visualMapModel;s.option.hoverLink&&i.api.dispatchAction({type:o,batch:$0(s.findTargetDataIndices(n),s)})}},e.prototype._getItemAlign=function(){var t=this.visualMapModel,n=t.option;if(n.orient==="vertical")return I3(t,this.api,t.itemSize);var i=n.align;return(!i||i==="auto")&&(i="left"),i},e.prototype._renderEndsText=function(t,n,i,a,o){if(n){var s=new qt,l=this.visualMapModel.textStyleModel;s.add(new Dr({style:an(l,{x:a?o==="right"?i[0]:0:i[0]/2,y:i[1]/2,verticalAlign:"middle",align:a?o:"center",text:n})})),t.add(s)}},e.prototype._getViewData=function(){var t=this.visualMapModel,n=je(t.getPieceList(),function(s,l){return{piece:s,indexInModelPieceList:l}}),i=t.get("text"),a=t.get("orient"),o=t.get("inverse");return(a==="horizontal"?o:!o)?n.reverse():i&&(i=i.slice().reverse()),{viewPieceList:n,endsText:i}},e.prototype._createItemSymbol=function(t,n,i,a){var o=qn(this.getControllerVisual(n,"symbol"),i[0],i[1],i[2],i[3],this.getControllerVisual(n,"color"));o.silent=a,t.add(o)},e.prototype._onItemClick=function(t){var n=this.visualMapModel,i=n.option,a=i.selectedMode;if(a){var o=Ut(i.selected),s=n.getSelectedMapKey(t);a==="single"||a===!0?(o[s]=!0,Q(o,function(l,u){o[u]=u===s})):o[s]=!o[s],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:o})}},e.type="visualMap.piecewise",e}(D3);function F3(r){r.registerComponentModel(Ule),r.registerComponentView(Wle),z3(r)}function qle(r){dr(B3),dr(F3)}var Zle={label:{enabled:!0},decal:{show:!1}},$3=Cr(),jle={};function Xle(r,e){var t=r.getModel("aria");if(!t.get("enabled"))return;var n=Ut(Zle);rr(n.label,r.getLocaleModel().get("aria"),!1),rr(t.option,n,!1),i(),a();function i(){var u=t.getModel("decal"),d=u.get("show");if(d){var f=Tt();r.eachSeries(function(g){if(!g.isColorBySeries()){var m=f.get(g.type);m||(m={},f.set(g.type,m)),$3(g).scope=m}}),r.eachRawSeries(function(g){if(r.isSeriesFiltered(g))return;if(It(g.enableAriaDecal)){g.enableAriaDecal();return}var m=g.getData();if(g.isColorBySeries()){var A=R1(g.ecModel,g.name,jle,r.getSeriesCount()),L=m.getVisual("decal");m.setVisual("decal",O(L,A))}else{var _=g.getRawData(),x={},w=$3(g).scope;m.each(function(V){var F=m.getRawIndex(V);x[F]=V});var C=_.count();_.each(function(V){var F=x[V],$=_.getName(V)||V+"",H=R1(g.ecModel,$,w,C),Z=m.getItemVisual(F,"decal");m.setItemVisual(F,"decal",O(Z,H))})}function O(V,F){var $=V?Ge(Ge({},F),V):F;return $.dirty=!0,$}})}}function a(){var u=e.getZr().dom;if(u){var d=r.getLocaleModel().get("aria"),f=t.getModel("label");if(f.option=Bt(f.option,d),!!f.get("enabled")){if(u.setAttribute("role","img"),f.get("description")){u.setAttribute("aria-label",f.get("description"));return}var g=r.getSeriesCount(),m=f.get(["data","maxCount"])||10,_=f.get(["series","maxCount"])||10,x=Math.min(g,_),w;if(!(g<1)){var C=s();if(C){var A=f.get(["general","withTitle"]);w=o(A,{title:C})}else w=f.get(["general","withoutTitle"]);var L=[],O=g>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);w+=o(O,{seriesCount:g}),r.eachSeries(function(H,Z){if(Z1?f.get(["series","multiple",se]):f.get(["series","single",se]),j=o(j,{seriesId:H.seriesIndex,seriesName:H.get("name"),seriesType:l(H.subType)});var ae=H.getData();if(ae.count()>m){var ue=f.get(["data","partialData"]);j+=o(ue,{displayCnt:m})}else j+=f.get(["data","allData"]);for(var fe=f.get(["data","separator","middle"]),le=f.get(["data","separator","end"]),ge=f.get(["data","excludeDimensionId"]),xe=[],Me=0;Me":"gt",">=":"gte","=":"eq","!=":"ne","<>":"ne"},Jle=function(){function r(e){var t=this._condVal=ut(e)?new RegExp(e):pM(e)?e:null;if(t==null){var n="";Qd.NODE_ENV!=="production"&&(n=Ki("Illegal regexp",e,"in")),Gr(n)}}return r.prototype.evaluate=function(e){var t=typeof e;return ut(t)?this._condVal.test(e):Lr(t)?this._condVal.test(e+""):!1},r}(),Qle=function(){function r(){}return r.prototype.evaluate=function(){return this.value},r}(),eue=function(){function r(){}return r.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&n.push(i),i=[ae,ue]}function d(ae,ue,fe,le){ef(ae,fe)&&ef(ue,le)||i.push(ae,ue,fe,le,fe,le)}function f(ae,ue,fe,le,ge,xe){var Me=Math.abs(ue-ae),Ve=Math.tan(Me/4)*4/3,Fe=ueH:Y2&&n.push(i),n}function j2(r,e,t,n,i,a,o,s,l,u){if(ef(r,t)&&ef(e,n)&&ef(i,o)&&ef(a,s)){l.push(o,s);return}var d=2/u,f=d*d,g=o-r,m=s-e,_=Math.sqrt(g*g+m*m);g/=_,m/=_;var x=t-r,w=n-e,C=i-o,A=a-s,L=x*x+w*w,O=C*C+A*A;if(L=0&&H=0){l.push(o,s);return}var Z=[],j=[];Il(r,t,i,o,.5,Z),Il(e,n,a,s,.5,j),j2(Z[0],j[0],Z[1],j[1],Z[2],j[2],Z[3],j[3],l,u),j2(Z[4],j[4],Z[5],j[5],Z[6],j[6],Z[7],j[7],l,u)}function pue(r,e){var t=Z2(r),n=[];e=e||1;for(var i=0;i0)for(var u=0;uMath.abs(u),f=q3([l,u],d?0:1,e),g=(d?s:u)/f.length,m=0;mi,o=q3([n,i],a?0:1,e),s=a?"width":"height",l=a?"height":"width",u=a?"x":"y",d=a?"y":"x",f=r[s]/o.length,g=0;g1?null:new ir(x*l+r,x*u+e)}function mue(r,e,t){var n=new ir;ir.sub(n,t,e),n.normalize();var i=new ir;ir.sub(i,r,e);var a=i.dot(n);return a}function tf(r,e){var t=r[r.length-1];t&&t[0]===e[0]&&t[1]===e[1]||r.push(e)}function yue(r,e,t){for(var n=r.length,i=[],a=0;ao?(u.x=d.x=s+a/2,u.y=l,d.y=l+o):(u.y=d.y=l+o/2,u.x=s,d.x=s+a),yue(e,u,d)}function G0(r,e,t,n){if(t===1)n.push(e);else{var i=Math.floor(t/2),a=r(e);G0(r,a[0],i,n),G0(r,a[1],t-i,n)}return n}function _ue(r,e){for(var t=[],n=0;n0;u/=2){var d=0,f=0;(r&u)>0&&(d=1),(e&u)>0&&(f=1),s+=u*u*(3*d^f),f===0&&(d===1&&(r=u-1-r,e=u-1-e),l=r,r=e,e=l)}return s}function W0(r){var e=1/0,t=1/0,n=-1/0,i=-1/0,a=je(r,function(s){var l=s.getBoundingRect(),u=s.getComputedTransform(),d=l.x+l.width/2+(u?u[4]:0),f=l.y+l.height/2+(u?u[5]:0);return e=Math.min(d,e),t=Math.min(f,t),n=Math.max(d,n),i=Math.max(f,i),[d,f]}),o=je(a,function(s,l){return{cp:s,z:Due(s[0],s[1],e,t,n,i),path:r[l]}});return o.sort(function(s,l){return s.z-l.z}).map(function(s){return s.path})}function t4(r){return wue(r.path,r.count)}function Y2(){return{fromIndividuals:[],toIndividuals:[],count:0}}function Mue(r,e,t){var n=[];function i(V){for(var F=0;F=0;i--)if(!t[i].many.length){var l=t[s].many;if(l.length<=1)if(s)s=0;else return t;var a=l.length,u=Math.ceil(a/2);t[i].many=l.slice(u,a),t[s].many=l.slice(0,u),s++}return t}var kue={clone:function(r){for(var e=[],t=1-Math.pow(1-r.path.style.opacity,1/r.count),n=0;n0))return;var s=n.getModel("universalTransition").get("delay"),l=Object.assign({setToFinal:!0},o),u,d;r4(r)&&(u=r,d=e),r4(e)&&(u=e,d=r);function f(C,A,L,O,V){var F=C.many,$=C.one;if(F.length===1&&!V){var H=A?F[0]:$,Z=A?$:F[0];if(U0(H))f({many:[H],one:Z},!0,L,O,!0);else{var j=s?Bt({delay:s(L,O)},l):l;X2(H,Z,j),a(H,Z,H,Z,j)}}else for(var Y=Bt({dividePath:kue[t],individualDelay:s&&function(ge,xe,Me,Ve){return s(ge+L,O)}},l),se=A?Mue(F,$,Y):Iue($,F,Y),ae=se.fromIndividuals,ue=se.toIndividuals,fe=ae.length,le=0;lee.length,m=u?n4(d,u):n4(g?e:r,[g?r:e]),_=0,x=0;xi4){J2.NODE_ENV!=="production"&&wn("Universal transition is disabled on large data > 10k.");return}for(var a=n.getIndices(),o=0;o0&&F.group.traverse(function(H){H instanceof vr&&!H.animators.length&&H.animateFrom({style:{opacity:0}},$)})})}function c4(r){var e=r.getModel("universalTransition").get("seriesKey");return e||r.id}function h4(r){return Ze(r)?r.sort().join(","):r}function su(r){if(r.hostModel)return r.hostModel.getModel("universalTransition").get("divideShape")}function Bue(r,e){var t=Tt(),n=Tt(),i=Tt();Q(r.oldSeries,function(o,s){var l=r.oldDataGroupIds[s],u=r.oldData[s],d=c4(o),f=h4(d);n.set(f,{dataGroupId:l,data:u}),Ze(d)&&Q(d,function(g){i.set(g,{key:f,dataGroupId:l,data:u})})});function a(o){t.get(o)&&wn("Duplicated seriesKey in universalTransition "+o)}return Q(e.updatedSeries,function(o){if(o.isUniversalTransitionEnabled()&&o.isAnimationEnabled()){var s=o.get("dataGroupId"),l=o.getData(),u=c4(o),d=h4(u),f=n.get(d);if(f)J2.NODE_ENV!=="production"&&a(d),t.set(d,{oldSeries:[{dataGroupId:f.dataGroupId,divide:su(f.data),data:f.data}],newSeries:[{dataGroupId:s,divide:su(l),data:l}]});else if(Ze(u)){J2.NODE_ENV!=="production"&&a(d);var g=[];Q(u,function(x){var w=n.get(x);w.data&&g.push({dataGroupId:w.dataGroupId,divide:su(w.data),data:w.data})}),g.length&&t.set(d,{oldSeries:g,newSeries:[{dataGroupId:s,data:l,divide:su(l)}]})}else{var m=i.get(u);if(m){var _=t.get(m.key);_||(_={oldSeries:[{dataGroupId:m.dataGroupId,data:m.data,divide:su(m.data)}],newSeries:[]},t.set(m.key,_)),_.newSeries.push({dataGroupId:s,data:l,divide:su(l)})}}}}),t}function d4(r,e){for(var t=0;t=0&&i.push({dataGroupId:e.oldDataGroupIds[s],data:e.oldData[s],divide:su(e.oldData[s]),groupIdDim:o.dimension})}),Q(Xr(r.to),function(o){var s=d4(t.updatedSeries,o);if(s>=0){var l=t.updatedSeries[s].getData();a.push({dataGroupId:e.oldDataGroupIds[s],data:l,divide:su(l),groupIdDim:o.dimension})}}),i.length>0&&a.length>0&&u4(i,a,n)}function Fue(r){r.registerUpdateLifecycle("series:beforeupdate",function(e,t,n){Q(Xr(n.seriesTransition),function(i){Q(Xr(i.to),function(a){for(var o=n.updatedSeries,s=0;sAn(n)),...(r==null?void 0:r.label)||{}},legend:{...(r==null?void 0:r.legend)||{},[((t=r==null?void 0:r.legend)==null?void 0:t.position)||"bottom"]:"0",show:(r==null?void 0:r.show_legend)||!1},barWidth:"70%",grid:{borderColor:"#e5e7eb"},title:{...(r==null?void 0:r.title)||{}}};return(r!=null&&r.colors||r!=null&&r.color)&&(e.color=(r==null?void 0:r.colors)||(r==null?void 0:r.color)||null),e}function f4(r){return{color:"#9ca3af",fontSize:10,fontFamily:"Inter, ui-sans-serif, system-ui",fontWeight:400,label:r==null?void 0:r.label,show:!0,formatter:(r==null?void 0:r.formatter)||(t=>An(t)),margin:(r==null?void 0:r.margin)||7,interval:(r==null?void 0:r.interval)||"auto",rotate:(r==null?void 0:r.rotate)||0}}const p4=["#d3c7e6","#bedae3","#f8e9cb","#ff8c8c","#c5d8be","#ffc6c6","#ffc39a","#fff7c5","#d8ffc0","#d4f7ff"],Ca={props:["source","style","widget","dashboard","title","currentWidget","widgetData","prefix"],data(){return{sourceData:null,styleData:null,widgetName:"",dimensions:[],dashboardName:"",titleCharts:"",widgetInstance:null}},mounted(){window.addEventListener("resize",this.handleResize),window.addEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.addEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},unmounted(){window.removeEventListener(`update-data-${this.widget}`,this.checkCustomEvent),window.removeEventListener(`update-style-${this.widget}`,this.checkCustomStyleEvent)},watch:{sourceData:{async handler(){setTimeout(()=>{this==null||this.onChangedData()},0)}}},methods:{checkCustomStyleEvent(r){this.changeOptionsByName(r.chartId,r.options)},checkCustomEvent({filterUrl:r}){this.getDataFromURL(r)},handleResize(){this.widgetInstance&&this.widgetInstance.resize()},async getDataFromURL(r){var e,t,n,i;try{const a=await _r.get(r);this.sourceData=((e=a.data)==null?void 0:e.source)||[],this.$emit("update:widgetData",a.data),this.dimensions=Object.keys(((t=this.sourceData)==null?void 0:t[0])||{}),this.titleCharts=this.style?this.style:((n=a.data)==null?void 0:n.title)||"",this.styleData=((i=a.data)==null?void 0:i.style)||{}}catch(a){const o={message:"Дані не знайдено",title:"Помилка!",type:"error",status:400,id:this.widgetName};(a==null?void 0:a.status)=="404"&&(o.status=404,o.message="Дані не знайдено"),(a==null?void 0:a.status)=="400"&&(o.message="Перевірте налаштування або зверніться до адміністратора"),(a==null?void 0:a.status)=="500"&&(o.message="Сталася помилка сервера"),this.$emit("update:widgetData",o)}},getValues(){return this.sourceData.map(r=>{var e;return parseFloat(r[(e=this.columns)==null?void 0:e[1]])})},formatDate(r){const e=new Date(r);if(isNaN(e))return r;const t=String(e.getDate()).padStart(2,"0"),i=["січня","лютого","березня","квітня","травня","червня","липня","серпня","вересня","жовтня","листопада","грудня"][e.getMonth()],a=e.getFullYear();return`${t} ${i} ${a}`},async getData(){var r;try{if(this.source)this.sourceData=[...this.source],this.styleData=this.style,this.titleCharts=this.title,this.dimensions=Object.keys(((r=this.sourceData)==null?void 0:r[0])||{});else{this.widgetName=this.widget,this.dashboardName=this.dashboard;const e=this.dashboardName?`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}`:`${this.prefix||""}/bi-data?&widget=${this.widgetName}`;await this.getDataFromURL(e)}}catch(e){console.error(e)}},async initChart(r,e,t){var n,i,a,o,s,l,u;this.widgetInstance&&this.widgetInstance.clear();try{const d=this.$refs.chart,f=w_(d),g={tooltip:{trigger:"axis",axisPointer:{type:"shadow"},backgroundColor:"transparent",shadowColor:"transparent",padding:[0,0,0,0],borderWidth:0,formatter:m=>{var C;const _=(C=m[0])==null?void 0:C.axisValue;let w=`
${_?this.formatDate(_):"N/A"}
`;return m.forEach(A=>{w+=`
${(A==null?void 0:A.seriesName)==="metric"?"Значення":A==null?void 0:A.seriesName} ${this.getMetricValue(A==null?void 0:A.data)}
`}),w+="
",w}},xAxis:{data:e!=null&&e.length?e:null,type:e?"category":"value",name:((i=(n=this.styleData)==null?void 0:n.x_axis)==null?void 0:i.name)||"",axisLabel:{...f4((a=this.styleData)==null?void 0:a.x_axis),formatter:m=>{var x,w;const _=this.formatDate(m);return((w=(x=this.styleData)==null?void 0:x.x_axis)==null?void 0:w.overflow)==="ellipsis"&&_.length>10?`${_.slice(0,10)}...`:_}}},yAxis:{data:t!=null&&t.length?t:null,type:t?"category":"value",name:((s=(o=this.styleData)==null?void 0:o.y_axis)==null?void 0:s.name)||"",axisLabel:f4((l=this.styleData)==null?void 0:l.y_axis)},series:r!=null&&r.length?r:null,...sh(this.styleData),grid:{bottom:"0%",right:"0%",left:"0%",top:"20px",containLabel:!0,...((u=this.styleData)==null?void 0:u.grid)||{}}};await f.setOption(g),f.resize(),this.widgetInstance=f,this.$emit("update:currentWidget",f)}catch(d){console.error(d)}},async setSeriesOption(r,e){const t=r.getOption(),{series:n=[]}=t,i=n.map(a=>({...a,...e}));r.setOption({...t,series:i})},async changeOptionsByName(r,e){const t=document.getElementById(r);if(!t)return null;const n=xS(t);if(!n)return null;const i=n.getOption();e.seriesOptions&&this.setSeriesOption(n,e.seriesOptions),n.setOption({...i,...e.options,tooltip:{...$ue.getTooltipOptions(e.options.tooltip.show)}})},async changeData(r){var e;try{let t=this.dashboard?`${this.prefix||""}/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`:`${this.prefix||""}/bi-data?&widget=${this.widget}`;(e=r==null?void 0:r.granularity)!=null&&e.length&&(t+=`&granularity=${r.granularity}`),r!=null&&r.metrics&&(t+=`&metrics=${r.metrics}`),this.getDataFromURL(t)}catch(t){console.error(t)}},async setFilter(r){const e=`${this.prefix||""}/bi-data?dashboard=${this.dashboardName}&widget=${this.widgetName}${r||""}`;await this.getDataFromURL(e)},async changeStyle(r,e){this.styleData[r]=e,this.onChangedData()},getMetricValue(r){var n;const e=(r==null?void 0:r.metric)||r;return parseFloat(e)?(n=An(e,{notation:"standard"}))==null?void 0:n.replaceAll(","," "):e}}},fr=(r,e)=>{const t=r.__vccOpts||r;for(const[n,i]of e)t[n]=i;return t},Hue={name:"VsBar",mixins:[Ca],data(){return{resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var e;this.getData(),this.onChangedData();const r=(e=this.$refs)==null?void 0:e.chart;r&&(this.resizeObserver=new ResizeObserver(()=>{var t;this.widgetInstance&&((t=this.widgetInstance)==null||t.resize())}),this.resizeObserver.observe(r))},unmounted(){this.resizeObserver.disconnect()},methods:{async onChangedData(){try{if(this.sourceData){await this.$nextTick();const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch(r){console.error(r)}},prepareData(){var r,e,t,n,i,a;try{if(!((r=this.sourceData)!=null&&r.length))return{series:[],xs:[],ys:void 0};const o=Array.from(new Set(this.sourceData.filter(g=>g[this.dimensions[0]]).map(g=>g[this.dimensions[0]])));let s;this.dimensions[0].includes("date")?s=o.map(g=>rs(g)):s=[...o];let l,u;((e=this.styleData)==null?void 0:e.horizontal)===!0?u=[...s]:l=[...s];const d=this.sourceData.filter(g=>parseFloat(g[this.dimensions[1]])&&g[this.dimensions[0]]).map(g=>parseFloat(g[this.dimensions[1]]));let f;return((t=this.styleData)==null?void 0:t.stack)!==!1?f=this.prepareStackData():((n=this.styleData)==null?void 0:n.negative_waterfall)===!0?f=this.prepareNegativeWaterfall():((i=this.styleData)==null?void 0:i.waterfall)===!0?f=this.prepareWaterfallData(d):((a=this.styleData)==null?void 0:a.accumulative)===!0?f=this.prepareAccumulative(d):f=this.dimensions.slice(1).map((m,_)=>({name:m,type:"bar",stack:`a${_}`,data:this.sourceData.filter(x=>parseFloat(x[m])&&m).map(x=>parseFloat(x[m]))})),{series:f,xs:l,ys:u}}catch(o){return console.error(o),{series:[],xs:[],ys:[]}}},prepareWaterfallData(r){let e=r.reduce((a,o)=>a+o,0);const t=[e,...r],n=t.map((a,o)=>{if(o===0)return 0;const s=e-a;return e-=a,s>=0?s:0});return[{type:"bar",stack:"Total",itemStyle:{borderColor:"transparent",color:"transparent"},data:n,tooltip:{show:!1}},{name:this.title?this.title:this.dimensions[0],type:"bar",stack:"Total",data:t}]},prepareStackData(){return this.dimensions.slice(1).map(t=>({name:t,type:"bar",stack:"a",data:this.sourceData.filter(n=>parseFloat(n[t])&&t).map(n=>parseFloat(n[t]))}))},prepareNegativeWaterfall(){const r=this.sourceData.map(a=>Number.isNaN(a[this.dimensions[1]])?0:Number(a[this.dimensions[1]])),e=this.sourceData.map(a=>Number.isNaN(a[this.dimensions[2]])?0:Number(a[this.dimensions[2]]));let t=0;const n=r.map((a,o)=>{const s=t;return t+=Number.isNaN(a)?0:a,o===0&&(t-=Number.isNaN(e[o])?0:e[o]),t-=Number.isNaN(e[o+1])?0:e[o+1],s>=0?s:0});return[{type:"bar",stack:"a",itemStyle:{borderColor:"transparent",color:"transparent"},data:n,tooltip:{show:!1}},{name:this.dimensions[1],type:"bar",stack:"a",data:r},{name:this.dimensions[2],type:"bar",stack:"a",data:e}]},prepareAccumulative(r){let e=0;const t=r.map(i=>(e+=i,e));return[{name:this.titleCharts,type:"bar",stack:"Total",data:t}]}}},Wue=["id"];function que(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{id:a.uniqueID,ref:"chart",class:"h-full w-full min-h-[200px]"},null,8,Wue)}const Z0=fr(Hue,[["render",que]]),Zue=Object.freeze(Object.defineProperty({__proto__:null,default:Z0},Symbol.toStringTag,{value:"Module"})),jue={name:"VsPie",props:["currentWidget"],mixins:[Ca],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var t;await this.$nextTick(),await this.getData();const{series:r}=this.prepareData()||{};r&&this.initChart(r);const e=(t=this.$refs)==null?void 0:t.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},beforeUnmount(){var r;(r=this.resizeObserver)==null||r.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&this.initChart(r,e,t)}}catch(r){console.error(r)}},buildTooltipForDonut(r,e){const{name:t,value:n,percent:i}=r;return`
${t==null?void 0:t.replace("null","Не визначено")}: ${An(n)} (${i}%)
`},prepareData(){var r,e,t,n,i,a;try{if(this.styleData=this.styleData||{},!((r=this.sourceData)!=null&&r.length))return console.warn("No source data available"),null;const o=Array.from(new Set((this.sourceData||[]).map(_=>_[this.dimensions[0]]))),s=Array.from(new Set((this.sourceData||[]).map(_=>_[this.dimensions[1]]))),l=parseInt((this.sourceData||[]).reduce((_,x)=>_+parseFloat((x==null?void 0:x.metric)||0),0),10),u=o.map((_,x)=>{const w=(s[x]/l*100).toFixed(2);return{name:`${_} (${w}%)`,value:s[x]}}),d=((e=this.styleData)==null?void 0:e.innerRadius)||"80%",f=((t=this.styleData)==null?void 0:t.outerRadius)||"100%",g=[d,f];return this.styleData.legend=q0.getLegendOpions({borderRadius:10,height:"100%",padding:10,bottom:"0",type:"scroll",itemWidth:14,itemHeight:14,formatter:_=>{var x;return(x=_==null?void 0:_.replace("null","Не визначено"))==null?void 0:x.replace("NaN","0.00")},...((n=this.styleData)==null?void 0:n.legend)||{}}),this.styleData.label=q0.getLabelOptions((i=this.styleData)==null?void 0:i.label),this.styleData.show_legend=((a=this.styleData)==null?void 0:a.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:g,center:["50%","60%"],height:"75%",...sh(this.styleData),data:u}]}}catch(o){return console.error("Error in prepareData:",o),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=w_(e);const t=parseInt((this.sourceData||[]).reduce((i,a)=>i+parseFloat((a==null?void 0:a.metric)||0),0),10),n={tooltip:{trigger:"item",formatter:i=>this.buildTooltipForDonut(i,[i.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...sh(this.styleData||{}),title:{text:An(t),left:"center",top:"41%",textStyle:{color:"black",fontWeight:400,fontSize:"22px"}}};this.chartInstance.setOption(n),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var i;(i=this.chartInstance)==null||i.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Xue=["id"];function Yue(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{id:a.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Xue)}const g4=fr(jue,[["render",Yue]]),Kue=Object.freeze(Object.defineProperty({__proto__:null,default:g4},Symbol.toStringTag,{value:"Module"})),Jue={name:"VsPie",props:["currentWidget"],mixins:[Ca],data(){return{chartInstance:null,resizeObserver:null}},computed:{uniqueID(){return this.widget}},async mounted(){var t;await this.$nextTick(),await this.getData();const{series:r}=this.prepareData()||{};r&&this.initChart(r);const e=(t=this.$refs)==null?void 0:t.chart;e&&(this.resizeObserver=new ResizeObserver(()=>{this.chartInstance&&this.chartInstance.resize()}),this.resizeObserver.observe(e))},unmounted(){var r;(r=this.resizeObserver)==null||r.disconnect()},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&this.initChart(r,e,t)}}catch(r){console.error(r)}},buildTooltipForDonut(r,e){const{name:t,value:n,percent:i}=r;return`
${t==null?void 0:t.replace("null","Не визначено")}: ${An(n)} (${i}%)
`},prepareData(){var r,e,t,n,i;try{this.styleData=this.styleData||{};const a=Array.from(new Set((this.sourceData||[]).map(m=>m[this.dimensions[0]]))),o=Array.from(new Set((this.sourceData||[]).map(m=>m[this.dimensions[1]]))),s=parseInt((this.sourceData||[]).reduce((m,_)=>m+parseFloat(_==null?void 0:_.metric),0),10),l=a.map((m,_)=>{const x=(o[_]/s*100).toFixed(2);return{name:`${m} (${x}%)`,value:o[_]}}),u=((r=this.styleData)==null?void 0:r.innerRadius)||"0%",d=((e=this.styleData)==null?void 0:e.outerRadius)||"100%",f=[u,d];return this.styleData.legend=q0.getLegendOpions({borderRadius:10,height:"100%",padding:10,type:"scroll",itemWidth:14,itemHeight:14,formatter:m=>m==null?void 0:m.replace("null","Не визначено"),textStyle:{fontSize:"14px"},...((t=this.styleData)==null?void 0:t.legend)||{}}),this.styleData.label=q0.getLabelOptions((n=this.styleData)==null?void 0:n.label),this.styleData.show_legend=((i=this.styleData)==null?void 0:i.show_legend)??!0,{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"pie",radius:f,center:["50%","60%"],height:"75%",...sh(this.styleData),data:l}]}}catch(a){return console.error("Error in prepareData:",a),null}},async initChart(r){try{if(!r){console.warn("No series data available for chart initialization");return}const e=this.$refs.chart;if(!e){console.warn("Chart DOM element not found");return}this.chartInstance=w_(e);const t={tooltip:{trigger:"item",formatter:n=>this.buildTooltipForDonut(n,[n.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[15,15],shadowColor:"transparent",backgroundColor:"transparent"},series:r,...sh(this.styleData||{})};this.chartInstance.setOption(t),this.$emit("update:currentWidget",this.chartInstance),this.chartInstance.resize(),window.addEventListener("resize",()=>{var n;(n=this.chartInstance)==null||n.resize()})}catch(e){console.error("Error in initChart:",e)}}}},Que=["id"];function ece(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{id:a.uniqueID,ref:"chart",class:"h-full min-h-[200px] flex items-center"},null,8,Que)}const tC=fr(Jue,[["render",ece]]),tce=Object.freeze(Object.defineProperty({__proto__:null,default:tC},Symbol.toStringTag,{value:"Module"})),rce={name:"VsLine",mixins:[Ca],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r,xs:e}=this.prepareData();r&&this.initChart(r,e)},methods:{onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch(r){console.error(r)}},prepareData(){var r,e;try{const t=Array.from(new Set(this.sourceData.map(o=>o[this.dimensions[0]])));let n;this.dimensions[0].includes("date")?n=t.map(o=>rs(o)):n=[...t];const i=this.sourceData.map(o=>parseFloat(o[this.dimensions[1]]));let a;return(r=this.styleData)!=null&&r.stack?a=this.dimensions.slice(1).map(s=>({name:s,type:"line",stack:"a",areaStyle:this.styleData.area?{}:null,data:this.sourceData.filter(l=>parseFloat(l[s])).map(l=>parseFloat(l[s]))})):a=[{name:this.title,type:"line",areaStyle:(e=this.styleData)!=null&&e.area?{}:null,data:i,stack:"a"}],{series:a,xs:n}}catch(t){return console.error(t),null}}}},nce=["id"];function ice(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{id:i.uniqueID,ref:"chart",style:{height:"400px"}},null,8,nce)}const rC=fr(rce,[["render",ice]]),ace=Object.freeze(Object.defineProperty({__proto__:null,default:rC},Symbol.toStringTag,{value:"Module"})),oce={name:"VsStat",mixins:[Ca],data(){return{restDimensions:[],sumValue:0,columns:null,showTooltip:-1}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){this.columns=Object.keys(this.sourceData[0]);const r=this.getValues();this.sumValue=r.reduce((e,t)=>e+t,0),this.sourceData.forEach((e,t)=>{e.color=t{var l,u,d,f;return P.openBlock(),P.createElementBlock("div",{class:P.normalizeClass(["flex flex-col min-w-[5px] justify-center min-h-2.5 h-2.5 text-xs text-white text-center whitespace-nowrap",`bg-[${o.color}]`]),style:P.normalizeStyle({width:`${parseFloat(o==null?void 0:o[(l=i.columns)==null?void 0:l[1]])/i.sumValue*100}%`}),role:"progressbar","aria-valuenow":"42","aria-valuemin":"0","aria-valuemax":"100",onMouseover:g=>i.showTooltip=s,onMouseleave:e[0]||(e[0]=g=>i.showTooltip=-1)},[i.showTooltip>-1?(P.openBlock(),P.createElementBlock("div",dce,P.toDisplayString(r.sourceData[i.showTooltip][i.columns[0]])+" "+P.toDisplayString((parseFloat((f=(u=r.sourceData)==null?void 0:u[i.showTooltip])==null?void 0:f[(d=i.columns)==null?void 0:d[1]])/i.sumValue*100).toFixed(2))+"% ",1)):P.createCommentVNode("",!0)],46,hce)}),256))]),P.createElementVNode("ul",fce,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.sourceData,o=>{var s,l;return P.openBlock(),P.createElementBlock("li",pce,[P.createElementVNode("div",gce,[P.createElementVNode("span",{class:P.normalizeClass(["shrink-0 size-2.5 inline-block rounded-sm me-2.5 min-w-[10px] w-[10px] h-[10px] min-h-[10px]",`bg-[${o.color}]`])},null,2),P.createElementVNode("span",vce,P.toDisplayString((o==null?void 0:o[(s=i.columns)==null?void 0:s[0]])||"Не визначено"),1)]),P.createElementVNode("div",mce,[P.createElementVNode("span",yce,P.toDisplayString(a.formattedValue(o==null?void 0:o[(l=i.columns)==null?void 0:l[1]])||"-"),1)])])}),256))])])])])}const nC=fr(oce,[["render",_ce]]),bce=Object.freeze(Object.defineProperty({__proto__:null,default:nC},Symbol.toStringTag,{value:"Module"})),xce={name:"VsProgressBar",mixins:[Ca],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){var e;this.columns=Object.keys((e=this.sourceData)==null?void 0:e[0])||null;const r=this.getValues();this.maxValue=Math.max(...r)},formattedValue(r){return An(r)}}},wce={key:0,class:"flex flex-col h-full pt-[16px] rounded-xl"},Sce={class:"h-full pt-0 pb-6 space-y-4"},Tce={class:"h-full space-y-4 custom-scrollbar"},Ece={class:"flex items-center justify-between mr-2 gap-x-2"},Cce={class:"grid items-center w-full grid-cols-2 gap-x-2"},Ace={class:"text-sm text-gray-800"},Dce={class:"flex justify-end",role:"progressbar","aria-valuenow":"100","aria-valuemin":"0","aria-valuemax":"100"},Mce={class:"min-w-[60px] text-end"},Ice={class:"text-sm text-gray-500"};function kce(r,e,t,n,i,a){return i.columns?(P.openBlock(),P.createElementBlock("div",wce,[P.createElementVNode("div",Sce,[P.createElementVNode("ul",Tce,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.sourceData,(o,s)=>(P.openBlock(),P.createElementBlock("li",Ece,[P.createElementVNode("div",Cce,[P.createElementVNode("span",Ace,P.toDisplayString(o[i.columns[0]]),1),P.createElementVNode("div",Dce,[P.createElementVNode("div",{class:"h-1.5 flex flex-col justify-center overflow-hidden bg-indigo-500 rounded-full text-xs text-white text-center whitespace-nowrap",style:P.normalizeStyle({width:`${parseFloat(o[i.columns[1]])/i.maxValue*100}%`})},null,4)])]),P.createElementVNode("div",Mce,[P.createElementVNode("span",Ice,P.toDisplayString(a.formattedValue(o[i.columns[1]])),1)])]))),256))])])])):P.createCommentVNode("",!0)}const iC=fr(xce,[["render",kce]]),Lce=Object.freeze(Object.defineProperty({__proto__:null,default:iC},Symbol.toStringTag,{value:"Module"})),Pce={name:"VsListbar",mixins:[Ca],props:["source"],data(){return{restDimensions:[],maxValue:0,columns:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch(r){console.error(r)}},prepareData(){var e,t,n;this.columns=Object.keys(((e=this.sourceData)==null?void 0:e[0])||{});const r=(t=this.sourceData)==null?void 0:t.map(i=>{var a;return i==null?void 0:i[(a=this.columns)==null?void 0:a[1]]});this.maxValue=Math.max(...r||[]),this.restDimensions=(n=this.columns)==null?void 0:n.filter((i,a)=>a!==0)},formattedValue(r){return An(r)},getWidth(r){return`${r/this.maxValue*100}%`}}},Rce={class:"h-full pt-[20px] list-bar"},Nce={class:"space-y-2 custom-scrollbar h-full h-[calc(100%-20px)]"},Oce={class:"relative w-full truncate"},zce={class:"relative z-[1] text-sm block py-1 px-2 w-full text-sm truncate text-gray-800"},Bce={class:"text-[14px] text-gray-500"};function Vce(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",Rce,[P.createElementVNode("ul",Nce,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.sourceData,(o,s)=>{var l,u,d;return P.openBlock(),P.createElementBlock("li",{key:s,class:"flex items-center justify-between w-full gap-x-2"},[P.createElementVNode("div",Oce,[P.createElementVNode("span",zce,P.toDisplayString((o==null?void 0:o[(l=i.columns)==null?void 0:l[0]])||"Без категорії"),1),P.createElementVNode("div",{class:P.normalizeClass(["absolute inset-y-0 h-full rounded start-0",o!=null&&o[(u=i.columns)==null?void 0:u[0]]?"bg-indigo-100":"bg-gray-100"]),style:P.normalizeStyle({width:a.getWidth(o==null?void 0:o[(d=i.columns)==null?void 0:d[1]])})},null,6)]),(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.restDimensions,(f,g)=>(P.openBlock(),P.createElementBlock("div",{key:g,class:"w-20 mr-2 text-end"},[P.createElementVNode("span",Bce,P.toDisplayString(a.formattedValue(o==null?void 0:o[f])),1)]))),128))])}),128))])])}const aC=fr(Pce,[["render",Vce]]),Fce=Object.freeze(Object.defineProperty({__proto__:null,default:aC},Symbol.toStringTag,{value:"Module"})),oC={week:"Тиждень",month:"Місяць",quarter:"Квартал",year:"Рік"},$ce=["onClick"],Gce={class:"flex items-center justify-between w-full"},Uce={key:0},Hce={__name:"vs-bi-dropdown",props:{title:String,options:[Array,String],value:{type:String}},emits:["selected"],setup(r,{emit:e}){const t=r,n=e,i=P.ref(!1),a=P.ref(t.value||null),o=P.ref(null),s=P.computed(()=>typeof t.options=="string"?t.options.split(",").map((m,_)=>({id:_,text:m.trim()})):t.options),l=P.computed(()=>{const m=s.value.find(_=>(_.id||_)===a.value);return m?m.text||m:t.title}),u=m=>{a.value=m.id||m,i.value=!1,n("selected",(m==null?void 0:m.id)||m),document.removeEventListener("click",d)},d=m=>{o.value&&!o.value.contains(m.target)&&(i.value=!1,document.removeEventListener("click",d))},f=()=>{i.value=!i.value,i.value?setTimeout(()=>{document.addEventListener("click",d)},200):document.removeEventListener("click",d)},g=m=>(oC==null?void 0:oC[m])||m;return P.onUnmounted(()=>{document.removeEventListener("click",d)}),(m,_)=>(P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createElementVNode("button",{type:"button","aria-expanded":"true",class:"hs-select-disabled:pointer-events-none hs-select-disabled:opacity-50 relative group pr-2 -ms-2 py-1.5 pl-2.5 inline-flex shrink-0 justify-center items-center gap-x-1.5 text-sm text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 before:absolute before:inset-0 before:z-[1] dark:text-neutral-400 dark:hover:bg-neutral-800 dark:focus:bg-neutral-700",onClick:f},[P.createTextVNode(P.toDisplayString(g(l.value))+" ",1),_[0]||(_[0]=P.createElementVNode("svg",{class:"shrink-0 size-3.5 text-gray-600 dark:text-neutral-400",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[P.createElementVNode("path",{d:"m6 9 6 6 6-6"})],-1))]),i.value?(P.openBlock(),P.createElementBlock("div",{key:0,ref_key:"biDropdown",ref:o,"data-hs-select-dropdown":"",class:"absolute mt-2 z-50 w-48 p-1 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-950 opened",role:"listbox",tabindex:"-1","aria-orientation":"vertical",style:{"margin-top":"10px"}},[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(s.value,x=>(P.openBlock(),P.createElementBlock("div",{key:x.id||x,class:"cursor-pointer selected hs-selected:bg-gray-100 dark:hs-selected:bg-neutral-800 py-1.5 px-2 w-full text-[13px] text-gray-800 rounded-lg hover:bg-gray-100 focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:w=>u(x)},[P.createElementVNode("div",Gce,[P.createElementVNode("span",null,P.toDisplayString(g(x.text||x)),1),a.value===(x.id||x)?(P.openBlock(),P.createElementBlock("span",Uce,_[1]||(_[1]=[P.createElementVNode("svg",{class:"shrink-0 h-3.5 w-3.5 text-gray-800 dark:text-neutral-200",xmlns:"http:.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[P.createElementVNode("polyline",{points:"20 6 9 17 4 12"})],-1)]))):P.createCommentVNode("",!0)])],8,$ce))),128))],512)):P.createCommentVNode("",!0)],64))}},Wce={"bi-bar":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Zue)),"bi-number":P.defineAsyncComponent(()=>Promise.resolve().then(()=>hve)),"bi-text":P.defineAsyncComponent(()=>Promise.resolve().then(()=>vve)),"bi-listbar":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Fce)),"bi-pie":P.defineAsyncComponent(()=>Promise.resolve().then(()=>tce)),"bi-donut":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Kue)),"bi-line":P.defineAsyncComponent(()=>Promise.resolve().then(()=>ace)),"bi-stat":P.defineAsyncComponent(()=>Promise.resolve().then(()=>bce)),"bi-pivot":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Qhe)),"bi-progress":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Lce)),"bi-funnel":P.defineAsyncComponent(()=>Promise.resolve().then(()=>bve)),"bi-map":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Tme)),"bi-cluster":P.defineAsyncComponent(()=>Promise.resolve().then(()=>Zme)),"bi-table":P.defineAsyncComponent(()=>Promise.resolve().then(()=>oye))},qce={class:"flex items-center space-x-2"},Zce=P.defineComponent({__name:"vs-bi-switch",props:P.mergeModels({leftLabel:{},rightLabel:{},modelValue:{type:Boolean}},{modelValue:{default:()=>!1,type:Boolean},modelModifiers:{}}),emits:P.mergeModels(["update:is-enabled"],["update:modelValue"]),setup(r,{emit:e}){const t=e,n=P.useModel(r,"modelValue"),i=()=>{t("update:is-enabled",n)};return(a,o)=>(P.openBlock(),P.createElementBlock("div",qce,[a.leftLabel?(P.openBlock(),P.createElementBlock("div",{key:0,class:P.normalizeClass(["transition-colors",{"text-blue-500":!n.value}])},P.toDisplayString(a.leftLabel),3)):P.createCommentVNode("",!0),P.withDirectives(P.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>n.value=s),type:"checkbox",class:"relative w-11 h-6 p-px bg-gray-100 border-transparent text-transparent rounded-full cursor-pointer transition-colors ease-in-out duration-200 focus:ring-blue-600 disabled:opacity-50 disabled:pointer-events-none checked:bg-none checked:text-blue-600 checked:border-blue-600 focus:checked:border-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-600 before:inline-block before:size-5 before:bg-white checked:before:bg-blue-200 before:translate-x-0 checked:before:translate-x-full before:rounded-full before:shadow before:h-5 before:w-5 before:transform before:ring-0 before:transition before:ease-in-out before:duration-200 dark:before:bg-neutral-400 dark:checked:before:bg-blue-200",onChange:i},null,544),[[P.vModelCheckbox,n.value]]),a.rightLabel?(P.openBlock(),P.createElementBlock("div",{key:1,class:P.normalizeClass(["transition-colors",{"text-blue-500":n.value}])},P.toDisplayString(a.rightLabel),3)):P.createCommentVNode("",!0)]))}}),jce={},Xce={class:"flex items-center justify-center h-full"};function Yce(r,e){return P.openBlock(),P.createElementBlock("div",Xce,e[0]||(e[0]=[P.createElementVNode("div",{class:"text-center text-gray-500"},[P.createElementVNode("h2",{class:"text-2xl font-bold"},"No data available")],-1)]))}const Kce=fr(jce,[["render",Yce]]),Jce={},Qce={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-download"};function ehe(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("svg",Qce,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),P.createElementVNode("path",{d:"M7 11l5 5l5 -5"},null,-1),P.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const the={components:{VsBiDropdown:Hce,VsBiSwitch:Zce,VsNoDataChart:Kce,IconDownload:fr(Jce,[["render",ehe]]),...Wce},props:{dashboard:{type:String},prefix:{type:String,default:""},widget:{type:String},filterURl:{type:String},dashboardWidgets:{type:Object},selectedWidget:{type:String}},data(){return{checked:[],selected:[],currentWidget:null,widgetData:[]}},computed:{computedTitle(){var e,t;const r=(e=this.dashboardWidgets)==null?void 0:e.find(n=>n.name===this.widget);return((t=r==null?void 0:r.data)==null?void 0:t.title)||(r==null?void 0:r.title)||""},computedType(){var e;const r=(e=this.dashboardWidgets)==null?void 0:e.find(t=>t.name===this.widget);return(r==null?void 0:r.type)||"text"},controls(){var e;return Object.keys(((e=this.widgetData)==null?void 0:e.controls)||{}).map(t=>{var n,i,a;return{name:t,options:typeof((n=this.widgetData)==null?void 0:n.controls)=="boolean"?!1:(a=(i=this.widgetData)==null?void 0:i.controls)==null?void 0:a[t]}})}},mounted(){this.prefix&&(_r.defaults.baseURL=this.prefix)},watch:{filterURl(r){var e,t;(t=(e=this.$refs)==null?void 0:e.chart)==null||t.setFilter(r)},selectedWidget(r,e){var t;r!==e&&r===((t=this.widgetData)==null?void 0:t.id)&&this.$emit("update:current-widget-data",this.widgetData)},widgetData(r,e){if((r==null?void 0:r.id)===(e==null?void 0:e.id))return;const n=new URLSearchParams(window.top.location.search).get("widget");n&&n===(r==null?void 0:r.id)&&this.$emit("update:current-widget-data",r)}},methods:{changeStyleHandler(r,e){var t;(t=this.$refs.chart)==null||t.changeStyle(r,e)},selectedOptionHandler(r,e){let t=!0;this.selected.forEach(n=>{n.name===e&&(n.option=r,t=!1)}),t&&this.selected.push({name:e,option:r}),this.makeUpUrl()},makeUpUrl(){var e;let r=`/bi-data?dashboard=${this.dashboard}&widget=${this.widget}`;this.selected.forEach((t,n)=>{r+=`&${t.name}=${t.option}`}),(e=this.$refs.chart)==null||e.getDataFromURL(r)},exportChart(){if(this.currentWidget){const r=this.currentWidget.getDataURL({type:"png",pixelRatio:2,backgroundColor:"#ffffff"}),e=document.createElement("a");e.href=r,e.download="chart.png",document.body.appendChild(e),e.click(),document.body.removeChild(e)}}}},rhe={key:0,class:"text-[16px] flex max-w-full items-center min-h-0 flex justify-between max-h-[50px] h-fit shrink-0"},nhe={class:"flex items-center justify-between w-full"},ihe={class:"grid"},ahe={class:"text-gray-800 max-h-[30px] inline-block text-nowrap font-semibold"},ohe={class:"flex flex-col justify-end"},she={key:0,class:"flex items-center justify-end w-full gap-2"},lhe={class:"w-full h-full"};function uhe(r,e,t,n,i,a){var d,f,g,m,_,x,w,C,A;const o=P.resolveComponent("VsBiDropdown"),s=P.resolveComponent("VsBiSwitch"),l=P.resolveComponent("IconDownload"),u=P.resolveComponent("VsNoDataChart");return P.openBlock(),P.createElementBlock("div",{ref:"widget",class:P.normalizeClass(["box-border relative h-full p-4 bg-white border border-gray-200 select-auto rounded-xl",[(f=(d=i.widgetData)==null?void 0:d.style)!=null&&f.height?`max-h-[${(m=(g=i.widgetData)==null?void 0:g.style)==null?void 0:m.height}px] h-[${(x=(_=i.widgetData)==null?void 0:_.style)==null?void 0:x.height}px]`:"max-h-[460px]"]])},[["text","cluster","map"].includes(a.computedType)?P.createCommentVNode("",!0):(P.openBlock(),P.createElementBlock("div",rhe,[P.createElementVNode("div",nhe,[P.createElementVNode("div",ihe,[P.createElementVNode("span",ahe,P.toDisplayString(a.computedTitle),1)]),P.createElementVNode("div",ohe,[(w=a.controls)!=null&&w.length?(P.openBlock(),P.createElementBlock("span",she,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList((C=a.controls)==null?void 0:C.filter(L=>(L==null?void 0:L.options)&&(L==null?void 0:L.name)!=="export"),L=>{var O;return P.openBlock(),P.createElementBlock("div",null,[Array.isArray(L==null?void 0:L.options)?(P.openBlock(),P.createBlock(o,{key:0,title:L==null?void 0:L.name,options:L==null?void 0:L.options,value:(O=i.widgetData)==null?void 0:O.data[L==null?void 0:L.name],onSelected:V=>a.selectedOptionHandler(V,L==null?void 0:L.name)},null,8,["title","options","value","onSelected"])):typeof L.options=="boolean"?(P.openBlock(),P.createBlock(s,{key:1,"left-label":L==null?void 0:L.name,"is-enabled":L==null?void 0:L.options,"onUpdate:isEnabled":V=>a.changeStyleHandler(L==null?void 0:L.name,V)},null,8,["left-label","is-enabled","onUpdate:isEnabled"])):P.createCommentVNode("",!0)])}),256)),(A=a.controls)!=null&&A.some(L=>(L==null?void 0:L.name)==="export")?(P.openBlock(),P.createElementBlock("button",{key:0,onClick:e[0]||(e[0]=(...L)=>a.exportChart&&a.exportChart(...L)),class:"h-[32px] w-[32px] rounded-lg hover:bg-gray-100 duration-100 flex items-center justify-center"},[P.createVNode(l,{height:"16",width:"16",class:"text-gray-800"})])):P.createCommentVNode("",!0)])):P.createCommentVNode("",!0)])])])),P.createElementVNode("div",lhe,[i.widgetData?(P.openBlock(),P.createBlock(P.resolveDynamicComponent("bi-"+a.computedType),{key:0,currentWidget:i.currentWidget,"onUpdate:currentWidget":e[1]||(e[1]=L=>i.currentWidget=L),widgetData:i.widgetData,"onUpdate:widgetData":e[2]||(e[2]=L=>i.widgetData=L),ref:"chart",dashboard:t.dashboard,title:a.computedTitle,widget:t.widget},null,40,["currentWidget","widgetData","dashboard","title","widget"])):(P.openBlock(),P.createBlock(u,{key:1,class:"w-full h-full"}))])],2)}const rv=fr(the,[["render",uhe]]),che={props:{title:{type:String,default:()=>"Дані для відображення відсутні"},text:{type:String,default:()=>"Змініть параметри пошуку або спробуйте пізніше"}}},hhe={class:"w-full overflow-hidden rounded vs-table-interface__table-wrp h-fit"},dhe={class:"p-5 min-h-[500px] flex flex-col justify-center items-center text-center"},fhe={class:"max-w-sm mx-auto mt-6"},phe={class:"font-medium text-gray-800 dark:text-neutral-200"},ghe={class:"mt-2 text-sm text-gray-500 dark:text-neutral-500"};function vhe(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",hhe,[P.createElementVNode("div",null,[P.createElementVNode("div",dhe,[e[0]||(e[0]=P.createStaticVNode('',1)),P.createElementVNode("div",fhe,[P.createElementVNode("p",phe,P.toDisplayString(t.title),1),P.createElementVNode("p",ghe,P.toDisplayString(t.text),1)])])])])}const j0=fr(che,[["render",vhe]]),mhe={},yhe={class:"flex-shrink-0 size-3.5",xmlns:"http://www.w3.org/2000/svg",width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function _he(r,e){return P.openBlock(),P.createElementBlock("svg",yhe,e[0]||(e[0]=[P.createStaticVNode('',9)]))}const bhe=fr(mhe,[["render",_he]]),xhe={},whe={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-refresh"};function She(r,e){return P.openBlock(),P.createElementBlock("svg",whe,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4"},null,-1),P.createElementVNode("path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"},null,-1)]))}const The={components:{filterIcon:bhe,refreshIcon:fr(xhe,[["render",She]])},props:["filterScheme"],emits:["filters:changed"],data(){return{rows:[],isFilterVisible:!1,rowList:[],activeFilters:"",filters:{}}},async mounted(){const e=await(await new URLSearchParams(window.top.location.search)).get("filter");this.filters.url=e||""},computed:{activeFiltersCount(){var r,e;return(r=this.filters)!=null&&r.url?((e=this.filters)==null?void 0:e.url.split("=").length)-1:0}},methods:{toggleFilterShown(){this.isFilterVisible=!this.isFilterVisible},handleFilterChange(r){var e,t;this.filters=r,this.activeFilters=(t=(e=this.$refs)==null?void 0:e.filter)==null?void 0:t.activeFilters,this.$emit("filters:changed",this.filters)},resetFilters(){this.$refs.filter&&this.$refs.filter.clearAll(),this.isFilterVisible=!1,this.$emit("filters:changed",""),this.activeFilters=null},closeFilter({target:r}){this.isFilterVisible&&r.classList.contains("filter-container")&&(this.isFilterVisible=!1)}}},Ehe={class:"flex items-center"},Che={key:0,class:"font-medium text-[10px] min-w-[16px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full"};function Ahe(r,e,t,n,i,a){const o=P.resolveComponent("filterIcon"),s=P.resolveComponent("VsFilterList");return P.openBlock(),P.createElementBlock("div",Ehe,[t.filterScheme?(P.openBlock(),P.createBlock(s,{key:0,ref:"filter",scheme:t.filterScheme,closeFilterBtn:!0,onFilterClose:e[1]||(e[1]=l=>i.isFilterVisible=!1),layout:"default","apply-vue-router":"",history:"",view:"plain",token:r.table,name:"filter",footer:!0,background:!0,onFilterChange:a.handleFilterChange},{button:P.withCtx(()=>[P.createElementVNode("button",{type:"button",class:"py-2 px-2.5 ml-3 h-[38px] inline-flex items-center gap-x-1.5 text-xs font-medium rounded-lg border border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50",onClick:e[0]||(e[0]=(...l)=>a.toggleFilterShown&&a.toggleFilterShown(...l))},[P.createVNode(o),e[2]||(e[2]=P.createTextVNode(" Фільтри ")),a.activeFiltersCount>=1?(P.openBlock(),P.createElementBlock("span",Che,P.toDisplayString(a.activeFiltersCount),1)):P.createCommentVNode("",!0)])]),_:1},8,["scheme","token","onFilterChange"])):P.createCommentVNode("",!0)])}const Dhe={props:["dashboardData","filters"],components:{VsFilterHeader:fr(The,[["render",Ahe]])}},Mhe={class:"bg-white px-5 flex gap-4 h-[90px] border border-gray-200 mt-2 rounded-xl mb-2 pt-[3px] justify-between items-center"},Ihe={class:"grow"},khe={class:"text-lg font-semibold text-stone-800 dark:text-neutral-200"},Lhe={type:"button",class:"inline-flex items-center text-sm gap-x-2 text-stone-800 hover:text-stone-500 focus:outline-none focus:text-stone-500 dark:text-neutral-200 dark:hover:text-neutral-400 dark:focus:text-neutral-400","data-clipboard-target":"#hs-erc","data-clipboard-action":"copy","data-clipboard-success-text":"Copied"};function Phe(r,e,t,n,i,a){var s,l;const o=P.resolveComponent("VsFilterHeader");return P.openBlock(),P.createElementBlock("div",Mhe,[P.createElementVNode("div",Ihe,[P.createElementVNode("h1",khe,P.toDisplayString((s=t.dashboardData)==null?void 0:s.title),1),P.createElementVNode("button",Lhe,P.toDisplayString((l=t.dashboardData)==null?void 0:l.description),1)]),P.createVNode(o,{filterScheme:t.filters,"onFilters:changed":e[0]||(e[0]=u=>r.$emit("filters:changed",u))},null,8,["filterScheme"])])}const Rhe={components:{VsWidget:rv,VsNewNodata:j0,VsHeader:fr(Dhe,[["render",Phe]])},props:["id","prefix"],data(){return{widgets:[],panels:[],error:!1,selectedPanel:"",filterURl:null,dashboardData:null}},async mounted(){_r.defaults.baseURL=this.prefix||"/api",await this.fetchData()},methods:{async fetchData(){if(this.id)try{const{data:r}=await _r.get(`/bi-dashboard/${this.id}`);this.dashboardData=r}catch(r){console.error(r)}},columnClass(r){const e=r!=null&&r.col?r==null?void 0:r.col:12;return{1:"md:w-1/12 sm:w-full",2:"md:w-1/6 sm:w-full",3:"md:w-1/4 sm:w-full",4:"md:w-1/3 sm:w-full",6:"md:w-1/2 sm:w-full",8:"md:w-2/3 sm:w-full",10:"md:w-5/6 sm:w-full",12:"w-full"}[e]||"w-full"},async filterHandler(r){var t;this.filterURl="";let e="&filter=";(t=r==null?void 0:r.url)!=null&&t.length&&(r.url.split("|").forEach(i=>{const a=i.split("=");e+=`${a[0]}=${a[1]}`}),this.filterURl+=e)}}},Nhe={class:"w-full pb-8 overflow-y-auto"},Ohe={class:"grid flex-grow w-full grid-cols-12 gap-4 h-fit"};function zhe(r,e,t,n,i,a){var u,d,f;const o=P.resolveComponent("VsHeader"),s=P.resolveComponent("VsNewNodata"),l=P.resolveComponent("VsWidget");return P.openBlock(),P.createElementBlock("div",Nhe,[P.createElementVNode("div",null,[(u=i.dashboardData)!=null&&u.filters?(P.openBlock(),P.createBlock(o,{key:0,filters:(d=i.dashboardData)==null?void 0:d.filters,dashboardData:i.dashboardData,"onFilters:changed":e[0]||(e[0]=g=>a.filterHandler(g))},null,8,["filters","dashboardData"])):P.createCommentVNode("",!0)]),P.createElementVNode("div",Ohe,[i.error||!i.dashboardData?(P.openBlock(),P.createBlock(s,{key:0,class:"col-span-12"})):P.createCommentVNode("",!0),(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(((f=i.dashboardData)==null?void 0:f.panels)||[],(g,m)=>{var _;return P.openBlock(),P.createElementBlock("div",{key:m,class:P.normalizeClass([`col-span-${g.col||12}`,"flex flex-col gap-[10px]"])},[(_=g.widgets)!=null&&_.length?(P.openBlock(!0),P.createElementBlock(P.Fragment,{key:0},P.renderList(g.widgets,x=>(P.openBlock(),P.createBlock(l,{key:x,dashboard:t.id,widget:x,"dashboard-widgets":i.dashboardData.widgets,"filter-u-rl":i.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))),128)):(P.openBlock(),P.createBlock(l,{key:1,class:"flex flex-col",dashboard:t.id,widget:g.widget,"dashboard-widgets":i.dashboardData.widgets,"filter-u-rl":i.filterURl},null,8,["dashboard","widget","dashboard-widgets","filter-u-rl"]))],2)}),128))])])}const sC=fr(Rhe,[["render",zhe]]),Bhe={name:"VsPivotTable",mixins:[Ca],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>rs(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>An(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},Vhe={class:"flex flex-col h-full p-5 space-y-4 rounded-xl custom-scrollbar"},Fhe={class:"overflow-x-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 custom-scrollbar"},$he={class:"inline-block min-w-full align-middle"},Ghe={class:"min-w-full divide-y divide-gray-200"},Uhe={class:"space-x-2"},Hhe={scope:"col",class:"xl:min-w-[120px] min-w-48"},Whe={class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"},qhe={class:"divide-y divide-gray-200 text-[12px]"},Zhe={class:"py-3 size-px whitespace-nowrap"},jhe={class:"flex items-center gap-x-3"},Xhe={class:"font-medium text-gray-800"},Yhe={class:"py-3 size-px whitespace-nowrap"},Khe={class:"text-gray-600"};function Jhe(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",Vhe,[P.createElementVNode("div",Fhe,[P.createElementVNode("div",$he,[P.createElementVNode("table",Ghe,[P.createElementVNode("thead",null,[P.createElementVNode("tr",Uhe,[e[0]||(e[0]=P.createElementVNode("th",{scope:"col",class:"min-w-[200px]"},[P.createElementVNode("div",{class:"py-2.5 text-text-start flex items-center gap-x-1 text-sm font-normal text-gray-500"})],-1)),(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.xs,o=>(P.openBlock(),P.createElementBlock("th",Hhe,[P.createElementVNode("div",Whe,P.toDisplayString(o),1)]))),256))])]),(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.values,o=>(P.openBlock(),P.createElementBlock("tbody",qhe,[P.createElementVNode("tr",null,[P.createElementVNode("td",Zhe,[P.createElementVNode("div",jhe,[P.createElementVNode("span",Xhe,P.toDisplayString(o.name),1)])]),(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.xs,(s,l)=>(P.openBlock(),P.createElementBlock("td",Yhe,[P.createElementVNode("span",Khe,P.toDisplayString(o.data[l]),1)]))),256))])]))),256))])])])])}const lC=fr(Bhe,[["render",Jhe]]),Qhe=Object.freeze(Object.defineProperty({__proto__:null,default:lC},Symbol.toStringTag,{value:"Module"})),ede={},tde={width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function rde(r,e){return P.openBlock(),P.createElementBlock("svg",tde,e[0]||(e[0]=[P.createElementVNode("path",{d:"M3.3335 8H12.6668",stroke:"#1E40AF","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),P.createElementVNode("path",{d:"M8 3.33325V12.6666",stroke:"#1E40AF","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const nde=fr(ede,[["render",rde]]),ide={},ade={width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:"mr-3"};function ode(r,e){return P.openBlock(),P.createElementBlock("svg",ade,e[0]||(e[0]=[P.createElementVNode("path",{d:"M6.41667 11.0833C8.994 11.0833 11.0833 8.994 11.0833 6.41667C11.0833 3.83934 8.994 1.75 6.41667 1.75C3.83934 1.75 1.75 3.83934 1.75 6.41667C1.75 8.994 3.83934 11.0833 6.41667 11.0833Z",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1),P.createElementVNode("path",{d:"M12.25 12.25L9.7417 9.7417",stroke:"#6B7280","stroke-linecap":"round","stroke-linejoin":"round"},null,-1)]))}const v4=fr(ide,[["render",ode]]),sde={},lde={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-upload"};function ude(r,e){return P.openBlock(),P.createElementBlock("svg",lde,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2"},null,-1),P.createElementVNode("path",{d:"M7 9l5 -5l5 5"},null,-1),P.createElementVNode("path",{d:"M12 4l0 12"},null,-1)]))}const cde=fr(sde,[["render",ude]]),hde={},dde={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-lock"};function fde(r,e){return P.openBlock(),P.createElementBlock("svg",dde,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z"},null,-1),P.createElementVNode("path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0"},null,-1),P.createElementVNode("path",{d:"M8 11v-4a4 4 0 1 1 8 0v4"},null,-1)]))}const pde=fr(hde,[["render",fde]]),gde=[{type:"Text",key:"name",label:"Назва",validators:["required"],original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"title",label:"Заголовок",validators:["required"],original:{type:"Text",ua:"Титул",col:8}},{type:"Text",key:"description",label:"Опис",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"words",label:"Ключові слова",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці",original:{type:"Text",ua:"Назва",col:8}},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}],vde={components:{plusIcon:nde,searchIcon:v4,IconLock:pde,IconImport:cde},props:["selectedDashboard","prefix"],emits:["update:selectedDashboard","add","update"],mounted(){_r.defaults.baseURL=this.prefix||"/api",this.getFileItems(),this.getList()},data(){return{searchQuery:"",scheme:null,formValues:{},formCreateValues:{},isVisible:!1,isVisibleFormDashboard:!1,fileItems:null,list:null,addDashboardForm:gde}},methods:{async getFileItems(){var r;try{const{data:e}=await _r.get("/bi-dashboard?type=file");this.scheme={dashboard:{type:"Checkbox",ua:"Дашборди",options:(r=e==null?void 0:e.rows)==null?void 0:r.map(({name:t,title:n})=>({id:t,text:n}))}}}catch{}},async getList(){try{const{data:r}=await _r.get("/bi-dashboard?type=db");this.list=r.rows.filter(e=>e.type==="db")}catch(r){console.error(r)}},async dashboardImport(){try{await _r.get(`/bi-dashboard-import?dashboard=${this.formValues.dashboard}`),this.isVisible=!1,this.formValues={},this.$notify({type:"success",title:"Успішно!",message:"Дашборд імпортовано успішно"}),this.getList()}catch{this.$notify({type:"error",title:"Помилка!",message:"При спробі імпортувати дашборд виникла помилка"})}},async createDashboard(){try{await this.$refs.form.doValidation(),await _r.post("/bi-dashboard",this.formCreateValues),this.isVisibleFormDashboard=!1,this.formCreateValues={},this.$notify({type:"success",title:"Успішно!",message:"Дашборд створено успішно"}),this.getList()}catch{this.$notify({type:"error",title:"Помилка!",message:"При спробі створити дашборд виникла помилка"})}}},computed:{filteredList(){var e;const r=this.searchQuery.toLowerCase();return(e=this.list)==null?void 0:e.filter(t=>(t==null?void 0:t.title)&&(t==null?void 0:t.title.toLowerCase().includes(r))||(t==null?void 0:t.name)&&(t==null?void 0:t.name.toLowerCase().includes(r)))}}},mde={class:"h-full w-[300px] shrink-0 bg-white border-r border-gray-200 flex flex-col"},yde={class:"flex h-[49px] border-b justify-between px-[16px] items-center"},_de={class:"flex items-center gap-2"},bde={class:"flex items-center gap-2 px-[10px] py-2"},xde={class:"relative w-full"},wde={class:"px-[10px] flex flex-col gap-[2px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},Sde=["item","onClick"],Tde={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Ede={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function Cde(r,e,t,n,i,a){const o=P.resolveComponent("IconImport"),s=P.resolveComponent("VsPopover"),l=P.resolveComponent("plusIcon"),u=P.resolveComponent("IconLock"),d=P.resolveComponent("VsForm"),f=P.resolveComponent("VsDialog");return P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createElementVNode("div",mde,[P.createElementVNode("div",yde,[e[13]||(e[13]=P.createElementVNode("div",{class:"text-[20px]"},[P.createTextVNode("Editor "),P.createElementVNode("span",{class:"text-[#666666]"})],-1)),P.createElementVNode("div",_de,[P.createVNode(s,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"bg-[#DBEAFE] h-[38px] text-blue-500 w-[38px] flex items-center hover:bg-blue-300 duration-300 justify-center rounded-lg shrink-0",onClick:e[0]||(e[0]=g=>i.isVisible=!0)},[P.createVNode(o,{height:"18",width:"18"})])]),default:P.withCtx(()=>[e[11]||(e[11]=P.createTextVNode(" Імпортувати дашборд "))]),_:1,__:[11]}),P.createVNode(s,{placement:"right",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"bg-[#DBEAFE] h-[38px] w-[38px] flex items-center hover:bg-blue-300 duration-300 justify-center rounded-lg shrink-0",onClick:e[1]||(e[1]=g=>i.isVisibleFormDashboard=!0)},[P.createVNode(l)])]),default:P.withCtx(()=>[e[12]||(e[12]=P.createTextVNode(" Створити дашборд "))]),_:1,__:[12]})])]),P.createElementVNode("div",bde,[P.createElementVNode("div",xde,[P.withDirectives(P.createElementVNode("input",{"onUpdate:modelValue":e[2]||(e[2]=g=>i.searchQuery=g),class:"flex-1 text-[13px] w-full h-[38px] px-3 text-gray-800 rounded-lg !border-none bg-gray-100 placeholder-gray-800 focus:outline-2 focus:outline-blue-600",placeholder:"Пошук..."},null,512),[[P.vModelText,i.searchQuery]])])]),P.createElementVNode("div",wde,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(a.filteredList,(g,m)=>(P.openBlock(),P.createElementBlock("div",{key:m,item:g,class:P.normalizeClass(["flex items-center cursor-pointer hover:bg-[#F3F4F6] py-1.5 px-2 text-[13px] text-gray-800 rounded-lg",{"bg-gray-100 outline-none":g.name===t.selectedDashboard}]),onClick:_=>r.$emit("update:selectedDashboard",g==null?void 0:g.name)},[P.createTextVNode(P.toDisplayString((g==null?void 0:g.title)||(g==null?void 0:g.name))+" ",1),g!=null&&g.public?P.createCommentVNode("",!0):(P.openBlock(),P.createBlock(u,{key:0,height:"12",width:"12",class:"ml-1 shrink-0"}))],10,Sde))),128))])]),P.createVNode(f,{visible:i.isVisible,"onUpdate:visible":e[6]||(e[6]=g=>i.isVisible=g),title:"Імпортувати"},{footer:P.withCtx(()=>[P.createElementVNode("div",Tde,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[4]||(e[4]=g=>i.isVisible=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:e[5]||(e[5]=(...g)=>a.dashboardImport&&a.dashboardImport(...g)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Імпортувати ")])]),default:P.withCtx(()=>{var g;return[P.createTextVNode(P.toDisplayString((g=i.fileItems)==null?void 0:g.map(({name:m,title:_})=>({value:m,text:_})))+" ",1),P.createVNode(d,{scheme:i.scheme,modelValue:i.formValues,"onUpdate:modelValue":e[3]||(e[3]=m=>i.formValues=m)},null,8,["scheme","modelValue"])]}),_:1},8,["visible"]),P.createVNode(f,{visible:i.isVisibleFormDashboard,"onUpdate:visible":e[10]||(e[10]=g=>i.isVisibleFormDashboard=g),title:"Створити дашборд"},{footer:P.withCtx(()=>[P.createElementVNode("div",Ede,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[8]||(e[8]=g=>i.isVisibleFormDashboard=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:e[9]||(e[9]=(...g)=>a.createDashboard&&a.createDashboard(...g)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:P.withCtx(()=>[P.createVNode(d,{ref:"form",scheme:i.addDashboardForm,modelValue:i.formCreateValues,"onUpdate:modelValue":e[7]||(e[7]=g=>i.formCreateValues=g)},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}const Ade=fr(vde,[["render",Cde]]),Dde={},Mde={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-trash"};function Ide(r,e){return P.openBlock(),P.createElementBlock("svg",Mde,e[0]||(e[0]=[P.createStaticVNode('',6)]))}const m4=fr(Dde,[["render",Ide]]),kde={},Lde={class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"};function Pde(r,e){return P.openBlock(),P.createElementBlock("svg",Lde,e[0]||(e[0]=[P.createElementVNode("path",{d:"M18 6 6 18"},null,-1),P.createElementVNode("path",{d:"m6 6 12 12"},null,-1)]))}const uC=fr(kde,[["render",Pde]]),Rde={},Nde={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-edit"};function Ode(r,e){return P.openBlock(),P.createElementBlock("svg",Nde,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1"},null,-1),P.createElementVNode("path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z"},null,-1),P.createElementVNode("path",{d:"M16 5l3 3"},null,-1)]))}const y4=fr(Rde,[["render",Ode]]),zde={class:"pt-[10px]"},Bde={__name:"vs-editor-form-style",props:{widgetName:{type:String},data:{type:Object,default:()=>{}}},setup(r){var g,m,_,x,w,C;const{$notify:e}=P.getCurrentInstance().proxy,t=r,n=P.ref(null),i={show:{label:"Label",type:"switcher",title:"Show label"},rotate:{type:"number",label:"Rotate angel",conditions:["show","==",!0]},align:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"center",text:"Center"},{id:"left",text:"Left"},{id:"right",text:"Right"}]},position:{type:"radio",view:"buttons",style:{size:"xs"},conditions:["show","==",!0],options:[{id:"top",text:"Top"},{id:"right",text:"Right"},{id:"left",text:"Left"},{id:"bottom",text:"Bottom"}]}},a={show:{label:"Legend",type:"switcher",title:"Show legend"}},o={show:{label:"Tooltip ",type:"switcher",title:"Show tooltip"}},s=P.ref({...((m=(g=t.data)==null?void 0:g.style)==null?void 0:m.label)||{}}),l=P.ref({...((x=(_=t.data)==null?void 0:_.style)==null?void 0:x.legend)||{}}),u=P.ref({...((C=(w=t.data)==null?void 0:w.style)==null?void 0:C.tooltip)||{}}),d=()=>{const A=new CustomEvent(`update-style-${t.widgetName}`);A.chartId=t.widgetName,A.options={options:{legend:l.value,tooltip:u.value,label:s.value},seriesOptions:s.value},window.dispatchEvent(A)};P.watch(s,d,{deep:!0}),P.watch(l,d,{deep:!0}),P.watch(u,d,{deep:!0});const f=async()=>{try{await _r.put(`/bi-dashboard/${n.value}/${t.widgetName}`,{style:{legend:l.value,tooltip:u.value,label:s.value}});const A=new CustomEvent(`update-style-${t.widgetName}`);A.chartId=t.widgetName,A.options={options:{legend:l.value,tooltip:u.value,label:s.value},seriesOptions:s.value},window.dispatchEvent(A),await e({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{await e({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return P.onMounted(()=>{const A=new URLSearchParams(window.top.location.search);n.value=A.get("dashboard")}),(A,L)=>{const O=P.resolveComponent("VsButton"),V=P.resolveComponent("VsForm");return P.openBlock(),P.createElementBlock("div",zde,[P.createVNode(O,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:f},{default:P.withCtx(()=>L[3]||(L[3]=[P.createTextVNode(" Зберегти ")])),_:1,__:[3]}),P.createVNode(V,{scheme:i,modelValue:s.value,"onUpdate:modelValue":L[0]||(L[0]=F=>s.value=F),class:"p-0"},null,8,["modelValue"]),P.createVNode(V,{scheme:a,modelValue:l.value,"onUpdate:modelValue":L[1]||(L[1]=F=>l.value=F),class:"p-0"},null,8,["modelValue"]),P.createVNode(V,{scheme:o,modelValue:u.value,"onUpdate:modelValue":L[2]||(L[2]=F=>u.value=F),class:"p-0"},null,8,["modelValue"])])}}};function cC(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let lh=cC();function _4(r){lh=r}const b4=/[&<>"']/,Vde=new RegExp(b4.source,"g"),x4=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,Fde=new RegExp(x4.source,"g"),$de={"&":"&","<":"<",">":">",'"':""","'":"'"},w4=r=>$de[r];function Ha(r,e){if(e){if(b4.test(r))return r.replace(Vde,w4)}else if(x4.test(r))return r.replace(Fde,w4);return r}const Gde=/(^|[^\[])\^/g;function dn(r,e){let t=typeof r=="string"?r:r.source;e=e||"";const n={replace:(i,a)=>{let o=typeof a=="string"?a:a.source;return o=o.replace(Gde,"$1"),t=t.replace(i,o),n},getRegex:()=>new RegExp(t,e)};return n}function S4(r){try{r=encodeURI(r).replace(/%25/g,"%")}catch{return null}return r}const nv={exec:()=>null};function T4(r,e){const t=r.replace(/\|/g,(a,o,s)=>{let l=!1,u=o;for(;--u>=0&&s[u]==="\\";)l=!l;return l?"|":" |"}),n=t.split(/ \|/);let i=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length{const a=i.match(/^\s+/);if(a===null)return i;const[o]=a;return o.length>=n.length?i.slice(n.length):i}).join(` `)}class X0{constructor(e){bn(this,"options");bn(this,"rules");bn(this,"lexer");this.options=e||lh}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const n=t[0].replace(/^(?: {1,4}| {0,3}\t)/gm,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?n:iv(n,` `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const n=t[0],i=Hde(n,t[3]||"");return{type:"code",raw:n,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:i}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let n=t[2].trim();if(/#$/.test(n)){const i=iv(n,"#");(this.options.pedantic||!i||/ $/.test(i))&&(n=i.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:iv(t[0],` `)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let n=iv(t[0],` `).split(` `),i="",a="";const o=[];for(;n.length>0;){let s=!1;const l=[];let u;for(u=0;u/.test(n[u]))l.push(n[u]),s=!0;else if(!s)l.push(n[u]);else break;n=n.slice(u);const d=l.join(` `),f=d.replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,` $1`).replace(/^ {0,3}>[ \t]?/gm,"");i=i?`${i} ${d}`:d,a=a?`${a} ${f}`:f;const g=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=g,n.length===0)break;const m=o[o.length-1];if((m==null?void 0:m.type)==="code")break;if((m==null?void 0:m.type)==="blockquote"){const _=m,x=_.raw+` `+n.join(` `),w=this.blockquote(x);o[o.length-1]=w,i=i.substring(0,i.length-_.raw.length)+w.raw,a=a.substring(0,a.length-_.text.length)+w.text;break}else if((m==null?void 0:m.type)==="list"){const _=m,x=_.raw+` `+n.join(` `),w=this.list(x);o[o.length-1]=w,i=i.substring(0,i.length-m.raw.length)+w.raw,a=a.substring(0,a.length-_.raw.length)+w.raw,n=x.substring(o[o.length-1].raw.length).split(` `);continue}}return{type:"blockquote",raw:i,tokens:o,text:a}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim();const i=n.length>1,a={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");const o=new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`);let s=!1;for(;e;){let l=!1,u="",d="";if(!(t=o.exec(e))||this.rules.block.hr.test(e))break;u=t[0],e=e.substring(u.length);let f=t[2].split(` `,1)[0].replace(/^\t+/,C=>" ".repeat(3*C.length)),g=e.split(` `,1)[0],m=!f.trim(),_=0;if(this.options.pedantic?(_=2,d=f.trimStart()):m?_=t[1].length+1:(_=t[2].search(/[^ ]/),_=_>4?1:_,d=f.slice(_),_+=t[1].length),m&&/^[ \t]*$/.test(g)&&(u+=g+` `,e=e.substring(g.length+1),l=!0),!l){const C=new RegExp(`^ {0,${Math.min(3,_-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),A=new RegExp(`^ {0,${Math.min(3,_-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),L=new RegExp(`^ {0,${Math.min(3,_-1)}}(?:\`\`\`|~~~)`),O=new RegExp(`^ {0,${Math.min(3,_-1)}}#`),V=new RegExp(`^ {0,${Math.min(3,_-1)}}<(?:[a-z].*>|!--)`,"i");for(;e;){const F=e.split(` `,1)[0];let $;if(g=F,this.options.pedantic?(g=g.replace(/^ {1,4}(?=( {4})*[^ ])/g," "),$=g):$=g.replace(/\t/g," "),L.test(g)||O.test(g)||V.test(g)||C.test(g)||A.test(g))break;if($.search(/[^ ]/)>=_||!g.trim())d+=` `+$.slice(_);else{if(m||f.replace(/\t/g," ").search(/[^ ]/)>=4||L.test(f)||O.test(f)||A.test(f))break;d+=` `+g}!m&&!g.trim()&&(m=!0),u+=F+` `,e=e.substring(F.length+1),f=$.slice(_)}}a.loose||(s?a.loose=!0:/\n[ \t]*\n[ \t]*$/.test(u)&&(s=!0));let x=null,w;this.options.gfm&&(x=/^\[[ xX]\] /.exec(d),x&&(w=x[0]!=="[ ] ",d=d.replace(/^\[[ xX]\] +/,""))),a.items.push({type:"list_item",raw:u,task:!!x,checked:w,loose:!1,text:d,tokens:[]}),a.raw+=u}a.items[a.items.length-1].raw=a.items[a.items.length-1].raw.trimEnd(),a.items[a.items.length-1].text=a.items[a.items.length-1].text.trimEnd(),a.raw=a.raw.trimEnd();for(let l=0;lf.type==="space"),d=u.length>0&&u.some(f=>/\n.*\n/.test(f.raw));a.loose=d}if(a.loose)for(let l=0;l$/,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",a=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:n,raw:t[0],href:i,title:a}}}table(e){const t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;const n=T4(t[1]),i=t[2].replace(/^\||\| *$/g,"").split("|"),a=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,"").split(` `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(const s of i)/^ *-+: *$/.test(s)?o.align.push("right"):/^ *:-+: *$/.test(s)?o.align.push("center"):/^ *:-+ *$/.test(s)?o.align.push("left"):o.align.push(null);for(let s=0;s({text:l,tokens:this.lexer.inline(l),header:!1,align:o.align[u]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const n=t[1].charAt(t[1].length-1)===` `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:n,tokens:this.lexer.inline(n)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:Ha(t[1])}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const n=t[2].trim();if(!this.options.pedantic&&/^$/.test(n))return;const o=iv(n.slice(0,-1),"\\");if((n.length-o.length)%2===0)return}else{const o=Ude(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let i=t[2],a="";if(this.options.pedantic){const o=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(i);o&&(i=o[1],a=o[3])}else a=t[3]?t[3].slice(1,-1):"";return i=i.trim(),/^$/.test(n)?i=i.slice(1):i=i.slice(1,-1)),E4(t,{href:i&&i.replace(this.rules.inline.anyPunctuation,"$1"),title:a&&a.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){const i=(n[2]||n[1]).replace(/\s+/g," "),a=t[i.toLowerCase()];if(!a){const o=n[0].charAt(0);return{type:"text",raw:o,text:o}}return E4(n,a,n[0],this.lexer)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!i||i[3]&&n.match(/[\p{L}\p{N}]/u))return;if(!(i[1]||i[2]||"")||!n||this.rules.inline.punctuation.exec(n)){const o=[...i[0]].length-1;let s,l,u=o,d=0;const f=i[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(f.lastIndex=0,t=t.slice(-1*e.length+o);(i=f.exec(t))!=null;){if(s=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!s)continue;if(l=[...s].length,i[3]||i[4]){u+=l;continue}else if((i[5]||i[6])&&o%3&&!((o+l)%3)){d+=l;continue}if(u-=l,u>0)continue;l=Math.min(l,l+u+d);const g=[...i[0]][0].length,m=e.slice(0,o+i.index+g+l);if(Math.min(o,l)%2){const x=m.slice(1,-1);return{type:"em",raw:m,text:x,tokens:this.lexer.inlineTokens(x)}}const _=m.slice(2,-2);return{type:"strong",raw:m,text:_,tokens:this.lexer.inlineTokens(_)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let n=t[2].replace(/\n/g," ");const i=/[^ ]/.test(n),a=/^ /.test(n)&&/ $/.test(n);return i&&a&&(n=n.substring(1,n.length-1)),n=Ha(n,!0),{type:"codespan",raw:t[0],text:n}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let n,i;return t[2]==="@"?(n=Ha(t[1]),i="mailto:"+n):(n=Ha(t[1]),i=n),{type:"link",raw:t[0],text:n,href:i,tokens:[{type:"text",raw:n,text:n}]}}}url(e){var n;let t;if(t=this.rules.inline.url.exec(e)){let i,a;if(t[2]==="@")i=Ha(t[0]),a="mailto:"+i;else{let o;do o=t[0],t[0]=((n=this.rules.inline._backpedal.exec(t[0]))==null?void 0:n[0])??"";while(o!==t[0]);i=Ha(t[0]),t[1]==="www."?a="http://"+t[0]:a=t[0]}return{type:"link",raw:t[0],text:i,href:a,tokens:[{type:"text",raw:i,text:i}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){let n;return this.lexer.state.inRawBlock?n=t[0]:n=Ha(t[0]),{type:"text",raw:t[0],text:n}}}}const Wde=/^(?:[ \t]*(?:\n|$))+/,qde=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Zde=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,av=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,jde=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,C4=/(?:[*+-]|\d{1,9}[.)])/,A4=dn(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,C4).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),hC=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xde=/^[^\n]+/,dC=/(?!\s*\])(?:\\.|[^\[\]\\])+/,Yde=dn(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",dC).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Kde=dn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,C4).getRegex(),Y0="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",fC=/|$))/,Jde=dn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|\\n*|$)|\\n*|$)|)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",fC).replace("tag",Y0).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),D4=dn(hC).replace("hr",av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y0).getRegex(),pC={blockquote:dn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",D4).getRegex(),code:qde,def:Yde,fences:Zde,heading:jde,hr:av,html:Jde,lheading:A4,list:Kde,newline:Wde,paragraph:D4,table:nv,text:Xde},M4=dn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y0).getRegex(),Qde={...pC,table:M4,paragraph:dn(hC).replace("hr",av).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",M4).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|textarea|!--)").replace("tag",Y0).getRegex()},efe={...pC,html:dn(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",fC).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:nv,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:dn(hC).replace("hr",av).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",A4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},I4=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tfe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,k4=/^( {2,}|\\)\n(?!\s*$)/,rfe=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\]*?>/g,afe=dn(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,"u").replace(/punct/g,ov).getRegex(),ofe=dn("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])","gu").replace(/punct/g,ov).getRegex(),sfe=dn("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])","gu").replace(/punct/g,ov).getRegex(),lfe=dn(/\\([punct])/,"gu").replace(/punct/g,ov).getRegex(),ufe=dn(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),cfe=dn(fC).replace("(?:-->|$)","-->").getRegex(),hfe=dn("^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^").replace("comment",cfe).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),K0=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,dfe=dn(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",K0).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),L4=dn(/^!?\[(label)\]\[(ref)\]/).replace("label",K0).replace("ref",dC).getRegex(),P4=dn(/^!?\[(ref)\](?:\[\])?/).replace("ref",dC).getRegex(),ffe=dn("reflink|nolink(?!\\()","g").replace("reflink",L4).replace("nolink",P4).getRegex(),gC={_backpedal:nv,anyPunctuation:lfe,autolink:ufe,blockSkip:ife,br:k4,code:tfe,del:nv,emStrongLDelim:afe,emStrongRDelimAst:ofe,emStrongRDelimUnd:sfe,escape:I4,link:dfe,nolink:P4,punctuation:nfe,reflink:L4,reflinkSearch:ffe,tag:hfe,text:rfe,url:nv},pfe={...gC,link:dn(/^!?\[(label)\]\((.*?)\)/).replace("label",K0).getRegex(),reflink:dn(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",K0).getRegex()},vC={...gC,escape:dn(I4).replace("])","~|])").getRegex(),url:dn(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\(i=s.call({lexer:this},e,t))?(e=e.substring(i.raw.length),t.push(i),!0):!1))){if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length),i.raw.length===1&&t.length>0?t[t.length-1].raw+=` `:t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` `+i.raw,a.text+=` `+i.text,this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length),a=t[t.length-1],a&&(a.type==="paragraph"||a.type==="text")?(a.raw+=` `+i.raw,a.text+=` `+i.raw,this.inlineQueue[this.inlineQueue.length-1].src=a.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title});continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(o=e,this.options.extensions&&this.options.extensions.startBlock){let s=1/0;const l=e.slice(1);let u;this.options.extensions.startBlock.forEach(d=>{u=d.call({lexer:this},l),typeof u=="number"&&u>=0&&(s=Math.min(s,u))}),s<1/0&&s>=0&&(o=e.substring(0,s+1))}if(this.state.top&&(i=this.tokenizer.paragraph(o))){a=t[t.length-1],n&&(a==null?void 0:a.type)==="paragraph"?(a.raw+=` `+i.raw,a.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i),n=o.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length),a=t[t.length-1],a&&a.type==="text"?(a.raw+=` `+i.raw,a.text+=` `+i.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=a.text):t.push(i);continue}if(e){const s="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(s);break}else throw new Error(s)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i,a,o=e,s,l,u;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(s=this.tokenizer.rules.inline.reflinkSearch.exec(o))!=null;)d.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(s=this.tokenizer.rules.inline.blockSkip.exec(o))!=null;)o=o.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+o.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(s=this.tokenizer.rules.inline.anyPunctuation.exec(o))!=null;)o=o.slice(0,s.index)+"++"+o.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(l||(u=""),l=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(d=>(n=d.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length),i=t[t.length-1],i&&n.type==="text"&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,o,u)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}if(a=e,this.options.extensions&&this.options.extensions.startInline){let d=1/0;const f=e.slice(1);let g;this.options.extensions.startInline.forEach(m=>{g=m.call({lexer:this},f),typeof g=="number"&&g>=0&&(d=Math.min(d,g))}),d<1/0&&d>=0&&(a=e.substring(0,d+1))}if(n=this.tokenizer.inlineText(a)){e=e.substring(n.raw.length),n.raw.slice(-1)!=="_"&&(u=n.raw.slice(-1)),l=!0,i=t[t.length-1],i&&i.type==="text"?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){const d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return t}}class Q0{constructor(e){bn(this,"options");bn(this,"parser");this.options=e||lh}space(e){return""}code({text:e,lang:t,escaped:n}){var o;const i=(o=(t||"").match(/^\S*/))==null?void 0:o[0],a=e.replace(/\n$/,"")+` `;return i?'
'+(n?a:Ha(a,!0))+`
`:"
"+(n?a:Ha(a,!0))+`
`}blockquote({tokens:e}){return`
${this.parser.parse(e)}
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`${this.parser.parseInline(e)} `}hr(e){return`
`}list(e){const t=e.ordered,n=e.start;let i="";for(let s=0;s `+i+" `}listitem(e){let t="";if(e.task){const n=this.checkbox({checked:!!e.checked});e.loose?e.tokens.length>0&&e.tokens[0].type==="paragraph"?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser.parse(e.tokens,!!e.loose),`
  • ${t}
  • `}checkbox({checked:e}){return"'}paragraph({tokens:e}){return`

    ${this.parser.parseInline(e)}

    `}table(e){let t="",n="";for(let a=0;a${i}`),` `+t+` `+i+`
    `}tablerow({text:e}){return` ${e} `}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+` `}strong({tokens:e}){return`${this.parser.parseInline(e)}`}em({tokens:e}){return`${this.parser.parseInline(e)}`}codespan({text:e}){return`${e}`}br(e){return"
    "}del({tokens:e}){return`${this.parser.parseInline(e)}`}link({href:e,title:t,tokens:n}){const i=this.parser.parseInline(n),a=S4(e);if(a===null)return i;e=a;let o='
    ",o}image({href:e,title:t,text:n}){const i=S4(e);if(i===null)return n;e=i;let a=`${n}{const u=s[l].flat(1/0);n=n.concat(this.walkTokens(u,t))}):s.tokens&&(n=n.concat(this.walkTokens(s.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const i={...n};if(i.async=this.defaults.async||i.async||!1,n.extensions&&(n.extensions.forEach(a=>{if(!a.name)throw new Error("extension name required");if("renderer"in a){const o=t.renderers[a.name];o?t.renderers[a.name]=function(...s){let l=a.renderer.apply(this,s);return l===!1&&(l=o.apply(this,s)),l}:t.renderers[a.name]=a.renderer}if("tokenizer"in a){if(!a.level||a.level!=="block"&&a.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[a.level];o?o.unshift(a.tokenizer):t[a.level]=[a.tokenizer],a.start&&(a.level==="block"?t.startBlock?t.startBlock.push(a.start):t.startBlock=[a.start]:a.level==="inline"&&(t.startInline?t.startInline.push(a.start):t.startInline=[a.start]))}"childTokens"in a&&a.childTokens&&(t.childTokens[a.name]=a.childTokens)}),i.extensions=t),n.renderer){const a=this.defaults.renderer||new Q0(this.defaults);for(const o in n.renderer){if(!(o in a))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const s=o,l=n.renderer[s],u=a[s];a[s]=(...d)=>{let f=l.apply(a,d);return f===!1&&(f=u.apply(a,d)),f||""}}i.renderer=a}if(n.tokenizer){const a=this.defaults.tokenizer||new X0(this.defaults);for(const o in n.tokenizer){if(!(o in a))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const s=o,l=n.tokenizer[s],u=a[s];a[s]=(...d)=>{let f=l.apply(a,d);return f===!1&&(f=u.apply(a,d)),f}}i.tokenizer=a}if(n.hooks){const a=this.defaults.hooks||new lv;for(const o in n.hooks){if(!(o in a))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const s=o,l=n.hooks[s],u=a[s];lv.passThroughHooks.has(o)?a[s]=d=>{if(this.defaults.async)return Promise.resolve(l.call(a,d)).then(g=>u.call(a,g));const f=l.call(a,d);return u.call(a,f)}:a[s]=(...d)=>{let f=l.apply(a,d);return f===!1&&(f=u.apply(a,d)),f}}i.hooks=a}if(n.walkTokens){const a=this.defaults.walkTokens,o=n.walkTokens;i.walkTokens=function(s){let l=[];return l.push(o.call(this,s)),a&&(l=l.concat(a.call(this,s))),l}}this.defaults={...this.defaults,...i}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Co.lex(e,t??this.defaults)}parser(e,t){return Ao.parse(e,t??this.defaults)}parseMarkdown(e){return(n,i)=>{const a={...i},o={...this.defaults,...a},s=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?Co.lex:Co.lexInline,u=o.hooks?o.hooks.provideParser():e?Ao.parse:Ao.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(n):n).then(d=>l(d,o)).then(d=>o.hooks?o.hooks.processAllTokens(d):d).then(d=>o.walkTokens?Promise.all(this.walkTokens(d,o.walkTokens)).then(()=>d):d).then(d=>u(d,o)).then(d=>o.hooks?o.hooks.postprocess(d):d).catch(s);try{o.hooks&&(n=o.hooks.preprocess(n));let d=l(n,o);o.hooks&&(d=o.hooks.processAllTokens(d)),o.walkTokens&&this.walkTokens(d,o.walkTokens);let f=u(d,o);return o.hooks&&(f=o.hooks.postprocess(f)),f}catch(d){return s(d)}}}onError(e,t){return n=>{if(n.message+=` Please report this to https://github.com/markedjs/marked.`,e){const i="

    An error occurred:

    "+Ha(n.message+"",!0)+"
    ";return t?Promise.resolve(i):i}if(t)return Promise.reject(n);throw n}}}const uh=new vfe;function ln(r,e){return uh.parse(r,e)}ln.options=ln.setOptions=function(r){return uh.setOptions(r),ln.defaults=uh.defaults,_4(ln.defaults),ln},ln.getDefaults=cC,ln.defaults=lh,ln.use=function(...r){return uh.use(...r),ln.defaults=uh.defaults,_4(ln.defaults),ln},ln.walkTokens=function(r,e){return uh.walkTokens(r,e)},ln.parseInline=uh.parseInline,ln.Parser=Ao,ln.parser=Ao.parse,ln.Renderer=Q0,ln.TextRenderer=mC,ln.Lexer=Co,ln.lexer=Co.lex,ln.Tokenizer=X0,ln.Hooks=lv,ln.parse=ln,ln.options,ln.setOptions,ln.use,ln.walkTokens,ln.parseInline,Ao.parse,Co.lex;const mfe={class:"pt-[10px]"},yfe={__name:"vs-editor-form-data",props:{widgetName:{type:String},data:{type:Object,default:()=>{}},columns:{type:Array,default:()=>[]}},emits:["update-dashboard"],setup(r,{emit:e}){var d,f,g,m,_,x,w,C,A,L,O,V,F,$,H,Z,j,Y,se,ae,ue,fe,le,ge,xe,Me,Ve,Fe,Xe,ot,et,it,kt,Ht,lt,st,Ct,rt,vt;const{$notify:t}=P.getCurrentInstance().proxy,n=e,i=r,a=P.ref(null),o={text:{type:"Text",label:"Text",conditions:["type","==","text"]},x:{type:"radio",label:"X Axis",view:"buttons",style:{size:"xs"},conditions:["type","not_in",["text","table","map"]],options:[...(f=(d=i.columns)==null?void 0:d.filter(Qe=>(Qe==null?void 0:Qe.type)=="text"||(Qe==null?void 0:Qe.type)==="date"||(Qe==null?void 0:Qe.type)==="timestamp without time zone"||(Qe==null?void 0:Qe.type)==="boolean"||(Qe==null?void 0:Qe.type)==="integer"))==null?void 0:f.map(({name:Qe,type:Ft})=>({id:Qe,label:Qe,type:Ft}))]},cls:{label:"X Axis classifier",type:"text",conditions:["type","not_in",["text","table","map","cluster"]]},y_type:{label:"Y type",type:"radio",options:["columns","function"],conditions:["type","not_in",["text","table","map","number","cluster"]]},tableSQL:{label:"tableSQL",type:"text",hidden:!0},metric:{type:"radio",label:"Y Axis",view:"buttons",style:{size:"xs"},conditions:[["type","not_in",["text","table","map","cluster"]],["y_type","!=","function"]],options:[{id:"count",label:"count"},...(m=(g=i.columns)==null?void 0:g.filter(Qe=>(Qe==null?void 0:Qe.type)==="numeric"||(Qe==null?void 0:Qe.type)==="double precision"))==null?void 0:m.map(({name:Qe,type:Ft})=>({id:Qe,label:Qe,type:Ft}))]},fx:{type:"text",label:"Function",conditions:[["y_type","==","function"]]},query:{label:"Query",type:"text",conditions:["type","not_in",["text","table","map","number"]]},groupby:{type:"radio",label:"Groupby",view:"buttons",style:{size:"xs"},options:[{id:"null",label:"null"},...(x=(_=i.columns)==null?void 0:_.filter(Qe=>(Qe==null?void 0:Qe.type)=="text"||(Qe==null?void 0:Qe.type)==="boolean"||(Qe==null?void 0:Qe.type)==="integer"))==null?void 0:x.map(({name:Qe})=>({id:Qe,label:Qe}))],conditions:["type","==","bar"]},columns:{type:"checkbox",label:"Columns",style:{size:"xs"},options:(w=i.columns)==null?void 0:w.map(({name:Qe})=>Qe),conditions:["type","in",["table","map"]]},granularity:{type:"radio",label:"Granularity",options:[{id:"year",label:"year"},{id:"quarter",label:"quarter"},{id:"month",label:"month"},{id:"week",label:"week"}],conditions:["x.type","==","date"]},type:{type:"Text",hidden:!0}},s=P.ref({x:((A=(C=i.data)==null?void 0:C.data)==null?void 0:A.x)||((L=i.data)==null?void 0:L.x)||null,metric:((V=(O=i.data)==null?void 0:O.data)==null?void 0:V.metric)||((F=i.data)==null?void 0:F.metric)||null,columns:((H=($=i.data)==null?void 0:$.data)==null?void 0:H.columns)||((Z=i.data)==null?void 0:Z.columns)||null,granularity:((Y=(j=i.data)==null?void 0:j.data)==null?void 0:Y.granularity)||((se=i.data)==null?void 0:se.granularity)||null,type:((ue=(ae=i.data)==null?void 0:ae.data)==null?void 0:ue.type)||((fe=i.data)==null?void 0:fe.type)||null,groupby:((ge=(le=i.data)==null?void 0:le.data)==null?void 0:ge.groupby)||i.data.groupby||null,fx:((Me=(xe=i.data)==null?void 0:xe.data)==null?void 0:Me.fx)||((Ve=i.data)==null?void 0:Ve.fx)||null,query:((Xe=(Fe=i.data)==null?void 0:Fe.data)==null?void 0:Xe.query)||((ot=i.data)==null?void 0:ot.query)||null,y_type:((it=(et=i.data)==null?void 0:et.data)==null?void 0:it.y_type)||((kt=i.data)==null?void 0:kt.y_type)||null,tableSQL:((lt=(Ht=i.data)==null?void 0:Ht.data)==null?void 0:lt.tableSQL)||((st=i.data)==null?void 0:st.tableSQL)||null,cls:((rt=(Ct=i.data)==null?void 0:Ct.data)==null?void 0:rt.cls)||((vt=i.data)==null?void 0:vt.cls)||null}),l=async()=>{try{await _r.put(`/bi-dashboard/${a.value}/${i.widgetName}`,{data:s.value});let Qe=`/bi-data?dashboard=${a.value}&widget=${i.widgetName}`;Object.entries(s.value).forEach(([Kt,Le])=>{Qe+=`&${Kt}=${Le}`});const Ft=new CustomEvent(`update-data-${i.widgetName}`);Ft.filterUrl=Qe,window.dispatchEvent(Ft),await t({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}},u=async()=>{try{let Qe=`/bi-data?dashboard=${a.value}&widget=${i.widgetName}`;Object.entries(s.value).forEach(([Kt,Le])=>{Qe+=`&${Kt}=${Le}`});const Ft=new CustomEvent(`update-data-${i.widgetName}`);Ft.filterUrl=Qe,window.dispatchEvent(Ft),n("update-dashboard")}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return P.watch(s,(Qe,Ft)=>{var Mr,Lt;const Kt=(Mr=Object.entries(Qe))==null?void 0:Mr.reduce((Xt,[nr,lr])=>lr?Xt+lr:Xt),Le=(Lt=Object.entries(Ft))==null?void 0:Lt.reduce((Xt,[nr,lr])=>lr?Xt+lr:Xt);Kt!==Le&&u()},{deep:!0}),P.onMounted(()=>{const Qe=new URLSearchParams(window.top.location.search);a.value=Qe.get("dashboard")}),(Qe,Ft)=>{const Kt=P.resolveComponent("VsButton"),Le=P.resolveComponent("VsForm");return P.openBlock(),P.createElementBlock("div",mfe,[P.createVNode(Kt,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:l},{default:P.withCtx(()=>Ft[1]||(Ft[1]=[P.createTextVNode(" Зберегти ")])),_:1,__:[1]}),P.createVNode(Le,{scheme:o,modelValue:s.value,"onUpdate:modelValue":Ft[0]||(Ft[0]=Mr=>s.value=Mr)},null,8,["modelValue"])])}}},_fe={class:"pt-[10px]"},bfe={__name:"vs-editor-form-yaml",props:{yamlValue:{type:null,default:()=>""},widgetName:{type:String},data:{type:Object}},setup(r){const e=P.ref(null),{$notify:t}=P.getCurrentInstance().proxy,n=r,i=(l,{dimensions:u,source:d})=>{const f=l.getOption(),{data:g,...m}=(f==null?void 0:f.series)[0],[,..._]=u||[],x=_.map((w,C)=>({...(f==null?void 0:f.series[C])||{},data:d.map(A=>A[C+1]),name:w}));l==null||l.setOption({...f||{},dataset:{dimensions:u,source:d},series:x,xAxis:{type:"category"},yAxis:{}},!0)},a=l=>{const u=document.getElementById(l);if(!u)return null;const d=xS(u);return d||null},o=P.ref(n.yamlValue),s=async()=>{try{await _r.put(`/bi-dashboard/${e.value}/${n.widgetName}`,{yml:o.value});const l=a(n.widgetName);if(l){const{data:u}=await _r.get(`/bi-data?dashboard=${e.value}&widget=${n.widgetName}`);i(l,u)}await t({type:"success",title:"Успішно!",message:"Дані успішно оновлено"})}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return P.onMounted(()=>{const l=new URLSearchParams(window.top.location.search);e.value=l.get("dashboard")}),(l,u)=>{const d=P.resolveComponent("VsButton"),f=P.resolveComponent("VsFormAce");return P.openBlock(),P.createElementBlock("div",_fe,[P.createVNode(d,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:s},{default:P.withCtx(()=>u[1]||(u[1]=[P.createTextVNode(" Зберегти ")])),_:1,__:[1]}),P.createVNode(f,{modelValue:o.value,"onUpdate:modelValue":u[0]||(u[0]=g=>o.value=g),value:o.value,fontSize:"12px"},null,8,["modelValue","value"])])}}},xfe={class:"pt-[10px]"},R4={"vs-editor-form-style":Bde,"vs-editor-form-data":yfe,"vs-editor-form-yaml":bfe,"vs-editor-form-controls":{__name:"vs-editor-form-controls",props:{widgetName:{type:String},controls:{type:Object,default:()=>{}},columns:{type:Array,default:()=>[]}},emits:["update-dashboard"],setup(r,{emit:e}){var u;const{$notify:t}=P.getCurrentInstance().proxy,n=e,i=r,a=P.ref(null),o={granularity:{ua:"Granularity",type:"checkbox",options:["week","month","quarter","year"]},export:{ua:"Export",type:"Switcher"},groupby:{ua:"Groupby",type:"checkbox",options:(u=i.columns)==null?void 0:u.map(({name:d})=>d)}},s=P.ref(i.controls||{}),l=async()=>{try{await _r.put(`/bi-dashboard/${a.value}/${i.widgetName}`,{controls:s.value}),await t({type:"success",title:"Успішно!",message:"Дані успішно оновлено"}),staticTypes!=null&&staticTypes.includes(s.value.type)&&n("update-dashboard")}catch{await t({type:"error",title:"Помилка!",message:"При спробі оновити данні сталася помилка"})}};return P.onMounted(()=>{const d=new URLSearchParams(window.top.location.search);a.value=d.get("dashboard")}),(d,f)=>{const g=P.resolveComponent("VsButton"),m=P.resolveComponent("VsForm");return P.openBlock(),P.createElementBlock("div",xfe,[P.createVNode(g,{class:"ml-[10px] mb-[10px]",type:"plain",onClick:l},{default:P.withCtx(()=>f[1]||(f[1]=[P.createTextVNode(" Зберегти ")])),_:1,__:[1]}),P.createVNode(m,{scheme:o,modelValue:s.value,"onUpdate:modelValue":f[0]||(f[0]=_=>s.value=_)},null,8,["modelValue"])])}}}},wfe={},Sfe={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-table"};function Tfe(r,e){return P.openBlock(),P.createElementBlock("svg",Sfe,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z"},null,-1),P.createElementVNode("path",{d:"M3 10h18"},null,-1),P.createElementVNode("path",{d:"M10 3v18"},null,-1)]))}const yC=fr(wfe,[["render",Tfe]]);var Efe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N4(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function O4(r){return r instanceof Map?r.clear=r.delete=r.set=function(){throw new Error("map is read-only")}:r instanceof Set&&(r.add=r.clear=r.delete=function(){throw new Error("set is read-only")}),Object.freeze(r),Object.getOwnPropertyNames(r).forEach(e=>{const t=r[e],n=typeof t;(n==="object"||n==="function")&&!Object.isFrozen(t)&&O4(t)}),r}let z4=class{constructor(e){e.data===void 0&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}};function B4(r){return r.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function lu(r,...e){const t=Object.create(null);for(const n in r)t[n]=r[n];return e.forEach(function(n){for(const i in n)t[i]=n[i]}),t}const Cfe="",V4=r=>!!r.scope,Afe=(r,{prefix:e})=>{if(r.startsWith("language:"))return r.replace("language:","language-");if(r.includes(".")){const t=r.split(".");return[`${e}${t.shift()}`,...t.map((n,i)=>`${n}${"_".repeat(i+1)}`)].join(" ")}return`${e}${r}`};class Dfe{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=B4(e)}openNode(e){if(!V4(e))return;const t=Afe(e.scope,{prefix:this.classPrefix});this.span(t)}closeNode(e){V4(e)&&(this.buffer+=Cfe)}value(){return this.buffer}span(e){this.buffer+=``}}const F4=(r={})=>{const e={children:[]};return Object.assign(e,r),e};class _C{constructor(){this.rootNode=F4(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t=F4({scope:e});this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return typeof t=="string"?e.addText(t):t.children&&(e.openNode(t),t.children.forEach(n=>this._walk(e,n)),e.closeNode(t)),e}static _collapse(e){typeof e!="string"&&e.children&&(e.children.every(t=>typeof t=="string")?e.children=[e.children.join("")]:e.children.forEach(t=>{_C._collapse(t)}))}}class Mfe extends _C{constructor(e){super(),this.options=e}addText(e){e!==""&&this.add(e)}startScope(e){this.openNode(e)}endScope(){this.closeNode()}__addSublanguage(e,t){const n=e.root;t&&(n.scope=`language:${t}`),this.add(n)}toHTML(){return new Dfe(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function uv(r){return r?typeof r=="string"?r:r.source:null}function $4(r){return ch("(?=",r,")")}function Ife(r){return ch("(?:",r,")*")}function kfe(r){return ch("(?:",r,")?")}function ch(...r){return r.map(t=>uv(t)).join("")}function Lfe(r){const e=r[r.length-1];return typeof e=="object"&&e.constructor===Object?(r.splice(r.length-1,1),e):{}}function bC(...r){return"("+(Lfe(r).capture?"":"?:")+r.map(n=>uv(n)).join("|")+")"}function G4(r){return new RegExp(r.toString()+"|").exec("").length-1}function Pfe(r,e){const t=r&&r.exec(e);return t&&t.index===0}const Rfe=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function xC(r,{joinWith:e}){let t=0;return r.map(n=>{t+=1;const i=t;let a=uv(n),o="";for(;a.length>0;){const s=Rfe.exec(a);if(!s){o+=a;break}o+=a.substring(0,s.index),a=a.substring(s.index+s[0].length),s[0][0]==="\\"&&s[1]?o+="\\"+String(Number(s[1])+i):(o+=s[0],s[0]==="("&&t++)}return o}).map(n=>`(${n})`).join(e)}const Nfe=/\b\B/,U4="[a-zA-Z]\\w*",wC="[a-zA-Z_]\\w*",H4="\\b\\d+(\\.\\d+)?",W4="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q4="\\b(0b[01]+)",Ofe="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",zfe=(r={})=>{const e=/^#![ ]*\//;return r.binary&&(r.begin=ch(e,/.*\b/,r.binary,/\b.*/)),lu({scope:"meta",begin:e,end:/$/,relevance:0,"on:begin":(t,n)=>{t.index!==0&&n.ignoreMatch()}},r)},cv={begin:"\\\\[\\s\\S]",relevance:0},Bfe={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[cv]},Vfe={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[cv]},Ffe={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},eb=function(r,e,t={}){const n=lu({scope:"comment",begin:r,end:e,contains:[]},t);n.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const i=bC("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return n.contains.push({begin:ch(/[ ]+/,"(",i,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),n},$fe=eb("//","$"),Gfe=eb("/\\*","\\*/"),Ufe=eb("#","$"),Hfe={scope:"number",begin:H4,relevance:0},Wfe={scope:"number",begin:W4,relevance:0},qfe={scope:"number",begin:q4,relevance:0},Zfe={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[cv,{begin:/\[/,end:/\]/,relevance:0,contains:[cv]}]},jfe={scope:"title",begin:U4,relevance:0},Xfe={scope:"title",begin:wC,relevance:0},Yfe={begin:"\\.\\s*"+wC,relevance:0};var tb=Object.freeze({__proto__:null,APOS_STRING_MODE:Bfe,BACKSLASH_ESCAPE:cv,BINARY_NUMBER_MODE:qfe,BINARY_NUMBER_RE:q4,COMMENT:eb,C_BLOCK_COMMENT_MODE:Gfe,C_LINE_COMMENT_MODE:$fe,C_NUMBER_MODE:Wfe,C_NUMBER_RE:W4,END_SAME_AS_BEGIN:function(r){return Object.assign(r,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})},HASH_COMMENT_MODE:Ufe,IDENT_RE:U4,MATCH_NOTHING_RE:Nfe,METHOD_GUARD:Yfe,NUMBER_MODE:Hfe,NUMBER_RE:H4,PHRASAL_WORDS_MODE:Ffe,QUOTE_STRING_MODE:Vfe,REGEXP_MODE:Zfe,RE_STARTERS_RE:Ofe,SHEBANG:zfe,TITLE_MODE:jfe,UNDERSCORE_IDENT_RE:wC,UNDERSCORE_TITLE_MODE:Xfe});function Kfe(r,e){r.input[r.index-1]==="."&&e.ignoreMatch()}function Jfe(r,e){r.className!==void 0&&(r.scope=r.className,delete r.className)}function Qfe(r,e){e&&r.beginKeywords&&(r.begin="\\b("+r.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",r.__beforeBegin=Kfe,r.keywords=r.keywords||r.beginKeywords,delete r.beginKeywords,r.relevance===void 0&&(r.relevance=0))}function epe(r,e){Array.isArray(r.illegal)&&(r.illegal=bC(...r.illegal))}function tpe(r,e){if(r.match){if(r.begin||r.end)throw new Error("begin & end are not supported with match");r.begin=r.match,delete r.match}}function rpe(r,e){r.relevance===void 0&&(r.relevance=1)}const npe=(r,e)=>{if(!r.beforeMatch)return;if(r.starts)throw new Error("beforeMatch cannot be used with starts");const t=Object.assign({},r);Object.keys(r).forEach(n=>{delete r[n]}),r.keywords=t.keywords,r.begin=ch(t.beforeMatch,$4(t.begin)),r.starts={relevance:0,contains:[Object.assign(t,{endsParent:!0})]},r.relevance=0,delete t.beforeMatch},ipe=["of","and","for","in","not","or","if","then","parent","list","value"],ape="keyword";function Z4(r,e,t=ape){const n=Object.create(null);return typeof r=="string"?i(t,r.split(" ")):Array.isArray(r)?i(t,r):Object.keys(r).forEach(function(a){Object.assign(n,Z4(r[a],e,a))}),n;function i(a,o){e&&(o=o.map(s=>s.toLowerCase())),o.forEach(function(s){const l=s.split("|");n[l[0]]=[a,ope(l[0],l[1])]})}}function ope(r,e){return e?Number(e):spe(r)?0:1}function spe(r){return ipe.includes(r.toLowerCase())}const j4={},hh=r=>{console.error(r)},X4=(r,...e)=>{console.log(`WARN: ${r}`,...e)},nf=(r,e)=>{j4[`${r}/${e}`]||(console.log(`Deprecated as of ${r}. ${e}`),j4[`${r}/${e}`]=!0)},rb=new Error;function Y4(r,e,{key:t}){let n=0;const i=r[t],a={},o={};for(let s=1;s<=e.length;s++)o[s+n]=i[s],a[s+n]=!0,n+=G4(e[s-1]);r[t]=o,r[t]._emit=a,r[t]._multi=!0}function lpe(r){if(Array.isArray(r.begin)){if(r.skip||r.excludeBegin||r.returnBegin)throw hh("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),rb;if(typeof r.beginScope!="object"||r.beginScope===null)throw hh("beginScope must be object"),rb;Y4(r,r.begin,{key:"beginScope"}),r.begin=xC(r.begin,{joinWith:""})}}function upe(r){if(Array.isArray(r.end)){if(r.skip||r.excludeEnd||r.returnEnd)throw hh("skip, excludeEnd, returnEnd not compatible with endScope: {}"),rb;if(typeof r.endScope!="object"||r.endScope===null)throw hh("endScope must be object"),rb;Y4(r,r.end,{key:"endScope"}),r.end=xC(r.end,{joinWith:""})}}function cpe(r){r.scope&&typeof r.scope=="object"&&r.scope!==null&&(r.beginScope=r.scope,delete r.scope)}function hpe(r){cpe(r),typeof r.beginScope=="string"&&(r.beginScope={_wrap:r.beginScope}),typeof r.endScope=="string"&&(r.endScope={_wrap:r.endScope}),lpe(r),upe(r)}function dpe(r){function e(o,s){return new RegExp(uv(o),"m"+(r.case_insensitive?"i":"")+(r.unicodeRegex?"u":"")+(s?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(s,l){l.position=this.position++,this.matchIndexes[this.matchAt]=l,this.regexes.push([l,s]),this.matchAt+=G4(s)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const s=this.regexes.map(l=>l[1]);this.matcherRe=e(xC(s,{joinWith:"|"}),!0),this.lastIndex=0}exec(s){this.matcherRe.lastIndex=this.lastIndex;const l=this.matcherRe.exec(s);if(!l)return null;const u=l.findIndex((f,g)=>g>0&&f!==void 0),d=this.matchIndexes[u];return l.splice(0,u),Object.assign(l,d)}}class n{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(s){if(this.multiRegexes[s])return this.multiRegexes[s];const l=new t;return this.rules.slice(s).forEach(([u,d])=>l.addRule(u,d)),l.compile(),this.multiRegexes[s]=l,l}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(s,l){this.rules.push([s,l]),l.type==="begin"&&this.count++}exec(s){const l=this.getMatcher(this.regexIndex);l.lastIndex=this.lastIndex;let u=l.exec(s);if(this.resumingScanAtSamePosition()&&!(u&&u.index===this.lastIndex)){const d=this.getMatcher(0);d.lastIndex=this.lastIndex+1,u=d.exec(s)}return u&&(this.regexIndex+=u.position+1,this.regexIndex===this.count&&this.considerAll()),u}}function i(o){const s=new n;return o.contains.forEach(l=>s.addRule(l.begin,{rule:l,type:"begin"})),o.terminatorEnd&&s.addRule(o.terminatorEnd,{type:"end"}),o.illegal&&s.addRule(o.illegal,{type:"illegal"}),s}function a(o,s){const l=o;if(o.isCompiled)return l;[Jfe,tpe,hpe,npe].forEach(d=>d(o,s)),r.compilerExtensions.forEach(d=>d(o,s)),o.__beforeBegin=null,[Qfe,epe,rpe].forEach(d=>d(o,s)),o.isCompiled=!0;let u=null;return typeof o.keywords=="object"&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),u=o.keywords.$pattern,delete o.keywords.$pattern),u=u||/\w+/,o.keywords&&(o.keywords=Z4(o.keywords,r.case_insensitive)),l.keywordPatternRe=e(u,!0),s&&(o.begin||(o.begin=/\B|\b/),l.beginRe=e(l.begin),!o.end&&!o.endsWithParent&&(o.end=/\B|\b/),o.end&&(l.endRe=e(l.end)),l.terminatorEnd=uv(l.end)||"",o.endsWithParent&&s.terminatorEnd&&(l.terminatorEnd+=(o.end?"|":"")+s.terminatorEnd)),o.illegal&&(l.illegalRe=e(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map(function(d){return fpe(d==="self"?o:d)})),o.contains.forEach(function(d){a(d,l)}),o.starts&&a(o.starts,s),l.matcher=i(l),l}if(r.compilerExtensions||(r.compilerExtensions=[]),r.contains&&r.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return r.classNameAliases=lu(r.classNameAliases||{}),a(r)}function K4(r){return r?r.endsWithParent||K4(r.starts):!1}function fpe(r){return r.variants&&!r.cachedVariants&&(r.cachedVariants=r.variants.map(function(e){return lu(r,{variants:null},e)})),r.cachedVariants?r.cachedVariants:K4(r)?lu(r,{starts:r.starts?lu(r.starts):null}):Object.isFrozen(r)?lu(r):r}var ppe="11.11.1";class gpe extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const SC=B4,J4=lu,Q4=Symbol("nomatch"),vpe=7,e$=function(r){const e=Object.create(null),t=Object.create(null),n=[];let i=!0;const a="Could not find the language '{}', did you forget to load/include a language module?",o={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Mfe};function l(le){return s.noHighlightRe.test(le)}function u(le){let ge=le.className+" ";ge+=le.parentNode?le.parentNode.className:"";const xe=s.languageDetectRe.exec(ge);if(xe){const Me=H(xe[1]);return Me||(X4(a.replace("{}",xe[1])),X4("Falling back to no-highlight mode for this block.",le)),Me?xe[1]:"no-highlight"}return ge.split(/\s+/).find(Me=>l(Me)||H(Me))}function d(le,ge,xe){let Me="",Ve="";typeof ge=="object"?(Me=le,xe=ge.ignoreIllegals,Ve=ge.language):(nf("10.7.0","highlight(lang, code, ...args) has been deprecated."),nf("10.7.0",`Please use highlight(code, options) instead. https://github.com/highlightjs/highlight.js/issues/2277`),Ve=le,Me=ge),xe===void 0&&(xe=!0);const Fe={code:Me,language:Ve};ue("before:highlight",Fe);const Xe=Fe.result?Fe.result:f(Fe.language,Fe.code,xe);return Xe.code=Fe.code,ue("after:highlight",Xe),Xe}function f(le,ge,xe,Me){const Ve=Object.create(null);function Fe(mt,$t){return mt.keywords[$t]}function Xe(){if(!Lt.keywords){nr.addText(lr);return}let mt=0;Lt.keywordPatternRe.lastIndex=0;let $t=Lt.keywordPatternRe.exec(lr),qe="";for(;$t;){qe+=lr.substring(mt,$t.index);const wr=Kt.case_insensitive?$t[0].toLowerCase():$t[0],zr=Fe(Lt,wr);if(zr){const[Dn,sa]=zr;if(nr.addText(qe),qe="",Ve[wr]=(Ve[wr]||0)+1,Ve[wr]<=vpe&&(Yn+=sa),Dn.startsWith("_"))qe+=$t[0];else{const ct=Kt.classNameAliases[Dn]||Dn;it($t[0],ct)}}else qe+=$t[0];mt=Lt.keywordPatternRe.lastIndex,$t=Lt.keywordPatternRe.exec(lr)}qe+=lr.substring(mt),nr.addText(qe)}function ot(){if(lr==="")return;let mt=null;if(typeof Lt.subLanguage=="string"){if(!e[Lt.subLanguage]){nr.addText(lr);return}mt=f(Lt.subLanguage,lr,!0,Xt[Lt.subLanguage]),Xt[Lt.subLanguage]=mt._top}else mt=m(lr,Lt.subLanguage.length?Lt.subLanguage:null);Lt.relevance>0&&(Yn+=mt.relevance),nr.__addSublanguage(mt._emitter,mt.language)}function et(){Lt.subLanguage!=null?ot():Xe(),lr=""}function it(mt,$t){mt!==""&&(nr.startScope($t),nr.addText(mt),nr.endScope())}function kt(mt,$t){let qe=1;const wr=$t.length-1;for(;qe<=wr;){if(!mt._emit[qe]){qe++;continue}const zr=Kt.classNameAliases[mt[qe]]||mt[qe],Dn=$t[qe];zr?it(Dn,zr):(lr=Dn,Xe(),lr=""),qe++}}function Ht(mt,$t){return mt.scope&&typeof mt.scope=="string"&&nr.openNode(Kt.classNameAliases[mt.scope]||mt.scope),mt.beginScope&&(mt.beginScope._wrap?(it(lr,Kt.classNameAliases[mt.beginScope._wrap]||mt.beginScope._wrap),lr=""):mt.beginScope._multi&&(kt(mt.beginScope,$t),lr="")),Lt=Object.create(mt,{parent:{value:Lt}}),Lt}function lt(mt,$t,qe){let wr=Pfe(mt.endRe,qe);if(wr){if(mt["on:end"]){const zr=new z4(mt);mt["on:end"]($t,zr),zr.isMatchIgnored&&(wr=!1)}if(wr){for(;mt.endsParent&&mt.parent;)mt=mt.parent;return mt}}if(mt.endsWithParent)return lt(mt.parent,$t,qe)}function st(mt){return Lt.matcher.regexIndex===0?(lr+=mt[0],1):(Pn=!0,0)}function Ct(mt){const $t=mt[0],qe=mt.rule,wr=new z4(qe),zr=[qe.__beforeBegin,qe["on:begin"]];for(const Dn of zr)if(Dn&&(Dn(mt,wr),wr.isMatchIgnored))return st($t);return qe.skip?lr+=$t:(qe.excludeBegin&&(lr+=$t),et(),!qe.returnBegin&&!qe.excludeBegin&&(lr=$t)),Ht(qe,mt),qe.returnBegin?0:$t.length}function rt(mt){const $t=mt[0],qe=ge.substring(mt.index),wr=lt(Lt,mt,qe);if(!wr)return Q4;const zr=Lt;Lt.endScope&&Lt.endScope._wrap?(et(),it($t,Lt.endScope._wrap)):Lt.endScope&&Lt.endScope._multi?(et(),kt(Lt.endScope,mt)):zr.skip?lr+=$t:(zr.returnEnd||zr.excludeEnd||(lr+=$t),et(),zr.excludeEnd&&(lr=$t));do Lt.scope&&nr.closeNode(),!Lt.skip&&!Lt.subLanguage&&(Yn+=Lt.relevance),Lt=Lt.parent;while(Lt!==wr.parent);return wr.starts&&Ht(wr.starts,mt),zr.returnEnd?0:$t.length}function vt(){const mt=[];for(let $t=Lt;$t!==Kt;$t=$t.parent)$t.scope&&mt.unshift($t.scope);mt.forEach($t=>nr.openNode($t))}let Qe={};function Ft(mt,$t){const qe=$t&&$t[0];if(lr+=mt,qe==null)return et(),0;if(Qe.type==="begin"&&$t.type==="end"&&Qe.index===$t.index&&qe===""){if(lr+=ge.slice($t.index,$t.index+1),!i){const wr=new Error(`0 width match regex (${le})`);throw wr.languageName=le,wr.badRule=Qe.rule,wr}return 1}if(Qe=$t,$t.type==="begin")return Ct($t);if($t.type==="illegal"&&!xe){const wr=new Error('Illegal lexeme "'+qe+'" for mode "'+(Lt.scope||"")+'"');throw wr.mode=Lt,wr}else if($t.type==="end"){const wr=rt($t);if(wr!==Q4)return wr}if($t.type==="illegal"&&qe==="")return lr+=` `,1;if(Aa>1e5&&Aa>$t.index*3)throw new Error("potential infinite loop, way more iterations than matches");return lr+=qe,qe.length}const Kt=H(le);if(!Kt)throw hh(a.replace("{}",le)),new Error('Unknown language: "'+le+'"');const Le=dpe(Kt);let Mr="",Lt=Me||Le;const Xt={},nr=new s.__emitter(s);vt();let lr="",Yn=0,Tn=0,Aa=0,Pn=!1;try{if(Kt.__emitTokens)Kt.__emitTokens(ge,nr);else{for(Lt.matcher.considerAll();;){Aa++,Pn?Pn=!1:Lt.matcher.considerAll(),Lt.matcher.lastIndex=Tn;const mt=Lt.matcher.exec(ge);if(!mt)break;const $t=ge.substring(Tn,mt.index),qe=Ft($t,mt);Tn=mt.index+qe}Ft(ge.substring(Tn))}return nr.finalize(),Mr=nr.toHTML(),{language:le,value:Mr,relevance:Yn,illegal:!1,_emitter:nr,_top:Lt}}catch(mt){if(mt.message&&mt.message.includes("Illegal"))return{language:le,value:SC(ge),illegal:!0,relevance:0,_illegalBy:{message:mt.message,index:Tn,context:ge.slice(Tn-100,Tn+100),mode:mt.mode,resultSoFar:Mr},_emitter:nr};if(i)return{language:le,value:SC(ge),illegal:!1,relevance:0,errorRaised:mt,_emitter:nr,_top:Lt};throw mt}}function g(le){const ge={value:SC(le),illegal:!1,relevance:0,_top:o,_emitter:new s.__emitter(s)};return ge._emitter.addText(le),ge}function m(le,ge){ge=ge||s.languages||Object.keys(e);const xe=g(le),Me=ge.filter(H).filter(j).map(et=>f(et,le,!1));Me.unshift(xe);const Ve=Me.sort((et,it)=>{if(et.relevance!==it.relevance)return it.relevance-et.relevance;if(et.language&&it.language){if(H(et.language).supersetOf===it.language)return 1;if(H(it.language).supersetOf===et.language)return-1}return 0}),[Fe,Xe]=Ve,ot=Fe;return ot.secondBest=Xe,ot}function _(le,ge,xe){const Me=ge&&t[ge]||xe;le.classList.add("hljs"),le.classList.add(`language-${Me}`)}function x(le){let ge=null;const xe=u(le);if(l(xe))return;if(ue("before:highlightElement",{el:le,language:xe}),le.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",le);return}if(le.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(le)),s.throwUnescapedHTML))throw new gpe("One of your code blocks includes unescaped HTML.",le.innerHTML);ge=le;const Me=ge.textContent,Ve=xe?d(Me,{language:xe,ignoreIllegals:!0}):m(Me);le.innerHTML=Ve.value,le.dataset.highlighted="yes",_(le,xe,Ve.language),le.result={language:Ve.language,re:Ve.relevance,relevance:Ve.relevance},Ve.secondBest&&(le.secondBest={language:Ve.secondBest.language,relevance:Ve.secondBest.relevance}),ue("after:highlightElement",{el:le,result:Ve,text:Me})}function w(le){s=J4(s,le)}const C=()=>{O(),nf("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function A(){O(),nf("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let L=!1;function O(){function le(){O()}if(document.readyState==="loading"){L||window.addEventListener("DOMContentLoaded",le,!1),L=!0;return}document.querySelectorAll(s.cssSelector).forEach(x)}function V(le,ge){let xe=null;try{xe=ge(r)}catch(Me){if(hh("Language definition for '{}' could not be registered.".replace("{}",le)),i)hh(Me);else throw Me;xe=o}xe.name||(xe.name=le),e[le]=xe,xe.rawDefinition=ge.bind(null,r),xe.aliases&&Z(xe.aliases,{languageName:le})}function F(le){delete e[le];for(const ge of Object.keys(t))t[ge]===le&&delete t[ge]}function $(){return Object.keys(e)}function H(le){return le=(le||"").toLowerCase(),e[le]||e[t[le]]}function Z(le,{languageName:ge}){typeof le=="string"&&(le=[le]),le.forEach(xe=>{t[xe.toLowerCase()]=ge})}function j(le){const ge=H(le);return ge&&!ge.disableAutodetect}function Y(le){le["before:highlightBlock"]&&!le["before:highlightElement"]&&(le["before:highlightElement"]=ge=>{le["before:highlightBlock"](Object.assign({block:ge.el},ge))}),le["after:highlightBlock"]&&!le["after:highlightElement"]&&(le["after:highlightElement"]=ge=>{le["after:highlightBlock"](Object.assign({block:ge.el},ge))})}function se(le){Y(le),n.push(le)}function ae(le){const ge=n.indexOf(le);ge!==-1&&n.splice(ge,1)}function ue(le,ge){const xe=le;n.forEach(function(Me){Me[xe]&&Me[xe](ge)})}function fe(le){return nf("10.7.0","highlightBlock will be removed entirely in v12.0"),nf("10.7.0","Please use highlightElement now."),x(le)}Object.assign(r,{highlight:d,highlightAuto:m,highlightAll:O,highlightElement:x,highlightBlock:fe,configure:w,initHighlighting:C,initHighlightingOnLoad:A,registerLanguage:V,unregisterLanguage:F,listLanguages:$,getLanguage:H,registerAliases:Z,autoDetection:j,inherit:J4,addPlugin:se,removePlugin:ae}),r.debugMode=function(){i=!1},r.safeMode=function(){i=!0},r.versionString=ppe,r.regex={concat:ch,lookahead:$4,either:bC,optional:kfe,anyNumberOfTimes:Ife};for(const le in tb)typeof tb[le]=="object"&&O4(tb[le]);return Object.assign(r,tb),r},af=e$({});af.newInstance=()=>e$({});var t$=af;af.HighlightJS=af,af.default=af;const TC=N4(t$);var EC,r$;function mpe(){if(r$)return EC;r$=1;function r(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),i=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},s=e.inherit(o,{begin:/\(/,end:/\)/}),l=e.inherit(e.APOS_STRING_MODE,{className:"string"}),u=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),d={endsWithParent:!0,illegal:/`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin://,relevance:10,contains:[o,u,l,s,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin://,contains:[o,s,u,l]}]}]},e.COMMENT(//,{relevance:10}),{begin://,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[u]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/)/,end:/>/,keywords:{name:"style"},contains:[d],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/)/,end:/>/,keywords:{name:"script"},contains:[d],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(//,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:d}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}return EC=r,EC}var CC,n$;function ype(){if(n$)return CC;n$=1;function r(e){const t=e.regex,n={},i={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},i]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),s={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},l={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(l);const u={match:/\\"/},d={className:"string",begin:/'/,end:/'/},f={match:/\\'/},g={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},m=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],_=e.SHEBANG({binary:`(${m.join("|")})`,relevance:10}),x={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},w=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],C=["true","false"],A={match:/(\/[a-z._-]+)+/},L=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],O=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],V=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],F=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:w,literal:C,built_in:[...L,...O,"set","shopt",...V,...F]},contains:[_,e.SHEBANG(),x,g,o,s,A,l,u,d,f,n]}}return CC=r,CC}var AC,i$;function _pe(){if(i$)return AC;i$=1;function r(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",s="("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},_=t.optional(a)+e.IDENT_RE+"\\s*\\(",C={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},A=[g,l,n,e.C_BLOCK_COMMENT_MODE,f,d],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:C,contains:A.concat([{begin:/\(/,end:/\)/,keywords:C,contains:A.concat(["self"]),relevance:0}]),relevance:0},O={begin:"("+s+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:C,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:C,relevance:0},{begin:_,returnBegin:!0,contains:[e.inherit(m,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:C,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C",aliases:["h"],keywords:C,disableAutodetect:!0,illegal:"=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:g,strings:d,keywords:C}}}return AC=r,AC}var DC,a$;function bpe(){if(a$)return DC;a$=1;function r(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),i="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",s="(?!struct)("+i+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",l={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},d={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},f={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},g={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(d,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},m={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},_=t.optional(a)+e.IDENT_RE+"\\s*\\(",x=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],w=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],C=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],A=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],V={type:w,keyword:x,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:C},F={className:"function.dispatch",relevance:0,keywords:{_hint:A},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},$=[F,g,l,n,e.C_BLOCK_COMMENT_MODE,f,d],H={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:V,contains:$.concat([{begin:/\(/,end:/\)/,keywords:V,contains:$.concat(["self"]),relevance:0}]),relevance:0},Z={className:"function",begin:"("+s+"[\\*&\\s]+)+"+_,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:V,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:i,keywords:V,relevance:0},{begin:_,returnBegin:!0,contains:[m],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[d,f]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,d,f,l,{begin:/\(/,end:/\)/,keywords:V,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,d,f,l]}]},l,n,e.C_BLOCK_COMMENT_MODE,g]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:V,illegal:"",keywords:V,contains:["self",l]},{begin:e.IDENT_RE+"::",keywords:V},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}return DC=r,DC}var MC,o$;function xpe(){if(o$)return MC;o$=1;function r(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],i=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:a.concat(o),built_in:t,literal:i},l=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},d={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},f={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},g=e.inherit(f,{illegal:/\n/}),m={className:"subst",begin:/\{/,end:/\}/,keywords:s},_=e.inherit(m,{illegal:/\n/}),x={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,_]},w={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},m]},C=e.inherit(w,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},_]});m.contains=[w,x,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.C_BLOCK_COMMENT_MODE],_.contains=[C,x,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,u,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[d,w,x,f,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},L={begin:"<",end:">",contains:[{beginKeywords:"in out"},l]},O=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",V={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:""},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},l,L,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[l,L,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+O+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,L],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[A,u,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},V]}}return MC=r,MC}var IC,s$;function wpe(){if(s$)return IC;s$=1;const r=u=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:u.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:u.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),a=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function l(u){const d=u.regex,f=r(u),g={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},m="and or not only",_=/@-?\w[\w]*(-\w+)*/,x="[a-zA-Z-][a-zA-Z0-9_-]*",w=[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[f.BLOCK_COMMENT,g,f.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+x,relevance:0},f.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+a.join("|")+")"},{begin:":(:)?("+o.join("|")+")"}]},f.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[f.BLOCK_COMMENT,f.HEXCOLOR,f.IMPORTANT,f.CSS_NUMBER_MODE,...w,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...w,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},f.FUNCTION_DISPATCH]},{begin:d.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:_},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:m,attribute:i.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...w,f.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b"}]}}return IC=l,IC}var kC,l$;function Spe(){if(l$)return kC;l$=1;function r(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},i={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},s={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},l=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,l,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},d={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},f={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},g=e.inherit(d,{contains:[]}),m=e.inherit(f,{contains:[]});d.contains.push(m),f.contains.push(g);let _=[n,u];return[d,f,g,m].forEach(A=>{A.contains=A.contains.concat(_)}),_=_.concat(d,f),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:_},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:_}]}]},n,o,d,f,{className:"quote",begin:"^>\\s+",contains:_,end:"$"},a,i,u,s,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}return kC=r,kC}var LC,u$;function Tpe(){if(u$)return LC;u$=1;function r(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}return LC=r,LC}var PC,c$;function Epe(){if(c$)return PC;c$=1;function r(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",i=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(i,/(::\w+)*/),s={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},l={className:"doctag",begin:"@[A-Za-z]+"},u={begin:"#<",end:">"},d=[e.COMMENT("#","$",{contains:[l]}),e.COMMENT("^=begin","^=end",{contains:[l],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],f={className:"subst",begin:/#\{/,end:/\}/,keywords:s},g={className:"string",contains:[e.BACKSLASH_ESCAPE,f],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,f]})]}]},m="[1-9](_?[0-9])*|0",_="[0-9](_?[0-9])*",x={className:"number",relevance:0,variants:[{begin:`\\b(${m})(\\.(${_}))?([eE][+-]?(${_})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},w={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:s}]},$=[g,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:s},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:s},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:i,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[w]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[g,{begin:n}],relevance:0},x,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:s},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,f],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(u,d),relevance:0}].concat(u,d);f.contains=$,w.contains=$;const Y=[{begin:/^\s*=>/,starts:{end:"$",contains:$}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:s,contains:$}}];return d.unshift(u),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:s,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(Y).concat(d).concat($)}}return PC=r,PC}var RC,h$;function Cpe(){if(h$)return RC;h$=1;function r(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"i(o,s,l-1))}function a(o){const s=o.regex,l="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",u=l+i("(?:<"+l+"~~~(?:\\s*,\\s*"+l+"~~~)*>)?",/~~~/g,2),_={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},x={className:"meta",begin:"@"+l,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},w={className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[o.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:_,illegal:/<\/|#/,contains:[o.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[o.BACKSLASH_ESCAPE]},o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,l],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[s.concat(/(?!else)/,l),/\s+/,l,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,l],className:{1:"keyword",3:"title.class"},contains:[w,o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+u+"\\s+)",o.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:_,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[x,o.APOS_STRING_MODE,o.QUOTE_STRING_MODE,n,o.C_BLOCK_COMMENT_MODE]},o.C_LINE_COMMENT_MODE,o.C_BLOCK_COMMENT_MODE]},n,x]}}return zC=a,zC}var BC,g$;function Ipe(){if(g$)return BC;g$=1;const r="[A-Za-z$_][0-9A-Za-z$_]*",e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],t=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],i=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],a=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],o=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],s=[].concat(a,n,i);function l(u){const d=u.regex,f=(Ht,{after:lt})=>{const st="",end:""},_=/<[A-Za-z0-9\\._:-]+\s*\/>/,x={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Ht,lt)=>{const st=Ht[0].length+Ht.index,Ct=Ht.input[st];if(Ct==="<"||Ct===","){lt.ignoreMatch();return}Ct===">"&&(f(Ht,{after:st})||lt.ignoreMatch());let rt;const vt=Ht.input.substring(st);if(rt=vt.match(/^\s*=/)){lt.ignoreMatch();return}if((rt=vt.match(/^\s+extends\s+/))&&rt.index===0){lt.ignoreMatch();return}}},w={$pattern:r,keyword:e,literal:t,built_in:s,"variable.language":o},C="[0-9](_?[0-9])*",A=`\\.(${C})`,L="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",O={className:"number",variants:[{begin:`(\\b(${L})((${A})|\\.)?|(${A}))[eE][+-]?(${C})\\b`},{begin:`\\b(${L})\\b((${A})\\b|\\.)?|(${A})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},V={className:"subst",begin:"\\$\\{",end:"\\}",keywords:w,contains:[]},F={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,V],subLanguage:"xml"}},$={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,V],subLanguage:"css"}},H={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[u.BACKSLASH_ESCAPE,V],subLanguage:"graphql"}},Z={className:"string",begin:"`",end:"`",contains:[u.BACKSLASH_ESCAPE,V]},Y={className:"comment",variants:[u.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:g+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),u.C_BLOCK_COMMENT_MODE,u.C_LINE_COMMENT_MODE]},se=[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,F,$,H,Z,{match:/\$\d+/},O];V.contains=se.concat({begin:/\{/,end:/\}/,keywords:w,contains:["self"].concat(se)});const ae=[].concat(Y,V.contains),ue=ae.concat([{begin:/(\s*)\(/,end:/\)/,keywords:w,contains:["self"].concat(ae)}]),fe={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:w,contains:ue},le={variants:[{match:[/class/,/\s+/,g,/\s+/,/extends/,/\s+/,d.concat(g,"(",d.concat(/\./,g),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,g],scope:{1:"keyword",3:"title.class"}}]},ge={relevance:0,match:d.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...i]}},xe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Me={variants:[{match:[/function/,/\s+/,g,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[fe],illegal:/%/},Ve={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Fe(Ht){return d.concat("(?!",Ht.join("|"),")")}const Xe={match:d.concat(/\b/,Fe([...a,"super","import"].map(Ht=>`${Ht}\\s*\\(`)),g,d.lookahead(/\s*\(/)),className:"title.function",relevance:0},ot={begin:d.concat(/\./,d.lookahead(d.concat(g,/(?![0-9A-Za-z$_(])/))),end:g,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},et={match:[/get|set/,/\s+/,g,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},fe]},it="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+u.UNDERSCORE_IDENT_RE+")\\s*=>",kt={match:[/const|var|let/,/\s+/,g,/\s*/,/=\s*/,/(async\s*)?/,d.lookahead(it)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[fe]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:w,exports:{PARAMS_CONTAINS:ue,CLASS_REFERENCE:ge},illegal:/#(?![$_A-z])/,contains:[u.SHEBANG({label:"shebang",binary:"node",relevance:5}),xe,u.APOS_STRING_MODE,u.QUOTE_STRING_MODE,F,$,H,Z,Y,{match:/\$\d+/},O,ge,{scope:"attr",match:g+d.lookahead(":"),relevance:0},kt,{begin:"("+u.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[Y,u.REGEXP_MODE,{className:"function",begin:it,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:u.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:w,contains:ue}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:m.begin,end:m.end},{match:_},{begin:x.begin,"on:begin":x.isTrulyOpeningTag,end:x.end}],subLanguage:"xml",contains:[{begin:x.begin,end:x.end,skip:!0,contains:["self"]}]}]},Me,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+u.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[fe,u.inherit(u.TITLE_MODE,{begin:g,className:"title.function"})]},{match:/\.\.\./,relevance:0},ot,{match:"\\$"+g,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[fe]},Xe,Ve,le,et,{match:/\$[(.]/}]}}return BC=l,BC}var VC,v$;function kpe(){if(v$)return VC;v$=1;function r(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},i=["true","false","null"],a={scope:"literal",beginKeywords:i.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:i},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}return VC=r,VC}var FC,m$;function Lpe(){if(m$)return FC;m$=1;var r="[0-9](_*[0-9])*",e=`\\.(${r})`,t="[0-9a-fA-F](_*[0-9a-fA-F])*",n={className:"number",variants:[{begin:`(\\b(${r})((${e})|\\.)?|(${e}))[eE][+-]?(${r})[fFdD]?\\b`},{begin:`\\b(${r})((${e})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${e})[fFdD]?\\b`},{begin:`\\b(${r})[fFdD]\\b`},{begin:`\\b0[xX]((${t})\\.?|(${t})?\\.(${t}))[pP][+-]?(${r})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${t})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function i(a){const o={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},s={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},l={className:"symbol",begin:a.UNDERSCORE_IDENT_RE+"@"},u={className:"subst",begin:/\$\{/,end:/\}/,contains:[a.C_NUMBER_MODE]},d={className:"variable",begin:"\\$"+a.UNDERSCORE_IDENT_RE},f={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[d,u]},{begin:"'",end:"'",illegal:/\n/,contains:[a.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[a.BACKSLASH_ESCAPE,d,u]}]};u.contains.push(f);const g={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+a.UNDERSCORE_IDENT_RE+")?"},m={className:"meta",begin:"@"+a.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[a.inherit(f,{className:"string"}),"self"]}]},_=n,x=a.COMMENT("/\\*","\\*/",{contains:[a.C_BLOCK_COMMENT_MODE]}),w={variants:[{className:"type",begin:a.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},C=w;return C.variants[1].contains=[w],w.variants[1].contains=[C],{name:"Kotlin",aliases:["kt","kts"],keywords:o,contains:[a.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),a.C_LINE_COMMENT_MODE,x,s,l,g,m,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:o,relevance:5,contains:[{begin:a.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[a.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[w,a.C_LINE_COMMENT_MODE,x],relevance:0},a.C_LINE_COMMENT_MODE,x,g,m,f,a.C_NUMBER_MODE]},x]},{begin:[/class|interface|trait/,/\s+/,a.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},a.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},g,m]},f,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:` `},_]}}return FC=i,FC}var $C,y$;function Ppe(){if(y$)return $C;y$=1;const r=d=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:d.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:d.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),a=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),l=a.concat(o).sort().reverse();function u(d){const f=r(d),g=l,m="and or not only",_="[\\w-]+",x="("+_+"|@\\{"+_+"\\})",w=[],C=[],A=function(ae){return{className:"string",begin:"~?"+ae+".*?"+ae}},L=function(ae,ue,fe){return{className:ae,begin:ue,relevance:fe}},O={$pattern:/[a-z-]+/,keyword:m,attribute:i.join(" ")},V={begin:"\\(",end:"\\)",contains:C,keywords:O,relevance:0};C.push(d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE,A("'"),A('"'),f.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},f.HEXCOLOR,V,L("variable","@@?"+_,10),L("variable","@\\{"+_+"\\}"),L("built_in","~?`[^`]*?`"),{className:"attribute",begin:_+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},f.IMPORTANT,{beginKeywords:"and not"},f.FUNCTION_DISPATCH);const F=C.concat({begin:/\{/,end:/\}/,contains:w}),$={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(C)},H={begin:x+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},f.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:C}}]},Z={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:O,returnEnd:!0,contains:C,relevance:0}},j={className:"variable",variants:[{begin:"@"+_+"\\s*:",relevance:15},{begin:"@"+_}],starts:{end:"[;}]",returnEnd:!0,contains:F}},Y={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:x,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE,$,L("keyword","all\\b"),L("variable","@\\{"+_+"\\}"),{begin:"\\b("+n.join("|")+")\\b",className:"selector-tag"},f.CSS_NUMBER_MODE,L("selector-tag",x,0),L("selector-id","#"+x),L("selector-class","\\."+x,0),L("selector-tag","&",0),f.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+a.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+o.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:F},{begin:"!important"},f.FUNCTION_DISPATCH]},se={begin:_+`:(:)?(${g.join("|")})`,returnBegin:!0,contains:[Y]};return w.push(d.C_LINE_COMMENT_MODE,d.C_BLOCK_COMMENT_MODE,Z,j,se,H,Y,$,f.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:w}}return $C=u,$C}var GC,_$;function Rpe(){if(_$)return GC;_$=1;function r(e){const t="\\[=*\\[",n="\\]=*\\]",i={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[i],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[i],relevance:5}])}}return GC=r,GC}var UC,b$;function Npe(){if(b$)return UC;b$=1;function r(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%\{/,end:/\}/},l={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},u={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[l]},d={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},f=[e.BACKSLASH_ESCAPE,o,u],g=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],m=(w,C,A="\\1")=>{const L=A==="\\1"?A:t.concat(A,C);return t.concat(t.concat("(?:",w,")"),C,/(?:\\.|[^\\\/])*?/,L,/(?:\\.|[^\\\/])*?/,A,i)},_=(w,C,A)=>t.concat(t.concat("(?:",w,")"),C,/(?:\\.|[^\\\/])*?/,A,i),x=[u,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),s,{className:"string",contains:f,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},d,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:m("s|tr|y",t.either(...g,{capture:!0}))},{begin:m("s|tr|y","\\(","\\)")},{begin:m("s|tr|y","\\[","\\]")},{begin:m("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:_("(?:m|qr)?",/\//,/\//)},{begin:_("m|qr",t.either(...g,{capture:!0}),/\1/)},{begin:_("m|qr",/\(/,/\)/)},{begin:_("m|qr",/\[/,/\]/)},{begin:_("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,l,d]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=x,s.contains=x,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:x}}return HC=r,HC}var WC,w$;function zpe(){if(w$)return WC;w$=1;function r(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,l={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},u={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:l,illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+u.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:u,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}return WC=r,WC}var qC,S$;function Bpe(){if(S$)return qC;S$=1;function r(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,i=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),s={scope:"variable",match:"\\$+"+i},l={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},u={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},d=e.inherit(e.APOS_STRING_MODE,{illegal:null}),f=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(u)}),g={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(u),"on:begin":(fe,le)=>{le.data._beginMatch=fe[1]||fe[2]},"on:end":(fe,le)=>{le.data._beginMatch!==fe[1]&&le.ignoreMatch()}},m=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),_=`[ ]`,x={scope:"string",variants:[f,d,g,m]},w={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},C=["false","null","true"],A=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],L=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],V={keyword:A,literal:(fe=>{const le=[];return fe.forEach(ge=>{le.push(ge),ge.toLowerCase()===ge?le.push(ge.toUpperCase()):le.push(ge.toLowerCase())}),le})(C),built_in:L},F=fe=>fe.map(le=>le.replace(/\|\d+$/,"")),$={variants:[{match:[/new/,t.concat(_,"+"),t.concat("(?!",F(L).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},H=t.concat(i,"\\b(?!\\()"),Z={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),H],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),H],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},j={scope:"attr",match:t.concat(i,t.lookahead(":"),t.lookahead(/(?!::)/))},Y={relevance:0,begin:/\(/,end:/\)/,keywords:V,contains:[j,s,Z,e.C_BLOCK_COMMENT_MODE,x,w,$]},se={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",F(A).join("\\b|"),"|",F(L).join("\\b|"),"\\b)"),i,t.concat(_,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[Y]};Y.contains.push(se);const ae=[j,Z,e.C_BLOCK_COMMENT_MODE,x,w,$],ue={begin:t.concat(/#\[\s*\\?/,t.either(a,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:C,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:C,keyword:["new","array"]},contains:["self",...ae]},...ae,{scope:"meta",variants:[{match:a},{match:o}]}]};return{case_insensitive:!1,keywords:V,contains:[ue,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},l,{scope:"variable.language",match:/\$this\b/},s,se,Z,{match:[/const/,/\s/,i],scope:{1:"keyword",3:"variable.constant"}},$,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:V,contains:["self",ue,s,Z,e.C_BLOCK_COMMENT_MODE,x,w]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},x,w]}}return qC=r,qC}var ZC,T$;function Vpe(){if(T$)return ZC;T$=1;function r(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}return ZC=r,ZC}var jC,E$;function Fpe(){if(E$)return jC;E$=1;function r(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}return jC=r,jC}var XC,C$;function $pe(){if(C$)return XC;C$=1;function r(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),i=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],l={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:i,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},d={className:"subst",begin:/\{/,end:/\}/,keywords:l,illegal:/#/},f={begin:/\{\{/,relevance:0},g={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,f,d]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,f,d]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,f,d]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},m="[0-9](_?[0-9])*",_=`(\\b(${m}))?\\.(${m})|\\b(${m})\\.`,x=`\\b|${i.join("|")}`,w={className:"number",relevance:0,variants:[{begin:`(\\b(${m})|(${_}))[eE][+-]?(${m})[jJ]?(?=${x})`},{begin:`(${_})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${x})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${x})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${x})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${x})`},{begin:`\\b(${m})[jJ](?=${x})`}]},C={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:l,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,contains:["self",u,w,g,e.HASH_COMMENT_MODE]}]};return d.contains=[g,w,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:l,illegal:/(<\/|\?)|=>/,contains:[u,w,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},g,C,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[w,A,g]}]}}return XC=r,XC}var YC,A$;function Gpe(){if(A$)return YC;A$=1;function r(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}return YC=r,YC}var KC,D$;function Upe(){if(D$)return KC;D$=1;function r(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,i=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,i]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,i]},{scope:{1:"punctuation",2:"number"},match:[o,i]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,i]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}return KC=r,KC}var JC,M$;function Hpe(){if(M$)return JC;M$=1;function r(e){const t=e.regex,n=/(r#)?/,i=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},s="([ui](8|16|32|64|128|size)|f(32|64))?",l=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],u=["true","false","Some","None","Ok","Err"],d=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],f=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:f,keyword:l,literal:u,built_in:d},illegal:""},o]}}return JC=r,JC}var QC,I$;function Wpe(){if(I$)return QC;I$=1;const r=u=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:u.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[u.APOS_STRING_MODE,u.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:u.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),e=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],t=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],n=[...e,...t],i=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),a=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),o=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),s=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function l(u){const d=r(u),f=o,g=a,m="@[a-z-]+",_="and or not only",w={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[u.C_LINE_COMMENT_MODE,u.C_BLOCK_COMMENT_MODE,d.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},d.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+n.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+g.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+f.join("|")+")"},w,{begin:/\(/,end:/\)/,contains:[d.CSS_NUMBER_MODE]},d.CSS_VARIABLE,{className:"attribute",begin:"\\b("+s.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[d.BLOCK_COMMENT,w,d.HEXCOLOR,d.CSS_NUMBER_MODE,u.QUOTE_STRING_MODE,u.APOS_STRING_MODE,d.IMPORTANT,d.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:m,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:_,attribute:i.join(" ")},contains:[{begin:m,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},w,u.QUOTE_STRING_MODE,u.APOS_STRING_MODE,d.HEXCOLOR,d.CSS_NUMBER_MODE]},d.FUNCTION_DISPATCH]}}return QC=l,QC}var eA,k$;function qpe(){if(k$)return eA;k$=1;function r(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}return eA=r,eA}var tA,L$;function Zpe(){if(L$)return tA;L$=1;function r(e){const t=e.regex,n=e.COMMENT("--","$"),i={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],s=["double precision","large object","with timezone","without timezone"],l=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],u=["add","asc","collation","desc","final","first","last","view"],d=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],f=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],g=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],m=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],_=f,x=[...d,...u].filter(F=>!f.includes(F)),w={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},C={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},A={match:t.concat(/\b/,t.either(..._),/\s*\(/),relevance:0,keywords:{built_in:_}};function L(F){return t.concat(/\b/,t.either(...F.map($=>$.replace(/\s+/,"\\s+"))),/\b/)}const O={scope:"keyword",match:L(m),relevance:0};function V(F,{exceptions:$,when:H}={}){const Z=H;return $=$||[],F.map(j=>j.match(/\|\d+$/)||$.includes(j)?j:Z(j)?`${j}|0`:j)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:V(x,{when:F=>F.length<3}),literal:o,type:l,built_in:g},contains:[{scope:"type",match:L(s)},O,A,w,i,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,C]}}return tA=r,tA}var rA,P$;function jpe(){if(P$)return rA;P$=1;function r(H){return H?typeof H=="string"?H:H.source:null}function e(H){return t("(?=",H,")")}function t(...H){return H.map(j=>r(j)).join("")}function n(H){const Z=H[H.length-1];return typeof Z=="object"&&Z.constructor===Object?(H.splice(H.length-1,1),Z):{}}function i(...H){return"("+(n(H).capture?"":"?:")+H.map(Y=>r(Y)).join("|")+")"}const a=H=>t(/\b/,H,/\w$/.test(H)?/\b/:/\B/),o=["Protocol","Type"].map(a),s=["init","self"].map(a),l=["Any","Self"],u=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],d=["false","nil","true"],f=["assignment","associativity","higherThan","left","lowerThan","none","right"],g=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],m=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],_=i(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),x=i(_,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),w=t(_,x,"*"),C=i(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),A=i(C,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),L=t(C,A,"*"),O=t(/[A-Z]/,A,"*"),V=["attached","autoclosure",t(/convention\(/,i("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",t(/objc\(/,L,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],F=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function $(H){const Z={match:/\s+/,relevance:0},j=H.COMMENT("/\\*","\\*/",{contains:["self"]}),Y=[H.C_LINE_COMMENT_MODE,j],se={match:[/\./,i(...o,...s)],className:{2:"keyword"}},ae={match:t(/\./,i(...u)),relevance:0},ue=u.filter(Br=>typeof Br=="string").concat(["_|0"]),fe=u.filter(Br=>typeof Br!="string").concat(l).map(a),le={variants:[{className:"keyword",match:i(...fe,...s)}]},ge={$pattern:i(/\b\w+/,/#\w+/),keyword:ue.concat(g),literal:d},xe=[se,ae,le],Me={match:t(/\./,i(...m)),relevance:0},Ve={className:"built_in",match:t(/\b/,i(...m),/(?=\()/)},Fe=[Me,Ve],Xe={match:/->/,relevance:0},ot={className:"operator",relevance:0,variants:[{match:w},{match:`\\.(\\.|${x})+`}]},et=[Xe,ot],it="([0-9]_*)+",kt="([0-9a-fA-F]_*)+",Ht={className:"number",relevance:0,variants:[{match:`\\b(${it})(\\.(${it}))?([eE][+-]?(${it}))?\\b`},{match:`\\b0x(${kt})(\\.(${kt}))?([pP][+-]?(${it}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},lt=(Br="")=>({className:"subst",variants:[{match:t(/\\/,Br,/[0\\tnr"']/)},{match:t(/\\/,Br,/u\{[0-9a-fA-F]{1,8}\}/)}]}),st=(Br="")=>({className:"subst",match:t(/\\/,Br,/[\t ]*(?:[\r\n]|\r\n)/)}),Ct=(Br="")=>({className:"subst",label:"interpol",begin:t(/\\/,Br,/\(/),end:/\)/}),rt=(Br="")=>({begin:t(Br,/"""/),end:t(/"""/,Br),contains:[lt(Br),st(Br),Ct(Br)]}),vt=(Br="")=>({begin:t(Br,/"/),end:t(/"/,Br),contains:[lt(Br),Ct(Br)]}),Qe={className:"string",variants:[rt(),rt("#"),rt("##"),rt("###"),vt(),vt("#"),vt("##"),vt("###")]},Ft=[H.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[H.BACKSLASH_ESCAPE]}],Kt={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:Ft},Le=Br=>{const ua=t(Br,/\//),pi=t(/\//,Br);return{begin:ua,end:pi,contains:[...Ft,{scope:"comment",begin:`#(?!.*${pi})`,end:/$/}]}},Mr={scope:"regexp",variants:[Le("###"),Le("##"),Le("#"),Kt]},Lt={match:t(/`/,L,/`/)},Xt={className:"variable",match:/\$\d+/},nr={className:"variable",match:`\\$${A}+`},lr=[Lt,Xt,nr],Yn={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:F,contains:[...et,Ht,Qe]}]}},Tn={scope:"keyword",match:t(/@/,i(...V),e(i(/\(/,/\s+/)))},Aa={scope:"meta",match:t(/@/,L)},Pn=[Yn,Tn,Aa],mt={match:e(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:t(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,A,"+")},{className:"type",match:O,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:t(/\s+&\s+/,e(O)),relevance:0}]},$t={begin://,keywords:ge,contains:[...Y,...xe,...Pn,Xe,mt]};mt.contains.push($t);const qe={match:t(L,/\s*:/),keywords:"_|0",relevance:0},wr={begin:/\(/,end:/\)/,relevance:0,keywords:ge,contains:["self",qe,...Y,Mr,...xe,...Fe,...et,Ht,Qe,...lr,...Pn,mt]},zr={begin://,keywords:"repeat each",contains:[...Y,mt]},Dn={begin:i(e(t(L,/\s*:/)),e(t(L,/\s+/,L,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:L}]},sa={begin:/\(/,end:/\)/,keywords:ge,contains:[Dn,...Y,...xe,...et,Ht,Qe,...Pn,mt,wr],endsParent:!0,illegal:/["']/},ct={match:[/(func|macro)/,/\s+/,i(Lt.match,L,w)],className:{1:"keyword",3:"title.function"},contains:[zr,sa,Z],illegal:[/\[/,/%/]},yr={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[zr,sa,Z],illegal:/\[|%/},tr={match:[/operator/,/\s+/,w],className:{1:"keyword",3:"title"}},fi={begin:[/precedencegroup/,/\s+/,O],className:{1:"keyword",3:"title"},contains:[mt],keywords:[...f,...d],end:/}/},la={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},cr={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},Da={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,L,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:ge,contains:[zr,...xe,{begin:/:/,end:/\{/,keywords:ge,contains:[{scope:"title.class.inherited",match:O},...xe],relevance:0}]};for(const Br of Qe.variants){const ua=Br.contains.find(be=>be.label==="interpol");ua.keywords=ge;const pi=[...xe,...Fe,...et,Ht,Qe,...lr];ua.contains=[...pi,{begin:/\(/,end:/\)/,contains:["self",...pi]}]}return{name:"Swift",keywords:ge,contains:[...Y,ct,yr,la,cr,Da,tr,fi,{beginKeywords:"import",end:/$/,contains:[...Y],relevance:0},Mr,...xe,...Fe,...et,Ht,Qe,...lr,...Pn,mt,wr]}}return rA=$,rA}var nA,R$;function Xpe(){if(R$)return nA;R$=1;function r(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",i={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},s={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},l=e.inherit(s,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),m={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},_={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},x={begin:/\{/,end:/\}/,contains:[_],illegal:"\\n",relevance:0},w={begin:"\\[",end:"\\]",contains:[_],illegal:"\\n",relevance:0},C=[i,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},m,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},x,w,o,s],A=[...C];return A.pop(),A.push(l),_.contains=A,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:C}}return nA=r,nA}var iA,N$;function Ype(){if(N$)return iA;N$=1;const r="[A-Za-z$_][0-9A-Za-z$_]*",e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],t=["true","false","null","undefined","NaN","Infinity"],n=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],i=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],a=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],o=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],s=[].concat(a,n,i);function l(d){const f=d.regex,g=(lt,{after:st})=>{const Ct="",end:""},x=/<[A-Za-z0-9\\._:-]+\s*\/>/,w={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(lt,st)=>{const Ct=lt[0].length+lt.index,rt=lt.input[Ct];if(rt==="<"||rt===","){st.ignoreMatch();return}rt===">"&&(g(lt,{after:Ct})||st.ignoreMatch());let vt;const Qe=lt.input.substring(Ct);if(vt=Qe.match(/^\s*=/)){st.ignoreMatch();return}if((vt=Qe.match(/^\s+extends\s+/))&&vt.index===0){st.ignoreMatch();return}}},C={$pattern:r,keyword:e,literal:t,built_in:s,"variable.language":o},A="[0-9](_?[0-9])*",L=`\\.(${A})`,O="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",V={className:"number",variants:[{begin:`(\\b(${O})((${L})|\\.)?|(${L}))[eE][+-]?(${A})\\b`},{begin:`\\b(${O})\\b((${L})\\b|\\.)?|(${L})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},F={className:"subst",begin:"\\$\\{",end:"\\}",keywords:C,contains:[]},$={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,F],subLanguage:"xml"}},H={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,F],subLanguage:"css"}},Z={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[d.BACKSLASH_ESCAPE,F],subLanguage:"graphql"}},j={className:"string",begin:"`",end:"`",contains:[d.BACKSLASH_ESCAPE,F]},se={className:"comment",variants:[d.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:m+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),d.C_BLOCK_COMMENT_MODE,d.C_LINE_COMMENT_MODE]},ae=[d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,$,H,Z,j,{match:/\$\d+/},V];F.contains=ae.concat({begin:/\{/,end:/\}/,keywords:C,contains:["self"].concat(ae)});const ue=[].concat(se,F.contains),fe=ue.concat([{begin:/(\s*)\(/,end:/\)/,keywords:C,contains:["self"].concat(ue)}]),le={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:fe},ge={variants:[{match:[/class/,/\s+/,m,/\s+/,/extends/,/\s+/,f.concat(m,"(",f.concat(/\./,m),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,m],scope:{1:"keyword",3:"title.class"}}]},xe={relevance:0,match:f.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...n,...i]}},Me={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},Ve={variants:[{match:[/function/,/\s+/,m,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[le],illegal:/%/},Fe={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function Xe(lt){return f.concat("(?!",lt.join("|"),")")}const ot={match:f.concat(/\b/,Xe([...a,"super","import"].map(lt=>`${lt}\\s*\\(`)),m,f.lookahead(/\s*\(/)),className:"title.function",relevance:0},et={begin:f.concat(/\./,f.lookahead(f.concat(m,/(?![0-9A-Za-z$_(])/))),end:m,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},it={match:[/get|set/,/\s+/,m,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},le]},kt="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+d.UNDERSCORE_IDENT_RE+")\\s*=>",Ht={match:[/const|var|let/,/\s+/,m,/\s*/,/=\s*/,/(async\s*)?/,f.lookahead(kt)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[le]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:C,exports:{PARAMS_CONTAINS:fe,CLASS_REFERENCE:xe},illegal:/#(?![$_A-z])/,contains:[d.SHEBANG({label:"shebang",binary:"node",relevance:5}),Me,d.APOS_STRING_MODE,d.QUOTE_STRING_MODE,$,H,Z,j,se,{match:/\$\d+/},V,xe,{scope:"attr",match:m+f.lookahead(":"),relevance:0},Ht,{begin:"("+d.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[se,d.REGEXP_MODE,{className:"function",begin:kt,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:d.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:C,contains:fe}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:_.begin,end:_.end},{match:x},{begin:w.begin,"on:begin":w.isTrulyOpeningTag,end:w.end}],subLanguage:"xml",contains:[{begin:w.begin,end:w.end,skip:!0,contains:["self"]}]}]},Ve,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+d.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[le,d.inherit(d.TITLE_MODE,{begin:m,className:"title.function"})]},{match:/\.\.\./,relevance:0},et,{match:"\\$"+m,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[le]},ot,Fe,ge,it,{match:/\$[(.]/}]}}function u(d){const f=d.regex,g=l(d),m=r,_=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],x={begin:[/namespace/,/\s+/,d.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},w={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:_},contains:[g.exports.CLASS_REFERENCE]},C={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},A=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],L={$pattern:r,keyword:e.concat(A),literal:t,built_in:s.concat(_),"variable.language":o},O={className:"meta",begin:"@"+m},V=(Z,j,Y)=>{const se=Z.contains.findIndex(ae=>ae.label===j);if(se===-1)throw new Error("can not find mode to replace");Z.contains.splice(se,1,Y)};Object.assign(g.keywords,L),g.exports.PARAMS_CONTAINS.push(O);const F=g.contains.find(Z=>Z.scope==="attr"),$=Object.assign({},F,{match:f.concat(m,f.lookahead(/\s*\?:/))});g.exports.PARAMS_CONTAINS.push([g.exports.CLASS_REFERENCE,F,$]),g.contains=g.contains.concat([O,x,w,$]),V(g,"shebang",d.SHEBANG()),V(g,"use_strict",C);const H=g.contains.find(Z=>Z.label==="func.def");return H.relevance=0,Object.assign(g,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),g}return iA=u,iA}var aA,O$;function Kpe(){if(O$)return aA;O$=1;function r(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},i={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,s=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,l=/\d{1,2}(:\d{1,2}){1,2}/,u={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,a),/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,s,/ *#/)},{begin:t.concat(/# */,t.either(o,a),/ +/,t.either(s,l),/ *#/)}]},d={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},f={className:"label",begin:/^\w+:/},g=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),m=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,i,u,d,f,g,m,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[m]}]}}return aA=r,aA}var oA,z$;function Jpe(){if(z$)return oA;z$=1;function r(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),i=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},s={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},l={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},u={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},d={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:i},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,s,a,e.QUOTE_STRING_MODE,u,d,l]}}return oA=r,oA}var Pr=t$;Pr.registerLanguage("xml",mpe()),Pr.registerLanguage("bash",ype()),Pr.registerLanguage("c",_pe()),Pr.registerLanguage("cpp",bpe()),Pr.registerLanguage("csharp",xpe()),Pr.registerLanguage("css",wpe()),Pr.registerLanguage("markdown",Spe()),Pr.registerLanguage("diff",Tpe()),Pr.registerLanguage("ruby",Epe()),Pr.registerLanguage("go",Cpe()),Pr.registerLanguage("graphql",Ape()),Pr.registerLanguage("ini",Dpe()),Pr.registerLanguage("java",Mpe()),Pr.registerLanguage("javascript",Ipe()),Pr.registerLanguage("json",kpe()),Pr.registerLanguage("kotlin",Lpe()),Pr.registerLanguage("less",Ppe()),Pr.registerLanguage("lua",Rpe()),Pr.registerLanguage("makefile",Npe()),Pr.registerLanguage("perl",Ope()),Pr.registerLanguage("objectivec",zpe()),Pr.registerLanguage("php",Bpe()),Pr.registerLanguage("php-template",Vpe()),Pr.registerLanguage("plaintext",Fpe()),Pr.registerLanguage("python",$pe()),Pr.registerLanguage("python-repl",Gpe()),Pr.registerLanguage("r",Upe()),Pr.registerLanguage("rust",Hpe()),Pr.registerLanguage("scss",Wpe()),Pr.registerLanguage("shell",qpe()),Pr.registerLanguage("sql",Zpe()),Pr.registerLanguage("swift",jpe()),Pr.registerLanguage("yaml",Xpe()),Pr.registerLanguage("typescript",Ype()),Pr.registerLanguage("vbnet",Kpe()),Pr.registerLanguage("wasm",Jpe()),Pr.HighlightJS=Pr,Pr.default=Pr;var Qpe=P.defineComponent({props:{code:{type:String,required:!0},language:{type:String,default:""},autodetect:{type:Boolean,default:!0},ignoreIllegals:{type:Boolean,default:!0}},setup:function(r){var e=P.ref(r.language);P.watch(function(){return r.language},function(i){e.value=i});var t=P.computed(function(){return r.autodetect||!e.value}),n=P.computed(function(){return!t.value&&!TC.getLanguage(e.value)});return{className:P.computed(function(){return n.value?"":"hljs "+e.value}),highlightedCode:P.computed(function(){var i;if(n.value)return console.warn('The language "'+e.value+'" you specified could not be found.'),r.code.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'");if(t.value){var a=TC.highlightAuto(r.code);return e.value=(i=a.language)!==null&&i!==void 0?i:"",a.value}return(a=TC.highlight(r.code,{language:e.value,ignoreIllegals:r.ignoreIllegals})).value})}},render:function(){return P.h("pre",{},[P.h("code",{class:this.className,innerHTML:this.highlightedCode})])}}),ege={component:Qpe};const tge={class:"h-full flex flex-col bg-white shrink-0 !w-[400px] border-l"},rge={key:0},nge={class:"border-b flex items-center px-[10px] h-[49px] border-transparent border-solid border-b-gray-200"},ige={class:"flex gap-2 ml-auto"},age={key:1,class:"h-[calc(100vh-110px)] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},oge={key:0},sge={key:1},lge={class:"p-4"},uge={class:"flex justify-end mt-4 gap-x-3"},cge={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},hge={__name:"vs-editor-forms",props:P.mergeModels({selectedWidgetData:{type:Object,required:!1,default:null},selectedDashboard:{type:String,default:()=>""},currentWidgetData:{type:String,default:()=>""}},{selectedWidget:{},selectedWidgetModifiers:{}}),emits:P.mergeModels(["update-data"],["update:selectedWidget"]),setup(r,{emit:e}){var V,F;const t=(F=(V=P.getCurrentInstance())==null?void 0:V.proxy)==null?void 0:F.$notify,n=e;P.getCurrentInstance().appContext.app.component("highlightjs",ege.component);const a=r,o=P.ref(!1),s=P.ref(!0),l=P.ref(!1),u=P.ref(!1),d=P.ref(""),f=P.ref({}),g=P.useModel(r,"selectedWidget"),m=["table","text","number","stat","progress","listbar","map","pivot"],_=P.ref("data"),x=async()=>{try{await _r.delete(`/bi-dashboard/${a.selectedDashboard}/${a.selectedWidgetData.name}`);const $=new URL(window.top.location.href);$.searchParams.set("dashboard",a.selectedDashboard),$.searchParams.delete("widget"),window.top.history.pushState({},"",$),n("update-data"),o.value=!1,t({type:"success",title:"Успішно!",message:"Віджет успішно видалено"})}catch($){console.error($),t({type:"error",title:"Помилка!",message:"При спробі видалити віджет виникла помилка"})}},w=()=>{var $;d.value="",($=a.currentWidgetData)==null||$.columns.forEach(H=>{d.value+=`${H.name} ${H.type.split(" ")[0]}; -- ${H.title||""} `})},C=P.computed(()=>{const $=[{id:"data",label:"Дані"},{id:"style",label:"Стилі"},{id:"yaml",label:"{ }"}];return $==null?void 0:$.filter(H=>{var Z,j,Y;return H.id==="style"?!(m!=null&&m.includes(((Z=a.selectedWidgetData)==null?void 0:Z.type)||((Y=(j=a.selectedWidgetData)==null?void 0:j.data)==null?void 0:Y.type))):!0})}),A=()=>{var $,H,Z,j,Y,se,ae,ue,fe;f.value={title:($=a.selectedWidgetData)==null?void 0:$.title,type:(H=a.selectedWidgetData)==null?void 0:H.type,table:(Z=a.selectedWidgetData)==null?void 0:Z.table_name,query:(Y=(j=a.selectedWidgetData)==null?void 0:j.data)==null?void 0:Y.query,x:(ae=(se=a.selectedWidgetData)==null?void 0:se.data)==null?void 0:ae.x,cls:(fe=(ue=a.selectedWidgetData)==null?void 0:ue.data)==null?void 0:fe.cls},u.value=!0},L=async()=>{try{await _r.put(`/bi-dashboard/${a.selectedDashboard}/${a.selectedWidgetData.name}`,f.value),t({type:"success",title:"Успішно!",message:"Дані успішно змінено"}),await n("update-data"),u.value=!1}catch{t({type:"error",title:"Помилка!",message:"При спробі внести зміни виникла помилка"})}};P.watch(g,$=>{s.value=!1;const H=new URL(window.top.location.href);$?(H.searchParams.set("widget",$),window.top.history.pushState({},"",H)):(H.searchParams.delete("widget"),window.top.history.pushState({},"",H)),setTimeout(()=>s.value=!0)}),P.watch(()=>a.currentWidgetData,()=>{w()},{deep:!0}),P.onMounted(w);const O={title:{type:"text",ua:"Заголовок",placeholder:"Заголовок",validators:["required"]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'
    {{ label }}
    '},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"text",ua:"Таблиця",placeholder:"Таблиця"},query:{type:"Text",ua:"Query",placeholder:"Query"},x:{type:"Text",ua:"X Axis",placeholder:"X Axis"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}};return($,H)=>{var fe,le,ge,xe,Me,Ve,Fe,Xe,ot,et,it;const Z=P.resolveComponent("VsFormRadio"),j=P.resolveComponent("VsPopover"),Y=P.resolveComponent("VsConfirm"),se=P.resolveComponent("VsForm"),ae=P.resolveComponent("VsDialog"),ue=P.resolveComponent("highlightjs");return P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createElementVNode("div",tge,[r.selectedWidgetData?(P.openBlock(),P.createElementBlock("div",rge,[P.createElementVNode("div",nge,[s.value?(P.openBlock(),P.createBlock(Z,{key:0,options:C.value,modelValue:_.value,"onUpdate:modelValue":H[0]||(H[0]=kt=>_.value=kt),view:"buttons"},null,8,["options","modelValue"])):(P.openBlock(),P.createBlock(Z,{key:1,options:C.value,modelValue:_.value,"onUpdate:modelValue":H[1]||(H[1]=kt=>_.value=kt),view:"buttons"},null,8,["options","modelValue"])),P.createElementVNode("div",ige,[P.createVNode(j,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:H[2]||(H[2]=kt=>l.value=!0)},[P.createVNode(yC,{class:"h-[16px] text-gray-500"})])]),default:P.withCtx(()=>[H[12]||(H[12]=P.createTextVNode(" Переглянути колонки таблиці "))]),_:1,__:[12]}),P.createVNode(j,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{onClick:A,class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},[P.createVNode(y4,{class:"h-[16px]"})])]),default:P.withCtx(()=>[H[13]||(H[13]=P.createTextVNode(" Редагувати віджет "))]),_:1,__:[13]}),P.createVNode(j,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:H[3]||(H[3]=kt=>o.value=!0)},[P.createVNode(P.unref(m4),{class:"h-[16px]"})])]),default:P.withCtx(()=>[H[14]||(H[14]=P.createTextVNode(" Видалити віджет "))]),_:1,__:[14]})])]),(fe=r.currentWidgetData)!=null&&fe.status?(P.openBlock(),P.createBlock(j0,{key:0,title:(le=r.currentWidgetData)==null?void 0:le.title,text:(ge=r.currentWidgetData)==null?void 0:ge.message},null,8,["title","text"])):(P.openBlock(),P.createElementBlock("div",age,[s.value&&r.currentWidgetData?(P.openBlock(),P.createElementBlock("div",oge,[(P.openBlock(),P.createBlock(P.resolveDynamicComponent(P.unref(R4)["vs-editor-form-"+_.value]),{widgetName:(xe=r.selectedWidgetData)==null?void 0:xe.name,yamlValue:((Me=r.selectedWidgetData)==null?void 0:Me.yml)||"",data:r.selectedWidgetData,controls:(Ve=r.selectedWidgetData)==null?void 0:Ve.controls,columns:(Fe=r.currentWidgetData)==null?void 0:Fe.columns,onUpdateDashboard:H[4]||(H[4]=kt=>$.$emit("update-data"))},null,40,["widgetName","yamlValue","data","controls","columns"]))])):(P.openBlock(),P.createElementBlock("div",sge,[(P.openBlock(),P.createBlock(P.resolveDynamicComponent(P.unref(R4)["vs-editor-form-"+_.value]),{widgetName:(Xe=r.selectedWidgetData)==null?void 0:Xe.name,yamlValue:((ot=r.selectedWidgetData)==null?void 0:ot.yml)||"",data:r.selectedWidgetData,controls:(et=r.selectedWidgetData)==null?void 0:et.controls,columns:(it=r.currentWidgetData)==null?void 0:it.columns,onUpdateDashboard:H[5]||(H[5]=kt=>$.$emit("update-data"))},null,40,["widgetName","yamlValue","data","controls","columns"]))])),P.createVNode(Y,{visible:o.value,"onUpdate:visible":H[7]||(H[7]=kt=>o.value=kt),title:"Ви впевнені?"},{default:P.withCtx(()=>[P.createElementVNode("div",lge,[H[15]||(H[15]=P.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей віджет? ",-1)),P.createElementVNode("div",uge,[P.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:H[6]||(H[6]=kt=>o.value=!1)}," Скасувати "),P.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:x}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"])]))])):(P.openBlock(),P.createBlock(j0,{key:1,title:"Оберіть один з віджетів",text:""}))]),P.createVNode(ae,{visible:u.value,"onUpdate:visible":H[10]||(H[10]=kt=>u.value=kt),title:"Редагувати віджет"},{footer:P.withCtx(()=>[P.createElementVNode("div",cge,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:H[9]||(H[9]=kt=>u.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:L,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:P.withCtx(()=>[P.createVNode(se,{scheme:O,modelValue:f.value,"onUpdate:modelValue":H[8]||(H[8]=kt=>f.value=kt)},null,8,["modelValue"])]),_:1},8,["visible"]),P.createVNode(ae,{visible:l.value,"onUpdate:visible":H[11]||(H[11]=kt=>l.value=kt),title:"Переглянути структуру таблиці"},{default:P.withCtx(()=>[P.createVNode(ue,{language:"sql",code:d.value,disabled:!0,theme:"dark-theme",id:"sqlData",class:"w-full overflow-hidden text-white !bg-black rounded",contenteditable:"true"},null,8,["code"])]),_:1},8,["visible"])],64)}}},dge={},fge={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-plus"};function pge(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("svg",fge,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M12 5l0 14"},null,-1),P.createElementVNode("path",{d:"M5 12l14 0"},null,-1)]))}const gge=fr(dge,[["render",pge]]),vge={class:"mb-4 overflow-auto scrollbar max-h-96"},mge={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},yge={__name:"vs-editor-create-widget",props:{columns:{type:Array,default:()=>[]},selectedDashboard:String},emits:"update-data",setup(r,{emit:e}){var d;const t=(d=P.getCurrentInstance().proxy)==null?void 0:d.$notify,n=e,i=r,a=P.ref(!1),o=P.ref({}),s=P.ref(),l=async()=>{try{await s.value.doValidation(),await _r.post(`/bi-dashboard/${i.selectedDashboard}`,o.value),await t({type:"success",title:"Успішно!",message:"Віджет успішно створено"}),await n("update-data"),o.value={},a.value=!1}catch{t({type:"error",title:"Помилка!",message:"При спробі створити віджет сталася помилка"})}},u=P.computed(()=>{var f,g,m,_;return{title:{type:"text",label:"Widget title",placeholder:"Widget title",validators:["required"]},x:{type:"radio",label:"X Axis",view:"buttons",style:{size:"xs"},validators:["required"],options:(g=(f=i.columns)==null?void 0:f.filter(x=>(x==null?void 0:x.type)=="text"||(x==null?void 0:x.type)==="date"||(x==null?void 0:x.type)==="timestamp without time zone"||(x==null?void 0:x.type)==="boolean"||(x==null?void 0:x.type)==="integer"))==null?void 0:g.map(({name:x,type:w})=>({id:x,label:x,type:w}))},metric:{type:"radio",label:"Y Axis",view:"buttons",validators:["required"],style:{size:"xs"},options:[{id:"count",label:"count"},...(_=(m=i.columns)==null?void 0:m.filter(x=>(x==null?void 0:x.type)==="numeric"||(x==null?void 0:x.type)==="double precision"))==null?void 0:_.map(({name:x,type:w})=>({id:x,label:x,type:w}))]},col:{type:"radio",label:"Columns count",validators:["required"],options:[{id:1,label:1},{id:2,label:2},{id:3,label:3},{id:4,label:4},{id:6,label:6},{id:9,label:9},{id:12,label:12}]},type:{type:"radio",view:"buttons",validators:["required"],slots:{label:'
    {{ label }}
    '},options:[{label:"Bar",id:"bar"},{label:"Funnel",id:"funnel"},{label:"Line",id:"line"},{label:"List bar",id:"listbar"},{label:"Number",id:"number"},{label:"Pie",id:"pie"},{label:"Donut",id:"donut"},{label:"Pivot",id:"pivot"},{label:"Table",id:"table"},{label:"Progress",id:"progress"},{label:"Stat",id:"stat"},{label:"Text",id:"text"},{label:"Map",id:"map"}]},table:{type:"Text",ua:"Table",placeholder:"Table"},query:{type:"Text",ua:"Query",placeholder:"Query"},cls:{type:"Text",ua:"Cls",placeholder:"Cls"}}});return(f,g)=>{const m=P.resolveComponent("VsPopover"),_=P.resolveComponent("VsForm"),x=P.resolveComponent("VsDialog");return P.openBlock(),P.createElementBlock("div",null,[P.createVNode(m,{placement:"right",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("div",null,[P.createElementVNode("button",{class:"z-50 flex items-center justify-center h-[50px] !w-[50px] text-2xl text-white transition-colors bg-blue-500 rounded-full cursor-pointer hover:bg-blue-700",onClick:g[0]||(g[0]=w=>a.value=!0)},[P.createVNode(gge,{height:"20",width:"20"})])])]),default:P.withCtx(()=>[g[4]||(g[4]=P.createTextVNode(" Створити віджет "))]),_:1,__:[4]}),P.createVNode(x,{visible:a.value,"onUpdate:visible":g[3]||(g[3]=w=>a.value=w),title:"Створити віджет"},{footer:P.withCtx(()=>[P.createElementVNode("div",mge,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:g[2]||(g[2]=w=>a.value=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:l,class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Створити ")])]),default:P.withCtx(()=>[P.createElementVNode("div",vge,[P.createVNode(_,{ref_key:"form",ref:s,scheme:u.value,modelValue:o.value,"onUpdate:modelValue":g[1]||(g[1]=w=>o.value=w)},null,8,["scheme","modelValue"])])]),_:1},8,["visible"])])}}},_ge={},bge={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-align-box-left-stretch"};function xge(r,e){return P.openBlock(),P.createElementBlock("svg",bge,e[0]||(e[0]=[P.createStaticVNode('',5)]))}const B$=fr(_ge,[["render",xge]]),wge={},Sge={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-filter"};function Tge(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("svg",Sge,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z"},null,-1)]))}const Ege=fr(wge,[["render",Tge]]),Cge={},Age={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-dots-vertical"};function Dge(r,e){return P.openBlock(),P.createElementBlock("svg",Age,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),P.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),P.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const Mge={components:{deleteIcon:m4,editIcon:y4,IconGrid:B$,IconMore:fr(Cge,[["render",Dge]]),IconFilter:Ege,IconTable:yC},watch:{dashboardData(r){var t,n;if(this.formEditValue={title:r==null?void 0:r.title,description:r==null?void 0:r.description,table_name:r==null?void 0:r.table_name,db:r==null?void 0:r.db,public:r==null?void 0:r.public,words:r==null?void 0:r.words},!((t=r==null?void 0:r.panels)!=null&&t.length))return[];const e=(n=r==null?void 0:r.panels)==null?void 0:n.map(i=>{var s,l;const{title:a="",type:o=""}=((l=(s=r==null?void 0:r.widgets)==null?void 0:s.find(u=>(u==null?void 0:u.name)===(i==null?void 0:i.widget)))==null?void 0:l.data)||{};return{title:a,type:o,...i}});this.formGridValue={panels:e},this.formFilterValue={filters:(r==null?void 0:r.filters)||null}}},data(){return{isDeleteConfirm:!1,isFormEdit:!1,isFormGrid:!1,isFormFilter:!1,isVisibleTableColumns:!1,formEditValue:{},formGridValue:{},formFilterValue:{},editDashboardScheme:[{type:"Text",key:"title",label:"Заголовок",validators:["required"]},{type:"Text",key:"description",label:"Опис"},{type:"Text",key:"table_name",validators:["required"],label:"Назва таблиці"},{type:"Text",key:"words",label:"Ключові слова"},{type:"Text",key:"db",label:"База даних",original:{type:"Text",ua:"Назва",col:8}},{type:"Switcher",key:"public",label:"Публічний",original:{type:"Text",ua:"Назва",col:8}}],editGridScheme:[{type:"DataTable",ua:"Панелі",key:"panels",editable:!1,addition:!1,colModel:[{name:"title",ua:"Назва",type:"Text",key:"col"},{name:"type",ua:"Тип",type:"Text",key:"col",disabled:!0},{name:"widget",type:"Text",ua:"Назва",key:"widget",hiddenCol:!0},{name:"col",ua:"Кількість стовпчиків",type:"Text",key:"col"}]}],editFilterScheme:[{name:"filters",type:"DataTable",colModel:[{ua:"Підпис",type:"Text",key:"label"},{ua:"Тип",type:"Text",key:"type"}]}]}},props:{selected:{type:String,default:()=>""},dashboardData:{type:Object,default:()=>{}},selectedWidgetData:{type:Object,default:()=>{}},columns:{type:Array}},methods:{async editDashboard(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formEdit)==null||e.doValidation(),await _r.put(`/bi-dashboard/${this.selected}`,this.formEditValue),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormEdit=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"при спробі оновити дані виникла помилка"})}},async editDashboardGrid(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formGrid)==null||e.doValidation(),await _r.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormGrid=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async editDashboardFilters(){var r,e;try{(e=(r=this.$refs)==null?void 0:r.formFilter)==null||e.doValidation(),await _r.put(`/bi-dashboard/${this.selected}`,{...this.formEditValue,...this.formGridValue,...this.formFilterValue}),await this.$notify({title:"Успішно!",type:"success",message:"Дані успішно оновлено"}),this.isFormFilter=!1,await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі оновити дані виникла помилка"})}},async deleteDashboard(){try{await _r.delete(`/bi-dashboard/${this.selected}`);const r=new URL(window.top.location.href);r.searchParams.delete("dashboard"),r.searchParams.delete("widget"),window.history.pushState({},"",r),await this.$notify({title:"Успішно!",type:"success",message:"Дашборд видалено успішно"}),this.isDeleteConfirm=!1,await this.$emit("update:selected",null),await this.$emit("update-editor")}catch{this.$notify({title:"Помилка!",type:"error",message:"При спробі видалити дашборд виникла помилка"})}},closePopover(){document.body.click()}}},Ige={class:"bg-white h-[49px] min-h-[49px] mb-[8px] flex justify-between px-[10px] py-[15px] items-center border-b border-b-solid border-b-gray-200"},kge={class:"flex items-center gap-2 text-center truncate grow lg:text-start"},Lge={class:"block text-sm font-semibold leading-4 text-gray-800 truncate"},Pge={class:"text-[12px] text-gray-500"},Rge={key:0,class:"flex"},Nge={class:"pr-[5px] flex items-center gap-[8px] mr-[5px] flex"},Oge={class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200"},zge={class:"flex flex-col items-start -ml-2 -mr-2"},Bge={class:"p-4"},Vge={class:"flex justify-end mt-4 gap-x-3"},Fge={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},$ge={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"},Gge={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function Uge(r,e,t,n,i,a){var m,_,x,w,C;const o=P.resolveComponent("IconFilter"),s=P.resolveComponent("VsPopover"),l=P.resolveComponent("IconGrid"),u=P.resolveComponent("IconMore"),d=P.resolveComponent("VsConfirm"),f=P.resolveComponent("VsForm"),g=P.resolveComponent("VsDialog");return P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createElementVNode("div",Ige,[P.createElementVNode("div",null,[P.createElementVNode("div",kge,[P.createElementVNode("span",Lge,P.toDisplayString((m=t.dashboardData)==null?void 0:m.title)+" "+P.toDisplayString((_=t.selectedWidgetData)!=null&&_.title?` / ${(x=t.selectedWidgetData)==null?void 0:x.title}`:""),1),P.createElementVNode("span",Pge,P.toDisplayString((w=t.selectedWidgetData)!=null&&w.table_name?`${(C=t.selectedWidgetData)==null?void 0:C.table_name}`:""),1)])]),t.selected?(P.openBlock(),P.createElementBlock("div",Rge,[P.createElementVNode("div",Nge,[P.createVNode(s,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[0]||(e[0]=A=>i.isFormFilter=!0)},[P.createVNode(o,{class:"h-[16px] text-gray-500"})])]),default:P.withCtx(()=>[e[19]||(e[19]=P.createTextVNode(" Редагувати фільтри "))]),_:1,__:[19]}),P.createVNode(s,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createElementVNode("button",{class:"h-[30px] w-[30px] rounded-full bg-gray-100 flex items-center justify-center duration-300 hover:bg-gray-200",onClick:e[1]||(e[1]=A=>i.isFormGrid=!0)},[P.createVNode(l,{class:"h-[16px] text-gray-500"})])]),default:P.withCtx(()=>[e[20]||(e[20]=P.createTextVNode(" Редагувати структуру дашборду "))]),_:1,__:[20]}),P.createVNode(s,{placement:"left",trigger:"hover"},{reference:P.withCtx(()=>[P.createVNode(s,{placement:"bottom-left"},{reference:P.withCtx(()=>[P.createElementVNode("button",Oge,[P.createVNode(u,{class:"h-[16px]"})])]),default:P.withCtx(()=>[P.createElementVNode("div",zge,[P.createElementVNode("button",{onClick:e[2]||(e[2]=A=>{a.closePopover(),i.isFormEdit=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Редагувати дашборд "),P.createElementVNode("button",{onClick:e[3]||(e[3]=A=>{a.closePopover(),i.isDeleteConfirm=!0}),class:"px-[8px] py-[4px] hover:bg-gray-100 w-full text-start rounded-lg"}," Видалити дашборд ")])]),_:1})]),default:P.withCtx(()=>[e[21]||(e[21]=P.createTextVNode(" Керування дашбордом "))]),_:1,__:[21]})])])):P.createCommentVNode("",!0)]),P.createVNode(d,{visible:i.isDeleteConfirm,"onUpdate:visible":e[6]||(e[6]=A=>i.isDeleteConfirm=A),size:"small",title:"Ви впевнені?"},{default:P.withCtx(()=>[P.createElementVNode("div",Bge,[e[22]||(e[22]=P.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей дашборд? ",-1)),P.createElementVNode("div",Vge,[P.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-medium text-gray-800 bg-white border border-gray-200 rounded-lg shadow-sm gap-x-2 hover:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-50 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",onClick:e[4]||(e[4]=A=>i.isDeleteConfirm=!1)}," Скасувати "),P.createElementVNode("button",{type:"button",class:"inline-flex items-center px-3 py-2 text-sm font-semibold text-white bg-red-500 border border-transparent rounded-lg gap-x-2 hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:e[5]||(e[5]=(...A)=>a.deleteDashboard&&a.deleteDashboard(...A))}," Так, я впевнена(ий) ")])])]),_:1},8,["visible"]),P.createVNode(g,{visible:i.isFormEdit,"onUpdate:visible":e[10]||(e[10]=A=>i.isFormEdit=A),title:"Редагувати дашборд"},{footer:P.withCtx(()=>[P.createElementVNode("div",Fge,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[8]||(e[8]=A=>i.isFormEdit=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:e[9]||(e[9]=(...A)=>a.editDashboard&&a.editDashboard(...A)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:P.withCtx(()=>[P.createVNode(f,{ref:"formEdit",scheme:i.editDashboardScheme,modelValue:i.formEditValue,"onUpdate:modelValue":e[7]||(e[7]=A=>i.formEditValue=A)},null,8,["scheme","modelValue"])]),_:1},8,["visible"]),P.createVNode(g,{visible:i.isFormGrid,"onUpdate:visible":e[14]||(e[14]=A=>i.isFormGrid=A),title:"Редагувати структуру дашборду"},{footer:P.withCtx(()=>[P.createElementVNode("div",$ge,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[12]||(e[12]=A=>i.isFormGrid=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:e[13]||(e[13]=(...A)=>a.editDashboardGrid&&a.editDashboardGrid(...A)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:P.withCtx(()=>[P.createVNode(f,{ref:"formgrid",scheme:i.editGridScheme,modelValue:i.formGridValue,"onUpdate:modelValue":e[11]||(e[11]=A=>i.formGridValue=A)},null,8,["scheme","modelValue"])]),_:1},8,["visible"]),P.createVNode(g,{visible:i.isFormFilter,"onUpdate:visible":e[18]||(e[18]=A=>i.isFormFilter=A),title:"Редагувати фільтри"},{footer:P.withCtx(()=>[P.createElementVNode("div",Gge,[P.createElementVNode("button",{style:{border:"1px solid #000"},onClick:e[16]||(e[16]=A=>i.isFormFilter=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border-gray-200 rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Скасувати "),P.createElementVNode("button",{onClick:e[17]||(e[17]=(...A)=>a.editDashboardFilters&&a.editDashboardFilters(...A)),class:"py-2 px-3 inline-flex items-center gap-x-2 text-[14px] font-[400] whitespace-nowrap text-white bg-blue-500 rounded-lg !border-gray-200 hover:bg-blue-700 duration-300"}," Зберегти ")])]),default:P.withCtx(()=>[P.createVNode(f,{ref:"formFilter",scheme:i.editFilterScheme,modelValue:i.formFilterValue,"onUpdate:modelValue":e[15]||(e[15]=A=>i.formFilterValue=A)},null,8,["scheme","modelValue"])]),_:1},8,["visible"])],64)}const Hge=fr(Mge,[["render",Uge]]),Wge={class:"relative flex-grow h-full"},qge={class:"grid flex-grow w-full grid-cols-12 gap-4 p-[10px] h-[calc(100%-120px)] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Zge=fr({__name:"vs-editor",props:{prefix:String,customClass:{type:String,default:()=>"w-screen h-screen"}},setup(r){const e=r;_r.defaults.baseURL=e.prefix||"/api";const t=P.ref(""),n=P.ref(""),i=P.ref(null),a=P.ref(null),o=async()=>{if(!t.value){i.value=null;return}try{const{data:l}=await _r.get(`/bi-dashboard/${t.value}`);i.value=l}catch(l){console.error(l)}},s=P.computed(()=>{var l,u,d;return(d=Array.isArray((l=i.value)==null?void 0:l.widgets)?(u=i.value)==null?void 0:u.widgets:[])==null?void 0:d.find(f=>(f==null?void 0:f.name)===n.value)});return P.watch(t,(l,u)=>{var f,g,m;u&&(n.value="");const d=new URL(window.top.location.href);l?((f=d==null?void 0:d.searchParams)==null||f.set("dashboard",l),(m=(g=window.top)==null?void 0:g.history)==null||m.pushState({},"",d),o()):(d==null||d.searchParams.delete("dashboard"),d==null||d.searchParams.delete("widget"))}),P.onMounted(()=>{const l=new URLSearchParams(window.top.location.search);t.value=l.get("dashboard"),n.value=l.get("widget"),o()}),(l,u)=>{var d,f;return P.openBlock(),P.createElementBlock("div",{class:P.normalizeClass(["flex w-full h-full",[r.customClass]])},[P.createVNode(Ade,{ref:"MenuNativeRouting",prefix:r.prefix,selectedDashboard:t.value,"onUpdate:selectedDashboard":u[0]||(u[0]=g=>t.value=g)},null,8,["prefix","selectedDashboard"]),P.createElementVNode("div",Wge,[P.createVNode(Hge,{selected:t.value,"onUpdate:selected":u[1]||(u[1]=g=>t.value=g),dashboardData:i.value,columns:(d=i.value)==null?void 0:d.columns,selectedWidgetData:s.value,prefix:r.prefix,onUpdateEditor:u[2]||(u[2]=()=>{var g;o(),(g=l.$refs.MenuNativeRouting)==null||g.getList()})},null,8,["selected","dashboardData","columns","selectedWidgetData","prefix"]),P.createElementVNode("div",qge,[i.value?(P.openBlock(!0),P.createElementBlock(P.Fragment,{key:1},P.renderList(i.value.panels,(g,m)=>{var _;return P.openBlock(),P.createElementBlock("div",{key:m,class:P.normalizeClass([`col-span-${g.col||12}`,"flex flex-col gap-[10px]"])},[(_=g.widgets)!=null&&_.length?(P.openBlock(!0),P.createElementBlock(P.Fragment,{key:0},P.renderList(g.widgets,x=>(P.openBlock(),P.createBlock(rv,{onClick:w=>n.value=x,"onUpdate:currentWidgetData":u[3]||(u[3]=w=>a.value=w),key:x,dashboard:t.value,widget:x,selectedWidget:n.value,"dashboard-widgets":i.value.widgets,class:P.normalizeClass({"border border-blue-500":n.value===x})},null,8,["onClick","dashboard","widget","selectedWidget","dashboard-widgets","class"]))),128)):(P.openBlock(),P.createBlock(rv,{key:1,onClick:x=>n.value=g.widget,"onUpdate:currentWidgetData":u[4]||(u[4]=x=>a.value=x),class:P.normalizeClass(["flex flex-col",{"border border-blue-500":n.value===g.widget}]),dashboard:t.value,widget:g.widget,selectedWidget:n.value,"dashboard-widgets":i.value.widgets},null,8,["onClick","class","dashboard","widget","selectedWidget","dashboard-widgets"]))],2)}),128)):(P.openBlock(),P.createBlock(j0,{key:0,class:"col-span-12"}))]),t.value?(P.openBlock(),P.createBlock(yge,{key:0,class:"bottom-[10px] left-[10px] absolute",columns:(f=i.value)==null?void 0:f.columns,selectedDashboard:t.value,onUpdateData:o},null,8,["columns","selectedDashboard"])):P.createCommentVNode("",!0)]),P.createVNode(hge,{selectedWidget:n.value,"onUpdate:selectedWidget":u[5]||(u[5]=g=>n.value=g),selectedWidgetData:s.value,currentWidgetData:a.value,selectedDashboard:t.value,onUpdateData:o},null,8,["selectedWidget","selectedWidgetData","currentWidgetData","selectedDashboard"])],2)}}},[["__scopeId","data-v-88ce3ea2"]]),jge={props:["item","selected"]},Xge={class:"truncate grow"},Yge={class:"flex items-center"},Kge=["title"];function Jge(r,e,t,n,i,a){var o,s,l,u;return P.openBlock(),P.createElementBlock("div",{class:P.normalizeClass([{"bg-gray-100 outline-none":t.selected},"flex items-center cursor-pointer hover:bg-[#F3F4F6] px-[12px] py-1 rounded-lg text-sm"])},[P.createElementVNode("div",Xge,[P.createElementVNode("div",Yge,[P.createElementVNode("div",{class:"truncate",title:((o=t.item)==null?void 0:o.title)||((s=t.item)==null?void 0:s.name)},P.toDisplayString(((l=t.item)==null?void 0:l.title)||((u=t.item)==null?void 0:u.name)),9,Kge)])])],2)}const Qge=fr(jge,[["render",Jge]]),eve={class:"h-full w-[300px] shrink-0 bg-white border-r border-gray-200 flex flex-col"},tve={class:"flex items-center gap-2 px-4 py-5"},rve={class:"relative w-full"},nve={class:"px-3.5 flex flex-col gap-[2px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},ive={__name:"vs-menu-list",props:P.mergeModels({list:{type:Array,required:!0}},{selected:{},selectedModifiers:{}}),emits:["update:selected"],setup(r){const e=P.ref(""),t=P.useModel(r,"selected"),n=r,i=P.computed(()=>{var o;const a=e.value.toLowerCase();return(o=n.list)==null?void 0:o.filter(s=>(s==null?void 0:s.title)&&(s==null?void 0:s.title.toLowerCase().includes(a))||(s==null?void 0:s.name)&&(s==null?void 0:s.name.toLowerCase().includes(a)))});return(a,o)=>(P.openBlock(),P.createElementBlock("div",eve,[o[1]||(o[1]=P.createElementVNode("div",{class:"h-[49px] border-b flex items-center pl-[20px]"},[P.createElementVNode("div",{class:"text-[20px]"},[P.createTextVNode("Viewer "),P.createElementVNode("span",{class:"text-[#666666]"})])],-1)),P.createElementVNode("div",tve,[P.createElementVNode("div",rve,[P.createVNode(v4,{class:"absolute top-[50%] translate-y-[-50%] left-[12px]"}),P.withDirectives(P.createElementVNode("input",{"onUpdate:modelValue":o[0]||(o[0]=s=>e.value=s),class:"flex-1 text-[13px] w-full h-[38px] px-9 text-gray-800 rounded-lg !border-none bg-gray-100 placeholder-gray-400 focus:outline-2 focus:outline-blue-600",placeholder:"Пошук..."},null,512),[[P.vModelText,e.value]])])]),P.createElementVNode("div",nve,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.value,(s,l)=>(P.openBlock(),P.createBlock(Qge,{key:l,item:s,selected:s.name===t.value,onClick:u=>t.value=s.name},null,8,["item","selected","onClick"]))),128))])]))}},ave={class:"flex"},ove={class:"flex w-full max-h-[100vh] h-[100vh] overflow-x-hidden"},sve={class:"relative flex justify-center w-full pt-3 bg-gray-50 w-[calc(100vw-300px)] custom-scrollbar"},V$={__name:"vs-bi-viewer",props:{prefix:{type:String,default:()=>"/api"}},setup(r){const e=r;_r.defaults.baseURL=e.prefix||"/api";const t=P.ref(null),n=P.ref(null),i=async()=>{try{const a=await _r.get("/bi-dashboard?type=viewer");n.value=a.data.rows}catch{}};return P.watch(t,a=>{var s,l,u;const o=new URL(window.top.location.href);a?((s=o==null?void 0:o.searchParams)==null||s.set("dashboard",a),(u=(l=window.top)==null?void 0:l.history)==null||u.pushState({},"",o)):o==null||o.searchParams.delete("dashboard")}),P.onMounted(()=>{const a=new URLSearchParams(window.top.location.search);t.value=a.get("dashboard"),i()}),(a,o)=>(P.openBlock(),P.createElementBlock("div",ave,[P.createElementVNode("div",ove,[P.createVNode(ive,{list:n.value,selected:t.value,"onUpdate:selected":o[0]||(o[0]=s=>t.value=s)},null,8,["list","selected"]),P.createElementVNode("div",sve,[(P.openBlock(),P.createBlock(sC,{id:t.value,key:t.value,prefix:r.prefix,class:"px-3 w-full flex-grow max-w-[1280px]"},null,8,["id","prefix"]))])])]))}},F$={install:r=>{r.component("VsBar",Z0),r.component("VsLine",rC),r.component("VsPie",tC),r.component("VsDonut",g4),r.component("VsStat",nC),r.component("VsDashboard",sC),r.component("VsWidget",rv),r.component("VsProgressBar",iC),r.component("VsListBar",aC),r.component("VsPivotTable",lC),r.component("VsEditor",Zge),r.component("VsViewer",V$)},components:{VsBar:Z0,VsLine:rC,VsPie:tC,VsStat:nC,VsDashboard:sC,VsProgressBar:iC,VsListBar:aC,VsPivotTable:lC,VsWidget:rv,VsBiViewer:V$}};typeof window<"u"&&(window.v3bi=F$);const lve={name:"VsNumber",mixins:[Ca],data(){return{number:""}},computed:{formattedNumber(){return PG(this.number)},prefix(){var r,e;return(r=this.styleData)!=null&&r.prefix?(e=this.styleData)==null?void 0:e.prefix:""}},watch:{sourceData:{async handler(){this.getNumber()},deep:!0}},async mounted(){await this.getData(),this.getNumber()},methods:{onChangedData(){try{this.sourceData&&this.getNumber()}catch(r){console.error(r)}},async getNumber(){var r,e;try{this.number=((e=this.sourceData[0])==null?void 0:e[Object.keys((r=this.sourceData)==null?void 0:r[0])])||0}catch(t){console.error(t)}}}},uve={class:"text-lg lg:text-xl xl:text-2xl text-gray-800 h-[32px] flex items-center"};function cve(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",uve,P.toDisplayString(a.prefix)+P.toDisplayString(a.formattedNumber),1)}const hve=Object.freeze(Object.defineProperty({__proto__:null,default:fr(lve,[["render",cve]])},Symbol.toStringTag,{value:"Module"})),dve={name:"VsText",mixins:[Ca],data(){return{markedText:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget;try{await this.getData(),this.markedText=ln(this.sourceData)}catch(r){console.error(r)}},methods:{onChangedData(){return null}}},fve=["id"],pve=["innerHTML"];function gve(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{id:i.uniqueID,class:"relative select-auto h-full rounded-xl text-[12px] box-border bg-white custom-scrollbar text-widget"},[i.markedText?(P.openBlock(),P.createElementBlock("div",{key:0,innerHTML:i.markedText},null,8,pve)):P.createCommentVNode("",!0)],8,fve)}const vve=Object.freeze(Object.defineProperty({__proto__:null,default:fr(dve,[["render",gve]])},Symbol.toStringTag,{value:"Module"})),mve={name:"VsFunnelBar",mixins:[Ca],data(){return{chartInstance:null,uniqueID:null}},async mounted(){this.uniqueID=this.widget,await this.$nextTick(),await this.getData();const{series:r}=this.prepareData();r&&this.initChart(r)},methods:{buildTooltipForDonut(r,e){const{name:t,value:n,percent:i}=r;return`
    ${rs(t)}: ${An(n)} (${i}%)
    `},onChangedData(){try{if(this.sourceData){const{series:r,xs:e,ys:t}=this.prepareData();r&&(this==null||this.initChart(r,e,t))}}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(i=>i[this.dimensions[0]]))),e=Array.from(new Set(this.sourceData.map(i=>i[this.dimensions[1]]))),t=r.map((i,a)=>({name:i,value:e[a]}));return{series:[{name:this.titleCharts?this.titleCharts:this.dimensions[0],type:"funnel",...sh(this.styleData),data:t,height:"80%",emphasis:{label:{show:!1}}}]}}catch(r){console.error(r)}},async initChart(r){try{const e=this.$refs.chart,t=w_(e),n={series:r,...sh(this.styleData),tooltip:{trigger:"item",formatter:i=>this.buildTooltipForDonut(i,[i.color]),borderWidth:0,appendToBody:!0,borderColor:"transparent",textStyle:{color:"#000"},padding:[10,15],shadowColor:"transparent",backgroundColor:"transparent"},itemStyle:{height:"15px"},legend:{borderRadius:10,type:"scroll",itemWidth:14,itemHeight:14,...this.styleData.legend},labelLine:{show:!1},grid:{bottom:"0"}};t.setOption(n),t.resize(),window.addEventListener("resize",()=>{t.resize()})}catch(e){console.error(e)}}}},yve=["id"];function _ve(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",{ref:"chart",id:i.uniqueID,class:"h-[90%] custom-scrollbar min-h-[200px]"},null,8,yve)}const bve=Object.freeze(Object.defineProperty({__proto__:null,default:fr(mve,[["render",_ve]])},Symbol.toStringTag,{value:"Module"}));function xve(r){return[{type:"fill",paint:{"fill-color":r.color||"#ccc","fill-outline-color":r.color||"blue","fill-opacity":r.opacity||1}}]}function wve(r){return[{type:"line",paint:{"line-color":r.color||"#ccc","line-opacity":r.opacity||1}}]}function Sve(r){return[{type:"circle",paint:{"circle-radius":r.radius||6,"circle-stroke-color":r.stroke||"#ccc","circle-stroke-width":r.width||1,"circle-color":r.color||"blue"}}]}function $$(r){if(!r)return null;const e=r.type||"point";return e==="polygon"?xve(r):e==="line"?wve(r):Sve(r)}const sA={data(){return{layerList:[],activeLayer:""}},computed:{interactiveSources(){return this.layerList.filter(r=>r==null?void 0:r.interactive).map(r=>r.id)}},methods:{moveLayer(r,e=this.map){e.getStyle().layers.forEach(t=>{t.id.match(r)&&e.moveLayer(t.id)})},async setVisible(r,e=!0,t=this.map){if(!r)return;const n=(r==null?void 0:r.id)||r,i=this.layerList.find(o=>o.id===r)||r;if(!(i!=null&&i.id))throw new Error("MixinError: Layer has no id");const a=t.getStyle().layers.filter(o=>o.id.match(n));a.forEach(o=>{t.setLayoutProperty(o.id,"visibility",e?"visible":"none")}),!a.length&&e&&await this.addLayer(i)},async addLayer(r,e=this==null?void 0:this.map){var i,a;const t=this.layerList.find(o=>o.id===r)||r;!this.map.getStyle()||this.map.getStyle().layers.find(o=>o.id===t.id)||(this.layerList.find(o=>o.id===t.id)||this.layerList.push(t),(t.service==="vtile"||t.service==="vector"||(i=t.url)!=null&&i.includes(".vmt"))&&this.addVtileLayer(t,e),t.service==="geojson"&&this.addGeoJsonLayer(t,e),((a=t.url)!=null&&a.includes(".png")||["tms","raster"].includes(t.service))&&await this.addRasterLayer(t,e))},async addRasterLayer(r,e=this==null?void 0:this.map){var t,n;e.getSource(r.id)||(await e.addSource(r.id,{type:"raster",tiles:[r==null?void 0:r.url],tileSize:256,...r!=null&&r.scheme?{scheme:r==null?void 0:r.scheme}:{}}),await e.addLayer({id:r.id,type:"raster",source:r.id,minzoom:0,maxzoom:(r==null?void 0:r.maxzoom)||22},r.basemap?(n=(t=this.map.getStyle().layers)==null?void 0:t[0])==null?void 0:n.id:null))},async addVtileLayer(r,e=this==null?void 0:this.map){var a;const t=["props","pointZoom"].filter(o=>r[o]).map(o=>`&${o}=${r[o]}`),n={type:"vector",tiles:[`${(a=r==null?void 0:r.url)!=null&&a.startsWith("http")?"":window.location.origin}${r==null?void 0:r.url}${t}`],minzoom:r.minzoom||3,maxzoom:r.maxzoom||24};e.addSource(r.id,n),($$(r.style)||r.layers||[]).forEach((o,s)=>{const l={...o,id:`${r.id}-${s}`,source:r.id,"source-layer":o["source-layer"]||r.source||r.id,maxzoom:+o.maxzoom||24,minzoom:+o.minzoom||0};e.addLayer(l)})},async addGeoJsonLayer(r,e=this.map){var i;const t=r.data||((i=r==null?void 0:r.url)!=null&&i.startsWith("http")?"":window.location.origin)+r.url;e.addSource(r.id,{type:"geojson",data:t}),($$(r.style)||r.layers||[]).forEach(a=>{const o={...a,source:r.id,id:a.id||r.id,maxzoom:+a.maxzoom||24,minzoom:+a.minzoom||0,type:a.type||"circle"};e.addLayer(o)})},setLayerData(r,e){this.layerList=this.layerList.map(t=>t.id===r?{...t,...e}:t)},async removeLayer(r,e=this.map){e.getSource(r)&&(await e.getStyle().layers.forEach(async t=>{t.source===r&&await e.removeLayer(t.id)}),await e.removeSource(r))},async setFilter(r,e){var i;const t=this.layerList.find(a=>a.id===r),n=await((i=this.map)==null?void 0:i.getSource(r));if(n&&t.service==="vtile"){await n.setTiles([`${window.location.origin}${t.url}${t.url.includes("?")?"&":"?"}filter=${e}${t.props?`&props=${t.props}`:""}`]);return}n&&t.service},async changeBaseLayer(r){const e=r!=null&&r.id?r:this.layerList.find(n=>n.id===r),{id:t}=e;if(t&&t!==this.activeLayer){if(this.activeLayer&&this.map.setLayoutProperty(this.activeLayer,"visibility","none"),this.activeLayer=t,this.map.getLayer(t)){this.map.setLayoutProperty(t,"visibility","visible");return}await this.addRasterLayer(e)}},async refreshLayer(r,e=this.map){await e.getStyle().layers.forEach(t=>{t.source===r&&e.removeLayer(t.id)}),await e.removeSource(r),this.setVisible(r)}}};var G$={exports:{}};/** * MapLibre GL JS * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt */(function(r,e){(function(t,n){r.exports=n()})(Efe,function(){var t={},n={};function i(o,s,l){if(n[o]=l,o==="index"){var u="var sharedModule = {}; ("+n.shared+")(sharedModule); ("+n.worker+")(sharedModule);",d={};return n.shared(d),n.index(t,d),typeof window<"u"&&t.setWorkerUrl(window.URL.createObjectURL(new Blob([u],{type:"text/javascript"}))),t}}i("shared",["exports"],function(o){function s(p,h,v,b){return new(v||(v=Promise))(function(E,I){function k(U){try{z(b.next(U))}catch(W){I(W)}}function R(U){try{z(b.throw(U))}catch(W){I(W)}}function z(U){var W;U.done?E(U.value):(W=U.value,W instanceof v?W:new v(function(X){X(W)})).then(k,R)}z((b=b.apply(p,h||[])).next())})}function l(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}typeof SuppressedError=="function"&&SuppressedError;var u=d;function d(p,h){this.x=p,this.y=h}d.prototype={clone:function(){return new d(this.x,this.y)},add:function(p){return this.clone()._add(p)},sub:function(p){return this.clone()._sub(p)},multByPoint:function(p){return this.clone()._multByPoint(p)},divByPoint:function(p){return this.clone()._divByPoint(p)},mult:function(p){return this.clone()._mult(p)},div:function(p){return this.clone()._div(p)},rotate:function(p){return this.clone()._rotate(p)},rotateAround:function(p,h){return this.clone()._rotateAround(p,h)},matMult:function(p){return this.clone()._matMult(p)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(p){return this.x===p.x&&this.y===p.y},dist:function(p){return Math.sqrt(this.distSqr(p))},distSqr:function(p){var h=p.x-this.x,v=p.y-this.y;return h*h+v*v},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(p){return Math.atan2(this.y-p.y,this.x-p.x)},angleWith:function(p){return this.angleWithSep(p.x,p.y)},angleWithSep:function(p,h){return Math.atan2(this.x*h-this.y*p,this.x*p+this.y*h)},_matMult:function(p){var h=p[2]*this.x+p[3]*this.y;return this.x=p[0]*this.x+p[1]*this.y,this.y=h,this},_add:function(p){return this.x+=p.x,this.y+=p.y,this},_sub:function(p){return this.x-=p.x,this.y-=p.y,this},_mult:function(p){return this.x*=p,this.y*=p,this},_div:function(p){return this.x/=p,this.y/=p,this},_multByPoint:function(p){return this.x*=p.x,this.y*=p.y,this},_divByPoint:function(p){return this.x/=p.x,this.y/=p.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var p=this.y;return this.y=this.x,this.x=-p,this},_rotate:function(p){var h=Math.cos(p),v=Math.sin(p),b=v*this.x+h*this.y;return this.x=h*this.x-v*this.y,this.y=b,this},_rotateAround:function(p,h){var v=Math.cos(p),b=Math.sin(p),E=h.y+b*(this.x-h.x)+v*(this.y-h.y);return this.x=h.x+v*(this.x-h.x)-b*(this.y-h.y),this.y=E,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(p){return p instanceof d?p:Array.isArray(p)?new d(p[0],p[1]):p};var f=l(u),g=m;function m(p,h,v,b){this.cx=3*p,this.bx=3*(v-p)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*h,this.by=3*(b-h)-this.cy,this.ay=1-this.cy-this.by,this.p1x=p,this.p1y=h,this.p2x=v,this.p2y=b}m.prototype={sampleCurveX:function(p){return((this.ax*p+this.bx)*p+this.cx)*p},sampleCurveY:function(p){return((this.ay*p+this.by)*p+this.cy)*p},sampleCurveDerivativeX:function(p){return(3*this.ax*p+2*this.bx)*p+this.cx},solveCurveX:function(p,h){if(h===void 0&&(h=1e-6),p<0)return 0;if(p>1)return 1;for(var v=p,b=0;b<8;b++){var E=this.sampleCurveX(v)-p;if(Math.abs(E)E?k=v:R=v,v=.5*(R-k)+k;return v},solve:function(p,h){return this.sampleCurveY(this.solveCurveX(p,h))}};var _=l(g);let x,w;function C(){return x==null&&(x=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),x}function A(){if(w==null&&(w=!1,C())){const h=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(h){for(let b=0;b<5*5;b++){const E=4*b;h.fillStyle=`rgb(${E},${E+1},${E+2})`,h.fillRect(b%5,Math.floor(b/5),1,1)}const v=h.getImageData(0,0,5,5).data;for(let b=0;b<5*5*4;b++)if(b%4!=3&&v[b]!==b){w=!0;break}}}return w||!1}function L(p,h,v,b){const E=new _(p,h,v,b);return I=>E.solve(I)}const O=L(.25,.1,.25,1);function V(p,h,v){return Math.min(v,Math.max(h,p))}function F(p,h,v){const b=v-h,E=((p-h)%b+b)%b+h;return E===h?v:E}function $(p,...h){for(const v of h)for(const b in v)p[b]=v[b];return p}let H=1;function Z(p,h,v){const b={};for(const E in p)b[E]=h.call(this,p[E],E,p);return b}function j(p,h,v){const b={};for(const E in p)h.call(this,p[E],E,p)&&(b[E]=p[E]);return b}function Y(p){return Array.isArray(p)?p.map(Y):typeof p=="object"&&p?Z(p,Y):p}const se={};function ae(p){se[p]||(typeof console<"u"&&console.warn(p),se[p]=!0)}function ue(p,h,v){return(v.y-p.y)*(h.x-p.x)>(h.y-p.y)*(v.x-p.x)}function fe(p){return typeof WorkerGlobalScope<"u"&&p!==void 0&&p instanceof WorkerGlobalScope}let le=null;function ge(p){return typeof ImageBitmap<"u"&&p instanceof ImageBitmap}const xe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function Me(p,h,v,b,E){return s(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const I=new VideoFrame(p,{timestamp:0});try{const k=I==null?void 0:I.format;if(!k||!k.startsWith("BGR")&&!k.startsWith("RGB"))throw new Error(`Unrecognized format ${k}`);const R=k.startsWith("BGR"),z=new Uint8ClampedArray(b*E*4);if(yield I.copyTo(z,function(U,W,X,ee,ne){const oe=4*Math.max(-W,0),ce=(Math.max(0,X)-X)*ee*4+oe,me=4*ee,we=Math.max(0,W),Oe=Math.max(0,X);return{rect:{x:we,y:Oe,width:Math.min(U.width,W+ee)-we,height:Math.min(U.height,X+ne)-Oe},layout:[{offset:ce,stride:me}]}}(p,h,v,b,E)),R)for(let U=0;Ufe(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,st=function(p,h){if(/:\/\//.test(p.url)&&!/^https?:|^file:/.test(p.url)){const b=it(p.url);if(b)return b(p,h);if(fe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:p,targetMapId:kt},h)}if(!(/^file:/.test(v=p.url)||/^file:/.test(lt())&&!/^\w+:/.test(v))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(b,E){return s(this,void 0,void 0,function*(){const I=new Request(b.url,{method:b.method||"GET",body:b.body,credentials:b.credentials,headers:b.headers,cache:b.cache,referrer:lt(),signal:E.signal});b.type!=="json"||I.headers.has("Accept")||I.headers.set("Accept","application/json");const k=yield fetch(I);if(!k.ok){const U=yield k.blob();throw new Ht(k.status,k.statusText,b.url,U)}let R;R=b.type==="arrayBuffer"||b.type==="image"?k.arrayBuffer():b.type==="json"?k.json():k.text();const z=yield R;if(E.signal.aborted)throw ot();return{data:z,cacheControl:k.headers.get("Cache-Control"),expires:k.headers.get("Expires")}})}(p,h);if(fe(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:p,mustQueue:!0,targetMapId:kt},h)}var v;return function(b,E){return new Promise((I,k)=>{var R;const z=new XMLHttpRequest;z.open(b.method||"GET",b.url,!0),b.type!=="arrayBuffer"&&b.type!=="image"||(z.responseType="arraybuffer");for(const U in b.headers)z.setRequestHeader(U,b.headers[U]);b.type==="json"&&(z.responseType="text",!((R=b.headers)===null||R===void 0)&&R.Accept||z.setRequestHeader("Accept","application/json")),z.withCredentials=b.credentials==="include",z.onerror=()=>{k(new Error(z.statusText))},z.onload=()=>{if(!E.signal.aborted)if((z.status>=200&&z.status<300||z.status===0)&&z.response!==null){let U=z.response;if(b.type==="json")try{U=JSON.parse(z.response)}catch(W){return void k(W)}I({data:U,cacheControl:z.getResponseHeader("Cache-Control"),expires:z.getResponseHeader("Expires")})}else{const U=new Blob([z.response],{type:z.getResponseHeader("Content-Type")});k(new Ht(z.status,z.statusText,b.url,U))}},E.signal.addEventListener("abort",()=>{z.abort(),k(ot())}),z.send(b.body)})}(p,h)};function Ct(p){if(!p||p.indexOf("://")<=0||p.indexOf("data:image/")===0||p.indexOf("blob:")===0)return!0;const h=new URL(p),v=window.location;return h.protocol===v.protocol&&h.host===v.host}function rt(p,h,v){v[p]&&v[p].indexOf(h)!==-1||(v[p]=v[p]||[],v[p].push(h))}function vt(p,h,v){if(v&&v[p]){const b=v[p].indexOf(h);b!==-1&&v[p].splice(b,1)}}class Qe{constructor(h,v={}){$(this,v),this.type=h}}class Ft extends Qe{constructor(h,v={}){super("error",$({error:h},v))}}class Kt{on(h,v){return this._listeners=this._listeners||{},rt(h,v,this._listeners),this}off(h,v){return vt(h,v,this._listeners),vt(h,v,this._oneTimeListeners),this}once(h,v){return v?(this._oneTimeListeners=this._oneTimeListeners||{},rt(h,v,this._oneTimeListeners),this):new Promise(b=>this.once(h,b))}fire(h,v){typeof h=="string"&&(h=new Qe(h,v||{}));const b=h.type;if(this.listens(b)){h.target=this;const E=this._listeners&&this._listeners[b]?this._listeners[b].slice():[];for(const R of E)R.call(this,h);const I=this._oneTimeListeners&&this._oneTimeListeners[b]?this._oneTimeListeners[b].slice():[];for(const R of I)vt(b,R,this._oneTimeListeners),R.call(this,h);const k=this._eventedParent;k&&($(h,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),k.fire(h))}else h instanceof Ft&&console.error(h.error);return this}listens(h){return this._listeners&&this._listeners[h]&&this._listeners[h].length>0||this._oneTimeListeners&&this._oneTimeListeners[h]&&this._oneTimeListeners[h].length>0||this._eventedParent&&this._eventedParent.listens(h)}setEventedParent(h,v){return this._eventedParent=h,this._eventedParentData=v,this}}var Le={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},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:{},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_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"}},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:"enum",default:"mercator",values:{mercator:{},globe:{}}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","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"]},"property-type":"cross-faded"},"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:"number",default:335,minimum:0,maximum:359,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:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",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"}},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"}}};const Mr=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Lt(p,h){const v={};for(const b in p)b!=="ref"&&(v[b]=p[b]);return Mr.forEach(b=>{b in h&&(v[b]=h[b])}),v}function Xt(p,h){if(Array.isArray(p)){if(!Array.isArray(h)||p.length!==h.length)return!1;for(let v=0;v`:p.itemType.kind==="value"?"array":`array<${h}>`}return p.kind}const he=[sa,ct,yr,tr,fi,Br,la,re(cr),ua,pi,be];function ye(p,h){if(h.kind==="error")return null;if(p.kind==="array"){if(h.kind==="array"&&(h.N===0&&h.itemType.kind==="value"||!ye(p.itemType,h.itemType))&&(typeof p.N!="number"||p.N===h.N))return null}else{if(p.kind===h.kind)return null;if(p.kind==="value"){for(const v of he)if(!ye(v,h))return null}}return`Expected ${te(p)} but found ${te(h)} instead.`}function De(p,h){return h.some(v=>v.kind===p.kind)}function ke(p,h){return h.some(v=>v==="null"?p===null:v==="array"?Array.isArray(p):v==="object"?p&&!Array.isArray(p)&&typeof p=="object":v===typeof p)}function Ne(p,h){return p.kind==="array"&&h.kind==="array"?p.itemType.kind===h.itemType.kind&&typeof p.N=="number":p.kind===h.kind}const Ee=.96422,He=.82521,Je=4/29,$e=6/29,ht=3*$e*$e,Wt=$e*$e*$e,Yt=Math.PI/180,Vr=180/Math.PI;function pr(p){return(p%=360)<0&&(p+=360),p}function Fr([p,h,v,b]){let E,I;const k=Bn((.2225045*(p=Ir(p))+.7168786*(h=Ir(h))+.0606169*(v=Ir(v)))/1);p===h&&h===v?E=I=k:(E=Bn((.4360747*p+.3850649*h+.1430804*v)/Ee),I=Bn((.0139322*p+.0971045*h+.7141733*v)/He));const R=116*k-16;return[R<0?0:R,500*(E-k),200*(k-I),b]}function Ir(p){return p<=.04045?p/12.92:Math.pow((p+.055)/1.055,2.4)}function Bn(p){return p>Wt?Math.pow(p,1/3):p/ht+Je}function En([p,h,v,b]){let E=(p+16)/116,I=isNaN(h)?E:E+h/500,k=isNaN(v)?E:E-v/200;return E=1*Yr(E),I=Ee*Yr(I),k=He*Yr(k),[Sr(3.1338561*I-1.6168667*E-.4906146*k),Sr(-.9787684*I+1.9161415*E+.033454*k),Sr(.0719453*I-.2289914*E+1.4052427*k),b]}function Sr(p){return(p=p<=.00304?12.92*p:1.055*Math.pow(p,1/2.4)-.055)<0?0:p>1?1:p}function Yr(p){return p>$e?p*p*p:ht*(p-Je)}function _n(p){return parseInt(p.padEnd(2,p),16)/255}function Kn(p,h){return li(h?p/100:p,0,1)}function li(p,h,v){return Math.min(Math.max(h,p),v)}function Di(p){return!p.some(Number.isNaN)}const uu={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]};class Kr{constructor(h,v,b,E=1,I=!0){this.r=h,this.g=v,this.b=b,this.a=E,I||(this.r*=E,this.g*=E,this.b*=E,E||this.overwriteGetter("rgb",[h,v,b,E]))}static parse(h){if(h instanceof Kr)return h;if(typeof h!="string")return;const v=function(b){if((b=b.toLowerCase().trim())==="transparent")return[0,0,0,0];const E=uu[b];if(E){const[k,R,z]=E;return[k/255,R/255,z/255,1]}if(b.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(b)){const k=b.length<6?1:2;let R=1;return[_n(b.slice(R,R+=k)),_n(b.slice(R,R+=k)),_n(b.slice(R,R+=k)),_n(b.slice(R,R+k)||"ff")]}if(b.startsWith("rgb")){const k=b.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(k){const[R,z,U,W,X,ee,ne,oe,ce,me,we,Oe]=k,Ae=[W||" ",ne||" ",me].join("");if(Ae===" "||Ae===" /"||Ae===",,"||Ae===",,,"){const Re=[U,ee,ce].join(""),Ue=Re==="%%%"?100:Re===""?255:0;if(Ue){const tt=[li(+z/Ue,0,1),li(+X/Ue,0,1),li(+oe/Ue,0,1),we?Kn(+we,Oe):1];if(Di(tt))return tt}}return}}const I=b.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(I){const[k,R,z,U,W,X,ee,ne,oe]=I,ce=[z||" ",W||" ",ee].join("");if(ce===" "||ce===" /"||ce===",,"||ce===",,,"){const me=[+R,li(+U,0,100),li(+X,0,100),ne?Kn(+ne,oe):1];if(Di(me))return function([we,Oe,Ae,Re]){function Ue(tt){const St=(tt+we/30)%12,Jt=Oe*Math.min(Ae,1-Ae);return Ae-Jt*Math.max(-1,Math.min(St-3,9-St,1))}return we=pr(we),Oe/=100,Ae/=100,[Ue(0),Ue(8),Ue(4),Re]}(me)}}}(h);return v?new Kr(...v,!1):void 0}get rgb(){const{r:h,g:v,b,a:E}=this,I=E||1/0;return this.overwriteGetter("rgb",[h/I,v/I,b/I,E])}get hcl(){return this.overwriteGetter("hcl",function(h){const[v,b,E,I]=Fr(h),k=Math.sqrt(b*b+E*E);return[Math.round(1e4*k)?pr(Math.atan2(E,b)*Vr):NaN,k,v,I]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Fr(this.rgb))}overwriteGetter(h,v){return Object.defineProperty(this,h,{value:v}),v}toString(){const[h,v,b,E]=this.rgb;return`rgba(${[h,v,b].map(I=>Math.round(255*I)).join(",")},${E})`}}Kr.black=new Kr(0,0,0,1),Kr.white=new Kr(1,1,1,1),Kr.transparent=new Kr(0,0,0,0),Kr.red=new Kr(1,0,0,1);class hv{constructor(h,v,b){this.sensitivity=h?v?"variant":"case":v?"accent":"base",this.locale=b,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(h,v){return this.collator.compare(h,v)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class dv{constructor(h,v,b,E,I){this.text=h,this.image=v,this.scale=b,this.fontStack=E,this.textColor=I}}class ca{constructor(h){this.sections=h}static fromString(h){return new ca([new dv(h,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(h=>h.text.length!==0||h.image&&h.image.name.length!==0)}static factory(h){return h instanceof ca?h:ca.fromString(h)}toString(){return this.sections.length===0?"":this.sections.map(h=>h.text).join("")}}class ha{constructor(h){this.values=h.slice()}static parse(h){if(h instanceof ha)return h;if(typeof h=="number")return new ha([h,h,h,h]);if(Array.isArray(h)&&!(h.length<1||h.length>4)){for(const v of h)if(typeof v!="number")return;switch(h.length){case 1:h=[h[0],h[0],h[0],h[0]];break;case 2:h=[h[0],h[1],h[0],h[1]];break;case 3:h=[h[0],h[1],h[2],h[1]]}return new ha(h)}}toString(){return JSON.stringify(this.values)}}const cA=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Ma{constructor(h){this.values=h.slice()}static parse(h){if(h instanceof Ma)return h;if(Array.isArray(h)&&!(h.length<1)&&h.length%2==0){for(let v=0;v=0&&p<=255&&typeof h=="number"&&h>=0&&h<=255&&typeof v=="number"&&v>=0&&v<=255?b===void 0||typeof b=="number"&&b>=0&&b<=1?null:`Invalid rgba value [${[p,h,v,b].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof b=="number"?[p,h,v,b]:[p,h,v]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function ol(p){if(p===null||typeof p=="string"||typeof p=="boolean"||typeof p=="number"||p instanceof Kr||p instanceof hv||p instanceof ca||p instanceof ha||p instanceof Ma||p instanceof da)return!0;if(Array.isArray(p)){for(const h of p)if(!ol(h))return!1;return!0}if(typeof p=="object"){for(const h in p)if(!ol(p[h]))return!1;return!0}return!1}function Vn(p){if(p===null)return sa;if(typeof p=="string")return yr;if(typeof p=="boolean")return tr;if(typeof p=="number")return ct;if(p instanceof Kr)return fi;if(p instanceof hv)return Da;if(p instanceof ca)return Br;if(p instanceof ha)return ua;if(p instanceof Ma)return be;if(p instanceof da)return pi;if(Array.isArray(p)){const h=p.length;let v;for(const b of p){const E=Vn(b);if(v){if(v===E)continue;v=cr;break}v=E}return re(v||cr,h)}return la}function dh(p){const h=typeof p;return p===null?"":h==="string"||h==="number"||h==="boolean"?String(p):p instanceof Kr||p instanceof ca||p instanceof ha||p instanceof Ma||p instanceof da?p.toString():JSON.stringify(p)}class Wa{constructor(h,v){this.type=h,this.value=v}static parse(h,v){if(h.length!==2)return v.error(`'literal' expression requires exactly one argument, but found ${h.length-1} instead.`);if(!ol(h[1]))return v.error("invalid value");const b=h[1];let E=Vn(b);const I=v.expectedType;return E.kind!=="array"||E.N!==0||!I||I.kind!=="array"||typeof I.N=="number"&&I.N!==0||(E=I),new Wa(E,b)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Rn{constructor(h){this.name="ExpressionEvaluationError",this.message=h}toJSON(){return this.message}}const of={string:yr,number:ct,boolean:tr,object:la};class qa{constructor(h,v){this.type=h,this.args=v}static parse(h,v){if(h.length<2)return v.error("Expected at least one argument.");let b,E=1;const I=h[0];if(I==="array"){let R,z;if(h.length>2){const U=h[1];if(typeof U!="string"||!(U in of)||U==="object")return v.error('The item type argument of "array" must be one of string, number, boolean',1);R=of[U],E++}else R=cr;if(h.length>3){if(h[2]!==null&&(typeof h[2]!="number"||h[2]<0||h[2]!==Math.floor(h[2])))return v.error('The length argument to "array" must be a positive integer literal',2);z=h[2],E++}b=re(R,z)}else{if(!of[I])throw new Error(`Types doesn't contain name = ${I}`);b=of[I]}const k=[];for(;Eh.outputDefined())}}const fv={"to-boolean":tr,"to-color":fi,"to-number":ct,"to-string":yr};class Za{constructor(h,v){this.type=h,this.args=v}static parse(h,v){if(h.length<2)return v.error("Expected at least one argument.");const b=h[0];if(!fv[b])throw new Error(`Can't parse ${b} as it is not part of the known types`);if((b==="to-boolean"||b==="to-string")&&h.length!==2)return v.error("Expected one argument.");const E=fv[b],I=[];for(let k=1;k4?`Invalid rbga value ${JSON.stringify(v)}: expected an array containing either three or four numeric values.`:cu(v[0],v[1],v[2],v[3]),!b))return new Kr(v[0]/255,v[1]/255,v[2]/255,v[3])}throw new Rn(b||`Could not parse color from value '${typeof v=="string"?v:JSON.stringify(v)}'`)}case"padding":{let v;for(const b of this.args){v=b.evaluate(h);const E=ha.parse(v);if(E)return E}throw new Rn(`Could not parse padding from value '${typeof v=="string"?v:JSON.stringify(v)}'`)}case"variableAnchorOffsetCollection":{let v;for(const b of this.args){v=b.evaluate(h);const E=Ma.parse(v);if(E)return E}throw new Rn(`Could not parse variableAnchorOffsetCollection from value '${typeof v=="string"?v:JSON.stringify(v)}'`)}case"number":{let v=null;for(const b of this.args){if(v=b.evaluate(h),v===null)return 0;const E=Number(v);if(!isNaN(E))return E}throw new Rn(`Could not convert ${JSON.stringify(v)} to number.`)}case"formatted":return ca.fromString(dh(this.args[0].evaluate(h)));case"resolvedImage":return da.fromString(dh(this.args[0].evaluate(h)));default:return dh(this.args[0].evaluate(h))}}eachChild(h){this.args.forEach(h)}outputDefined(){return this.args.every(h=>h.outputDefined())}}const hA=["Unknown","Point","LineString","Polygon"];class sf{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?typeof this.feature.type=="number"?hA[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(h){let v=this._parseColorCache[h];return v||(v=this._parseColorCache[h]=Kr.parse(h)),v}}class sl{constructor(h,v,b=[],E,I=new Dn,k=[]){this.registry=h,this.path=b,this.key=b.map(R=>`[${R}]`).join(""),this.scope=I,this.errors=k,this.expectedType=E,this._isConstant=v}parse(h,v,b,E,I={}){return v?this.concat(v,b,E)._parse(h,I):this._parse(h,I)}_parse(h,v){function b(E,I,k){return k==="assert"?new qa(I,[E]):k==="coerce"?new Za(I,[E]):E}if(h!==null&&typeof h!="string"&&typeof h!="boolean"&&typeof h!="number"||(h=["literal",h]),Array.isArray(h)){if(h.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const E=h[0];if(typeof E!="string")return this.error(`Expression name must be a string, but found ${typeof E} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const I=this.registry[E];if(I){let k=I.parse(h,this);if(!k)return null;if(this.expectedType){const R=this.expectedType,z=k.type;if(R.kind!=="string"&&R.kind!=="number"&&R.kind!=="boolean"&&R.kind!=="object"&&R.kind!=="array"||z.kind!=="value")if(R.kind!=="color"&&R.kind!=="formatted"&&R.kind!=="resolvedImage"||z.kind!=="value"&&z.kind!=="string")if(R.kind!=="padding"||z.kind!=="value"&&z.kind!=="number"&&z.kind!=="array")if(R.kind!=="variableAnchorOffsetCollection"||z.kind!=="value"&&z.kind!=="array"){if(this.checkSubtype(R,z))return null}else k=b(k,R,v.typeAnnotation||"coerce");else k=b(k,R,v.typeAnnotation||"coerce");else k=b(k,R,v.typeAnnotation||"coerce");else k=b(k,R,v.typeAnnotation||"assert")}if(!(k instanceof Wa)&&k.type.kind!=="resolvedImage"&&this._isConstant(k)){const R=new sf;try{k=new Wa(k.type,k.evaluate(R))}catch(z){return this.error(z.message),null}}return k}return this.error(`Unknown expression "${E}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(h===void 0?"'undefined' value invalid. Use null instead.":typeof h=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof h} instead.`)}concat(h,v,b){const E=typeof h=="number"?this.path.concat(h):this.path,I=b?this.scope.concat(b):this.scope;return new sl(this.registry,this._isConstant,E,v||null,I,this.errors)}error(h,...v){const b=`${this.key}${v.map(E=>`[${E}]`).join("")}`;this.errors.push(new zr(b,h))}checkSubtype(h,v){const b=ye(h,v);return b&&this.error(b),b}}class As{constructor(h,v){this.type=v.type,this.bindings=[].concat(h),this.result=v}evaluate(h){return this.result.evaluate(h)}eachChild(h){for(const v of this.bindings)h(v[1]);h(this.result)}static parse(h,v){if(h.length<4)return v.error(`Expected at least 3 arguments, but found ${h.length-1} instead.`);const b=[];for(let I=1;I=b.length)throw new Rn(`Array index out of bounds: ${v} > ${b.length-1}.`);if(v!==Math.floor(v))throw new Rn(`Array index must be an integer, but found ${v} instead.`);return b[v]}eachChild(h){h(this.index),h(this.input)}outputDefined(){return!1}}class gv{constructor(h,v){this.type=tr,this.needle=h,this.haystack=v}static parse(h,v){if(h.length!==3)return v.error(`Expected 2 arguments, but found ${h.length-1} instead.`);const b=v.parse(h[1],1,cr),E=v.parse(h[2],2,cr);return b&&E?De(b.type,[tr,yr,ct,sa,cr])?new gv(b,E):v.error(`Expected first argument to be of type boolean, string, number or null, but found ${te(b.type)} instead`):null}evaluate(h){const v=this.needle.evaluate(h),b=this.haystack.evaluate(h);if(!b)return!1;if(!ke(v,["boolean","string","number","null"]))throw new Rn(`Expected first argument to be of type boolean, string, number or null, but found ${te(Vn(v))} instead.`);if(!ke(b,["string","array"]))throw new Rn(`Expected second argument to be of type array or string, but found ${te(Vn(b))} instead.`);return b.indexOf(v)>=0}eachChild(h){h(this.needle),h(this.haystack)}outputDefined(){return!0}}class hu{constructor(h,v,b){this.type=ct,this.needle=h,this.haystack=v,this.fromIndex=b}static parse(h,v){if(h.length<=2||h.length>=5)return v.error(`Expected 3 or 4 arguments, but found ${h.length-1} instead.`);const b=v.parse(h[1],1,cr),E=v.parse(h[2],2,cr);if(!b||!E)return null;if(!De(b.type,[tr,yr,ct,sa,cr]))return v.error(`Expected first argument to be of type boolean, string, number or null, but found ${te(b.type)} instead`);if(h.length===4){const I=v.parse(h[3],3,ct);return I?new hu(b,E,I):null}return new hu(b,E)}evaluate(h){const v=this.needle.evaluate(h),b=this.haystack.evaluate(h);if(!ke(v,["boolean","string","number","null"]))throw new Rn(`Expected first argument to be of type boolean, string, number or null, but found ${te(Vn(v))} instead.`);let E;if(this.fromIndex&&(E=this.fromIndex.evaluate(h)),ke(b,["string"])){const I=b.indexOf(v,E);return I===-1?-1:[...b.slice(0,I)].length}if(ke(b,["array"]))return b.indexOf(v,E);throw new Rn(`Expected second argument to be of type array or string, but found ${te(Vn(b))} instead.`)}eachChild(h){h(this.needle),h(this.haystack),this.fromIndex&&h(this.fromIndex)}outputDefined(){return!1}}class vv{constructor(h,v,b,E,I,k){this.inputType=h,this.type=v,this.input=b,this.cases=E,this.outputs=I,this.otherwise=k}static parse(h,v){if(h.length<5)return v.error(`Expected at least 4 arguments, but found only ${h.length-1}.`);if(h.length%2!=1)return v.error("Expected an even number of arguments.");let b,E;v.expectedType&&v.expectedType.kind!=="value"&&(E=v.expectedType);const I={},k=[];for(let U=2;UNumber.MAX_SAFE_INTEGER)return ee.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof oe=="number"&&Math.floor(oe)!==oe)return ee.error("Numeric branch labels must be integer values.");if(b){if(ee.checkSubtype(b,Vn(oe)))return null}else b=Vn(oe);if(I[String(oe)]!==void 0)return ee.error("Branch labels must be unique.");I[String(oe)]=k.length}const ne=v.parse(X,U,E);if(!ne)return null;E=E||ne.type,k.push(ne)}const R=v.parse(h[1],1,cr);if(!R)return null;const z=v.parse(h[h.length-1],h.length-1,E);return z?R.type.kind!=="value"&&v.concat(1).checkSubtype(b,R.type)?null:new vv(b,E,R,I,k,z):null}evaluate(h){const v=this.input.evaluate(h);return(Vn(v)===this.inputType&&this.outputs[this.cases[v]]||this.otherwise).evaluate(h)}eachChild(h){h(this.input),this.outputs.forEach(h),h(this.otherwise)}outputDefined(){return this.outputs.every(h=>h.outputDefined())&&this.otherwise.outputDefined()}}class lf{constructor(h,v,b){this.type=h,this.branches=v,this.otherwise=b}static parse(h,v){if(h.length<4)return v.error(`Expected at least 3 arguments, but found only ${h.length-1}.`);if(h.length%2!=0)return v.error("Expected an odd number of arguments.");let b;v.expectedType&&v.expectedType.kind!=="value"&&(b=v.expectedType);const E=[];for(let k=1;kv.outputDefined())&&this.otherwise.outputDefined()}}class fh{constructor(h,v,b,E){this.type=h,this.input=v,this.beginIndex=b,this.endIndex=E}static parse(h,v){if(h.length<=2||h.length>=5)return v.error(`Expected 3 or 4 arguments, but found ${h.length-1} instead.`);const b=v.parse(h[1],1,cr),E=v.parse(h[2],2,ct);if(!b||!E)return null;if(!De(b.type,[re(cr),yr,cr]))return v.error(`Expected first argument to be of type array or string, but found ${te(b.type)} instead`);if(h.length===4){const I=v.parse(h[3],3,ct);return I?new fh(b.type,b,E,I):null}return new fh(b.type,b,E)}evaluate(h){const v=this.input.evaluate(h),b=this.beginIndex.evaluate(h);let E;if(this.endIndex&&(E=this.endIndex.evaluate(h)),ke(v,["string"]))return[...v].slice(b,E).join("");if(ke(v,["array"]))return v.slice(b,E);throw new Rn(`Expected first argument to be of type array or string, but found ${te(Vn(v))} instead.`)}eachChild(h){h(this.input),h(this.beginIndex),this.endIndex&&h(this.endIndex)}outputDefined(){return!1}}function uf(p,h){const v=p.length-1;let b,E,I=0,k=v,R=0;for(;I<=k;)if(R=Math.floor((I+k)/2),b=p[R],E=p[R+1],b<=h){if(R===v||hh))throw new Rn("Input is not a number.");k=R-1}return 0}class du{constructor(h,v,b){this.type=h,this.input=v,this.labels=[],this.outputs=[];for(const[E,I]of b)this.labels.push(E),this.outputs.push(I)}static parse(h,v){if(h.length-1<4)return v.error(`Expected at least 4 arguments, but found only ${h.length-1}.`);if((h.length-1)%2!=0)return v.error("Expected an even number of arguments.");const b=v.parse(h[1],1,ct);if(!b)return null;const E=[];let I=null;v.expectedType&&v.expectedType.kind!=="value"&&(I=v.expectedType);for(let k=1;k=R)return v.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',U);const X=v.parse(z,W,I);if(!X)return null;I=I||X.type,E.push([R,X])}return new du(I,b,E)}evaluate(h){const v=this.labels,b=this.outputs;if(v.length===1)return b[0].evaluate(h);const E=this.input.evaluate(h);if(E<=v[0])return b[0].evaluate(h);const I=v.length;return E>=v[I-1]?b[I-1].evaluate(h):b[uf(v,E)].evaluate(h)}eachChild(h){h(this.input);for(const v of this.outputs)h(v)}outputDefined(){return this.outputs.every(h=>h.outputDefined())}}function ib(p){return p&&p.__esModule&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p}var dA=ab;function ab(p,h,v,b){this.cx=3*p,this.bx=3*(v-p)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*h,this.by=3*(b-h)-this.cy,this.ay=1-this.cy-this.by,this.p1x=p,this.p1y=h,this.p2x=v,this.p2y=b}ab.prototype={sampleCurveX:function(p){return((this.ax*p+this.bx)*p+this.cx)*p},sampleCurveY:function(p){return((this.ay*p+this.by)*p+this.cy)*p},sampleCurveDerivativeX:function(p){return(3*this.ax*p+2*this.bx)*p+this.cx},solveCurveX:function(p,h){if(h===void 0&&(h=1e-6),p<0)return 0;if(p>1)return 1;for(var v=p,b=0;b<8;b++){var E=this.sampleCurveX(v)-p;if(Math.abs(E)E?k=v:R=v,v=.5*(R-k)+k;return v},solve:function(p,h){return this.sampleCurveY(this.solveCurveX(p,h))}};var fA=ib(dA);function ll(p,h,v){return p+v*(h-p)}function ph(p,h,v){return p.map((b,E)=>ll(b,h[E],v))}const Fi={number:ll,color:function(p,h,v,b="rgb"){switch(b){case"rgb":{const[E,I,k,R]=ph(p.rgb,h.rgb,v);return new Kr(E,I,k,R,!1)}case"hcl":{const[E,I,k,R]=p.hcl,[z,U,W,X]=h.hcl;let ee,ne;if(isNaN(E)||isNaN(z))isNaN(E)?isNaN(z)?ee=NaN:(ee=z,k!==1&&k!==0||(ne=U)):(ee=E,W!==1&&W!==0||(ne=I));else{let Oe=z-E;z>E&&Oe>180?Oe-=360:z180&&(Oe+=360),ee=E+v*Oe}const[oe,ce,me,we]=function([Oe,Ae,Re,Ue]){return Oe=isNaN(Oe)?0:Oe*Yt,En([Re,Math.cos(Oe)*Ae,Math.sin(Oe)*Ae,Ue])}([ee,ne??ll(I,U,v),ll(k,W,v),ll(R,X,v)]);return new Kr(oe,ce,me,we,!1)}case"lab":{const[E,I,k,R]=En(ph(p.lab,h.lab,v));return new Kr(E,I,k,R,!1)}}},array:ph,padding:function(p,h,v){return new ha(ph(p.values,h.values,v))},variableAnchorOffsetCollection:function(p,h,v){const b=p.values,E=h.values;if(b.length!==E.length)throw new Rn(`Cannot interpolate values of different length. from: ${p.toString()}, to: ${h.toString()}`);const I=[];for(let k=0;ktypeof W!="number"||W<0||W>1))return v.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);E={name:"cubic-bezier",controlPoints:U}}}if(h.length-1<4)return v.error(`Expected at least 4 arguments, but found only ${h.length-1}.`);if((h.length-1)%2!=0)return v.error("Expected an even number of arguments.");if(I=v.parse(I,2,ct),!I)return null;const R=[];let z=null;b==="interpolate-hcl"||b==="interpolate-lab"?z=fi:v.expectedType&&v.expectedType.kind!=="value"&&(z=v.expectedType);for(let U=0;U=W)return v.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',ee);const oe=v.parse(X,ne,z);if(!oe)return null;z=z||oe.type,R.push([W,oe])}return Ne(z,ct)||Ne(z,fi)||Ne(z,ua)||Ne(z,be)||Ne(z,re(ct))?new $i(z,b,E,I,R):v.error(`Type ${te(z)} is not interpolatable.`)}evaluate(h){const v=this.labels,b=this.outputs;if(v.length===1)return b[0].evaluate(h);const E=this.input.evaluate(h);if(E<=v[0])return b[0].evaluate(h);const I=v.length;if(E>=v[I-1])return b[I-1].evaluate(h);const k=uf(v,E),R=$i.interpolationFactor(this.interpolation,E,v[k],v[k+1]),z=b[k].evaluate(h),U=b[k+1].evaluate(h);switch(this.operator){case"interpolate":return Fi[this.type.kind](z,U,R);case"interpolate-hcl":return Fi.color(z,U,R,"hcl");case"interpolate-lab":return Fi.color(z,U,R,"lab")}}eachChild(h){h(this.input);for(const v of this.outputs)h(v)}outputDefined(){return this.outputs.every(h=>h.outputDefined())}}function cf(p,h,v,b){const E=b-v,I=p-v;return E===0?0:h===1?I/E:(Math.pow(h,I)-1)/(Math.pow(h,E)-1)}class hf{constructor(h,v){this.type=h,this.args=v}static parse(h,v){if(h.length<2)return v.error("Expectected at least one argument.");let b=null;const E=v.expectedType;E&&E.kind!=="value"&&(b=E);const I=[];for(const R of h.slice(1)){const z=v.parse(R,1+I.length,b,void 0,{typeAnnotation:"omit"});if(!z)return null;b=b||z.type,I.push(z)}if(!b)throw new Error("No output type");const k=E&&I.some(R=>ye(E,R.type));return new hf(k?cr:b,I)}evaluate(h){let v,b=null,E=0;for(const I of this.args)if(E++,b=I.evaluate(h),b&&b instanceof da&&!b.available&&(v||(v=b.name),b=null,E===this.args.length&&(b=v)),b!==null)break;return b}eachChild(h){this.args.forEach(h)}outputDefined(){return this.args.every(h=>h.outputDefined())}}function df(p,h){return p==="=="||p==="!="?h.kind==="boolean"||h.kind==="string"||h.kind==="number"||h.kind==="null"||h.kind==="value":h.kind==="string"||h.kind==="number"||h.kind==="value"}function ob(p,h,v,b){return b.compare(h,v)===0}function fu(p,h,v){const b=p!=="=="&&p!=="!=";return class LG{constructor(I,k,R){this.type=tr,this.lhs=I,this.rhs=k,this.collator=R,this.hasUntypedArgument=I.type.kind==="value"||k.type.kind==="value"}static parse(I,k){if(I.length!==3&&I.length!==4)return k.error("Expected two or three arguments.");const R=I[0];let z=k.parse(I[1],1,cr);if(!z)return null;if(!df(R,z.type))return k.concat(1).error(`"${R}" comparisons are not supported for type '${te(z.type)}'.`);let U=k.parse(I[2],2,cr);if(!U)return null;if(!df(R,U.type))return k.concat(2).error(`"${R}" comparisons are not supported for type '${te(U.type)}'.`);if(z.type.kind!==U.type.kind&&z.type.kind!=="value"&&U.type.kind!=="value")return k.error(`Cannot compare types '${te(z.type)}' and '${te(U.type)}'.`);b&&(z.type.kind==="value"&&U.type.kind!=="value"?z=new qa(U.type,[z]):z.type.kind!=="value"&&U.type.kind==="value"&&(U=new qa(z.type,[U])));let W=null;if(I.length===4){if(z.type.kind!=="string"&&U.type.kind!=="string"&&z.type.kind!=="value"&&U.type.kind!=="value")return k.error("Cannot use collator to compare non-string types.");if(W=k.parse(I[3],3,Da),!W)return null}return new LG(z,U,W)}evaluate(I){const k=this.lhs.evaluate(I),R=this.rhs.evaluate(I);if(b&&this.hasUntypedArgument){const z=Vn(k),U=Vn(R);if(z.kind!==U.kind||z.kind!=="string"&&z.kind!=="number")throw new Rn(`Expected arguments for "${p}" to be (string, string) or (number, number), but found (${z.kind}, ${U.kind}) instead.`)}if(this.collator&&!b&&this.hasUntypedArgument){const z=Vn(k),U=Vn(R);if(z.kind!=="string"||U.kind!=="string")return h(I,k,R)}return this.collator?v(I,k,R,this.collator.evaluate(I)):h(I,k,R)}eachChild(I){I(this.lhs),I(this.rhs),this.collator&&I(this.collator)}outputDefined(){return!0}}}const pA=fu("==",function(p,h,v){return h===v},ob),sb=fu("!=",function(p,h,v){return h!==v},function(p,h,v,b){return!ob(0,h,v,b)}),lb=fu("<",function(p,h,v){return h",function(p,h,v){return h>v},function(p,h,v,b){return b.compare(h,v)>0}),vA=fu("<=",function(p,h,v){return h<=v},function(p,h,v,b){return b.compare(h,v)<=0}),ub=fu(">=",function(p,h,v){return h>=v},function(p,h,v,b){return b.compare(h,v)>=0});class gh{constructor(h,v,b){this.type=Da,this.locale=b,this.caseSensitive=h,this.diacriticSensitive=v}static parse(h,v){if(h.length!==2)return v.error("Expected one argument.");const b=h[1];if(typeof b!="object"||Array.isArray(b))return v.error("Collator options argument must be an object.");const E=v.parse(b["case-sensitive"]!==void 0&&b["case-sensitive"],1,tr);if(!E)return null;const I=v.parse(b["diacritic-sensitive"]!==void 0&&b["diacritic-sensitive"],1,tr);if(!I)return null;let k=null;return b.locale&&(k=v.parse(b.locale,1,yr),!k)?null:new gh(E,I,k)}evaluate(h){return new hv(this.caseSensitive.evaluate(h),this.diacriticSensitive.evaluate(h),this.locale?this.locale.evaluate(h):null)}eachChild(h){h(this.caseSensitive),h(this.diacriticSensitive),this.locale&&h(this.locale)}outputDefined(){return!1}}class mv{constructor(h,v,b,E,I){this.type=yr,this.number=h,this.locale=v,this.currency=b,this.minFractionDigits=E,this.maxFractionDigits=I}static parse(h,v){if(h.length!==3)return v.error("Expected two arguments.");const b=v.parse(h[1],1,ct);if(!b)return null;const E=h[2];if(typeof E!="object"||Array.isArray(E))return v.error("NumberFormat options argument must be an object.");let I=null;if(E.locale&&(I=v.parse(E.locale,1,yr),!I))return null;let k=null;if(E.currency&&(k=v.parse(E.currency,1,yr),!k))return null;let R=null;if(E["min-fraction-digits"]&&(R=v.parse(E["min-fraction-digits"],1,ct),!R))return null;let z=null;return E["max-fraction-digits"]&&(z=v.parse(E["max-fraction-digits"],1,ct),!z)?null:new mv(b,I,k,R,z)}evaluate(h){return new Intl.NumberFormat(this.locale?this.locale.evaluate(h):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(h):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(h):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(h):void 0}).format(this.number.evaluate(h))}eachChild(h){h(this.number),this.locale&&h(this.locale),this.currency&&h(this.currency),this.minFractionDigits&&h(this.minFractionDigits),this.maxFractionDigits&&h(this.maxFractionDigits)}outputDefined(){return!1}}class ff{constructor(h){this.type=Br,this.sections=h}static parse(h,v){if(h.length<2)return v.error("Expected at least one argument.");const b=h[1];if(!Array.isArray(b)&&typeof b=="object")return v.error("First argument must be an image or text section.");const E=[];let I=!1;for(let k=1;k<=h.length-1;++k){const R=h[k];if(I&&typeof R=="object"&&!Array.isArray(R)){I=!1;let z=null;if(R["font-scale"]&&(z=v.parse(R["font-scale"],1,ct),!z))return null;let U=null;if(R["text-font"]&&(U=v.parse(R["text-font"],1,re(yr)),!U))return null;let W=null;if(R["text-color"]&&(W=v.parse(R["text-color"],1,fi),!W))return null;const X=E[E.length-1];X.scale=z,X.font=U,X.textColor=W}else{const z=v.parse(h[k],1,cr);if(!z)return null;const U=z.type.kind;if(U!=="string"&&U!=="value"&&U!=="null"&&U!=="resolvedImage")return v.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");I=!0,E.push({content:z,scale:null,font:null,textColor:null})}}return new ff(E)}evaluate(h){return new ca(this.sections.map(v=>{const b=v.content.evaluate(h);return Vn(b)===pi?new dv("",b,null,null,null):new dv(dh(b),null,v.scale?v.scale.evaluate(h):null,v.font?v.font.evaluate(h).join(","):null,v.textColor?v.textColor.evaluate(h):null)}))}eachChild(h){for(const v of this.sections)h(v.content),v.scale&&h(v.scale),v.font&&h(v.font),v.textColor&&h(v.textColor)}outputDefined(){return!1}}class yv{constructor(h){this.type=pi,this.input=h}static parse(h,v){if(h.length!==2)return v.error("Expected two arguments.");const b=v.parse(h[1],1,yr);return b?new yv(b):v.error("No image name provided.")}evaluate(h){const v=this.input.evaluate(h),b=da.fromString(v);return b&&h.availableImages&&(b.available=h.availableImages.indexOf(v)>-1),b}eachChild(h){h(this.input)}outputDefined(){return!1}}class _v{constructor(h){this.type=ct,this.input=h}static parse(h,v){if(h.length!==2)return v.error(`Expected 1 argument, but found ${h.length-1} instead.`);const b=v.parse(h[1],1);return b?b.type.kind!=="array"&&b.type.kind!=="string"&&b.type.kind!=="value"?v.error(`Expected argument of type string or array, but found ${te(b.type)} instead.`):new _v(b):null}evaluate(h){const v=this.input.evaluate(h);if(typeof v=="string")return[...v].length;if(Array.isArray(v))return v.length;throw new Rn(`Expected value to be of type string or array, but found ${te(Vn(v))} instead.`)}eachChild(h){h(this.input)}outputDefined(){return!1}}const Do=8192;function mA(p,h){const v=(180+p[0])/360,b=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+p[1]*Math.PI/360)))/360,E=Math.pow(2,h.z);return[Math.round(v*E*Do),Math.round(b*E*Do)]}function bv(p,h){const v=Math.pow(2,h.z);return[(E=(p[0]/Do+h.x)/v,360*E-180),(b=(p[1]/Do+h.y)/v,360/Math.PI*Math.atan(Math.exp((180-360*b)*Math.PI/180))-90)];var b,E}function ul(p,h){p[0]=Math.min(p[0],h[0]),p[1]=Math.min(p[1],h[1]),p[2]=Math.max(p[2],h[0]),p[3]=Math.max(p[3],h[1])}function Ds(p,h){return!(p[0]<=h[0]||p[2]>=h[2]||p[1]<=h[1]||p[3]>=h[3])}function jr(p,h,v){const b=p[0]-h[0],E=p[1]-h[1],I=p[0]-v[0],k=p[1]-v[1];return b*k-I*E==0&&b*I<=0&&E*k<=0}function pf(p,h,v,b){return(E=[b[0]-v[0],b[1]-v[1]])[0]*(I=[h[0]-p[0],h[1]-p[1]])[1]-E[1]*I[0]!=0&&!(!hb(p,h,v,b)||!hb(v,b,p,h));var E,I}function yA(p,h,v){for(const b of v)for(let E=0;E(E=p)[1]!=(k=R[z+1])[1]>E[1]&&E[0]<(k[0]-I[0])*(E[1]-I[1])/(k[1]-I[1])+I[0]&&(b=!b)}var E,I,k;return b}function _A(p,h){for(const v of h)if(pu(p,v))return!0;return!1}function cb(p,h){for(const v of p)if(!pu(v,h))return!1;for(let v=0;v0&&R<0||k<0&&R>0}function xv(p,h,v){const b=[];for(let E=0;Ev[2]){const E=.5*b;let I=p[0]-v[0]>E?-b:v[0]-p[0]>E?b:0;I===0&&(I=p[0]-v[2]>E?-b:v[2]-p[0]>E?b:0),p[0]+=I}ul(h,p)}function pb(p,h,v,b){const E=Math.pow(2,b.z)*Do,I=[b.x*Do,b.y*Do],k=[];for(const R of p)for(const z of R){const U=[z.x+I[0],z.y+I[1]];fb(U,h,v,E),k.push(U)}return k}function gb(p,h,v,b){const E=Math.pow(2,b.z)*Do,I=[b.x*Do,b.y*Do],k=[];for(const z of p){const U=[];for(const W of z){const X=[W.x+I[0],W.y+I[1]];ul(h,X),U.push(X)}k.push(U)}if(h[2]-h[0]<=E/2){(R=h)[0]=R[1]=1/0,R[2]=R[3]=-1/0;for(const z of k)for(const U of z)fb(U,h,v,E)}var R;return k}class cl{constructor(h,v){this.type=tr,this.geojson=h,this.geometries=v}static parse(h,v){if(h.length!==2)return v.error(`'within' expression requires exactly one argument, but found ${h.length-1} instead.`);if(ol(h[1])){const b=h[1];if(b.type==="FeatureCollection"){const E=[];for(const I of b.features){const{type:k,coordinates:R}=I.geometry;k==="Polygon"&&E.push(R),k==="MultiPolygon"&&E.push(...R)}if(E.length)return new cl(b,{type:"MultiPolygon",coordinates:E})}else if(b.type==="Feature"){const E=b.geometry.type;if(E==="Polygon"||E==="MultiPolygon")return new cl(b,b.geometry)}else if(b.type==="Polygon"||b.type==="MultiPolygon")return new cl(b,b)}return v.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(h){if(h.geometry()!=null&&h.canonicalID()!=null){if(h.geometryType()==="Point")return function(v,b){const E=[1/0,1/0,-1/0,-1/0],I=[1/0,1/0,-1/0,-1/0],k=v.canonicalID();if(b.type==="Polygon"){const R=xv(b.coordinates,I,k),z=pb(v.geometry(),E,I,k);if(!Ds(E,I))return!1;for(const U of z)if(!pu(U,R))return!1}if(b.type==="MultiPolygon"){const R=db(b.coordinates,I,k),z=pb(v.geometry(),E,I,k);if(!Ds(E,I))return!1;for(const U of z)if(!_A(U,R))return!1}return!0}(h,this.geometries);if(h.geometryType()==="LineString")return function(v,b){const E=[1/0,1/0,-1/0,-1/0],I=[1/0,1/0,-1/0,-1/0],k=v.canonicalID();if(b.type==="Polygon"){const R=xv(b.coordinates,I,k),z=gb(v.geometry(),E,I,k);if(!Ds(E,I))return!1;for(const U of z)if(!cb(U,R))return!1}if(b.type==="MultiPolygon"){const R=db(b.coordinates,I,k),z=gb(v.geometry(),E,I,k);if(!Ds(E,I))return!1;for(const U of z)if(!bA(U,R))return!1}return!0}(h,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let vb=class{constructor(p=[],h=(v,b)=>vb?1:0){if(this.data=p,this.length=this.data.length,this.compare=h,this.length>0)for(let v=(this.length>>1)-1;v>=0;v--)this._down(v)}push(p){this.data.push(p),this._up(this.length++)}pop(){if(this.length===0)return;const p=this.data[0],h=this.data.pop();return--this.length>0&&(this.data[0]=h,this._down(0)),p}peek(){return this.data[0]}_up(p){const{data:h,compare:v}=this,b=h[p];for(;p>0;){const E=p-1>>1,I=h[E];if(v(b,I)>=0)break;h[p]=I,p=E}h[p]=b}_down(p){const{data:h,compare:v}=this,b=this.length>>1,E=h[p];for(;p=0)break;h[p]=h[I],p=I}h[p]=E}};function xA(p,h,v,b,E){mb(p,h,v,b||p.length-1,E||wA)}function mb(p,h,v,b,E){for(;b>v;){if(b-v>600){var I=b-v+1,k=h-v+1,R=Math.log(I),z=.5*Math.exp(2*R/3),U=.5*Math.sqrt(R*z*(I-z)/I)*(k-I/2<0?-1:1);mb(p,h,Math.max(v,Math.floor(h-k*z/I+U)),Math.min(b,Math.floor(h+(I-k)*z/I+U)),E)}var W=p[h],X=v,ee=b;for(vh(p,v,h),E(p[b],W)>0&&vh(p,v,b);X0;)ee--}E(p[v],W)===0?vh(p,v,ee):vh(p,++ee,b),ee<=h&&(v=ee+1),h<=ee&&(b=ee-1)}}function vh(p,h,v){var b=p[h];p[h]=p[v],p[v]=b}function wA(p,h){return ph?1:0}function gf(p,h){if(p.length<=1)return[p];const v=[];let b,E;for(const I of p){const k=TA(I);k!==0&&(I.area=Math.abs(k),E===void 0&&(E=k<0),E===k<0?(b&&v.push(b),b=[I]):b.push(I))}if(b&&v.push(b),h>1)for(let I=0;I1?(U=h[z+1][0],W=h[z+1][1]):ne>0&&(U+=X/this.kx*ne,W+=ee/this.ky*ne)),X=this.wrap(v[0]-U)*this.kx,ee=(v[1]-W)*this.ky;const oe=X*X+ee*ee;oe180;)h-=360;return h}}function xb(p,h){return h[0]-p[0]}function vf(p){return p[1]-p[0]+1}function Ko(p,h){return p[1]>=p[0]&&p[1]p[1])return[null,null];const v=vf(p);if(h){if(v===2)return[p,null];const E=Math.floor(v/2);return[[p[0],p[0]+E],[p[0]+E,p[1]]]}if(v===1)return[p,null];const b=Math.floor(v/2)-1;return[[p[0],p[0]+b],[p[0]+b+1,p[1]]]}function Tv(p,h){if(!Ko(h,p.length))return[1/0,1/0,-1/0,-1/0];const v=[1/0,1/0,-1/0,-1/0];for(let b=h[0];b<=h[1];++b)ul(v,p[b]);return v}function Ev(p){const h=[1/0,1/0,-1/0,-1/0];for(const v of p)for(const b of v)ul(h,b);return h}function mf(p){return p[0]!==-1/0&&p[1]!==-1/0&&p[2]!==1/0&&p[3]!==1/0}function Cv(p,h,v){if(!mf(p)||!mf(h))return NaN;let b=0,E=0;return p[2]h[2]&&(b=p[0]-h[2]),p[1]>h[3]&&(E=p[1]-h[3]),p[3]=b)return b;if(Ds(E,I)){if(yf(p,h))return 0}else if(yf(h,p))return 0;let k=1/0;for(const R of p)for(let z=0,U=R.length,W=U-1;z0;){const z=k.pop();if(z[0]>=I)continue;const U=z[1],W=h?50:100;if(vf(U)<=W){if(!Ko(U,p.length))return NaN;if(h){const X=Tr(p,U,v,b);if(isNaN(X)||X===0)return X;I=Math.min(I,X)}else for(let X=U[0];X<=U[1];++X){const ee=CA(p[X],v,b);if(I=Math.min(I,ee),I===0)return 0}}else{const X=Sv(U,h);Qr(k,I,b,p,R,X[0]),Qr(k,I,b,p,R,X[1])}}return I}function yh(p,h,v,b,E,I=1/0){let k=Math.min(I,E.distance(p[0],v[0]));if(k===0)return k;const R=new vb([[0,[0,p.length-1],[0,v.length-1]]],xb);for(;R.length>0;){const z=R.pop();if(z[0]>=k)continue;const U=z[1],W=z[2],X=h?50:100,ee=b?50:100;if(vf(U)<=X&&vf(W)<=ee){if(!Ko(U,p.length)&&Ko(W,v.length))return NaN;let ne;if(h&&b)ne=EA(p,U,v,W,E),k=Math.min(k,ne);else if(h&&!b){const oe=p.slice(U[0],U[1]+1);for(let ce=W[0];ce<=W[1];++ce)if(ne=hl(v[ce],oe,E),k=Math.min(k,ne),k===0)return k}else if(!h&&b){const oe=v.slice(W[0],W[1]+1);for(let ce=U[0];ce<=U[1];++ce)if(ne=hl(p[ce],oe,E),k=Math.min(k,ne),k===0)return k}else ne=Mn(p,U,v,W,E),k=Math.min(k,ne)}else{const ne=Sv(U,h),oe=Sv(W,b);dl(R,k,E,p,v,ne[0],oe[0]),dl(R,k,E,p,v,ne[0],oe[1]),dl(R,k,E,p,v,ne[1],oe[0]),dl(R,k,E,p,v,ne[1],oe[1])}}return k}function Dv(p){return p.type==="MultiPolygon"?p.coordinates.map(h=>({type:"Polygon",coordinates:h})):p.type==="MultiLineString"?p.coordinates.map(h=>({type:"LineString",coordinates:h})):p.type==="MultiPoint"?p.coordinates.map(h=>({type:"Point",coordinates:h})):[p]}class fl{constructor(h,v){this.type=ct,this.geojson=h,this.geometries=v}static parse(h,v){if(h.length!==2)return v.error(`'distance' expression requires exactly one argument, but found ${h.length-1} instead.`);if(ol(h[1])){const b=h[1];if(b.type==="FeatureCollection")return new fl(b,b.features.map(E=>Dv(E.geometry)).flat());if(b.type==="Feature")return new fl(b,Dv(b.geometry));if("type"in b&&"coordinates"in b)return new fl(b,Dv(b))}return v.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(h){if(h.geometry()!=null&&h.canonicalID()!=null){if(h.geometryType()==="Point")return function(v,b){const E=v.geometry(),I=E.flat().map(z=>bv([z.x,z.y],v.canonical));if(E.length===0)return NaN;const k=new wv(I[0][1]);let R=1/0;for(const z of b){switch(z.type){case"Point":R=Math.min(R,yh(I,!1,[z.coordinates],!1,k,R));break;case"LineString":R=Math.min(R,yh(I,!1,z.coordinates,!0,k,R));break;case"Polygon":R=Math.min(R,mh(I,!1,z.coordinates,k,R))}if(R===0)return R}return R}(h,this.geometries);if(h.geometryType()==="LineString")return function(v,b){const E=v.geometry(),I=E.flat().map(z=>bv([z.x,z.y],v.canonical));if(E.length===0)return NaN;const k=new wv(I[0][1]);let R=1/0;for(const z of b){switch(z.type){case"Point":R=Math.min(R,yh(I,!0,[z.coordinates],!1,k,R));break;case"LineString":R=Math.min(R,yh(I,!0,z.coordinates,!0,k,R));break;case"Polygon":R=Math.min(R,mh(I,!0,z.coordinates,k,R))}if(R===0)return R}return R}(h,this.geometries);if(h.geometryType()==="Polygon")return function(v,b){const E=v.geometry();if(E.length===0||E[0].length===0)return NaN;const I=gf(E,0).map(z=>z.map(U=>U.map(W=>bv([W.x,W.y],v.canonical)))),k=new wv(I[0][0][0][1]);let R=1/0;for(const z of b)for(const U of I){switch(z.type){case"Point":R=Math.min(R,mh([z.coordinates],!1,U,k,R));break;case"LineString":R=Math.min(R,mh(z.coordinates,!0,U,k,R));break;case"Polygon":R=Math.min(R,un(U,z.coordinates,k,R))}if(R===0)return R}return R}(h,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const gu={"==":pA,"!=":sb,">":gA,"<":lb,">=":ub,"<=":vA,array:qa,at:pv,boolean:qa,case:lf,coalesce:hf,collator:gh,format:ff,image:yv,in:gv,"index-of":hu,interpolate:$i,"interpolate-hcl":$i,"interpolate-lab":$i,length:_v,let:As,literal:Wa,match:vv,number:qa,"number-format":mv,object:qa,slice:fh,step:du,string:qa,"to-boolean":Za,"to-color":Za,"to-number":Za,"to-string":Za,var:Zr,within:cl,distance:fl};class Ia{constructor(h,v,b,E){this.name=h,this.type=v,this._evaluate=b,this.args=E}evaluate(h){return this._evaluate(h,this.args)}eachChild(h){this.args.forEach(h)}outputDefined(){return!1}static parse(h,v){const b=h[0],E=Ia.definitions[b];if(!E)return v.error(`Unknown expression "${b}". If you wanted a literal array, use ["literal", [...]].`,0);const I=Array.isArray(E)?E[0]:E.type,k=Array.isArray(E)?[[E[1],E[2]]]:E.overloads,R=k.filter(([U])=>!Array.isArray(U)||U.length===h.length-1);let z=null;for(const[U,W]of R){z=new sl(v.registry,_h,v.path,null,v.scope);const X=[];let ee=!1;for(let ne=1;ne{return ee=X,Array.isArray(ee)?`(${ee.map(te).join(", ")})`:`(${te(ee.type)}...)`;var ee}).join(" | "),W=[];for(let X=1;X{v=h?v&&_h(b):v&&b instanceof Wa}),!!v&&bh(p)&&xh(p,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function bh(p){if(p instanceof Ia&&(p.name==="get"&&p.args.length===1||p.name==="feature-state"||p.name==="has"&&p.args.length===1||p.name==="properties"||p.name==="geometry-type"||p.name==="id"||/^filter-/.test(p.name))||p instanceof cl||p instanceof fl)return!1;let h=!0;return p.eachChild(v=>{h&&!bh(v)&&(h=!1)}),h}function vu(p){if(p instanceof Ia&&p.name==="feature-state")return!1;let h=!0;return p.eachChild(v=>{h&&!vu(v)&&(h=!1)}),h}function xh(p,h){if(p instanceof Ia&&h.indexOf(p.name)>=0)return!1;let v=!0;return p.eachChild(b=>{v&&!xh(b,h)&&(v=!1)}),v}function _f(p){return{result:"success",value:p}}function mu(p){return{result:"error",value:p}}function yu(p){return p["property-type"]==="data-driven"||p["property-type"]==="cross-faded-data-driven"}function wb(p){return!!p.expression&&p.expression.parameters.indexOf("zoom")>-1}function Lv(p){return!!p.expression&&p.expression.interpolated}function Ur(p){return p instanceof Number?"number":p instanceof String?"string":p instanceof Boolean?"boolean":Array.isArray(p)?"array":p===null?"null":typeof p}function bf(p){return typeof p=="object"&&p!==null&&!Array.isArray(p)}function AA(p){return p}function Sb(p,h){const v=h.type==="color",b=p.stops&&typeof p.stops[0][0]=="object",E=b||!(b||p.property!==void 0),I=p.type||(Lv(h)?"exponential":"interval");if(v||h.type==="padding"){const W=v?Kr.parse:ha.parse;(p=wr({},p)).stops&&(p.stops=p.stops.map(X=>[X[0],W(X[1])])),p.default=W(p.default?p.default:h.default)}if(p.colorSpace&&(k=p.colorSpace)!=="rgb"&&k!=="hcl"&&k!=="lab")throw new Error(`Unknown color space: "${p.colorSpace}"`);var k;let R,z,U;if(I==="exponential")R=Eb;else if(I==="interval")R=xf;else if(I==="categorical"){R=Tb,z=Object.create(null);for(const W of p.stops)z[W[0]]=W[1];U=typeof p.stops[0][0]}else{if(I!=="identity")throw new Error(`Unknown function type "${I}"`);R=Cb}if(b){const W={},X=[];for(let oe=0;oeoe[0]),evaluate:({zoom:oe},ce)=>Eb({stops:ee,base:p.base},h,oe).evaluate(oe,ce)}}if(E){const W=I==="exponential"?{name:"exponential",base:p.base!==void 0?p.base:1}:null;return{kind:"camera",interpolationType:W,interpolationFactor:$i.interpolationFactor.bind(void 0,W),zoomStops:p.stops.map(X=>X[0]),evaluate:({zoom:X})=>R(p,h,X,z,U)}}return{kind:"source",evaluate(W,X){const ee=X&&X.properties?X.properties[p.property]:void 0;return ee===void 0?_u(p.default,h.default):R(p,h,ee,z,U)}}}function _u(p,h,v){return p!==void 0?p:h!==void 0?h:v!==void 0?v:void 0}function Tb(p,h,v,b,E){return _u(typeof v===E?b[v]:void 0,p.default,h.default)}function xf(p,h,v){if(Ur(v)!=="number")return _u(p.default,h.default);const b=p.stops.length;if(b===1||v<=p.stops[0][0])return p.stops[0][1];if(v>=p.stops[b-1][0])return p.stops[b-1][1];const E=uf(p.stops.map(I=>I[0]),v);return p.stops[E][1]}function Eb(p,h,v){const b=p.base!==void 0?p.base:1;if(Ur(v)!=="number")return _u(p.default,h.default);const E=p.stops.length;if(E===1||v<=p.stops[0][0])return p.stops[0][1];if(v>=p.stops[E-1][0])return p.stops[E-1][1];const I=uf(p.stops.map(W=>W[0]),v),k=function(W,X,ee,ne){const oe=ne-ee,ce=W-ee;return oe===0?0:X===1?ce/oe:(Math.pow(X,ce)-1)/(Math.pow(X,oe)-1)}(v,b,p.stops[I][0],p.stops[I+1][0]),R=p.stops[I][1],z=p.stops[I+1][1],U=Fi[h.type]||AA;return typeof R.evaluate=="function"?{evaluate(...W){const X=R.evaluate.apply(void 0,W),ee=z.evaluate.apply(void 0,W);if(X!==void 0&&ee!==void 0)return U(X,ee,k,p.colorSpace)}}:U(R,z,k,p.colorSpace)}function Cb(p,h,v){switch(h.type){case"color":v=Kr.parse(v);break;case"formatted":v=ca.fromString(v.toString());break;case"resolvedImage":v=da.fromString(v.toString());break;case"padding":v=ha.parse(v);break;default:Ur(v)===h.type||h.type==="enum"&&h.values[v]||(v=void 0)}return _u(v,p.default,h.default)}Ia.register(gu,{error:[{kind:"error"},[yr],(p,[h])=>{throw new Rn(h.evaluate(p))}],typeof:[yr,[cr],(p,[h])=>te(Vn(h.evaluate(p)))],"to-rgba":[re(ct,4),[fi],(p,[h])=>{const[v,b,E,I]=h.evaluate(p).rgb;return[255*v,255*b,255*E,I]}],rgb:[fi,[ct,ct,ct],Mv],rgba:[fi,[ct,ct,ct,ct],Mv],has:{type:tr,overloads:[[[yr],(p,[h])=>Iv(h.evaluate(p),p.properties())],[[yr,la],(p,[h,v])=>Iv(h.evaluate(p),v.evaluate(p))]]},get:{type:cr,overloads:[[[yr],(p,[h])=>kv(h.evaluate(p),p.properties())],[[yr,la],(p,[h,v])=>kv(h.evaluate(p),v.evaluate(p))]]},"feature-state":[cr,[yr],(p,[h])=>kv(h.evaluate(p),p.featureState||{})],properties:[la,[],p=>p.properties()],"geometry-type":[yr,[],p=>p.geometryType()],id:[cr,[],p=>p.id()],zoom:[ct,[],p=>p.globals.zoom],"heatmap-density":[ct,[],p=>p.globals.heatmapDensity||0],"line-progress":[ct,[],p=>p.globals.lineProgress||0],accumulated:[cr,[],p=>p.globals.accumulated===void 0?null:p.globals.accumulated],"+":[ct,pl(ct),(p,h)=>{let v=0;for(const b of h)v+=b.evaluate(p);return v}],"*":[ct,pl(ct),(p,h)=>{let v=1;for(const b of h)v*=b.evaluate(p);return v}],"-":{type:ct,overloads:[[[ct,ct],(p,[h,v])=>h.evaluate(p)-v.evaluate(p)],[[ct],(p,[h])=>-h.evaluate(p)]]},"/":[ct,[ct,ct],(p,[h,v])=>h.evaluate(p)/v.evaluate(p)],"%":[ct,[ct,ct],(p,[h,v])=>h.evaluate(p)%v.evaluate(p)],ln2:[ct,[],()=>Math.LN2],pi:[ct,[],()=>Math.PI],e:[ct,[],()=>Math.E],"^":[ct,[ct,ct],(p,[h,v])=>Math.pow(h.evaluate(p),v.evaluate(p))],sqrt:[ct,[ct],(p,[h])=>Math.sqrt(h.evaluate(p))],log10:[ct,[ct],(p,[h])=>Math.log(h.evaluate(p))/Math.LN10],ln:[ct,[ct],(p,[h])=>Math.log(h.evaluate(p))],log2:[ct,[ct],(p,[h])=>Math.log(h.evaluate(p))/Math.LN2],sin:[ct,[ct],(p,[h])=>Math.sin(h.evaluate(p))],cos:[ct,[ct],(p,[h])=>Math.cos(h.evaluate(p))],tan:[ct,[ct],(p,[h])=>Math.tan(h.evaluate(p))],asin:[ct,[ct],(p,[h])=>Math.asin(h.evaluate(p))],acos:[ct,[ct],(p,[h])=>Math.acos(h.evaluate(p))],atan:[ct,[ct],(p,[h])=>Math.atan(h.evaluate(p))],min:[ct,pl(ct),(p,h)=>Math.min(...h.map(v=>v.evaluate(p)))],max:[ct,pl(ct),(p,h)=>Math.max(...h.map(v=>v.evaluate(p)))],abs:[ct,[ct],(p,[h])=>Math.abs(h.evaluate(p))],round:[ct,[ct],(p,[h])=>{const v=h.evaluate(p);return v<0?-Math.round(-v):Math.round(v)}],floor:[ct,[ct],(p,[h])=>Math.floor(h.evaluate(p))],ceil:[ct,[ct],(p,[h])=>Math.ceil(h.evaluate(p))],"filter-==":[tr,[yr,cr],(p,[h,v])=>p.properties()[h.value]===v.value],"filter-id-==":[tr,[cr],(p,[h])=>p.id()===h.value],"filter-type-==":[tr,[yr],(p,[h])=>p.geometryType()===h.value],"filter-<":[tr,[yr,cr],(p,[h,v])=>{const b=p.properties()[h.value],E=v.value;return typeof b==typeof E&&b{const v=p.id(),b=h.value;return typeof v==typeof b&&v":[tr,[yr,cr],(p,[h,v])=>{const b=p.properties()[h.value],E=v.value;return typeof b==typeof E&&b>E}],"filter-id->":[tr,[cr],(p,[h])=>{const v=p.id(),b=h.value;return typeof v==typeof b&&v>b}],"filter-<=":[tr,[yr,cr],(p,[h,v])=>{const b=p.properties()[h.value],E=v.value;return typeof b==typeof E&&b<=E}],"filter-id-<=":[tr,[cr],(p,[h])=>{const v=p.id(),b=h.value;return typeof v==typeof b&&v<=b}],"filter->=":[tr,[yr,cr],(p,[h,v])=>{const b=p.properties()[h.value],E=v.value;return typeof b==typeof E&&b>=E}],"filter-id->=":[tr,[cr],(p,[h])=>{const v=p.id(),b=h.value;return typeof v==typeof b&&v>=b}],"filter-has":[tr,[cr],(p,[h])=>h.value in p.properties()],"filter-has-id":[tr,[],p=>p.id()!==null&&p.id()!==void 0],"filter-type-in":[tr,[re(yr)],(p,[h])=>h.value.indexOf(p.geometryType())>=0],"filter-id-in":[tr,[re(cr)],(p,[h])=>h.value.indexOf(p.id())>=0],"filter-in-small":[tr,[yr,re(cr)],(p,[h,v])=>v.value.indexOf(p.properties()[h.value])>=0],"filter-in-large":[tr,[yr,re(cr)],(p,[h,v])=>function(b,E,I,k){for(;I<=k;){const R=I+k>>1;if(E[R]===b)return!0;E[R]>b?k=R-1:I=R+1}return!1}(p.properties()[h.value],v.value,0,v.value.length-1)],all:{type:tr,overloads:[[[tr,tr],(p,[h,v])=>h.evaluate(p)&&v.evaluate(p)],[pl(tr),(p,h)=>{for(const v of h)if(!v.evaluate(p))return!1;return!0}]]},any:{type:tr,overloads:[[[tr,tr],(p,[h,v])=>h.evaluate(p)||v.evaluate(p)],[pl(tr),(p,h)=>{for(const v of h)if(v.evaluate(p))return!0;return!1}]]},"!":[tr,[tr],(p,[h])=>!h.evaluate(p)],"is-supported-script":[tr,[yr],(p,[h])=>{const v=p.globals&&p.globals.isSupportedScript;return!v||v(h.evaluate(p))}],upcase:[yr,[yr],(p,[h])=>h.evaluate(p).toUpperCase()],downcase:[yr,[yr],(p,[h])=>h.evaluate(p).toLowerCase()],concat:[yr,pl(cr),(p,h)=>h.map(v=>dh(v.evaluate(p))).join("")],"resolved-locale":[yr,[Da],(p,[h])=>h.evaluate(p).resolvedLocale()]});class wf{constructor(h,v){var b;this.expression=h,this._warningHistory={},this._evaluator=new sf,this._defaultValue=v?(b=v).type==="color"&&bf(b.default)?new Kr(0,0,0,0):b.type==="color"?Kr.parse(b.default)||null:b.type==="padding"?ha.parse(b.default)||null:b.type==="variableAnchorOffsetCollection"?Ma.parse(b.default)||null:b.default===void 0?null:b.default:null,this._enumValues=v&&v.type==="enum"?v.values:null}evaluateWithoutErrorHandling(h,v,b,E,I,k){return this._evaluator.globals=h,this._evaluator.feature=v,this._evaluator.featureState=b,this._evaluator.canonical=E,this._evaluator.availableImages=I||null,this._evaluator.formattedSection=k,this.expression.evaluate(this._evaluator)}evaluate(h,v,b,E,I,k){this._evaluator.globals=h,this._evaluator.feature=v||null,this._evaluator.featureState=b||null,this._evaluator.canonical=E,this._evaluator.availableImages=I||null,this._evaluator.formattedSection=k||null;try{const R=this.expression.evaluate(this._evaluator);if(R==null||typeof R=="number"&&R!=R)return this._defaultValue;if(this._enumValues&&!(R in this._enumValues))throw new Rn(`Expected value to be one of ${Object.keys(this._enumValues).map(z=>JSON.stringify(z)).join(", ")}, but found ${JSON.stringify(R)} instead.`);return R}catch(R){return this._warningHistory[R.message]||(this._warningHistory[R.message]=!0,typeof console<"u"&&console.warn(R.message)),this._defaultValue}}}function Sf(p){return Array.isArray(p)&&p.length>0&&typeof p[0]=="string"&&p[0]in gu}function bu(p,h){const v=new sl(gu,_h,[],h?function(E){const I={color:fi,string:yr,number:ct,enum:yr,boolean:tr,formatted:Br,padding:ua,resolvedImage:pi,variableAnchorOffsetCollection:be};return E.type==="array"?re(I[E.value]||cr,E.length):I[E.type]}(h):void 0),b=v.parse(p,void 0,void 0,void 0,h&&h.type==="string"?{typeAnnotation:"coerce"}:void 0);return b?_f(new wf(b,h)):mu(v.errors)}class xu{constructor(h,v){this.kind=h,this._styleExpression=v,this.isStateDependent=h!=="constant"&&!vu(v.expression)}evaluateWithoutErrorHandling(h,v,b,E,I,k){return this._styleExpression.evaluateWithoutErrorHandling(h,v,b,E,I,k)}evaluate(h,v,b,E,I,k){return this._styleExpression.evaluate(h,v,b,E,I,k)}}class wu{constructor(h,v,b,E){this.kind=h,this.zoomStops=b,this._styleExpression=v,this.isStateDependent=h!=="camera"&&!vu(v.expression),this.interpolationType=E}evaluateWithoutErrorHandling(h,v,b,E,I,k){return this._styleExpression.evaluateWithoutErrorHandling(h,v,b,E,I,k)}evaluate(h,v,b,E,I,k){return this._styleExpression.evaluate(h,v,b,E,I,k)}interpolationFactor(h,v,b){return this.interpolationType?$i.interpolationFactor(this.interpolationType,h,v,b):0}}function Pv(p,h){const v=bu(p,h);if(v.result==="error")return v;const b=v.value.expression,E=bh(b);if(!E&&!yu(h))return mu([new zr("","data expressions not supported")]);const I=xh(b,["zoom"]);if(!I&&!wb(h))return mu([new zr("","zoom expressions not supported")]);const k=wh(b);return k||I?k instanceof zr?mu([k]):k instanceof $i&&!Lv(h)?mu([new zr("",'"interpolate" expressions cannot be used with this property')]):_f(k?new wu(E?"camera":"composite",v.value,k.labels,k instanceof $i?k.interpolation:void 0):new xu(E?"constant":"source",v.value)):mu([new zr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Su{constructor(h,v){this._parameters=h,this._specification=v,wr(this,Sb(this._parameters,this._specification))}static deserialize(h){return new Su(h._parameters,h._specification)}static serialize(h){return{_parameters:h._parameters,_specification:h._specification}}}function wh(p){let h=null;if(p instanceof As)h=wh(p.result);else if(p instanceof hf){for(const v of p.args)if(h=wh(v),h)break}else(p instanceof du||p instanceof $i)&&p.input instanceof Ia&&p.input.name==="zoom"&&(h=p);return h instanceof zr||p.eachChild(v=>{const b=wh(v);b instanceof zr?h=b:!h&&b?h=new zr("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):h&&b&&h!==b&&(h=new zr("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),h}function Tf(p){if(p===!0||p===!1)return!0;if(!Array.isArray(p)||p.length===0)return!1;switch(p[0]){case"has":return p.length>=2&&p[1]!=="$id"&&p[1]!=="$type";case"in":return p.length>=3&&(typeof p[1]!="string"||Array.isArray(p[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return p.length!==3||Array.isArray(p[1])||Array.isArray(p[2]);case"any":case"all":for(const h of p.slice(1))if(!Tf(h)&&typeof h!="boolean")return!1;return!0;default:return!0}}const Ef={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Rv(p){if(p==null)return{filter:()=>!0,needGeometry:!1};Tf(p)||(p=Cf(p));const h=bu(p,Ef);if(h.result==="error")throw new Error(h.value.map(v=>`${v.key}: ${v.message}`).join(", "));return{filter:(v,b,E)=>h.value.evaluate(v,b,{},E),needGeometry:Ab(p)}}function DA(p,h){return ph?1:0}function Ab(p){if(!Array.isArray(p))return!1;if(p[0]==="within"||p[0]==="distance")return!0;for(let h=1;h"||h==="<="||h===">="?Nv(p[1],p[2],h):h==="any"?(v=p.slice(1),["any"].concat(v.map(Cf))):h==="all"?["all"].concat(p.slice(1).map(Cf)):h==="none"?["all"].concat(p.slice(1).map(Cf).map(gi)):h==="in"?Sh(p[1],p.slice(2)):h==="!in"?gi(Sh(p[1],p.slice(2))):h==="has"?Th(p[1]):h!=="!has"||gi(Th(p[1]));var v}function Nv(p,h,v){switch(p){case"$type":return[`filter-type-${v}`,h];case"$id":return[`filter-id-${v}`,h];default:return[`filter-${v}`,p,h]}}function Sh(p,h){if(h.length===0)return!1;switch(p){case"$type":return["filter-type-in",["literal",h]];case"$id":return["filter-id-in",["literal",h]];default:return h.length>200&&!h.some(v=>typeof v!=typeof h[0])?["filter-in-large",p,["literal",h.sort(DA)]]:["filter-in-small",p,["literal",h]]}}function Th(p){switch(p){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",p]}}function gi(p){return["!",p]}function gl(p){const h=typeof p;if(h==="number"||h==="boolean"||h==="string"||p==null)return JSON.stringify(p);if(Array.isArray(p)){let E="[";for(const I of p)E+=`${gl(I)},`;return`${E}]`}const v=Object.keys(p).sort();let b="{";for(let E=0;Eb.maximum?[new qe(h,v,`${v} is greater than the maximum value ${b.maximum}`)]:[]}function Af(p){const h=p.valueSpec,v=In(p.value.type);let b,E,I,k={};const R=v!=="categorical"&&p.value.property===void 0,z=!R,U=Ur(p.value.stops)==="array"&&Ur(p.value.stops[0])==="array"&&Ur(p.value.stops[0][0])==="object",W=fa({key:p.key,value:p.value,valueSpec:p.styleSpec.function,validateSpec:p.validateSpec,style:p.style,styleSpec:p.styleSpec,objectElementValidators:{stops:function(ne){if(v==="identity")return[new qe(ne.key,ne.value,'identity function may not have a "stops" property')];let oe=[];const ce=ne.value;return oe=oe.concat(Eh({key:ne.key,value:ce,valueSpec:ne.valueSpec,validateSpec:ne.validateSpec,style:ne.style,styleSpec:ne.styleSpec,arrayElementValidator:X})),Ur(ce)==="array"&&ce.length===0&&oe.push(new qe(ne.key,ce,"array must have at least one stop")),oe},default:function(ne){return ne.validateSpec({key:ne.key,value:ne.value,valueSpec:h,validateSpec:ne.validateSpec,style:ne.style,styleSpec:ne.styleSpec})}}});return v==="identity"&&R&&W.push(new qe(p.key,p.value,'missing required property "property"')),v==="identity"||p.value.stops||W.push(new qe(p.key,p.value,'missing required property "stops"')),v==="exponential"&&p.valueSpec.expression&&!Lv(p.valueSpec)&&W.push(new qe(p.key,p.value,"exponential functions not supported")),p.styleSpec.$version>=8&&(z&&!yu(p.valueSpec)?W.push(new qe(p.key,p.value,"property functions not supported")):R&&!wb(p.valueSpec)&&W.push(new qe(p.key,p.value,"zoom functions not supported"))),v!=="categorical"&&!U||p.value.property!==void 0||W.push(new qe(p.key,p.value,'"property" property is required')),W;function X(ne){let oe=[];const ce=ne.value,me=ne.key;if(Ur(ce)!=="array")return[new qe(me,ce,`array expected, ${Ur(ce)} found`)];if(ce.length!==2)return[new qe(me,ce,`array length 2 expected, length ${ce.length} found`)];if(U){if(Ur(ce[0])!=="object")return[new qe(me,ce,`object expected, ${Ur(ce[0])} found`)];if(ce[0].zoom===void 0)return[new qe(me,ce,"object stop key must have zoom")];if(ce[0].value===void 0)return[new qe(me,ce,"object stop key must have value")];if(I&&I>In(ce[0].zoom))return[new qe(me,ce[0].zoom,"stop zoom values must appear in ascending order")];In(ce[0].zoom)!==I&&(I=In(ce[0].zoom),E=void 0,k={}),oe=oe.concat(fa({key:`${me}[0]`,value:ce[0],valueSpec:{zoom:{}},validateSpec:ne.validateSpec,style:ne.style,styleSpec:ne.styleSpec,objectElementValidators:{zoom:Ov,value:ee}}))}else oe=oe.concat(ee({key:`${me}[0]`,value:ce[0],validateSpec:ne.validateSpec,style:ne.style,styleSpec:ne.styleSpec},ce));return Sf(ja(ce[1]))?oe.concat([new qe(`${me}[1]`,ce[1],"expressions are not allowed in function stops.")]):oe.concat(ne.validateSpec({key:`${me}[1]`,value:ce[1],valueSpec:h,validateSpec:ne.validateSpec,style:ne.style,styleSpec:ne.styleSpec}))}function ee(ne,oe){const ce=Ur(ne.value),me=In(ne.value),we=ne.value!==null?ne.value:oe;if(b){if(ce!==b)return[new qe(ne.key,we,`${ce} stop domain type must match previous stop domain type ${b}`)]}else b=ce;if(ce!=="number"&&ce!=="string"&&ce!=="boolean")return[new qe(ne.key,we,"stop domain value must be a number, string, or boolean")];if(ce!=="number"&&v!=="categorical"){let Oe=`number expected, ${ce} found`;return yu(h)&&v===void 0&&(Oe+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new qe(ne.key,we,Oe)]}return v!=="categorical"||ce!=="number"||isFinite(me)&&Math.floor(me)===me?v!=="categorical"&&ce==="number"&&E!==void 0&&menew qe(`${p.key}${b.key}`,p.value,b.message));const v=h.value.expression||h.value._styleExpression.expression;if(p.expressionContext==="property"&&p.propertyKey==="text-font"&&!v.outputDefined())return[new qe(p.key,p.value,`Invalid data expression for "${p.propertyKey}". Output values must be contained as literals within the expression.`)];if(p.expressionContext==="property"&&p.propertyType==="layout"&&!vu(v))return[new qe(p.key,p.value,'"feature-state" data expressions are not supported with layout properties.')];if(p.expressionContext==="filter"&&!vu(v))return[new qe(p.key,p.value,'"feature-state" data expressions are not supported with filters.')];if(p.expressionContext&&p.expressionContext.indexOf("cluster")===0){if(!xh(v,["zoom","feature-state"]))return[new qe(p.key,p.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(p.expressionContext==="cluster-initial"&&!bh(v))return[new qe(p.key,p.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Jo(p){const h=p.key,v=p.value,b=p.valueSpec,E=[];return Array.isArray(b.values)?b.values.indexOf(In(v))===-1&&E.push(new qe(h,v,`expected one of [${b.values.join(", ")}], ${JSON.stringify(v)} found`)):Object.keys(b.values).indexOf(In(v))===-1&&E.push(new qe(h,v,`expected one of [${Object.keys(b.values).join(", ")}], ${JSON.stringify(v)} found`)),E}function zv(p){return Tf(ja(p.value))?Tu(wr({},p,{expressionContext:"filter",valueSpec:{value:"boolean"}})):Df(p)}function Df(p){const h=p.value,v=p.key;if(Ur(h)!=="array")return[new qe(v,h,`array expected, ${Ur(h)} found`)];const b=p.styleSpec;let E,I=[];if(h.length<1)return[new qe(v,h,"filter array must have at least 1 element")];switch(I=I.concat(Jo({key:`${v}[0]`,value:h[0],valueSpec:b.filter_operator,style:p.style,styleSpec:p.styleSpec})),In(h[0])){case"<":case"<=":case">":case">=":h.length>=2&&In(h[1])==="$type"&&I.push(new qe(v,h,`"$type" cannot be use with operator "${h[0]}"`));case"==":case"!=":h.length!==3&&I.push(new qe(v,h,`filter array for operator "${h[0]}" must have 3 elements`));case"in":case"!in":h.length>=2&&(E=Ur(h[1]),E!=="string"&&I.push(new qe(`${v}[1]`,h[1],`string expected, ${E} found`)));for(let k=2;k{U in v&&h.push(new qe(b,v[U],`"${U}" is prohibited for ref layers`))}),E.layers.forEach(U=>{In(U.id)===R&&(z=U)}),z?z.ref?h.push(new qe(b,v.ref,"ref cannot reference another ref layer")):k=In(z.type):h.push(new qe(b,v.ref,`ref layer "${R}" not found`))}else if(k!=="background")if(v.source){const z=E.sources&&E.sources[v.source],U=z&&In(z.type);z?U==="vector"&&k==="raster"?h.push(new qe(b,v.source,`layer "${v.id}" requires a raster source`)):U!=="raster-dem"&&k==="hillshade"?h.push(new qe(b,v.source,`layer "${v.id}" requires a raster-dem source`)):U==="raster"&&k!=="raster"?h.push(new qe(b,v.source,`layer "${v.id}" requires a vector source`)):U!=="vector"||v["source-layer"]?U==="raster-dem"&&k!=="hillshade"?h.push(new qe(b,v.source,"raster-dem source can only be used with layer type 'hillshade'.")):k!=="line"||!v.paint||!v.paint["line-gradient"]||U==="geojson"&&z.lineMetrics||h.push(new qe(b,v,`layer "${v.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):h.push(new qe(b,v,`layer "${v.id}" must specify a "source-layer"`)):h.push(new qe(b,v.source,`source "${v.source}" not found`))}else h.push(new qe(b,v,'missing required property "source"'));return h=h.concat(fa({key:b,value:v,valueSpec:I.layer,style:p.style,styleSpec:p.styleSpec,validateSpec:p.validateSpec,objectElementValidators:{"*":()=>[],type:()=>p.validateSpec({key:`${b}.type`,value:v.type,valueSpec:I.layer.type,style:p.style,styleSpec:p.styleSpec,validateSpec:p.validateSpec,object:v,objectKey:"type"}),filter:zv,layout:z=>fa({layer:v,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,validateSpec:z.validateSpec,objectElementValidators:{"*":U=>Vv(wr({layerType:k},U))}}),paint:z=>fa({layer:v,key:z.key,value:z.value,style:z.style,styleSpec:z.styleSpec,validateSpec:z.validateSpec,objectElementValidators:{"*":U=>Mf(wr({layerType:k},U))}})}})),h}function vl(p){const h=p.value,v=p.key,b=Ur(h);return b!=="string"?[new qe(v,h,`string expected, ${b} found`)]:[]}const If={promoteId:function({key:p,value:h}){if(Ur(h)==="string")return vl({key:p,value:h});{const v=[];for(const b in h)v.push(...vl({key:`${p}.${b}`,value:h[b]}));return v}}};function Ch(p){const h=p.value,v=p.key,b=p.styleSpec,E=p.style,I=p.validateSpec;if(!h.type)return[new qe(v,h,'"type" is required')];const k=In(h.type);let R;switch(k){case"vector":case"raster":return R=fa({key:v,value:h,valueSpec:b[`source_${k.replace("-","_")}`],style:p.style,styleSpec:b,objectElementValidators:If,validateSpec:I}),R;case"raster-dem":return R=function(z){var U;const W=(U=z.sourceName)!==null&&U!==void 0?U:"",X=z.value,ee=z.styleSpec,ne=ee.source_raster_dem,oe=z.style;let ce=[];const me=Ur(X);if(X===void 0)return ce;if(me!=="object")return ce.push(new qe("source_raster_dem",X,`object expected, ${me} found`)),ce;const we=In(X.encoding)==="custom",Oe=["redFactor","greenFactor","blueFactor","baseShift"],Ae=z.value.encoding?`"${z.value.encoding}"`:"Default";for(const Re in X)!we&&Oe.includes(Re)?ce.push(new qe(Re,X[Re],`In "${W}": "${Re}" is only valid when "encoding" is set to "custom". ${Ae} encoding found`)):ne[Re]?ce=ce.concat(z.validateSpec({key:Re,value:X[Re],valueSpec:ne[Re],validateSpec:z.validateSpec,style:oe,styleSpec:ee})):ce.push(new qe(Re,X[Re],`unknown property "${Re}"`));return ce}({sourceName:v,value:h,style:p.style,styleSpec:b,validateSpec:I}),R;case"geojson":if(R=fa({key:v,value:h,valueSpec:b.source_geojson,style:E,styleSpec:b,validateSpec:I,objectElementValidators:If}),h.cluster)for(const z in h.clusterProperties){const[U,W]=h.clusterProperties[z],X=typeof U=="string"?[U,["accumulated"],["get",z]]:U;R.push(...Tu({key:`${v}.${z}.map`,value:W,expressionContext:"cluster-map"})),R.push(...Tu({key:`${v}.${z}.reduce`,value:X,expressionContext:"cluster-reduce"}))}return R;case"video":return fa({key:v,value:h,valueSpec:b.source_video,style:E,validateSpec:I,styleSpec:b});case"image":return fa({key:v,value:h,valueSpec:b.source_image,style:E,validateSpec:I,styleSpec:b});case"canvas":return[new qe(v,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Jo({key:`${v}.type`,value:h.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function $v(p){const h=p.value,v=p.styleSpec,b=v.light,E=p.style;let I=[];const k=Ur(h);if(h===void 0)return I;if(k!=="object")return I=I.concat([new qe("light",h,`object expected, ${k} found`)]),I;for(const R in h){const z=R.match(/^(.*)-transition$/);I=I.concat(z&&b[z[1]]&&b[z[1]].transition?p.validateSpec({key:R,value:h[R],valueSpec:v.transition,validateSpec:p.validateSpec,style:E,styleSpec:v}):b[R]?p.validateSpec({key:R,value:h[R],valueSpec:b[R],validateSpec:p.validateSpec,style:E,styleSpec:v}):[new qe(R,h[R],`unknown property "${R}"`)])}return I}function Gv(p){const h=p.value,v=p.styleSpec,b=v.sky,E=p.style,I=Ur(h);if(h===void 0)return[];if(I!=="object")return[new qe("sky",h,`object expected, ${I} found`)];let k=[];for(const R in h)k=k.concat(b[R]?p.validateSpec({key:R,value:h[R],valueSpec:b[R],style:E,styleSpec:v}):[new qe(R,h[R],`unknown property "${R}"`)]);return k}function Uv(p){const h=p.value,v=p.styleSpec,b=v.terrain,E=p.style;let I=[];const k=Ur(h);if(h===void 0)return I;if(k!=="object")return I=I.concat([new qe("terrain",h,`object expected, ${k} found`)]),I;for(const R in h)I=I.concat(b[R]?p.validateSpec({key:R,value:h[R],valueSpec:b[R],validateSpec:p.validateSpec,style:E,styleSpec:v}):[new qe(R,h[R],`unknown property "${R}"`)]);return I}function Hv(p){let h=[];const v=p.value,b=p.key;if(Array.isArray(v)){const E=[],I=[];for(const k in v)v[k].id&&E.includes(v[k].id)&&h.push(new qe(b,v,`all the sprites' ids must be unique, but ${v[k].id} is duplicated`)),E.push(v[k].id),v[k].url&&I.includes(v[k].url)&&h.push(new qe(b,v,`all the sprites' URLs must be unique, but ${v[k].url} is duplicated`)),I.push(v[k].url),h=h.concat(fa({key:`${b}[${k}]`,value:v[k],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:p.validateSpec}));return h}return vl({key:b,value:v})}const kf={"*":()=>[],array:Eh,boolean:function(p){const h=p.value,v=p.key,b=Ur(h);return b!=="boolean"?[new qe(v,h,`boolean expected, ${b} found`)]:[]},number:Ov,color:function(p){const h=p.key,v=p.value,b=Ur(v);return b!=="string"?[new qe(h,v,`color expected, ${b} found`)]:Kr.parse(String(v))?[]:[new qe(h,v,`color expected, "${v}" found`)]},constants:Mb,enum:Jo,filter:zv,function:Af,layer:Fv,object:fa,source:Ch,light:$v,sky:Gv,terrain:Uv,projection:function(p){const h=p.value,v=p.styleSpec,b=v.projection,E=p.style,I=Ur(h);if(h===void 0)return[];if(I!=="object")return[new qe("projection",h,`object expected, ${I} found`)];let k=[];for(const R in h)k=k.concat(b[R]?p.validateSpec({key:R,value:h[R],valueSpec:b[R],style:E,styleSpec:v}):[new qe(R,h[R],`unknown property "${R}"`)]);return k},string:vl,formatted:function(p){return vl(p).length===0?[]:Tu(p)},resolvedImage:function(p){return vl(p).length===0?[]:Tu(p)},padding:function(p){const h=p.key,v=p.value;if(Ur(v)==="array"){if(v.length<1||v.length>4)return[new qe(h,v,`padding requires 1 to 4 values; ${v.length} values found`)];const b={type:"number"};let E=[];for(let I=0;I[]}})),p.constants&&(v=v.concat(Mb({key:"constants",value:p.constants}))),Wv(v)}function Mo(p){return function(h){return p({...h,validateSpec:Ah})}}function Wv(p){return[].concat(p).sort((h,v)=>h.line-v.line)}function Xa(p){return function(...h){return Wv(p.apply(this,h))}}ka.source=Xa(Mo(Ch)),ka.sprite=Xa(Mo(Hv)),ka.glyphs=Xa(Mo(Ib)),ka.light=Xa(Mo($v)),ka.sky=Xa(Mo(Gv)),ka.terrain=Xa(Mo(Uv)),ka.layer=Xa(Mo(Fv)),ka.filter=Xa(Mo(zv)),ka.paintProperty=Xa(Mo(Mf)),ka.layoutProperty=Xa(Mo(Vv));const ml=ka,MA=ml.light,IA=ml.sky,kb=ml.paintProperty,Lb=ml.layoutProperty;function qv(p,h){let v=!1;if(h&&h.length)for(const b of h)p.fire(new Ft(new Error(b.message))),v=!0;return v}class Eu{constructor(h,v,b){const E=this.cells=[];if(h instanceof ArrayBuffer){this.arrayBuffer=h;const k=new Int32Array(this.arrayBuffer);h=k[0],this.d=(v=k[1])+2*(b=k[2]);for(let z=0;z=X[oe+0]&&E>=X[oe+1])?(R[ne]=!0,k.push(W[ne])):R[ne]=!1}}}}_forEachCell(h,v,b,E,I,k,R,z){const U=this._convertToCellCoord(h),W=this._convertToCellCoord(v),X=this._convertToCellCoord(b),ee=this._convertToCellCoord(E);for(let ne=U;ne<=X;ne++)for(let oe=W;oe<=ee;oe++){const ce=this.d*oe+ne;if((!z||z(this._convertFromCellCoord(ne),this._convertFromCellCoord(oe),this._convertFromCellCoord(ne+1),this._convertFromCellCoord(oe+1)))&&I.call(this,h,v,b,E,ce,k,R,z))return}}_convertFromCellCoord(h){return(h-this.padding)/this.scale}_convertToCellCoord(h){return Math.max(0,Math.min(this.d-1,Math.floor(h*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const h=this.cells,v=3+this.cells.length+1+1;let b=0;for(let k=0;k=0)continue;const k=p[I];E[I]=La[v].shallow.indexOf(I)>=0?k:Cu(k,h)}p instanceof Error&&(E.message=p.message)}if(E.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(E.$name=v),E}function Au(p){if(Pb(p))return p;if(Array.isArray(p))return p.map(Au);if(typeof p!="object")throw new Error("can't deserialize object of type "+typeof p);const h=Zv(p)||"Object";if(!La[h])throw new Error(`can't deserialize unregistered class ${h}`);const{klass:v}=La[h];if(!v)throw new Error(`can't deserialize unregistered class ${h}`);if(v.deserialize)return v.deserialize(p);const b=Object.create(v.prototype);for(const E of Object.keys(p)){if(E==="$name")continue;const I=p[E];b[E]=La[h].shallow.indexOf(E)>=0?I:Au(I)}return b}class jv{constructor(){this.first=!0}update(h,v){const b=Math.floor(h);return this.first?(this.first=!1,this.lastIntegerZoom=b,this.lastIntegerZoomTime=0,this.lastZoom=h,this.lastFloorZoom=b,!0):(this.lastFloorZoom>b?(this.lastIntegerZoom=b+1,this.lastIntegerZoomTime=v):this.lastFloorZoomp>=128&&p<=255,"Hangul Jamo":p=>p>=4352&&p<=4607,Khmer:p=>p>=6016&&p<=6143,"General Punctuation":p=>p>=8192&&p<=8303,"Letterlike Symbols":p=>p>=8448&&p<=8527,"Number Forms":p=>p>=8528&&p<=8591,"Miscellaneous Technical":p=>p>=8960&&p<=9215,"Control Pictures":p=>p>=9216&&p<=9279,"Optical Character Recognition":p=>p>=9280&&p<=9311,"Enclosed Alphanumerics":p=>p>=9312&&p<=9471,"Geometric Shapes":p=>p>=9632&&p<=9727,"Miscellaneous Symbols":p=>p>=9728&&p<=9983,"Miscellaneous Symbols and Arrows":p=>p>=11008&&p<=11263,"Ideographic Description Characters":p=>p>=12272&&p<=12287,"CJK Symbols and Punctuation":p=>p>=12288&&p<=12351,Katakana:p=>p>=12448&&p<=12543,Kanbun:p=>p>=12688&&p<=12703,"CJK Strokes":p=>p>=12736&&p<=12783,"Enclosed CJK Letters and Months":p=>p>=12800&&p<=13055,"CJK Compatibility":p=>p>=13056&&p<=13311,"Yijing Hexagram Symbols":p=>p>=19904&&p<=19967,"Private Use Area":p=>p>=57344&&p<=63743,"Vertical Forms":p=>p>=65040&&p<=65055,"CJK Compatibility Forms":p=>p>=65072&&p<=65103,"Small Form Variants":p=>p>=65104&&p<=65135,"Halfwidth and Fullwidth Forms":p=>p>=65280&&p<=65519};function Xv(p){for(const h of p)if(Kv(h.charCodeAt(0)))return!0;return!1}function kA(p){for(const h of p)if(!Du(h.charCodeAt(0)))return!1;return!0}function Yv(p){const h=p.map(v=>{try{return new RegExp(`\\p{sc=${v}}`,"u").source}catch{return null}}).filter(v=>v);return new RegExp(h.join("|"),"u")}const LA=Yv(["Arab","Dupl","Mong","Ougr","Syrc"]);function Du(p){return!LA.test(String.fromCodePoint(p))}const Rb=Yv(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Kv(p){return!(p!==746&&p!==747&&(p<4352||!(Rr["CJK Compatibility Forms"](p)&&!(p>=65097&&p<=65103)||Rr["CJK Compatibility"](p)||Rr["CJK Strokes"](p)||!(!Rr["CJK Symbols and Punctuation"](p)||p>=12296&&p<=12305||p>=12308&&p<=12319||p===12336)||Rr["Enclosed CJK Letters and Months"](p)||Rr["Ideographic Description Characters"](p)||Rr.Kanbun(p)||Rr.Katakana(p)&&p!==12540||!(!Rr["Halfwidth and Fullwidth Forms"](p)||p===65288||p===65289||p===65293||p>=65306&&p<=65310||p===65339||p===65341||p===65343||p>=65371&&p<=65503||p===65507||p>=65512&&p<=65519)||!(!Rr["Small Form Variants"](p)||p>=65112&&p<=65118||p>=65123&&p<=65126)||Rr["Vertical Forms"](p)||Rr["Yijing Hexagram Symbols"](p)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(p))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(p))||Rb.test(String.fromCodePoint(p)))))}function Nb(p){return!(Kv(p)||function(h){return!!(Rr["Latin-1 Supplement"](h)&&(h===167||h===169||h===174||h===177||h===188||h===189||h===190||h===215||h===247)||Rr["General Punctuation"](h)&&(h===8214||h===8224||h===8225||h===8240||h===8241||h===8251||h===8252||h===8258||h===8263||h===8264||h===8265||h===8273)||Rr["Letterlike Symbols"](h)||Rr["Number Forms"](h)||Rr["Miscellaneous Technical"](h)&&(h>=8960&&h<=8967||h>=8972&&h<=8991||h>=8996&&h<=9e3||h===9003||h>=9085&&h<=9114||h>=9150&&h<=9165||h===9167||h>=9169&&h<=9179||h>=9186&&h<=9215)||Rr["Control Pictures"](h)&&h!==9251||Rr["Optical Character Recognition"](h)||Rr["Enclosed Alphanumerics"](h)||Rr["Geometric Shapes"](h)||Rr["Miscellaneous Symbols"](h)&&!(h>=9754&&h<=9759)||Rr["Miscellaneous Symbols and Arrows"](h)&&(h>=11026&&h<=11055||h>=11088&&h<=11097||h>=11192&&h<=11243)||Rr["CJK Symbols and Punctuation"](h)||Rr.Katakana(h)||Rr["Private Use Area"](h)||Rr["CJK Compatibility Forms"](h)||Rr["Small Form Variants"](h)||Rr["Halfwidth and Fullwidth Forms"](h)||h===8734||h===8756||h===8757||h>=9984&&h<=10087||h>=10102&&h<=10131||h===65532||h===65533)}(p))}const PA=Yv(["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 Jv(p){return PA.test(String.fromCodePoint(p))}function RA(p,h){return!(!h&&Jv(p)||p>=2304&&p<=3583||p>=3840&&p<=4255||Rr.Khmer(p))}function NA(p){for(const h of p)if(Jv(h.charCodeAt(0)))return!0;return!1}const pa=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(p){this.pluginStatus=p.pluginStatus,this.pluginURL=p.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(p){this.applyArabicShaping=p.applyArabicShaping,this.processBidirectionalText=p.processBidirectionalText,this.processStyledBidirectionalText=p.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class fn{constructor(h,v){this.zoom=h,v?(this.now=v.now,this.fadeDuration=v.fadeDuration,this.zoomHistory=v.zoomHistory,this.transition=v.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new jv,this.transition={})}isSupportedScript(h){return function(v,b){for(const E of v)if(!RA(E.charCodeAt(0),b))return!1;return!0}(h,pa.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const h=this.zoom,v=h-Math.floor(h),b=this.crossFadingFactor();return h>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:v+(1-v)*b}:{fromScale:.5,toScale:1,t:1-(1-b)*v}}}class Mu{constructor(h,v){this.property=h,this.value=v,this.expression=function(b,E){if(bf(b))return new Su(b,E);if(Sf(b)){const I=Pv(b,E);if(I.result==="error")throw new Error(I.value.map(k=>`${k.key}: ${k.message}`).join(", "));return I.value}{let I=b;return E.type==="color"&&typeof b=="string"?I=Kr.parse(b):E.type!=="padding"||typeof b!="number"&&!Array.isArray(b)?E.type==="variableAnchorOffsetCollection"&&Array.isArray(b)&&(I=Ma.parse(b)):I=ha.parse(b),{kind:"constant",evaluate:()=>I}}}(v===void 0?h.specification.default:v,h.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(h,v,b){return this.property.possiblyEvaluate(this,h,v,b)}}class Pf{constructor(h){this.property=h,this.value=new Mu(h,void 0)}transitioned(h,v){return new Ob(this.property,this.value,v,$({},h.transition,this.transition),h.now)}untransitioned(){return new Ob(this.property,this.value,null,{},0)}}class Rf{constructor(h){this._properties=h,this._values=Object.create(h.defaultTransitionablePropertyValues)}getValue(h){return Y(this._values[h].value.value)}setValue(h,v){Object.prototype.hasOwnProperty.call(this._values,h)||(this._values[h]=new Pf(this._values[h].property)),this._values[h].value=new Mu(this._values[h].property,v===null?void 0:Y(v))}getTransition(h){return Y(this._values[h].transition)}setTransition(h,v){Object.prototype.hasOwnProperty.call(this._values,h)||(this._values[h]=new Pf(this._values[h].property)),this._values[h].transition=Y(v)||void 0}serialize(){const h={};for(const v of Object.keys(this._values)){const b=this.getValue(v);b!==void 0&&(h[v]=b);const E=this.getTransition(v);E!==void 0&&(h[`${v}-transition`]=E)}return h}transitioned(h,v){const b=new Dh(this._properties);for(const E of Object.keys(this._values))b._values[E]=this._values[E].transitioned(h,v._values[E]);return b}untransitioned(){const h=new Dh(this._properties);for(const v of Object.keys(this._values))h._values[v]=this._values[v].untransitioned();return h}}class Ob{constructor(h,v,b,E,I){this.property=h,this.value=v,this.begin=I+E.delay||0,this.end=this.begin+E.duration||0,h.specification.transition&&(E.delay||E.duration)&&(this.prior=b)}possiblyEvaluate(h,v,b){const E=h.now||0,I=this.value.possiblyEvaluate(h,v,b),k=this.prior;if(k){if(E>this.end)return this.prior=null,I;if(this.value.isDataDriven())return this.prior=null,I;if(E=1)return 1;const U=z*z,W=U*z;return 4*(z<.5?W:3*(z-U)+W-.75)}(R))}}return I}}class Dh{constructor(h){this._properties=h,this._values=Object.create(h.defaultTransitioningPropertyValues)}possiblyEvaluate(h,v,b){const E=new Ih(this._properties);for(const I of Object.keys(this._values))E._values[I]=this._values[I].possiblyEvaluate(h,v,b);return E}hasTransition(){for(const h of Object.keys(this._values))if(this._values[h].prior)return!0;return!1}}class Mh{constructor(h){this._properties=h,this._values=Object.create(h.defaultPropertyValues)}hasValue(h){return this._values[h].value!==void 0}getValue(h){return Y(this._values[h].value)}setValue(h,v){this._values[h]=new Mu(this._values[h].property,v===null?void 0:Y(v))}serialize(){const h={};for(const v of Object.keys(this._values)){const b=this.getValue(v);b!==void 0&&(h[v]=b)}return h}possiblyEvaluate(h,v,b){const E=new Ih(this._properties);for(const I of Object.keys(this._values))E._values[I]=this._values[I].possiblyEvaluate(h,v,b);return E}}class Io{constructor(h,v,b){this.property=h,this.value=v,this.parameters=b}isConstant(){return this.value.kind==="constant"}constantOr(h){return this.value.kind==="constant"?this.value.value:h}evaluate(h,v,b,E){return this.property.evaluate(this.value,this.parameters,h,v,b,E)}}class Ih{constructor(h){this._properties=h,this._values=Object.create(h.defaultPossiblyEvaluatedValues)}get(h){return this._values[h]}}class Pt{constructor(h){this.specification=h}possiblyEvaluate(h,v){if(h.isDataDriven())throw new Error("Value should not be data driven");return h.expression.evaluate(v)}interpolate(h,v,b){const E=Fi[this.specification.type];return E?E(h,v,b):h}}class Qt{constructor(h,v){this.specification=h,this.overrides=v}possiblyEvaluate(h,v,b,E){return new Io(this,h.expression.kind==="constant"||h.expression.kind==="camera"?{kind:"constant",value:h.expression.evaluate(v,null,{},b,E)}:h.expression,v)}interpolate(h,v,b){if(h.value.kind!=="constant"||v.value.kind!=="constant")return h;if(h.value.value===void 0||v.value.value===void 0)return new Io(this,{kind:"constant",value:void 0},h.parameters);const E=Fi[this.specification.type];if(E){const I=E(h.value.value,v.value.value,b);return new Io(this,{kind:"constant",value:I},h.parameters)}return h}evaluate(h,v,b,E,I,k){return h.kind==="constant"?h.value:h.evaluate(v,b,E,I,k)}}class Nf extends Qt{possiblyEvaluate(h,v,b,E){if(h.value===void 0)return new Io(this,{kind:"constant",value:void 0},v);if(h.expression.kind==="constant"){const I=h.expression.evaluate(v,null,{},b,E),k=h.property.specification.type==="resolvedImage"&&typeof I!="string"?I.name:I,R=this._calculate(k,k,k,v);return new Io(this,{kind:"constant",value:R},v)}if(h.expression.kind==="camera"){const I=this._calculate(h.expression.evaluate({zoom:v.zoom-1}),h.expression.evaluate({zoom:v.zoom}),h.expression.evaluate({zoom:v.zoom+1}),v);return new Io(this,{kind:"constant",value:I},v)}return new Io(this,h.expression,v)}evaluate(h,v,b,E,I,k){if(h.kind==="source"){const R=h.evaluate(v,b,E,I,k);return this._calculate(R,R,R,v)}return h.kind==="composite"?this._calculate(h.evaluate({zoom:Math.floor(v.zoom)-1},b,E),h.evaluate({zoom:Math.floor(v.zoom)},b,E),h.evaluate({zoom:Math.floor(v.zoom)+1},b,E),v):h.value}_calculate(h,v,b,E){return E.zoom>E.zoomHistory.lastIntegerZoom?{from:h,to:v}:{from:b,to:v}}interpolate(h){return h}}class Of{constructor(h){this.specification=h}possiblyEvaluate(h,v,b,E){if(h.value!==void 0){if(h.expression.kind==="constant"){const I=h.expression.evaluate(v,null,{},b,E);return this._calculate(I,I,I,v)}return this._calculate(h.expression.evaluate(new fn(Math.floor(v.zoom-1),v)),h.expression.evaluate(new fn(Math.floor(v.zoom),v)),h.expression.evaluate(new fn(Math.floor(v.zoom+1),v)),v)}}_calculate(h,v,b,E){return E.zoom>E.zoomHistory.lastIntegerZoom?{from:h,to:v}:{from:b,to:v}}interpolate(h){return h}}class Qv{constructor(h){this.specification=h}possiblyEvaluate(h,v,b,E){return!!h.expression.evaluate(v,null,{},b,E)}interpolate(){return!1}}class M{constructor(h){this.properties=h,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const v in h){const b=h[v];b.specification.overridable&&this.overridableProperties.push(v);const E=this.defaultPropertyValues[v]=new Mu(b,void 0),I=this.defaultTransitionablePropertyValues[v]=new Pf(b);this.defaultTransitioningPropertyValues[v]=I.untransitioned(),this.defaultPossiblyEvaluatedValues[v]=E.possiblyEvaluate({})}}}Dt("DataDrivenProperty",Qt),Dt("DataConstantProperty",Pt),Dt("CrossFadedDataDrivenProperty",Nf),Dt("CrossFadedProperty",Of),Dt("ColorRampProperty",Qv);const c="-transition";class y extends Kt{constructor(h,v){if(super(),this.id=h.id,this.type=h.type,this._featureFilter={filter:()=>!0,needGeometry:!1},h.type!=="custom"&&(this.metadata=h.metadata,this.minzoom=h.minzoom,this.maxzoom=h.maxzoom,h.type!=="background"&&(this.source=h.source,this.sourceLayer=h["source-layer"],this.filter=h.filter),v.layout&&(this._unevaluatedLayout=new Mh(v.layout)),v.paint)){this._transitionablePaint=new Rf(v.paint);for(const b in h.paint)this.setPaintProperty(b,h.paint[b],{validate:!1});for(const b in h.layout)this.setLayoutProperty(b,h.layout[b],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new Ih(v.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(h){return h==="visibility"?this.visibility:this._unevaluatedLayout.getValue(h)}setLayoutProperty(h,v,b={}){v!=null&&this._validate(Lb,`layers.${this.id}.layout.${h}`,h,v,b)||(h!=="visibility"?this._unevaluatedLayout.setValue(h,v):this.visibility=v)}getPaintProperty(h){return h.endsWith(c)?this._transitionablePaint.getTransition(h.slice(0,-11)):this._transitionablePaint.getValue(h)}setPaintProperty(h,v,b={}){if(v!=null&&this._validate(kb,`layers.${this.id}.paint.${h}`,h,v,b))return!1;if(h.endsWith(c))return this._transitionablePaint.setTransition(h.slice(0,-11),v||void 0),!1;{const E=this._transitionablePaint._values[h],I=E.property.specification["property-type"]==="cross-faded-data-driven",k=E.value.isDataDriven(),R=E.value;this._transitionablePaint.setValue(h,v),this._handleSpecialPaintPropertyUpdate(h);const z=this._transitionablePaint._values[h].value;return z.isDataDriven()||k||I||this._handleOverridablePaintPropertyUpdate(h,R,z)}}_handleSpecialPaintPropertyUpdate(h){}_handleOverridablePaintPropertyUpdate(h,v,b){return!1}isHidden(h){return!!(this.minzoom&&h=this.maxzoom)||this.visibility==="none"}updateTransitions(h){this._transitioningPaint=this._transitionablePaint.transitioned(h,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(h,v){h.getCrossfadeParameters&&(this._crossfadeParameters=h.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(h,void 0,v)),this.paint=this._transitioningPaint.possiblyEvaluate(h,void 0,v)}serialize(){const h={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&&(h.layout=h.layout||{},h.layout.visibility=this.visibility),j(h,(v,b)=>!(v===void 0||b==="layout"&&!Object.keys(v).length||b==="paint"&&!Object.keys(v).length))}_validate(h,v,b,E,I={}){return(!I||I.validate!==!1)&&qv(this,h.call(ml,{key:v,layerType:this.type,objectKey:b,value:E,styleSpec:Le,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const h in this.paint._values){const v=this.paint.get(h);if(v instanceof Io&&yu(v.property.specification)&&(v.value.kind==="source"||v.value.kind==="composite")&&v.value.isStateDependent)return!0}return!1}}const S={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class T{constructor(h,v){this._structArray=h,this._pos1=v*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class D{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(h,v){return h._trim(),v&&(h.isTransferred=!0,v.push(h.arrayBuffer)),{length:h.length,arrayBuffer:h.arrayBuffer}}static deserialize(h){const v=Object.create(this.prototype);return v.arrayBuffer=h.arrayBuffer,v.length=h.length,v.capacity=h.arrayBuffer.byteLength/v.bytesPerElement,v._refreshViews(),v}_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(h){this.reserve(h),this.length=h}reserve(h){if(h>this.capacity){this.capacity=Math.max(h,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const v=this.uint8;this._refreshViews(),v&&this.uint8.set(v)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function N(p,h=1){let v=0,b=0;return{members:p.map(E=>{const I=S[E.type].BYTES_PER_ELEMENT,k=v=B(v,Math.max(h,I)),R=E.components||1;return b=Math.max(b,I),v+=I*R,{name:E.name,type:E.type,components:R,offset:k}}),size:B(v,Math.max(b,h)),alignment:h}}function B(p,h){return Math.ceil(p/h)*h}class G extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v){const b=this.length;return this.resize(b+1),this.emplace(b,h,v)}emplace(h,v,b){const E=2*h;return this.int16[E+0]=v,this.int16[E+1]=b,h}}G.prototype.bytesPerElement=4,Dt("StructArrayLayout2i4",G);class q extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,h,v,b)}emplace(h,v,b,E){const I=3*h;return this.int16[I+0]=v,this.int16[I+1]=b,this.int16[I+2]=E,h}}q.prototype.bytesPerElement=6,Dt("StructArrayLayout3i6",q);class K extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E){const I=this.length;return this.resize(I+1),this.emplace(I,h,v,b,E)}emplace(h,v,b,E,I){const k=4*h;return this.int16[k+0]=v,this.int16[k+1]=b,this.int16[k+2]=E,this.int16[k+3]=I,h}}K.prototype.bytesPerElement=8,Dt("StructArrayLayout4i8",K);class J extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k){const R=this.length;return this.resize(R+1),this.emplace(R,h,v,b,E,I,k)}emplace(h,v,b,E,I,k,R){const z=6*h;return this.int16[z+0]=v,this.int16[z+1]=b,this.int16[z+2]=E,this.int16[z+3]=I,this.int16[z+4]=k,this.int16[z+5]=R,h}}J.prototype.bytesPerElement=12,Dt("StructArrayLayout2i4i12",J);class ie extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k){const R=this.length;return this.resize(R+1),this.emplace(R,h,v,b,E,I,k)}emplace(h,v,b,E,I,k,R){const z=4*h,U=8*h;return this.int16[z+0]=v,this.int16[z+1]=b,this.uint8[U+4]=E,this.uint8[U+5]=I,this.uint8[U+6]=k,this.uint8[U+7]=R,h}}ie.prototype.bytesPerElement=8,Dt("StructArrayLayout2i4ub8",ie);class de extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(h,v){const b=this.length;return this.resize(b+1),this.emplace(b,h,v)}emplace(h,v,b){const E=2*h;return this.float32[E+0]=v,this.float32[E+1]=b,h}}de.prototype.bytesPerElement=8,Dt("StructArrayLayout2f8",de);class pe extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k,R,z,U,W){const X=this.length;return this.resize(X+1),this.emplace(X,h,v,b,E,I,k,R,z,U,W)}emplace(h,v,b,E,I,k,R,z,U,W,X){const ee=10*h;return this.uint16[ee+0]=v,this.uint16[ee+1]=b,this.uint16[ee+2]=E,this.uint16[ee+3]=I,this.uint16[ee+4]=k,this.uint16[ee+5]=R,this.uint16[ee+6]=z,this.uint16[ee+7]=U,this.uint16[ee+8]=W,this.uint16[ee+9]=X,h}}pe.prototype.bytesPerElement=20,Dt("StructArrayLayout10ui20",pe);class _e extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k,R,z,U,W,X,ee){const ne=this.length;return this.resize(ne+1),this.emplace(ne,h,v,b,E,I,k,R,z,U,W,X,ee)}emplace(h,v,b,E,I,k,R,z,U,W,X,ee,ne){const oe=12*h;return this.int16[oe+0]=v,this.int16[oe+1]=b,this.int16[oe+2]=E,this.int16[oe+3]=I,this.uint16[oe+4]=k,this.uint16[oe+5]=R,this.uint16[oe+6]=z,this.uint16[oe+7]=U,this.int16[oe+8]=W,this.int16[oe+9]=X,this.int16[oe+10]=ee,this.int16[oe+11]=ne,h}}_e.prototype.bytesPerElement=24,Dt("StructArrayLayout4i4ui4i24",_e);class Se extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(h,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,h,v,b)}emplace(h,v,b,E){const I=3*h;return this.float32[I+0]=v,this.float32[I+1]=b,this.float32[I+2]=E,h}}Se.prototype.bytesPerElement=12,Dt("StructArrayLayout3f12",Se);class Te extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(h){const v=this.length;return this.resize(v+1),this.emplace(v,h)}emplace(h,v){return this.uint32[1*h+0]=v,h}}Te.prototype.bytesPerElement=4,Dt("StructArrayLayout1ul4",Te);class Ce extends D{_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(h,v,b,E,I,k,R,z,U){const W=this.length;return this.resize(W+1),this.emplace(W,h,v,b,E,I,k,R,z,U)}emplace(h,v,b,E,I,k,R,z,U,W){const X=10*h,ee=5*h;return this.int16[X+0]=v,this.int16[X+1]=b,this.int16[X+2]=E,this.int16[X+3]=I,this.int16[X+4]=k,this.int16[X+5]=R,this.uint32[ee+3]=z,this.uint16[X+8]=U,this.uint16[X+9]=W,h}}Ce.prototype.bytesPerElement=20,Dt("StructArrayLayout6i1ul2ui20",Ce);class ve extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k){const R=this.length;return this.resize(R+1),this.emplace(R,h,v,b,E,I,k)}emplace(h,v,b,E,I,k,R){const z=6*h;return this.int16[z+0]=v,this.int16[z+1]=b,this.int16[z+2]=E,this.int16[z+3]=I,this.int16[z+4]=k,this.int16[z+5]=R,h}}ve.prototype.bytesPerElement=12,Dt("StructArrayLayout2i2i2i12",ve);class Ie extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I){const k=this.length;return this.resize(k+1),this.emplace(k,h,v,b,E,I)}emplace(h,v,b,E,I,k){const R=4*h,z=8*h;return this.float32[R+0]=v,this.float32[R+1]=b,this.float32[R+2]=E,this.int16[z+6]=I,this.int16[z+7]=k,h}}Ie.prototype.bytesPerElement=16,Dt("StructArrayLayout2f1f2i16",Ie);class Pe extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(h,v,b,E,I,k){const R=this.length;return this.resize(R+1),this.emplace(R,h,v,b,E,I,k)}emplace(h,v,b,E,I,k,R){const z=16*h,U=4*h,W=8*h;return this.uint8[z+0]=v,this.uint8[z+1]=b,this.float32[U+1]=E,this.float32[U+2]=I,this.int16[W+6]=k,this.int16[W+7]=R,h}}Pe.prototype.bytesPerElement=16,Dt("StructArrayLayout2ub2f2i16",Pe);class Be extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,h,v,b)}emplace(h,v,b,E){const I=3*h;return this.uint16[I+0]=v,this.uint16[I+1]=b,this.uint16[I+2]=E,h}}Be.prototype.bytesPerElement=6,Dt("StructArrayLayout3ui6",Be);class Ke extends D{_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(h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we){const Oe=this.length;return this.resize(Oe+1),this.emplace(Oe,h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we)}emplace(h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we,Oe){const Ae=24*h,Re=12*h,Ue=48*h;return this.int16[Ae+0]=v,this.int16[Ae+1]=b,this.uint16[Ae+2]=E,this.uint16[Ae+3]=I,this.uint32[Re+2]=k,this.uint32[Re+3]=R,this.uint32[Re+4]=z,this.uint16[Ae+10]=U,this.uint16[Ae+11]=W,this.uint16[Ae+12]=X,this.float32[Re+7]=ee,this.float32[Re+8]=ne,this.uint8[Ue+36]=oe,this.uint8[Ue+37]=ce,this.uint8[Ue+38]=me,this.uint32[Re+10]=we,this.int16[Ae+22]=Oe,h}}Ke.prototype.bytesPerElement=48,Dt("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ke);class at extends D{_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(h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we,Oe,Ae,Re,Ue,tt,St,Jt,xt,_t,Vt,Mt){const At=this.length;return this.resize(At+1),this.emplace(At,h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we,Oe,Ae,Re,Ue,tt,St,Jt,xt,_t,Vt,Mt)}emplace(h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe,ce,me,we,Oe,Ae,Re,Ue,tt,St,Jt,xt,_t,Vt,Mt,At){const Ye=32*h,Gt=16*h;return this.int16[Ye+0]=v,this.int16[Ye+1]=b,this.int16[Ye+2]=E,this.int16[Ye+3]=I,this.int16[Ye+4]=k,this.int16[Ye+5]=R,this.int16[Ye+6]=z,this.int16[Ye+7]=U,this.uint16[Ye+8]=W,this.uint16[Ye+9]=X,this.uint16[Ye+10]=ee,this.uint16[Ye+11]=ne,this.uint16[Ye+12]=oe,this.uint16[Ye+13]=ce,this.uint16[Ye+14]=me,this.uint16[Ye+15]=we,this.uint16[Ye+16]=Oe,this.uint16[Ye+17]=Ae,this.uint16[Ye+18]=Re,this.uint16[Ye+19]=Ue,this.uint16[Ye+20]=tt,this.uint16[Ye+21]=St,this.uint16[Ye+22]=Jt,this.uint32[Gt+12]=xt,this.float32[Gt+13]=_t,this.float32[Gt+14]=Vt,this.uint16[Ye+30]=Mt,this.uint16[Ye+31]=At,h}}at.prototype.bytesPerElement=64,Dt("StructArrayLayout8i15ui1ul2f2ui64",at);class bt extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(h){const v=this.length;return this.resize(v+1),this.emplace(v,h)}emplace(h,v){return this.float32[1*h+0]=v,h}}bt.prototype.bytesPerElement=4,Dt("StructArrayLayout1f4",bt);class Et extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(h,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,h,v,b)}emplace(h,v,b,E){const I=3*h;return this.uint16[6*h+0]=v,this.float32[I+1]=b,this.float32[I+2]=E,h}}Et.prototype.bytesPerElement=12,Dt("StructArrayLayout1ui2f12",Et);class ft extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h,v,b){const E=this.length;return this.resize(E+1),this.emplace(E,h,v,b)}emplace(h,v,b,E){const I=4*h;return this.uint32[2*h+0]=v,this.uint16[I+2]=b,this.uint16[I+3]=E,h}}ft.prototype.bytesPerElement=8,Dt("StructArrayLayout1ul2ui8",ft);class dt extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h,v){const b=this.length;return this.resize(b+1),this.emplace(b,h,v)}emplace(h,v,b){const E=2*h;return this.uint16[E+0]=v,this.uint16[E+1]=b,h}}dt.prototype.bytesPerElement=4,Dt("StructArrayLayout2ui4",dt);class Rt extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(h){const v=this.length;return this.resize(v+1),this.emplace(v,h)}emplace(h,v){return this.uint16[1*h+0]=v,h}}Rt.prototype.bytesPerElement=2,Dt("StructArrayLayout1ui2",Rt);class ur extends D{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(h,v,b,E){const I=this.length;return this.resize(I+1),this.emplace(I,h,v,b,E)}emplace(h,v,b,E,I){const k=4*h;return this.float32[k+0]=v,this.float32[k+1]=b,this.float32[k+2]=E,this.float32[k+3]=I,h}}ur.prototype.bytesPerElement=16,Dt("StructArrayLayout4f16",ur);class yt extends T{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 f(this.anchorPointX,this.anchorPointY)}}yt.prototype.size=20;class wt extends Ce{get(h){return new yt(this,h)}}Dt("CollisionBoxArray",wt);class ar extends T{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(h){this._structArray.uint8[this._pos1+37]=h}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(h){this._structArray.uint8[this._pos1+38]=h}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(h){this._structArray.uint32[this._pos4+10]=h}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}ar.prototype.size=48;class pn extends Ke{get(h){return new ar(this,h)}}Dt("PlacedSymbolArray",pn);class xr extends T{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(h){this._structArray.uint32[this._pos4+12]=h}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]}}xr.prototype.size=64;class kr extends at{get(h){return new xr(this,h)}}Dt("SymbolInstanceArray",kr);class gn extends bt{getoffsetX(h){return this.float32[1*h+0]}}Dt("GlyphOffsetArray",gn);class vi extends q{getx(h){return this.int16[3*h+0]}gety(h){return this.int16[3*h+1]}gettileUnitDistanceFromAnchor(h){return this.int16[3*h+2]}}Dt("SymbolLineVertexArray",vi);class Ya extends T{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]}}Ya.prototype.size=12;class vn extends Et{get(h){return new Ya(this,h)}}Dt("TextAnchorOffsetArray",vn);class Gi extends T{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]}}Gi.prototype.size=8;class Mi extends ft{get(h){return new Gi(this,h)}}Dt("FeatureIndexArray",Mi);class mi extends G{}class Ii extends G{}class ko extends G{}class Iu extends J{}class zf extends ie{}class ku extends de{}class Pa extends pe{}class Bf extends _e{}class em extends Se{}class Ra extends Te{}class Na extends ve{}class Ms extends Pe{}class Ka extends Be{}class ui extends dt{}const yi=N([{name:"a_pos",components:2,type:"Int16"}],4),{members:ga}=yi;class Nr{constructor(h=[]){this.segments=h}prepareSegment(h,v,b,E){let I=this.segments[this.segments.length-1];return h>Nr.MAX_VERTEX_ARRAY_LENGTH&&ae(`Max vertices per segment is ${Nr.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${h}`),(!I||I.vertexLength+h>Nr.MAX_VERTEX_ARRAY_LENGTH||I.sortKey!==E)&&(I={vertexOffset:v.length,primitiveOffset:b.length,vertexLength:0,primitiveLength:0},E!==void 0&&(I.sortKey=E),this.segments.push(I)),I}get(){return this.segments}destroy(){for(const h of this.segments)for(const v in h.vaos)h.vaos[v].destroy()}static simpleSegment(h,v,b,E){return new Nr([{vertexOffset:h,primitiveOffset:v,vertexLength:b,primitiveLength:E,vaos:{},sortKey:0}])}}function yl(p,h){return 256*(p=V(Math.floor(p),0,255))+V(Math.floor(h),0,255)}Nr.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Dt("SegmentVector",Nr);const Lu=N([{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"}]);var Pu={exports:{}},zb={exports:{}};zb.exports=function(p,h){var v,b,E,I,k,R,z,U;for(b=p.length-(v=3&p.length),E=h,k=3432918353,R=461845907,U=0;U>>16)*k&65535)<<16)&4294967295)<<15|z>>>17))*R+(((z>>>16)*R&65535)<<16)&4294967295)<<13|E>>>19))+((5*(E>>>16)&65535)<<16)&4294967295))+((58964+(I>>>16)&65535)<<16);switch(z=0,v){case 3:z^=(255&p.charCodeAt(U+2))<<16;case 2:z^=(255&p.charCodeAt(U+1))<<8;case 1:E^=z=(65535&(z=(z=(65535&(z^=255&p.charCodeAt(U)))*k+(((z>>>16)*k&65535)<<16)&4294967295)<<15|z>>>17))*R+(((z>>>16)*R&65535)<<16)&4294967295}return E^=p.length,E=2246822507*(65535&(E^=E>>>16))+((2246822507*(E>>>16)&65535)<<16)&4294967295,E=3266489909*(65535&(E^=E>>>13))+((3266489909*(E>>>16)&65535)<<16)&4294967295,(E^=E>>>16)>>>0};var OA=zb.exports,Bb={exports:{}};Bb.exports=function(p,h){for(var v,b=p.length,E=h^b,I=0;b>=4;)v=1540483477*(65535&(v=255&p.charCodeAt(I)|(255&p.charCodeAt(++I))<<8|(255&p.charCodeAt(++I))<<16|(255&p.charCodeAt(++I))<<24))+((1540483477*(v>>>16)&65535)<<16),E=1540483477*(65535&E)+((1540483477*(E>>>16)&65535)<<16)^(v=1540483477*(65535&(v^=v>>>24))+((1540483477*(v>>>16)&65535)<<16)),b-=4,++I;switch(b){case 3:E^=(255&p.charCodeAt(I+2))<<16;case 2:E^=(255&p.charCodeAt(I+1))<<8;case 1:E=1540483477*(65535&(E^=255&p.charCodeAt(I)))+((1540483477*(E>>>16)&65535)<<16)}return E=1540483477*(65535&(E^=E>>>13))+((1540483477*(E>>>16)&65535)<<16),(E^=E>>>15)>>>0};var Is=OA,Vb=Bb.exports;Pu.exports=Is,Pu.exports.murmur3=Is,Pu.exports.murmur2=Vb;var Vf=l(Pu.exports);class kh{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(h,v,b,E){this.ids.push(Ff(h)),this.positions.push(v,b,E)}getPositions(h){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const v=Ff(h);let b=0,E=this.ids.length-1;for(;b>1;this.ids[k]>=v?E=k:b=k+1}const I=[];for(;this.ids[b]===v;)I.push({index:this.positions[3*b],start:this.positions[3*b+1],end:this.positions[3*b+2]}),b++;return I}static serialize(h,v){const b=new Float64Array(h.ids),E=new Uint32Array(h.positions);return $f(b,E,0,b.length-1),v&&v.push(b.buffer,E.buffer),{ids:b,positions:E}}static deserialize(h){const v=new kh;return v.ids=h.ids,v.positions=h.positions,v.indexed=!0,v}}function Ff(p){const h=+p;return!isNaN(h)&&h<=Number.MAX_SAFE_INTEGER?h:Vf(String(p))}function $f(p,h,v,b){for(;v>1];let I=v-1,k=b+1;for(;;){do I++;while(p[I]E);if(I>=k)break;Ru(p,I,k),Ru(h,3*I,3*k),Ru(h,3*I+1,3*k+1),Ru(h,3*I+2,3*k+2)}k-v`u_${E}`),this.type=b}setUniform(h,v,b){h.set(b.constantOr(this.value))}getBinding(h,v,b){return this.type==="color"?new X$(h,v):new Fb(h,v)}}class Gf{constructor(h,v){this.uniformNames=v.map(b=>`u_${b}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(h,v){this.pixelRatioFrom=v.pixelRatio,this.pixelRatioTo=h.pixelRatio,this.patternFrom=v.tlbr,this.patternTo=h.tlbr}setUniform(h,v,b,E){const I=E==="u_pattern_to"?this.patternTo:E==="u_pattern_from"?this.patternFrom:E==="u_pixel_ratio_to"?this.pixelRatioTo:E==="u_pixel_ratio_from"?this.pixelRatioFrom:null;I&&h.set(I)}getBinding(h,v,b){return b.substr(0,9)==="u_pattern"?new j$(h,v):new Fb(h,v)}}class _l{constructor(h,v,b,E){this.expression=h,this.type=b,this.maxValue=0,this.paintVertexAttributes=v.map(I=>({name:`a_${I}`,type:"Float32",components:b==="color"?2:1,offset:0})),this.paintVertexArray=new E}populatePaintArray(h,v,b,E,I){const k=this.paintVertexArray.length,R=this.expression.evaluate(new fn(0),v,{},E,[],I);this.paintVertexArray.resize(h),this._setPaintValue(k,h,R)}updatePaintArray(h,v,b,E){const I=this.expression.evaluate({zoom:0},b,E);this._setPaintValue(h,v,I)}_setPaintValue(h,v,b){if(this.type==="color"){const E=zA(b);for(let I=h;I`u_${R}_t`),this.type=b,this.useIntegerZoom=E,this.zoom=I,this.maxValue=0,this.paintVertexAttributes=v.map(R=>({name:`a_${R}`,type:"Float32",components:b==="color"?4:2,offset:0})),this.paintVertexArray=new k}populatePaintArray(h,v,b,E,I){const k=this.expression.evaluate(new fn(this.zoom),v,{},E,[],I),R=this.expression.evaluate(new fn(this.zoom+1),v,{},E,[],I),z=this.paintVertexArray.length;this.paintVertexArray.resize(h),this._setPaintValue(z,h,k,R)}updatePaintArray(h,v,b,E){const I=this.expression.evaluate({zoom:this.zoom},b,E),k=this.expression.evaluate({zoom:this.zoom+1},b,E);this._setPaintValue(h,v,I,k)}_setPaintValue(h,v,b,E){if(this.type==="color"){const I=zA(b),k=zA(E);for(let R=h;R`#define HAS_UNIFORM_${E}`))}return h}getBinderAttributes(){const h=[];for(const v in this.binders){const b=this.binders[v];if(b instanceof _l||b instanceof Qo)for(let E=0;E!0){this.programConfigurations={};for(const E of h)this.programConfigurations[E.id]=new Y$(E,v,b);this.needsUpload=!1,this._featureMap=new kh,this._bufferOffset=0}populatePaintArrays(h,v,b,E,I,k){for(const R in this.programConfigurations)this.programConfigurations[R].populatePaintArrays(h,v,E,I,k);v.id!==void 0&&this._featureMap.add(v.id,b,this._bufferOffset,h),this._bufferOffset=h,this.needsUpload=!0}updatePaintArrays(h,v,b,E){for(const I of b)this.needsUpload=this.programConfigurations[I.id].updatePaintArrays(h,this._featureMap,v,I,E)||this.needsUpload}get(h){return this.programConfigurations[h]}upload(h){if(this.needsUpload){for(const v in this.programConfigurations)this.programConfigurations[v].upload(h);this.needsUpload=!1}}destroy(){for(const h in this.programConfigurations)this.programConfigurations[h].destroy()}}function lye(p,h){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-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"]}[p]||[p.replace(`${h}-`,"").replace(/-/g,"_")]}function K$(p,h,v){const b={color:{source:de,composite:ur},number:{source:bt,composite:de}},E=function(I){return{"line-pattern":{source:Pa,composite:Pa},"fill-pattern":{source:Pa,composite:Pa},"fill-extrusion-pattern":{source:Pa,composite:Pa}}[I]}(p);return E&&E[v]||b[h][v]}Dt("ConstantBinder",tm),Dt("CrossFadedConstantBinder",Gf),Dt("SourceExpressionBinder",_l),Dt("CrossFadedCompositeBinder",Nu),Dt("CompositeExpressionBinder",Qo),Dt("ProgramConfiguration",Y$,{omit:["_buffers"]}),Dt("ProgramConfigurationSet",Ph);const Fn=8192,BA=Math.pow(2,14)-1,J$=-BA-1;function Rh(p){const h=Fn/p.extent,v=p.loadGeometry();for(let b=0;bk.x+1||zk.y+1)&&ae("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return v}function Nh(p,h){return{type:p.type,id:p.id,properties:p.properties,geometry:h?Rh(p):[]}}function $b(p,h,v,b,E){p.emplaceBack(2*h+(b+1)/2,2*v+(E+1)/2)}class VA{constructor(h){this.zoom=h.zoom,this.overscaling=h.overscaling,this.layers=h.layers,this.layerIds=this.layers.map(v=>v.id),this.index=h.index,this.hasPattern=!1,this.layoutVertexArray=new Ii,this.indexArray=new Ka,this.segments=new Nr,this.programConfigurations=new Ph(h.layers,h.zoom),this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(h,v,b){const E=this.layers[0],I=[];let k=null,R=!1;E.type==="circle"&&(k=E.layout.get("circle-sort-key"),R=!k.isConstant());for(const{feature:z,id:U,index:W,sourceLayerIndex:X}of h){const ee=this.layers[0]._featureFilter.needGeometry,ne=Nh(z,ee);if(!this.layers[0]._featureFilter.filter(new fn(this.zoom),ne,b))continue;const oe=R?k.evaluate(ne,{},b):void 0,ce={id:U,properties:z.properties,type:z.type,sourceLayerIndex:X,index:W,geometry:ee?ne.geometry:Rh(z),patterns:{},sortKey:oe};I.push(ce)}R&&I.sort((z,U)=>z.sortKey-U.sortKey);for(const z of I){const{geometry:U,index:W,sourceLayerIndex:X}=z,ee=h[W].feature;this.addFeature(z,U,W,b),v.featureIndex.insert(ee,U,W,X,this.index)}}update(h,v,b){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(h,v,this.stateDependentLayers,b)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(h){this.uploaded||(this.layoutVertexBuffer=h.createVertexBuffer(this.layoutVertexArray,ga),this.indexBuffer=h.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(h),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(h,v,b,E){for(const I of v)for(const k of I){const R=k.x,z=k.y;if(R<0||R>=Fn||z<0||z>=Fn)continue;const U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,h.sortKey),W=U.vertexLength;$b(this.layoutVertexArray,R,z,-1,-1),$b(this.layoutVertexArray,R,z,1,-1),$b(this.layoutVertexArray,R,z,1,1),$b(this.layoutVertexArray,R,z,-1,1),this.indexArray.emplaceBack(W,W+1,W+2),this.indexArray.emplaceBack(W,W+3,W+2),U.vertexLength+=4,U.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,h,b,{},E)}}function Q$(p,h){for(let v=0;v1){if(FA(p,h))return!0;for(let b=0;b1?v:v.sub(h)._mult(E)._add(h))}function r6(p,h){let v,b,E,I=!1;for(let k=0;kh.y!=E.y>h.y&&h.x<(E.x-b.x)*(h.y-b.y)/(E.y-b.y)+b.x&&(I=!I)}return I}function Uf(p,h){let v=!1;for(let b=0,E=p.length-1;bh.y!=k.y>h.y&&h.x<(k.x-I.x)*(h.y-I.y)/(k.y-I.y)+I.x&&(v=!v)}return v}function dye(p,h,v){const b=v[0],E=v[2];if(p.xE.x&&h.x>E.x||p.yE.y&&h.y>E.y)return!1;const I=ue(p,h,v[0]);return I!==ue(p,h,v[1])||I!==ue(p,h,v[2])||I!==ue(p,h,v[3])}function rm(p,h,v){const b=h.paint.get(p).value;return b.kind==="constant"?b.value:v.programConfigurations.get(h.id).getMaxValue(p)}function Gb(p){return Math.sqrt(p[0]*p[0]+p[1]*p[1])}function Ub(p,h,v,b,E){if(!h[0]&&!h[1])return p;const I=f.convert(h)._mult(E);v==="viewport"&&I._rotate(-b);const k=[];for(let R=0;Ro6(me,ce))}(U,z),ne=X?W*R:W;for(const oe of E)for(const ce of oe){const me=X?ce:o6(ce,z);let we=ne;const Oe=Hb([],[ce.x,ce.y,0,1],z);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?we*=Oe[3]/k.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(we*=k.cameraToCenterDistance/Oe[3]),uye(ee,me,we))return!0}return!1}}function o6(p,h){const v=Hb([],[p.x,p.y,0,1],h);return new f(v[0]/v[3],v[1]/v[3])}class s6 extends VA{}let l6;Dt("HeatmapBucket",s6,{omit:["layers"]});var vye={get paint(){return l6=l6||new M({"heatmap-radius":new Qt(Le.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Qt(Le.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new Pt(Le.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Qv(Le.paint_heatmap["heatmap-color"]),"heatmap-opacity":new Pt(Le.paint_heatmap["heatmap-opacity"])})}};function UA(p,{width:h,height:v},b,E){if(E){if(E instanceof Uint8ClampedArray)E=new Uint8Array(E.buffer);else if(E.length!==h*v*b)throw new RangeError(`mismatched image size. expected: ${E.length} but got: ${h*v*b}`)}else E=new Uint8Array(h*v*b);return p.width=h,p.height=v,p.data=E,p}function u6(p,{width:h,height:v},b){if(h===p.width&&v===p.height)return;const E=UA({},{width:h,height:v},b);HA(p,E,{x:0,y:0},{x:0,y:0},{width:Math.min(p.width,h),height:Math.min(p.height,v)},b),p.width=h,p.height=v,p.data=E.data}function HA(p,h,v,b,E,I){if(E.width===0||E.height===0)return h;if(E.width>p.width||E.height>p.height||v.x>p.width-E.width||v.y>p.height-E.height)throw new RangeError("out of range source coordinates for image copy");if(E.width>h.width||E.height>h.height||b.x>h.width-E.width||b.y>h.height-E.height)throw new RangeError("out of range destination coordinates for image copy");const k=p.data,R=h.data;if(k===R)throw new Error("srcData equals dstData, so image is already copied");for(let z=0;z{h[p.evaluationKey]=z;const U=p.expression.evaluate(h);E.data[k+R+0]=Math.floor(255*U.r/U.a),E.data[k+R+1]=Math.floor(255*U.g/U.a),E.data[k+R+2]=Math.floor(255*U.b/U.a),E.data[k+R+3]=Math.floor(255*U.a)};if(p.clips)for(let k=0,R=0;k80*v){R=1/0,z=1/0;let W=-1/0,X=-1/0;for(let ee=v;eeW&&(W=ne),oe>X&&(X=oe)}U=Math.max(W-R,X-z),U=U!==0?32767/U:0}return am(I,k,v,R,z,U,0),k}function f6(p,h,v,b,E){let I;if(E===function(k,R,z,U){let W=0;for(let X=R,ee=z-U;X0)for(let k=h;k=h;k-=b)I=v6(k/b|0,p[k],p[k+1],I);return I&&Wb(I,I.next)&&(sm(I),I=I.next),I}function Oh(p,h){if(!p)return p;h||(h=p);let v,b=p;do if(v=!1,b.steiner||!Wb(b,b.next)&&Nn(b.prev,b,b.next)!==0)b=b.next;else{if(sm(b),b=h=b.prev,b===b.next)break;v=!0}while(v||b!==h);return h}function am(p,h,v,b,E,I,k){if(!p)return;!k&&I&&function(z,U,W,X){let ee=z;do ee.z===0&&(ee.z=qA(ee.x,ee.y,U,W,X)),ee.prevZ=ee.prev,ee.nextZ=ee.next,ee=ee.next;while(ee!==z);ee.prevZ.nextZ=null,ee.prevZ=null,function(ne){let oe,ce=1;do{let me,we=ne;ne=null;let Oe=null;for(oe=0;we;){oe++;let Ae=we,Re=0;for(let tt=0;tt0||Ue>0&&Ae;)Re!==0&&(Ue===0||!Ae||we.z<=Ae.z)?(me=we,we=we.nextZ,Re--):(me=Ae,Ae=Ae.nextZ,Ue--),Oe?Oe.nextZ=me:ne=me,me.prevZ=Oe,Oe=me;we=Ae}Oe.nextZ=null,ce*=2}while(oe>1)}(ee)}(p,b,E,I);let R=p;for(;p.prev!==p.next;){const z=p.prev,U=p.next;if(I?Sye(p,b,E,I):wye(p))h.push(z.i,p.i,U.i),sm(p),p=U.next,R=U.next;else if((p=U)===R){k?k===1?am(p=Tye(Oh(p),h),h,v,b,E,I,2):k===2&&Eye(p,h,v,b,E,I):am(Oh(p),h,v,b,E,I,1);break}}}function wye(p){const h=p.prev,v=p,b=p.next;if(Nn(h,v,b)>=0)return!1;const E=h.x,I=v.x,k=b.x,R=h.y,z=v.y,U=b.y,W=EI?E>k?E:k:I>k?I:k,ne=R>z?R>U?R:U:z>U?z:U;let oe=b.next;for(;oe!==h;){if(oe.x>=W&&oe.x<=ee&&oe.y>=X&&oe.y<=ne&&Wf(E,R,I,z,k,U,oe.x,oe.y)&&Nn(oe.prev,oe,oe.next)>=0)return!1;oe=oe.next}return!0}function Sye(p,h,v,b){const E=p.prev,I=p,k=p.next;if(Nn(E,I,k)>=0)return!1;const R=E.x,z=I.x,U=k.x,W=E.y,X=I.y,ee=k.y,ne=Rz?R>U?R:U:z>U?z:U,me=W>X?W>ee?W:ee:X>ee?X:ee,we=qA(ne,oe,h,v,b),Oe=qA(ce,me,h,v,b);let Ae=p.prevZ,Re=p.nextZ;for(;Ae&&Ae.z>=we&&Re&&Re.z<=Oe;){if(Ae.x>=ne&&Ae.x<=ce&&Ae.y>=oe&&Ae.y<=me&&Ae!==E&&Ae!==k&&Wf(R,W,z,X,U,ee,Ae.x,Ae.y)&&Nn(Ae.prev,Ae,Ae.next)>=0||(Ae=Ae.prevZ,Re.x>=ne&&Re.x<=ce&&Re.y>=oe&&Re.y<=me&&Re!==E&&Re!==k&&Wf(R,W,z,X,U,ee,Re.x,Re.y)&&Nn(Re.prev,Re,Re.next)>=0))return!1;Re=Re.nextZ}for(;Ae&&Ae.z>=we;){if(Ae.x>=ne&&Ae.x<=ce&&Ae.y>=oe&&Ae.y<=me&&Ae!==E&&Ae!==k&&Wf(R,W,z,X,U,ee,Ae.x,Ae.y)&&Nn(Ae.prev,Ae,Ae.next)>=0)return!1;Ae=Ae.prevZ}for(;Re&&Re.z<=Oe;){if(Re.x>=ne&&Re.x<=ce&&Re.y>=oe&&Re.y<=me&&Re!==E&&Re!==k&&Wf(R,W,z,X,U,ee,Re.x,Re.y)&&Nn(Re.prev,Re,Re.next)>=0)return!1;Re=Re.nextZ}return!0}function Tye(p,h){let v=p;do{const b=v.prev,E=v.next.next;!Wb(b,E)&&p6(b,v,v.next,E)&&om(b,E)&&om(E,b)&&(h.push(b.i,v.i,E.i),sm(v),sm(v.next),v=p=E),v=v.next}while(v!==p);return Oh(v)}function Eye(p,h,v,b,E,I){let k=p;do{let R=k.next.next;for(;R!==k.prev;){if(k.i!==R.i&&Iye(k,R)){let z=g6(k,R);return k=Oh(k,k.next),z=Oh(z,z.next),am(k,h,v,b,E,I,0),void am(z,h,v,b,E,I,0)}R=R.next}k=k.next}while(k!==p)}function Cye(p,h){return p.x-h.x}function Aye(p,h){const v=function(E,I){let k=I;const R=E.x,z=E.y;let U,W=-1/0;do{if(z<=k.y&&z>=k.next.y&&k.next.y!==k.y){const ce=k.x+(z-k.y)*(k.next.x-k.x)/(k.next.y-k.y);if(ce<=R&&ce>W&&(W=ce,U=k.x=k.x&&k.x>=ee&&R!==k.x&&Wf(zU.x||k.x===U.x&&Dye(U,k)))&&(U=k,oe=ce)}k=k.next}while(k!==X);return U}(p,h);if(!v)return h;const b=g6(v,p);return Oh(b,b.next),Oh(v,v.next)}function Dye(p,h){return Nn(p.prev,p,h.prev)<0&&Nn(h.next,p,p.next)<0}function qA(p,h,v,b,E){return(p=1431655765&((p=858993459&((p=252645135&((p=16711935&((p=(p-v)*E|0)|p<<8))|p<<4))|p<<2))|p<<1))|(h=1431655765&((h=858993459&((h=252645135&((h=16711935&((h=(h-b)*E|0)|h<<8))|h<<4))|h<<2))|h<<1))<<1}function Mye(p){let h=p,v=p;do(h.x=(p-k)*(I-R)&&(p-k)*(b-R)>=(v-k)*(h-R)&&(v-k)*(I-R)>=(E-k)*(b-R)}function Iye(p,h){return p.next.i!==h.i&&p.prev.i!==h.i&&!function(v,b){let E=v;do{if(E.i!==v.i&&E.next.i!==v.i&&E.i!==b.i&&E.next.i!==b.i&&p6(E,E.next,v,b))return!0;E=E.next}while(E!==v);return!1}(p,h)&&(om(p,h)&&om(h,p)&&function(v,b){let E=v,I=!1;const k=(v.x+b.x)/2,R=(v.y+b.y)/2;do E.y>R!=E.next.y>R&&E.next.y!==E.y&&k<(E.next.x-E.x)*(R-E.y)/(E.next.y-E.y)+E.x&&(I=!I),E=E.next;while(E!==v);return I}(p,h)&&(Nn(p.prev,p,h.prev)||Nn(p,h.prev,h))||Wb(p,h)&&Nn(p.prev,p,p.next)>0&&Nn(h.prev,h,h.next)>0)}function Nn(p,h,v){return(h.y-p.y)*(v.x-h.x)-(h.x-p.x)*(v.y-h.y)}function Wb(p,h){return p.x===h.x&&p.y===h.y}function p6(p,h,v,b){const E=Zb(Nn(p,h,v)),I=Zb(Nn(p,h,b)),k=Zb(Nn(v,b,p)),R=Zb(Nn(v,b,h));return E!==I&&k!==R||!(E!==0||!qb(p,v,h))||!(I!==0||!qb(p,b,h))||!(k!==0||!qb(v,p,b))||!(R!==0||!qb(v,h,b))}function qb(p,h,v){return h.x<=Math.max(p.x,v.x)&&h.x>=Math.min(p.x,v.x)&&h.y<=Math.max(p.y,v.y)&&h.y>=Math.min(p.y,v.y)}function Zb(p){return p>0?1:p<0?-1:0}function om(p,h){return Nn(p.prev,p,p.next)<0?Nn(p,h,p.next)>=0&&Nn(p,p.prev,h)>=0:Nn(p,h,p.prev)<0||Nn(p,p.next,h)<0}function g6(p,h){const v=ZA(p.i,p.x,p.y),b=ZA(h.i,h.x,h.y),E=p.next,I=h.prev;return p.next=h,h.prev=p,v.next=E,E.prev=v,b.next=v,v.prev=b,I.next=b,b.prev=I,b}function v6(p,h,v,b){const E=ZA(p,h,v);return b?(E.next=b.next,E.prev=b,b.next.prev=E,b.next=E):(E.prev=E,E.next=E),E}function sm(p){p.next.prev=p.prev,p.prev.next=p.next,p.prevZ&&(p.prevZ.nextZ=p.nextZ),p.nextZ&&(p.nextZ.prevZ=p.prevZ)}function ZA(p,h,v){return{i:p,x:h,y:v,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function jA(p,h,v){const b=v.patternDependencies;let E=!1;for(const I of h){const k=I.paint.get(`${p}-pattern`);k.isConstant()||(E=!0);const R=k.constantOr(null);R&&(E=!0,b[R.to]=!0,b[R.from]=!0)}return E}function XA(p,h,v,b,E){const I=E.patternDependencies;for(const k of h){const R=k.paint.get(`${p}-pattern`).value;if(R.kind!=="constant"){let z=R.evaluate({zoom:b-1},v,{},E.availableImages),U=R.evaluate({zoom:b},v,{},E.availableImages),W=R.evaluate({zoom:b+1},v,{},E.availableImages);z=z&&z.name?z.name:z,U=U&&U.name?U.name:U,W=W&&W.name?W.name:W,I[z]=!0,I[U]=!0,I[W]=!0,v.patterns[k.id]={min:z,mid:U,max:W}}}return v}class YA{constructor(h){this.zoom=h.zoom,this.overscaling=h.overscaling,this.layers=h.layers,this.layerIds=this.layers.map(v=>v.id),this.index=h.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new ko,this.indexArray=new Ka,this.indexArray2=new ui,this.programConfigurations=new Ph(h.layers,h.zoom),this.segments=new Nr,this.segments2=new Nr,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(h,v,b){this.hasPattern=jA("fill",this.layers,v);const E=this.layers[0].layout.get("fill-sort-key"),I=!E.isConstant(),k=[];for(const{feature:R,id:z,index:U,sourceLayerIndex:W}of h){const X=this.layers[0]._featureFilter.needGeometry,ee=Nh(R,X);if(!this.layers[0]._featureFilter.filter(new fn(this.zoom),ee,b))continue;const ne=I?E.evaluate(ee,{},b,v.availableImages):void 0,oe={id:z,properties:R.properties,type:R.type,sourceLayerIndex:W,index:U,geometry:X?ee.geometry:Rh(R),patterns:{},sortKey:ne};k.push(oe)}I&&k.sort((R,z)=>R.sortKey-z.sortKey);for(const R of k){const{geometry:z,index:U,sourceLayerIndex:W}=R;if(this.hasPattern){const X=XA("fill",this.layers,R,this.zoom,v);this.patternFeatures.push(X)}else this.addFeature(R,z,U,b,{});v.featureIndex.insert(h[U].feature,z,U,W,this.index)}}update(h,v,b){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(h,v,this.stateDependentLayers,b)}addFeatures(h,v,b){for(const E of this.patternFeatures)this.addFeature(E,E.geometry,E.index,v,b)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(h){this.uploaded||(this.layoutVertexBuffer=h.createVertexBuffer(this.layoutVertexArray,xye),this.indexBuffer=h.createIndexBuffer(this.indexArray),this.indexBuffer2=h.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(h),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(h,v,b,E,I){for(const k of gf(v,500)){let R=0;for(const ne of k)R+=ne.length;const z=this.segments.prepareSegment(R,this.layoutVertexArray,this.indexArray),U=z.vertexLength,W=[],X=[];for(const ne of k){if(ne.length===0)continue;ne!==k[0]&&X.push(W.length/2);const oe=this.segments2.prepareSegment(ne.length,this.layoutVertexArray,this.indexArray2),ce=oe.vertexLength;this.layoutVertexArray.emplaceBack(ne[0].x,ne[0].y),this.indexArray2.emplaceBack(ce+ne.length-1,ce),W.push(ne[0].x),W.push(ne[0].y);for(let me=1;me>3}if(E--,b===1||b===2)I+=p.readSVarint(),k+=p.readSVarint(),b===1&&(h&&R.push(h),h=[]),h.push(new Oye(I,k));else{if(b!==7)throw new Error("unknown command "+b);h&&h.push(h[0].clone())}}return h&&R.push(h),R},qf.prototype.bbox=function(){var p=this._pbf;p.pos=this._geometry;for(var h=p.readVarint()+p.pos,v=1,b=0,E=0,I=0,k=1/0,R=-1/0,z=1/0,U=-1/0;p.pos>3}if(b--,v===1||v===2)(E+=p.readSVarint())R&&(R=E),(I+=p.readSVarint())U&&(U=I);else if(v!==7)throw new Error("unknown command "+v)}return[k,z,R,U]},qf.prototype.toGeoJSON=function(p,h,v){var b,E,I=this.extent*Math.pow(2,v),k=this.extent*p,R=this.extent*h,z=this.loadGeometry(),U=qf.types[this.type];function W(ne){for(var oe=0;oe>3;E=k===1?b.readString():k===2?b.readFloat():k===3?b.readDouble():k===4?b.readVarint64():k===5?b.readVarint():k===6?b.readSVarint():k===7?b.readBoolean():null}return E}(v))}x6.prototype.feature=function(p){if(p<0||p>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[p];var h=this._pbf.readVarint()+this._pbf.pos;return new Vye(this._pbf,h,this.extent,this._keys,this._values)};var $ye=b6;function Gye(p,h,v){if(p===3){var b=new $ye(v,v.readVarint()+v.pos);b.length&&(h[b.name]=b)}}Ou.VectorTile=function(p,h){this.layers=p.readFields(Gye,{},h)},Ou.VectorTileFeature=_6,Ou.VectorTileLayer=b6;const Uye=Ou.VectorTileFeature.types,KA=Math.pow(2,13);function lm(p,h,v,b,E,I,k,R){p.emplaceBack(h,v,2*Math.floor(b*KA)+k,E*KA*2,I*KA*2,Math.round(R))}class JA{constructor(h){this.zoom=h.zoom,this.overscaling=h.overscaling,this.layers=h.layers,this.layerIds=this.layers.map(v=>v.id),this.index=h.index,this.hasPattern=!1,this.layoutVertexArray=new Iu,this.centroidVertexArray=new mi,this.indexArray=new Ka,this.programConfigurations=new Ph(h.layers,h.zoom),this.segments=new Nr,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(h,v,b){this.features=[],this.hasPattern=jA("fill-extrusion",this.layers,v);for(const{feature:E,id:I,index:k,sourceLayerIndex:R}of h){const z=this.layers[0]._featureFilter.needGeometry,U=Nh(E,z);if(!this.layers[0]._featureFilter.filter(new fn(this.zoom),U,b))continue;const W={id:I,sourceLayerIndex:R,index:k,geometry:z?U.geometry:Rh(E),properties:E.properties,type:E.type,patterns:{}};this.hasPattern?this.features.push(XA("fill-extrusion",this.layers,W,this.zoom,v)):this.addFeature(W,W.geometry,k,b,{}),v.featureIndex.insert(E,W.geometry,k,R,this.index,!0)}}addFeatures(h,v,b){for(const E of this.features){const{geometry:I}=E;this.addFeature(E,I,E.index,v,b)}}update(h,v,b){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(h,v,this.stateDependentLayers,b)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(h){this.uploaded||(this.layoutVertexBuffer=h.createVertexBuffer(this.layoutVertexArray,Nye),this.centroidVertexBuffer=h.createVertexBuffer(this.centroidVertexArray,Rye.members,!0),this.indexBuffer=h.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(h),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(h,v,b,E,I){for(const k of gf(v,500)){const R={x:0,y:0,vertexCount:0};let z=0;for(const oe of k)z+=oe.length;let U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const oe of k){if(oe.length===0||Wye(oe))continue;let ce=0;for(let me=0;me=1){const Oe=oe[me-1];if(!Hye(we,Oe)){U.vertexLength+4>Nr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const Ae=we.sub(Oe)._perp()._unit(),Re=Oe.dist(we);ce+Re>32768&&(ce=0),lm(this.layoutVertexArray,we.x,we.y,Ae.x,Ae.y,0,0,ce),lm(this.layoutVertexArray,we.x,we.y,Ae.x,Ae.y,0,1,ce),R.x+=2*we.x,R.y+=2*we.y,R.vertexCount+=2,ce+=Re,lm(this.layoutVertexArray,Oe.x,Oe.y,Ae.x,Ae.y,0,0,ce),lm(this.layoutVertexArray,Oe.x,Oe.y,Ae.x,Ae.y,0,1,ce),R.x+=2*Oe.x,R.y+=2*Oe.y,R.vertexCount+=2;const Ue=U.vertexLength;this.indexArray.emplaceBack(Ue,Ue+2,Ue+1),this.indexArray.emplaceBack(Ue+1,Ue+2,Ue+3),U.vertexLength+=4,U.primitiveLength+=2}}}}if(U.vertexLength+z>Nr.MAX_VERTEX_ARRAY_LENGTH&&(U=this.segments.prepareSegment(z,this.layoutVertexArray,this.indexArray)),Uye[h.type]!=="Polygon")continue;const W=[],X=[],ee=U.vertexLength;for(const oe of k)if(oe.length!==0){oe!==k[0]&&X.push(W.length/2);for(let ce=0;ceFn)||p.y===h.y&&(p.y<0||p.y>Fn)}function Wye(p){return p.every(h=>h.x<0)||p.every(h=>h.x>Fn)||p.every(h=>h.y<0)||p.every(h=>h.y>Fn)}let w6;Dt("FillExtrusionBucket",JA,{omit:["layers","features"]});var qye={get paint(){return w6=w6||new M({"fill-extrusion-opacity":new Pt(Le["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Qt(Le["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new Pt(Le["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new Pt(Le["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Nf(Le["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Qt(Le["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Qt(Le["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new Pt(Le["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class Zye extends y{constructor(h){super(h,qye)}createBucket(h){return new JA(h)}queryRadius(){return Gb(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(h,v,b,E,I,k,R,z){const U=Ub(h,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),k.angle,R),W=this.paint.get("fill-extrusion-height").evaluate(v,b),X=this.paint.get("fill-extrusion-base").evaluate(v,b),ee=function(oe,ce,me,we){const Oe=[];for(const Ae of oe){const Re=[Ae.x,Ae.y,0,1];Hb(Re,Re,ce),Oe.push(new f(Re[0]/Re[3],Re[1]/Re[3]))}return Oe}(U,z),ne=function(oe,ce,me,we){const Oe=[],Ae=[],Re=we[8]*ce,Ue=we[9]*ce,tt=we[10]*ce,St=we[11]*ce,Jt=we[8]*me,xt=we[9]*me,_t=we[10]*me,Vt=we[11]*me;for(const Mt of oe){const At=[],Ye=[];for(const Gt of Mt){const zt=Gt.x,or=Gt.y,nn=we[0]*zt+we[4]*or+we[12],tn=we[1]*zt+we[5]*or+we[13],Jn=we[2]*zt+we[6]*or+we[14],Lo=we[3]*zt+we[7]*or+we[15],bi=Jn+tt,Qn=Lo+St,Hi=nn+Jt,Wi=tn+xt,qi=Jn+_t,kn=Lo+Vt,ei=new f((nn+Re)/Qn,(tn+Ue)/Qn);ei.z=bi/Qn,At.push(ei);const ki=new f(Hi/kn,Wi/kn);ki.z=qi/kn,Ye.push(ki)}Oe.push(At),Ae.push(Ye)}return[Oe,Ae]}(E,X,W,z);return function(oe,ce,me){let we=1/0;e6(me,ce)&&(we=S6(me,ce[0]));for(let Oe=0;Oev.id),this.index=h.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(v=>{this.gradients[v.id]={}}),this.layoutVertexArray=new zf,this.layoutVertexArray2=new ku,this.indexArray=new Ka,this.programConfigurations=new Ph(h.layers,h.zoom),this.segments=new Nr,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(v=>v.isStateDependent()).map(v=>v.id)}populate(h,v,b){this.hasPattern=jA("line",this.layers,v);const E=this.layers[0].layout.get("line-sort-key"),I=!E.isConstant(),k=[];for(const{feature:R,id:z,index:U,sourceLayerIndex:W}of h){const X=this.layers[0]._featureFilter.needGeometry,ee=Nh(R,X);if(!this.layers[0]._featureFilter.filter(new fn(this.zoom),ee,b))continue;const ne=I?E.evaluate(ee,{},b):void 0,oe={id:z,properties:R.properties,type:R.type,sourceLayerIndex:W,index:U,geometry:X?ee.geometry:Rh(R),patterns:{},sortKey:ne};k.push(oe)}I&&k.sort((R,z)=>R.sortKey-z.sortKey);for(const R of k){const{geometry:z,index:U,sourceLayerIndex:W}=R;if(this.hasPattern){const X=XA("line",this.layers,R,this.zoom,v);this.patternFeatures.push(X)}else this.addFeature(R,z,U,b,{});v.featureIndex.insert(h[U].feature,z,U,W,this.index)}}update(h,v,b){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(h,v,this.stateDependentLayers,b)}addFeatures(h,v,b){for(const E of this.patternFeatures)this.addFeature(E,E.geometry,E.index,v,b)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(h){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=h.createVertexBuffer(this.layoutVertexArray2,Kye)),this.layoutVertexBuffer=h.createVertexBuffer(this.layoutVertexArray,Xye),this.indexBuffer=h.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(h),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(h){if(h.properties&&Object.prototype.hasOwnProperty.call(h.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(h.properties,"mapbox_clip_end"))return{start:+h.properties.mapbox_clip_start,end:+h.properties.mapbox_clip_end}}addFeature(h,v,b,E,I){const k=this.layers[0].layout,R=k.get("line-join").evaluate(h,{}),z=k.get("line-cap"),U=k.get("line-miter-limit"),W=k.get("line-round-limit");this.lineClips=this.lineFeatureClips(h);for(const X of v)this.addLine(X,h,R,z,U,W);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,h,b,I,E)}addLine(h,v,b,E,I,k){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let we=0;we=2&&h[z-1].equals(h[z-2]);)z--;let U=0;for(;U0;if(St&&we>U){const Vt=ee.dist(ne);if(Vt>2*W){const Mt=ee.sub(ee.sub(ne)._mult(W/Vt)._round());this.updateDistance(ne,Mt),this.addCurrentVertex(Mt,ce,0,0,X),ne=Mt}}const xt=ne&&oe;let _t=xt?b:R?"butt":E;if(xt&&_t==="round"&&(UeI&&(_t="bevel"),_t==="bevel"&&(Ue>2&&(_t="flipbevel"),Ue100)Oe=me.mult(-1);else{const Vt=Ue*ce.add(me).mag()/ce.sub(me).mag();Oe._perp()._mult(Vt*(Jt?-1:1))}this.addCurrentVertex(ee,Oe,0,0,X),this.addCurrentVertex(ee,Oe.mult(-1),0,0,X)}else if(_t==="bevel"||_t==="fakeround"){const Vt=-Math.sqrt(Ue*Ue-1),Mt=Jt?Vt:0,At=Jt?0:Vt;if(ne&&this.addCurrentVertex(ee,ce,Mt,At,X),_t==="fakeround"){const Ye=Math.round(180*tt/Math.PI/20);for(let Gt=1;Gt2*W){const Mt=ee.add(oe.sub(ee)._mult(W/Vt)._round());this.updateDistance(ee,Mt),this.addCurrentVertex(Mt,me,0,0,X),ee=Mt}}}}addCurrentVertex(h,v,b,E,I,k=!1){const R=v.y*E-v.x,z=-v.y-v.x*E;this.addHalfVertex(h,v.x+v.y*b,v.y-v.x*b,k,!1,b,I),this.addHalfVertex(h,R,z,k,!0,-E,I),this.distance>T6/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(h,v,b,E,I,k))}addHalfVertex({x:h,y:v},b,E,I,k,R,z){const U=.5*(this.lineClips?this.scaledDistance*(T6-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((h<<1)+(I?1:0),(v<<1)+(k?1:0),Math.round(63*b)+128,Math.round(63*E)+128,1+(R===0?0:R<0?-1:1)|(63&U)<<2,U>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const W=z.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,W),z.primitiveLength++),k?this.e2=W:this.e1=W}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(h,v){this.distance+=h.dist(v),this.updateScaledDistance()}}let E6,C6;Dt("LineBucket",QA,{omit:["layers","patternFeatures"]});var A6={get paint(){return C6=C6||new M({"line-opacity":new Qt(Le.paint_line["line-opacity"]),"line-color":new Qt(Le.paint_line["line-color"]),"line-translate":new Pt(Le.paint_line["line-translate"]),"line-translate-anchor":new Pt(Le.paint_line["line-translate-anchor"]),"line-width":new Qt(Le.paint_line["line-width"]),"line-gap-width":new Qt(Le.paint_line["line-gap-width"]),"line-offset":new Qt(Le.paint_line["line-offset"]),"line-blur":new Qt(Le.paint_line["line-blur"]),"line-dasharray":new Of(Le.paint_line["line-dasharray"]),"line-pattern":new Nf(Le.paint_line["line-pattern"]),"line-gradient":new Qv(Le.paint_line["line-gradient"])})},get layout(){return E6=E6||new M({"line-cap":new Pt(Le.layout_line["line-cap"]),"line-join":new Qt(Le.layout_line["line-join"]),"line-miter-limit":new Pt(Le.layout_line["line-miter-limit"]),"line-round-limit":new Pt(Le.layout_line["line-round-limit"]),"line-sort-key":new Qt(Le.layout_line["line-sort-key"])})}};class e_e extends Qt{possiblyEvaluate(h,v){return v=new fn(Math.floor(v.zoom),{now:v.now,fadeDuration:v.fadeDuration,zoomHistory:v.zoomHistory,transition:v.transition}),super.possiblyEvaluate(h,v)}evaluate(h,v,b,E){return v=$({},v,{zoom:Math.floor(v.zoom)}),super.evaluate(h,v,b,E)}}let jb;class t_e extends y{constructor(h){super(h,A6),this.gradientVersion=0,jb||(jb=new e_e(A6.paint.properties["line-width"].specification),jb.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(h){if(h==="line-gradient"){const v=this.gradientExpression();this.stepInterpolant=!!function(b){return b._styleExpression!==void 0}(v)&&v._styleExpression.expression instanceof du,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(h,v){super.recalculate(h,v),this.paint._values["line-floorwidth"]=jb.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,h)}createBucket(h){return new QA(h)}queryRadius(h){const v=h,b=D6(rm("line-width",this,v),rm("line-gap-width",this,v)),E=rm("line-offset",this,v);return b/2+Math.abs(E)+Gb(this.paint.get("line-translate"))}queryIntersectsFeature(h,v,b,E,I,k,R){const z=Ub(h,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),k.angle,R),U=R/2*D6(this.paint.get("line-width").evaluate(v,b),this.paint.get("line-gap-width").evaluate(v,b)),W=this.paint.get("line-offset").evaluate(v,b);return W&&(E=function(X,ee){const ne=[];for(let oe=0;oe=3){for(let me=0;me0?h+2*p:p}const r_e=N([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),n_e=N([{name:"a_projected_pos",components:3,type:"Float32"}],4);N([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const i_e=N([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);N([{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"}]);const M6=N([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),a_e=N([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function o_e(p,h,v){return p.sections.forEach(b=>{b.text=function(E,I,k){const R=I.layout.get("text-transform").evaluate(k,{});return R==="uppercase"?E=E.toLocaleUpperCase():R==="lowercase"&&(E=E.toLocaleLowerCase()),pa.applyArabicShaping&&(E=pa.applyArabicShaping(E)),E}(b.text,h,v)}),p}N([{name:"triangle",components:3,type:"Uint16"}]),N([{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"}]),N([{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"}]),N([{type:"Float32",name:"offsetX"}]),N([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),N([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const cm={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Zn=24,I6=en,k6=function(p,h,v,b,E){var I,k,R=8*E-b-1,z=(1<>1,W=-7,X=E-1,ee=-1,ne=p[h+X];for(X+=ee,I=ne&(1<<-W)-1,ne>>=-W,W+=R;W>0;I=256*I+p[h+X],X+=ee,W-=8);for(k=I&(1<<-W)-1,I>>=-W,W+=b;W>0;k=256*k+p[h+X],X+=ee,W-=8);if(I===0)I=1-U;else{if(I===z)return k?NaN:1/0*(ne?-1:1);k+=Math.pow(2,b),I-=U}return(ne?-1:1)*k*Math.pow(2,I-b)},L6=function(p,h,v,b,E,I){var k,R,z,U=8*I-E-1,W=(1<>1,ee=E===23?Math.pow(2,-24)-Math.pow(2,-77):0,ne=0,oe=1,ce=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(R=isNaN(h)?1:0,k=W):(k=Math.floor(Math.log(h)/Math.LN2),h*(z=Math.pow(2,-k))<1&&(k--,z*=2),(h+=k+X>=1?ee/z:ee*Math.pow(2,1-X))*z>=2&&(k++,z/=2),k+X>=W?(R=0,k=W):k+X>=1?(R=(h*z-1)*Math.pow(2,E),k+=X):(R=h*Math.pow(2,X-1)*Math.pow(2,E),k=0));E>=8;p[v+ne]=255&R,ne+=oe,R/=256,E-=8);for(k=k<0;p[v+ne]=255&k,ne+=oe,k/=256,U-=8);p[v+ne-oe]|=128*ce};function en(p){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(p)?p:new Uint8Array(p||0),this.pos=0,this.type=0,this.length=this.buf.length}en.Varint=0,en.Fixed64=1,en.Bytes=2,en.Fixed32=5;var eD=4294967296,P6=1/eD,R6=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function bl(p){return p.type===en.Bytes?p.readVarint()+p.pos:p.pos+1}function Zf(p,h,v){return v?4294967296*h+(p>>>0):4294967296*(h>>>0)+(p>>>0)}function N6(p,h,v){var b=h<=16383?1:h<=2097151?2:h<=268435455?3:Math.floor(Math.log(h)/(7*Math.LN2));v.realloc(b);for(var E=v.pos-1;E>=p;E--)v.buf[E+b]=v.buf[E]}function s_e(p,h){for(var v=0;v>>8,p[v+2]=h>>>16,p[v+3]=h>>>24}function O6(p,h){return(p[h]|p[h+1]<<8|p[h+2]<<16)+(p[h+3]<<24)}en.prototype={destroy:function(){this.buf=null},readFields:function(p,h,v){for(v=v||this.length;this.pos>3,I=this.pos;this.type=7&b,p(E,h,this),this.pos===I&&this.skip(b)}return h},readMessage:function(p,h){return this.readFields(p,h,this.readVarint()+this.pos)},readFixed32:function(){var p=Xb(this.buf,this.pos);return this.pos+=4,p},readSFixed32:function(){var p=O6(this.buf,this.pos);return this.pos+=4,p},readFixed64:function(){var p=Xb(this.buf,this.pos)+Xb(this.buf,this.pos+4)*eD;return this.pos+=8,p},readSFixed64:function(){var p=Xb(this.buf,this.pos)+O6(this.buf,this.pos+4)*eD;return this.pos+=8,p},readFloat:function(){var p=k6(this.buf,this.pos,!0,23,4);return this.pos+=4,p},readDouble:function(){var p=k6(this.buf,this.pos,!0,52,8);return this.pos+=8,p},readVarint:function(p){var h,v,b=this.buf;return h=127&(v=b[this.pos++]),v<128?h:(h|=(127&(v=b[this.pos++]))<<7,v<128?h:(h|=(127&(v=b[this.pos++]))<<14,v<128?h:(h|=(127&(v=b[this.pos++]))<<21,v<128?h:function(E,I,k){var R,z,U=k.buf;if(R=(112&(z=U[k.pos++]))>>4,z<128||(R|=(127&(z=U[k.pos++]))<<3,z<128)||(R|=(127&(z=U[k.pos++]))<<10,z<128)||(R|=(127&(z=U[k.pos++]))<<17,z<128)||(R|=(127&(z=U[k.pos++]))<<24,z<128)||(R|=(1&(z=U[k.pos++]))<<31,z<128))return Zf(E,R,I);throw new Error("Expected varint not more than 10 bytes")}(h|=(15&(v=b[this.pos]))<<28,p,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var p=this.readVarint();return p%2==1?(p+1)/-2:p/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var p=this.readVarint()+this.pos,h=this.pos;return this.pos=p,p-h>=12&&R6?function(v,b,E){return R6.decode(v.subarray(b,E))}(this.buf,h,p):function(v,b,E){for(var I="",k=b;k239?4:W>223?3:W>191?2:1;if(k+ee>E)break;ee===1?W<128&&(X=W):ee===2?(192&(R=v[k+1]))==128&&(X=(31&W)<<6|63&R)<=127&&(X=null):ee===3?(z=v[k+2],(192&(R=v[k+1]))==128&&(192&z)==128&&((X=(15&W)<<12|(63&R)<<6|63&z)<=2047||X>=55296&&X<=57343)&&(X=null)):ee===4&&(z=v[k+2],U=v[k+3],(192&(R=v[k+1]))==128&&(192&z)==128&&(192&U)==128&&((X=(15&W)<<18|(63&R)<<12|(63&z)<<6|63&U)<=65535||X>=1114112)&&(X=null)),X===null?(X=65533,ee=1):X>65535&&(X-=65536,I+=String.fromCharCode(X>>>10&1023|55296),X=56320|1023&X),I+=String.fromCharCode(X),k+=ee}return I}(this.buf,h,p)},readBytes:function(){var p=this.readVarint()+this.pos,h=this.buf.subarray(this.pos,p);return this.pos=p,h},readPackedVarint:function(p,h){if(this.type!==en.Bytes)return p.push(this.readVarint(h));var v=bl(this);for(p=p||[];this.pos127;);else if(h===en.Bytes)this.pos=this.readVarint()+this.pos;else if(h===en.Fixed32)this.pos+=4;else{if(h!==en.Fixed64)throw new Error("Unimplemented type: "+h);this.pos+=8}},writeTag:function(p,h){this.writeVarint(p<<3|h)},realloc:function(p){for(var h=this.length||16;h268435455||p<0?function(h,v){var b,E;if(h>=0?(b=h%4294967296|0,E=h/4294967296|0):(E=~(-h/4294967296),4294967295^(b=~(-h%4294967296))?b=b+1|0:(b=0,E=E+1|0)),h>=18446744073709552e3||h<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");v.realloc(10),function(I,k,R){R.buf[R.pos++]=127&I|128,I>>>=7,R.buf[R.pos++]=127&I|128,I>>>=7,R.buf[R.pos++]=127&I|128,I>>>=7,R.buf[R.pos++]=127&I|128,R.buf[R.pos]=127&(I>>>=7)}(b,0,v),function(I,k){var R=(7&I)<<4;k.buf[k.pos++]|=R|((I>>>=3)?128:0),I&&(k.buf[k.pos++]=127&I|((I>>>=7)?128:0),I&&(k.buf[k.pos++]=127&I|((I>>>=7)?128:0),I&&(k.buf[k.pos++]=127&I|((I>>>=7)?128:0),I&&(k.buf[k.pos++]=127&I|((I>>>=7)?128:0),I&&(k.buf[k.pos++]=127&I)))))}(E,v)}(p,this):(this.realloc(4),this.buf[this.pos++]=127&p|(p>127?128:0),p<=127||(this.buf[this.pos++]=127&(p>>>=7)|(p>127?128:0),p<=127||(this.buf[this.pos++]=127&(p>>>=7)|(p>127?128:0),p<=127||(this.buf[this.pos++]=p>>>7&127))))},writeSVarint:function(p){this.writeVarint(p<0?2*-p-1:2*p)},writeBoolean:function(p){this.writeVarint(!!p)},writeString:function(p){p=String(p),this.realloc(4*p.length),this.pos++;var h=this.pos;this.pos=function(b,E,I){for(var k,R,z=0;z55295&&k<57344){if(!R){k>56319||z+1===E.length?(b[I++]=239,b[I++]=191,b[I++]=189):R=k;continue}if(k<56320){b[I++]=239,b[I++]=191,b[I++]=189,R=k;continue}k=R-55296<<10|k-56320|65536,R=null}else R&&(b[I++]=239,b[I++]=191,b[I++]=189,R=null);k<128?b[I++]=k:(k<2048?b[I++]=k>>6|192:(k<65536?b[I++]=k>>12|224:(b[I++]=k>>18|240,b[I++]=k>>12&63|128),b[I++]=k>>6&63|128),b[I++]=63&k|128)}return I}(this.buf,p,this.pos);var v=this.pos-h;v>=128&&N6(h,v,this),this.pos=h-1,this.writeVarint(v),this.pos+=v},writeFloat:function(p){this.realloc(4),L6(this.buf,p,this.pos,!0,23,4),this.pos+=4},writeDouble:function(p){this.realloc(8),L6(this.buf,p,this.pos,!0,52,8),this.pos+=8},writeBytes:function(p){var h=p.length;this.writeVarint(h),this.realloc(h);for(var v=0;v=128&&N6(v,b,this),this.pos=v-1,this.writeVarint(b),this.pos+=b},writeMessage:function(p,h,v){this.writeTag(p,en.Bytes),this.writeRawMessage(h,v)},writePackedVarint:function(p,h){h.length&&this.writeMessage(p,s_e,h)},writePackedSVarint:function(p,h){h.length&&this.writeMessage(p,l_e,h)},writePackedBoolean:function(p,h){h.length&&this.writeMessage(p,h_e,h)},writePackedFloat:function(p,h){h.length&&this.writeMessage(p,u_e,h)},writePackedDouble:function(p,h){h.length&&this.writeMessage(p,c_e,h)},writePackedFixed32:function(p,h){h.length&&this.writeMessage(p,d_e,h)},writePackedSFixed32:function(p,h){h.length&&this.writeMessage(p,f_e,h)},writePackedFixed64:function(p,h){h.length&&this.writeMessage(p,p_e,h)},writePackedSFixed64:function(p,h){h.length&&this.writeMessage(p,g_e,h)},writeBytesField:function(p,h){this.writeTag(p,en.Bytes),this.writeBytes(h)},writeFixed32Field:function(p,h){this.writeTag(p,en.Fixed32),this.writeFixed32(h)},writeSFixed32Field:function(p,h){this.writeTag(p,en.Fixed32),this.writeSFixed32(h)},writeFixed64Field:function(p,h){this.writeTag(p,en.Fixed64),this.writeFixed64(h)},writeSFixed64Field:function(p,h){this.writeTag(p,en.Fixed64),this.writeSFixed64(h)},writeVarintField:function(p,h){this.writeTag(p,en.Varint),this.writeVarint(h)},writeSVarintField:function(p,h){this.writeTag(p,en.Varint),this.writeSVarint(h)},writeStringField:function(p,h){this.writeTag(p,en.Bytes),this.writeString(h)},writeFloatField:function(p,h){this.writeTag(p,en.Fixed32),this.writeFloat(h)},writeDoubleField:function(p,h){this.writeTag(p,en.Fixed64),this.writeDouble(h)},writeBooleanField:function(p,h){this.writeVarintField(p,!!h)}};var tD=l(I6);const rD=3;function v_e(p,h,v){p===1&&v.readMessage(m_e,h)}function m_e(p,h,v){if(p===3){const{id:b,bitmap:E,width:I,height:k,left:R,top:z,advance:U}=v.readMessage(y_e,{});h.push({id:b,bitmap:new im({width:I+2*rD,height:k+2*rD},E),metrics:{width:I,height:k,left:R,top:z,advance:U}})}}function y_e(p,h,v){p===1?h.id=v.readVarint():p===2?h.bitmap=v.readBytes():p===3?h.width=v.readVarint():p===4?h.height=v.readVarint():p===5?h.left=v.readSVarint():p===6?h.top=v.readSVarint():p===7&&(h.advance=v.readVarint())}const z6=rD;function B6(p){let h=0,v=0;for(const k of p)h+=k.w*k.h,v=Math.max(v,k.w);p.sort((k,R)=>R.h-k.h);const b=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(h/.95)),v),h:1/0}];let E=0,I=0;for(const k of p)for(let R=b.length-1;R>=0;R--){const z=b[R];if(!(k.w>z.w||k.h>z.h)){if(k.x=z.x,k.y=z.y,I=Math.max(I,k.y+k.h),E=Math.max(E,k.x+k.w),k.w===z.w&&k.h===z.h){const U=b.pop();R=0&&b>=h&&Kb[this.text.charCodeAt(b)];b--)v--;this.text=this.text.substring(h,v),this.sectionIndex=this.sectionIndex.slice(h,v)}substring(h,v){const b=new Xf;return b.text=this.text.substring(h,v),b.sectionIndex=this.sectionIndex.slice(h,v),b.sections=this.sections,b}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((h,v)=>Math.max(h,this.sections[v].scale),0)}addTextSection(h,v){this.text+=h.text,this.sections.push(dm.forText(h.scale,h.fontStack||v));const b=this.sections.length-1;for(let E=0;E=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Yb(p,h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe){const ce=Xf.fromFeature(p,E);let me;X===o.ah.vertical&&ce.verticalizePunctuation();const{processBidirectionalText:we,processStyledBidirectionalText:Oe}=pa;if(we&&ce.sections.length===1){me=[];const Ue=we(ce.toString(),iD(ce,U,I,h,b,ne));for(const tt of Ue){const St=new Xf;St.text=tt,St.sections=ce.sections;for(let Jt=0;Jt0&&xl>wi&&(wi=xl)}else{const to=St[Hr.fontStack],ci=to&&to[mn];if(ci&&ci.rect)Qf=ci.rect,Cn=ci.metrics;else{const xl=tt[Hr.fontStack],ym=xl&&xl[mn];if(!ym)continue;Cn=ym.metrics}Oa=(ei-Hr.scale)*Zn}Po?(Ue.verticalizable=!0,Zi.push({glyph:mn,imageName:Ls,x:or,y:nn+Oa,vertical:Po,scale:Hr.scale,fontStack:Hr.fontStack,sectionIndex:cn,metrics:Cn,rect:Qf}),or+=Ps*Hr.scale+Ye):(Zi.push({glyph:mn,imageName:Ls,x:or,y:nn+Oa,vertical:Po,scale:Hr.scale,fontStack:Hr.fontStack,sectionIndex:cn,metrics:Cn,rect:Qf}),or+=Cn.advance*Hr.scale+Ye)}Zi.length!==0&&(tn=Math.max(or-Ye,tn),w_e(Zi,0,Zi.length-1,Lo,wi)),or=0;const eo=_t*ei+wi;xi.lineOffset=Math.max(wi,ki),nn+=eo,Jn=Math.max(eo,Jn),++bi}var Qn;const Hi=nn-hm,{horizontalAlign:Wi,verticalAlign:qi}=aD(Vt);(function(kn,ei,ki,xi,Zi,wi,eo,ma,Hr){const cn=(ei-ki)*Zi;let mn=0;mn=wi!==eo?-ma*xi-hm:(-xi*Hr+.5)*eo;for(const Oa of kn)for(const Cn of Oa.positionedGlyphs)Cn.x+=cn,Cn.y+=mn})(Ue.positionedLines,Lo,Wi,qi,tn,Jn,_t,Hi,xt.length),Ue.top+=-qi*Hi,Ue.bottom=Ue.top+Hi,Ue.left+=-Wi*tn,Ue.right=Ue.left+tn}(Re,h,v,b,me,k,R,z,X,U,ee,oe),!function(Ue){for(const tt of Ue)if(tt.positionedGlyphs.length!==0)return!1;return!0}(Ae)&&Re}const Kb={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},__e={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},b_e={40:!0};function F6(p,h,v,b,E,I){if(h.imageName){const k=b[h.imageName];return k?k.displaySize[0]*h.scale*Zn/I+E:0}{const k=v[h.fontStack],R=k&&k[p];return R?R.metrics.advance*h.scale+E:0}}function $6(p,h,v,b){const E=Math.pow(p-h,2);return b?p=0;let U=0;for(let X=0;XU){const W=Math.ceil(I/U);E*=W/k,k=W}return{x1:b,y1:E,x2:b+I,y2:E+k}}function W6(p,h,v,b,E,I){const k=p.image;let R;if(k.content){const me=k.content,we=k.pixelRatio||1;R=[me[0]/we,me[1]/we,k.displaySize[0]-me[2]/we,k.displaySize[1]-me[3]/we]}const z=h.left*I,U=h.right*I;let W,X,ee,ne;v==="width"||v==="both"?(ne=E[0]+z-b[3],X=E[0]+U+b[1]):(ne=E[0]+(z+U-k.displaySize[0])/2,X=ne+k.displaySize[0]);const oe=h.top*I,ce=h.bottom*I;return v==="height"||v==="both"?(W=E[1]+oe-b[0],ee=E[1]+ce+b[2]):(W=E[1]+(oe+ce-k.displaySize[1])/2,ee=W+k.displaySize[1]),{image:k,top:W,right:X,bottom:ee,left:ne,collisionPadding:R}}const fm=255,ks=128,Bu=fm*ks;function q6(p,h){const{expression:v}=h;if(v.kind==="constant")return{kind:"constant",layoutSize:v.evaluate(new fn(p+1))};if(v.kind==="source")return{kind:"source"};{const{zoomStops:b,interpolationType:E}=v;let I=0;for(;Ik.id),this.index=h.index,this.pixelRatio=h.pixelRatio,this.sourceLayerIndex=h.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=GA([]),this.placementViewportMatrix=GA([]);const v=this.layers[0]._unevaluatedLayout._values;this.textSizeData=q6(this.zoom,v["text-size"]),this.iconSizeData=q6(this.zoom,v["icon-size"]);const b=this.layers[0].layout,E=b.get("symbol-sort-key"),I=b.get("symbol-z-order");this.canOverlap=oD(b,"text-overlap","text-allow-overlap")!=="never"||oD(b,"icon-overlap","icon-allow-overlap")!=="never"||b.get("text-ignore-placement")||b.get("icon-ignore-placement"),this.sortFeaturesByKey=I!=="viewport-y"&&!E.isConstant(),this.sortFeaturesByY=(I==="viewport-y"||I==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,b.get("symbol-placement")==="point"&&(this.writingModes=b.get("text-writing-mode").map(k=>o.ah[k])),this.stateDependentLayerIds=this.layers.filter(k=>k.isStateDependent()).map(k=>k.id),this.sourceID=h.sourceID}createArrays(){this.text=new lD(new Ph(this.layers,this.zoom,h=>/^text/.test(h))),this.icon=new lD(new Ph(this.layers,this.zoom,h=>/^icon/.test(h))),this.glyphOffsetArray=new gn,this.lineVertexArray=new vi,this.symbolInstances=new kr,this.textAnchorOffsets=new vn}calculateGlyphDependencies(h,v,b,E,I){for(let k=0;k0)&&(k.value.kind!=="constant"||k.value.value.length>0),W=z.value.kind!=="constant"||!!z.value.value||Object.keys(z.parameters).length>0,X=I.get("symbol-sort-key");if(this.features=[],!U&&!W)return;const ee=v.iconDependencies,ne=v.glyphDependencies,oe=v.availableImages,ce=new fn(this.zoom);for(const{feature:me,id:we,index:Oe,sourceLayerIndex:Ae}of h){const Re=E._featureFilter.needGeometry,Ue=Nh(me,Re);if(!E._featureFilter.filter(ce,Ue,b))continue;let tt,St;if(Re||(Ue.geometry=Rh(me)),U){const xt=E.getValueAndResolveTokens("text-field",Ue,b,oe),_t=ca.factory(xt),Vt=this.hasRTLText=this.hasRTLText||C_e(_t);(!Vt||pa.getRTLTextPluginStatus()==="unavailable"||Vt&&pa.isParsed())&&(tt=o_e(_t,E,Ue))}if(W){const xt=E.getValueAndResolveTokens("icon-image",Ue,b,oe);St=xt instanceof da?xt:da.fromString(xt)}if(!tt&&!St)continue;const Jt=this.sortFeaturesByKey?X.evaluate(Ue,{},b):void 0;if(this.features.push({id:we,text:tt,icon:St,index:Oe,sourceLayerIndex:Ae,geometry:Ue.geometry,properties:me.properties,type:T_e[me.type],sortKey:Jt}),St&&(ee[St.name]=!0),tt){const xt=k.evaluate(Ue,{},b).join(","),_t=I.get("text-rotation-alignment")!=="viewport"&&I.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(o.ah.vertical)>=0;for(const Vt of tt.sections)if(Vt.image)ee[Vt.image.name]=!0;else{const Mt=Xv(tt.toString()),At=Vt.fontStack||xt,Ye=ne[At]=ne[At]||{};this.calculateGlyphDependencies(Vt.text,Ye,_t,this.allowVerticalPlacement,Mt)}}}I.get("symbol-placement")==="line"&&(this.features=function(me){const we={},Oe={},Ae=[];let Re=0;function Ue(xt){Ae.push(me[xt]),Re++}function tt(xt,_t,Vt){const Mt=Oe[xt];return delete Oe[xt],Oe[_t]=Mt,Ae[Mt].geometry[0].pop(),Ae[Mt].geometry[0]=Ae[Mt].geometry[0].concat(Vt[0]),Mt}function St(xt,_t,Vt){const Mt=we[_t];return delete we[_t],we[xt]=Mt,Ae[Mt].geometry[0].shift(),Ae[Mt].geometry[0]=Vt[0].concat(Ae[Mt].geometry[0]),Mt}function Jt(xt,_t,Vt){const Mt=Vt?_t[0][_t[0].length-1]:_t[0][0];return`${xt}:${Mt.x}:${Mt.y}`}for(let xt=0;xtxt.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((me,we)=>me.sortKey-we.sortKey)}update(h,v,b){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(h,v,this.layers,b),this.icon.programConfigurations.updatePaintArrays(h,v,this.layers,b))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(h){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(h),this.iconCollisionBox.upload(h)),this.text.upload(h,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(h,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(h,v){const b=this.lineVertexArray.length;if(h.segment!==void 0){let E=h.dist(v[h.segment+1]),I=h.dist(v[h.segment]);const k={};for(let R=h.segment+1;R=0;R--)k[R]={x:v[R].x,y:v[R].y,tileUnitDistanceFromAnchor:I},R>0&&(I+=v[R-1].dist(v[R]));for(let R=0;R0}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(h,v){const b=h.placedSymbolArray.get(v),E=b.vertexStartIndex+4*b.numGlyphs;for(let I=b.vertexStartIndex;IE[R]-E[z]||I[z]-I[R]),k}addToSortKeyRanges(h,v){const b=this.sortKeyRanges[this.sortKeyRanges.length-1];b&&b.sortKey===v?b.symbolInstanceEnd=h+1:this.sortKeyRanges.push({sortKey:v,symbolInstanceStart:h,symbolInstanceEnd:h+1})}sortFeatures(h){if(this.sortFeaturesByY&&this.sortedAngle!==h&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(h),this.sortedAngle=h,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const v of this.symbolInstanceIndexes){const b=this.symbolInstances.get(v);this.featureSortOrder.push(b.featureIndex),[b.rightJustifiedTextSymbolIndex,b.centerJustifiedTextSymbolIndex,b.leftJustifiedTextSymbolIndex].forEach((E,I,k)=>{E>=0&&k.indexOf(E)===I&&this.addIndicesForPlacedSymbol(this.text,E)}),b.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,b.verticalPlacedTextSymbolIndex),b.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,b.placedIconSymbolIndex),b.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,b.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let Z6,j6;Dt("SymbolBucket",Yf,{omit:["layers","collisionBoxArray","features","compareText"]}),Yf.MAX_GLYPHS=65535,Yf.addDynamicAttributes=sD;var cD={get paint(){return j6=j6||new M({"icon-opacity":new Qt(Le.paint_symbol["icon-opacity"]),"icon-color":new Qt(Le.paint_symbol["icon-color"]),"icon-halo-color":new Qt(Le.paint_symbol["icon-halo-color"]),"icon-halo-width":new Qt(Le.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Qt(Le.paint_symbol["icon-halo-blur"]),"icon-translate":new Pt(Le.paint_symbol["icon-translate"]),"icon-translate-anchor":new Pt(Le.paint_symbol["icon-translate-anchor"]),"text-opacity":new Qt(Le.paint_symbol["text-opacity"]),"text-color":new Qt(Le.paint_symbol["text-color"],{runtimeType:fi,getOverride:p=>p.textColor,hasOverride:p=>!!p.textColor}),"text-halo-color":new Qt(Le.paint_symbol["text-halo-color"]),"text-halo-width":new Qt(Le.paint_symbol["text-halo-width"]),"text-halo-blur":new Qt(Le.paint_symbol["text-halo-blur"]),"text-translate":new Pt(Le.paint_symbol["text-translate"]),"text-translate-anchor":new Pt(Le.paint_symbol["text-translate-anchor"])})},get layout(){return Z6=Z6||new M({"symbol-placement":new Pt(Le.layout_symbol["symbol-placement"]),"symbol-spacing":new Pt(Le.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new Pt(Le.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Qt(Le.layout_symbol["symbol-sort-key"]),"symbol-z-order":new Pt(Le.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new Pt(Le.layout_symbol["icon-allow-overlap"]),"icon-overlap":new Pt(Le.layout_symbol["icon-overlap"]),"icon-ignore-placement":new Pt(Le.layout_symbol["icon-ignore-placement"]),"icon-optional":new Pt(Le.layout_symbol["icon-optional"]),"icon-rotation-alignment":new Pt(Le.layout_symbol["icon-rotation-alignment"]),"icon-size":new Qt(Le.layout_symbol["icon-size"]),"icon-text-fit":new Pt(Le.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new Pt(Le.layout_symbol["icon-text-fit-padding"]),"icon-image":new Qt(Le.layout_symbol["icon-image"]),"icon-rotate":new Qt(Le.layout_symbol["icon-rotate"]),"icon-padding":new Qt(Le.layout_symbol["icon-padding"]),"icon-keep-upright":new Pt(Le.layout_symbol["icon-keep-upright"]),"icon-offset":new Qt(Le.layout_symbol["icon-offset"]),"icon-anchor":new Qt(Le.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new Pt(Le.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new Pt(Le.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new Pt(Le.layout_symbol["text-rotation-alignment"]),"text-field":new Qt(Le.layout_symbol["text-field"]),"text-font":new Qt(Le.layout_symbol["text-font"]),"text-size":new Qt(Le.layout_symbol["text-size"]),"text-max-width":new Qt(Le.layout_symbol["text-max-width"]),"text-line-height":new Pt(Le.layout_symbol["text-line-height"]),"text-letter-spacing":new Qt(Le.layout_symbol["text-letter-spacing"]),"text-justify":new Qt(Le.layout_symbol["text-justify"]),"text-radial-offset":new Qt(Le.layout_symbol["text-radial-offset"]),"text-variable-anchor":new Pt(Le.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new Qt(Le.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new Qt(Le.layout_symbol["text-anchor"]),"text-max-angle":new Pt(Le.layout_symbol["text-max-angle"]),"text-writing-mode":new Pt(Le.layout_symbol["text-writing-mode"]),"text-rotate":new Qt(Le.layout_symbol["text-rotate"]),"text-padding":new Pt(Le.layout_symbol["text-padding"]),"text-keep-upright":new Pt(Le.layout_symbol["text-keep-upright"]),"text-transform":new Qt(Le.layout_symbol["text-transform"]),"text-offset":new Qt(Le.layout_symbol["text-offset"]),"text-allow-overlap":new Pt(Le.layout_symbol["text-allow-overlap"]),"text-overlap":new Pt(Le.layout_symbol["text-overlap"]),"text-ignore-placement":new Pt(Le.layout_symbol["text-ignore-placement"]),"text-optional":new Pt(Le.layout_symbol["text-optional"])})}};class X6{constructor(h){if(h.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=h.property.overrides?h.property.overrides.runtimeType:sa,this.defaultValue=h}evaluate(h){if(h.formattedSection){const v=this.defaultValue.property.overrides;if(v&&v.hasOverride(h.formattedSection))return v.getOverride(h.formattedSection)}return h.feature&&h.featureState?this.defaultValue.evaluate(h.feature,h.featureState):this.defaultValue.property.specification.default}eachChild(h){this.defaultValue.isConstant()||h(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Dt("FormatSectionOverride",X6,{omit:["defaultValue"]});class Qb extends y{constructor(h){super(h,cD)}recalculate(h,v){if(super.recalculate(h,v),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")==="map"?"map":"viewport"),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){const b=this.layout.get("text-writing-mode");if(b){const E=[];for(const I of b)E.indexOf(I)<0&&E.push(I);this.layout._values["text-writing-mode"]=E}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(h,v,b,E){const I=this.layout.get(h).evaluate(v,{},b,E),k=this._unevaluatedLayout._values[h];return k.isDataDriven()||Sf(k.value)||!I?I:function(R,z){return z.replace(/{([^{}]+)}/g,(U,W)=>R&&W in R?String(R[W]):"")}(v.properties,I)}createBucket(h){return new Yf(h)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const h of cD.paint.overridableProperties){if(!Qb.hasPaintOverride(this.layout,h))continue;const v=this.paint.get(h),b=new X6(v),E=new wf(b,v.property.specification);let I=null;I=v.value.kind==="constant"||v.value.kind==="source"?new xu("source",E):new wu("composite",E,v.value.zoomStops),this.paint._values[h]=new Io(v.property,I,v.parameters)}}_handleOverridablePaintPropertyUpdate(h,v,b){return!(!this.layout||v.isDataDriven()||b.isDataDriven())&&Qb.hasPaintOverride(this.layout,h)}static hasPaintOverride(h,v){const b=h.get("text-field"),E=cD.paint.properties[v];let I=!1;const k=R=>{for(const z of R)if(E.overrides&&E.overrides.hasOverride(z))return void(I=!0)};if(b.value.kind==="constant"&&b.value.value instanceof ca)k(b.value.value.sections);else if(b.value.kind==="source"){const R=U=>{I||(U instanceof Wa&&Vn(U.value)===Br?k(U.value.sections):U instanceof ff?k(U.sections):U.eachChild(R))},z=b.value;z._styleExpression&&R(z._styleExpression.expression)}return I}}let Y6;var A_e={get paint(){return Y6=Y6||new M({"background-color":new Pt(Le.paint_background["background-color"]),"background-pattern":new Of(Le.paint_background["background-pattern"]),"background-opacity":new Pt(Le.paint_background["background-opacity"])})}};class D_e extends y{constructor(h){super(h,A_e)}}let K6;var M_e={get paint(){return K6=K6||new M({"raster-opacity":new Pt(Le.paint_raster["raster-opacity"]),"raster-hue-rotate":new Pt(Le.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new Pt(Le.paint_raster["raster-brightness-min"]),"raster-brightness-max":new Pt(Le.paint_raster["raster-brightness-max"]),"raster-saturation":new Pt(Le.paint_raster["raster-saturation"]),"raster-contrast":new Pt(Le.paint_raster["raster-contrast"]),"raster-resampling":new Pt(Le.paint_raster["raster-resampling"]),"raster-fade-duration":new Pt(Le.paint_raster["raster-fade-duration"])})}};class I_e extends y{constructor(h){super(h,M_e)}}class k_e extends y{constructor(h){super(h,{}),this.onAdd=v=>{this.implementation.onAdd&&this.implementation.onAdd(v,v.painter.context.gl)},this.onRemove=v=>{this.implementation.onRemove&&this.implementation.onRemove(v,v.painter.context.gl)},this.implementation=h}is3D(){return this.implementation.renderingMode==="3d"}hasOffscreenPass(){return this.implementation.prerender!==void 0}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}class L_e{constructor(h){this._methodToThrottle=h,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=()=>{}}}const hD=63710088e-1;class Vu{constructor(h,v){if(isNaN(h)||isNaN(v))throw new Error(`Invalid LngLat object: (${h}, ${v})`);if(this.lng=+h,this.lat=+v,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Vu(F(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(h){const v=Math.PI/180,b=this.lat*v,E=h.lat*v,I=Math.sin(b)*Math.sin(E)+Math.cos(b)*Math.cos(E)*Math.cos((h.lng-this.lng)*v);return hD*Math.acos(Math.min(I,1))}static convert(h){if(h instanceof Vu)return h;if(Array.isArray(h)&&(h.length===2||h.length===3))return new Vu(Number(h[0]),Number(h[1]));if(!Array.isArray(h)&&typeof h=="object"&&h!==null)return new Vu(Number("lng"in h?h.lng:h.lon),Number(h.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]")}}const J6=2*Math.PI*hD;function Q6(p){return J6*Math.cos(p*Math.PI/180)}function eG(p){return(180+p)/360}function tG(p){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+p*Math.PI/360)))/360}function rG(p,h){return p/Q6(h)}function dD(p){return 360/Math.PI*Math.atan(Math.exp((180-360*p)*Math.PI/180))-90}class pm{constructor(h,v,b=0){this.x=+h,this.y=+v,this.z=+b}static fromLngLat(h,v=0){const b=Vu.convert(h);return new pm(eG(b.lng),tG(b.lat),rG(v,b.lat))}toLngLat(){return new Vu(360*this.x-180,dD(this.y))}toAltitude(){return this.z*Q6(dD(this.y))}meterInMercatorCoordinateUnits(){return 1/J6*(h=dD(this.y),1/Math.cos(h*Math.PI/180));var h}}function nG(p,h,v){var b=2*Math.PI*6378137/256/Math.pow(2,v);return[p*b-2*Math.PI*6378137/2,h*b-2*Math.PI*6378137/2]}class fD{constructor(h,v,b){if(!function(E,I,k){return!(E<0||E>25||k<0||k>=Math.pow(2,E)||I<0||I>=Math.pow(2,E))}(h,v,b))throw new Error(`x=${v}, y=${b}, z=${h} outside of bounds. 0<=x<${Math.pow(2,h)}, 0<=y<${Math.pow(2,h)} 0<=z<=25 `);this.z=h,this.x=v,this.y=b,this.key=gm(0,h,h,v,b)}equals(h){return this.z===h.z&&this.x===h.x&&this.y===h.y}url(h,v,b){const E=(k=this.y,R=this.z,z=nG(256*(I=this.x),256*(k=Math.pow(2,R)-k-1),R),U=nG(256*(I+1),256*(k+1),R),z[0]+","+z[1]+","+U[0]+","+U[1]);var I,k,R,z,U;const W=function(X,ee,ne){let oe,ce="";for(let me=X;me>0;me--)oe=1<1?"@2x":"").replace(/{quadkey}/g,W).replace(/{bbox-epsg-3857}/g,E)}isChildOf(h){const v=this.z-h.z;return v>0&&h.x===this.x>>v&&h.y===this.y>>v}getTilePoint(h){const v=Math.pow(2,this.z);return new f((h.x*v-this.x)*Fn,(h.y*v-this.y)*Fn)}toString(){return`${this.z}/${this.x}/${this.y}`}}class iG{constructor(h,v){this.wrap=h,this.canonical=v,this.key=gm(h,v.z,v.z,v.x,v.y)}}class Qa{constructor(h,v,b,E,I){if(h= z; overscaledZ = ${h}; z = ${b}`);this.overscaledZ=h,this.wrap=v,this.canonical=new fD(b,+E,+I),this.key=gm(v,h,b,E,I)}clone(){return new Qa(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(h){return this.overscaledZ===h.overscaledZ&&this.wrap===h.wrap&&this.canonical.equals(h.canonical)}scaledTo(h){if(h>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${h}; overscaledZ = ${this.overscaledZ}`);const v=this.canonical.z-h;return h>this.canonical.z?new Qa(h,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new Qa(h,this.wrap,h,this.canonical.x>>v,this.canonical.y>>v)}calculateScaledKey(h,v){if(h>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${h}; overscaledZ = ${this.overscaledZ}`);const b=this.canonical.z-h;return h>this.canonical.z?gm(this.wrap*+v,h,this.canonical.z,this.canonical.x,this.canonical.y):gm(this.wrap*+v,h,h,this.canonical.x>>b,this.canonical.y>>b)}isChildOf(h){if(h.wrap!==this.wrap)return!1;const v=this.canonical.z-h.canonical.z;return h.overscaledZ===0||h.overscaledZ>v&&h.canonical.y===this.canonical.y>>v}children(h){if(this.overscaledZ>=h)return[new Qa(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const v=this.canonical.z+1,b=2*this.canonical.x,E=2*this.canonical.y;return[new Qa(v,this.wrap,v,b,E),new Qa(v,this.wrap,v,b+1,E),new Qa(v,this.wrap,v,b,E+1),new Qa(v,this.wrap,v,b+1,E+1)]}isLessThan(h){return this.wraph.wrap)&&(this.overscaledZh.overscaledZ)&&(this.canonical.xh.canonical.x)&&this.canonical.ythis.max&&(this.max=X),X=this.dim+1||v<-1||v>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(v+1)*this.stride+(h+1)}unpack(h,v,b){return h*this.redFactor+v*this.greenFactor+b*this.blueFactor-this.baseShift}getPixels(){return new Ja({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(h,v,b){if(this.dim!==h.dim)throw new Error("dem dimension mismatch");let E=v*this.dim,I=v*this.dim+this.dim,k=b*this.dim,R=b*this.dim+this.dim;switch(v){case-1:E=I-1;break;case 1:I=E+1}switch(b){case-1:k=R-1;break;case 1:R=k+1}const z=-v*this.dim,U=-b*this.dim;for(let W=k;W=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${h} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[h]}}class sG{constructor(h,v,b,E,I){this.type="Feature",this._vectorTileFeature=h,h._z=v,h._x=b,h._y=E,this.properties=h.properties,this.id=I}get geometry(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(h){this._geometry=h}toJSON(){const h={geometry:this.geometry};for(const v in this)v!=="_geometry"&&v!=="_vectorTileFeature"&&(h[v]=this[v]);return h}}class lG{constructor(h,v){this.tileID=h,this.x=h.canonical.x,this.y=h.canonical.y,this.z=h.canonical.z,this.grid=new Eu(Fn,16,0),this.grid3D=new Eu(Fn,16,0),this.featureIndexArray=new Mi,this.promoteId=v}insert(h,v,b,E,I,k){const R=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(b,E,I);const z=k?this.grid3D:this.grid;for(let U=0;U=0&&X[3]>=0&&z.insert(R,X[0],X[1],X[2],X[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Ou.VectorTile(new tD(this.rawTileData)).layers,this.sourceLayerCoder=new oG(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(h,v,b,E){this.loadVTLayers();const I=h.params||{},k=Fn/h.tileSize/h.scale,R=Rv(I.filter),z=h.queryGeometry,U=h.queryPadding*k,W=cG(z),X=this.grid.query(W.minX-U,W.minY-U,W.maxX+U,W.maxY+U),ee=cG(h.cameraQueryGeometry),ne=this.grid3D.query(ee.minX-U,ee.minY-U,ee.maxX+U,ee.maxY+U,(me,we,Oe,Ae)=>function(Re,Ue,tt,St,Jt){for(const _t of Re)if(Ue<=_t.x&&tt<=_t.y&&St>=_t.x&&Jt>=_t.y)return!0;const xt=[new f(Ue,tt),new f(Ue,Jt),new f(St,Jt),new f(St,tt)];if(Re.length>2){for(const _t of xt)if(Uf(Re,_t))return!0}for(let _t=0;_t(Ae||(Ae=Rh(Re)),Ue.queryIntersectsFeature(z,Re,tt,Ae,this.z,h.transform,k,h.pixelPosMatrix)))}return oe}loadMatchingFeature(h,v,b,E,I,k,R,z,U,W,X){const ee=this.bucketLayerIDs[v];if(k&&!function(me,we){for(let Oe=0;Oe=0)return!0;return!1}(k,ee))return;const ne=this.sourceLayerCoder.decode(b),oe=this.vtLayers[ne].feature(E);if(I.needGeometry){const me=Nh(oe,!0);if(!I.filter(new fn(this.tileID.overscaledZ),me,this.tileID.canonical))return}else if(!I.filter(new fn(this.tileID.overscaledZ),oe))return;const ce=this.getId(oe,ne);for(let me=0;me{const R=h instanceof Ih?h.get(k):null;return R&&R.evaluate?R.evaluate(v,b,E):R})}function cG(p){let h=1/0,v=1/0,b=-1/0,E=-1/0;for(const I of p)h=Math.min(h,I.x),v=Math.min(v,I.y),b=Math.max(b,I.x),E=Math.max(E,I.y);return{minX:h,minY:v,maxX:b,maxY:E}}function P_e(p,h){return h-p}function hG(p,h,v,b,E){const I=[];for(let k=0;k=b&&X.x>=b||(W.x>=b?W=new f(b,W.y+(b-W.x)/(X.x-W.x)*(X.y-W.y))._round():X.x>=b&&(X=new f(b,W.y+(b-W.x)/(X.x-W.x)*(X.y-W.y))._round()),W.y>=E&&X.y>=E||(W.y>=E?W=new f(W.x+(E-W.y)/(X.y-W.y)*(X.x-W.x),E)._round():X.y>=E&&(X=new f(W.x+(E-W.y)/(X.y-W.y)*(X.x-W.x),E)._round()),z&&W.equals(z[z.length-1])||(z=[W],I.push(z)),z.push(X)))))}}return I}Dt("FeatureIndex",lG,{omit:["rawTileData","sourceLayerCoder"]});class Fu extends f{constructor(h,v,b,E){super(h,v),this.angle=b,E!==void 0&&(this.segment=E)}clone(){return new Fu(this.x,this.y,this.angle,this.segment)}}function dG(p,h,v,b,E){if(h.segment===void 0||v===0)return!0;let I=h,k=h.segment+1,R=0;for(;R>-v/2;){if(k--,k<0)return!1;R-=p[k].dist(I),I=p[k]}R+=p[k].dist(p[k+1]),k++;const z=[];let U=0;for(;Rb;)U-=z.shift().angleDelta;if(U>E)return!1;k++,R+=W.dist(X)}return!0}function fG(p){let h=0;for(let v=0;vU){const oe=(U-z)/ne,ce=Fi.number(X.x,ee.x,oe),me=Fi.number(X.y,ee.y,oe),we=new Fu(ce,me,ee.angleTo(X),W);return we._round(),!k||dG(p,we,R,k,h)?we:void 0}z+=ne}}function N_e(p,h,v,b,E,I,k,R,z){const U=pG(b,I,k),W=gG(b,E),X=W*k,ee=p[0].x===0||p[0].x===z||p[0].y===0||p[0].y===z;return h-X=0&&Re=0&&Ue=0&&ee+U<=W){const tt=new Fu(Re,Ue,Oe,oe);tt._round(),b&&!dG(p,tt,I,b,E)||ne.push(tt)}}X+=we}return R||ne.length||k||(ne=vG(p,X/2,v,b,E,I,k,!0,z)),ne}Dt("Anchor",Fu);const Kf=va;function mG(p,h,v,b){const E=[],I=p.image,k=I.pixelRatio,R=I.paddedRect.w-2*Kf,z=I.paddedRect.h-2*Kf;let U={x1:p.left,y1:p.top,x2:p.right,y2:p.bottom};const W=I.stretchX||[[0,R]],X=I.stretchY||[[0,z]],ee=(Ye,Gt)=>Ye+Gt[1]-Gt[0],ne=W.reduce(ee,0),oe=X.reduce(ee,0),ce=R-ne,me=z-oe;let we=0,Oe=ne,Ae=0,Re=oe,Ue=0,tt=ce,St=0,Jt=me;if(I.content&&b){const Ye=I.content,Gt=Ye[2]-Ye[0],zt=Ye[3]-Ye[1];(I.textFitWidth||I.textFitHeight)&&(U=H6(p)),we=ex(W,0,Ye[0]),Ae=ex(X,0,Ye[1]),Oe=ex(W,Ye[0],Ye[2]),Re=ex(X,Ye[1],Ye[3]),Ue=Ye[0]-we,St=Ye[1]-Ae,tt=Gt-Oe,Jt=zt-Re}const xt=U.x1,_t=U.y1,Vt=U.x2-xt,Mt=U.y2-_t,At=(Ye,Gt,zt,or)=>{const nn=tx(Ye.stretch-we,Oe,Vt,xt),tn=rx(Ye.fixed-Ue,tt,Ye.stretch,ne),Jn=tx(Gt.stretch-Ae,Re,Mt,_t),Lo=rx(Gt.fixed-St,Jt,Gt.stretch,oe),bi=tx(zt.stretch-we,Oe,Vt,xt),Qn=rx(zt.fixed-Ue,tt,zt.stretch,ne),Hi=tx(or.stretch-Ae,Re,Mt,_t),Wi=rx(or.fixed-St,Jt,or.stretch,oe),qi=new f(nn,Jn),kn=new f(bi,Jn),ei=new f(bi,Hi),ki=new f(nn,Hi),xi=new f(tn/k,Lo/k),Zi=new f(Qn/k,Wi/k),wi=h*Math.PI/180;if(wi){const Hr=Math.sin(wi),cn=Math.cos(wi),mn=[cn,-Hr,Hr,cn];qi._matMult(mn),kn._matMult(mn),ki._matMult(mn),ei._matMult(mn)}const eo=Ye.stretch+Ye.fixed,ma=Gt.stretch+Gt.fixed;return{tl:qi,tr:kn,bl:ki,br:ei,tex:{x:I.paddedRect.x+Kf+eo,y:I.paddedRect.y+Kf+ma,w:zt.stretch+zt.fixed-eo,h:or.stretch+or.fixed-ma},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:xi,pixelOffsetBR:Zi,minFontScaleX:tt/k/Vt,minFontScaleY:Jt/k/Mt,isSDF:v}};if(b&&(I.stretchX||I.stretchY)){const Ye=yG(W,ce,ne),Gt=yG(X,me,oe);for(let zt=0;zt0&&(ce=Math.max(10,ce),this.circleDiameter=ce)}else{const ee=!((X=k.image)===null||X===void 0)&&X.content&&(k.image.textFitWidth||k.image.textFitHeight)?H6(k):{x1:k.left,y1:k.top,x2:k.right,y2:k.bottom};ee.y1=ee.y1*R-z[0],ee.y2=ee.y2*R+z[2],ee.x1=ee.x1*R-z[3],ee.x2=ee.x2*R+z[1];const ne=k.collisionPadding;if(ne&&(ee.x1-=ne[0]*R,ee.y1-=ne[1]*R,ee.x2+=ne[2]*R,ee.y2+=ne[3]*R),W){const oe=new f(ee.x1,ee.y1),ce=new f(ee.x2,ee.y1),me=new f(ee.x1,ee.y2),we=new f(ee.x2,ee.y2),Oe=W*Math.PI/180;oe._rotate(Oe),ce._rotate(Oe),me._rotate(Oe),we._rotate(Oe),ee.x1=Math.min(oe.x,ce.x,me.x,we.x),ee.x2=Math.max(oe.x,ce.x,me.x,we.x),ee.y1=Math.min(oe.y,ce.y,me.y,we.y),ee.y2=Math.max(oe.y,ce.y,me.y,we.y)}h.emplaceBack(v.x,v.y,ee.x1,ee.y1,ee.x2,ee.y2,b,E,I)}this.boxEndIndex=h.length}}class O_e{constructor(h=[],v=(b,E)=>bE?1:0){if(this.data=h,this.length=this.data.length,this.compare=v,this.length>0)for(let b=(this.length>>1)-1;b>=0;b--)this._down(b)}push(h){this.data.push(h),this._up(this.length++)}pop(){if(this.length===0)return;const h=this.data[0],v=this.data.pop();return--this.length>0&&(this.data[0]=v,this._down(0)),h}peek(){return this.data[0]}_up(h){const{data:v,compare:b}=this,E=v[h];for(;h>0;){const I=h-1>>1,k=v[I];if(b(E,k)>=0)break;v[h]=k,h=I}v[h]=E}_down(h){const{data:v,compare:b}=this,E=this.length>>1,I=v[h];for(;h=0)break;v[h]=v[k],h=k}v[h]=I}}function z_e(p,h=1,v=!1){let b=1/0,E=1/0,I=-1/0,k=-1/0;const R=p[0];for(let ne=0;neI)&&(I=oe.x),(!ne||oe.y>k)&&(k=oe.y)}const z=Math.min(I-b,k-E);let U=z/2;const W=new O_e([],B_e);if(z===0)return new f(b,E);for(let ne=b;neX.d||!X.d)&&(X=ne,v&&console.log("found best %d after %d probes",Math.round(1e4*ne.d)/1e4,ee)),ne.max-X.d<=h||(U=ne.h/2,W.push(new Jf(ne.p.x-U,ne.p.y-U,U,p)),W.push(new Jf(ne.p.x+U,ne.p.y-U,U,p)),W.push(new Jf(ne.p.x-U,ne.p.y+U,U,p)),W.push(new Jf(ne.p.x+U,ne.p.y+U,U,p)),ee+=4)}return v&&(console.log(`num probes: ${ee}`),console.log(`best distance: ${X.d}`)),X.p}function B_e(p,h){return h.max-p.max}function Jf(p,h,v,b){this.p=new f(p,h),this.h=v,this.d=function(E,I){let k=!1,R=1/0;for(let z=0;zE.y!=oe.y>E.y&&E.x<(oe.x-ne.x)*(E.y-ne.y)/(oe.y-ne.y)+ne.x&&(k=!k),R=Math.min(R,t6(E,ne,oe))}}return(k?1:-1)*Math.sqrt(R)}(this.p,b),this.max=this.d+this.h*Math.SQRT2}var _i;o.aq=void 0,(_i=o.aq||(o.aq={}))[_i.center=1]="center",_i[_i.left=2]="left",_i[_i.right=3]="right",_i[_i.top=4]="top",_i[_i.bottom=5]="bottom",_i[_i["top-left"]=6]="top-left",_i[_i["top-right"]=7]="top-right",_i[_i["bottom-left"]=8]="bottom-left",_i[_i["bottom-right"]=9]="bottom-right";const $u=7,pD=Number.POSITIVE_INFINITY;function _G(p,h){return h[1]!==pD?function(v,b,E){let I=0,k=0;switch(b=Math.abs(b),E=Math.abs(E),v){case"top-right":case"top-left":case"top":k=E-$u;break;case"bottom-right":case"bottom-left":case"bottom":k=-E+$u}switch(v){case"top-right":case"bottom-right":case"right":I=-b;break;case"top-left":case"bottom-left":case"left":I=b}return[I,k]}(p,h[0],h[1]):function(v,b){let E=0,I=0;b<0&&(b=0);const k=b/Math.SQRT2;switch(v){case"top-right":case"top-left":I=k-$u;break;case"bottom-right":case"bottom-left":I=-k+$u;break;case"bottom":I=-b+$u;break;case"top":I=b-$u}switch(v){case"top-right":case"bottom-right":E=-k;break;case"top-left":case"bottom-left":E=k;break;case"left":E=b;break;case"right":E=-b}return[E,I]}(p,h[0])}function bG(p,h,v){var b;const E=p.layout,I=(b=E.get("text-variable-anchor-offset"))===null||b===void 0?void 0:b.evaluate(h,{},v);if(I){const R=I.values,z=[];for(let U=0;Uee*Zn);W.startsWith("top")?X[1]-=$u:W.startsWith("bottom")&&(X[1]+=$u),z[U+1]=X}return new Ma(z)}const k=E.get("text-variable-anchor");if(k){let R;R=p._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[E.get("text-radial-offset").evaluate(h,{},v)*Zn,pD]:E.get("text-offset").evaluate(h,{},v).map(U=>U*Zn);const z=[];for(const U of k)z.push(U,_G(U,R));return new Ma(z)}return null}function gD(p){switch(p){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function V_e(p,h,v,b,E,I,k,R,z,U,W){let X=I.textMaxSize.evaluate(h,{});X===void 0&&(X=k);const ee=p.layers[0].layout,ne=ee.get("icon-offset").evaluate(h,{},W),oe=wG(v.horizontal),ce=k/24,me=p.tilePixelRatio*ce,we=p.tilePixelRatio*X/24,Oe=p.tilePixelRatio*R,Ae=p.tilePixelRatio*ee.get("symbol-spacing"),Re=ee.get("text-padding")*p.tilePixelRatio,Ue=function(Ye,Gt,zt,or=1){const nn=Ye.get("icon-padding").evaluate(Gt,{},zt),tn=nn&&nn.values;return[tn[0]*or,tn[1]*or,tn[2]*or,tn[3]*or]}(ee,h,W,p.tilePixelRatio),tt=ee.get("text-max-angle")/180*Math.PI,St=ee.get("text-rotation-alignment")!=="viewport"&&ee.get("symbol-placement")!=="point",Jt=ee.get("icon-rotation-alignment")==="map"&&ee.get("symbol-placement")!=="point",xt=ee.get("symbol-placement"),_t=Ae/2,Vt=ee.get("icon-text-fit");let Mt;b&&Vt!=="none"&&(p.allowVerticalPlacement&&v.vertical&&(Mt=W6(b,v.vertical,Vt,ee.get("icon-text-fit-padding"),ne,ce)),oe&&(b=W6(b,oe,Vt,ee.get("icon-text-fit-padding"),ne,ce)));const At=(Ye,Gt)=>{Gt.x<0||Gt.x>=Fn||Gt.y<0||Gt.y>=Fn||function(zt,or,nn,tn,Jn,Lo,bi,Qn,Hi,Wi,qi,kn,ei,ki,xi,Zi,wi,eo,ma,Hr,cn,mn,Oa,Cn,Qf){const Ls=zt.addToLineVertexArray(or,nn);let Ps,Po,to,ci,xl=0,ym=0,CG=0,AG=0,SD=-1,TD=-1;const wl={};let DG=Vf("");if(zt.allowVerticalPlacement&&tn.vertical){const Li=Qn.layout.get("text-rotate").evaluate(cn,{},Cn)+90;to=new nx(Hi,or,Wi,qi,kn,tn.vertical,ei,ki,xi,Li),bi&&(ci=new nx(Hi,or,Wi,qi,kn,bi,wi,eo,xi,Li))}if(Jn){const Li=Qn.layout.get("icon-rotate").evaluate(cn,{}),ro=Qn.layout.get("icon-text-fit")!=="none",zh=mG(Jn,Li,Oa,ro),ts=bi?mG(bi,Li,Oa,ro):void 0;Po=new nx(Hi,or,Wi,qi,kn,Jn,wi,eo,!1,Li),xl=4*zh.length;const Bh=zt.iconSizeData;let Rs=null;Bh.kind==="source"?(Rs=[ks*Qn.layout.get("icon-size").evaluate(cn,{})],Rs[0]>Bu&&ae(`${zt.layerIds[0]}: Value for "icon-size" is >= ${fm}. Reduce your "icon-size".`)):Bh.kind==="composite"&&(Rs=[ks*mn.compositeIconSizes[0].evaluate(cn,{},Cn),ks*mn.compositeIconSizes[1].evaluate(cn,{},Cn)],(Rs[0]>Bu||Rs[1]>Bu)&&ae(`${zt.layerIds[0]}: Value for "icon-size" is >= ${fm}. Reduce your "icon-size".`)),zt.addSymbols(zt.icon,zh,Rs,Hr,ma,cn,o.ah.none,or,Ls.lineStartIndex,Ls.lineLength,-1,Cn),SD=zt.icon.placedSymbolArray.length-1,ts&&(ym=4*ts.length,zt.addSymbols(zt.icon,ts,Rs,Hr,ma,cn,o.ah.vertical,or,Ls.lineStartIndex,Ls.lineLength,-1,Cn),TD=zt.icon.placedSymbolArray.length-1)}const MG=Object.keys(tn.horizontal);for(const Li of MG){const ro=tn.horizontal[Li];if(!Ps){DG=Vf(ro.text);const ts=Qn.layout.get("text-rotate").evaluate(cn,{},Cn);Ps=new nx(Hi,or,Wi,qi,kn,ro,ei,ki,xi,ts)}const zh=ro.positionedLines.length===1;if(CG+=xG(zt,or,ro,Lo,Qn,xi,cn,Zi,Ls,tn.vertical?o.ah.horizontal:o.ah.horizontalOnly,zh?MG:[Li],wl,SD,mn,Cn),zh)break}tn.vertical&&(AG+=xG(zt,or,tn.vertical,Lo,Qn,xi,cn,Zi,Ls,o.ah.vertical,["vertical"],wl,TD,mn,Cn));const G_e=Ps?Ps.boxStartIndex:zt.collisionBoxArray.length,U_e=Ps?Ps.boxEndIndex:zt.collisionBoxArray.length,H_e=to?to.boxStartIndex:zt.collisionBoxArray.length,W_e=to?to.boxEndIndex:zt.collisionBoxArray.length,q_e=Po?Po.boxStartIndex:zt.collisionBoxArray.length,Z_e=Po?Po.boxEndIndex:zt.collisionBoxArray.length,j_e=ci?ci.boxStartIndex:zt.collisionBoxArray.length,X_e=ci?ci.boxEndIndex:zt.collisionBoxArray.length;let es=-1;const ax=(Li,ro)=>Li&&Li.circleDiameter?Math.max(Li.circleDiameter,ro):ro;es=ax(Ps,es),es=ax(to,es),es=ax(Po,es),es=ax(ci,es);const IG=es>-1?1:0;IG&&(es*=Qf/Zn),zt.glyphOffsetArray.length>=Yf.MAX_GLYPHS&&ae("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),cn.sortKey!==void 0&&zt.addToSortKeyRanges(zt.symbolInstances.length,cn.sortKey);const Y_e=bG(Qn,cn,Cn),[K_e,J_e]=function(Li,ro){const zh=Li.length,ts=ro==null?void 0:ro.values;if((ts==null?void 0:ts.length)>0)for(let Bh=0;Bh=0?wl.right:-1,wl.center>=0?wl.center:-1,wl.left>=0?wl.left:-1,wl.vertical||-1,SD,TD,DG,G_e,U_e,H_e,W_e,q_e,Z_e,j_e,X_e,Wi,CG,AG,xl,ym,IG,0,ei,es,K_e,J_e)}(p,Gt,Ye,v,b,E,Mt,p.layers[0],p.collisionBoxArray,h.index,h.sourceLayerIndex,p.index,me,[Re,Re,Re,Re],St,z,Oe,Ue,Jt,ne,h,I,U,W,k)};if(xt==="line")for(const Ye of hG(h.geometry,0,0,Fn,Fn)){const Gt=N_e(Ye,Ae,tt,v.vertical||oe,b,24,we,p.overscaling,Fn);for(const zt of Gt)oe&&F_e(p,oe.text,_t,zt)||At(Ye,zt)}else if(xt==="line-center"){for(const Ye of h.geometry)if(Ye.length>1){const Gt=R_e(Ye,tt,v.vertical||oe,b,24,we);Gt&&At(Ye,Gt)}}else if(h.type==="Polygon")for(const Ye of gf(h.geometry,0)){const Gt=z_e(Ye,16);At(Ye[0],new Fu(Gt.x,Gt.y,0))}else if(h.type==="LineString")for(const Ye of h.geometry)At(Ye,new Fu(Ye[0].x,Ye[0].y,0));else if(h.type==="Point")for(const Ye of h.geometry)for(const Gt of Ye)At([Gt],new Fu(Gt.x,Gt.y,0))}function xG(p,h,v,b,E,I,k,R,z,U,W,X,ee,ne,oe){const ce=function(Oe,Ae,Re,Ue,tt,St,Jt,xt){const _t=Ue.layout.get("text-rotate").evaluate(St,{})*Math.PI/180,Vt=[];for(const Mt of Ae.positionedLines)for(const At of Mt.positionedGlyphs){if(!At.rect)continue;const Ye=At.rect||{};let Gt=z6+1,zt=!0,or=1,nn=0;const tn=(tt||xt)&&At.vertical,Jn=At.metrics.advance*At.scale/2;if(xt&&Ae.verticalizable&&(nn=Mt.lineOffset/2-(At.imageName?-(Zn-At.metrics.width*At.scale)/2:(At.scale-1)*Zn)),At.imageName){const Hr=Jt[At.imageName];zt=Hr.sdf,or=Hr.pixelRatio,Gt=va/or}const Lo=tt?[At.x+Jn,At.y]:[0,0];let bi=tt?[0,0]:[At.x+Jn+Re[0],At.y+Re[1]-nn],Qn=[0,0];tn&&(Qn=bi,bi=[0,0]);const Hi=At.metrics.isDoubleResolution?2:1,Wi=(At.metrics.left-Gt)*At.scale-Jn+bi[0],qi=(-At.metrics.top-Gt)*At.scale+bi[1],kn=Wi+Ye.w/Hi*At.scale/or,ei=qi+Ye.h/Hi*At.scale/or,ki=new f(Wi,qi),xi=new f(kn,qi),Zi=new f(Wi,ei),wi=new f(kn,ei);if(tn){const Hr=new f(-Jn,Jn-hm),cn=-Math.PI/2,mn=Zn/2-Jn,Oa=new f(5-hm-mn,-(At.imageName?mn:0)),Cn=new f(...Qn);ki._rotateAround(cn,Hr)._add(Oa)._add(Cn),xi._rotateAround(cn,Hr)._add(Oa)._add(Cn),Zi._rotateAround(cn,Hr)._add(Oa)._add(Cn),wi._rotateAround(cn,Hr)._add(Oa)._add(Cn)}if(_t){const Hr=Math.sin(_t),cn=Math.cos(_t),mn=[cn,-Hr,Hr,cn];ki._matMult(mn),xi._matMult(mn),Zi._matMult(mn),wi._matMult(mn)}const eo=new f(0,0),ma=new f(0,0);Vt.push({tl:ki,tr:xi,bl:Zi,br:wi,tex:Ye,writingMode:Ae.writingMode,glyphOffset:Lo,sectionIndex:At.sectionIndex,isSDF:zt,pixelOffsetTL:eo,pixelOffsetBR:ma,minFontScaleX:0,minFontScaleY:0})}return Vt}(0,v,R,E,I,k,b,p.allowVerticalPlacement),me=p.textSizeData;let we=null;me.kind==="source"?(we=[ks*E.layout.get("text-size").evaluate(k,{})],we[0]>Bu&&ae(`${p.layerIds[0]}: Value for "text-size" is >= ${fm}. Reduce your "text-size".`)):me.kind==="composite"&&(we=[ks*ne.compositeTextSizes[0].evaluate(k,{},oe),ks*ne.compositeTextSizes[1].evaluate(k,{},oe)],(we[0]>Bu||we[1]>Bu)&&ae(`${p.layerIds[0]}: Value for "text-size" is >= ${fm}. Reduce your "text-size".`)),p.addSymbols(p.text,ce,we,R,I,k,U,h,z.lineStartIndex,z.lineLength,ee,oe);for(const Oe of W)X[Oe]=p.text.placedSymbolArray.length-1;return 4*ce.length}function wG(p){for(const h in p)return p[h];return null}function F_e(p,h,v,b){const E=p.compareText;if(h in E){const I=E[h];for(let k=I.length-1;k>=0;k--)if(b.dist(I[k])>4;if(E!==1)throw new Error(`Got v${E} data when expected v1.`);const I=SG[15&b];if(!I)throw new Error("Unrecognized array type.");const[k]=new Uint16Array(h,2,1),[R]=new Uint32Array(h,4,1);return new vD(R,k,I,h)}constructor(h,v=64,b=Float64Array,E){if(isNaN(h)||h<0)throw new Error(`Unpexpected numItems value: ${h}.`);this.numItems=+h,this.nodeSize=Math.min(Math.max(+v,2),65535),this.ArrayType=b,this.IndexArrayType=h<65536?Uint16Array:Uint32Array;const I=SG.indexOf(this.ArrayType),k=2*h*this.ArrayType.BYTES_PER_ELEMENT,R=h*this.IndexArrayType.BYTES_PER_ELEMENT,z=(8-R%8)%8;if(I<0)throw new Error(`Unexpected typed array class: ${b}.`);E&&E instanceof ArrayBuffer?(this.data=E,this.ids=new this.IndexArrayType(this.data,8,h),this.coords=new this.ArrayType(this.data,8+R+z,2*h),this._pos=2*h,this._finished=!0):(this.data=new ArrayBuffer(8+k+R+z),this.ids=new this.IndexArrayType(this.data,8,h),this.coords=new this.ArrayType(this.data,8+R+z,2*h),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+I]),new Uint16Array(this.data,2,1)[0]=v,new Uint32Array(this.data,4,1)[0]=h)}add(h,v){const b=this._pos>>1;return this.ids[b]=b,this.coords[this._pos++]=h,this.coords[this._pos++]=v,b}finish(){const h=this._pos>>1;if(h!==this.numItems)throw new Error(`Added ${h} items when expected ${this.numItems}.`);return mD(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(h,v,b,E){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:I,coords:k,nodeSize:R}=this,z=[0,I.length-1,0],U=[];for(;z.length;){const W=z.pop()||0,X=z.pop()||0,ee=z.pop()||0;if(X-ee<=R){for(let me=ee;me<=X;me++){const we=k[2*me],Oe=k[2*me+1];we>=h&&we<=b&&Oe>=v&&Oe<=E&&U.push(I[me])}continue}const ne=ee+X>>1,oe=k[2*ne],ce=k[2*ne+1];oe>=h&&oe<=b&&ce>=v&&ce<=E&&U.push(I[ne]),(W===0?h<=oe:v<=ce)&&(z.push(ee),z.push(ne-1),z.push(1-W)),(W===0?b>=oe:E>=ce)&&(z.push(ne+1),z.push(X),z.push(1-W))}return U}within(h,v,b){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:E,coords:I,nodeSize:k}=this,R=[0,E.length-1,0],z=[],U=b*b;for(;R.length;){const W=R.pop()||0,X=R.pop()||0,ee=R.pop()||0;if(X-ee<=k){for(let me=ee;me<=X;me++)EG(I[2*me],I[2*me+1],h,v)<=U&&z.push(E[me]);continue}const ne=ee+X>>1,oe=I[2*ne],ce=I[2*ne+1];EG(oe,ce,h,v)<=U&&z.push(E[ne]),(W===0?h-b<=oe:v-b<=ce)&&(R.push(ee),R.push(ne-1),R.push(1-W)),(W===0?h+b>=oe:v+b>=ce)&&(R.push(ne+1),R.push(X),R.push(1-W))}return z}}function mD(p,h,v,b,E,I){if(E-b<=v)return;const k=b+E>>1;TG(p,h,k,b,E,I),mD(p,h,v,b,k-1,1-I),mD(p,h,v,k+1,E,1-I)}function TG(p,h,v,b,E,I){for(;E>b;){if(E-b>600){const U=E-b+1,W=v-b+1,X=Math.log(U),ee=.5*Math.exp(2*X/3),ne=.5*Math.sqrt(X*ee*(U-ee)/U)*(W-U/2<0?-1:1);TG(p,h,v,Math.max(b,Math.floor(v-W*ee/U+ne)),Math.min(E,Math.floor(v+(U-W)*ee/U+ne)),I)}const k=h[2*v+I];let R=b,z=E;for(vm(p,h,b,v),h[2*E+I]>k&&vm(p,h,b,E);Rk;)z--}h[2*b+I]===k?vm(p,h,b,z):(z++,vm(p,h,z,E)),z<=v&&(b=z+1),v<=z&&(E=z-1)}}function vm(p,h,v,b){yD(p,v,b),yD(h,2*v,2*b),yD(h,2*v+1,2*b+1)}function yD(p,h,v){const b=p[h];p[h]=p[v],p[v]=b}function EG(p,h,v,b){const E=p-v,I=h-b;return E*E+I*I}var _D;o.bg=void 0,(_D=o.bg||(o.bg={})).create="create",_D.load="load",_D.fullLoad="fullLoad";let ix=null,mm=[];const bD=1e3/60,xD="loadTime",wD="fullLoadTime",$_e={mark(p){performance.mark(p)},frame(p){const h=p;ix!=null&&mm.push(h-ix),ix=h},clearMetrics(){ix=null,mm=[],performance.clearMeasures(xD),performance.clearMeasures(wD);for(const p in o.bg)performance.clearMarks(o.bg[p])},getPerformanceMetrics(){performance.measure(xD,o.bg.create,o.bg.load),performance.measure(wD,o.bg.create,o.bg.fullLoad);const p=performance.getEntriesByName(xD)[0].duration,h=performance.getEntriesByName(wD)[0].duration,v=mm.length,b=1/(mm.reduce((I,k)=>I+k,0)/v/1e3),E=mm.filter(I=>I>bD).reduce((I,k)=>I+(k-bD)/bD,0);return{loadTime:p,fullLoadTime:h,fps:b,percentDroppedFrames:E/(v+E)*100,totalFrames:v}}};o.$=class extends K{},o.A=Hf,o.B=IA,o.C=function(p){if(le==null){const h=p.navigator?p.navigator.userAgent:null;le=!!p.safari||!(!h||!(/\b(iPad|iPhone|iPod)\b/.test(h)||h.match("Safari")&&!h.match("Chrome")))}return le},o.D=Pt,o.E=Kt,o.F=class{constructor(p,h){this.target=p,this.mapId=h,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new L_e(()=>this.process()),this.subscription=function(v,b,E,I){return v.addEventListener(b,E,!1),{unsubscribe:()=>{v.removeEventListener(b,E,!1)}}}(this.target,"message",v=>this.receive(v)),this.globalScope=fe(self)?p:window}registerMessageHandler(p,h){this.messageHandlers[p]=h}sendAsync(p,h){return new Promise((v,b)=>{const E=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[E]={resolve:v,reject:b},h&&h.signal.addEventListener("abort",()=>{delete this.resolveRejects[E];const R={id:E,type:"",origin:location.origin,targetMapId:p.targetMapId,sourceMapId:this.mapId};this.target.postMessage(R)},{once:!0});const I=[],k=Object.assign(Object.assign({},p),{id:E,sourceMapId:this.mapId,origin:location.origin,data:Cu(p.data,I)});this.target.postMessage(k,{transfer:I})})}receive(p){const h=p.data,v=h.id;if(!(h.origin!=="file://"&&location.origin!=="file://"&&h.origin!=="resource://android"&&location.origin!=="resource://android"&&h.origin!==location.origin||h.targetMapId&&this.mapId!==h.targetMapId)){if(h.type===""){delete this.tasks[v];const b=this.abortControllers[v];return delete this.abortControllers[v],void(b&&b.abort())}if(fe(self)||h.mustQueue)return this.tasks[v]=h,this.taskQueue.push(v),void this.invoker.trigger();this.processTask(v,h)}}process(){if(this.taskQueue.length===0)return;const p=this.taskQueue.shift(),h=this.tasks[p];delete this.tasks[p],this.taskQueue.length>0&&this.invoker.trigger(),h&&this.processTask(p,h)}processTask(p,h){return s(this,void 0,void 0,function*(){if(h.type===""){const E=this.resolveRejects[p];return delete this.resolveRejects[p],E?void(h.error?E.reject(Au(h.error)):E.resolve(Au(h.data))):void 0}if(!this.messageHandlers[h.type])return void this.completeTask(p,new Error(`Could not find a registered handler for ${h.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const v=Au(h.data),b=new AbortController;this.abortControllers[p]=b;try{const E=yield this.messageHandlers[h.type](h.sourceMapId,v,b);this.completeTask(p,null,E)}catch(E){this.completeTask(p,E)}})}completeTask(p,h,v){const b=[];delete this.abortControllers[p];const E={id:p,type:"",sourceMapId:this.mapId,origin:location.origin,error:h?Cu(h):null,data:Cu(v,b)};this.target.postMessage(E,{transfer:b})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},o.G=kt,o.H=function(){var p=new Hf(16);return Hf!=Float32Array&&(p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[11]=0,p[12]=0,p[13]=0,p[14]=0),p[0]=1,p[5]=1,p[10]=1,p[15]=1,p},o.I=nD,o.J=function(p,h,v){var b,E,I,k,R,z,U,W,X,ee,ne,oe,ce=v[0],me=v[1],we=v[2];return h===p?(p[12]=h[0]*ce+h[4]*me+h[8]*we+h[12],p[13]=h[1]*ce+h[5]*me+h[9]*we+h[13],p[14]=h[2]*ce+h[6]*me+h[10]*we+h[14],p[15]=h[3]*ce+h[7]*me+h[11]*we+h[15]):(E=h[1],I=h[2],k=h[3],R=h[4],z=h[5],U=h[6],W=h[7],X=h[8],ee=h[9],ne=h[10],oe=h[11],p[0]=b=h[0],p[1]=E,p[2]=I,p[3]=k,p[4]=R,p[5]=z,p[6]=U,p[7]=W,p[8]=X,p[9]=ee,p[10]=ne,p[11]=oe,p[12]=b*ce+R*me+X*we+h[12],p[13]=E*ce+z*me+ee*we+h[13],p[14]=I*ce+U*me+ne*we+h[14],p[15]=k*ce+W*me+oe*we+h[15]),p},o.K=function(p,h,v){var b=v[0],E=v[1],I=v[2];return p[0]=h[0]*b,p[1]=h[1]*b,p[2]=h[2]*b,p[3]=h[3]*b,p[4]=h[4]*E,p[5]=h[5]*E,p[6]=h[6]*E,p[7]=h[7]*E,p[8]=h[8]*I,p[9]=h[9]*I,p[10]=h[10]*I,p[11]=h[11]*I,p[12]=h[12],p[13]=h[13],p[14]=h[14],p[15]=h[15],p},o.L=a6,o.M=function(p,h){const v={};for(let b=0;b{const h=window.document.createElement("video");return h.muted=!0,new Promise(v=>{h.onloadstart=()=>{v(h)};for(const b of p){const E=window.document.createElement("source");Ct(b)||(h.crossOrigin="Anonymous"),E.src=b,h.appendChild(E)}})},o.a4=function(){return H++},o.a5=wt,o.a6=Yf,o.a7=Rv,o.a8=Nh,o.a9=sG,o.aA=function(p){if(p.type==="custom")return new k_e(p);switch(p.type){case"background":return new D_e(p);case"circle":return new gye(p);case"fill":return new Lye(p);case"fill-extrusion":return new Zye(p);case"heatmap":return new mye(p);case"hillshade":return new _ye(p);case"line":return new t_e(p);case"raster":return new I_e(p);case"symbol":return new Qb(p)}},o.aB=Y,o.aC=function(p,h){if(!p)return[{command:"setStyle",args:[h]}];let v=[];try{if(!Xt(p.version,h.version))return[{command:"setStyle",args:[h]}];Xt(p.center,h.center)||v.push({command:"setCenter",args:[h.center]}),Xt(p.zoom,h.zoom)||v.push({command:"setZoom",args:[h.zoom]}),Xt(p.bearing,h.bearing)||v.push({command:"setBearing",args:[h.bearing]}),Xt(p.pitch,h.pitch)||v.push({command:"setPitch",args:[h.pitch]}),Xt(p.sprite,h.sprite)||v.push({command:"setSprite",args:[h.sprite]}),Xt(p.glyphs,h.glyphs)||v.push({command:"setGlyphs",args:[h.glyphs]}),Xt(p.transition,h.transition)||v.push({command:"setTransition",args:[h.transition]}),Xt(p.light,h.light)||v.push({command:"setLight",args:[h.light]}),Xt(p.terrain,h.terrain)||v.push({command:"setTerrain",args:[h.terrain]}),Xt(p.sky,h.sky)||v.push({command:"setSky",args:[h.sky]}),Xt(p.projection,h.projection)||v.push({command:"setProjection",args:[h.projection]});const b={},E=[];(function(k,R,z,U){let W;for(W in R=R||{},k=k||{})Object.prototype.hasOwnProperty.call(k,W)&&(Object.prototype.hasOwnProperty.call(R,W)||Yn(W,z,U));for(W in R)Object.prototype.hasOwnProperty.call(R,W)&&(Object.prototype.hasOwnProperty.call(k,W)?Xt(k[W],R[W])||(k[W].type==="geojson"&&R[W].type==="geojson"&&Aa(k,R,W)?nr(z,{command:"setGeoJSONSourceData",args:[W,R[W].data]}):Tn(W,R,z,U)):lr(W,R,z))})(p.sources,h.sources,E,b);const I=[];p.layers&&p.layers.forEach(k=>{"source"in k&&b[k.source]?v.push({command:"removeLayer",args:[k.id]}):I.push(k)}),v=v.concat(E),function(k,R,z){R=R||[];const U=(k=k||[]).map(mt),W=R.map(mt),X=k.reduce($t,{}),ee=R.reduce($t,{}),ne=U.slice(),oe=Object.create(null);let ce,me,we,Oe,Ae;for(let Re=0,Ue=0;Re@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(v,b,E,I)=>{const k=E||I;return h[b]=!k||k.toLowerCase(),""}),h["max-age"]){const v=parseInt(h["max-age"],10);isNaN(v)?delete h["max-age"]:h["max-age"]=v}return h},o.ab=function(p,h){const v=[];for(const b in p)b in h||v.push(b);return v},o.ac=V,o.ad=function(p,h,v){var b=Math.sin(v),E=Math.cos(v),I=h[0],k=h[1],R=h[2],z=h[3],U=h[4],W=h[5],X=h[6],ee=h[7];return h!==p&&(p[8]=h[8],p[9]=h[9],p[10]=h[10],p[11]=h[11],p[12]=h[12],p[13]=h[13],p[14]=h[14],p[15]=h[15]),p[0]=I*E+U*b,p[1]=k*E+W*b,p[2]=R*E+X*b,p[3]=z*E+ee*b,p[4]=U*E-I*b,p[5]=W*E-k*b,p[6]=X*E-R*b,p[7]=ee*E-z*b,p},o.ae=function(p){var h=new Hf(16);return h[0]=p[0],h[1]=p[1],h[2]=p[2],h[3]=p[3],h[4]=p[4],h[5]=p[5],h[6]=p[6],h[7]=p[7],h[8]=p[8],h[9]=p[9],h[10]=p[10],h[11]=p[11],h[12]=p[12],h[13]=p[13],h[14]=p[14],h[15]=p[15],h},o.af=Hb,o.ag=function(p,h){let v=0,b=0;if(p.kind==="constant")b=p.layoutSize;else if(p.kind!=="source"){const{interpolationType:E,minZoom:I,maxZoom:k}=p,R=E?V($i.interpolationFactor(E,h,I,k),0,1):0;p.kind==="camera"?b=Fi.number(p.minSize,p.maxSize,R):v=R}return{uSizeT:v,uSize:b}},o.ai=function(p,{uSize:h,uSizeT:v},{lowerSize:b,upperSize:E}){return p.kind==="source"?b/ks:p.kind==="composite"?Fi.number(b/ks,E/ks,v):h},o.aj=sD,o.ak=function(p,h,v,b){const E=h.y-p.y,I=h.x-p.x,k=b.y-v.y,R=b.x-v.x,z=k*I-R*E;if(z===0)return null;const U=(R*(p.y-v.y)-k*(p.x-v.x))/z;return new f(p.x+U*I,p.y+U*E)},o.al=hG,o.am=Q$,o.an=GA,o.ao=function(p){let h=1/0,v=1/0,b=-1/0,E=-1/0;for(const I of p)h=Math.min(h,I.x),v=Math.min(v,I.y),b=Math.max(b,I.x),E=Math.max(E,I.y);return[h,v,b,E]},o.ap=Zn,o.ar=oD,o.as=function(p,h){var v=h[0],b=h[1],E=h[2],I=h[3],k=h[4],R=h[5],z=h[6],U=h[7],W=h[8],X=h[9],ee=h[10],ne=h[11],oe=h[12],ce=h[13],me=h[14],we=h[15],Oe=v*R-b*k,Ae=v*z-E*k,Re=v*U-I*k,Ue=b*z-E*R,tt=b*U-I*R,St=E*U-I*z,Jt=W*ce-X*oe,xt=W*me-ee*oe,_t=W*we-ne*oe,Vt=X*me-ee*ce,Mt=X*we-ne*ce,At=ee*we-ne*me,Ye=Oe*At-Ae*Mt+Re*Vt+Ue*_t-tt*xt+St*Jt;return Ye?(p[0]=(R*At-z*Mt+U*Vt)*(Ye=1/Ye),p[1]=(E*Mt-b*At-I*Vt)*Ye,p[2]=(ce*St-me*tt+we*Ue)*Ye,p[3]=(ee*tt-X*St-ne*Ue)*Ye,p[4]=(z*_t-k*At-U*xt)*Ye,p[5]=(v*At-E*_t+I*xt)*Ye,p[6]=(me*Re-oe*St-we*Ae)*Ye,p[7]=(W*St-ee*Re+ne*Ae)*Ye,p[8]=(k*Mt-R*_t+U*Jt)*Ye,p[9]=(b*_t-v*Mt-I*Jt)*Ye,p[10]=(oe*tt-ce*Re+we*Oe)*Ye,p[11]=(X*Re-W*tt-ne*Oe)*Ye,p[12]=(R*xt-k*Vt-z*Jt)*Ye,p[13]=(v*Vt-b*xt+E*Jt)*Ye,p[14]=(ce*Ae-oe*Ue-me*Oe)*Ye,p[15]=(W*Ue-X*Ae+ee*Oe)*Ye,p):null},o.at=gD,o.au=aD,o.av=vD,o.aw=function(){const p={},h=Le.$version;for(const v in Le.$root){const b=Le.$root[v];if(b.required){let E=null;E=v==="version"?h:b.type==="array"?[]:{},E!=null&&(p[v]=E)}}return p},o.ax=jv,o.ay=lt,o.az=function(p){p=p.slice();const h=Object.create(null);for(let v=0;v25||b<0||b>=1||v<0||v>=1)},o.bc=function(p,h){return p[0]=h[0],p[1]=0,p[2]=0,p[3]=0,p[4]=0,p[5]=h[1],p[6]=0,p[7]=0,p[8]=0,p[9]=0,p[10]=h[2],p[11]=0,p[12]=0,p[13]=0,p[14]=0,p[15]=1,p},o.bd=class extends q{},o.be=hD,o.bf=$_e,o.bh=Ht,o.bi=function(p,h){et.REGISTERED_PROTOCOLS[p]=h},o.bj=function(p){delete et.REGISTERED_PROTOCOLS[p]},o.bk=function(p,h){const v={};for(let E=0;EAt*Zn)}let xt=k?"center":v.get("text-justify").evaluate(U,{},p.canonical);const _t=v.get("symbol-placement")==="point"?v.get("text-max-width").evaluate(U,{},p.canonical)*Zn:1/0,Vt=()=>{p.bucket.allowVerticalPlacement&&Xv(Re)&&(oe.vertical=Yb(ce,p.glyphMap,p.glyphPositions,p.imagePositions,W,_t,I,St,"left",tt,we,o.ah.vertical,!0,ee,X))};if(!k&&Jt){const Mt=new Set;if(xt==="auto")for(let Ye=0;Yes(void 0,void 0,void 0,function*(){if(p.byteLength===0)return createImageBitmap(new ImageData(1,1));const h=new Blob([new Uint8Array(p)],{type:"image/png"});try{return createImageBitmap(h)}catch(v){throw new Error(`Could not load image because of ${v.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),o.e=$,o.f=p=>new Promise((h,v)=>{const b=new Image;b.onload=()=>{h(b),URL.revokeObjectURL(b.src),b.onload=null,window.requestAnimationFrame(()=>{b.src=xe})},b.onerror=()=>v(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."));const E=new Blob([new Uint8Array(p)],{type:"image/png"});b.src=p.byteLength?URL.createObjectURL(E):xe}),o.g=it,o.h=(p,h)=>st($(p,{type:"json"}),h),o.i=fe,o.j=Ft,o.k=Qe,o.l=(p,h)=>st($(p,{type:"arrayBuffer"}),h),o.m=st,o.n=function(p){return new tD(p).readFields(v_e,[])},o.o=im,o.p=B6,o.q=M,o.r=MA,o.s=Ct,o.t=qv,o.u=ml,o.v=Le,o.w=ae,o.x=function([p,h,v]){return h+=90,h*=Math.PI/180,v*=Math.PI/180,{x:p*Math.cos(h)*Math.sin(v),y:p*Math.sin(h)*Math.sin(v),z:p*Math.cos(v)}},o.y=Fi,o.z=fn}),i("worker",["./shared"],function(o){class s{constructor(re){this.keyCache={},re&&this.replace(re)}replace(re){this._layerConfigs={},this._layers={},this.update(re,[])}update(re,te){for(const ye of re){this._layerConfigs[ye.id]=ye;const De=this._layers[ye.id]=o.aA(ye);De._featureFilter=o.a7(De.filter),this.keyCache[ye.id]&&delete this.keyCache[ye.id]}for(const ye of te)delete this.keyCache[ye],delete this._layerConfigs[ye],delete this._layers[ye];this.familiesBySource={};const he=o.bk(Object.values(this._layerConfigs),this.keyCache);for(const ye of he){const De=ye.map($e=>this._layers[$e.id]),ke=De[0];if(ke.visibility==="none")continue;const Ne=ke.source||"";let Ee=this.familiesBySource[Ne];Ee||(Ee=this.familiesBySource[Ne]={});const He=ke.sourceLayer||"_geojsonTileLayer";let Je=Ee[He];Je||(Je=Ee[He]=[]),Je.push(De)}}}class l{constructor(re){const te={},he=[];for(const Ne in re){const Ee=re[Ne],He=te[Ne]={};for(const Je in Ee){const $e=Ee[+Je];if(!$e||$e.bitmap.width===0||$e.bitmap.height===0)continue;const ht={x:0,y:0,w:$e.bitmap.width+2,h:$e.bitmap.height+2};he.push(ht),He[Je]={rect:ht,metrics:$e.metrics}}}const{w:ye,h:De}=o.p(he),ke=new o.o({width:ye||1,height:De||1});for(const Ne in re){const Ee=re[Ne];for(const He in Ee){const Je=Ee[+He];if(!Je||Je.bitmap.width===0||Je.bitmap.height===0)continue;const $e=te[Ne][He].rect;o.o.copy(Je.bitmap,ke,{x:0,y:0},{x:$e.x+1,y:$e.y+1},Je.bitmap)}}this.image=ke,this.positions=te}}o.bl("GlyphAtlas",l);class u{constructor(re){this.tileID=new o.S(re.tileID.overscaledZ,re.tileID.wrap,re.tileID.canonical.z,re.tileID.canonical.x,re.tileID.canonical.y),this.uid=re.uid,this.zoom=re.zoom,this.pixelRatio=re.pixelRatio,this.tileSize=re.tileSize,this.source=re.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=re.showCollisionBoxes,this.collectResourceTiming=!!re.collectResourceTiming,this.returnDependencies=!!re.returnDependencies,this.promoteId=re.promoteId,this.inFlightDependencies=[]}parse(re,te,he,ye){return o._(this,void 0,void 0,function*(){this.status="parsing",this.data=re,this.collisionBoxArray=new o.a5;const De=new o.bm(Object.keys(re.layers).sort()),ke=new o.bn(this.tileID,this.promoteId);ke.bucketLayerIDs=[];const Ne={},Ee={featureIndex:ke,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:he},He=te.familiesBySource[this.source];for(const Sr in He){const Yr=re.layers[Sr];if(!Yr)continue;Yr.version===1&&o.w(`Vector tile source "${this.source}" layer "${Sr}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const _n=De.encode(Sr),Kn=[];for(let li=0;li=Di.maxzoom||Di.visibility!=="none"&&(d(li,this.zoom,he),(Ne[Di.id]=Di.createBucket({index:ke.bucketLayerIDs.length,layers:li,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:_n,sourceID:this.source})).populate(Kn,Ee,this.tileID.canonical),ke.bucketLayerIDs.push(li.map(uu=>uu.id)))}}const Je=o.aF(Ee.glyphDependencies,Sr=>Object.keys(Sr).map(Number));this.inFlightDependencies.forEach(Sr=>Sr==null?void 0:Sr.abort()),this.inFlightDependencies=[];let $e=Promise.resolve({});if(Object.keys(Je).length){const Sr=new AbortController;this.inFlightDependencies.push(Sr),$e=ye.sendAsync({type:"GG",data:{stacks:Je,source:this.source,tileID:this.tileID,type:"glyphs"}},Sr)}const ht=Object.keys(Ee.iconDependencies);let Wt=Promise.resolve({});if(ht.length){const Sr=new AbortController;this.inFlightDependencies.push(Sr),Wt=ye.sendAsync({type:"GI",data:{icons:ht,source:this.source,tileID:this.tileID,type:"icons"}},Sr)}const Yt=Object.keys(Ee.patternDependencies);let Vr=Promise.resolve({});if(Yt.length){const Sr=new AbortController;this.inFlightDependencies.push(Sr),Vr=ye.sendAsync({type:"GI",data:{icons:Yt,source:this.source,tileID:this.tileID,type:"patterns"}},Sr)}const[pr,Fr,Ir]=yield Promise.all([$e,Wt,Vr]),Bn=new l(pr),En=new o.bo(Fr,Ir);for(const Sr in Ne){const Yr=Ne[Sr];Yr instanceof o.a6?(d(Yr.layers,this.zoom,he),o.bp({bucket:Yr,glyphMap:pr,glyphPositions:Bn.positions,imageMap:Fr,imagePositions:En.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):Yr.hasPattern&&(Yr instanceof o.bq||Yr instanceof o.br||Yr instanceof o.bs)&&(d(Yr.layers,this.zoom,he),Yr.addFeatures(Ee,this.tileID.canonical,En.patternPositions))}return this.status="done",{buckets:Object.values(Ne).filter(Sr=>!Sr.isEmpty()),featureIndex:ke,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Bn.image,imageAtlas:En,glyphMap:this.returnDependencies?pr:null,iconMap:this.returnDependencies?Fr:null,glyphPositions:this.returnDependencies?Bn.positions:null}})}}function d(be,re,te){const he=new o.z(re);for(const ye of be)ye.recalculate(he,te)}class f{constructor(re,te,he){this.actor=re,this.layerIndex=te,this.availableImages=he,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(re,te){return o._(this,void 0,void 0,function*(){const he=yield o.l(re.request,te);try{return{vectorTile:new o.bt.VectorTile(new o.bu(he.data)),rawData:he.data,cacheControl:he.cacheControl,expires:he.expires}}catch(ye){const De=new Uint8Array(he.data);let ke=`Unable to parse the tile at ${re.request.url}, `;throw ke+=De[0]===31&&De[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${ye.message}`,new Error(ke)}})}loadTile(re){return o._(this,void 0,void 0,function*(){const te=re.uid,he=!!(re&&re.request&&re.request.collectResourceTiming)&&new o.bv(re.request),ye=new u(re);this.loading[te]=ye;const De=new AbortController;ye.abort=De;try{const ke=yield this.loadVectorTile(re,De);if(delete this.loading[te],!ke)return null;const Ne=ke.rawData,Ee={};ke.expires&&(Ee.expires=ke.expires),ke.cacheControl&&(Ee.cacheControl=ke.cacheControl);const He={};if(he){const $e=he.finish();$e&&(He.resourceTiming=JSON.parse(JSON.stringify($e)))}ye.vectorTile=ke.vectorTile;const Je=ye.parse(ke.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[te]=ye,this.fetching[te]={rawTileData:Ne,cacheControl:Ee,resourceTiming:He};try{const $e=yield Je;return o.e({rawTileData:Ne.slice(0)},$e,Ee,He)}finally{delete this.fetching[te]}}catch(ke){throw delete this.loading[te],ye.status="done",this.loaded[te]=ye,ke}})}reloadTile(re){return o._(this,void 0,void 0,function*(){const te=re.uid;if(!this.loaded||!this.loaded[te])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const he=this.loaded[te];if(he.showCollisionBoxes=re.showCollisionBoxes,he.status==="parsing"){const ye=yield he.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor);let De;if(this.fetching[te]){const{rawTileData:ke,cacheControl:Ne,resourceTiming:Ee}=this.fetching[te];delete this.fetching[te],De=o.e({rawTileData:ke.slice(0)},ye,Ne,Ee)}else De=ye;return De}if(he.status==="done"&&he.vectorTile)return he.parse(he.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(re){return o._(this,void 0,void 0,function*(){const te=this.loading,he=re.uid;te&&te[he]&&te[he].abort&&(te[he].abort.abort(),delete te[he])})}removeTile(re){return o._(this,void 0,void 0,function*(){this.loaded&&this.loaded[re.uid]&&delete this.loaded[re.uid]})}}class g{constructor(){this.loaded={}}loadTile(re){return o._(this,void 0,void 0,function*(){const{uid:te,encoding:he,rawImageData:ye,redFactor:De,greenFactor:ke,blueFactor:Ne,baseShift:Ee}=re,He=ye.width+2,Je=ye.height+2,$e=o.b(ye)?new o.R({width:He,height:Je},yield o.bw(ye,-1,-1,He,Je)):ye,ht=new o.bx(te,$e,he,De,ke,Ne,Ee);return this.loaded=this.loaded||{},this.loaded[te]=ht,ht})}removeTile(re){const te=this.loaded,he=re.uid;te&&te[he]&&delete te[he]}}function m(be,re){if(be.length!==0){_(be[0],re);for(var te=1;te=Math.abs(Ne)?te-Ee+Ne:Ne-Ee+te,te=Ee}te+he>=0!=!!re&&be.reverse()}var x=o.by(function be(re,te){var he,ye=re&&re.type;if(ye==="FeatureCollection")for(he=0;he>31}function fe(be,re){for(var te=be.loadGeometry(),he=be.type,ye=0,De=0,ke=te.length,Ne=0;Nebe},Me=Math.fround||(Ve=new Float32Array(1),be=>(Ve[0]=+be,Ve[0]));var Ve;const Fe=3,Xe=5,ot=6;class et{constructor(re){this.options=Object.assign(Object.create(xe),re),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(re){const{log:te,minZoom:he,maxZoom:ye}=this.options;te&&console.time("total time");const De=`prepare ${re.length} points`;te&&console.time(De),this.points=re;const ke=[];for(let Ee=0;Ee=he;Ee--){const He=+Date.now();Ne=this.trees[Ee]=this._createTree(this._cluster(Ne,Ee)),te&&console.log("z%d: %d clusters in %dms",Ee,Ne.numItems,+Date.now()-He)}return te&&console.timeEnd("total time"),this}getClusters(re,te){let he=((re[0]+180)%360+360)%360-180;const ye=Math.max(-90,Math.min(90,re[1]));let De=re[2]===180?180:((re[2]+180)%360+360)%360-180;const ke=Math.max(-90,Math.min(90,re[3]));if(re[2]-re[0]>=360)he=-180,De=180;else if(he>De){const $e=this.getClusters([he,ye,180,ke],te),ht=this.getClusters([-180,ye,De,ke],te);return $e.concat(ht)}const Ne=this.trees[this._limitZoom(te)],Ee=Ne.range(Ht(he),lt(ke),Ht(De),lt(ye)),He=Ne.data,Je=[];for(const $e of Ee){const ht=this.stride*$e;Je.push(He[ht+Xe]>1?it(He,ht,this.clusterProps):this.points[He[ht+Fe]])}return Je}getChildren(re){const te=this._getOriginId(re),he=this._getOriginZoom(re),ye="No cluster with the specified id.",De=this.trees[he];if(!De)throw new Error(ye);const ke=De.data;if(te*this.stride>=ke.length)throw new Error(ye);const Ne=this.options.radius/(this.options.extent*Math.pow(2,he-1)),Ee=De.within(ke[te*this.stride],ke[te*this.stride+1],Ne),He=[];for(const Je of Ee){const $e=Je*this.stride;ke[$e+4]===re&&He.push(ke[$e+Xe]>1?it(ke,$e,this.clusterProps):this.points[ke[$e+Fe]])}if(He.length===0)throw new Error(ye);return He}getLeaves(re,te,he){const ye=[];return this._appendLeaves(ye,re,te=te||10,he=he||0,0),ye}getTile(re,te,he){const ye=this.trees[this._limitZoom(re)],De=Math.pow(2,re),{extent:ke,radius:Ne}=this.options,Ee=Ne/ke,He=(he-Ee)/De,Je=(he+1+Ee)/De,$e={features:[]};return this._addTileFeatures(ye.range((te-Ee)/De,He,(te+1+Ee)/De,Je),ye.data,te,he,De,$e),te===0&&this._addTileFeatures(ye.range(1-Ee/De,He,1,Je),ye.data,De,he,De,$e),te===De-1&&this._addTileFeatures(ye.range(0,He,Ee/De,Je),ye.data,-1,he,De,$e),$e.features.length?$e:null}getClusterExpansionZoom(re){let te=this._getOriginZoom(re)-1;for(;te<=this.options.maxZoom;){const he=this.getChildren(re);if(te++,he.length!==1)break;re=he[0].properties.cluster_id}return te}_appendLeaves(re,te,he,ye,De){const ke=this.getChildren(te);for(const Ne of ke){const Ee=Ne.properties;if(Ee&&Ee.cluster?De+Ee.point_count<=ye?De+=Ee.point_count:De=this._appendLeaves(re,Ee.cluster_id,he,ye,De):De1;let Je,$e,ht;if(He)Je=kt(te,Ee,this.clusterProps),$e=te[Ee],ht=te[Ee+1];else{const Vr=this.points[te[Ee+Fe]];Je=Vr.properties;const[pr,Fr]=Vr.geometry.coordinates;$e=Ht(pr),ht=lt(Fr)}const Wt={type:1,geometry:[[Math.round(this.options.extent*($e*De-he)),Math.round(this.options.extent*(ht*De-ye))]],tags:Je};let Yt;Yt=He||this.options.generateId?te[Ee+Fe]:this.points[te[Ee+Fe]].id,Yt!==void 0&&(Wt.id=Yt),ke.features.push(Wt)}}_limitZoom(re){return Math.max(this.options.minZoom,Math.min(Math.floor(+re),this.options.maxZoom+1))}_cluster(re,te){const{radius:he,extent:ye,reduce:De,minPoints:ke}=this.options,Ne=he/(ye*Math.pow(2,te)),Ee=re.data,He=[],Je=this.stride;for(let $e=0;$ete&&(pr+=Ee[Ir+Xe])}if(pr>Vr&&pr>=ke){let Fr,Ir=ht*Vr,Bn=Wt*Vr,En=-1;const Sr=(($e/Je|0)<<5)+(te+1)+this.points.length;for(const Yr of Yt){const _n=Yr*Je;if(Ee[_n+2]<=te)continue;Ee[_n+2]=te;const Kn=Ee[_n+Xe];Ir+=Ee[_n]*Kn,Bn+=Ee[_n+1]*Kn,Ee[_n+4]=Sr,De&&(Fr||(Fr=this._map(Ee,$e,!0),En=this.clusterProps.length,this.clusterProps.push(Fr)),De(Fr,this._map(Ee,_n)))}Ee[$e+4]=Sr,He.push(Ir/pr,Bn/pr,1/0,Sr,-1,pr),De&&He.push(En)}else{for(let Fr=0;Fr1)for(const Fr of Yt){const Ir=Fr*Je;if(!(Ee[Ir+2]<=te)){Ee[Ir+2]=te;for(let Bn=0;Bn>5}_getOriginZoom(re){return(re-this.points.length)%32}_map(re,te,he){if(re[te+Xe]>1){const ke=this.clusterProps[re[te+ot]];return he?Object.assign({},ke):ke}const ye=this.points[re[te+Fe]].properties,De=this.options.map(ye);return he&&De===ye?Object.assign({},De):De}}function it(be,re,te){return{type:"Feature",id:be[re+Fe],properties:kt(be,re,te),geometry:{type:"Point",coordinates:[(he=be[re],360*(he-.5)),st(be[re+1])]}};var he}function kt(be,re,te){const he=be[re+Xe],ye=he>=1e4?`${Math.round(he/1e3)}k`:he>=1e3?Math.round(he/100)/10+"k":he,De=be[re+ot],ke=De===-1?{}:Object.assign({},te[De]);return Object.assign(ke,{cluster:!0,cluster_id:be[re+Fe],point_count:he,point_count_abbreviated:ye})}function Ht(be){return be/360+.5}function lt(be){const re=Math.sin(be*Math.PI/180),te=.5-.25*Math.log((1+re)/(1-re))/Math.PI;return te<0?0:te>1?1:te}function st(be){const re=(180-360*be)*Math.PI/180;return 360*Math.atan(Math.exp(re))/Math.PI-90}function Ct(be,re,te,he){let ye=he;const De=re+(te-re>>1);let ke,Ne=te-re;const Ee=be[re],He=be[re+1],Je=be[te],$e=be[te+1];for(let ht=re+3;htye)ke=ht,ye=Wt;else if(Wt===ye){const Yt=Math.abs(ht-De);Ythe&&(ke-re>3&&Ct(be,re,ke,he),be[ke+2]=ye,te-ke>3&&Ct(be,ke,te,he))}function rt(be,re,te,he,ye,De){let ke=ye-te,Ne=De-he;if(ke!==0||Ne!==0){const Ee=((be-te)*ke+(re-he)*Ne)/(ke*ke+Ne*Ne);Ee>1?(te=ye,he=De):Ee>0&&(te+=ke*Ee,he+=Ne*Ee)}return ke=be-te,Ne=re-he,ke*ke+Ne*Ne}function vt(be,re,te,he){const ye={id:be??null,type:re,geometry:te,tags:he,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(re==="Point"||re==="MultiPoint"||re==="LineString")Qe(ye,te);else if(re==="Polygon")Qe(ye,te[0]);else if(re==="MultiLineString")for(const De of te)Qe(ye,De);else if(re==="MultiPolygon")for(const De of te)Qe(ye,De[0]);return ye}function Qe(be,re){for(let te=0;te0&&(ke+=he?(ye*Je-He*De)/2:Math.sqrt(Math.pow(He-ye,2)+Math.pow(Je-De,2))),ye=He,De=Je}const Ne=re.length-3;re[2]=1,Ct(re,0,Ne,te),re[Ne+2]=1,re.size=Math.abs(ke),re.start=0,re.end=re.size}function Mr(be,re,te,he){for(let ye=0;ye1?1:te}function nr(be,re,te,he,ye,De,ke,Ne){if(he/=re,De>=(te/=re)&&ke=he)return null;const Ee=[];for(const He of be){const Je=He.geometry;let $e=He.type;const ht=ye===0?He.minX:He.minY,Wt=ye===0?He.maxX:He.maxY;if(ht>=te&&Wt=he)continue;let Yt=[];if($e==="Point"||$e==="MultiPoint")lr(Je,Yt,te,he,ye);else if($e==="LineString")Yn(Je,Yt,te,he,ye,!1,Ne.lineMetrics);else if($e==="MultiLineString")Aa(Je,Yt,te,he,ye,!1);else if($e==="Polygon")Aa(Je,Yt,te,he,ye,!0);else if($e==="MultiPolygon")for(const Vr of Je){const pr=[];Aa(Vr,pr,te,he,ye,!0),pr.length&&Yt.push(pr)}if(Yt.length){if(Ne.lineMetrics&&$e==="LineString"){for(const Vr of Yt)Ee.push(vt(He.id,$e,Vr,He.tags));continue}$e!=="LineString"&&$e!=="MultiLineString"||(Yt.length===1?($e="LineString",Yt=Yt[0]):$e="MultiLineString"),$e!=="Point"&&$e!=="MultiPoint"||($e=Yt.length===3?"Point":"MultiPoint"),Ee.push(vt(He.id,$e,Yt,He.tags))}}return Ee.length?Ee:null}function lr(be,re,te,he,ye){for(let De=0;De=te&&ke<=he&&Pn(re,be[De],be[De+1],be[De+2])}}function Yn(be,re,te,he,ye,De,ke){let Ne=Tn(be);const Ee=ye===0?mt:$t;let He,Je,$e=be.start;for(let pr=0;prte&&(Je=Ee(Ne,Fr,Ir,En,Sr,te),ke&&(Ne.start=$e+He*Je)):Yr>he?_n=te&&(Je=Ee(Ne,Fr,Ir,En,Sr,te),Kn=!0),_n>he&&Yr<=he&&(Je=Ee(Ne,Fr,Ir,En,Sr,he),Kn=!0),!De&&Kn&&(ke&&(Ne.end=$e+He*Je),re.push(Ne),Ne=Tn(be)),ke&&($e+=He)}let ht=be.length-3;const Wt=be[ht],Yt=be[ht+1],Vr=ye===0?Wt:Yt;Vr>=te&&Vr<=he&&Pn(Ne,Wt,Yt,be[ht+2]),ht=Ne.length-3,De&&ht>=3&&(Ne[ht]!==Ne[0]||Ne[ht+1]!==Ne[1])&&Pn(Ne,Ne[0],Ne[1],Ne[2]),Ne.length&&re.push(Ne)}function Tn(be){const re=[];return re.size=be.size,re.start=be.start,re.end=be.end,re}function Aa(be,re,te,he,ye,De){for(const ke of be)Yn(ke,re,te,he,ye,De,!1)}function Pn(be,re,te,he){be.push(re,te,he)}function mt(be,re,te,he,ye,De){const ke=(De-re)/(he-re);return Pn(be,De,te+(ye-te)*ke,1),ke}function $t(be,re,te,he,ye,De){const ke=(De-te)/(ye-te);return Pn(be,re+(he-re)*ke,De,1),ke}function qe(be,re){const te=[];for(let he=0;he0&&re.size<(ye?ke:he))return void(te.numPoints+=re.length/3);const Ne=[];for(let Ee=0;Eeke)&&(te.numSimplified++,Ne.push(re[Ee],re[Ee+1])),te.numPoints++;ye&&function(Ee,He){let Je=0;for(let $e=0,ht=Ee.length,Wt=ht-2;$e0===He)for(let $e=0,ht=Ee.length;$e24)throw new Error("maxZoom should be in the 0-24 range");if(te.promoteId&&te.generateId)throw new Error("promoteId and generateId cannot be used together.");let ye=function(De,ke){const Ne=[];if(De.type==="FeatureCollection")for(let Ee=0;Ee1&&console.time("creation"),Wt=this.tiles[ht]=sa(re,te,he,ye,He),this.tileCoords.push({z:te,x:he,y:ye}),Je)){Je>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",te,he,ye,Wt.numFeatures,Wt.numPoints,Wt.numSimplified),console.timeEnd("creation"));const Kn=`z${te}`;this.stats[Kn]=(this.stats[Kn]||0)+1,this.total++}if(Wt.source=re,De==null){if(te===He.indexMaxZoom||Wt.numPoints<=He.indexMaxPoints)continue}else{if(te===He.maxZoom||te===De)continue;if(De!=null){const Kn=De-te;if(he!==ke>>Kn||ye!==Ne>>Kn)continue}}if(Wt.source=null,re.length===0)continue;Je>1&&console.time("clipping");const Yt=.5*He.buffer/He.extent,Vr=.5-Yt,pr=.5+Yt,Fr=1+Yt;let Ir=null,Bn=null,En=null,Sr=null,Yr=nr(re,$e,he-Yt,he+pr,0,Wt.minX,Wt.maxX,He),_n=nr(re,$e,he+Vr,he+Fr,0,Wt.minX,Wt.maxX,He);re=null,Yr&&(Ir=nr(Yr,$e,ye-Yt,ye+pr,1,Wt.minY,Wt.maxY,He),Bn=nr(Yr,$e,ye+Vr,ye+Fr,1,Wt.minY,Wt.maxY,He),Yr=null),_n&&(En=nr(_n,$e,ye-Yt,ye+pr,1,Wt.minY,Wt.maxY,He),Sr=nr(_n,$e,ye+Vr,ye+Fr,1,Wt.minY,Wt.maxY,He),_n=null),Je>1&&console.timeEnd("clipping"),Ee.push(Ir||[],te+1,2*he,2*ye),Ee.push(Bn||[],te+1,2*he,2*ye+1),Ee.push(En||[],te+1,2*he+1,2*ye),Ee.push(Sr||[],te+1,2*he+1,2*ye+1)}}getTile(re,te,he){re=+re,te=+te,he=+he;const ye=this.options,{extent:De,debug:ke}=ye;if(re<0||re>24)return null;const Ne=1<1&&console.log("drilling down to z%d-%d-%d",re,te,he);let He,Je=re,$e=te,ht=he;for(;!He&&Je>0;)Je--,$e>>=1,ht>>=1,He=this.tiles[la(Je,$e,ht)];return He&&He.source?(ke>1&&(console.log("found parent tile z%d-%d-%d",Je,$e,ht),console.time("drilling down")),this.splitTile(He.source,Je,$e,ht,re,te,he),ke>1&&console.timeEnd("drilling down"),this.tiles[Ee]?zr(this.tiles[Ee],De):null):null}}function la(be,re,te){return 32*((1<{$e.properties=Wt;const Yt={};for(const Vr of ht)Yt[Vr]=Ee[Vr].evaluate(Je,$e);return Yt},ke.reduce=(Wt,Yt)=>{$e.properties=Yt;for(const Vr of ht)Je.accumulated=Wt[Vr],Wt[Vr]=He[Vr].evaluate(Je,$e)},ke}(re)).load((yield this._pendingData).features):(ye=yield this._pendingData,new fi(ye,re.geojsonVtOptions)),this.loaded={};const De={};if(he){const ke=he.finish();ke&&(De.resourceTiming={},De.resourceTiming[re.source]=JSON.parse(JSON.stringify(ke)))}return De}catch(De){if(delete this._pendingRequest,o.bB(De))return{abandoned:!0};throw De}var ye})}getData(){return o._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(re){const te=this.loaded;return te&&te[re.uid]?super.reloadTile(re):this.loadTile(re)}loadAndProcessGeoJSON(re,te){return o._(this,void 0,void 0,function*(){let he=yield this.loadGeoJSON(re,te);if(delete this._pendingRequest,typeof he!="object")throw new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`);if(x(he,!0),re.filter){const ye=o.bC(re.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(ye.result==="error")throw new Error(ye.value.map(ke=>`${ke.key}: ${ke.message}`).join(", "));he={type:"FeatureCollection",features:he.features.filter(ke=>ye.value.evaluate({zoom:0},ke))}}return he})}loadGeoJSON(re,te){return o._(this,void 0,void 0,function*(){const{promoteId:he}=re;if(re.request){const ye=yield o.h(re.request,te);return this._dataUpdateable=Da(ye.data,he)?Br(ye.data,he):void 0,ye.data}if(typeof re.data=="string")try{const ye=JSON.parse(re.data);return this._dataUpdateable=Da(ye,he)?Br(ye,he):void 0,ye}catch{throw new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`)}if(!re.dataDiff)throw new Error(`Input data given to '${re.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${re.source}`);return function(ye,De,ke){var Ne,Ee,He,Je;if(De.removeAll&&ye.clear(),De.remove)for(const $e of De.remove)ye.delete($e);if(De.add)for(const $e of De.add){const ht=cr($e,ke);ht!=null&&ye.set(ht,$e)}if(De.update)for(const $e of De.update){let ht=ye.get($e.id);if(ht==null)continue;const Wt=!$e.removeAllProperties&&(((Ne=$e.removeProperties)===null||Ne===void 0?void 0:Ne.length)>0||((Ee=$e.addOrUpdateProperties)===null||Ee===void 0?void 0:Ee.length)>0);if(($e.newGeometry||$e.removeAllProperties||Wt)&&(ht=Object.assign({},ht),ye.set($e.id,ht),Wt&&(ht.properties=Object.assign({},ht.properties))),$e.newGeometry&&(ht.geometry=$e.newGeometry),$e.removeAllProperties)ht.properties={};else if(((He=$e.removeProperties)===null||He===void 0?void 0:He.length)>0)for(const Yt of $e.removeProperties)Object.prototype.hasOwnProperty.call(ht.properties,Yt)&&delete ht.properties[Yt];if(((Je=$e.addOrUpdateProperties)===null||Je===void 0?void 0:Je.length)>0)for(const{key:Yt,value:Vr}of $e.addOrUpdateProperties)ht.properties[Yt]=Vr}}(this._dataUpdateable,re.dataDiff,he),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(re){return o._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(re){return this._geoJSONIndex.getClusterExpansionZoom(re.clusterId)}getClusterChildren(re){return this._geoJSONIndex.getChildren(re.clusterId)}getClusterLeaves(re){return this._geoJSONIndex.getLeaves(re.clusterId,re.limit,re.offset)}}class pi{constructor(re){this.self=re,this.actor=new o.F(re),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(te,he)=>{if(this.externalWorkerSourceTypes[te])throw new Error(`Worker source with name "${te}" already registered.`);this.externalWorkerSourceTypes[te]=he},this.self.addProtocol=o.bi,this.self.removeProtocol=o.bj,this.self.registerRTLTextPlugin=te=>{if(o.bD.isParsed())throw new Error("RTL text plugin already registered.");o.bD.setMethods(te)},this.actor.registerMessageHandler("LDT",(te,he)=>this._getDEMWorkerSource(te,he.source).loadTile(he)),this.actor.registerMessageHandler("RDT",(te,he)=>o._(this,void 0,void 0,function*(){this._getDEMWorkerSource(te,he.source).removeTile(he)})),this.actor.registerMessageHandler("GCEZ",(te,he)=>o._(this,void 0,void 0,function*(){return this._getWorkerSource(te,he.type,he.source).getClusterExpansionZoom(he)})),this.actor.registerMessageHandler("GCC",(te,he)=>o._(this,void 0,void 0,function*(){return this._getWorkerSource(te,he.type,he.source).getClusterChildren(he)})),this.actor.registerMessageHandler("GCL",(te,he)=>o._(this,void 0,void 0,function*(){return this._getWorkerSource(te,he.type,he.source).getClusterLeaves(he)})),this.actor.registerMessageHandler("LD",(te,he)=>this._getWorkerSource(te,he.type,he.source).loadData(he)),this.actor.registerMessageHandler("GD",(te,he)=>this._getWorkerSource(te,he.type,he.source).getData()),this.actor.registerMessageHandler("LT",(te,he)=>this._getWorkerSource(te,he.type,he.source).loadTile(he)),this.actor.registerMessageHandler("RT",(te,he)=>this._getWorkerSource(te,he.type,he.source).reloadTile(he)),this.actor.registerMessageHandler("AT",(te,he)=>this._getWorkerSource(te,he.type,he.source).abortTile(he)),this.actor.registerMessageHandler("RMT",(te,he)=>this._getWorkerSource(te,he.type,he.source).removeTile(he)),this.actor.registerMessageHandler("RS",(te,he)=>o._(this,void 0,void 0,function*(){if(!this.workerSources[te]||!this.workerSources[te][he.type]||!this.workerSources[te][he.type][he.source])return;const ye=this.workerSources[te][he.type][he.source];delete this.workerSources[te][he.type][he.source],ye.removeSource!==void 0&&ye.removeSource(he)})),this.actor.registerMessageHandler("RM",te=>o._(this,void 0,void 0,function*(){delete this.layerIndexes[te],delete this.availableImages[te],delete this.workerSources[te],delete this.demWorkerSources[te]})),this.actor.registerMessageHandler("SR",(te,he)=>o._(this,void 0,void 0,function*(){this.referrer=he})),this.actor.registerMessageHandler("SRPS",(te,he)=>this._syncRTLPluginState(te,he)),this.actor.registerMessageHandler("IS",(te,he)=>o._(this,void 0,void 0,function*(){this.self.importScripts(he)})),this.actor.registerMessageHandler("SI",(te,he)=>this._setImages(te,he)),this.actor.registerMessageHandler("UL",(te,he)=>o._(this,void 0,void 0,function*(){this._getLayerIndex(te).update(he.layers,he.removedIds)})),this.actor.registerMessageHandler("SL",(te,he)=>o._(this,void 0,void 0,function*(){this._getLayerIndex(te).replace(he)}))}_setImages(re,te){return o._(this,void 0,void 0,function*(){this.availableImages[re]=te;for(const he in this.workerSources[re]){const ye=this.workerSources[re][he];for(const De in ye)ye[De].availableImages=te}})}_syncRTLPluginState(re,te){return o._(this,void 0,void 0,function*(){if(o.bD.isParsed())return o.bD.getState();if(te.pluginStatus!=="loading")return o.bD.setState(te),te;const he=te.pluginURL;if(this.self.importScripts(he),o.bD.isParsed()){const ye={pluginStatus:"loaded",pluginURL:he};return o.bD.setState(ye),ye}throw o.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${he}`)})}_getAvailableImages(re){let te=this.availableImages[re];return te||(te=[]),te}_getLayerIndex(re){let te=this.layerIndexes[re];return te||(te=this.layerIndexes[re]=new s),te}_getWorkerSource(re,te,he){if(this.workerSources[re]||(this.workerSources[re]={}),this.workerSources[re][te]||(this.workerSources[re][te]={}),!this.workerSources[re][te][he]){const ye={sendAsync:(De,ke)=>(De.targetMapId=re,this.actor.sendAsync(De,ke))};switch(te){case"vector":this.workerSources[re][te][he]=new f(ye,this._getLayerIndex(re),this._getAvailableImages(re));break;case"geojson":this.workerSources[re][te][he]=new ua(ye,this._getLayerIndex(re),this._getAvailableImages(re));break;default:this.workerSources[re][te][he]=new this.externalWorkerSourceTypes[te](ye,this._getLayerIndex(re),this._getAvailableImages(re))}}return this.workerSources[re][te][he]}_getDEMWorkerSource(re,te){return this.demWorkerSources[re]||(this.demWorkerSources[re]={}),this.demWorkerSources[re][te]||(this.demWorkerSources[re][te]=new g),this.demWorkerSources[re][te]}}return o.i(self)&&(self.worker=new pi(self)),pi}),i("index",["exports","./shared"],function(o,s){var l="4.7.1";let u,d;const f={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:M=>new Promise((c,y)=>{const S=requestAnimationFrame(c);M.signal.addEventListener("abort",()=>{cancelAnimationFrame(S),y(s.c())})}),getImageData(M,c=0){return this.getImageCanvasContext(M).getImageData(-c,-c,M.width+2*c,M.height+2*c)},getImageCanvasContext(M){const c=window.document.createElement("canvas"),y=c.getContext("2d",{willReadFrequently:!0});if(!y)throw new Error("failed to create canvas 2d context");return c.width=M.width,c.height=M.height,y.drawImage(M,0,0,M.width,M.height),y},resolveURL:M=>(u||(u=document.createElement("a")),u.href=M,u.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(d==null&&(d=matchMedia("(prefers-reduced-motion: reduce)")),d.matches)}};class g{static testProp(c){if(!g.docStyle)return c[0];for(let y=0;y{window.removeEventListener("click",g.suppressClickInternal,!0)},0)}static getScale(c){const y=c.getBoundingClientRect();return{x:y.width/c.offsetWidth||1,y:y.height/c.offsetHeight||1,boundingClientRect:y}}static getPoint(c,y,S){const T=y.boundingClientRect;return new s.P((S.clientX-T.left)/y.x-c.clientLeft,(S.clientY-T.top)/y.y-c.clientTop)}static mousePos(c,y){const S=g.getScale(c);return g.getPoint(c,S,y)}static touchPos(c,y){const S=[],T=g.getScale(c);for(let D=0;D{_&&A(_),_=null,C=!0},x.onerror=()=>{w=!0,_=null},x.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(M){let c,y,S,T;M.resetRequestQueue=()=>{c=[],y=0,S=0,T={}},M.addThrottleControl=G=>{const q=S++;return T[q]=G,q},M.removeThrottleControl=G=>{delete T[G],N()},M.getImage=(G,q,K=!0)=>new Promise((J,ie)=>{m.supported&&(G.headers||(G.headers={}),G.headers.accept="image/webp,*/*"),s.e(G,{type:"image"}),c.push({abortController:q,requestParameters:G,supportImageRefresh:K,state:"queued",onError:de=>{ie(de)},onSuccess:de=>{J(de)}}),N()});const D=G=>s._(this,void 0,void 0,function*(){G.state="running";const{requestParameters:q,supportImageRefresh:K,onError:J,onSuccess:ie,abortController:de}=G,pe=K===!1&&!s.i(self)&&!s.g(q.url)&&(!q.headers||Object.keys(q.headers).reduce((Te,Ce)=>Te&&Ce==="accept",!0));y++;const _e=pe?B(q,de):s.m(q,de);try{const Te=yield _e;delete G.abortController,G.state="completed",Te.data instanceof HTMLImageElement||s.b(Te.data)?ie(Te):Te.data&&ie({data:yield(Se=Te.data,typeof createImageBitmap=="function"?s.d(Se):s.f(Se)),cacheControl:Te.cacheControl,expires:Te.expires})}catch(Te){delete G.abortController,J(Te)}finally{y--,N()}var Se}),N=()=>{const G=(()=>{for(const q of Object.keys(T))if(T[q]())return!0;return!1})()?s.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:s.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let q=y;q0;q++){const K=c.shift();K.abortController.signal.aborted?q--:D(K)}},B=(G,q)=>new Promise((K,J)=>{const ie=new Image,de=G.url,pe=G.credentials;pe&&pe==="include"?ie.crossOrigin="use-credentials":(pe&&pe==="same-origin"||!s.s(de))&&(ie.crossOrigin="anonymous"),q.signal.addEventListener("abort",()=>{ie.src="",J(s.c())}),ie.fetchPriority="high",ie.onload=()=>{ie.onerror=ie.onload=null,K({data:ie})},ie.onerror=()=>{ie.onerror=ie.onload=null,q.signal.aborted||J(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."))},ie.src=de})}(L||(L={})),L.resetRequestQueue();class O{constructor(c){this._transformRequestFn=c}transformRequest(c,y){return this._transformRequestFn&&this._transformRequestFn(c,y)||{url:c}}setTransformRequest(c){this._transformRequestFn=c}}function V(M){var c=new s.A(3);return c[0]=M[0],c[1]=M[1],c[2]=M[2],c}var F,$=function(M,c,y){return M[0]=c[0]-y[0],M[1]=c[1]-y[1],M[2]=c[2]-y[2],M};F=new s.A(3),s.A!=Float32Array&&(F[0]=0,F[1]=0,F[2]=0);var H=function(M){var c=M[0],y=M[1];return c*c+y*y};function Z(M){const c=[];if(typeof M=="string")c.push({id:"default",url:M});else if(M&&M.length>0){const y=[];for(const{id:S,url:T}of M){const D=`${S}${T}`;y.indexOf(D)===-1&&(y.push(D),c.push({id:S,url:T}))}}return c}function j(M,c,y){const S=M.split("?");return S[0]+=`${c}${y}`,S.join("?")}(function(){var M=new s.A(2);s.A!=Float32Array&&(M[0]=0,M[1]=0)})();class Y{constructor(c,y,S,T){this.context=c,this.format=S,this.texture=c.gl.createTexture(),this.update(y,T)}update(c,y,S){const{width:T,height:D}=c,N=!(this.size&&this.size[0]===T&&this.size[1]===D||S),{context:B}=this,{gl:G}=B;if(this.useMipmap=!!(y&&y.useMipmap),G.bindTexture(G.TEXTURE_2D,this.texture),B.pixelStoreUnpackFlipY.set(!1),B.pixelStoreUnpack.set(1),B.pixelStoreUnpackPremultiplyAlpha.set(this.format===G.RGBA&&(!y||y.premultiply!==!1)),N)this.size=[T,D],c instanceof HTMLImageElement||c instanceof HTMLCanvasElement||c instanceof HTMLVideoElement||c instanceof ImageData||s.b(c)?G.texImage2D(G.TEXTURE_2D,0,this.format,this.format,G.UNSIGNED_BYTE,c):G.texImage2D(G.TEXTURE_2D,0,this.format,T,D,0,this.format,G.UNSIGNED_BYTE,c.data);else{const{x:q,y:K}=S||{x:0,y:0};c instanceof HTMLImageElement||c instanceof HTMLCanvasElement||c instanceof HTMLVideoElement||c instanceof ImageData||s.b(c)?G.texSubImage2D(G.TEXTURE_2D,0,q,K,G.RGBA,G.UNSIGNED_BYTE,c):G.texSubImage2D(G.TEXTURE_2D,0,q,K,T,D,G.RGBA,G.UNSIGNED_BYTE,c.data)}this.useMipmap&&this.isSizePowerOfTwo()&&G.generateMipmap(G.TEXTURE_2D)}bind(c,y,S){const{context:T}=this,{gl:D}=T;D.bindTexture(D.TEXTURE_2D,this.texture),S!==D.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(S=D.LINEAR),c!==this.filter&&(D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,c),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,S||c),this.filter=c),y!==this.wrap&&(D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,y),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,y),this.wrap=y)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:c}=this.context;c.deleteTexture(this.texture),this.texture=null}}function se(M){const{userImage:c}=M;return!!(c&&c.render&&c.render())&&(M.data.replace(new Uint8Array(c.data.buffer)),!0)}class ae extends s.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new s.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(c){if(this.loaded!==c&&(this.loaded=c,c)){for(const{ids:y,promiseResolve:S}of this.requestors)S(this._getImagesForIds(y));this.requestors=[]}}getImage(c){const y=this.images[c];if(y&&!y.data&&y.spriteData){const S=y.spriteData;y.data=new s.R({width:S.width,height:S.height},S.context.getImageData(S.x,S.y,S.width,S.height).data),y.spriteData=null}return y}addImage(c,y){if(this.images[c])throw new Error(`Image id ${c} already exist, use updateImage instead`);this._validate(c,y)&&(this.images[c]=y)}_validate(c,y){let S=!0;const T=y.data||y.spriteData;return this._validateStretch(y.stretchX,T&&T.width)||(this.fire(new s.j(new Error(`Image "${c}" has invalid "stretchX" value`))),S=!1),this._validateStretch(y.stretchY,T&&T.height)||(this.fire(new s.j(new Error(`Image "${c}" has invalid "stretchY" value`))),S=!1),this._validateContent(y.content,y)||(this.fire(new s.j(new Error(`Image "${c}" has invalid "content" value`))),S=!1),S}_validateStretch(c,y){if(!c)return!0;let S=0;for(const T of c){if(T[0]{let T=!0;if(!this.isLoaded())for(const D of c)this.images[D]||(T=!1);this.isLoaded()||T?y(this._getImagesForIds(c)):this.requestors.push({ids:c,promiseResolve:y})})}_getImagesForIds(c){const y={};for(const S of c){let T=this.getImage(S);T||(this.fire(new s.k("styleimagemissing",{id:S})),T=this.getImage(S)),T?y[S]={data:T.data.clone(),pixelRatio:T.pixelRatio,sdf:T.sdf,version:T.version,stretchX:T.stretchX,stretchY:T.stretchY,content:T.content,textFitWidth:T.textFitWidth,textFitHeight:T.textFitHeight,hasRenderCallback:!!(T.userImage&&T.userImage.render)}:s.w(`Image "${S}" 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 y}getPixelSize(){const{width:c,height:y}=this.atlasImage;return{width:c,height:y}}getPattern(c){const y=this.patterns[c],S=this.getImage(c);if(!S)return null;if(y&&y.position.version===S.version)return y.position;if(y)y.position.version=S.version;else{const T={w:S.data.width+2,h:S.data.height+2,x:0,y:0},D=new s.I(T,S);this.patterns[c]={bin:T,position:D}}return this._updatePatternAtlas(),this.patterns[c].position}bind(c){const y=c.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Y(c,this.atlasImage,y.RGBA),this.atlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE)}_updatePatternAtlas(){const c=[];for(const D in this.patterns)c.push(this.patterns[D].bin);const{w:y,h:S}=s.p(c),T=this.atlasImage;T.resize({width:y||1,height:S||1});for(const D in this.patterns){const{bin:N}=this.patterns[D],B=N.x+1,G=N.y+1,q=this.getImage(D).data,K=q.width,J=q.height;s.R.copy(q,T,{x:0,y:0},{x:B,y:G},{width:K,height:J}),s.R.copy(q,T,{x:0,y:J-1},{x:B,y:G-1},{width:K,height:1}),s.R.copy(q,T,{x:0,y:0},{x:B,y:G+J},{width:K,height:1}),s.R.copy(q,T,{x:K-1,y:0},{x:B-1,y:G},{width:1,height:J}),s.R.copy(q,T,{x:0,y:0},{x:B+K,y:G},{width:1,height:J})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(c){for(const y of c){if(this.callbackDispatchedThisFrame[y])continue;this.callbackDispatchedThisFrame[y]=!0;const S=this.getImage(y);S||s.w(`Image with ID: "${y}" was not found`),se(S)&&this.updateImage(y,S)}}}const ue=1e20;function fe(M,c,y,S,T,D,N,B,G){for(let q=c;q-1);G++,D[G]=B,N[G]=q,N[G+1]=ue}for(let B=0,G=0;B65535)throw new Error("glyphs > 65535 not supported");if(S.ranges[D])return{stack:c,id:y,glyph:T};if(!this.url)throw new Error("glyphsUrl is not set");if(!S.requests[D]){const B=ge.loadGlyphRange(c,D,this.url,this.requestManager);S.requests[D]=B}const N=yield S.requests[D];for(const B in N)this._doesCharSupportLocalGlyph(+B)||(S.glyphs[+B]=N[+B]);return S.ranges[D]=!0,{stack:c,id:y,glyph:N[y]||null}})}_doesCharSupportLocalGlyph(c){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(c))}_tinySDF(c,y,S){const T=this.localIdeographFontFamily;if(!T||!this._doesCharSupportLocalGlyph(S))return;let D=c.tinySDF;if(!D){let B="400";/bold/i.test(y)?B="900":/medium/i.test(y)?B="500":/light/i.test(y)&&(B="200"),D=c.tinySDF=new ge.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:T,fontWeight:B})}const N=D.draw(String.fromCharCode(S));return{id:S,bitmap:new s.o({width:N.width||60,height:N.height||60},N.data),metrics:{width:N.glyphWidth/2||24,height:N.glyphHeight/2||24,left:N.glyphLeft/2+.5||0,top:N.glyphTop/2-27.5||-8,advance:N.glyphAdvance/2||24,isDoubleResolution:!0}}}}ge.loadGlyphRange=function(M,c,y,S){return s._(this,void 0,void 0,function*(){const T=256*c,D=T+255,N=S.transformRequest(y.replace("{fontstack}",M).replace("{range}",`${T}-${D}`),"Glyphs"),B=yield s.l(N,new AbortController);if(!B||!B.data)throw new Error(`Could not load glyph range. range: ${c}, ${T}-${D}`);const G={};for(const q of s.n(B.data))G[q.id]=q;return G})},ge.TinySDF=class{constructor({fontSize:M=24,buffer:c=3,radius:y=8,cutoff:S=.25,fontFamily:T="sans-serif",fontWeight:D="normal",fontStyle:N="normal"}={}){this.buffer=c,this.cutoff=S,this.radius=y;const B=this.size=M+4*c,G=this._createCanvas(B),q=this.ctx=G.getContext("2d",{willReadFrequently:!0});q.font=`${N} ${D} ${M}px ${T}`,q.textBaseline="alphabetic",q.textAlign="left",q.fillStyle="black",this.gridOuter=new Float64Array(B*B),this.gridInner=new Float64Array(B*B),this.f=new Float64Array(B),this.z=new Float64Array(B+1),this.v=new Uint16Array(B)}_createCanvas(M){const c=document.createElement("canvas");return c.width=c.height=M,c}draw(M){const{width:c,actualBoundingBoxAscent:y,actualBoundingBoxDescent:S,actualBoundingBoxLeft:T,actualBoundingBoxRight:D}=this.ctx.measureText(M),N=Math.ceil(y),B=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(D-T))),G=Math.min(this.size-this.buffer,N+Math.ceil(S)),q=B+2*this.buffer,K=G+2*this.buffer,J=Math.max(q*K,0),ie=new Uint8ClampedArray(J),de={data:ie,width:q,height:K,glyphWidth:B,glyphHeight:G,glyphTop:N,glyphLeft:0,glyphAdvance:c};if(B===0||G===0)return de;const{ctx:pe,buffer:_e,gridInner:Se,gridOuter:Te}=this;pe.clearRect(_e,_e,B,G),pe.fillText(M,_e,_e+N);const Ce=pe.getImageData(_e,_e,B,G);Te.fill(ue,0,J),Se.fill(0,0,J);for(let ve=0;ve0?Ke*Ke:0,Se[Be]=Ke<0?Ke*Ke:0}}fe(Te,0,0,q,K,q,this.f,this.v,this.z),fe(Se,_e,_e,B,G,q,this.f,this.v,this.z);for(let ve=0;ve1&&(G=c[++B]);const K=Math.abs(q-G.left),J=Math.abs(q-G.right),ie=Math.min(K,J);let de;const pe=D/S*(T+1);if(G.isDash){const _e=T-Math.abs(pe);de=Math.sqrt(ie*ie+_e*_e)}else de=T-Math.sqrt(ie*ie+pe*pe);this.data[N+q]=Math.max(0,Math.min(255,de+128))}}}addRegularDash(c){for(let B=c.length-1;B>=0;--B){const G=c[B],q=c[B+1];G.zeroLength?c.splice(B,1):q&&q.isDash===G.isDash&&(q.left=G.left,c.splice(B,1))}const y=c[0],S=c[c.length-1];y.isDash===S.isDash&&(y.left=S.left-this.width,S.right=y.right+this.width);const T=this.width*this.nextRow;let D=0,N=c[D];for(let B=0;B1&&(N=c[++D]);const G=Math.abs(B-N.left),q=Math.abs(B-N.right),K=Math.min(G,q);this.data[T+B]=Math.max(0,Math.min(255,(N.isDash?K:-K)+128))}}addDash(c,y){const S=y?7:0,T=2*S+1;if(this.nextRow+T>this.height)return s.w("LineAtlas out of space"),null;let D=0;for(let B=0;B{y.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[et]}numActive(){return Object.keys(this.active).length}}const kt=Math.floor(f.hardwareConcurrency/2);let Ht,lt;function st(){return Ht||(Ht=new it),Ht}it.workerCount=s.C(globalThis)?Math.max(Math.min(kt,3),1):1;class Ct{constructor(c,y){this.workerPool=c,this.actors=[],this.currentActor=0,this.id=y;const S=this.workerPool.acquire(y);for(let T=0;T{y.remove()}),this.actors=[],c&&this.workerPool.release(this.id)}registerMessageHandler(c,y){for(const S of this.actors)S.registerMessageHandler(c,y)}}function rt(){return lt||(lt=new Ct(st(),s.G),lt.registerMessageHandler("GR",(M,c,y)=>s.m(c,y))),lt}function vt(M,c){const y=s.H();return s.J(y,y,[1,1,0]),s.K(y,y,[.5*M.width,.5*M.height,1]),s.L(y,y,M.calculatePosMatrix(c.toUnwrapped()))}function Qe(M,c,y,S,T,D){const N=function(J,ie,de){if(J)for(const pe of J){const _e=ie[pe];if(_e&&_e.source===de&&_e.type==="fill-extrusion")return!0}else for(const pe in ie){const _e=ie[pe];if(_e.source===de&&_e.type==="fill-extrusion")return!0}return!1}(T&&T.layers,c,M.id),B=D.maxPitchScaleFactor(),G=M.tilesIn(S,B,N);G.sort(Ft);const q=[];for(const J of G)q.push({wrappedTileID:J.tileID.wrapped().key,queryResults:J.tile.queryRenderedFeatures(c,y,M._state,J.queryGeometry,J.cameraQueryGeometry,J.scale,T,D,B,vt(M.transform,J.tileID))});const K=function(J){const ie={},de={};for(const pe of J){const _e=pe.queryResults,Se=pe.wrappedTileID,Te=de[Se]=de[Se]||{};for(const Ce in _e){const ve=_e[Ce],Ie=Te[Ce]=Te[Ce]||{},Pe=ie[Ce]=ie[Ce]||[];for(const Be of ve)Ie[Be.featureIndex]||(Ie[Be.featureIndex]=!0,Pe.push(Be))}}return ie}(q);for(const J in K)K[J].forEach(ie=>{const de=ie.feature,pe=M.getFeatureState(de.layer["source-layer"],de.id);de.source=de.layer.source,de.layer["source-layer"]&&(de.sourceLayer=de.layer["source-layer"]),de.state=pe});return K}function Ft(M,c){const y=M.tileID,S=c.tileID;return y.overscaledZ-S.overscaledZ||y.canonical.y-S.canonical.y||y.wrap-S.wrap||y.canonical.x-S.canonical.x}function Kt(M,c,y){return s._(this,void 0,void 0,function*(){let S=M;if(M.url?S=(yield s.h(c.transformRequest(M.url,"Source"),y)).data:yield f.frameAsync(y),!S)return null;const T=s.M(s.e(S,M),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in S&&S.vector_layers&&(T.vectorLayerIds=S.vector_layers.map(D=>D.id)),T})}class Le{constructor(c,y){c&&(y?this.setSouthWest(c).setNorthEast(y):Array.isArray(c)&&(c.length===4?this.setSouthWest([c[0],c[1]]).setNorthEast([c[2],c[3]]):this.setSouthWest(c[0]).setNorthEast(c[1])))}setNorthEast(c){return this._ne=c instanceof s.N?new s.N(c.lng,c.lat):s.N.convert(c),this}setSouthWest(c){return this._sw=c instanceof s.N?new s.N(c.lng,c.lat):s.N.convert(c),this}extend(c){const y=this._sw,S=this._ne;let T,D;if(c instanceof s.N)T=c,D=c;else{if(!(c instanceof Le))return Array.isArray(c)?c.length===4||c.every(Array.isArray)?this.extend(Le.convert(c)):this.extend(s.N.convert(c)):c&&("lng"in c||"lon"in c)&&"lat"in c?this.extend(s.N.convert(c)):this;if(T=c._sw,D=c._ne,!T||!D)return this}return y||S?(y.lng=Math.min(T.lng,y.lng),y.lat=Math.min(T.lat,y.lat),S.lng=Math.max(D.lng,S.lng),S.lat=Math.max(D.lat,S.lat)):(this._sw=new s.N(T.lng,T.lat),this._ne=new s.N(D.lng,D.lat)),this}getCenter(){return new s.N((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 s.N(this.getWest(),this.getNorth())}getSouthEast(){return new s.N(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(c){const{lng:y,lat:S}=s.N.convert(c);let T=this._sw.lng<=y&&y<=this._ne.lng;return this._sw.lng>this._ne.lng&&(T=this._sw.lng>=y&&y>=this._ne.lng),this._sw.lat<=S&&S<=this._ne.lat&&T}static convert(c){return c instanceof Le?c:c&&new Le(c)}static fromLngLat(c,y=0){const S=360*y/40075017,T=S/Math.cos(Math.PI/180*c.lat);return new Le(new s.N(c.lng-T,c.lat-S),new s.N(c.lng+T,c.lat+S))}adjustAntiMeridian(){const c=new s.N(this._sw.lng,this._sw.lat),y=new s.N(this._ne.lng,this._ne.lat);return new Le(c,c.lng>y.lng?new s.N(y.lng+360,y.lat):y)}}class Mr{constructor(c,y,S){this.bounds=Le.convert(this.validateBounds(c)),this.minzoom=y||0,this.maxzoom=S||24}validateBounds(c){return Array.isArray(c)&&c.length===4?[Math.max(-180,c[0]),Math.max(-90,c[1]),Math.min(180,c[2]),Math.min(90,c[3])]:[-180,-90,180,90]}contains(c){const y=Math.pow(2,c.z),S=Math.floor(s.O(this.bounds.getWest())*y),T=Math.floor(s.Q(this.bounds.getNorth())*y),D=Math.ceil(s.O(this.bounds.getEast())*y),N=Math.ceil(s.Q(this.bounds.getSouth())*y);return c.x>=S&&c.x=T&&c.y{this._options.tiles=c}),this}setUrl(c){return this.setSourceProperty(()=>{this.url=c,this._options.url=c}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return s.e({},this._options)}loadTile(c){return s._(this,void 0,void 0,function*(){const y=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),S={request:this.map._requestManager.transformRequest(y,"Tile"),uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,tileSize:this.tileSize*c.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};S.request.collectResourceTiming=this._collectResourceTiming;let T="RT";if(c.actor&&c.state!=="expired"){if(c.state==="loading")return new Promise((D,N)=>{c.reloadPromise={resolve:D,reject:N}})}else c.actor=this.dispatcher.getActor(),T="LT";c.abortController=new AbortController;try{const D=yield c.actor.sendAsync({type:T,data:S},c.abortController);if(delete c.abortController,c.aborted)return;this._afterTileLoadWorkerResponse(c,D)}catch(D){if(delete c.abortController,c.aborted)return;if(D&&D.status!==404)throw D;this._afterTileLoadWorkerResponse(c,null)}})}_afterTileLoadWorkerResponse(c,y){if(y&&y.resourceTiming&&(c.resourceTiming=y.resourceTiming),y&&this.map._refreshExpiredTiles&&c.setExpiryData(y),c.loadVectorData(y,this.map.painter),c.reloadPromise){const S=c.reloadPromise;c.reloadPromise=null,this.loadTile(c).then(S.resolve).catch(S.reject)}}abortTile(c){return s._(this,void 0,void 0,function*(){c.abortController&&(c.abortController.abort(),delete c.abortController),c.actor&&(yield c.actor.sendAsync({type:"AT",data:{uid:c.uid,type:this.type,source:this.id}}))})}unloadTile(c){return s._(this,void 0,void 0,function*(){c.unloadVectorData(),c.actor&&(yield c.actor.sendAsync({type:"RMT",data:{uid:c.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Xt extends s.E{constructor(c,y,S,T){super(),this.id=c,this.dispatcher=S,this.setEventedParent(T),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=s.e({type:"raster"},y),s.e(this,s.M(y,["url","scheme","tileSize"]))}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const c=yield Kt(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,c&&(s.e(this,c),c.bounds&&(this.tileBounds=new Mr(c.bounds,this.minzoom,this.maxzoom)),this.fire(new s.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new s.k("data",{dataType:"source",sourceDataType:"content"})))}catch(c){this._tileJSONRequest=null,this.fire(new s.j(c))}})}loaded(){return this._loaded}onAdd(c){this.map=c,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(c){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),c(),this.load()}setTiles(c){return this.setSourceProperty(()=>{this._options.tiles=c}),this}setUrl(c){return this.setSourceProperty(()=>{this.url=c,this._options.url=c}),this}serialize(){return s.e({},this._options)}hasTile(c){return!this.tileBounds||this.tileBounds.contains(c.canonical)}loadTile(c){return s._(this,void 0,void 0,function*(){const y=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);c.abortController=new AbortController;try{const S=yield L.getImage(this.map._requestManager.transformRequest(y,"Tile"),c.abortController,this.map._refreshExpiredTiles);if(delete c.abortController,c.aborted)return void(c.state="unloaded");if(S&&S.data){this.map._refreshExpiredTiles&&S.cacheControl&&S.expires&&c.setExpiryData({cacheControl:S.cacheControl,expires:S.expires});const T=this.map.painter.context,D=T.gl,N=S.data;c.texture=this.map.painter.getTileTexture(N.width),c.texture?c.texture.update(N,{useMipmap:!0}):(c.texture=new Y(T,N,D.RGBA,{useMipmap:!0}),c.texture.bind(D.LINEAR,D.CLAMP_TO_EDGE,D.LINEAR_MIPMAP_NEAREST)),c.state="loaded"}}catch(S){if(delete c.abortController,c.aborted)c.state="unloaded";else if(S)throw c.state="errored",S}})}abortTile(c){return s._(this,void 0,void 0,function*(){c.abortController&&(c.abortController.abort(),delete c.abortController)})}unloadTile(c){return s._(this,void 0,void 0,function*(){c.texture&&this.map.painter.saveTileTexture(c.texture)})}hasTransition(){return!1}}class nr extends Xt{constructor(c,y,S,T){super(c,y,S,T),this.type="raster-dem",this.maxzoom=22,this._options=s.e({type:"raster-dem"},y),this.encoding=y.encoding||"mapbox",this.redFactor=y.redFactor,this.greenFactor=y.greenFactor,this.blueFactor=y.blueFactor,this.baseShift=y.baseShift}loadTile(c){return s._(this,void 0,void 0,function*(){const y=c.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),S=this.map._requestManager.transformRequest(y,"Tile");c.neighboringTiles=this._getNeighboringTiles(c.tileID),c.abortController=new AbortController;try{const T=yield L.getImage(S,c.abortController,this.map._refreshExpiredTiles);if(delete c.abortController,c.aborted)return void(c.state="unloaded");if(T&&T.data){const D=T.data;this.map._refreshExpiredTiles&&T.cacheControl&&T.expires&&c.setExpiryData({cacheControl:T.cacheControl,expires:T.expires});const N=s.b(D)&&s.U()?D:yield this.readImageNow(D),B={type:this.type,uid:c.uid,source:this.id,rawImageData:N,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!c.actor||c.state==="expired"){c.actor=this.dispatcher.getActor();const G=yield c.actor.sendAsync({type:"LDT",data:B});c.dem=G,c.needsHillshadePrepare=!0,c.needsTerrainPrepare=!0,c.state="loaded"}}}catch(T){if(delete c.abortController,c.aborted)c.state="unloaded";else if(T)throw c.state="errored",T}})}readImageNow(c){return s._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&s.V()){const y=c.width+2,S=c.height+2;try{return new s.R({width:y,height:S},yield s.W(c,-1,-1,y,S))}catch{}}return f.getImageData(c,1)})}_getNeighboringTiles(c){const y=c.canonical,S=Math.pow(2,y.z),T=(y.x-1+S)%S,D=y.x===0?c.wrap-1:c.wrap,N=(y.x+1+S)%S,B=y.x+1===S?c.wrap+1:c.wrap,G={};return G[new s.S(c.overscaledZ,D,y.z,T,y.y).key]={backfilled:!1},G[new s.S(c.overscaledZ,B,y.z,N,y.y).key]={backfilled:!1},y.y>0&&(G[new s.S(c.overscaledZ,D,y.z,T,y.y-1).key]={backfilled:!1},G[new s.S(c.overscaledZ,c.wrap,y.z,y.x,y.y-1).key]={backfilled:!1},G[new s.S(c.overscaledZ,B,y.z,N,y.y-1).key]={backfilled:!1}),y.y+10&&s.e(D,{resourceTiming:T}),this.fire(new s.k("data",Object.assign(Object.assign({},D),{sourceDataType:"metadata"}))),this.fire(new s.k("data",Object.assign(Object.assign({},D),{sourceDataType:"content"})))}catch(S){if(this._pendingLoads--,this._removed)return void this.fire(new s.k("dataabort",{dataType:"source"}));this.fire(new s.j(S))}})}loaded(){return this._pendingLoads===0}loadTile(c){return s._(this,void 0,void 0,function*(){const y=c.actor?"RT":"LT";c.actor=this.actor;const S={type:this.type,uid:c.uid,tileID:c.tileID,zoom:c.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};c.abortController=new AbortController;const T=yield this.actor.sendAsync({type:y,data:S},c.abortController);delete c.abortController,c.unloadVectorData(),c.aborted||c.loadVectorData(T,this.map.painter,y==="RT")})}abortTile(c){return s._(this,void 0,void 0,function*(){c.abortController&&(c.abortController.abort(),delete c.abortController),c.aborted=!0})}unloadTile(c){return s._(this,void 0,void 0,function*(){c.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:c.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 s.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var Yn=s.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class Tn extends s.E{constructor(c,y,S,T){super(),this.id=c,this.dispatcher=S,this.coordinates=y.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(T),this.options=y}load(c){return s._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new s.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const y=yield L.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,y&&y.data&&(this.image=y.data,c&&(this.coordinates=c),this._finishLoading())}catch(y){this._request=null,this._loaded=!0,this.fire(new s.j(y))}})}loaded(){return this._loaded}updateImage(c){return c.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=c.url,this.load(c.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new s.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(c){this.map=c,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(c){this.coordinates=c;const y=c.map(s.Z.fromLngLat);this.tileID=function(T){let D=1/0,N=1/0,B=-1/0,G=-1/0;for(const ie of T)D=Math.min(D,ie.x),N=Math.min(N,ie.y),B=Math.max(B,ie.x),G=Math.max(G,ie.y);const q=Math.max(B-D,G-N),K=Math.max(0,Math.floor(-Math.log(q)/Math.LN2)),J=Math.pow(2,K);return new s.a1(K,Math.floor((D+B)/2*J),Math.floor((N+G)/2*J))}(y),this.minzoom=this.maxzoom=this.tileID.z;const S=y.map(T=>this.tileID.getTilePoint(T)._round());return this._boundsArray=new s.$,this._boundsArray.emplaceBack(S[0].x,S[0].y,0,0),this._boundsArray.emplaceBack(S[1].x,S[1].y,s.X,0),this._boundsArray.emplaceBack(S[3].x,S[3].y,0,s.X),this._boundsArray.emplaceBack(S[2].x,S[2].y,s.X,s.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new s.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const c=this.map.painter.context,y=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,Yn.members)),this.boundsSegments||(this.boundsSegments=s.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Y(c,this.image,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE));let S=!1;for(const T in this.tiles){const D=this.tiles[T];D.state!=="loaded"&&(D.state="loaded",D.texture=this.texture,S=!0)}S&&this.fire(new s.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(c){return s._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(c.tileID.canonical)?(this.tiles[String(c.tileID.wrap)]=c,c.buckets={}):c.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Aa extends Tn{constructor(c,y,S,T){super(c,y,S,T),this.roundZoom=!0,this.type="video",this.options=y}load(){return s._(this,void 0,void 0,function*(){this._loaded=!1;const c=this.options;this.urls=[];for(const y of c.urls)this.urls.push(this.map._requestManager.transformRequest(y,"Source").url);try{const y=yield s.a3(this.urls);if(this._loaded=!0,!y)return;this.video=y,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(y){this.fire(new s.j(y))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(c){if(this.video){const y=this.video.seekable;cy.end(0)?this.fire(new s.j(new s.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${y.start(0)} and ${y.end(0)}-second mark.`))):this.video.currentTime=c}}getVideo(){return this.video}onAdd(c){this.map||(this.map=c,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const c=this.map.painter.context,y=c.gl;this.boundsBuffer||(this.boundsBuffer=c.createVertexBuffer(this._boundsArray,Yn.members)),this.boundsSegments||(this.boundsSegments=s.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE),y.texSubImage2D(y.TEXTURE_2D,0,0,0,y.RGBA,y.UNSIGNED_BYTE,this.video)):(this.texture=new Y(c,this.video,y.RGBA),this.texture.bind(y.LINEAR,y.CLAMP_TO_EDGE));let S=!1;for(const T in this.tiles){const D=this.tiles[T];D.state!=="loaded"&&(D.state="loaded",D.texture=this.texture,S=!0)}S&&this.fire(new s.k("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 Pn extends Tn{constructor(c,y,S,T){super(c,y,S,T),y.coordinates?Array.isArray(y.coordinates)&&y.coordinates.length===4&&!y.coordinates.some(D=>!Array.isArray(D)||D.length!==2||D.some(N=>typeof N!="number"))||this.fire(new s.j(new s.a2(`sources.${c}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new s.j(new s.a2(`sources.${c}`,null,'missing required property "coordinates"'))),y.animate&&typeof y.animate!="boolean"&&this.fire(new s.j(new s.a2(`sources.${c}`,null,'optional "animate" property must be a boolean value'))),y.canvas?typeof y.canvas=="string"||y.canvas instanceof HTMLCanvasElement||this.fire(new s.j(new s.a2(`sources.${c}`,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 s.j(new s.a2(`sources.${c}`,null,'missing required property "canvas"'))),this.options=y,this.animate=y.animate===void 0||y.animate}load(){return s._(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 s.j(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(c){this.map=c,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let c=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,c=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,c=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const y=this.map.painter.context,S=y.gl;this.boundsBuffer||(this.boundsBuffer=y.createVertexBuffer(this._boundsArray,Yn.members)),this.boundsSegments||(this.boundsSegments=s.a0.simpleSegment(0,0,4,2)),this.texture?(c||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Y(y,this.canvas,S.RGBA,{premultiply:!0});let T=!1;for(const D in this.tiles){const N=this.tiles[D];N.state!=="loaded"&&(N.state="loaded",N.texture=this.texture,T=!0)}T&&this.fire(new s.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const c of[this.canvas.width,this.canvas.height])if(isNaN(c)||c<=0)return!0;return!1}}const mt={},$t=M=>{switch(M){case"geojson":return lr;case"image":return Tn;case"raster":return Xt;case"raster-dem":return nr;case"vector":return Lt;case"video":return Aa;case"canvas":return Pn}return mt[M]},qe="RTLPluginLoaded";class wr extends s.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=rt()}_syncState(c){return this.status=c,this.dispatcher.broadcast("SRPS",{pluginStatus:c,pluginURL:this.url}).catch(y=>{throw this.status="error",y})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(c){return s._(this,arguments,void 0,function*(y,S=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=f.resolveURL(y),!this.url)throw new Error(`requested url ${y} is invalid`);if(this.status==="unavailable"){if(!S)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return s._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new s.k(qe))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let zr=null;function Dn(){return zr||(zr=new wr),zr}class sa{constructor(c,y){this.timeAdded=0,this.fadeEndTime=0,this.tileID=c,this.uid=s.a4(),this.uses=0,this.tileSize=y,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(c){const y=c+this.timeAdded;yD.getLayer(q)).filter(Boolean);if(G.length!==0){B.layers=G,B.stateDependentLayerIds&&(B.stateDependentLayers=B.stateDependentLayerIds.map(q=>G.filter(K=>K.id===q)[0]));for(const q of G)N[q.id]=B}}return N}(c.buckets,y.style),this.hasSymbolBuckets=!1;for(const T in this.buckets){const D=this.buckets[T];if(D instanceof s.a6){if(this.hasSymbolBuckets=!0,!S)break;D.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const T in this.buckets){const D=this.buckets[T];if(D instanceof s.a6&&D.hasRTLText){this.hasRTLText=!0,Dn().lazyLoad();break}}this.queryPadding=0;for(const T in this.buckets){const D=this.buckets[T];this.queryPadding=Math.max(this.queryPadding,y.style.getLayer(T).queryRadius(D))}c.imageAtlas&&(this.imageAtlas=c.imageAtlas),c.glyphAtlasImage&&(this.glyphAtlasImage=c.glyphAtlasImage)}else this.collisionBoxArray=new s.a5}unloadVectorData(){for(const c in this.buckets)this.buckets[c].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(c){return this.buckets[c.id]}upload(c){for(const S in this.buckets){const T=this.buckets[S];T.uploadPending()&&T.upload(c)}const y=c.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Y(c,this.imageAtlas.image,y.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Y(c,this.glyphAtlasImage,y.ALPHA),this.glyphAtlasImage=null)}prepare(c){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(c,this.imageAtlasTexture)}queryRenderedFeatures(c,y,S,T,D,N,B,G,q,K){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:T,cameraQueryGeometry:D,scale:N,tileSize:this.tileSize,pixelPosMatrix:K,transform:G,params:B,queryPadding:this.queryPadding*q},c,y,S):{}}querySourceFeatures(c,y){const S=this.latestFeatureIndex;if(!S||!S.rawTileData)return;const T=S.loadVTLayers(),D=y&&y.sourceLayer?y.sourceLayer:"",N=T._geojsonTileLayer||T[D];if(!N)return;const B=s.a7(y&&y.filter),{z:G,x:q,y:K}=this.tileID.canonical,J={z:G,x:q,y:K};for(let ie=0;ieS)T=!1;else if(y)if(this.expirationTime{this.remove(c,D)},S)),this.data[T].push(D),this.order.push(T),this.order.length>this.max){const N=this._getAndRemoveByKey(this.order[0]);N&&this.onRemove(N)}return this}has(c){return c.wrapped().key in this.data}getAndRemove(c){return this.has(c)?this._getAndRemoveByKey(c.wrapped().key):null}_getAndRemoveByKey(c){const y=this.data[c].shift();return y.timeout&&clearTimeout(y.timeout),this.data[c].length===0&&delete this.data[c],this.order.splice(this.order.indexOf(c),1),y.value}getByKey(c){const y=this.data[c];return y?y[0].value:null}get(c){return this.has(c)?this.data[c.wrapped().key][0].value:null}remove(c,y){if(!this.has(c))return this;const S=c.wrapped().key,T=y===void 0?0:this.data[S].indexOf(y),D=this.data[S][T];return this.data[S].splice(T,1),D.timeout&&clearTimeout(D.timeout),this.data[S].length===0&&delete this.data[S],this.onRemove(D.value),this.order.splice(this.order.indexOf(S),1),this}setMaxSize(c){for(this.max=c;this.order.length>this.max;){const y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this}filter(c){const y=[];for(const S in this.data)for(const T of this.data[S])c(T.value)||y.push(T);for(const S of y)this.remove(S.value.tileID,S)}}class yr{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(c,y,S){const T=String(y);if(this.stateChanges[c]=this.stateChanges[c]||{},this.stateChanges[c][T]=this.stateChanges[c][T]||{},s.e(this.stateChanges[c][T],S),this.deletedStates[c]===null){this.deletedStates[c]={};for(const D in this.state[c])D!==T&&(this.deletedStates[c][D]=null)}else if(this.deletedStates[c]&&this.deletedStates[c][T]===null){this.deletedStates[c][T]={};for(const D in this.state[c][T])S[D]||(this.deletedStates[c][T][D]=null)}else for(const D in S)this.deletedStates[c]&&this.deletedStates[c][T]&&this.deletedStates[c][T][D]===null&&delete this.deletedStates[c][T][D]}removeFeatureState(c,y,S){if(this.deletedStates[c]===null)return;const T=String(y);if(this.deletedStates[c]=this.deletedStates[c]||{},S&&y!==void 0)this.deletedStates[c][T]!==null&&(this.deletedStates[c][T]=this.deletedStates[c][T]||{},this.deletedStates[c][T][S]=null);else if(y!==void 0)if(this.stateChanges[c]&&this.stateChanges[c][T])for(S in this.deletedStates[c][T]={},this.stateChanges[c][T])this.deletedStates[c][T][S]=null;else this.deletedStates[c][T]=null;else this.deletedStates[c]=null}getState(c,y){const S=String(y),T=s.e({},(this.state[c]||{})[S],(this.stateChanges[c]||{})[S]);if(this.deletedStates[c]===null)return{};if(this.deletedStates[c]){const D=this.deletedStates[c][y];if(D===null)return{};for(const N in D)delete T[N]}return T}initializeTileState(c,y){c.setFeatureState(this.state,y)}coalesceChanges(c,y){const S={};for(const T in this.stateChanges){this.state[T]=this.state[T]||{};const D={};for(const N in this.stateChanges[T])this.state[T][N]||(this.state[T][N]={}),s.e(this.state[T][N],this.stateChanges[T][N]),D[N]=this.state[T][N];S[T]=D}for(const T in this.deletedStates){this.state[T]=this.state[T]||{};const D={};if(this.deletedStates[T]===null)for(const N in this.state[T])D[N]={},this.state[T][N]={};else for(const N in this.deletedStates[T]){if(this.deletedStates[T][N]===null)this.state[T][N]={};else for(const B of Object.keys(this.deletedStates[T][N]))delete this.state[T][N][B];D[N]=this.state[T][N]}S[T]=S[T]||{},s.e(S[T],D)}if(this.stateChanges={},this.deletedStates={},Object.keys(S).length!==0)for(const T in c)c[T].setFeatureState(S,y)}}class tr extends s.E{constructor(c,y,S){super(),this.id=c,this.dispatcher=S,this.on("data",T=>this._dataHandler(T)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((T,D,N,B)=>{const G=new($t(D.type))(T,D,N,B);if(G.id!==T)throw new Error(`Expected Source id to be ${T} instead of ${G.id}`);return G})(c,y,S,this),this._tiles={},this._cache=new ct(0,T=>this._unloadTile(T)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new yr,this._didEmitContent=!1,this._updated=!1}onAdd(c){this.map=c,this._maxTileCacheSize=c?c._maxTileCacheSize:null,this._maxTileCacheZoomLevels=c?c._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(c)}onRemove(c){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(c)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const c in this._tiles){const y=this._tiles[c];if(y.state!=="loaded"&&y.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const c=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,c&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(c,y,S){return s._(this,void 0,void 0,function*(){try{yield this._source.loadTile(c),this._tileLoaded(c,y,S)}catch(T){c.state="errored",T.status!==404?this._source.fire(new s.j(T,{tile:c})):this.update(this.transform,this.terrain)}})}_unloadTile(c){this._source.unloadTile&&this._source.unloadTile(c)}_abortTile(c){this._source.abortTile&&this._source.abortTile(c),this._source.fire(new s.k("dataabort",{tile:c,coord:c.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(c){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const y in this._tiles){const S=this._tiles[y];S.upload(c),S.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(c=>c.tileID).sort(fi).map(c=>c.key)}getRenderableIds(c){const y=[];for(const S in this._tiles)this._isIdRenderable(S,c)&&y.push(this._tiles[S]);return c?y.sort((S,T)=>{const D=S.tileID,N=T.tileID,B=new s.P(D.canonical.x,D.canonical.y)._rotate(this.transform.angle),G=new s.P(N.canonical.x,N.canonical.y)._rotate(this.transform.angle);return D.overscaledZ-N.overscaledZ||G.y-B.y||G.x-B.x}).map(S=>S.tileID.key):y.map(S=>S.tileID).sort(fi).map(S=>S.key)}hasRenderableParent(c){const y=this.findLoadedParent(c,0);return!!y&&this._isIdRenderable(y.tileID.key)}_isIdRenderable(c,y){return this._tiles[c]&&this._tiles[c].hasData()&&!this._coveredTiles[c]&&(y||!this._tiles[c].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const c in this._tiles)this._tiles[c].state!=="errored"&&this._reloadTile(c,"reloading")}}_reloadTile(c,y){return s._(this,void 0,void 0,function*(){const S=this._tiles[c];S&&(S.state!=="loading"&&(S.state=y),yield this._loadTile(S,c,y))})}_tileLoaded(c,y,S){c.timeAdded=f.now(),S==="expired"&&(c.refreshedUponExpiration=!0),this._setTileReloadTimer(y,c),this.getSource().type==="raster-dem"&&c.dem&&this._backfillDEM(c),this._state.initializeTileState(c,this.map?this.map.painter:null),c.aborted||this._source.fire(new s.k("data",{dataType:"source",tile:c,coord:c.tileID}))}_backfillDEM(c){const y=this.getRenderableIds();for(let T=0;T1||(Math.abs(N)>1&&(Math.abs(N+G)===1?N+=G:Math.abs(N-G)===1&&(N-=G)),D.dem&&T.dem&&(T.dem.backfillBorder(D.dem,N,B),T.neighboringTiles&&T.neighboringTiles[q]&&(T.neighboringTiles[q].backfilled=!0)))}}getTile(c){return this.getTileByID(c.key)}getTileByID(c){return this._tiles[c]}_retainLoadedChildren(c,y,S,T){for(const D in this._tiles){let N=this._tiles[D];if(T[D]||!N.hasData()||N.tileID.overscaledZ<=y||N.tileID.overscaledZ>S)continue;let B=N.tileID;for(;N&&N.tileID.overscaledZ>y+1;){const q=N.tileID.scaledTo(N.tileID.overscaledZ-1);N=this._tiles[q.key],N&&N.hasData()&&(B=q)}let G=B;for(;G.overscaledZ>y;)if(G=G.scaledTo(G.overscaledZ-1),c[G.key]){T[B.key]=B;break}}}findLoadedParent(c,y){if(c.key in this._loadedParentTiles){const S=this._loadedParentTiles[c.key];return S&&S.tileID.overscaledZ>=y?S:null}for(let S=c.overscaledZ-1;S>=y;S--){const T=c.scaledTo(S),D=this._getLoadedTile(T);if(D)return D}}findLoadedSibling(c){return this._getLoadedTile(c)}_getLoadedTile(c){const y=this._tiles[c.key];return y&&y.hasData()?y:this._cache.getByKey(c.wrapped().key)}updateCacheSize(c){const y=Math.ceil(c.width/this._source.tileSize)+1,S=Math.ceil(c.height/this._source.tileSize)+1,T=Math.floor(y*S*(this._maxTileCacheZoomLevels===null?s.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),D=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,T):T;this._cache.setMaxSize(D)}handleWrapJump(c){const y=Math.round((c-(this._prevLng===void 0?c:this._prevLng))/360);if(this._prevLng=c,y){const S={};for(const T in this._tiles){const D=this._tiles[T];D.tileID=D.tileID.unwrapTo(D.tileID.wrap+y),S[D.tileID.key]=D}this._tiles=S;for(const T in this._timers)clearTimeout(this._timers[T]),delete this._timers[T];for(const T in this._tiles)this._setTileReloadTimer(T,this._tiles[T])}}_updateCoveredAndRetainedTiles(c,y,S,T,D,N){const B={},G={},q=Object.keys(c),K=f.now();for(const J of q){const ie=c[J],de=this._tiles[J];if(!de||de.fadeEndTime!==0&&de.fadeEndTime<=K)continue;const pe=this.findLoadedParent(ie,y),_e=this.findLoadedSibling(ie),Se=pe||_e||null;Se&&(this._addTile(Se.tileID),B[Se.tileID.key]=Se.tileID),G[J]=ie}this._retainLoadedChildren(G,T,S,c);for(const J in B)c[J]||(this._coveredTiles[J]=!0,c[J]=B[J]);if(N){const J={},ie={};for(const de of D)this._tiles[de.key].hasData()?J[de.key]=de:ie[de.key]=de;for(const de in ie){const pe=ie[de].children(this._source.maxzoom);this._tiles[pe[0].key]&&this._tiles[pe[1].key]&&this._tiles[pe[2].key]&&this._tiles[pe[3].key]&&(J[pe[0].key]=c[pe[0].key]=pe[0],J[pe[1].key]=c[pe[1].key]=pe[1],J[pe[2].key]=c[pe[2].key]=pe[2],J[pe[3].key]=c[pe[3].key]=pe[3],delete ie[de])}for(const de in ie){const pe=ie[de],_e=this.findLoadedParent(pe,this._source.minzoom),Se=this.findLoadedSibling(pe),Te=_e||Se||null;if(Te){J[Te.tileID.key]=c[Te.tileID.key]=Te.tileID;for(const Ce in J)J[Ce].isChildOf(Te.tileID)&&delete J[Ce]}}for(const de in this._tiles)J[de]||(this._coveredTiles[de]=!0)}}update(c,y){if(!this._sourceLoaded||this._paused)return;let S;this.transform=c,this.terrain=y,this.updateCacheSize(c),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?S=c.getVisibleUnwrappedCoordinates(this._source.tileID).map(K=>new s.S(K.canonical.z,K.wrap,K.canonical.z,K.canonical.x,K.canonical.y)):(S=c.coveringTiles({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:y}),this._source.hasTile&&(S=S.filter(K=>this._source.hasTile(K)))):S=[];const T=c.coveringZoomLevel(this._source),D=Math.max(T-tr.maxOverzooming,this._source.minzoom),N=Math.max(T+tr.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const K={};for(const J of S)if(J.canonical.z>this._source.minzoom){const ie=J.scaledTo(J.canonical.z-1);K[ie.key]=ie;const de=J.scaledTo(Math.max(this._source.minzoom,Math.min(J.canonical.z,5)));K[de.key]=de}S=S.concat(Object.values(K))}const B=S.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,B&&this.fire(new s.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const G=this._updateRetainedTiles(S,T);la(this._source.type)&&this._updateCoveredAndRetainedTiles(G,D,N,T,S,y);for(const K in G)this._tiles[K].clearFadeHold();const q=s.ab(this._tiles,G);for(const K of q){const J=this._tiles[K];J.hasSymbolBuckets&&!J.holdingForFade()?J.setHoldDuration(this.map._fadeDuration):J.hasSymbolBuckets&&!J.symbolFadeFinished()||this._removeTile(K)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const c in this._tiles)this._tiles[c].holdingForFade()&&this._removeTile(c)}_updateRetainedTiles(c,y){var S;const T={},D={},N=Math.max(y-tr.maxOverzooming,this._source.minzoom),B=Math.max(y+tr.maxUnderzooming,this._source.minzoom),G={};for(const q of c){const K=this._addTile(q);T[q.key]=q,K.hasData()||ythis._source.maxzoom){const ie=q.children(this._source.maxzoom)[0],de=this.getTile(ie);if(de&&de.hasData()){T[ie.key]=ie;continue}}else{const ie=q.children(this._source.maxzoom);if(T[ie[0].key]&&T[ie[1].key]&&T[ie[2].key]&&T[ie[3].key])continue}let J=K.wasRequested();for(let ie=q.overscaledZ-1;ie>=N;--ie){const de=q.scaledTo(ie);if(D[de.key])break;if(D[de.key]=!0,K=this.getTile(de),!K&&J&&(K=this._addTile(de)),K){const pe=K.hasData();if((pe||!(!((S=this.map)===null||S===void 0)&&S.cancelPendingTileRequestsWhileZooming)||J)&&(T[de.key]=de),J=K.wasRequested(),pe)break}}}return T}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const c in this._tiles){const y=[];let S,T=this._tiles[c].tileID;for(;T.overscaledZ>0;){if(T.key in this._loadedParentTiles){S=this._loadedParentTiles[T.key];break}y.push(T.key);const D=T.scaledTo(T.overscaledZ-1);if(S=this._getLoadedTile(D),S)break;T=D}for(const D of y)this._loadedParentTiles[D]=S}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const c in this._tiles){const y=this._tiles[c].tileID,S=this._getLoadedTile(y);this._loadedSiblingTiles[y.key]=S}}_addTile(c){let y=this._tiles[c.key];if(y)return y;y=this._cache.getAndRemove(c),y&&(this._setTileReloadTimer(c.key,y),y.tileID=c,this._state.initializeTileState(y,this.map?this.map.painter:null),this._cacheTimers[c.key]&&(clearTimeout(this._cacheTimers[c.key]),delete this._cacheTimers[c.key],this._setTileReloadTimer(c.key,y)));const S=y;return y||(y=new sa(c,this._source.tileSize*c.overscaleFactor()),this._loadTile(y,c.key,y.state)),y.uses++,this._tiles[c.key]=y,S||this._source.fire(new s.k("dataloading",{tile:y,coord:y.tileID,dataType:"source"})),y}_setTileReloadTimer(c,y){c in this._timers&&(clearTimeout(this._timers[c]),delete this._timers[c]);const S=y.getExpiryTimeout();S&&(this._timers[c]=setTimeout(()=>{this._reloadTile(c,"expired"),delete this._timers[c]},S))}_removeTile(c){const y=this._tiles[c];y&&(y.uses--,delete this._tiles[c],this._timers[c]&&(clearTimeout(this._timers[c]),delete this._timers[c]),y.uses>0||(y.hasData()&&y.state!=="reloading"?this._cache.add(y.tileID,y,y.getExpiryTimeout()):(y.aborted=!0,this._abortTile(y),this._unloadTile(y))))}_dataHandler(c){const y=c.sourceDataType;c.dataType==="source"&&y==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&c.dataType==="source"&&y==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const c in this._tiles)this._removeTile(c);this._cache.reset()}tilesIn(c,y,S){const T=[],D=this.transform;if(!D)return T;const N=S?D.getCameraQueryGeometry(c):c,B=c.map(pe=>D.pointCoordinate(pe,this.terrain)),G=N.map(pe=>D.pointCoordinate(pe,this.terrain)),q=this.getIds();let K=1/0,J=1/0,ie=-1/0,de=-1/0;for(const pe of G)K=Math.min(K,pe.x),J=Math.min(J,pe.y),ie=Math.max(ie,pe.x),de=Math.max(de,pe.y);for(let pe=0;pe=0&&ve[1].y+Ce>=0){const Ie=B.map(Be=>Se.getTilePoint(Be)),Pe=G.map(Be=>Se.getTilePoint(Be));T.push({tile:_e,tileID:Se,queryGeometry:Ie,cameraQueryGeometry:Pe,scale:Te})}}return T}getVisibleCoordinates(c){const y=this.getRenderableIds(c).map(S=>this._tiles[S].tileID);for(const S of y)S.posMatrix=this.transform.calculatePosMatrix(S.toUnwrapped());return y}hasTransition(){if(this._source.hasTransition())return!0;if(la(this._source.type)){const c=f.now();for(const y in this._tiles)if(this._tiles[y].fadeEndTime>=c)return!0}return!1}setFeatureState(c,y,S){this._state.updateState(c=c||"_geojsonTileLayer",y,S)}removeFeatureState(c,y,S){this._state.removeFeatureState(c=c||"_geojsonTileLayer",y,S)}getFeatureState(c,y){return this._state.getState(c=c||"_geojsonTileLayer",y)}setDependencies(c,y,S){const T=this._tiles[c];T&&T.setDependencies(y,S)}reloadTilesForDependencies(c,y){for(const S in this._tiles)this._tiles[S].hasDependency(c,y)&&this._reloadTile(S,"reloading");this._cache.filter(S=>!S.hasDependency(c,y))}}function fi(M,c){const y=Math.abs(2*M.wrap)-+(M.wrap<0),S=Math.abs(2*c.wrap)-+(c.wrap<0);return M.overscaledZ-c.overscaledZ||S-y||c.canonical.y-M.canonical.y||c.canonical.x-M.canonical.x}function la(M){return M==="raster"||M==="image"||M==="video"}tr.maxOverzooming=10,tr.maxUnderzooming=3;class cr{constructor(c,y){this.reset(c,y)}reset(c,y){this.points=c||[],this._distances=[0];for(let S=1;S0?(T-N)/B:0;return this.points[D].mult(1-G).add(this.points[y].mult(G))}}function Da(M,c){let y=!0;return M==="always"||M!=="never"&&c!=="never"||(y=!1),y}class Br{constructor(c,y,S){const T=this.boxCells=[],D=this.circleCells=[];this.xCellCount=Math.ceil(c/S),this.yCellCount=Math.ceil(y/S);for(let N=0;Nthis.width||T<0||y>this.height)return[];const G=[];if(c<=0&&y<=0&&this.width<=S&&this.height<=T){if(D)return[{key:null,x1:c,y1:y,x2:S,y2:T}];for(let q=0;q0}hitTestCircle(c,y,S,T,D){const N=c-S,B=c+S,G=y-S,q=y+S;if(B<0||N>this.width||q<0||G>this.height)return!1;const K=[];return this._forEachCell(N,G,B,q,this._queryCellCircle,K,{hitTest:!0,overlapMode:T,circle:{x:c,y,radius:S},seenUids:{box:{},circle:{}}},D),K.length>0}_queryCell(c,y,S,T,D,N,B,G){const{seenUids:q,hitTest:K,overlapMode:J}=B,ie=this.boxCells[D];if(ie!==null){const pe=this.bboxes;for(const _e of ie)if(!q.box[_e]){q.box[_e]=!0;const Se=4*_e,Te=this.boxKeys[_e];if(c<=pe[Se+2]&&y<=pe[Se+3]&&S>=pe[Se+0]&&T>=pe[Se+1]&&(!G||G(Te))&&(!K||!Da(J,Te.overlapMode))&&(N.push({key:Te,x1:pe[Se],y1:pe[Se+1],x2:pe[Se+2],y2:pe[Se+3]}),K))return!0}}const de=this.circleCells[D];if(de!==null){const pe=this.circles;for(const _e of de)if(!q.circle[_e]){q.circle[_e]=!0;const Se=3*_e,Te=this.circleKeys[_e];if(this._circleAndRectCollide(pe[Se],pe[Se+1],pe[Se+2],c,y,S,T)&&(!G||G(Te))&&(!K||!Da(J,Te.overlapMode))){const Ce=pe[Se],ve=pe[Se+1],Ie=pe[Se+2];if(N.push({key:Te,x1:Ce-Ie,y1:ve-Ie,x2:Ce+Ie,y2:ve+Ie}),K)return!0}}}return!1}_queryCellCircle(c,y,S,T,D,N,B,G){const{circle:q,seenUids:K,overlapMode:J}=B,ie=this.boxCells[D];if(ie!==null){const pe=this.bboxes;for(const _e of ie)if(!K.box[_e]){K.box[_e]=!0;const Se=4*_e,Te=this.boxKeys[_e];if(this._circleAndRectCollide(q.x,q.y,q.radius,pe[Se+0],pe[Se+1],pe[Se+2],pe[Se+3])&&(!G||G(Te))&&!Da(J,Te.overlapMode))return N.push(!0),!0}}const de=this.circleCells[D];if(de!==null){const pe=this.circles;for(const _e of de)if(!K.circle[_e]){K.circle[_e]=!0;const Se=3*_e,Te=this.circleKeys[_e];if(this._circlesCollide(pe[Se],pe[Se+1],pe[Se+2],q.x,q.y,q.radius)&&(!G||G(Te))&&!Da(J,Te.overlapMode))return N.push(!0),!0}}}_forEachCell(c,y,S,T,D,N,B,G){const q=this._convertToXCellCoord(c),K=this._convertToYCellCoord(y),J=this._convertToXCellCoord(S),ie=this._convertToYCellCoord(T);for(let de=q;de<=J;de++)for(let pe=K;pe<=ie;pe++)if(D.call(this,c,y,S,T,this.xCellCount*pe+de,N,B,G))return}_convertToXCellCoord(c){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(c*this.xScale)))}_convertToYCellCoord(c){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(c*this.yScale)))}_circlesCollide(c,y,S,T,D,N){const B=T-c,G=D-y,q=S+N;return q*q>B*B+G*G}_circleAndRectCollide(c,y,S,T,D,N,B){const G=(N-T)/2,q=Math.abs(c-(T+G));if(q>G+S)return!1;const K=(B-D)/2,J=Math.abs(y-(D+K));if(J>K+S)return!1;if(q<=G||J<=K)return!0;const ie=q-G,de=J-K;return ie*ie+de*de<=S*S}}function ua(M,c,y,S,T){const D=s.H();return c?(s.K(D,D,[1/T,1/T,1]),y||s.ad(D,D,S.angle)):s.L(D,S.labelPlaneMatrix,M),D}function pi(M,c,y,S,T){if(c){const D=s.ae(M);return s.K(D,D,[T,T,1]),y||s.ad(D,D,-S.angle),D}return S.glCoordMatrix}function be(M,c,y,S){let T;S?(T=[M,c,S(M,c),1],s.af(T,T,y)):(T=[M,c,0,1],Vr(T,T,y));const D=T[3];return{point:new s.P(T[0]/D,T[1]/D),signedDistanceFromCamera:D,isOccluded:!1}}function re(M,c){return .5+M/c*.5}function te(M,c){return M.x>=-c[0]&&M.x<=c[0]&&M.y>=-c[1]&&M.y<=c[1]}function he(M,c,y,S,T,D,N,B,G,q,K,J,ie,de,pe){const _e=S?M.textSizeData:M.iconSizeData,Se=s.ag(_e,y.transform.zoom),Te=[256/y.width*2+1,256/y.height*2+1],Ce=S?M.text.dynamicLayoutVertexArray:M.icon.dynamicLayoutVertexArray;Ce.clear();const ve=M.lineVertexArray,Ie=S?M.text.placedSymbolArray:M.icon.placedSymbolArray,Pe=y.transform.width/y.transform.height;let Be=!1;for(let Ke=0;KeMath.abs(y.x-c.x)*S?{useVertical:!0}:(M===s.ah.vertical?c.yy.x)?{needsFlipping:!0}:null}function ke(M,c,y,S,T,D,N,B,G,q,K){const J=y/24,ie=c.lineOffsetX*J,de=c.lineOffsetY*J;let pe;if(c.numGlyphs>1){const _e=c.glyphStartIndex+c.numGlyphs,Se=c.lineStartIndex,Te=c.lineStartIndex+c.lineLength,Ce=ye(J,B,ie,de,S,c,K,M);if(!Ce)return{notEnoughRoom:!0};const ve=be(Ce.first.point.x,Ce.first.point.y,N,M.getElevation).point,Ie=be(Ce.last.point.x,Ce.last.point.y,N,M.getElevation).point;if(T&&!S){const Pe=De(c.writingMode,ve,Ie,q);if(Pe)return Pe}pe=[Ce.first];for(let Pe=c.glyphStartIndex+1;Pe<_e-1;Pe++)pe.push(ht(J*B.getoffsetX(Pe),ie,de,S,c.segment,Se,Te,M,K));pe.push(Ce.last)}else{if(T&&!S){const Se=be(M.tileAnchorPoint.x,M.tileAnchorPoint.y,D,M.getElevation).point,Te=c.lineStartIndex+c.segment+1,Ce=new s.P(M.lineVertexArray.getx(Te),M.lineVertexArray.gety(Te)),ve=be(Ce.x,Ce.y,D,M.getElevation),Ie=ve.signedDistanceFromCamera>0?ve.point:function(Be,Ke,at,bt,Et,ft){return Ne(Be,Ke,at,1,Et,ft)}(M.tileAnchorPoint,Ce,Se,0,D,M),Pe=De(c.writingMode,Se,Ie,q);if(Pe)return Pe}const _e=ht(J*B.getoffsetX(c.glyphStartIndex),ie,de,S,c.segment,c.lineStartIndex,c.lineStartIndex+c.lineLength,M,K);if(!_e||M.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};pe=[_e]}for(const _e of pe)s.aj(G,_e.point,_e.angle);return{}}function Ne(M,c,y,S,T,D){const N=M.add(M.sub(c)._unit()),B=T!==void 0?be(N.x,N.y,T,D.getElevation).point:He(N.x,N.y,D).point,G=y.sub(B);return y.add(G._mult(S/G.mag()))}function Ee(M,c,y){const S=c.projectionCache;if(S.projections[M])return S.projections[M];const T=new s.P(c.lineVertexArray.getx(M),c.lineVertexArray.gety(M)),D=He(T.x,T.y,c);if(D.signedDistanceFromCamera>0)return S.projections[M]=D.point,S.anyProjectionOccluded=S.anyProjectionOccluded||D.isOccluded,D.point;const N=M-y.direction;return function(B,G,q,K,J){return Ne(B,G,q,K,void 0,J)}(y.distanceFromAnchor===0?c.tileAnchorPoint:new s.P(c.lineVertexArray.getx(N),c.lineVertexArray.gety(N)),T,y.previousVertex,y.absOffsetX-y.distanceFromAnchor+1,c)}function He(M,c,y){const S=M+y.translation[0],T=c+y.translation[1];let D;return!y.pitchWithMap&&y.projection.useSpecialProjectionForSymbols?(D=y.projection.projectTileCoordinates(S,T,y.unwrappedTileID,y.getElevation),D.point.x=(.5*D.point.x+.5)*y.width,D.point.y=(.5*-D.point.y+.5)*y.height):(D=be(S,T,y.labelPlaneMatrix,y.getElevation),D.isOccluded=!1),D}function Je(M,c,y){return M._unit()._perp()._mult(c*y)}function $e(M,c,y,S,T,D,N,B,G){if(B.projectionCache.offsets[M])return B.projectionCache.offsets[M];const q=y.add(c);if(M+G.direction=T)return B.projectionCache.offsets[M]=q,q;const K=Ee(M+G.direction,B,G),J=Je(K.sub(y),N,G.direction),ie=y.add(J),de=K.add(J);return B.projectionCache.offsets[M]=s.ak(D,q,ie,de)||q,B.projectionCache.offsets[M]}function ht(M,c,y,S,T,D,N,B,G){const q=S?M-c:M+c;let K=q>0?1:-1,J=0;S&&(K*=-1,J=Math.PI),K<0&&(J+=Math.PI);let ie,de=K>0?D+T:D+T+1;B.projectionCache.cachedAnchorPoint?ie=B.projectionCache.cachedAnchorPoint:(ie=He(B.tileAnchorPoint.x,B.tileAnchorPoint.y,B).point,B.projectionCache.cachedAnchorPoint=ie);let pe,_e,Se=ie,Te=ie,Ce=0,ve=0;const Ie=Math.abs(q),Pe=[];let Be;for(;Ce+ve<=Ie;){if(de+=K,de=N)return null;Ce+=ve,Te=Se,_e=pe;const bt={absOffsetX:Ie,direction:K,distanceFromAnchor:Ce,previousVertex:Te};if(Se=Ee(de,B,bt),y===0)Pe.push(Te),Be=Se.sub(Te);else{let Et;const ft=Se.sub(Te);Et=ft.mag()===0?Je(Ee(de+K,B,bt).sub(Se),y,K):Je(ft,y,K),_e||(_e=Te.add(Et)),pe=$e(de,Et,Se,D,N,_e,y,B,bt),Pe.push(_e),Be=pe.sub(_e)}ve=Be.mag()}const Ke=Be._mult((Ie-Ce)/ve)._add(_e||Te),at=J+Math.atan2(Se.y-Te.y,Se.x-Te.x);return Pe.push(Ke),{point:Ke,angle:G?at:0,path:Pe}}const Wt=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Yt(M,c){for(let y=0;y=1;xr--)wt.push(ur.path[xr]);for(let xr=1;xrkr.signedDistanceFromCamera<=0)?[]:xr.map(kr=>kr.point)}let pn=[];if(wt.length>0){const xr=wt[0].clone(),kr=wt[0].clone();for(let gn=1;gn=ft.x&&kr.x<=dt.x&&xr.y>=ft.y&&kr.y<=dt.y?[wt]:kr.xdt.x||kr.ydt.y?[]:s.al([wt],ft.x,ft.y,dt.x,dt.y)}for(const xr of pn){Rt.reset(xr,.25*Et);let kr=0;kr=Rt.length<=.5*Et?1:Math.ceil(Rt.paddedLength/ar)+1;for(let gn=0;gnbe(T.x,T.y,S,y.getElevation))}queryRenderedSymbols(c){if(c.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const y=[];let S=1/0,T=1/0,D=-1/0,N=-1/0;for(const K of c){const J=new s.P(K.x+pr,K.y+pr);S=Math.min(S,J.x),T=Math.min(T,J.y),D=Math.max(D,J.x),N=Math.max(N,J.y),y.push(J)}const B=this.grid.query(S,T,D,N).concat(this.ignoredGrid.query(S,T,D,N)),G={},q={};for(const K of B){const J=K.key;if(G[J.bucketInstanceId]===void 0&&(G[J.bucketInstanceId]={}),G[J.bucketInstanceId][J.featureIndex])continue;const ie=[new s.P(K.x1,K.y1),new s.P(K.x2,K.y1),new s.P(K.x2,K.y2),new s.P(K.x1,K.y2)];s.am(y,ie)&&(G[J.bucketInstanceId][J.featureIndex]=!0,q[J.bucketInstanceId]===void 0&&(q[J.bucketInstanceId]=[]),q[J.bucketInstanceId].push(J.featureIndex))}return q}insertCollisionBox(c,y,S,T,D,N){(S?this.ignoredGrid:this.grid).insert({bucketInstanceId:T,featureIndex:D,collisionGroupID:N,overlapMode:y},c[0],c[1],c[2],c[3])}insertCollisionCircles(c,y,S,T,D,N){const B=S?this.ignoredGrid:this.grid,G={bucketInstanceId:T,featureIndex:D,collisionGroupID:N,overlapMode:y};for(let q=0;q=this.screenRightBoundary||Tthis.screenBottomBoundary}isInsideGrid(c,y,S,T){return S>=0&&c=0&&ythis.projectAndGetPerspectiveRatio(S,Et.x,Et.y,T,q));at=bt.some(Et=>!Et.isOccluded),Ke=bt.map(Et=>Et.point)}else at=!0;return{box:s.ao(Ke),allPointsOccluded:!at}}}function Ir(M,c,y){return c*(s.X/(M.tileSize*Math.pow(2,y-M.tileID.overscaledZ)))}class Bn{constructor(c,y,S,T){this.opacity=c?Math.max(0,Math.min(1,c.opacity+(c.placed?y:-y))):T&&S?1:0,this.placed=S}isHidden(){return this.opacity===0&&!this.placed}}class En{constructor(c,y,S,T,D){this.text=new Bn(c?c.text:null,y,S,D),this.icon=new Bn(c?c.icon:null,y,T,D)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Sr{constructor(c,y,S){this.text=c,this.icon=y,this.skipFade=S}}class Yr{constructor(){this.invProjMatrix=s.H(),this.viewportMatrix=s.H(),this.circles=[]}}class _n{constructor(c,y,S,T,D){this.bucketInstanceId=c,this.featureIndex=y,this.sourceLayerIndex=S,this.bucketIndex=T,this.tileID=D}}class Kn{constructor(c){this.crossSourceCollisions=c,this.maxGroupID=0,this.collisionGroups={}}get(c){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[c]){const y=++this.maxGroupID;this.collisionGroups[c]={ID:y,predicate:S=>S.collisionGroupID===y}}return this.collisionGroups[c]}}function li(M,c,y,S,T){const{horizontalAlign:D,verticalAlign:N}=s.au(M);return new s.P(-(D-.5)*c+S[0]*T,-(N-.5)*y+S[1]*T)}class Di{constructor(c,y,S,T,D,N){this.transform=c.clone(),this.terrain=S,this.collisionIndex=new Fr(this.transform,y),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=T,this.retainedQueryData={},this.collisionGroups=new Kn(D),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=N,N&&(N.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(c){const y=this.terrain;return y?(S,T)=>y.getElevation(c,S,T):null}getBucketParts(c,y,S,T){const D=S.getBucket(y),N=S.latestFeatureIndex;if(!D||!N||y.id!==D.layerIds[0])return;const B=S.collisionBoxArray,G=D.layers[0].layout,q=D.layers[0].paint,K=Math.pow(2,this.transform.zoom-S.tileID.overscaledZ),J=S.tileSize/s.X,ie=S.tileID.toUnwrapped(),de=this.transform.calculatePosMatrix(ie),pe=G.get("text-pitch-alignment")==="map",_e=G.get("text-rotation-alignment")==="map",Se=Ir(S,1,this.transform.zoom),Te=this.collisionIndex.mapProjection.translatePosition(this.transform,S,q.get("text-translate"),q.get("text-translate-anchor")),Ce=this.collisionIndex.mapProjection.translatePosition(this.transform,S,q.get("icon-translate"),q.get("icon-translate-anchor")),ve=ua(de,pe,_e,this.transform,Se);let Ie=null;if(pe){const Be=pi(de,pe,_e,this.transform,Se);Ie=s.L([],this.transform.labelPlaneMatrix,Be)}this.retainedQueryData[D.bucketInstanceId]=new _n(D.bucketInstanceId,N,D.sourceLayerIndex,D.index,S.tileID);const Pe={bucket:D,layout:G,translationText:Te,translationIcon:Ce,posMatrix:de,unwrappedTileID:ie,textLabelPlaneMatrix:ve,labelToScreenMatrix:Ie,scale:K,textPixelRatio:J,holdingForFade:S.holdingForFade(),collisionBoxArray:B,partiallyEvaluatedTextSize:s.ag(D.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(D.sourceID)};if(T)for(const Be of D.sortKeyRanges){const{sortKey:Ke,symbolInstanceStart:at,symbolInstanceEnd:bt}=Be;c.push({sortKey:Ke,symbolInstanceStart:at,symbolInstanceEnd:bt,parameters:Pe})}else c.push({symbolInstanceStart:0,symbolInstanceEnd:D.symbolInstances.length,parameters:Pe})}attemptAnchorPlacement(c,y,S,T,D,N,B,G,q,K,J,ie,de,pe,_e,Se,Te,Ce,ve){const Ie=s.aq[c.textAnchor],Pe=[c.textOffset0,c.textOffset1],Be=li(Ie,S,T,Pe,D),Ke=this.collisionIndex.placeCollisionBox(y,ie,G,q,K,B,N,Se,J.predicate,ve,Be);if((!Ce||this.collisionIndex.placeCollisionBox(Ce,ie,G,q,K,B,N,Te,J.predicate,ve,Be).placeable)&&Ke.placeable){let at;if(this.prevPlacement&&this.prevPlacement.variableOffsets[de.crossTileID]&&this.prevPlacement.placements[de.crossTileID]&&this.prevPlacement.placements[de.crossTileID].text&&(at=this.prevPlacement.variableOffsets[de.crossTileID].anchor),de.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[de.crossTileID]={textOffset:Pe,width:S,height:T,anchor:Ie,textBoxScale:D,prevAnchor:at},this.markUsedJustification(pe,Ie,de,_e),pe.allowVerticalPlacement&&(this.markUsedOrientation(pe,_e,de),this.placedOrientations[de.crossTileID]=_e),{shift:Be,placedGlyphBoxes:Ke}}}placeLayerBucketPart(c,y,S){const{bucket:T,layout:D,translationText:N,translationIcon:B,posMatrix:G,unwrappedTileID:q,textLabelPlaneMatrix:K,labelToScreenMatrix:J,textPixelRatio:ie,holdingForFade:de,collisionBoxArray:pe,partiallyEvaluatedTextSize:_e,collisionGroup:Se}=c.parameters,Te=D.get("text-optional"),Ce=D.get("icon-optional"),ve=s.ar(D,"text-overlap","text-allow-overlap"),Ie=ve==="always",Pe=s.ar(D,"icon-overlap","icon-allow-overlap"),Be=Pe==="always",Ke=D.get("text-rotation-alignment")==="map",at=D.get("text-pitch-alignment")==="map",bt=D.get("icon-text-fit")!=="none",Et=D.get("symbol-z-order")==="viewport-y",ft=Ie&&(Be||!T.hasIconData()||Ce),dt=Be&&(Ie||!T.hasTextData()||Te);!T.collisionArrays&&pe&&T.deserializeCollisionBoxes(pe);const Rt=this._getTerrainElevationFunc(this.retainedQueryData[T.bucketInstanceId].tileID),ur=(yt,wt,ar)=>{var pn,xr;if(y[yt.crossTileID])return;if(de)return void(this.placements[yt.crossTileID]=new Sr(!1,!1,!1));let kr=!1,gn=!1,vi=!0,Ya=null,vn={box:null,placeable:!1,offscreen:null},Gi={placeable:!1},Mi=null,mi=null,Ii=null,ko=0,Iu=0,zf=0;wt.textFeatureIndex?ko=wt.textFeatureIndex:yt.useRuntimeCollisionCircles&&(ko=yt.featureIndex),wt.verticalTextFeatureIndex&&(Iu=wt.verticalTextFeatureIndex);const ku=wt.textBox;if(ku){const Ra=ui=>{let yi=s.ah.horizontal;if(T.allowVerticalPlacement&&!ui&&this.prevPlacement){const ga=this.prevPlacement.placedOrientations[yt.crossTileID];ga&&(this.placedOrientations[yt.crossTileID]=ga,yi=ga,this.markUsedOrientation(T,yi,yt))}return yi},Na=(ui,yi)=>{if(T.allowVerticalPlacement&&yt.numVerticalGlyphVertices>0&&wt.verticalTextBox){for(const ga of T.writingModes)if(ga===s.ah.vertical?(vn=yi(),Gi=vn):vn=ui(),vn&&vn.placeable)break}else vn=ui()},Ms=yt.textAnchorOffsetStartIndex,Ka=yt.textAnchorOffsetEndIndex;if(Ka===Ms){const ui=(yi,ga)=>{const Nr=this.collisionIndex.placeCollisionBox(yi,ve,ie,G,q,at,Ke,N,Se.predicate,Rt);return Nr&&Nr.placeable&&(this.markUsedOrientation(T,ga,yt),this.placedOrientations[yt.crossTileID]=ga),Nr};Na(()=>ui(ku,s.ah.horizontal),()=>{const yi=wt.verticalTextBox;return T.allowVerticalPlacement&&yt.numVerticalGlyphVertices>0&&yi?ui(yi,s.ah.vertical):{box:null,offscreen:null}}),Ra(vn&&vn.placeable)}else{let ui=s.aq[(xr=(pn=this.prevPlacement)===null||pn===void 0?void 0:pn.variableOffsets[yt.crossTileID])===null||xr===void 0?void 0:xr.anchor];const yi=(Nr,yl,Lu)=>{const Pu=Nr.x2-Nr.x1,zb=Nr.y2-Nr.y1,OA=yt.textBoxScale,Bb=bt&&Pe==="never"?yl:null;let Is=null,Vb=ve==="never"?1:2,Vf="never";ui&&Vb++;for(let kh=0;khyi(ku,wt.iconBox,s.ah.horizontal),()=>{const Nr=wt.verticalTextBox;return T.allowVerticalPlacement&&(!vn||!vn.placeable)&&yt.numVerticalGlyphVertices>0&&Nr?yi(Nr,wt.verticalIconBox,s.ah.vertical):{box:null,occluded:!0,offscreen:null}}),vn&&(kr=vn.placeable,vi=vn.offscreen);const ga=Ra(vn&&vn.placeable);if(!kr&&this.prevPlacement){const Nr=this.prevPlacement.variableOffsets[yt.crossTileID];Nr&&(this.variableOffsets[yt.crossTileID]=Nr,this.markUsedJustification(T,Nr.anchor,yt,ga))}}}if(Mi=vn,kr=Mi&&Mi.placeable,vi=Mi&&Mi.offscreen,yt.useRuntimeCollisionCircles){const Ra=T.text.placedSymbolArray.get(yt.centerJustifiedTextSymbolIndex),Na=s.ai(T.textSizeData,_e,Ra),Ms=D.get("text-padding");mi=this.collisionIndex.placeCollisionCircles(ve,Ra,T.lineVertexArray,T.glyphOffsetArray,Na,G,q,K,J,S,at,Se.predicate,yt.collisionCircleDiameter,Ms,N,Rt),mi.circles.length&&mi.collisionDetected&&!S&&s.w("Collisions detected, but collision boxes are not shown"),kr=Ie||mi.circles.length>0&&!mi.collisionDetected,vi=vi&&mi.offscreen}if(wt.iconFeatureIndex&&(zf=wt.iconFeatureIndex),wt.iconBox){const Ra=Na=>this.collisionIndex.placeCollisionBox(Na,Pe,ie,G,q,at,Ke,B,Se.predicate,Rt,bt&&Ya?Ya:void 0);Gi&&Gi.placeable&&wt.verticalIconBox?(Ii=Ra(wt.verticalIconBox),gn=Ii.placeable):(Ii=Ra(wt.iconBox),gn=Ii.placeable),vi=vi&&Ii.offscreen}const Pa=Te||yt.numHorizontalGlyphVertices===0&&yt.numVerticalGlyphVertices===0,Bf=Ce||yt.numIconVertices===0;Pa||Bf?Bf?Pa||(gn=gn&&kr):kr=gn&&kr:gn=kr=gn&&kr;const em=gn&&Ii.placeable;if(kr&&Mi.placeable&&this.collisionIndex.insertCollisionBox(Mi.box,ve,D.get("text-ignore-placement"),T.bucketInstanceId,Gi&&Gi.placeable&&Iu?Iu:ko,Se.ID),em&&this.collisionIndex.insertCollisionBox(Ii.box,Pe,D.get("icon-ignore-placement"),T.bucketInstanceId,zf,Se.ID),mi&&kr&&this.collisionIndex.insertCollisionCircles(mi.circles,ve,D.get("text-ignore-placement"),T.bucketInstanceId,ko,Se.ID),S&&this.storeCollisionData(T.bucketInstanceId,ar,wt,Mi,Ii,mi),yt.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(T.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[yt.crossTileID]=new Sr(kr||ft,gn||dt,vi||T.justReloaded),y[yt.crossTileID]=!0};if(Et){if(c.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const yt=T.getSortedSymbolIndexes(this.transform.angle);for(let wt=yt.length-1;wt>=0;--wt){const ar=yt[wt];ur(T.symbolInstances.get(ar),T.collisionArrays[ar],ar)}}else for(let yt=c.symbolInstanceStart;yt=0&&(c.text.placedSymbolArray.get(B).crossTileID=D>=0&&B!==D?0:S.crossTileID)}markUsedOrientation(c,y,S){const T=y===s.ah.horizontal||y===s.ah.horizontalOnly?y:0,D=y===s.ah.vertical?y:0,N=[S.leftJustifiedTextSymbolIndex,S.centerJustifiedTextSymbolIndex,S.rightJustifiedTextSymbolIndex];for(const B of N)c.text.placedSymbolArray.get(B).placedOrientation=T;S.verticalPlacedTextSymbolIndex&&(c.text.placedSymbolArray.get(S.verticalPlacedTextSymbolIndex).placedOrientation=D)}commit(c){this.commitTime=c,this.zoomAtLastRecencyCheck=this.transform.zoom;const y=this.prevPlacement;let S=!1;this.prevZoomAdjustment=y?y.zoomAdjustment(this.transform.zoom):0;const T=y?y.symbolFadeChange(c):1,D=y?y.opacities:{},N=y?y.variableOffsets:{},B=y?y.placedOrientations:{};for(const G in this.placements){const q=this.placements[G],K=D[G];K?(this.opacities[G]=new En(K,T,q.text,q.icon),S=S||q.text!==K.text.placed||q.icon!==K.icon.placed):(this.opacities[G]=new En(null,T,q.text,q.icon,q.skipFade),S=S||q.text||q.icon)}for(const G in D){const q=D[G];if(!this.opacities[G]){const K=new En(q,T,!1,!1);K.isHidden()||(this.opacities[G]=K,S=S||q.text.placed||q.icon.placed)}}for(const G in N)this.variableOffsets[G]||!this.opacities[G]||this.opacities[G].isHidden()||(this.variableOffsets[G]=N[G]);for(const G in B)this.placedOrientations[G]||!this.opacities[G]||this.opacities[G].isHidden()||(this.placedOrientations[G]=B[G]);if(y&&y.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");S?this.lastPlacementChangeTime=c:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=y?y.lastPlacementChangeTime:c)}updateLayerOpacities(c,y){const S={};for(const T of y){const D=T.getBucket(c);D&&T.latestFeatureIndex&&c.id===D.layerIds[0]&&this.updateBucketOpacities(D,T.tileID,S,T.collisionBoxArray)}}updateBucketOpacities(c,y,S,T){c.hasTextData()&&(c.text.opacityVertexArray.clear(),c.text.hasVisibleVertices=!1),c.hasIconData()&&(c.icon.opacityVertexArray.clear(),c.icon.hasVisibleVertices=!1),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexArray.clear(),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexArray.clear();const D=c.layers[0],N=D.layout,B=new En(null,0,!1,!1,!0),G=N.get("text-allow-overlap"),q=N.get("icon-allow-overlap"),K=D._unevaluatedLayout.hasValue("text-variable-anchor")||D._unevaluatedLayout.hasValue("text-variable-anchor-offset"),J=N.get("text-rotation-alignment")==="map",ie=N.get("text-pitch-alignment")==="map",de=N.get("icon-text-fit")!=="none",pe=new En(null,0,G&&(q||!c.hasIconData()||N.get("icon-optional")),q&&(G||!c.hasTextData()||N.get("text-optional")),!0);!c.collisionArrays&&T&&(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData())&&c.deserializeCollisionBoxes(T);const _e=(Te,Ce,ve)=>{for(let Ie=0;Ie0,at=this.placedOrientations[Ce.crossTileID],bt=at===s.ah.vertical,Et=at===s.ah.horizontal||at===s.ah.horizontalOnly;if(ve>0||Ie>0){const dt=da(Be.text);_e(c.text,ve,bt?cu:dt),_e(c.text,Ie,Et?cu:dt);const Rt=Be.text.isHidden();[Ce.rightJustifiedTextSymbolIndex,Ce.centerJustifiedTextSymbolIndex,Ce.leftJustifiedTextSymbolIndex].forEach(wt=>{wt>=0&&(c.text.placedSymbolArray.get(wt).hidden=Rt||bt?1:0)}),Ce.verticalPlacedTextSymbolIndex>=0&&(c.text.placedSymbolArray.get(Ce.verticalPlacedTextSymbolIndex).hidden=Rt||Et?1:0);const ur=this.variableOffsets[Ce.crossTileID];ur&&this.markUsedJustification(c,ur.anchor,Ce,at);const yt=this.placedOrientations[Ce.crossTileID];yt&&(this.markUsedJustification(c,"left",Ce,yt),this.markUsedOrientation(c,yt,Ce))}if(Ke){const dt=da(Be.icon),Rt=!(de&&Ce.verticalPlacedIconSymbolIndex&&bt);Ce.placedIconSymbolIndex>=0&&(_e(c.icon,Ce.numIconVertices,Rt?dt:cu),c.icon.placedSymbolArray.get(Ce.placedIconSymbolIndex).hidden=Be.icon.isHidden()),Ce.verticalPlacedIconSymbolIndex>=0&&(_e(c.icon,Ce.numVerticalIconVertices,Rt?cu:dt),c.icon.placedSymbolArray.get(Ce.verticalPlacedIconSymbolIndex).hidden=Be.icon.isHidden())}const ft=Se&&Se.has(Te)?Se.get(Te):{text:null,icon:null};if(c.hasIconCollisionBoxData()||c.hasTextCollisionBoxData()){const dt=c.collisionArrays[Te];if(dt){let Rt=new s.P(0,0);if(dt.textBox||dt.verticalTextBox){let ur=!0;if(K){const yt=this.variableOffsets[Pe];yt?(Rt=li(yt.anchor,yt.width,yt.height,yt.textOffset,yt.textBoxScale),J&&Rt._rotate(ie?this.transform.angle:-this.transform.angle)):ur=!1}if(dt.textBox||dt.verticalTextBox){let yt;dt.textBox&&(yt=bt),dt.verticalTextBox&&(yt=Et),uu(c.textCollisionBox.collisionVertexArray,Be.text.placed,!ur||yt,ft.text,Rt.x,Rt.y)}}if(dt.iconBox||dt.verticalIconBox){const ur=!!(!Et&&dt.verticalIconBox);let yt;dt.iconBox&&(yt=ur),dt.verticalIconBox&&(yt=!ur),uu(c.iconCollisionBox.collisionVertexArray,Be.icon.placed,yt,ft.icon,de?Rt.x:0,de?Rt.y:0)}}}}if(c.sortFeatures(this.transform.angle),this.retainedQueryData[c.bucketInstanceId]&&(this.retainedQueryData[c.bucketInstanceId].featureSortOrder=c.featureSortOrder),c.hasTextData()&&c.text.opacityVertexBuffer&&c.text.opacityVertexBuffer.updateData(c.text.opacityVertexArray),c.hasIconData()&&c.icon.opacityVertexBuffer&&c.icon.opacityVertexBuffer.updateData(c.icon.opacityVertexArray),c.hasIconCollisionBoxData()&&c.iconCollisionBox.collisionVertexBuffer&&c.iconCollisionBox.collisionVertexBuffer.updateData(c.iconCollisionBox.collisionVertexArray),c.hasTextCollisionBoxData()&&c.textCollisionBox.collisionVertexBuffer&&c.textCollisionBox.collisionVertexBuffer.updateData(c.textCollisionBox.collisionVertexArray),c.text.opacityVertexArray.length!==c.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${c.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${c.text.layoutVertexArray.length}) / 4`);if(c.icon.opacityVertexArray.length!==c.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${c.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${c.icon.layoutVertexArray.length}) / 4`);if(c.bucketInstanceId in this.collisionCircleArrays){const Te=this.collisionCircleArrays[c.bucketInstanceId];c.placementInvProjMatrix=Te.invProjMatrix,c.placementViewportMatrix=Te.viewportMatrix,c.collisionCircleArray=Te.circles,delete this.collisionCircleArrays[c.bucketInstanceId]}}symbolFadeChange(c){return this.fadeDuration===0?1:(c-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(c){return Math.max(0,(this.transform.zoom-c)/1.5)}hasTransitions(c){return this.stale||c-this.lastPlacementChangeTimec}setStale(){this.stale=!0}}function uu(M,c,y,S,T,D){S&&S.length!==0||(S=[0,0,0,0]);const N=S[0]-pr,B=S[1]-pr,G=S[2]-pr,q=S[3]-pr;M.emplaceBack(c?1:0,y?1:0,T||0,D||0,N,B),M.emplaceBack(c?1:0,y?1:0,T||0,D||0,G,B),M.emplaceBack(c?1:0,y?1:0,T||0,D||0,G,q),M.emplaceBack(c?1:0,y?1:0,T||0,D||0,N,q)}const Kr=Math.pow(2,25),hv=Math.pow(2,24),dv=Math.pow(2,17),ca=Math.pow(2,16),ha=Math.pow(2,9),cA=Math.pow(2,8),Ma=Math.pow(2,1);function da(M){if(M.opacity===0&&!M.placed)return 0;if(M.opacity===1&&M.placed)return 4294967295;const c=M.placed?1:0,y=Math.floor(127*M.opacity);return y*Kr+c*hv+y*dv+c*ca+y*ha+c*cA+y*Ma+c}const cu=0;function ol(){return{isOccluded:(M,c,y)=>!1,getPitchedTextCorrection:(M,c,y)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(M,c,y,S){throw new Error("Not implemented.")},translatePosition:(M,c,y,S)=>function(T,D,N,B,G=!1){if(!N[0]&&!N[1])return[0,0];const q=G?B==="map"?T.angle:0:B==="viewport"?-T.angle:0;if(q){const K=Math.sin(q),J=Math.cos(q);N=[N[0]*J-N[1]*K,N[0]*K+N[1]*J]}return[G?N[0]:Ir(D,N[0],T.zoom),G?N[1]:Ir(D,N[1],T.zoom)]}(M,c,y,S),getCircleRadiusCorrection:M=>1}}class Vn{constructor(c){this._sortAcrossTiles=c.layout.get("symbol-z-order")!=="viewport-y"&&!c.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(c,y,S,T,D){const N=this._bucketParts;for(;this._currentTileIndexB.sortKey-G.sortKey));this._currentPartIndex!this._forceFullPlacement&&f.now()-T>2;for(;this._currentPlacementIndex>=0;){const N=y[c[this._currentPlacementIndex]],B=this.placement.collisionIndex.transform.zoom;if(N.type==="symbol"&&(!N.minzoom||N.minzoom<=B)&&(!N.maxzoom||N.maxzoom>B)){if(this._inProgressLayer||(this._inProgressLayer=new Vn(N)),this._inProgressLayer.continuePlacement(S[N.source],this.placement,this._showCollisionBoxes,N,D))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(c){return this.placement.commit(c),this.placement}}const Wa=512/s.X/2;class Rn{constructor(c,y,S){this.tileID=c,this.bucketInstanceId=S,this._symbolsByKey={};const T=new Map;for(let D=0;D({x:Math.floor(G.anchorX*Wa),y:Math.floor(G.anchorY*Wa)})),crossTileIDs:N.map(G=>G.crossTileID)};if(B.positions.length>128){const G=new s.av(B.positions.length,16,Uint16Array);for(const{x:q,y:K}of B.positions)G.add(q,K);G.finish(),delete B.positions,B.index=G}this._symbolsByKey[D]=B}}getScaledCoordinates(c,y){const{x:S,y:T,z:D}=this.tileID.canonical,{x:N,y:B,z:G}=y.canonical,q=Wa/Math.pow(2,G-D),K=(B*s.X+c.anchorY)*q,J=T*s.X*Wa;return{x:Math.floor((N*s.X+c.anchorX)*q-S*s.X*Wa),y:Math.floor(K-J)}}findMatches(c,y,S){const T=this.tileID.canonical.zc)}}class of{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class qa{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(c){const y=Math.round((c-this.lng)/360);if(y!==0)for(const S in this.indexes){const T=this.indexes[S],D={};for(const N in T){const B=T[N];B.tileID=B.tileID.unwrapTo(B.tileID.wrap+y),D[B.tileID.key]=B}this.indexes[S]=D}this.lng=c}addBucket(c,y,S){if(this.indexes[c.overscaledZ]&&this.indexes[c.overscaledZ][c.key]){if(this.indexes[c.overscaledZ][c.key].bucketInstanceId===y.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(c.overscaledZ,this.indexes[c.overscaledZ][c.key])}for(let D=0;Dc.overscaledZ)for(const B in N){const G=N[B];G.tileID.isChildOf(c)&&G.findMatches(y.symbolInstances,c,T)}else{const B=N[c.scaledTo(Number(D)).key];B&&B.findMatches(y.symbolInstances,c,T)}}for(let D=0;D{y[S]=!0});for(const S in this.layerIndexes)y[S]||delete this.layerIndexes[S]}}const Za=(M,c)=>s.t(M,c&&c.filter(y=>y.identifier!=="source.canvas")),hA=s.aw();class sf extends s.E{constructor(c,y={}){super(),this._rtlPluginLoaded=()=>{for(const S in this.sourceCaches){const T=this.sourceCaches[S].getSource().type;T!=="vector"&&T!=="geojson"||this.sourceCaches[S].reload()}},this.map=c,this.dispatcher=new Ct(st(),c._getMapId()),this.dispatcher.registerMessageHandler("GG",(S,T)=>this.getGlyphs(S,T)),this.dispatcher.registerMessageHandler("GI",(S,T)=>this.getImages(S,T)),this.imageManager=new ae,this.imageManager.setEventedParent(this),this.glyphManager=new ge(c._requestManager,y.localIdeographFontFamily),this.lineAtlas=new ot(256,512),this.crossTileSymbolIndex=new fv,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new s.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",s.ay()),Dn().on(qe,this._rtlPluginLoaded),this.on("data",S=>{if(S.dataType!=="source"||S.sourceDataType!=="metadata")return;const T=this.sourceCaches[S.sourceId];if(!T)return;const D=T.getSource();if(D&&D.vectorLayerIds)for(const N in this._layers){const B=this._layers[N];B.source===D.id&&this._validateLayer(B)}})}loadURL(c,y={},S){this.fire(new s.k("dataloading",{dataType:"style"})),y.validate=typeof y.validate!="boolean"||y.validate;const T=this.map._requestManager.transformRequest(c,"Style");this._loadStyleRequest=new AbortController;const D=this._loadStyleRequest;s.h(T,this._loadStyleRequest).then(N=>{this._loadStyleRequest=null,this._load(N.data,y,S)}).catch(N=>{this._loadStyleRequest=null,N&&!D.signal.aborted&&this.fire(new s.j(N))})}loadJSON(c,y={},S){this.fire(new s.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,f.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,y.validate=y.validate!==!1,this._load(c,y,S)}).catch(()=>{})}loadEmpty(){this.fire(new s.k("dataloading",{dataType:"style"})),this._load(hA,{validate:!1})}_load(c,y,S){var T;const D=y.transformStyle?y.transformStyle(S,c):c;if(!y.validate||!Za(this,s.u(D))){this._loaded=!0,this.stylesheet=D;for(const N in D.sources)this.addSource(N,D.sources[N],{validate:!1});D.sprite?this._loadSprite(D.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(D.glyphs),this._createLayers(),this.light=new Ve(this.stylesheet.light),this.sky=new Xe(this.stylesheet.sky),this.map.setTerrain((T=this.stylesheet.terrain)!==null&&T!==void 0?T:null),this.fire(new s.k("data",{dataType:"style"})),this.fire(new s.k("style.load"))}}_createLayers(){const c=s.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",c),this._order=c.map(y=>y.id),this._layers={},this._serializedLayers=null;for(const y of c){const S=s.aA(y);S.setEventedParent(this,{layer:{id:y.id}}),this._layers[y.id]=S}}_loadSprite(c,y=!1,S=void 0){let T;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(D,N,B,G){return s._(this,void 0,void 0,function*(){const q=Z(D),K=B>1?"@2x":"",J={},ie={};for(const{id:de,url:pe}of q){const _e=N.transformRequest(j(pe,K,".json"),"SpriteJSON");J[de]=s.h(_e,G);const Se=N.transformRequest(j(pe,K,".png"),"SpriteImage");ie[de]=L.getImage(Se,G)}return yield Promise.all([...Object.values(J),...Object.values(ie)]),function(de,pe){return s._(this,void 0,void 0,function*(){const _e={};for(const Se in de){_e[Se]={};const Te=f.getImageCanvasContext((yield pe[Se]).data),Ce=(yield de[Se]).data;for(const ve in Ce){const{width:Ie,height:Pe,x:Be,y:Ke,sdf:at,pixelRatio:bt,stretchX:Et,stretchY:ft,content:dt,textFitWidth:Rt,textFitHeight:ur}=Ce[ve];_e[Se][ve]={data:null,pixelRatio:bt,sdf:at,stretchX:Et,stretchY:ft,content:dt,textFitWidth:Rt,textFitHeight:ur,spriteData:{width:Ie,height:Pe,x:Be,y:Ke,context:Te}}}}return _e})}(J,ie)})}(c,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(D=>{if(this._spriteRequest=null,D)for(const N in D){this._spritesImagesIds[N]=[];const B=this._spritesImagesIds[N]?this._spritesImagesIds[N].filter(G=>!(G in D)):[];for(const G of B)this.imageManager.removeImage(G),this._changedImages[G]=!0;for(const G in D[N]){const q=N==="default"?G:`${N}:${G}`;this._spritesImagesIds[N].push(q),q in this.imageManager.images?this.imageManager.updateImage(q,D[N][G],!1):this.imageManager.addImage(q,D[N][G]),y&&(this._changedImages[q]=!0)}}}).catch(D=>{this._spriteRequest=null,T=D,this.fire(new s.j(T))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),y&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.k("data",{dataType:"style"})),S&&S(T)})}_unloadSprite(){for(const c of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(c),this._changedImages[c]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.k("data",{dataType:"style"}))}_validateLayer(c){const y=this.sourceCaches[c.source];if(!y)return;const S=c.sourceLayer;if(!S)return;const T=y.getSource();(T.type==="geojson"||T.vectorLayerIds&&T.vectorLayerIds.indexOf(S)===-1)&&this.fire(new s.j(new Error(`Source layer "${S}" does not exist on source "${T.id}" as specified by style layer "${c.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const c in this.sourceCaches)if(!this.sourceCaches[c].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(c,y=!1){const S=this._serializedAllLayers();if(!c||c.length===0)return Object.values(y?s.aB(S):S);const T=[];for(const D of c)if(S[D]){const N=y?s.aB(S[D]):S[D];T.push(N)}return T}_serializedAllLayers(){let c=this._serializedLayers;if(c)return c;c=this._serializedLayers={};const y=Object.keys(this._layers);for(const S of y){const T=this._layers[S];T.type!=="custom"&&(c[S]=T.serialize())}return c}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const c in this.sourceCaches)if(this.sourceCaches[c].hasTransition())return!0;for(const c in this._layers)if(this._layers[c].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(c){if(!this._loaded)return;const y=this._changed;if(y){const T=Object.keys(this._updatedLayers),D=Object.keys(this._removedLayers);(T.length||D.length)&&this._updateWorkerLayers(T,D);for(const N in this._updatedSources){const B=this._updatedSources[N];if(B==="reload")this._reloadSource(N);else{if(B!=="clear")throw new Error(`Invalid action ${B}`);this._clearSource(N)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const N in this._updatedPaintProps)this._layers[N].updateTransitions(c);this.light.updateTransitions(c),this.sky.updateTransitions(c),this._resetUpdates()}const S={};for(const T in this.sourceCaches){const D=this.sourceCaches[T];S[T]=D.used,D.used=!1}for(const T of this._order){const D=this._layers[T];D.recalculate(c,this._availableImages),!D.isHidden(c.zoom)&&D.source&&(this.sourceCaches[D.source].used=!0)}for(const T in S){const D=this.sourceCaches[T];!!S[T]!=!!D.used&&D.fire(new s.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:T}))}this.light.recalculate(c),this.sky.recalculate(c),this.z=c.zoom,y&&this.fire(new s.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const c=Object.keys(this._changedImages);if(c.length){for(const y in this.sourceCaches)this.sourceCaches[y].reloadTilesForDependencies(["icons","patterns"],c);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const c in this.sourceCaches)this.sourceCaches[c].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(c,y){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(c,!1),removedIds:y})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(c,y={}){var S;this._checkLoaded();const T=this.serialize();if(c=y.transformStyle?y.transformStyle(T,c):c,((S=y.validate)===null||S===void 0||S)&&Za(this,s.u(c)))return!1;(c=s.aB(c)).layers=s.az(c.layers);const D=s.aC(T,c),N=this._getOperationsToPerform(D);if(N.unimplemented.length>0)throw new Error(`Unimplemented: ${N.unimplemented.join(", ")}.`);if(N.operations.length===0)return!1;for(const B of N.operations)B();return this.stylesheet=c,this._serializedLayers=null,!0}_getOperationsToPerform(c){const y=[],S=[];for(const T of c)switch(T.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":y.push(()=>this.addLayer.apply(this,T.args));break;case"removeLayer":y.push(()=>this.removeLayer.apply(this,T.args));break;case"setPaintProperty":y.push(()=>this.setPaintProperty.apply(this,T.args));break;case"setLayoutProperty":y.push(()=>this.setLayoutProperty.apply(this,T.args));break;case"setFilter":y.push(()=>this.setFilter.apply(this,T.args));break;case"addSource":y.push(()=>this.addSource.apply(this,T.args));break;case"removeSource":y.push(()=>this.removeSource.apply(this,T.args));break;case"setLayerZoomRange":y.push(()=>this.setLayerZoomRange.apply(this,T.args));break;case"setLight":y.push(()=>this.setLight.apply(this,T.args));break;case"setGeoJSONSourceData":y.push(()=>this.setGeoJSONSourceData.apply(this,T.args));break;case"setGlyphs":y.push(()=>this.setGlyphs.apply(this,T.args));break;case"setSprite":y.push(()=>this.setSprite.apply(this,T.args));break;case"setSky":y.push(()=>this.setSky.apply(this,T.args));break;case"setTerrain":y.push(()=>this.map.setTerrain.apply(this,T.args));break;case"setTransition":y.push(()=>{});break;default:S.push(T.command)}return{operations:y,unimplemented:S}}addImage(c,y){if(this.getImage(c))return this.fire(new s.j(new Error(`An image named "${c}" already exists.`)));this.imageManager.addImage(c,y),this._afterImageUpdated(c)}updateImage(c,y){this.imageManager.updateImage(c,y)}getImage(c){return this.imageManager.getImage(c)}removeImage(c){if(!this.getImage(c))return this.fire(new s.j(new Error(`An image named "${c}" does not exist.`)));this.imageManager.removeImage(c),this._afterImageUpdated(c)}_afterImageUpdated(c){this._availableImages=this.imageManager.listImages(),this._changedImages[c]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(c,y,S={}){if(this._checkLoaded(),this.sourceCaches[c]!==void 0)throw new Error(`Source "${c}" already exists.`);if(!y.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(y).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(y.type)>=0&&this._validate(s.u.source,`sources.${c}`,y,null,S))return;this.map&&this.map._collectResourceTiming&&(y.collectResourceTiming=!0);const T=this.sourceCaches[c]=new tr(c,y,this.dispatcher);T.style=this,T.setEventedParent(this,()=>({isSourceLoaded:T.loaded(),source:T.serialize(),sourceId:c})),T.onAdd(this.map),this._changed=!0}removeSource(c){if(this._checkLoaded(),this.sourceCaches[c]===void 0)throw new Error("There is no source with this ID");for(const S in this._layers)if(this._layers[S].source===c)return this.fire(new s.j(new Error(`Source "${c}" cannot be removed while layer "${S}" is using it.`)));const y=this.sourceCaches[c];delete this.sourceCaches[c],delete this._updatedSources[c],y.fire(new s.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:c})),y.setEventedParent(null),y.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(c,y){if(this._checkLoaded(),this.sourceCaches[c]===void 0)throw new Error(`There is no source with this ID=${c}`);const S=this.sourceCaches[c].getSource();if(S.type!=="geojson")throw new Error(`geojsonSource.type is ${S.type}, which is !== 'geojson`);S.setData(y),this._changed=!0}getSource(c){return this.sourceCaches[c]&&this.sourceCaches[c].getSource()}addLayer(c,y,S={}){this._checkLoaded();const T=c.id;if(this.getLayer(T))return void this.fire(new s.j(new Error(`Layer "${T}" already exists on this map.`)));let D;if(c.type==="custom"){if(Za(this,s.aD(c)))return;D=s.aA(c)}else{if("source"in c&&typeof c.source=="object"&&(this.addSource(T,c.source),c=s.aB(c),c=s.e(c,{source:T})),this._validate(s.u.layer,`layers.${T}`,c,{arrayIndex:-1},S))return;D=s.aA(c),this._validateLayer(D),D.setEventedParent(this,{layer:{id:T}})}const N=y?this._order.indexOf(y):this._order.length;if(y&&N===-1)this.fire(new s.j(new Error(`Cannot add layer "${T}" before non-existing layer "${y}".`)));else{if(this._order.splice(N,0,T),this._layerOrderChanged=!0,this._layers[T]=D,this._removedLayers[T]&&D.source&&D.type!=="custom"){const B=this._removedLayers[T];delete this._removedLayers[T],B.type!==D.type?this._updatedSources[D.source]="clear":(this._updatedSources[D.source]="reload",this.sourceCaches[D.source].pause())}this._updateLayer(D),D.onAdd&&D.onAdd(this.map)}}moveLayer(c,y){if(this._checkLoaded(),this._changed=!0,!this._layers[c])return void this.fire(new s.j(new Error(`The layer '${c}' does not exist in the map's style and cannot be moved.`)));if(c===y)return;const S=this._order.indexOf(c);this._order.splice(S,1);const T=y?this._order.indexOf(y):this._order.length;y&&T===-1?this.fire(new s.j(new Error(`Cannot move layer "${c}" before non-existing layer "${y}".`))):(this._order.splice(T,0,c),this._layerOrderChanged=!0)}removeLayer(c){this._checkLoaded();const y=this._layers[c];if(!y)return void this.fire(new s.j(new Error(`Cannot remove non-existing layer "${c}".`)));y.setEventedParent(null);const S=this._order.indexOf(c);this._order.splice(S,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[c]=y,delete this._layers[c],this._serializedLayers&&delete this._serializedLayers[c],delete this._updatedLayers[c],delete this._updatedPaintProps[c],y.onRemove&&y.onRemove(this.map)}getLayer(c){return this._layers[c]}getLayersOrder(){return[...this._order]}hasLayer(c){return c in this._layers}setLayerZoomRange(c,y,S){this._checkLoaded();const T=this.getLayer(c);T?T.minzoom===y&&T.maxzoom===S||(y!=null&&(T.minzoom=y),S!=null&&(T.maxzoom=S),this._updateLayer(T)):this.fire(new s.j(new Error(`Cannot set the zoom range of non-existing layer "${c}".`)))}setFilter(c,y,S={}){this._checkLoaded();const T=this.getLayer(c);if(T){if(!s.aE(T.filter,y))return y==null?(T.filter=void 0,void this._updateLayer(T)):void(this._validate(s.u.filter,`layers.${T.id}.filter`,y,null,S)||(T.filter=s.aB(y),this._updateLayer(T)))}else this.fire(new s.j(new Error(`Cannot filter non-existing layer "${c}".`)))}getFilter(c){return s.aB(this.getLayer(c).filter)}setLayoutProperty(c,y,S,T={}){this._checkLoaded();const D=this.getLayer(c);D?s.aE(D.getLayoutProperty(y),S)||(D.setLayoutProperty(y,S,T),this._updateLayer(D)):this.fire(new s.j(new Error(`Cannot style non-existing layer "${c}".`)))}getLayoutProperty(c,y){const S=this.getLayer(c);if(S)return S.getLayoutProperty(y);this.fire(new s.j(new Error(`Cannot get style of non-existing layer "${c}".`)))}setPaintProperty(c,y,S,T={}){this._checkLoaded();const D=this.getLayer(c);D?s.aE(D.getPaintProperty(y),S)||(D.setPaintProperty(y,S,T)&&this._updateLayer(D),this._changed=!0,this._updatedPaintProps[c]=!0,this._serializedLayers=null):this.fire(new s.j(new Error(`Cannot style non-existing layer "${c}".`)))}getPaintProperty(c,y){return this.getLayer(c).getPaintProperty(y)}setFeatureState(c,y){this._checkLoaded();const S=c.source,T=c.sourceLayer,D=this.sourceCaches[S];if(D===void 0)return void this.fire(new s.j(new Error(`The source '${S}' does not exist in the map's style.`)));const N=D.getSource().type;N==="geojson"&&T?this.fire(new s.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):N!=="vector"||T?(c.id===void 0&&this.fire(new s.j(new Error("The feature id parameter must be provided."))),D.setFeatureState(T,c.id,y)):this.fire(new s.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(c,y){this._checkLoaded();const S=c.source,T=this.sourceCaches[S];if(T===void 0)return void this.fire(new s.j(new Error(`The source '${S}' does not exist in the map's style.`)));const D=T.getSource().type,N=D==="vector"?c.sourceLayer:void 0;D!=="vector"||N?y&&typeof c.id!="string"&&typeof c.id!="number"?this.fire(new s.j(new Error("A feature id is required to remove its specific state property."))):T.removeFeatureState(N,c.id,y):this.fire(new s.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(c){this._checkLoaded();const y=c.source,S=c.sourceLayer,T=this.sourceCaches[y];if(T!==void 0)return T.getSource().type!=="vector"||S?(c.id===void 0&&this.fire(new s.j(new Error("The feature id parameter must be provided."))),T.getFeatureState(S,c.id)):void this.fire(new s.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new s.j(new Error(`The source '${y}' does not exist in the map's style.`)))}getTransition(){return s.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const c=s.aF(this.sourceCaches,D=>D.serialize()),y=this._serializeByIds(this._order,!0),S=this.map.getTerrain()||void 0,T=this.stylesheet;return s.aG({version:T.version,name:T.name,metadata:T.metadata,light:T.light,sky:T.sky,center:T.center,zoom:T.zoom,bearing:T.bearing,pitch:T.pitch,sprite:T.sprite,glyphs:T.glyphs,transition:T.transition,sources:c,layers:y,terrain:S},D=>D!==void 0)}_updateLayer(c){this._updatedLayers[c.id]=!0,c.source&&!this._updatedSources[c.source]&&this.sourceCaches[c.source].getSource().type!=="raster"&&(this._updatedSources[c.source]="reload",this.sourceCaches[c.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(c){const y=N=>this._layers[N].type==="fill-extrusion",S={},T=[];for(let N=this._order.length-1;N>=0;N--){const B=this._order[N];if(y(B)){S[B]=N;for(const G of c){const q=G[B];if(q)for(const K of q)T.push(K)}}}T.sort((N,B)=>B.intersectionZ-N.intersectionZ);const D=[];for(let N=this._order.length-1;N>=0;N--){const B=this._order[N];if(y(B))for(let G=T.length-1;G>=0;G--){const q=T[G].feature;if(S[q.layer.id]{const at=Te.featureSortOrder;if(at){const bt=at.indexOf(Be.featureIndex);return at.indexOf(Ke.featureIndex)-bt}return Ke.featureIndex-Be.featureIndex});for(const Be of Pe)Ie.push(Be)}}for(const Te in pe)pe[Te].forEach(Ce=>{const ve=Ce.feature,Ie=q[B[Te].source].getFeatureState(ve.layer["source-layer"],ve.id);ve.source=ve.layer.source,ve.layer["source-layer"]&&(ve.sourceLayer=ve.layer["source-layer"]),ve.state=Ie});return pe}(this._layers,N,this.sourceCaches,c,y,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(D)}querySourceFeatures(c,y){y&&y.filter&&this._validate(s.u.filter,"querySourceFeatures.filter",y.filter,null,y);const S=this.sourceCaches[c];return S?function(T,D){const N=T.getRenderableIds().map(q=>T.getTileByID(q)),B=[],G={};for(let q=0;qie.getTileByID(de)).sort((de,pe)=>pe.tileID.overscaledZ-de.tileID.overscaledZ||(de.tileID.isLessThan(pe.tileID)?-1:1))}const J=this.crossTileSymbolIndex.addLayer(K,G[K.source],c.center.lng);N=N||J}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((D=D||this._layerOrderChanged||S===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(f.now(),c.zoom))&&(this.pauseablePlacement=new dh(c,this.map.terrain,this._order,D,y,S,T,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,G),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(f.now()),B=!0),N&&this.pauseablePlacement.placement.setStale()),B||N)for(const q of this._order){const K=this._layers[q];K.type==="symbol"&&this.placement.updateLayerOpacities(K,G[K.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(f.now())}_releaseSymbolFadeTiles(){for(const c in this.sourceCaches)this.sourceCaches[c].releaseSymbolFadeTiles()}getImages(c,y){return s._(this,void 0,void 0,function*(){const S=yield this.imageManager.getImages(y.icons);this._updateTilesForChangedImages();const T=this.sourceCaches[y.source];return T&&T.setDependencies(y.tileID.key,y.type,y.icons),S})}getGlyphs(c,y){return s._(this,void 0,void 0,function*(){const S=yield this.glyphManager.getGlyphs(y.stacks),T=this.sourceCaches[y.source];return T&&T.setDependencies(y.tileID.key,y.type,[""]),S})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(c,y={}){this._checkLoaded(),c&&this._validate(s.u.glyphs,"glyphs",c,null,y)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=c,this.glyphManager.entries={},this.glyphManager.setURL(c))}addSprite(c,y,S={},T){this._checkLoaded();const D=[{id:c,url:y}],N=[...Z(this.stylesheet.sprite),...D];this._validate(s.u.sprite,"sprite",N,null,S)||(this.stylesheet.sprite=N,this._loadSprite(D,!0,T))}removeSprite(c){this._checkLoaded();const y=Z(this.stylesheet.sprite);if(y.find(S=>S.id===c)){if(this._spritesImagesIds[c])for(const S of this._spritesImagesIds[c])this.imageManager.removeImage(S),this._changedImages[S]=!0;y.splice(y.findIndex(S=>S.id===c),1),this.stylesheet.sprite=y.length>0?y:void 0,delete this._spritesImagesIds[c],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new s.k("data",{dataType:"style"}))}else this.fire(new s.j(new Error(`Sprite "${c}" doesn't exists on this map.`)))}getSprite(){return Z(this.stylesheet.sprite)}setSprite(c,y={},S){this._checkLoaded(),c&&this._validate(s.u.sprite,"sprite",c,null,y)||(this.stylesheet.sprite=c,c?this._loadSprite(c,!0,S):(this._unloadSprite(),S&&S(null)))}}var sl=s.Y([{name:"a_pos",type:"Int16",components:2}]);const As={prelude:Zr(`#ifdef GL_ES precision mediump float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif `,`#ifdef GL_ES precision highp float; #else #if !defined(lowp) #define lowp #endif #if !defined(mediump) #define mediump #endif #if !defined(highp) #define highp #endif #endif vec2 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 );}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;} #ifdef TERRAIN3D uniform 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; #endif const 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) { #ifdef TERRAIN3D highp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0)); #else return 1.0; #endif }float calculate_visibility(vec4 pos) { #ifdef TERRAIN3D vec3 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; #else return 1.0; #endif }float ele(vec2 pos) { #ifdef TERRAIN3D vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a; #else return 0.0; #endif }float get_elevation(vec2 pos) { #ifdef TERRAIN3D vec2 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; #else return 0.0; #endif }`),background:Zr(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Zr(`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;varying vec2 v_pos_a;varying 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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;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;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);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:Zr(`varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 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));gl_FragColor=v_visibility*opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;varying float v_visibility; #pragma mapbox: define highp vec4 color #pragma mapbox: define mediump float radius #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define highp vec4 stroke_color #pragma mapbox: define mediump float stroke_width #pragma mapbox: define lowp float stroke_opacity void main(void) { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize mediump float radius #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize highp vec4 stroke_color #pragma mapbox: initialize mediump float stroke_width #pragma mapbox: initialize lowp float stroke_opacity vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,1);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:Zr("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:Zr(`uniform highp float u_intensity;varying vec2 v_extrude; #pragma mapbox: define highp float weight #define GAUSS_COEF 0.3989422804014327 void main() { #pragma mapbox: initialize highp float weight float d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude; #pragma mapbox: define highp float weight #pragma mapbox: define mediump float radius const highp float ZERO=1.0/255.0/16.0; #define GAUSS_COEF 0.3989422804014327 void main(void) { #pragma mapbox: initialize highp float weight #pragma mapbox: initialize mediump float radius vec2 unscaled_extrude=vec2(mod(a_pos,2.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;vec4 pos=vec4(floor(a_pos*0.5)+extrude,get_elevation(floor(a_pos*0.5)),1);gl_Position=u_matrix*pos;}`),heatmapTexture:Zr(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(0.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying 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:Zr("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_anchor_pos;attribute vec2 a_placed;attribute vec2 a_box_real;uniform mat4 u_matrix;uniform vec2 u_pixel_extrude_scale;varying float v_placed;varying float v_notUsed;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);}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:Zr("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);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);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;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;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:Zr("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:Zr(`#pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_FragColor=color*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Zr(`varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos; #pragma mapbox: define highp vec4 outline_color #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 outline_color #pragma mapbox: initialize lowp float opacity gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Zr(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 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=texture2D(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=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 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=u_matrix*vec4(a_pos,0,1);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;}`),fillPattern:Zr(`#ifdef GL_ES precision highp float; #endif uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to vec2 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=texture2D(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=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b; #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 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=u_matrix*vec4(a_pos,0,1);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:Zr(`varying vec4 v_color;void main() {gl_FragColor=v_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec4 v_color; #pragma mapbox: define highp float base #pragma mapbox: define highp float height #pragma mapbox: define highp vec4 color void main() { #pragma mapbox: initialize highp float base #pragma mapbox: initialize highp float height #pragma mapbox: initialize highp vec4 color vec3 normal=a_normal_ed.xyz; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float 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;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=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:Zr(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 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=texture2D(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=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`uniform mat4 u_matrix;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 vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed; #ifdef TERRAIN3D attribute vec2 a_centroid; #endif varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting; #pragma mapbox: define lowp float base #pragma mapbox: define lowp float height #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float base #pragma mapbox: initialize lowp float height #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to vec2 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; #ifdef TERRAIN3D float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0); #else float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0; #endif base=max(0.0,base)+base_terrain3d_offset;height=max(0.0,height)+height_terrain3d_offset;float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0 ? a_pos : vec2(edgedistance,z*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:Zr(`#ifdef GL_ES precision highp float; #endif uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;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))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying 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:Zr(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent; #define PI 3.141592653589793 void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;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_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),line:Zr(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity 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);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float 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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),lineGradient:Zr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity 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);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 attribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width float 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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_width2=vec2(outset,inset);}`),linePattern:Zr(`#ifdef GL_ES precision highp float; #endif uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity vec2 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(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width; #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float gapwidth #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth #pragma mapbox: define lowp vec4 pattern_from #pragma mapbox: define lowp vec4 pattern_to #pragma mapbox: define lowp float pixel_ratio_from #pragma mapbox: define lowp float pixel_ratio_to void main() { #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth #pragma mapbox: initialize mediump vec4 pattern_from #pragma mapbox: initialize mediump vec4 pattern_to #pragma mapbox: initialize lowp float pixel_ratio_from #pragma mapbox: initialize lowp float pixel_ratio_to float 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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Zr(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth 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 sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,` #define scale 0.015873016 #define LINE_DISTANCE_SCALE 2.0 attribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale; #pragma mapbox: define highp vec4 color #pragma mapbox: define lowp float blur #pragma mapbox: define lowp float opacity #pragma mapbox: define mediump float gapwidth #pragma mapbox: define lowp float offset #pragma mapbox: define mediump float width #pragma mapbox: define lowp float floorwidth void main() { #pragma mapbox: initialize highp vec4 color #pragma mapbox: initialize lowp float blur #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize mediump float gapwidth #pragma mapbox: initialize lowp float offset #pragma mapbox: initialize mediump float width #pragma mapbox: initialize lowp float floorwidth float 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);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude; #ifdef TERRAIN3D v_gamma_scale=1.0; #else float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective; #endif v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),raster:Zr(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying 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=texture2D(u_image0,v_pos0);vec4 color1=texture2D(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);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),symbolIcon:Zr(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity; #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_tex;varying float v_fade_opacity;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define lowp float opacity void main() { #pragma mapbox: initialize lowp float opacity vec2 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 ? camera_to_anchor_distance/u_camera_to_center_distance : u_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;vec4 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:Zr(`#define SDF_PX 8.0 uniform 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;varying vec2 v_data0;varying vec3 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float 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=texture2D(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);}gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec2 v_data0;varying vec3 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 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 ? camera_to_anchor_distance/u_camera_to_center_distance : u_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;vec4 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:Zr(`#define SDF_PX 8.0 #define SDF 1.0 #define ICON 0.0 uniform 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;varying vec4 v_data0;varying vec4 v_data1; #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur float fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha; #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif return;}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=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity); #ifdef OVERDRAW_INSPECTOR gl_FragColor=vec4(1.0); #endif }`,`attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute 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_matrix;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;varying vec4 v_data0;varying vec4 v_data1;vec4 projectTileWithElevation(vec2 posInTile,float elevation) {return u_matrix*vec4(posInTile,elevation,1.0);} #pragma mapbox: define highp vec4 fill_color #pragma mapbox: define highp vec4 halo_color #pragma mapbox: define lowp float opacity #pragma mapbox: define lowp float halo_width #pragma mapbox: define lowp float halo_blur void main() { #pragma mapbox: initialize highp vec4 fill_color #pragma mapbox: initialize highp vec4 halo_color #pragma mapbox: initialize lowp float opacity #pragma mapbox: initialize lowp float halo_width #pragma mapbox: initialize lowp float halo_blur vec2 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 ? camera_to_anchor_distance/u_camera_to_center_distance : u_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;vec4 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:Zr("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;varying vec2 v_texture_pos;varying 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=texture2D(u_texture,v_texture_pos);if (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);gl_FragColor=linearToGamma(mix(surface_color_linear,fog_horizon_color_linear,pow(factor_fog,2.0)*u_fog_ground_blend_opacity));} else {gl_FragColor=surface_color;}}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform mat4 u_fog_matrix;uniform float u_ele_delta;varying vec2 v_texture_pos;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);vec4 pos=u_fog_matrix*vec4(a_pos3d.xy,ele,1.0);v_fog_depth=pos.z/pos.w*0.5+0.5;}"),terrainDepth:Zr("varying 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() {gl_FragColor=pack(v_depth);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);v_depth=gl_Position.z/gl_Position.w;}"),terrainCoords:Zr("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}","attribute vec3 a_pos3d;uniform mat4 u_matrix;uniform float u_ele_delta;varying 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=u_matrix*vec4(a_pos3d.xy,ele-ele_delta,1.0);}"),sky:Zr("uniform vec4 u_sky_color;uniform vec4 u_horizon_color;uniform float u_horizon;uniform float u_sky_horizon_blend;void main() {float y=gl_FragCoord.y;if (y > u_horizon) {float blend=y-u_horizon;if (blend < u_sky_horizon_blend) {gl_FragColor=mix(u_sky_color,u_horizon_color,pow(1.0-blend/u_sky_horizon_blend,2.0));} else {gl_FragColor=u_sky_color;}}}","attribute vec2 a_pos;void main() {gl_Position=vec4(a_pos,1.0,1.0);}")};function Zr(M,c){const y=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,S=c.match(/attribute ([\w]+) ([\w]+)/g),T=M.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),D=c.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),N=D?D.concat(T):T,B={};return{fragmentSource:M=M.replace(y,(G,q,K,J,ie)=>(B[ie]=!0,q==="define"?` #ifndef HAS_UNIFORM_u_${ie} varying ${K} ${J} ${ie}; #else uniform ${K} ${J} u_${ie}; #endif `:` #ifdef HAS_UNIFORM_u_${ie} ${K} ${J} ${ie} = u_${ie}; #endif `)),vertexSource:c=c.replace(y,(G,q,K,J,ie)=>{const de=J==="float"?"vec2":"vec4",pe=ie.match(/color/)?"color":de;return B[ie]?q==="define"?` #ifndef HAS_UNIFORM_u_${ie} uniform lowp float u_${ie}_t; attribute ${K} ${de} a_${ie}; varying ${K} ${J} ${ie}; #else uniform ${K} ${J} u_${ie}; #endif `:pe==="vec4"?` #ifndef HAS_UNIFORM_u_${ie} ${ie} = a_${ie}; #else ${K} ${J} ${ie} = u_${ie}; #endif `:` #ifndef HAS_UNIFORM_u_${ie} ${ie} = unpack_mix_${pe}(a_${ie}, u_${ie}_t); #else ${K} ${J} ${ie} = u_${ie}; #endif `:q==="define"?` #ifndef HAS_UNIFORM_u_${ie} uniform lowp float u_${ie}_t; attribute ${K} ${de} a_${ie}; #else uniform ${K} ${J} u_${ie}; #endif `:pe==="vec4"?` #ifndef HAS_UNIFORM_u_${ie} ${K} ${J} ${ie} = a_${ie}; #else ${K} ${J} ${ie} = u_${ie}; #endif `:` #ifndef HAS_UNIFORM_u_${ie} ${K} ${J} ${ie} = unpack_mix_${pe}(a_${ie}, u_${ie}_t); #else ${K} ${J} ${ie} = u_${ie}; #endif `}),staticAttributes:S,staticUniforms:N}}class pv{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(c,y,S,T,D,N,B,G,q){this.context=c;let K=this.boundPaintVertexBuffers.length!==T.length;for(let J=0;!K&&J({u_matrix:M,u_texture:0,u_ele_delta:c,u_fog_matrix:y,u_fog_color:S?S.properties.get("fog-color"):s.aM.white,u_fog_ground_blend:S?S.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:S?S.calculateFogBlendOpacity(T):0,u_horizon_color:S?S.properties.get("horizon-color"):s.aM.white,u_horizon_fog_blend:S?S.properties.get("horizon-fog-blend"):1});function hu(M){const c=[];for(let y=0;y({u_depth:new s.aH(Be,Ke.u_depth),u_terrain:new s.aH(Be,Ke.u_terrain),u_terrain_dim:new s.aI(Be,Ke.u_terrain_dim),u_terrain_matrix:new s.aJ(Be,Ke.u_terrain_matrix),u_terrain_unpack:new s.aK(Be,Ke.u_terrain_unpack),u_terrain_exaggeration:new s.aI(Be,Ke.u_terrain_exaggeration)}))(c,Pe),this.binderUniforms=S?S.getUniforms(c,Pe):[]}draw(c,y,S,T,D,N,B,G,q,K,J,ie,de,pe,_e,Se,Te,Ce){const ve=c.gl;if(this.failedToCreate)return;if(c.program.set(this.program),c.setDepthMode(S),c.setStencilMode(T),c.setColorMode(D),c.setCullFace(N),G){c.activeTexture.set(ve.TEXTURE2),ve.bindTexture(ve.TEXTURE_2D,G.depthTexture),c.activeTexture.set(ve.TEXTURE3),ve.bindTexture(ve.TEXTURE_2D,G.texture);for(const Pe in this.terrainUniforms)this.terrainUniforms[Pe].set(G[Pe])}for(const Pe in this.fixedUniforms)this.fixedUniforms[Pe].set(B[Pe]);_e&&_e.setUniforms(c,this.binderUniforms,de,{zoom:pe});let Ie=0;switch(y){case ve.LINES:Ie=2;break;case ve.TRIANGLES:Ie=3;break;case ve.LINE_STRIP:Ie=1}for(const Pe of ie.get()){const Be=Pe.vaos||(Pe.vaos={});(Be[q]||(Be[q]=new pv)).bind(c,this,K,_e?_e.getPaintVertexBuffers():[],J,Pe.vertexOffset,Se,Te,Ce),ve.drawElements(y,Pe.primitiveLength*Ie,ve.UNSIGNED_SHORT,Pe.primitiveOffset*Ie*2)}}}function lf(M,c,y){const S=1/Ir(y,1,c.transform.tileZoom),T=Math.pow(2,y.tileID.overscaledZ),D=y.tileSize*Math.pow(2,c.transform.tileZoom)/T,N=D*(y.tileID.canonical.x+y.tileID.wrap*T),B=D*y.tileID.canonical.y;return{u_image:0,u_texsize:y.imageAtlasTexture.size,u_scale:[S,M.fromScale,M.toScale],u_fade:M.t,u_pixel_coord_upper:[N>>16,B>>16],u_pixel_coord_lower:[65535&N,65535&B]}}const fh=(M,c,y,S)=>{const T=c.style.light,D=T.properties.get("position"),N=[D.x,D.y,D.z],B=function(){var q=new s.A(9);return s.A!=Float32Array&&(q[1]=0,q[2]=0,q[3]=0,q[5]=0,q[6]=0,q[7]=0),q[0]=1,q[4]=1,q[8]=1,q}();T.properties.get("anchor")==="viewport"&&function(q,K){var J=Math.sin(K),ie=Math.cos(K);q[0]=ie,q[1]=J,q[2]=0,q[3]=-J,q[4]=ie,q[5]=0,q[6]=0,q[7]=0,q[8]=1}(B,-c.transform.angle),function(q,K,J){var ie=K[0],de=K[1],pe=K[2];q[0]=ie*J[0]+de*J[3]+pe*J[6],q[1]=ie*J[1]+de*J[4]+pe*J[7],q[2]=ie*J[2]+de*J[5]+pe*J[8]}(N,N,B);const G=T.properties.get("color");return{u_matrix:M,u_lightpos:N,u_lightintensity:T.properties.get("intensity"),u_lightcolor:[G.r,G.g,G.b],u_vertical_gradient:+y,u_opacity:S}},uf=(M,c,y,S,T,D,N)=>s.e(fh(M,c,y,S),lf(D,c,N),{u_height_factor:-Math.pow(2,T.overscaledZ)/N.tileSize/8}),du=M=>({u_matrix:M}),ib=(M,c,y,S)=>s.e(du(M),lf(y,c,S)),dA=(M,c)=>({u_matrix:M,u_world:c}),ab=(M,c,y,S,T)=>s.e(ib(M,c,y,S),{u_world:T}),fA=(M,c,y,S)=>{const T=M.transform;let D,N;if(S.paint.get("circle-pitch-alignment")==="map"){const B=Ir(y,1,T.zoom);D=!0,N=[B,B]}else D=!1,N=T.pixelsToGLUnits;return{u_camera_to_center_distance:T.cameraToCenterDistance,u_scale_with_map:+(S.paint.get("circle-pitch-scale")==="map"),u_matrix:M.translatePosMatrix(c.posMatrix,y,S.paint.get("circle-translate"),S.paint.get("circle-translate-anchor")),u_pitch_with_map:+D,u_device_pixel_ratio:M.pixelRatio,u_extrude_scale:N}},ll=(M,c,y)=>({u_matrix:M,u_inv_matrix:c,u_camera_to_center_distance:y.cameraToCenterDistance,u_viewport_size:[y.width,y.height]}),ph=(M,c,y=1)=>({u_matrix:M,u_color:c,u_overlay:0,u_overlay_scale:y}),Fi=M=>({u_matrix:M}),$i=(M,c,y,S)=>({u_matrix:M,u_extrude_scale:Ir(c,1,y),u_intensity:S}),cf=(M,c,y,S)=>{const T=s.H();s.aP(T,0,M.width,M.height,0,0,1);const D=M.context.gl;return{u_matrix:T,u_world:[D.drawingBufferWidth,D.drawingBufferHeight],u_image:y,u_color_ramp:S,u_opacity:c.paint.get("heatmap-opacity")}};function hf(M,c){const y=Math.pow(2,c.canonical.z),S=c.canonical.y;return[new s.Z(0,S/y).toLngLat().lat,new s.Z(0,(S+1)/y).toLngLat().lat]}const df=(M,c,y,S)=>{const T=M.transform;return{u_matrix:lb(M,c,y,S),u_ratio:1/Ir(c,1,T.zoom),u_device_pixel_ratio:M.pixelRatio,u_units_to_pixels:[1/T.pixelsToGLUnits[0],1/T.pixelsToGLUnits[1]]}},ob=(M,c,y,S,T)=>s.e(df(M,c,y,T),{u_image:0,u_image_height:S}),fu=(M,c,y,S,T)=>{const D=M.transform,N=sb(c,D);return{u_matrix:lb(M,c,y,T),u_texsize:c.imageAtlasTexture.size,u_ratio:1/Ir(c,1,D.zoom),u_device_pixel_ratio:M.pixelRatio,u_image:0,u_scale:[N,S.fromScale,S.toScale],u_fade:S.t,u_units_to_pixels:[1/D.pixelsToGLUnits[0],1/D.pixelsToGLUnits[1]]}},pA=(M,c,y,S,T,D)=>{const N=M.lineAtlas,B=sb(c,M.transform),G=y.layout.get("line-cap")==="round",q=N.getDash(S.from,G),K=N.getDash(S.to,G),J=q.width*T.fromScale,ie=K.width*T.toScale;return s.e(df(M,c,y,D),{u_patternscale_a:[B/J,-q.height/2],u_patternscale_b:[B/ie,-K.height/2],u_sdfgamma:N.width/(256*Math.min(J,ie)*M.pixelRatio)/2,u_image:0,u_tex_y_a:q.y,u_tex_y_b:K.y,u_mix:T.t})};function sb(M,c){return 1/Ir(M,1,c.tileZoom)}function lb(M,c,y,S){return M.translatePosMatrix(S?S.posMatrix:c.tileID.posMatrix,c,y.paint.get("line-translate"),y.paint.get("line-translate-anchor"))}const gA=(M,c,y,S,T)=>{return{u_matrix:M,u_tl_parent:c,u_scale_parent:y,u_buffer_scale:1,u_fade_t:S.mix,u_opacity:S.opacity*T.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:T.paint.get("raster-brightness-min"),u_brightness_high:T.paint.get("raster-brightness-max"),u_saturation_factor:(N=T.paint.get("raster-saturation"),N>0?1-1/(1.001-N):-N),u_contrast_factor:(D=T.paint.get("raster-contrast"),D>0?1/(1-D):1+D),u_spin_weights:vA(T.paint.get("raster-hue-rotate"))};var D,N};function vA(M){M*=Math.PI/180;const c=Math.sin(M),y=Math.cos(M);return[(2*y+1)/3,(-Math.sqrt(3)*c-y+1)/3,(Math.sqrt(3)*c-y+1)/3]}const ub=(M,c,y,S,T,D,N,B,G,q,K,J,ie,de)=>{const pe=N.transform;return{u_is_size_zoom_constant:+(M==="constant"||M==="source"),u_is_size_feature_constant:+(M==="constant"||M==="camera"),u_size_t:c?c.uSizeT:0,u_size:c?c.uSize:0,u_camera_to_center_distance:pe.cameraToCenterDistance,u_pitch:pe.pitch/360*2*Math.PI,u_rotate_symbol:+y,u_aspect_ratio:pe.width/pe.height,u_fade_change:N.options.fadeDuration?N.symbolFadeChange:1,u_matrix:B,u_label_plane_matrix:G,u_coord_matrix:q,u_is_text:+J,u_pitch_with_map:+S,u_is_along_line:T,u_is_variable_anchor:D,u_texsize:ie,u_texture:0,u_translation:K,u_pitched_scale:de}},gh=(M,c,y,S,T,D,N,B,G,q,K,J,ie,de,pe)=>{const _e=N.transform;return s.e(ub(M,c,y,S,T,D,N,B,G,q,K,J,ie,pe),{u_gamma_scale:S?Math.cos(_e._pitch)*_e.cameraToCenterDistance:1,u_device_pixel_ratio:N.pixelRatio,u_is_halo:1})},mv=(M,c,y,S,T,D,N,B,G,q,K,J,ie,de)=>s.e(gh(M,c,y,S,T,D,N,B,G,q,K,!0,J,!0,de),{u_texsize_icon:ie,u_texture_icon:1}),ff=(M,c,y)=>({u_matrix:M,u_opacity:c,u_color:y}),yv=(M,c,y,S,T,D)=>s.e(function(N,B,G,q){const K=G.imageManager.getPattern(N.from.toString()),J=G.imageManager.getPattern(N.to.toString()),{width:ie,height:de}=G.imageManager.getPixelSize(),pe=Math.pow(2,q.tileID.overscaledZ),_e=q.tileSize*Math.pow(2,G.transform.tileZoom)/pe,Se=_e*(q.tileID.canonical.x+q.tileID.wrap*pe),Te=_e*q.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:K.tl,u_pattern_br_a:K.br,u_pattern_tl_b:J.tl,u_pattern_br_b:J.br,u_texsize:[ie,de],u_mix:B.t,u_pattern_size_a:K.displaySize,u_pattern_size_b:J.displaySize,u_scale_a:B.fromScale,u_scale_b:B.toScale,u_tile_units_to_pixels:1/Ir(q,1,G.transform.tileZoom),u_pixel_coord_upper:[Se>>16,Te>>16],u_pixel_coord_lower:[65535&Se,65535&Te]}}(S,D,y,T),{u_matrix:M,u_opacity:c}),_v={fillExtrusion:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_lightpos:new s.aN(M,c.u_lightpos),u_lightintensity:new s.aI(M,c.u_lightintensity),u_lightcolor:new s.aN(M,c.u_lightcolor),u_vertical_gradient:new s.aI(M,c.u_vertical_gradient),u_opacity:new s.aI(M,c.u_opacity)}),fillExtrusionPattern:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_lightpos:new s.aN(M,c.u_lightpos),u_lightintensity:new s.aI(M,c.u_lightintensity),u_lightcolor:new s.aN(M,c.u_lightcolor),u_vertical_gradient:new s.aI(M,c.u_vertical_gradient),u_height_factor:new s.aI(M,c.u_height_factor),u_image:new s.aH(M,c.u_image),u_texsize:new s.aO(M,c.u_texsize),u_pixel_coord_upper:new s.aO(M,c.u_pixel_coord_upper),u_pixel_coord_lower:new s.aO(M,c.u_pixel_coord_lower),u_scale:new s.aN(M,c.u_scale),u_fade:new s.aI(M,c.u_fade),u_opacity:new s.aI(M,c.u_opacity)}),fill:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix)}),fillPattern:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_image:new s.aH(M,c.u_image),u_texsize:new s.aO(M,c.u_texsize),u_pixel_coord_upper:new s.aO(M,c.u_pixel_coord_upper),u_pixel_coord_lower:new s.aO(M,c.u_pixel_coord_lower),u_scale:new s.aN(M,c.u_scale),u_fade:new s.aI(M,c.u_fade)}),fillOutline:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_world:new s.aO(M,c.u_world)}),fillOutlinePattern:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_world:new s.aO(M,c.u_world),u_image:new s.aH(M,c.u_image),u_texsize:new s.aO(M,c.u_texsize),u_pixel_coord_upper:new s.aO(M,c.u_pixel_coord_upper),u_pixel_coord_lower:new s.aO(M,c.u_pixel_coord_lower),u_scale:new s.aN(M,c.u_scale),u_fade:new s.aI(M,c.u_fade)}),circle:(M,c)=>({u_camera_to_center_distance:new s.aI(M,c.u_camera_to_center_distance),u_scale_with_map:new s.aH(M,c.u_scale_with_map),u_pitch_with_map:new s.aH(M,c.u_pitch_with_map),u_extrude_scale:new s.aO(M,c.u_extrude_scale),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_matrix:new s.aJ(M,c.u_matrix)}),collisionBox:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_pixel_extrude_scale:new s.aO(M,c.u_pixel_extrude_scale)}),collisionCircle:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_inv_matrix:new s.aJ(M,c.u_inv_matrix),u_camera_to_center_distance:new s.aI(M,c.u_camera_to_center_distance),u_viewport_size:new s.aO(M,c.u_viewport_size)}),debug:(M,c)=>({u_color:new s.aL(M,c.u_color),u_matrix:new s.aJ(M,c.u_matrix),u_overlay:new s.aH(M,c.u_overlay),u_overlay_scale:new s.aI(M,c.u_overlay_scale)}),clippingMask:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix)}),heatmap:(M,c)=>({u_extrude_scale:new s.aI(M,c.u_extrude_scale),u_intensity:new s.aI(M,c.u_intensity),u_matrix:new s.aJ(M,c.u_matrix)}),heatmapTexture:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_world:new s.aO(M,c.u_world),u_image:new s.aH(M,c.u_image),u_color_ramp:new s.aH(M,c.u_color_ramp),u_opacity:new s.aI(M,c.u_opacity)}),hillshade:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_image:new s.aH(M,c.u_image),u_latrange:new s.aO(M,c.u_latrange),u_light:new s.aO(M,c.u_light),u_shadow:new s.aL(M,c.u_shadow),u_highlight:new s.aL(M,c.u_highlight),u_accent:new s.aL(M,c.u_accent)}),hillshadePrepare:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_image:new s.aH(M,c.u_image),u_dimension:new s.aO(M,c.u_dimension),u_zoom:new s.aI(M,c.u_zoom),u_unpack:new s.aK(M,c.u_unpack)}),line:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_ratio:new s.aI(M,c.u_ratio),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_units_to_pixels:new s.aO(M,c.u_units_to_pixels)}),lineGradient:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_ratio:new s.aI(M,c.u_ratio),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_units_to_pixels:new s.aO(M,c.u_units_to_pixels),u_image:new s.aH(M,c.u_image),u_image_height:new s.aI(M,c.u_image_height)}),linePattern:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_texsize:new s.aO(M,c.u_texsize),u_ratio:new s.aI(M,c.u_ratio),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_image:new s.aH(M,c.u_image),u_units_to_pixels:new s.aO(M,c.u_units_to_pixels),u_scale:new s.aN(M,c.u_scale),u_fade:new s.aI(M,c.u_fade)}),lineSDF:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_ratio:new s.aI(M,c.u_ratio),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_units_to_pixels:new s.aO(M,c.u_units_to_pixels),u_patternscale_a:new s.aO(M,c.u_patternscale_a),u_patternscale_b:new s.aO(M,c.u_patternscale_b),u_sdfgamma:new s.aI(M,c.u_sdfgamma),u_image:new s.aH(M,c.u_image),u_tex_y_a:new s.aI(M,c.u_tex_y_a),u_tex_y_b:new s.aI(M,c.u_tex_y_b),u_mix:new s.aI(M,c.u_mix)}),raster:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_tl_parent:new s.aO(M,c.u_tl_parent),u_scale_parent:new s.aI(M,c.u_scale_parent),u_buffer_scale:new s.aI(M,c.u_buffer_scale),u_fade_t:new s.aI(M,c.u_fade_t),u_opacity:new s.aI(M,c.u_opacity),u_image0:new s.aH(M,c.u_image0),u_image1:new s.aH(M,c.u_image1),u_brightness_low:new s.aI(M,c.u_brightness_low),u_brightness_high:new s.aI(M,c.u_brightness_high),u_saturation_factor:new s.aI(M,c.u_saturation_factor),u_contrast_factor:new s.aI(M,c.u_contrast_factor),u_spin_weights:new s.aN(M,c.u_spin_weights)}),symbolIcon:(M,c)=>({u_is_size_zoom_constant:new s.aH(M,c.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aH(M,c.u_is_size_feature_constant),u_size_t:new s.aI(M,c.u_size_t),u_size:new s.aI(M,c.u_size),u_camera_to_center_distance:new s.aI(M,c.u_camera_to_center_distance),u_pitch:new s.aI(M,c.u_pitch),u_rotate_symbol:new s.aH(M,c.u_rotate_symbol),u_aspect_ratio:new s.aI(M,c.u_aspect_ratio),u_fade_change:new s.aI(M,c.u_fade_change),u_matrix:new s.aJ(M,c.u_matrix),u_label_plane_matrix:new s.aJ(M,c.u_label_plane_matrix),u_coord_matrix:new s.aJ(M,c.u_coord_matrix),u_is_text:new s.aH(M,c.u_is_text),u_pitch_with_map:new s.aH(M,c.u_pitch_with_map),u_is_along_line:new s.aH(M,c.u_is_along_line),u_is_variable_anchor:new s.aH(M,c.u_is_variable_anchor),u_texsize:new s.aO(M,c.u_texsize),u_texture:new s.aH(M,c.u_texture),u_translation:new s.aO(M,c.u_translation),u_pitched_scale:new s.aI(M,c.u_pitched_scale)}),symbolSDF:(M,c)=>({u_is_size_zoom_constant:new s.aH(M,c.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aH(M,c.u_is_size_feature_constant),u_size_t:new s.aI(M,c.u_size_t),u_size:new s.aI(M,c.u_size),u_camera_to_center_distance:new s.aI(M,c.u_camera_to_center_distance),u_pitch:new s.aI(M,c.u_pitch),u_rotate_symbol:new s.aH(M,c.u_rotate_symbol),u_aspect_ratio:new s.aI(M,c.u_aspect_ratio),u_fade_change:new s.aI(M,c.u_fade_change),u_matrix:new s.aJ(M,c.u_matrix),u_label_plane_matrix:new s.aJ(M,c.u_label_plane_matrix),u_coord_matrix:new s.aJ(M,c.u_coord_matrix),u_is_text:new s.aH(M,c.u_is_text),u_pitch_with_map:new s.aH(M,c.u_pitch_with_map),u_is_along_line:new s.aH(M,c.u_is_along_line),u_is_variable_anchor:new s.aH(M,c.u_is_variable_anchor),u_texsize:new s.aO(M,c.u_texsize),u_texture:new s.aH(M,c.u_texture),u_gamma_scale:new s.aI(M,c.u_gamma_scale),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_is_halo:new s.aH(M,c.u_is_halo),u_translation:new s.aO(M,c.u_translation),u_pitched_scale:new s.aI(M,c.u_pitched_scale)}),symbolTextAndIcon:(M,c)=>({u_is_size_zoom_constant:new s.aH(M,c.u_is_size_zoom_constant),u_is_size_feature_constant:new s.aH(M,c.u_is_size_feature_constant),u_size_t:new s.aI(M,c.u_size_t),u_size:new s.aI(M,c.u_size),u_camera_to_center_distance:new s.aI(M,c.u_camera_to_center_distance),u_pitch:new s.aI(M,c.u_pitch),u_rotate_symbol:new s.aH(M,c.u_rotate_symbol),u_aspect_ratio:new s.aI(M,c.u_aspect_ratio),u_fade_change:new s.aI(M,c.u_fade_change),u_matrix:new s.aJ(M,c.u_matrix),u_label_plane_matrix:new s.aJ(M,c.u_label_plane_matrix),u_coord_matrix:new s.aJ(M,c.u_coord_matrix),u_is_text:new s.aH(M,c.u_is_text),u_pitch_with_map:new s.aH(M,c.u_pitch_with_map),u_is_along_line:new s.aH(M,c.u_is_along_line),u_is_variable_anchor:new s.aH(M,c.u_is_variable_anchor),u_texsize:new s.aO(M,c.u_texsize),u_texsize_icon:new s.aO(M,c.u_texsize_icon),u_texture:new s.aH(M,c.u_texture),u_texture_icon:new s.aH(M,c.u_texture_icon),u_gamma_scale:new s.aI(M,c.u_gamma_scale),u_device_pixel_ratio:new s.aI(M,c.u_device_pixel_ratio),u_is_halo:new s.aH(M,c.u_is_halo),u_translation:new s.aO(M,c.u_translation),u_pitched_scale:new s.aI(M,c.u_pitched_scale)}),background:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_opacity:new s.aI(M,c.u_opacity),u_color:new s.aL(M,c.u_color)}),backgroundPattern:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_opacity:new s.aI(M,c.u_opacity),u_image:new s.aH(M,c.u_image),u_pattern_tl_a:new s.aO(M,c.u_pattern_tl_a),u_pattern_br_a:new s.aO(M,c.u_pattern_br_a),u_pattern_tl_b:new s.aO(M,c.u_pattern_tl_b),u_pattern_br_b:new s.aO(M,c.u_pattern_br_b),u_texsize:new s.aO(M,c.u_texsize),u_mix:new s.aI(M,c.u_mix),u_pattern_size_a:new s.aO(M,c.u_pattern_size_a),u_pattern_size_b:new s.aO(M,c.u_pattern_size_b),u_scale_a:new s.aI(M,c.u_scale_a),u_scale_b:new s.aI(M,c.u_scale_b),u_pixel_coord_upper:new s.aO(M,c.u_pixel_coord_upper),u_pixel_coord_lower:new s.aO(M,c.u_pixel_coord_lower),u_tile_units_to_pixels:new s.aI(M,c.u_tile_units_to_pixels)}),terrain:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_texture:new s.aH(M,c.u_texture),u_ele_delta:new s.aI(M,c.u_ele_delta),u_fog_matrix:new s.aJ(M,c.u_fog_matrix),u_fog_color:new s.aL(M,c.u_fog_color),u_fog_ground_blend:new s.aI(M,c.u_fog_ground_blend),u_fog_ground_blend_opacity:new s.aI(M,c.u_fog_ground_blend_opacity),u_horizon_color:new s.aL(M,c.u_horizon_color),u_horizon_fog_blend:new s.aI(M,c.u_horizon_fog_blend)}),terrainDepth:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_ele_delta:new s.aI(M,c.u_ele_delta)}),terrainCoords:(M,c)=>({u_matrix:new s.aJ(M,c.u_matrix),u_texture:new s.aH(M,c.u_texture),u_terrain_coords_id:new s.aI(M,c.u_terrain_coords_id),u_ele_delta:new s.aI(M,c.u_ele_delta)}),sky:(M,c)=>({u_sky_color:new s.aL(M,c.u_sky_color),u_horizon_color:new s.aL(M,c.u_horizon_color),u_horizon:new s.aI(M,c.u_horizon),u_sky_horizon_blend:new s.aI(M,c.u_sky_horizon_blend)})};class Do{constructor(c,y,S){this.context=c;const T=c.gl;this.buffer=T.createBuffer(),this.dynamicDraw=!!S,this.context.unbindVAO(),c.bindElementBuffer.set(this.buffer),T.bufferData(T.ELEMENT_ARRAY_BUFFER,y.arrayBuffer,this.dynamicDraw?T.DYNAMIC_DRAW:T.STATIC_DRAW),this.dynamicDraw||delete y.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(c){const y=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),y.bufferSubData(y.ELEMENT_ARRAY_BUFFER,0,c.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const mA={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class bv{constructor(c,y,S,T){this.length=y.length,this.attributes=S,this.itemSize=y.bytesPerElement,this.dynamicDraw=T,this.context=c;const D=c.gl;this.buffer=D.createBuffer(),c.bindVertexBuffer.set(this.buffer),D.bufferData(D.ARRAY_BUFFER,y.arrayBuffer,this.dynamicDraw?D.DYNAMIC_DRAW:D.STATIC_DRAW),this.dynamicDraw||delete y.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(c){if(c.length!==this.length)throw new Error(`Length of new data is ${c.length}, which doesn't match current length of ${this.length}`);const y=this.context.gl;this.bind(),y.bufferSubData(y.ARRAY_BUFFER,0,c.arrayBuffer)}enableAttributes(c,y){for(let S=0;S0){const Be=s.H();s.aQ(Be,ve.placementInvProjMatrix,M.transform.glCoordMatrix),s.aQ(Be,Be,ve.placementViewportMatrix),G.push({circleArray:Pe,circleOffset:K,transform:Ce.posMatrix,invTransform:Be,coord:Ce}),q+=Pe.length/4,K=q}Ie&&B.draw(D,N.LINES,Tr.disabled,un.disabled,M.colorModeForRenderPass(),Qr.disabled,{u_matrix:Ce.posMatrix,u_pixel_extrude_scale:[1/(J=M.transform).width,1/J.height]},M.style.map.terrain&&M.style.map.terrain.getTerrainData(Ce),y.id,Ie.layoutVertexBuffer,Ie.indexBuffer,Ie.segments,null,M.transform.zoom,null,null,Ie.collisionVertexBuffer)}var J;if(!T||!G.length)return;const ie=M.useProgram("collisionCircle"),de=new s.aR;de.resize(4*q),de._trim();let pe=0;for(const Te of G)for(let Ce=0;Ce=0&&(Te[ve.associatedIconIndex]={shiftedAnchor:ar,angle:pn})}else Yt(ve.numGlyphs,_e)}if(q){Se.clear();const Ce=M.icon.placedSymbolArray;for(let ve=0;veM.style.map.terrain.getElevation(ft,Lu,Pu):null,yl=y.layout.get("text-rotation-alignment")==="map";he(Rt,ft.posMatrix,M,T,Iu,ku,Te,q,yl,_e,ft.toUnwrapped(),pe.width,pe.height,Pa,Nr)}const Ra=ft.posMatrix,Na=T&&at||em,Ms=Ce||Na?yh:Iu,Ka=zf,ui=wt&&y.paint.get(T?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let yi;yi=wt?Rt.iconsInText?mv(ar.kind,kr,ve,Te,Ce,Na,M,Ra,Ms,Ka,Pa,vi,Mi,Et):gh(ar.kind,kr,ve,Te,Ce,Na,M,Ra,Ms,Ka,Pa,T,vi,!0,Et):ub(ar.kind,kr,ve,Te,Ce,Na,M,Ra,Ms,Ka,Pa,T,vi,Et);const ga={program:xr,buffers:ur,uniformValues:yi,atlasTexture:Ya,atlasTextureIcon:mi,atlasInterpolation:vn,atlasInterpolationIcon:Gi,isSDF:wt,hasHalo:ui};if(Pe&&Rt.canOverlap){Be=!0;const Nr=ur.segments.get();for(const yl of Nr)bt.push({segments:new s.a0([yl]),sortKey:yl.sortKey,state:ga,terrainData:gn})}else bt.push({segments:ur.segments,sortKey:0,state:ga,terrainData:gn})}Be&&bt.sort((ft,dt)=>ft.sortKey-dt.sortKey);for(const ft of bt){const dt=ft.state;if(ie.activeTexture.set(de.TEXTURE0),dt.atlasTexture.bind(dt.atlasInterpolation,de.CLAMP_TO_EDGE),dt.atlasTextureIcon&&(ie.activeTexture.set(de.TEXTURE1),dt.atlasTextureIcon&&dt.atlasTextureIcon.bind(dt.atlasInterpolationIcon,de.CLAMP_TO_EDGE)),dt.isSDF){const Rt=dt.uniformValues;dt.hasHalo&&(Rt.u_is_halo=1,Iv(dt.buffers,ft.segments,y,M,dt.program,Ke,K,J,Rt,ft.terrainData)),Rt.u_is_halo=0}Iv(dt.buffers,ft.segments,y,M,dt.program,Ke,K,J,dt.uniformValues,ft.terrainData)}}function Iv(M,c,y,S,T,D,N,B,G,q){const K=S.context;T.draw(K,K.gl.TRIANGLES,D,N,B,Qr.disabled,G,q,y.id,M.layoutVertexBuffer,M.indexBuffer,c,y.paint,S.transform.zoom,M.programConfigurations.get(y.id),M.dynamicLayoutVertexBuffer,M.opacityVertexBuffer)}function kv(M,c,y,S){const T=M.context,D=T.gl,N=un.disabled,B=new Mn([D.ONE,D.ONE],s.aM.transparent,[!0,!0,!0,!0]),G=c.getBucket(y);if(!G)return;const q=S.key;let K=y.heatmapFbos.get(q);K||(K=_h(T,c.tileSize,c.tileSize),y.heatmapFbos.set(q,K)),T.bindFramebuffer.set(K.framebuffer),T.viewport.set([0,0,c.tileSize,c.tileSize]),T.clear({color:s.aM.transparent});const J=G.programConfigurations.get(y.id),ie=M.useProgram("heatmap",J),de=M.style.map.terrain.getTerrainData(S);ie.draw(T,D.TRIANGLES,Tr.disabled,N,B,Qr.disabled,$i(S.posMatrix,c,M.transform.zoom,y.paint.get("heatmap-intensity")),de,y.id,G.layoutVertexBuffer,G.indexBuffer,G.segments,y.paint,M.transform.zoom,J)}function pl(M,c,y){const S=M.context,T=S.gl;S.setColorMode(M.colorModeForRenderPass());const D=bh(S,c),N=y.key,B=c.heatmapFbos.get(N);B&&(S.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,B.colorAttachment.get()),S.activeTexture.set(T.TEXTURE1),D.bind(T.LINEAR,T.CLAMP_TO_EDGE),M.useProgram("heatmapTexture").draw(S,T.TRIANGLES,Tr.disabled,un.disabled,M.colorModeForRenderPass(),Qr.disabled,cf(M,c,0,1),null,c.id,M.rasterBoundsBuffer,M.quadTriangleIndexBuffer,M.rasterBoundsSegments,c.paint,M.transform.zoom),B.destroy(),c.heatmapFbos.delete(N))}function _h(M,c,y){var S,T;const D=M.gl,N=D.createTexture();D.bindTexture(D.TEXTURE_2D,N),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_S,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_WRAP_T,D.CLAMP_TO_EDGE),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MIN_FILTER,D.LINEAR),D.texParameteri(D.TEXTURE_2D,D.TEXTURE_MAG_FILTER,D.LINEAR);const B=(S=M.HALF_FLOAT)!==null&&S!==void 0?S:D.UNSIGNED_BYTE,G=(T=M.RGBA16F)!==null&&T!==void 0?T:D.RGBA;D.texImage2D(D.TEXTURE_2D,0,G,c,y,0,D.RGBA,B,null);const q=M.createFramebuffer(c,y,!1,!1);return q.colorAttachment.set(N),q}function bh(M,c){return c.colorRampTexture||(c.colorRampTexture=new Y(M,c.colorRamp,M.gl.RGBA)),c.colorRampTexture}function vu(M,c,y,S,T){if(!y||!S||!S.imageAtlas)return;const D=S.imageAtlas.patternPositions;let N=D[y.to.toString()],B=D[y.from.toString()];if(!N&&B&&(N=B),!B&&N&&(B=N),!N||!B){const G=T.getPaintProperty(c);N=D[G],B=D[G]}N&&B&&M.setConstantPatternPositions(N,B)}function xh(M,c,y,S,T,D,N){const B=M.context.gl,G="fill-pattern",q=y.paint.get(G),K=q&&q.constantOr(1),J=y.getCrossfadeParameters();let ie,de,pe,_e,Se;N?(de=K&&!y.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",ie=B.LINES):(de=K?"fillPattern":"fill",ie=B.TRIANGLES);const Te=q.constantOr(null);for(const Ce of S){const ve=c.getTile(Ce);if(K&&!ve.patternsLoaded())continue;const Ie=ve.getBucket(y);if(!Ie)continue;const Pe=Ie.programConfigurations.get(y.id),Be=M.useProgram(de,Pe),Ke=M.style.map.terrain&&M.style.map.terrain.getTerrainData(Ce);K&&(M.context.activeTexture.set(B.TEXTURE0),ve.imageAtlasTexture.bind(B.LINEAR,B.CLAMP_TO_EDGE),Pe.updatePaintBuffers(J)),vu(Pe,G,Te,ve,y);const at=Ke?Ce:null,bt=M.translatePosMatrix(at?at.posMatrix:Ce.posMatrix,ve,y.paint.get("fill-translate"),y.paint.get("fill-translate-anchor"));if(N){_e=Ie.indexBuffer2,Se=Ie.segments2;const Et=[B.drawingBufferWidth,B.drawingBufferHeight];pe=de==="fillOutlinePattern"&&K?ab(bt,M,J,ve,Et):dA(bt,Et)}else _e=Ie.indexBuffer,Se=Ie.segments,pe=K?ib(bt,M,J,ve):du(bt);Be.draw(M.context,ie,T,M.stencilModeForClipping(Ce),D,Qr.disabled,pe,Ke,y.id,Ie.layoutVertexBuffer,_e,Se,y.paint,M.transform.zoom,Pe)}}function _f(M,c,y,S,T,D,N){const B=M.context,G=B.gl,q="fill-extrusion-pattern",K=y.paint.get(q),J=K.constantOr(1),ie=y.getCrossfadeParameters(),de=y.paint.get("fill-extrusion-opacity"),pe=K.constantOr(null);for(const _e of S){const Se=c.getTile(_e),Te=Se.getBucket(y);if(!Te)continue;const Ce=M.style.map.terrain&&M.style.map.terrain.getTerrainData(_e),ve=Te.programConfigurations.get(y.id),Ie=M.useProgram(J?"fillExtrusionPattern":"fillExtrusion",ve);J&&(M.context.activeTexture.set(G.TEXTURE0),Se.imageAtlasTexture.bind(G.LINEAR,G.CLAMP_TO_EDGE),ve.updatePaintBuffers(ie)),vu(ve,q,pe,Se,y);const Pe=M.translatePosMatrix(_e.posMatrix,Se,y.paint.get("fill-extrusion-translate"),y.paint.get("fill-extrusion-translate-anchor")),Be=y.paint.get("fill-extrusion-vertical-gradient"),Ke=J?uf(Pe,M,Be,de,_e,ie,Se):fh(Pe,M,Be,de);Ie.draw(B,B.gl.TRIANGLES,T,D,N,Qr.backCCW,Ke,Ce,y.id,Te.layoutVertexBuffer,Te.indexBuffer,Te.segments,y.paint,M.transform.zoom,ve,M.style.map.terrain&&Te.centroidVertexBuffer)}}function mu(M,c,y,S,T,D,N){const B=M.context,G=B.gl,q=y.fbo;if(!q)return;const K=M.useProgram("hillshade"),J=M.style.map.terrain&&M.style.map.terrain.getTerrainData(c);B.activeTexture.set(G.TEXTURE0),G.bindTexture(G.TEXTURE_2D,q.colorAttachment.get()),K.draw(B,G.TRIANGLES,T,D,N,Qr.disabled,((ie,de,pe,_e)=>{const Se=pe.paint.get("hillshade-shadow-color"),Te=pe.paint.get("hillshade-highlight-color"),Ce=pe.paint.get("hillshade-accent-color");let ve=pe.paint.get("hillshade-illumination-direction")*(Math.PI/180);pe.paint.get("hillshade-illumination-anchor")==="viewport"&&(ve-=ie.transform.angle);const Ie=!ie.options.moving;return{u_matrix:_e?_e.posMatrix:ie.transform.calculatePosMatrix(de.tileID.toUnwrapped(),Ie),u_image:0,u_latrange:hf(0,de.tileID),u_light:[pe.paint.get("hillshade-exaggeration"),ve],u_shadow:Se,u_highlight:Te,u_accent:Ce}})(M,y,S,J?c:null),J,S.id,M.rasterBoundsBuffer,M.quadTriangleIndexBuffer,M.rasterBoundsSegments)}function yu(M,c,y,S,T,D){const N=M.context,B=N.gl,G=c.dem;if(G&&G.data){const q=G.dim,K=G.stride,J=G.getPixels();if(N.activeTexture.set(B.TEXTURE1),N.pixelStoreUnpackPremultiplyAlpha.set(!1),c.demTexture=c.demTexture||M.getTileTexture(K),c.demTexture){const de=c.demTexture;de.update(J,{premultiply:!1}),de.bind(B.NEAREST,B.CLAMP_TO_EDGE)}else c.demTexture=new Y(N,J,B.RGBA,{premultiply:!1}),c.demTexture.bind(B.NEAREST,B.CLAMP_TO_EDGE);N.activeTexture.set(B.TEXTURE0);let ie=c.fbo;if(!ie){const de=new Y(N,{width:q,height:q,data:null},B.RGBA);de.bind(B.LINEAR,B.CLAMP_TO_EDGE),ie=c.fbo=N.createFramebuffer(q,q,!0,!1),ie.colorAttachment.set(de.texture)}N.bindFramebuffer.set(ie.framebuffer),N.viewport.set([0,0,q,q]),M.useProgram("hillshadePrepare").draw(N,B.TRIANGLES,S,T,D,Qr.disabled,((de,pe)=>{const _e=pe.stride,Se=s.H();return s.aP(Se,0,s.X,-s.X,0,0,1),s.J(Se,Se,[0,-s.X,0]),{u_matrix:Se,u_image:1,u_dimension:[_e,_e],u_zoom:de.overscaledZ,u_unpack:pe.getUnpackVector()}})(c.tileID,G),null,y.id,M.rasterBoundsBuffer,M.quadTriangleIndexBuffer,M.rasterBoundsSegments),c.needsHillshadePrepare=!1}}function wb(M,c,y,S,T,D){const N=S.paint.get("raster-fade-duration");if(!D&&N>0){const B=f.now(),G=(B-M.timeAdded)/N,q=c?(B-c.timeAdded)/N:-1,K=y.getSource(),J=T.coveringZoomLevel({tileSize:K.tileSize,roundZoom:K.roundZoom}),ie=!c||Math.abs(c.tileID.overscaledZ-J)>Math.abs(M.tileID.overscaledZ-J),de=ie&&M.refreshedUponExpiration?1:s.ac(ie?G:1-q,0,1);return M.refreshedUponExpiration&&G>=1&&(M.refreshedUponExpiration=!1),c?{opacity:1,mix:1-de}:{opacity:de,mix:0}}return{opacity:1,mix:0}}const Lv=new s.aM(1,0,0,1),Ur=new s.aM(0,1,0,1),bf=new s.aM(0,0,1,1),AA=new s.aM(1,0,1,1),Sb=new s.aM(0,1,1,1);function _u(M,c,y,S){xf(M,0,c+y/2,M.transform.width,y,S)}function Tb(M,c,y,S){xf(M,c-y/2,0,y,M.transform.height,S)}function xf(M,c,y,S,T,D){const N=M.context,B=N.gl;B.enable(B.SCISSOR_TEST),B.scissor(c*M.pixelRatio,y*M.pixelRatio,S*M.pixelRatio,T*M.pixelRatio),N.clear({color:D}),B.disable(B.SCISSOR_TEST)}function Eb(M,c,y){const S=M.context,T=S.gl,D=y.posMatrix,N=M.useProgram("debug"),B=Tr.disabled,G=un.disabled,q=M.colorModeForRenderPass(),K="$debug",J=M.style.map.terrain&&M.style.map.terrain.getTerrainData(y);S.activeTexture.set(T.TEXTURE0);const ie=c.getTileByID(y.key).latestRawTileData,de=Math.floor((ie&&ie.byteLength||0)/1024),pe=c.getTile(y).tileSize,_e=512/Math.min(pe,512)*(y.overscaledZ/M.transform.zoom)*.5;let Se=y.canonical.toString();y.overscaledZ!==y.canonical.z&&(Se+=` => ${y.overscaledZ}`),function(Te,Ce){Te.initDebugOverlayCanvas();const ve=Te.debugOverlayCanvas,Ie=Te.context.gl,Pe=Te.debugOverlayCanvas.getContext("2d");Pe.clearRect(0,0,ve.width,ve.height),Pe.shadowColor="white",Pe.shadowBlur=2,Pe.lineWidth=1.5,Pe.strokeStyle="white",Pe.textBaseline="top",Pe.font="bold 36px Open Sans, sans-serif",Pe.fillText(Ce,5,5),Pe.strokeText(Ce,5,5),Te.debugOverlayTexture.update(ve),Te.debugOverlayTexture.bind(Ie.LINEAR,Ie.CLAMP_TO_EDGE)}(M,`${Se} ${de}kB`),N.draw(S,T.TRIANGLES,B,G,Mn.alphaBlended,Qr.disabled,ph(D,s.aM.transparent,_e),null,K,M.debugBuffer,M.quadTriangleIndexBuffer,M.debugSegments),N.draw(S,T.LINE_STRIP,B,G,q,Qr.disabled,ph(D,s.aM.red),J,K,M.debugBuffer,M.tileBorderIndexBuffer,M.debugSegments)}function Cb(M,c,y){const S=M.context,T=S.gl,D=M.colorModeForRenderPass(),N=new Tr(T.LEQUAL,Tr.ReadWrite,M.depthRangeFor3D),B=M.useProgram("terrain"),G=c.getTerrainMesh();S.bindFramebuffer.set(null),S.viewport.set([0,0,M.width,M.height]);for(const q of y){const K=M.renderToTexture.getTexture(q),J=c.getTerrainData(q.tileID);S.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,K.texture);const ie=M.transform.calculatePosMatrix(q.tileID.toUnwrapped()),de=c.getMeshFrameDelta(M.transform.zoom),pe=M.transform.calculateFogMatrix(q.tileID.toUnwrapped()),_e=gv(ie,de,pe,M.style.sky,M.transform.pitch);B.draw(S,T.TRIANGLES,N,un.disabled,D,Qr.backCCW,_e,J,"terrain",G.vertexBuffer,G.indexBuffer,G.segments)}}class wf{constructor(c,y,S){this.vertexBuffer=c,this.indexBuffer=y,this.segments=S}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class Sf{constructor(c,y){this.context=new CA(c),this.transform=y,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:s.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=tr.maxUnderzooming+tr.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new fv}resize(c,y,S){if(this.width=Math.floor(c*S),this.height=Math.floor(y*S),this.pixelRatio=S,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const T of this.style._order)this.style._layers[T].resize()}setup(){const c=this.context,y=new s.aX;y.emplaceBack(0,0),y.emplaceBack(s.X,0),y.emplaceBack(0,s.X),y.emplaceBack(s.X,s.X),this.tileExtentBuffer=c.createVertexBuffer(y,sl.members),this.tileExtentSegments=s.a0.simpleSegment(0,0,4,2);const S=new s.aX;S.emplaceBack(0,0),S.emplaceBack(s.X,0),S.emplaceBack(0,s.X),S.emplaceBack(s.X,s.X),this.debugBuffer=c.createVertexBuffer(S,sl.members),this.debugSegments=s.a0.simpleSegment(0,0,4,5);const T=new s.$;T.emplaceBack(0,0,0,0),T.emplaceBack(s.X,0,s.X,0),T.emplaceBack(0,s.X,0,s.X),T.emplaceBack(s.X,s.X,s.X,s.X),this.rasterBoundsBuffer=c.createVertexBuffer(T,Yn.members),this.rasterBoundsSegments=s.a0.simpleSegment(0,0,4,2);const D=new s.aX;D.emplaceBack(0,0),D.emplaceBack(1,0),D.emplaceBack(0,1),D.emplaceBack(1,1),this.viewportBuffer=c.createVertexBuffer(D,sl.members),this.viewportSegments=s.a0.simpleSegment(0,0,4,2);const N=new s.aZ;N.emplaceBack(0),N.emplaceBack(1),N.emplaceBack(3),N.emplaceBack(2),N.emplaceBack(0),this.tileBorderIndexBuffer=c.createIndexBuffer(N);const B=new s.aY;B.emplaceBack(0,1,2),B.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=c.createIndexBuffer(B);const G=this.context.gl;this.stencilClearMode=new un({func:G.ALWAYS,mask:0},0,255,G.ZERO,G.ZERO,G.ZERO)}clearStencil(){const c=this.context,y=c.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const S=s.H();s.aP(S,0,this.width,this.height,0,0,1),s.K(S,S,[y.drawingBufferWidth,y.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(c,y.TRIANGLES,Tr.disabled,this.stencilClearMode,Mn.disabled,Qr.disabled,Fi(S),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(c,y){if(this.currentStencilSource===c.source||!c.isTileClipped()||!y||!y.length)return;this.currentStencilSource=c.source;const S=this.context,T=S.gl;this.nextStencilID+y.length>256&&this.clearStencil(),S.setColorMode(Mn.disabled),S.setDepthMode(Tr.disabled);const D=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const N of y){const B=this._tileClippingMaskIDs[N.key]=this.nextStencilID++,G=this.style.map.terrain&&this.style.map.terrain.getTerrainData(N);D.draw(S,T.TRIANGLES,Tr.disabled,new un({func:T.ALWAYS,mask:0},B,255,T.KEEP,T.KEEP,T.REPLACE),Mn.disabled,Qr.disabled,Fi(N.posMatrix),G,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const c=this.nextStencilID++,y=this.context.gl;return new un({func:y.NOTEQUAL,mask:255},c,255,y.KEEP,y.KEEP,y.REPLACE)}stencilModeForClipping(c){const y=this.context.gl;return new un({func:y.EQUAL,mask:255},this._tileClippingMaskIDs[c.key],0,y.KEEP,y.KEEP,y.REPLACE)}stencilConfigForOverlap(c){const y=this.context.gl,S=c.sort((N,B)=>B.overscaledZ-N.overscaledZ),T=S[S.length-1].overscaledZ,D=S[0].overscaledZ-T+1;if(D>1){this.currentStencilSource=void 0,this.nextStencilID+D>256&&this.clearStencil();const N={};for(let B=0;B({u_sky_color:Te.properties.get("sky-color"),u_horizon_color:Te.properties.get("horizon-color"),u_horizon:(Ce.height/2+Ce.getHorizon())*ve,u_sky_horizon_blend:Te.properties.get("sky-horizon-blend")*Ce.height/2*ve}))(q,G.style.map.transform,G.pixelRatio),de=new Tr(J.LEQUAL,Tr.ReadWrite,[0,1]),pe=un.disabled,_e=G.colorModeForRenderPass(),Se=G.useProgram("sky");if(!q.mesh){const Te=new s.aX;Te.emplaceBack(-1,-1),Te.emplaceBack(1,-1),Te.emplaceBack(1,1),Te.emplaceBack(-1,1);const Ce=new s.aY;Ce.emplaceBack(0,1,2),Ce.emplaceBack(0,2,3),q.mesh=new wf(K.createVertexBuffer(Te,sl.members),K.createIndexBuffer(Ce),s.a0.simpleSegment(0,0,Te.length,Ce.length))}Se.draw(K,J.TRIANGLES,de,pe,_e,Qr.disabled,ie,void 0,"sky",q.mesh.vertexBuffer,q.mesh.indexBuffer,q.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=y.showOverdrawInspector,this.depthRangeFor3D=[0,1-(c._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=S.length-1;this.currentLayer>=0;this.currentLayer--){const G=this.style._layers[S[this.currentLayer]],q=T[G.source],K=D[G.source];this._renderTileClippingMasks(G,K),this.renderLayer(this,q,G,K)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayerSe.source&&!Se.isHidden(K)?[q.sourceCaches[Se.source]]:[]),de=ie.filter(Se=>Se.getSource().type==="vector"),pe=ie.filter(Se=>Se.getSource().type!=="vector"),_e=Se=>{(!J||J.getSource().maxzoom_e(Se)),J||pe.forEach(Se=>_e(Se)),J}(this.style,this.transform.zoom);G&&function(q,K,J){for(let ie=0;ie0),T&&(s.b0(y,S),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(D,N){const B=D.context,G=B.gl,q=Mn.unblended,K=new Tr(G.LEQUAL,Tr.ReadWrite,[0,1]),J=N.getTerrainMesh(),ie=N.sourceCache.getRenderableTiles(),de=D.useProgram("terrainDepth");B.bindFramebuffer.set(N.getFramebuffer("depth").framebuffer),B.viewport.set([0,0,D.width/devicePixelRatio,D.height/devicePixelRatio]),B.clear({color:s.aM.transparent,depth:1});for(const pe of ie){const _e=N.getTerrainData(pe.tileID),Se={u_matrix:D.transform.calculatePosMatrix(pe.tileID.toUnwrapped()),u_ele_delta:N.getMeshFrameDelta(D.transform.zoom)};de.draw(B,G.TRIANGLES,K,un.disabled,q,Qr.backCCW,Se,_e,"terrain",J.vertexBuffer,J.indexBuffer,J.segments)}B.bindFramebuffer.set(null),B.viewport.set([0,0,D.width,D.height])}(this,this.style.map.terrain),function(D,N){const B=D.context,G=B.gl,q=Mn.unblended,K=new Tr(G.LEQUAL,Tr.ReadWrite,[0,1]),J=N.getTerrainMesh(),ie=N.getCoordsTexture(),de=N.sourceCache.getRenderableTiles(),pe=D.useProgram("terrainCoords");B.bindFramebuffer.set(N.getFramebuffer("coords").framebuffer),B.viewport.set([0,0,D.width/devicePixelRatio,D.height/devicePixelRatio]),B.clear({color:s.aM.transparent,depth:1}),N.coordsIndex=[];for(const _e of de){const Se=N.getTerrainData(_e.tileID);B.activeTexture.set(G.TEXTURE0),G.bindTexture(G.TEXTURE_2D,ie.texture);const Te={u_matrix:D.transform.calculatePosMatrix(_e.tileID.toUnwrapped()),u_terrain_coords_id:(255-N.coordsIndex.length)/255,u_texture:0,u_ele_delta:N.getMeshFrameDelta(D.transform.zoom)};pe.draw(B,G.TRIANGLES,K,un.disabled,q,Qr.backCCW,Te,Se,"terrain",J.vertexBuffer,J.indexBuffer,J.segments),N.coordsIndex.push(_e.tileID.key)}B.bindFramebuffer.set(null),B.viewport.set([0,0,D.width,D.height])}(this,this.style.map.terrain))}renderLayer(c,y,S,T){if(!S.isHidden(this.transform.zoom)&&(S.type==="background"||S.type==="custom"||(T||[]).length))switch(this.id=S.id,S.type){case"symbol":(function(D,N,B,G,q){if(D.renderPass!=="translucent")return;const K=un.disabled,J=D.colorModeForRenderPass();(B._unevaluatedLayout.hasValue("text-variable-anchor")||B._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(ie,de,pe,_e,Se,Te,Ce,ve,Ie){const Pe=de.transform,Be=ol(),Ke=Se==="map",at=Te==="map";for(const bt of ie){const Et=_e.getTile(bt),ft=Et.getBucket(pe);if(!ft||!ft.text||!ft.text.segments.get().length)continue;const dt=s.ag(ft.textSizeData,Pe.zoom),Rt=Ir(Et,1,de.transform.zoom),ur=ua(bt.posMatrix,at,Ke,de.transform,Rt),yt=pe.layout.get("icon-text-fit")!=="none"&&ft.hasIconData();if(dt){const wt=Math.pow(2,Pe.zoom-Et.tileID.overscaledZ),ar=de.style.map.terrain?(xr,kr)=>de.style.map.terrain.getElevation(bt,xr,kr):null,pn=Be.translatePosition(Pe,Et,Ce,ve);gu(ft,Ke,at,Ie,Pe,ur,bt.posMatrix,wt,dt,yt,Be,pn,bt.toUnwrapped(),ar)}}}(G,D,B,N,B.layout.get("text-rotation-alignment"),B.layout.get("text-pitch-alignment"),B.paint.get("text-translate"),B.paint.get("text-translate-anchor"),q),B.paint.get("icon-opacity").constantOr(1)!==0&&Mv(D,N,B,G,!1,B.paint.get("icon-translate"),B.paint.get("icon-translate-anchor"),B.layout.get("icon-rotation-alignment"),B.layout.get("icon-pitch-alignment"),B.layout.get("icon-keep-upright"),K,J),B.paint.get("text-opacity").constantOr(1)!==0&&Mv(D,N,B,G,!0,B.paint.get("text-translate"),B.paint.get("text-translate-anchor"),B.layout.get("text-rotation-alignment"),B.layout.get("text-pitch-alignment"),B.layout.get("text-keep-upright"),K,J),N.map.showCollisionBoxes&&(mh(D,N,B,G,!0),mh(D,N,B,G,!1))})(c,y,S,T,this.style.placement.variableOffsets);break;case"circle":(function(D,N,B,G){if(D.renderPass!=="translucent")return;const q=B.paint.get("circle-opacity"),K=B.paint.get("circle-stroke-width"),J=B.paint.get("circle-stroke-opacity"),ie=!B.layout.get("circle-sort-key").isConstant();if(q.constantOr(1)===0&&(K.constantOr(1)===0||J.constantOr(1)===0))return;const de=D.context,pe=de.gl,_e=D.depthModeForSublayer(0,Tr.ReadOnly),Se=un.disabled,Te=D.colorModeForRenderPass(),Ce=[];for(let ve=0;veve.sortKey-Ie.sortKey);for(const ve of Ce){const{programConfiguration:Ie,program:Pe,layoutVertexBuffer:Be,indexBuffer:Ke,uniformValues:at,terrainData:bt}=ve.state;Pe.draw(de,pe.TRIANGLES,_e,Se,Te,Qr.disabled,at,bt,B.id,Be,Ke,ve.segments,B.paint,D.transform.zoom,Ie)}})(c,y,S,T);break;case"heatmap":(function(D,N,B,G){if(B.paint.get("heatmap-opacity")===0)return;const q=D.context;if(D.style.map.terrain){for(const K of G){const J=N.getTile(K);N.hasRenderableParent(K)||(D.renderPass==="offscreen"?kv(D,J,B,K):D.renderPass==="translucent"&&pl(D,B,K))}q.viewport.set([0,0,D.width,D.height])}else D.renderPass==="offscreen"?function(K,J,ie,de){const pe=K.context,_e=pe.gl,Se=un.disabled,Te=new Mn([_e.ONE,_e.ONE],s.aM.transparent,[!0,!0,!0,!0]);(function(Ce,ve,Ie){const Pe=Ce.gl;Ce.activeTexture.set(Pe.TEXTURE1),Ce.viewport.set([0,0,ve.width/4,ve.height/4]);let Be=Ie.heatmapFbos.get(s.aU);Be?(Pe.bindTexture(Pe.TEXTURE_2D,Be.colorAttachment.get()),Ce.bindFramebuffer.set(Be.framebuffer)):(Be=_h(Ce,ve.width/4,ve.height/4),Ie.heatmapFbos.set(s.aU,Be))})(pe,K,ie),pe.clear({color:s.aM.transparent});for(let Ce=0;Ce20&&K.texParameterf(K.TEXTURE_2D,q.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,q.extTextureFilterAnisotropicMax);const ft=D.style.map.terrain&&D.style.map.terrain.getTerrainData(Ce),dt=ft?Ce:null,Rt=dt?dt.posMatrix:D.transform.calculatePosMatrix(Ce.toUnwrapped(),Te),ur=gA(Rt,bt||[0,0],at||1,Ke,B);J instanceof Tn?ie.draw(q,K.TRIANGLES,ve,un.disabled,de,Qr.disabled,ur,ft,B.id,J.boundsBuffer,D.quadTriangleIndexBuffer,J.boundsSegments):ie.draw(q,K.TRIANGLES,ve,pe[Ce.overscaledZ],de,Qr.disabled,ur,ft,B.id,D.rasterBoundsBuffer,D.quadTriangleIndexBuffer,D.rasterBoundsSegments)}})(c,y,S,T);break;case"background":(function(D,N,B,G){const q=B.paint.get("background-color"),K=B.paint.get("background-opacity");if(K===0)return;const J=D.context,ie=J.gl,de=D.transform,pe=de.tileSize,_e=B.paint.get("background-pattern");if(D.isPatternMissing(_e))return;const Se=!_e&&q.a===1&&K===1&&D.opaquePassEnabledForLayer()?"opaque":"translucent";if(D.renderPass!==Se)return;const Te=un.disabled,Ce=D.depthModeForSublayer(0,Se==="opaque"?Tr.ReadWrite:Tr.ReadOnly),ve=D.colorModeForRenderPass(),Ie=D.useProgram(_e?"backgroundPattern":"background"),Pe=G||de.coveringTiles({tileSize:pe,terrain:D.style.map.terrain});_e&&(J.activeTexture.set(ie.TEXTURE0),D.imageManager.bind(D.context));const Be=B.getCrossfadeParameters();for(const Ke of Pe){const at=G?Ke.posMatrix:D.transform.calculatePosMatrix(Ke.toUnwrapped()),bt=_e?yv(at,K,D,_e,{tileID:Ke,tileSize:pe},Be):ff(at,K,q),Et=D.style.map.terrain&&D.style.map.terrain.getTerrainData(Ke);Ie.draw(J,ie.TRIANGLES,Ce,Te,ve,Qr.disabled,bt,Et,B.id,D.tileExtentBuffer,D.quadTriangleIndexBuffer,D.tileExtentSegments)}})(c,0,S,T);break;case"custom":(function(D,N,B){const G=D.context,q=B.implementation;if(D.renderPass==="offscreen"){const K=q.prerender;K&&(D.setCustomLayerDefaults(),G.setColorMode(D.colorModeForRenderPass()),K.call(q,G.gl,D.transform.customLayerMatrix()),G.setDirty(),D.setBaseState())}else if(D.renderPass==="translucent"){D.setCustomLayerDefaults(),G.setColorMode(D.colorModeForRenderPass()),G.setStencilMode(un.disabled);const K=q.renderingMode==="3d"?new Tr(D.context.gl.LEQUAL,Tr.ReadWrite,D.depthRangeFor3D):D.depthModeForSublayer(0,Tr.ReadOnly);G.setDepthMode(K),q.render(G.gl,D.transform.customLayerMatrix(),{farZ:D.transform.farZ,nearZ:D.transform.nearZ,fov:D.transform._fov,modelViewProjectionMatrix:D.transform.modelViewProjectionMatrix,projectionMatrix:D.transform.projectionMatrix}),G.setDirty(),D.setBaseState(),G.bindFramebuffer.set(null)}})(c,0,S)}}translatePosMatrix(c,y,S,T,D){if(!S[0]&&!S[1])return c;const N=D?T==="map"?this.transform.angle:0:T==="viewport"?-this.transform.angle:0;if(N){const q=Math.sin(N),K=Math.cos(N);S=[S[0]*K-S[1]*q,S[0]*q+S[1]*K]}const B=[D?S[0]:Ir(y,S[0],this.transform.zoom),D?S[1]:Ir(y,S[1],this.transform.zoom),0],G=new Float32Array(16);return s.J(G,c,B),G}saveTileTexture(c){const y=this._tileTextures[c.size[0]];y?y.push(c):this._tileTextures[c.size[0]]=[c]}getTileTexture(c){const y=this._tileTextures[c];return y&&y.length>0?y.pop():null}isPatternMissing(c){if(!c)return!1;if(!c.from||!c.to)return!0;const y=this.imageManager.getPattern(c.from.toString()),S=this.imageManager.getPattern(c.to.toString());return!y||!S}useProgram(c,y){this.cache=this.cache||{};const S=c+(y?y.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[S]||(this.cache[S]=new vv(this.context,As[c],y,_v[c],this._showOverdrawInspector,this.style.map.terrain)),this.cache[S]}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(){const c=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(c.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Y(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:c,drawingBufferHeight:y}=this.context.gl;return this.width!==c||this.height!==y}}class bu{constructor(c,y){this.points=c,this.planes=y}static fromInvProjectionMatrix(c,y,S){const T=Math.pow(2,S),D=[[-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(B=>{const G=1/(B=s.af([],B,c))[3]/y*T;return s.b1(B,B,[G,G,1/B[3],G])}),N=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(B=>{const G=function(ie,de){var pe=de[0],_e=de[1],Se=de[2],Te=pe*pe+_e*_e+Se*Se;return Te>0&&(Te=1/Math.sqrt(Te)),ie[0]=de[0]*Te,ie[1]=de[1]*Te,ie[2]=de[2]*Te,ie}([],function(ie,de,pe){var _e=de[0],Se=de[1],Te=de[2],Ce=pe[0],ve=pe[1],Ie=pe[2];return ie[0]=Se*Ie-Te*ve,ie[1]=Te*Ce-_e*Ie,ie[2]=_e*ve-Se*Ce,ie}([],$([],D[B[0]],D[B[1]]),$([],D[B[2]],D[B[1]]))),q=-((K=G)[0]*(J=D[B[1]])[0]+K[1]*J[1]+K[2]*J[2]);var K,J;return G.concat(q)});return new bu(D,N)}}class xu{constructor(c,y){this.min=c,this.max=y,this.center=function(S,T,D){return S[0]=.5*T[0],S[1]=.5*T[1],S[2]=.5*T[2],S}([],function(S,T,D){return S[0]=T[0]+D[0],S[1]=T[1]+D[1],S[2]=T[2]+D[2],S}([],this.min,this.max))}quadrant(c){const y=[c%2==0,c<2],S=V(this.min),T=V(this.max);for(let D=0;D=0&&N++;if(N===0)return 0;N!==y.length&&(S=!1)}if(S)return 2;for(let T=0;T<3;T++){let D=Number.MAX_VALUE,N=-Number.MAX_VALUE;for(let B=0;Bthis.max[T]-this.min[T])return 0}return 1}}class wu{constructor(c=0,y=0,S=0,T=0){if(isNaN(c)||c<0||isNaN(y)||y<0||isNaN(S)||S<0||isNaN(T)||T<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=c,this.bottom=y,this.left=S,this.right=T}interpolate(c,y,S){return y.top!=null&&c.top!=null&&(this.top=s.y.number(c.top,y.top,S)),y.bottom!=null&&c.bottom!=null&&(this.bottom=s.y.number(c.bottom,y.bottom,S)),y.left!=null&&c.left!=null&&(this.left=s.y.number(c.left,y.left,S)),y.right!=null&&c.right!=null&&(this.right=s.y.number(c.right,y.right,S)),this}getCenter(c,y){const S=s.ac((this.left+c-this.right)/2,0,c),T=s.ac((this.top+y-this.bottom)/2,0,y);return new s.P(S,T)}equals(c){return this.top===c.top&&this.bottom===c.bottom&&this.left===c.left&&this.right===c.right}clone(){return new wu(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Pv=85.051129;class Su{constructor(c,y,S,T,D){this.tileSize=512,this._renderWorldCopies=D===void 0||!!D,this._minZoom=c||0,this._maxZoom=y||22,this._minPitch=S??0,this._maxPitch=T??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new s.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new wu,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const c=new Su(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return c.apply(this),c}apply(c){this.tileSize=c.tileSize,this.latRange=c.latRange,this.lngRange=c.lngRange,this.width=c.width,this.height=c.height,this._center=c._center,this._elevation=c._elevation,this.minElevationForCurrentTile=c.minElevationForCurrentTile,this.zoom=c.zoom,this.angle=c.angle,this._fov=c._fov,this._pitch=c._pitch,this._unmodified=c._unmodified,this._edgeInsets=c._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(c){this._minZoom!==c&&(this._minZoom=c,this.zoom=Math.max(this.zoom,c))}get maxZoom(){return this._maxZoom}set maxZoom(c){this._maxZoom!==c&&(this._maxZoom=c,this.zoom=Math.min(this.zoom,c))}get minPitch(){return this._minPitch}set minPitch(c){this._minPitch!==c&&(this._minPitch=c,this.pitch=Math.max(this.pitch,c))}get maxPitch(){return this._maxPitch}set maxPitch(c){this._maxPitch!==c&&(this._maxPitch=c,this.pitch=Math.min(this.pitch,c))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(c){c===void 0?c=!0:c===null&&(c=!1),this._renderWorldCopies=c}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new s.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(c){const y=-s.b3(c,-180,180)*Math.PI/180;this.angle!==y&&(this._unmodified=!1,this.angle=y,this._calcMatrices(),this.rotationMatrix=function(){var S=new s.A(4);return s.A!=Float32Array&&(S[1]=0,S[2]=0),S[0]=1,S[3]=1,S}(),function(S,T,D){var N=T[0],B=T[1],G=T[2],q=T[3],K=Math.sin(D),J=Math.cos(D);S[0]=N*J+G*K,S[1]=B*J+q*K,S[2]=N*-K+G*J,S[3]=B*-K+q*J}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(c){const y=s.ac(c,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==y&&(this._unmodified=!1,this._pitch=y,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(c){c=Math.max(.01,Math.min(60,c)),this._fov!==c&&(this._unmodified=!1,this._fov=c/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(c){const y=Math.min(Math.max(c,this.minZoom),this.maxZoom);this._zoom!==y&&(this._unmodified=!1,this._zoom=y,this.tileZoom=Math.max(0,Math.floor(y)),this.scale=this.zoomScale(y),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(c){c.lat===this._center.lat&&c.lng===this._center.lng||(this._unmodified=!1,this._center=c,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(c){c!==this._elevation&&(this._elevation=c,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(c){this._edgeInsets.equals(c)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,c,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(c){return this._edgeInsets.equals(c)}interpolatePadding(c,y,S){this._unmodified=!1,this._edgeInsets.interpolate(c,y,S),this._constrain(),this._calcMatrices()}coveringZoomLevel(c){const y=(c.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/c.tileSize));return Math.max(0,y)}getVisibleUnwrappedCoordinates(c){const y=[new s.b4(0,c)];if(this._renderWorldCopies){const S=this.pointCoordinate(new s.P(0,0)),T=this.pointCoordinate(new s.P(this.width,0)),D=this.pointCoordinate(new s.P(this.width,this.height)),N=this.pointCoordinate(new s.P(0,this.height)),B=Math.floor(Math.min(S.x,T.x,D.x,N.x)),G=Math.floor(Math.max(S.x,T.x,D.x,N.x)),q=1;for(let K=B-q;K<=G+q;K++)K!==0&&y.push(new s.b4(K,c))}return y}coveringTiles(c){var y,S;let T=this.coveringZoomLevel(c);const D=T;if(c.minzoom!==void 0&&Tc.maxzoom&&(T=c.maxzoom);const N=this.pointCoordinate(this.getCameraPoint()),B=s.Z.fromLngLat(this.center),G=Math.pow(2,T),q=[G*N.x,G*N.y,0],K=[G*B.x,G*B.y,0],J=bu.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,T);let ie=c.minzoom||0;!c.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(ie=T);const de=c.terrain?2/Math.min(this.tileSize,c.tileSize)*this.tileSize:3,pe=ve=>({aabb:new xu([ve*G,0,0],[(ve+1)*G,G,0]),zoom:0,x:0,y:0,wrap:ve,fullyVisible:!1}),_e=[],Se=[],Te=T,Ce=c.reparseOverscaled?D:T;if(this._renderWorldCopies)for(let ve=1;ve<=3;ve++)_e.push(pe(-ve)),_e.push(pe(ve));for(_e.push(pe(0));_e.length>0;){const ve=_e.pop(),Ie=ve.x,Pe=ve.y;let Be=ve.fullyVisible;if(!Be){const ft=ve.aabb.intersects(J);if(ft===0)continue;Be=ft===2}const Ke=c.terrain?q:K,at=ve.aabb.distanceX(Ke),bt=ve.aabb.distanceY(Ke),Et=Math.max(Math.abs(at),Math.abs(bt));if(ve.zoom===Te||Et>de+(1<=ie){const ft=Te-ve.zoom,dt=q[0]-.5-(Ie<>1),ur=ve.zoom+1;let yt=ve.aabb.quadrant(ft);if(c.terrain){const wt=new s.S(ur,ve.wrap,ur,dt,Rt),ar=c.terrain.getMinMaxElevation(wt),pn=(y=ar.minElevation)!==null&&y!==void 0?y:this.elevation,xr=(S=ar.maxElevation)!==null&&S!==void 0?S:this.elevation;yt=new xu([yt.min[0],yt.min[1],pn],[yt.max[0],yt.max[1],xr])}_e.push({aabb:yt,zoom:ur,x:dt,y:Rt,wrap:ve.wrap,fullyVisible:Be})}}return Se.sort((ve,Ie)=>ve.distanceSq-Ie.distanceSq).map(ve=>ve.tileID)}resize(c,y){this.width=c,this.height=y,this.pixelsToGLUnits=[2/c,-2/y],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(c){return Math.pow(2,c)}scaleZoom(c){return Math.log(c)/Math.LN2}project(c){const y=s.ac(c.lat,-85.051129,Pv);return new s.P(s.O(c.lng)*this.worldSize,s.Q(y)*this.worldSize)}unproject(c){return new s.Z(c.x/this.worldSize,c.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(c){const y=this.elevation,S=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,T=this.pointLocation(this.centerPoint,c),D=c.getElevationForLngLatZoom(T,this.tileZoom);if(!(this.elevation-D))return;const N=S+y-D,B=Math.cos(this._pitch)*this.cameraToCenterDistance/N/s.b5(1,T.lat),G=this.scaleZoom(B/this.tileSize);this._elevation=D,this._center=T,this.zoom=G}setLocationAtPoint(c,y){const S=this.pointCoordinate(y),T=this.pointCoordinate(this.centerPoint),D=this.locationCoordinate(c),N=new s.Z(D.x-(S.x-T.x),D.y-(S.y-T.y));this.center=this.coordinateLocation(N),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(c,y){return y?this.coordinatePoint(this.locationCoordinate(c),y.getElevationForLngLatZoom(c,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(c))}pointLocation(c,y){return this.coordinateLocation(this.pointCoordinate(c,y))}locationCoordinate(c){return s.Z.fromLngLat(c)}coordinateLocation(c){return c&&c.toLngLat()}pointCoordinate(c,y){if(y){const ie=y.pointCoordinate(c);if(ie!=null)return ie}const S=[c.x,c.y,0,1],T=[c.x,c.y,1,1];s.af(S,S,this.pixelMatrixInverse),s.af(T,T,this.pixelMatrixInverse);const D=S[3],N=T[3],B=S[1]/D,G=T[1]/N,q=S[2]/D,K=T[2]/N,J=q===K?0:(0-q)/(K-q);return new s.Z(s.y.number(S[0]/D,T[0]/N,J)/this.worldSize,s.y.number(B,G,J)/this.worldSize)}coordinatePoint(c,y=0,S=this.pixelMatrix){const T=[c.x*this.worldSize,c.y*this.worldSize,y,1];return s.af(T,T,S),new s.P(T[0]/T[3],T[1]/T[3])}getBounds(){const c=Math.max(0,this.height/2-this.getHorizon());return new Le().extend(this.pointLocation(new s.P(0,c))).extend(this.pointLocation(new s.P(this.width,c))).extend(this.pointLocation(new s.P(this.width,this.height))).extend(this.pointLocation(new s.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new Le([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(c){c?(this.lngRange=[c.getWest(),c.getEast()],this.latRange=[c.getSouth(),c.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Pv])}calculateTileMatrix(c){const y=c.canonical,S=this.worldSize/this.zoomScale(y.z),T=y.x+Math.pow(2,y.z)*c.wrap,D=s.an(new Float64Array(16));return s.J(D,D,[T*S,y.y*S,0]),s.K(D,D,[S/s.X,S/s.X,1]),D}calculatePosMatrix(c,y=!1){const S=c.key,T=y?this._alignedPosMatrixCache:this._posMatrixCache;if(T[S])return T[S];const D=this.calculateTileMatrix(c);return s.L(D,y?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,D),T[S]=new Float32Array(D),T[S]}calculateFogMatrix(c){const y=c.key,S=this._fogMatrixCache;if(S[y])return S[y];const T=this.calculateTileMatrix(c);return s.L(T,this.fogMatrix,T),S[y]=new Float32Array(T),S[y]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(c,y){y=s.ac(+y,this.minZoom,this.maxZoom);const S={center:new s.N(c.lng,c.lat),zoom:y};let T=this.lngRange;if(!this._renderWorldCopies&&T===null){const ve=179.9999999999;T=[-ve,ve]}const D=this.tileSize*this.zoomScale(S.zoom);let N=0,B=D,G=0,q=D,K=0,J=0;const{x:ie,y:de}=this.size;if(this.latRange){const ve=this.latRange;N=s.Q(ve[1])*D,B=s.Q(ve[0])*D,B-NB&&(Te=B-ve)}if(T){const ve=(G+q)/2;let Ie=pe;this._renderWorldCopies&&(Ie=s.b3(pe,ve-D/2,ve+D/2));const Pe=ie/2;Ie-Peq&&(Se=q-Pe)}if(Se!==void 0||Te!==void 0){const ve=new s.P(Se??pe,Te??_e);S.center=this.unproject.call({worldSize:D},ve).wrap()}return S}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const c=this._unmodified,{center:y,zoom:S}=this.getConstrained(this.center,this.zoom);this.center=y,this.zoom=S,this._unmodified=c,this._constraining=!1}_calcMatrices(){if(!this.height)return;const c=this.centerOffset,y=this.point.x,S=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=s.b5(1,this.center.lat)*this.worldSize;let T=s.an(new Float64Array(16));s.K(T,T,[this.width/2,-this.height/2,1]),s.J(T,T,[1,-1,0]),this.labelPlaneMatrix=T,T=s.an(new Float64Array(16)),s.K(T,T,[1,-1,1]),s.J(T,T,[-1,-1,0]),s.K(T,T,[2/this.width,2/this.height,1]),this.glCoordMatrix=T;const D=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),N=Math.min(this.elevation,this.minElevationForCurrentTile),B=D-N*this._pixelPerMeter/Math.cos(this._pitch),G=N<0?B:D,q=Math.PI/2+this._pitch,K=this._fov*(.5+c.y/this.height),J=Math.sin(K)*G/Math.sin(s.ac(Math.PI-q-K,.01,Math.PI-.01)),ie=this.getHorizon(),de=2*Math.atan(ie/this.cameraToCenterDistance)*(.5+c.y/(2*ie)),pe=Math.sin(de)*G/Math.sin(s.ac(Math.PI-q-de,.01,Math.PI-.01)),_e=Math.min(J,pe);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*_e+G),this.nearZ=this.height/50,T=new Float64Array(16),s.b6(T,this._fov,this.width/this.height,this.nearZ,this.farZ),T[8]=2*-c.x/this.width,T[9]=2*c.y/this.height,this.projectionMatrix=s.ae(T),s.K(T,T,[1,-1,1]),s.J(T,T,[0,0,-this.cameraToCenterDistance]),s.b7(T,T,this._pitch),s.ad(T,T,this.angle),s.J(T,T,[-y,-S,0]),this.mercatorMatrix=s.K([],T,[this.worldSize,this.worldSize,this.worldSize]),s.K(T,T,[1,1,this._pixelPerMeter]),this.pixelMatrix=s.L(new Float64Array(16),this.labelPlaneMatrix,T),s.J(T,T,[0,0,-this.elevation]),this.modelViewProjectionMatrix=T,this.invModelViewProjectionMatrix=s.as([],T),this.fogMatrix=new Float64Array(16),s.b6(this.fogMatrix,this._fov,this.width/this.height,D,this.farZ),this.fogMatrix[8]=2*-c.x/this.width,this.fogMatrix[9]=2*c.y/this.height,s.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),s.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),s.b7(this.fogMatrix,this.fogMatrix,this._pitch),s.ad(this.fogMatrix,this.fogMatrix,this.angle),s.J(this.fogMatrix,this.fogMatrix,[-y,-S,0]),s.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),s.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=s.L(new Float64Array(16),this.labelPlaneMatrix,T);const Se=this.width%2/2,Te=this.height%2/2,Ce=Math.cos(this.angle),ve=Math.sin(this.angle),Ie=y-Math.round(y)+Ce*Se+ve*Te,Pe=S-Math.round(S)+Ce*Te+ve*Se,Be=new Float64Array(T);if(s.J(Be,Be,[Ie>.5?Ie-1:Ie,Pe>.5?Pe-1:Pe,0]),this.alignedModelViewProjectionMatrix=Be,T=s.as(new Float64Array(16),this.pixelMatrix),!T)throw new Error("failed to invert matrix");this.pixelMatrixInverse=T,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const c=this.pointCoordinate(new s.P(0,0)),y=[c.x*this.worldSize,c.y*this.worldSize,0,1];return s.af(y,y,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const c=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new s.P(0,c))}getCameraQueryGeometry(c){const y=this.getCameraPoint();if(c.length===1)return[c[0],y];{let S=y.x,T=y.y,D=y.x,N=y.y;for(const B of c)S=Math.min(S,B.x),T=Math.min(T,B.y),D=Math.max(D,B.x),N=Math.max(N,B.y);return[new s.P(S,T),new s.P(D,T),new s.P(D,N),new s.P(S,N),new s.P(S,T)]}}lngLatToCameraDepth(c,y){const S=this.locationCoordinate(c),T=[S.x*this.worldSize,S.y*this.worldSize,y,1];return s.af(T,T,this.modelViewProjectionMatrix),T[2]/T[3]}}function wh(M,c){let y,S=!1,T=null,D=null;const N=()=>{T=null,S&&(M.apply(D,y),T=setTimeout(N,c),S=!1)};return(...B)=>(S=!0,D=this,y=B,T||N(),T)}class Tf{constructor(c){this._getCurrentHash=()=>{const y=window.location.hash.replace("#","");if(this._hashName){let S;return y.split("&").map(T=>T.split("=")).forEach(T=>{T[0]===this._hashName&&(S=T)}),(S&&S[1]||"").split("/")}return y.split("/")},this._onHashChange=()=>{const y=this._getCurrentHash();if(y.length>=3&&!y.some(S=>isNaN(S))){const S=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(y[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+y[2],+y[1]],zoom:+y[0],bearing:S,pitch:+(y[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const y=window.location.href.replace(/(#.*)?$/,this.getHashString());window.history.replaceState(window.history.state,null,y)},this._removeHash=()=>{const y=this._getCurrentHash();if(y.length===0)return;const S=y.join("/");let T=S;T.split("&").length>0&&(T=T.split("&")[0]),this._hashName&&(T=`${this._hashName}=${S}`);let D=window.location.hash.replace(T,"");D.startsWith("#&")?D=D.slice(0,1)+D.slice(2):D==="#"&&(D="");let N=window.location.href.replace(/(#.+)?$/,D);N=N.replace("&&","&"),window.history.replaceState(window.history.state,null,N)},this._updateHash=wh(this._updateHashUnthrottled,300),this._hashName=c&&encodeURIComponent(c)}addTo(c){return this._map=c,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(c){const y=this._map.getCenter(),S=Math.round(100*this._map.getZoom())/100,T=Math.ceil((S*Math.LN2+Math.log(512/360/.5))/Math.LN10),D=Math.pow(10,T),N=Math.round(y.lng*D)/D,B=Math.round(y.lat*D)/D,G=this._map.getBearing(),q=this._map.getPitch();let K="";if(K+=c?`/${N}/${B}/${S}`:`${S}/${B}/${N}`,(G||q)&&(K+="/"+Math.round(10*G)/10),q&&(K+=`/${Math.round(q)}`),this._hashName){const J=this._hashName;let ie=!1;const de=window.location.hash.slice(1).split("&").map(pe=>{const _e=pe.split("=")[0];return _e===J?(ie=!0,`${_e}=${K}`):pe}).filter(pe=>pe);return ie||de.push(`${J}=${K}`),`#${de.join("&")}`}return`#${K}`}}const Ef={linearity:.3,easing:s.b8(0,0,.3,1)},Rv=s.e({deceleration:2500,maxSpeed:1400},Ef),DA=s.e({deceleration:20,maxSpeed:1400},Ef),Ab=s.e({deceleration:1e3,maxSpeed:360},Ef),Cf=s.e({deceleration:1e3,maxSpeed:90},Ef);class Nv{constructor(c){this._map=c,this.clear()}clear(){this._inertiaBuffer=[]}record(c){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:f.now(),settings:c})}_drainInertiaBuffer(){const c=this._inertiaBuffer,y=f.now();for(;c.length>0&&y-c[0].time>160;)c.shift()}_onMoveEnd(c){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const y={zoom:0,bearing:0,pitch:0,pan:new s.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:D}of this._inertiaBuffer)y.zoom+=D.zoomDelta||0,y.bearing+=D.bearingDelta||0,y.pitch+=D.pitchDelta||0,D.panDelta&&y.pan._add(D.panDelta),D.around&&(y.around=D.around),D.pinchAround&&(y.pinchAround=D.pinchAround);const S=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,T={};if(y.pan.mag()){const D=Th(y.pan.mag(),S,s.e({},Rv,c||{}));T.offset=y.pan.mult(D.amount/y.pan.mag()),T.center=this._map.transform.center,Sh(T,D)}if(y.zoom){const D=Th(y.zoom,S,DA);T.zoom=this._map.transform.zoom+D.amount,Sh(T,D)}if(y.bearing){const D=Th(y.bearing,S,Ab);T.bearing=this._map.transform.bearing+s.ac(D.amount,-179,179),Sh(T,D)}if(y.pitch){const D=Th(y.pitch,S,Cf);T.pitch=this._map.transform.pitch+D.amount,Sh(T,D)}if(T.zoom||T.bearing){const D=y.pinchAround===void 0?y.around:y.pinchAround;T.around=D?this._map.unproject(D):this._map.getCenter()}return this.clear(),s.e(T,{noMoveStart:!0})}}function Sh(M,c){(!M.duration||M.durationy.unproject(G)),B=D.reduce((G,q,K,J)=>G.add(q.div(J.length)),new s.P(0,0));super(c,{points:D,point:B,lngLats:N,lngLat:y.unproject(B),originalEvent:S}),this._defaultPrevented=!1}}class Db extends s.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(c,y,S){super(c,{originalEvent:S}),this._defaultPrevented=!1}}class Mb{constructor(c,y){this._map=c,this._clickTolerance=y.clickTolerance}reset(){delete this._mousedownPos}wheel(c){return this._firePreventable(new Db(c.type,this._map,c))}mousedown(c,y){return this._mousedownPos=y,this._firePreventable(new gi(c.type,this._map,c))}mouseup(c){this._map.fire(new gi(c.type,this._map,c))}click(c,y){this._mousedownPos&&this._mousedownPos.dist(y)>=this._clickTolerance||this._map.fire(new gi(c.type,this._map,c))}dblclick(c){return this._firePreventable(new gi(c.type,this._map,c))}mouseover(c){this._map.fire(new gi(c.type,this._map,c))}mouseout(c){this._map.fire(new gi(c.type,this._map,c))}touchstart(c){return this._firePreventable(new gl(c.type,this._map,c))}touchmove(c){this._map.fire(new gl(c.type,this._map,c))}touchend(c){this._map.fire(new gl(c.type,this._map,c))}touchcancel(c){this._map.fire(new gl(c.type,this._map,c))}_firePreventable(c){if(this._map.fire(c),c.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class In{constructor(c){this._map=c}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(c){this._map.fire(new gi(c.type,this._map,c))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new gi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(c){this._delayContextMenu?this._contextMenuEvent=c:this._ignoreContextMenu||this._map.fire(new gi(c.type,this._map,c)),this._map.listens("contextmenu")&&c.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class ja{constructor(c){this._map=c}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(c){return this.transform.pointLocation(s.P.convert(c),this._map.terrain)}}class fa{constructor(c,y){this._map=c,this._tr=new ja(c),this._el=c.getCanvasContainer(),this._container=c.getContainer(),this._clickTolerance=y.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(c,y){this.isEnabled()&&c.shiftKey&&c.button===0&&(g.disableDrag(),this._startPos=this._lastPos=y,this._active=!0)}mousemoveWindow(c,y){if(!this._active)return;const S=y;if(this._lastPos.equals(S)||!this._box&&S.dist(this._startPos)D.fitScreenCoordinates(S,T,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",c)}keydown(c){this._active&&c.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",c))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(g.remove(this._box),this._box=null),g.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(c,y){return this._map.fire(new s.k(c,{originalEvent:y}))}}function Eh(M,c){if(M.length!==c.length)throw new Error(`The number of touches and points are not equal - touches ${M.length}, points ${c.length}`);const y={};for(let S=0;Sthis.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=c.timeStamp),S.length===this.numTouches&&(this.centroid=function(T){const D=new s.P(0,0);for(const N of T)D._add(N);return D.div(T.length)}(y),this.touches=Eh(S,y)))}touchmove(c,y,S){if(this.aborted||!this.centroid)return;const T=Eh(S,y);for(const D in this.touches){const N=T[D];(!N||N.dist(this.touches[D])>30)&&(this.aborted=!0)}}touchend(c,y,S){if((!this.centroid||c.timeStamp-this.startTime>500)&&(this.aborted=!0),S.length===0){const T=!this.aborted&&this.centroid;if(this.reset(),T)return T}}}class Af{constructor(c){this.singleTap=new Ov(c),this.numTaps=c.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(c,y,S){this.singleTap.touchstart(c,y,S)}touchmove(c,y,S){this.singleTap.touchmove(c,y,S)}touchend(c,y,S){const T=this.singleTap.touchend(c,y,S);if(T){const D=c.timeStamp-this.lastTime<500,N=!this.lastTap||this.lastTap.dist(T)<30;if(D&&N||this.reset(),this.count++,this.lastTime=c.timeStamp,this.lastTap=T,this.count===this.numTaps)return this.reset(),T}}}class Tu{constructor(c){this._tr=new ja(c),this._zoomIn=new Af({numTouches:1,numTaps:2}),this._zoomOut=new Af({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(c,y,S){this._zoomIn.touchstart(c,y,S),this._zoomOut.touchstart(c,y,S)}touchmove(c,y,S){this._zoomIn.touchmove(c,y,S),this._zoomOut.touchmove(c,y,S)}touchend(c,y,S){const T=this._zoomIn.touchend(c,y,S),D=this._zoomOut.touchend(c,y,S),N=this._tr;return T?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:N.zoom+1,around:N.unproject(T)},{originalEvent:c})}):D?(this._active=!0,c.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:B=>B.easeTo({duration:300,zoom:N.zoom-1,around:N.unproject(D)},{originalEvent:c})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Jo{constructor(c){this._enabled=!!c.enable,this._moveStateManager=c.moveStateManager,this._clickTolerance=c.clickTolerance||1,this._moveFunction=c.move,this._activateOnStart=!!c.activateOnStart,c.assignEvents(this),this.reset()}reset(c){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(c)}_move(...c){const y=this._moveFunction(...c);if(y.bearingDelta||y.pitchDelta||y.around||y.panDelta)return this._active=!0,y}dragStart(c,y){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(c)&&(this._moveStateManager.startMove(c),this._lastPoint=y.length?y[0]:y,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(c,y){if(!this.isEnabled())return;const S=this._lastPoint;if(!S)return;if(c.preventDefault(),!this._moveStateManager.isValidMoveEvent(c))return void this.reset(c);const T=y.length?y[0]:y;return!this._moved&&T.dist(S){M.mousedown=M.dragStart,M.mousemoveWindow=M.dragMove,M.mouseup=M.dragEnd,M.contextmenu=c=>{c.preventDefault()}},Vv=({enable:M,clickTolerance:c,bearingDegreesPerPixelMoved:y=.8})=>{const S=new Df({checkCorrectEvent:T=>g.mouseButton(T)===0&&T.ctrlKey||g.mouseButton(T)===2});return new Jo({clickTolerance:c,move:(T,D)=>({bearingDelta:(D.x-T.x)*y}),moveStateManager:S,enable:M,assignEvents:Mf})},Fv=({enable:M,clickTolerance:c,pitchDegreesPerPixelMoved:y=-.5})=>{const S=new Df({checkCorrectEvent:T=>g.mouseButton(T)===0&&T.ctrlKey||g.mouseButton(T)===2});return new Jo({clickTolerance:c,move:(T,D)=>({pitchDelta:(D.y-T.y)*y}),moveStateManager:S,enable:M,assignEvents:Mf})};class vl{constructor(c,y){this._clickTolerance=c.clickTolerance||1,this._map=y,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new s.P(0,0)}_shouldBePrevented(c){return c<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(c,y,S){return this._calculateTransform(c,y,S)}touchmove(c,y,S){if(this._active){if(!this._shouldBePrevented(S.length))return c.preventDefault(),this._calculateTransform(c,y,S);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",c)}}touchend(c,y,S){this._calculateTransform(c,y,S),this._active&&this._shouldBePrevented(S.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(c,y,S){S.length>0&&(this._active=!0);const T=Eh(S,y),D=new s.P(0,0),N=new s.P(0,0);let B=0;for(const q in T){const K=T[q],J=this._touches[q];J&&(D._add(K),N._add(K.sub(J)),B++,T[q]=K)}if(this._touches=T,this._shouldBePrevented(B)||!N.mag())return;const G=N.div(B);return this._sum._add(G),this._sum.mag()Math.abs(M.x)}class Ah extends If{constructor(c){super(),this._currentTouchCount=0,this._map=c}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(c,y,S){super.touchstart(c,y,S),this._currentTouchCount=S.length}_start(c){this._lastPoints=c,kf(c[0].sub(c[1]))&&(this._valid=!1)}_move(c,y,S){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const T=c[0].sub(this._lastPoints[0]),D=c[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(T,D,S.timeStamp),this._valid?(this._lastPoints=c,this._active=!0,{pitchDelta:(T.y+D.y)/2*-.5}):void 0}gestureBeginsVertically(c,y,S){if(this._valid!==void 0)return this._valid;const T=c.mag()>=2,D=y.mag()>=2;if(!T&&!D)return;if(!T||!D)return this._firstMove===void 0&&(this._firstMove=S),S-this._firstMove<100&&void 0;const N=c.y>0==y.y>0;return kf(c)&&kf(y)&&N}}const Ib={panStep:100,bearingStep:15,pitchStep:10};class ka{constructor(c){this._tr=new ja(c);const y=Ib;this._panStep=y.panStep,this._bearingStep=y.bearingStep,this._pitchStep=y.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(c){if(c.altKey||c.ctrlKey||c.metaKey)return;let y=0,S=0,T=0,D=0,N=0;switch(c.keyCode){case 61:case 107:case 171:case 187:y=1;break;case 189:case 109:case 173:y=-1;break;case 37:c.shiftKey?S=-1:(c.preventDefault(),D=-1);break;case 39:c.shiftKey?S=1:(c.preventDefault(),D=1);break;case 38:c.shiftKey?T=1:(c.preventDefault(),N=-1);break;case 40:c.shiftKey?T=-1:(c.preventDefault(),N=1);break;default:return}return this._rotationDisabled&&(S=0,T=0),{cameraAnimation:B=>{const G=this._tr;B.easeTo({duration:300,easeId:"keyboardHandler",easing:Mo,zoom:y?Math.round(G.zoom)+y*(c.shiftKey?2:1):G.zoom,bearing:G.bearing+S*this._bearingStep,pitch:G.pitch+T*this._pitchStep,offset:[-D*this._panStep,-N*this._panStep],center:G.center},{originalEvent:c})}}}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 Mo(M){return M*(2-M)}const Wv=4.000244140625;class Xa{constructor(c,y){this._onTimeout=S=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(S)},this._map=c,this._tr=new ja(c),this._triggerRenderFrame=y,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(c){this._defaultZoomRate=c}setWheelZoomRate(c){this._wheelZoomRate=c}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(c){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!c&&c.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(c){return!!this._map.cooperativeGestures.isEnabled()&&!(c.ctrlKey||this._map.cooperativeGestures.isBypassed(c))}wheel(c){if(!this.isEnabled())return;if(this._shouldBePrevented(c))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",c);let y=c.deltaMode===WheelEvent.DOM_DELTA_LINE?40*c.deltaY:c.deltaY;const S=f.now(),T=S-(this._lastWheelEventTime||0);this._lastWheelEventTime=S,y!==0&&y%Wv==0?this._type="wheel":y!==0&&Math.abs(y)<4?this._type="trackpad":T>400?(this._type=null,this._lastValue=y,this._timeout=setTimeout(this._onTimeout,40,c)):this._type||(this._type=Math.abs(T*y)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,y+=this._lastValue)),c.shiftKey&&y&&(y/=4),this._type&&(this._lastWheelEvent=c,this._delta-=y,this._active||this._start(c)),c.preventDefault()}_start(c){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);const y=g.mousePos(this._map.getCanvas(),c),S=this._tr;this._around=y.y>S.transform.height/2-S.transform.getHorizon()?s.N.convert(this._aroundCenter?S.center:S.unproject(y)):s.N.convert(S.center),this._aroundPoint=S.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const c=this._tr.transform;if(this._delta!==0){const G=this._type==="wheel"&&Math.abs(this._delta)>Wv?this._wheelZoomRate:this._defaultZoomRate;let q=2/(1+Math.exp(-Math.abs(this._delta*G)));this._delta<0&&q!==0&&(q=1/q);const K=typeof this._targetZoom=="number"?c.zoomScale(this._targetZoom):c.scale;this._targetZoom=Math.min(c.maxZoom,Math.max(c.minZoom,c.scaleZoom(K*q))),this._type==="wheel"&&(this._startZoom=c.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const y=typeof this._targetZoom=="number"?this._targetZoom:c.zoom,S=this._startZoom,T=this._easing;let D,N=!1;const B=f.now()-this._lastWheelEventTime;if(this._type==="wheel"&&S&&T&&B){const G=Math.min(B/200,1),q=T(G);D=s.y.number(S,y,q),G<1?this._frameId||(this._frameId=!0):N=!0}else D=y,N=!0;return this._active=!0,N&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!N,zoomDelta:D-c.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(c){let y=s.b9;if(this._prevEase){const S=this._prevEase,T=(f.now()-S.start)/S.duration,D=S.easing(T+.01)-S.easing(T),N=.27/Math.sqrt(D*D+1e-4)*.01,B=Math.sqrt(.0729-N*N);y=s.b8(N,B,.25,1)}return this._prevEase={start:f.now(),duration:c,easing:y},y}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class ml{constructor(c,y){this._clickZoom=c,this._tapZoom=y}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 MA{constructor(c){this._tr=new ja(c),this.reset()}reset(){this._active=!1}dblclick(c,y){return c.preventDefault(),{cameraAnimation:S=>{S.easeTo({duration:300,zoom:this._tr.zoom+(c.shiftKey?-1:1),around:this._tr.unproject(y)},{originalEvent:c})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class IA{constructor(){this._tap=new Af({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(c,y,S){if(!this._swipePoint)if(this._tapTime){const T=y[0],D=c.timeStamp-this._tapTime<500,N=this._tapPoint.dist(T)<30;D&&N?S.length>0&&(this._swipePoint=T,this._swipeTouch=S[0].identifier):this.reset()}else this._tap.touchstart(c,y,S)}touchmove(c,y,S){if(this._tapTime){if(this._swipePoint){if(S[0].identifier!==this._swipeTouch)return;const T=y[0],D=T.y-this._swipePoint.y;return this._swipePoint=T,c.preventDefault(),this._active=!0,{zoomDelta:D/128}}}else this._tap.touchmove(c,y,S)}touchend(c,y,S){if(this._tapTime)this._swipePoint&&S.length===0&&this.reset();else{const T=this._tap.touchend(c,y,S);T&&(this._tapTime=c.timeStamp,this._tapPoint=T)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class kb{constructor(c,y,S){this._el=c,this._mousePan=y,this._touchPan=S}enable(c){this._inertiaOptions=c||{},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 Lb{constructor(c,y,S){this._pitchWithRotate=c.pitchWithRotate,this._mouseRotate=y,this._mousePitch=S}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class qv{constructor(c,y,S,T){this._el=c,this._touchZoom=y,this._touchRotate=S,this._tapDragZoom=T,this._rotationDisabled=!1,this._enabled=!0}enable(c){this._touchZoom.enable(c),this._rotationDisabled||this._touchRotate.enable(c),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 Eu{constructor(c,y){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=c,this._options=y,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const c=this._map.getCanvasContainer();c.classList.add("maplibregl-cooperative-gestures"),this._container=g.create("div","maplibregl-cooperative-gesture-screen",c);let y=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(y=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const S=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),T=document.createElement("div");T.className="maplibregl-desktop-message",T.textContent=y,this._container.appendChild(T);const D=document.createElement("div");D.className="maplibregl-mobile-message",D.textContent=S,this._container.appendChild(D),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(g.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(c){return c[this._bypassKey]}notifyGestureBlocked(c,y){this._enabled&&(this._map.fire(new s.k("cooperativegestureprevented",{gestureType:c,originalEvent:y})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const La=M=>M.zoom||M.drag||M.pitch||M.rotate;class Dt extends s.k{}function Lf(M){return M.panDelta&&M.panDelta.mag()||M.zoomDelta||M.bearingDelta||M.pitchDelta}class Zv{constructor(c,y){this.handleWindowEvent=T=>{this.handleEvent(T,`${T.type}Window`)},this.handleEvent=(T,D)=>{if(T.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const N=T.type==="renderFrame"?void 0:T,B={needsRenderFrame:!1},G={},q={},K=T.touches,J=K?this._getMapTouches(K):void 0,ie=J?g.touchPos(this._map.getCanvas(),J):g.mousePos(this._map.getCanvas(),T);for(const{handlerName:_e,handler:Se,allowed:Te}of this._handlers){if(!Se.isEnabled())continue;let Ce;this._blockedByActive(q,Te,_e)?Se.reset():Se[D||T.type]&&(Ce=Se[D||T.type](T,ie,J),this.mergeHandlerResult(B,G,Ce,_e,N),Ce&&Ce.needsRenderFrame&&this._triggerRenderFrame()),(Ce||Se.isActive())&&(q[_e]=Se)}const de={};for(const _e in this._previousActiveHandlers)q[_e]||(de[_e]=N);this._previousActiveHandlers=q,(Object.keys(de).length||Lf(B))&&(this._changes.push([B,G,de]),this._triggerRenderFrame()),(Object.keys(q).length||Lf(B))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:pe}=B;pe&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],pe(this._map))},this._map=c,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Nv(c),this._bearingSnap=y.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(y);const S=this._el;this._listeners=[[S,"touchstart",{passive:!0}],[S,"touchmove",{passive:!1}],[S,"touchend",void 0],[S,"touchcancel",void 0],[S,"mousedown",void 0],[S,"mousemove",void 0],[S,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[S,"mouseover",void 0],[S,"mouseout",void 0],[S,"dblclick",void 0],[S,"click",void 0],[S,"keydown",{capture:!1}],[S,"keyup",void 0],[S,"wheel",{passive:!1}],[S,"contextmenu",void 0],[window,"blur",void 0]];for(const[T,D,N]of this._listeners)g.addEventListener(T,D,T===document?this.handleWindowEvent:this.handleEvent,N)}destroy(){for(const[c,y,S]of this._listeners)g.removeEventListener(c,y,c===document?this.handleWindowEvent:this.handleEvent,S)}_addDefaultHandlers(c){const y=this._map,S=y.getCanvasContainer();this._add("mapEvent",new Mb(y,c));const T=y.boxZoom=new fa(y,c);this._add("boxZoom",T),c.interactive&&c.boxZoom&&T.enable();const D=y.cooperativeGestures=new Eu(y,c.cooperativeGestures);this._add("cooperativeGestures",D),c.cooperativeGestures&&D.enable();const N=new Tu(y),B=new MA(y);y.doubleClickZoom=new ml(B,N),this._add("tapZoom",N),this._add("clickZoom",B),c.interactive&&c.doubleClickZoom&&y.doubleClickZoom.enable();const G=new IA;this._add("tapDragZoom",G);const q=y.touchPitch=new Ah(y);this._add("touchPitch",q),c.interactive&&c.touchPitch&&y.touchPitch.enable(c.touchPitch);const K=Vv(c),J=Fv(c);y.dragRotate=new Lb(c,K,J),this._add("mouseRotate",K,["mousePitch"]),this._add("mousePitch",J,["mouseRotate"]),c.interactive&&c.dragRotate&&y.dragRotate.enable();const ie=(({enable:Ce,clickTolerance:ve})=>{const Ie=new Df({checkCorrectEvent:Pe=>g.mouseButton(Pe)===0&&!Pe.ctrlKey});return new Jo({clickTolerance:ve,move:(Pe,Be)=>({around:Be,panDelta:Be.sub(Pe)}),activateOnStart:!0,moveStateManager:Ie,enable:Ce,assignEvents:Mf})})(c),de=new vl(c,y);y.dragPan=new kb(S,ie,de),this._add("mousePan",ie),this._add("touchPan",de,["touchZoom","touchRotate"]),c.interactive&&c.dragPan&&y.dragPan.enable(c.dragPan);const pe=new Hv,_e=new Gv;y.touchZoomRotate=new qv(S,_e,pe,G),this._add("touchRotate",pe,["touchPan","touchZoom"]),this._add("touchZoom",_e,["touchPan","touchRotate"]),c.interactive&&c.touchZoomRotate&&y.touchZoomRotate.enable(c.touchZoomRotate);const Se=y.scrollZoom=new Xa(y,()=>this._triggerRenderFrame());this._add("scrollZoom",Se,["mousePan"]),c.interactive&&c.scrollZoom&&y.scrollZoom.enable(c.scrollZoom);const Te=y.keyboard=new ka(y);this._add("keyboard",Te),c.interactive&&c.keyboard&&y.keyboard.enable(),this._add("blockableMapEvent",new In(y))}_add(c,y,S){this._handlers.push({handlerName:c,handler:y,allowed:S}),this._handlersById[c]=y}stop(c){if(!this._updatingCamera){for(const{handler:y}of this._handlers)y.reset();this._inertia.clear(),this._fireEvents({},{},c),this._changes=[]}}isActive(){for(const{handler:c}of this._handlers)if(c.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!La(this._eventsInProgress)||this.isZooming()}_blockedByActive(c,y,S){for(const T in c)if(T!==S&&(!y||y.indexOf(T)<0))return!0;return!1}_getMapTouches(c){const y=[];for(const S of c)this._el.contains(S.target)&&y.push(S);return y}mergeHandlerResult(c,y,S,T,D){if(!S)return;s.e(c,S);const N={handlerName:T,originalEvent:S.originalEvent||D};S.zoomDelta!==void 0&&(y.zoom=N),S.panDelta!==void 0&&(y.drag=N),S.pitchDelta!==void 0&&(y.pitch=N),S.bearingDelta!==void 0&&(y.rotate=N)}_applyChanges(){const c={},y={},S={};for(const[T,D,N]of this._changes)T.panDelta&&(c.panDelta=(c.panDelta||new s.P(0,0))._add(T.panDelta)),T.zoomDelta&&(c.zoomDelta=(c.zoomDelta||0)+T.zoomDelta),T.bearingDelta&&(c.bearingDelta=(c.bearingDelta||0)+T.bearingDelta),T.pitchDelta&&(c.pitchDelta=(c.pitchDelta||0)+T.pitchDelta),T.around!==void 0&&(c.around=T.around),T.pinchAround!==void 0&&(c.pinchAround=T.pinchAround),T.noInertia&&(c.noInertia=T.noInertia),s.e(y,D),s.e(S,N);this._updateMapTransform(c,y,S),this._changes=[]}_updateMapTransform(c,y,S){const T=this._map,D=T._getTransformForUpdate(),N=T.terrain;if(!(Lf(c)||N&&this._terrainMovement))return this._fireEvents(y,S,!0);let{panDelta:B,zoomDelta:G,bearingDelta:q,pitchDelta:K,around:J,pinchAround:ie}=c;ie!==void 0&&(J=ie),T._stop(!0),J=J||T.transform.centerPoint;const de=D.pointLocation(B?J.sub(B):J);q&&(D.bearing+=q),K&&(D.pitch+=K),G&&(D.zoom+=G),N?this._terrainMovement||!y.drag&&!y.zoom?y.drag&&this._terrainMovement?D.center=D.pointLocation(D.centerPoint.sub(B)):D.setLocationAtPoint(de,J):(this._terrainMovement=!0,this._map._elevationFreeze=!0,D.setLocationAtPoint(de,J)):D.setLocationAtPoint(de,J),T._applyUpdatedTransform(D),this._map._update(),c.noInertia||this._inertia.record(c),this._fireEvents(y,S,!0)}_fireEvents(c,y,S){const T=La(this._eventsInProgress),D=La(c),N={};for(const J in c){const{originalEvent:ie}=c[J];this._eventsInProgress[J]||(N[`${J}start`]=ie),this._eventsInProgress[J]=c[J]}!T&&D&&this._fireEvent("movestart",D.originalEvent);for(const J in N)this._fireEvent(J,N[J]);D&&this._fireEvent("move",D.originalEvent);for(const J in c){const{originalEvent:ie}=c[J];this._fireEvent(J,ie)}const B={};let G;for(const J in this._eventsInProgress){const{handlerName:ie,originalEvent:de}=this._eventsInProgress[J];this._handlersById[ie].isActive()||(delete this._eventsInProgress[J],G=y[ie]||de,B[`${J}end`]=G)}for(const J in B)this._fireEvent(J,B[J]);const q=La(this._eventsInProgress),K=(T||D)&&!q;if(K&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const J=this._map._getTransformForUpdate();J.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(J)}if(S&&K){this._updatingCamera=!0;const J=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=de=>de!==0&&-this._bearingSnap{delete this._frameId,this.handleEvent(new Dt("renderFrame",{timeStamp:c})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class Pb extends s.E{constructor(c,y){super(),this._renderFrameCallback=()=>{const S=Math.min((f.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(S)),S<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=c,this._bearingSnap=y.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new s.N(this.transform.center.lng,this.transform.center.lat)}setCenter(c,y){return this.jumpTo({center:c},y)}panBy(c,y,S){return c=s.P.convert(c).mult(-1),this.panTo(this.transform.center,s.e({offset:c},y),S)}panTo(c,y,S){return this.easeTo(s.e({center:c},y),S)}getZoom(){return this.transform.zoom}setZoom(c,y){return this.jumpTo({zoom:c},y),this}zoomTo(c,y,S){return this.easeTo(s.e({zoom:c},y),S)}zoomIn(c,y){return this.zoomTo(this.getZoom()+1,c,y),this}zoomOut(c,y){return this.zoomTo(this.getZoom()-1,c,y),this}getBearing(){return this.transform.bearing}setBearing(c,y){return this.jumpTo({bearing:c},y),this}getPadding(){return this.transform.padding}setPadding(c,y){return this.jumpTo({padding:c},y),this}rotateTo(c,y,S){return this.easeTo(s.e({bearing:c},y),S)}resetNorth(c,y){return this.rotateTo(0,s.e({duration:1e3},c),y),this}resetNorthPitch(c,y){return this.easeTo(s.e({bearing:0,pitch:0,duration:1e3},c),y),this}snapToNorth(c,y){return Math.abs(this.getBearing()){if(this._zooming&&(T.zoom=s.y.number(D,Se,Ke)),this._rotating&&(T.bearing=s.y.number(N,q,Ke)),this._pitching&&(T.pitch=s.y.number(B,K,Ke)),this._padding&&(T.interpolatePadding(G,J,Ke),de=T.centerPoint.add(ie)),this.terrain&&!c.freezeElevation&&this._updateElevation(Ke),Ie)T.setLocationAtPoint(Ie,Pe);else{const at=T.zoomScale(T.zoom-D),bt=Se>D?Math.min(2,ve):Math.max(.5,ve),Et=Math.pow(bt,1-Ke),ft=T.unproject(Te.add(Ce.mult(Ke*Et)).mult(at));T.setLocationAtPoint(T.renderWorldCopies?ft.wrap():ft,de)}this._applyUpdatedTransform(T),this._fireMoveEvents(y)},Ke=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(y,Ke)},c),this}_prepareEase(c,y,S={}){this._moving=!0,y||S.moving||this.fire(new s.k("movestart",c)),this._zooming&&!S.zooming&&this.fire(new s.k("zoomstart",c)),this._rotating&&!S.rotating&&this.fire(new s.k("rotatestart",c)),this._pitching&&!S.pitching&&this.fire(new s.k("pitchstart",c))}_prepareElevation(c){this._elevationCenter=c,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(c,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(c){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const y=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(c<1&&y!==this._elevationTarget){const S=this._elevationTarget-this._elevationStart;this._elevationStart+=c*(S-(y-(S*c+this._elevationStart))/(1-c)),this._elevationTarget=y}this.transform.elevation=s.y.number(this._elevationStart,this._elevationTarget,c)}_finalizeElevation(){this._elevationFreeze=!1,this.transform.recalculateZoom(this.terrain)}_getTransformForUpdate(){return this.transformCameraUpdate||this.terrain?(this._requestedCameraState||(this._requestedCameraState=this.transform.clone()),this._requestedCameraState):this.transform}_elevateCameraIfInsideTerrain(c){const y=c.getCameraPosition(),S=this.terrain.getElevationForLngLatZoom(y.lngLat,c.zoom);if(y.altitudethis._elevateCameraIfInsideTerrain(T)),this.transformCameraUpdate&&y.push(T=>this.transformCameraUpdate(T)),!y.length)return;const S=c.clone();for(const T of y){const D=S.clone(),{center:N,zoom:B,pitch:G,bearing:q,elevation:K}=T(D);N&&(D.center=N),B!==void 0&&(D.zoom=B),G!==void 0&&(D.pitch=G),q!==void 0&&(D.bearing=q),K!==void 0&&(D.elevation=K),S.apply(D)}this.transform.apply(S)}_fireMoveEvents(c){this.fire(new s.k("move",c)),this._zooming&&this.fire(new s.k("zoom",c)),this._rotating&&this.fire(new s.k("rotate",c)),this._pitching&&this.fire(new s.k("pitch",c))}_afterEase(c,y){if(this._easeId&&y&&this._easeId===y)return;delete this._easeId;const S=this._zooming,T=this._rotating,D=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,S&&this.fire(new s.k("zoomend",c)),T&&this.fire(new s.k("rotateend",c)),D&&this.fire(new s.k("pitchend",c)),this.fire(new s.k("moveend",c))}flyTo(c,y){var S;if(!c.essential&&f.prefersReducedMotion){const wt=s.M(c,["center","zoom","bearing","pitch","around"]);return this.jumpTo(wt,y)}this.stop(),c=s.e({offset:[0,0],speed:1.2,curve:1.42,easing:s.b9},c);const T=this._getTransformForUpdate(),D=T.zoom,N=T.bearing,B=T.pitch,G=T.padding,q="bearing"in c?this._normalizeBearing(c.bearing,N):N,K="pitch"in c?+c.pitch:B,J="padding"in c?c.padding:T.padding,ie=s.P.convert(c.offset);let de=T.centerPoint.add(ie);const pe=T.pointLocation(de),{center:_e,zoom:Se}=T.getConstrained(s.N.convert(c.center||pe),(S=c.zoom)!==null&&S!==void 0?S:D);this._normalizeCenter(_e,T);const Te=T.zoomScale(Se-D),Ce=T.project(pe),ve=T.project(_e).sub(Ce);let Ie=c.curve;const Pe=Math.max(T.width,T.height),Be=Pe/Te,Ke=ve.mag();if("minZoom"in c){const wt=s.ac(Math.min(c.minZoom,D,Se),T.minZoom,T.maxZoom),ar=Pe/T.zoomScale(wt-D);Ie=Math.sqrt(ar/Ke*2)}const at=Ie*Ie;function bt(wt){const ar=(Be*Be-Pe*Pe+(wt?-1:1)*at*at*Ke*Ke)/(2*(wt?Be:Pe)*at*Ke);return Math.log(Math.sqrt(ar*ar+1)-ar)}function Et(wt){return(Math.exp(wt)-Math.exp(-wt))/2}function ft(wt){return(Math.exp(wt)+Math.exp(-wt))/2}const dt=bt(!1);let Rt=function(wt){return ft(dt)/ft(dt+Ie*wt)},ur=function(wt){return Pe*((ft(dt)*(Et(ar=dt+Ie*wt)/ft(ar))-Et(dt))/at)/Ke;var ar},yt=(bt(!0)-dt)/Ie;if(Math.abs(Ke)<1e-6||!isFinite(yt)){if(Math.abs(Pe-Be)<1e-6)return this.easeTo(c,y);const wt=Be0,Rt=ar=>Math.exp(wt*Ie*ar)}return c.duration="duration"in c?+c.duration:1e3*yt/("screenSpeed"in c?+c.screenSpeed/Ie:+c.speed),c.maxDuration&&c.duration>c.maxDuration&&(c.duration=0),this._zooming=!0,this._rotating=N!==q,this._pitching=K!==B,this._padding=!T.isPaddingEqual(J),this._prepareEase(y,!1),this.terrain&&this._prepareElevation(_e),this._ease(wt=>{const ar=wt*yt,pn=1/Rt(ar);T.zoom=wt===1?Se:D+T.scaleZoom(pn),this._rotating&&(T.bearing=s.y.number(N,q,wt)),this._pitching&&(T.pitch=s.y.number(B,K,wt)),this._padding&&(T.interpolatePadding(G,J,wt),de=T.centerPoint.add(ie)),this.terrain&&!c.freezeElevation&&this._updateElevation(wt);const xr=wt===1?_e:T.unproject(Ce.add(ve.mult(ur(ar))).mult(pn));T.setLocationAtPoint(T.renderWorldCopies?xr.wrap():xr,de),this._applyUpdatedTransform(T),this._fireMoveEvents(y)},()=>{this.terrain&&c.freezeElevation&&this._finalizeElevation(),this._afterEase(y)},c),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(c,y){var S;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const T=this._onEaseEnd;delete this._onEaseEnd,T.call(this,y)}return c||(S=this.handlers)===null||S===void 0||S.stop(!1),this}_ease(c,y,S){S.animate===!1||S.duration===0?(c(1),y()):(this._easeStart=f.now(),this._easeOptions=S,this._onEaseFrame=c,this._onEaseEnd=y,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(c,y){c=s.b3(c,-180,180);const S=Math.abs(c-y);return Math.abs(c-360-y)180?-360:S<-180?360:0}queryTerrainElevation(c){return this.terrain?this.terrain.getElevationForLngLatZoom(s.N.convert(c),this.transform.tileZoom)-this.transform.elevation:null}}const Cu={compact:!0,customAttribution:'
    MapLibre'};class Au{constructor(c=Cu){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=y=>{!y||y.sourceDataType!=="metadata"&&y.sourceDataType!=="visibility"&&y.dataType!=="style"&&y.type!=="terrain"||this._updateAttributions()},this._updateCompact=()=>{this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact===!1?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=c}getDefaultPosition(){return"bottom-right"}onAdd(c){return this._map=c,this._compact=this.options.compact,this._container=g.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=g.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=g.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(){g.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(c,y){const S=this._map._getUIString(`AttributionControl.${y}`);c.title=S,c.setAttribute("aria-label",S)}_updateAttributions(){if(!this._map.style)return;let c=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?c=c.concat(this.options.customAttribution.map(T=>typeof T!="string"?"":T)):typeof this.options.customAttribution=="string"&&c.push(this.options.customAttribution)),this._map.style.stylesheet){const T=this._map.style.stylesheet;this.styleOwner=T.owner,this.styleId=T.id}const y=this._map.style.sourceCaches;for(const T in y){const D=y[T];if(D.used||D.usedForTerrain){const N=D.getSource();N.attribution&&c.indexOf(N.attribution)<0&&c.push(N.attribution)}}c=c.filter(T=>String(T).trim()),c.sort((T,D)=>T.length-D.length),c=c.filter((T,D)=>{for(let N=D+1;N=0)return!1;return!0});const S=c.join(" | ");S!==this._attribHTML&&(this._attribHTML=S,c.length?(this._innerContainer.innerHTML=S,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class jv{constructor(c={}){this._updateCompact=()=>{const y=this._container.children;if(y.length){const S=y[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&S.classList.add("maplibregl-compact"):S.classList.remove("maplibregl-compact")}},this.options=c}getDefaultPosition(){return"bottom-left"}onAdd(c){this._map=c,this._compact=this.options&&this.options.compact,this._container=g.create("div","maplibregl-ctrl");const y=g.create("a","maplibregl-ctrl-logo");return y.target="_blank",y.rel="noopener nofollow",y.href="https://maplibre.org/",y.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),y.setAttribute("rel","noopener nofollow"),this._container.appendChild(y),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){g.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Rr{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(c){const y=++this._id;return this._queue.push({callback:c,id:y,cancelled:!1}),y}remove(c){const y=this._currentlyRunning,S=y?this._queue.concat(y):this._queue;for(const T of S)if(T.id===c)return void(T.cancelled=!0)}run(c=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const y=this._currentlyRunning=this._queue;this._queue=[];for(const S of y)if(!S.cancelled&&(S.callback(c),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Xv=s.Y([{name:"a_pos3d",type:"Int16",components:3}]);class kA extends s.E{constructor(c){super(),this.sourceCache=c,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,c.usedForTerrain=!0,c.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(c,y){this.sourceCache.update(c,y),this._renderableTilesKeys=[];const S={};for(const T of c.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:y}))S[T.key]=!0,this._renderableTilesKeys.push(T.key),this._tiles[T.key]||(T.posMatrix=new Float64Array(16),s.aP(T.posMatrix,0,s.X,0,s.X,0,1),this._tiles[T.key]=new sa(T,this.tileSize));for(const T in this._tiles)S[T]||delete this._tiles[T]}freeRtt(c){for(const y in this._tiles){const S=this._tiles[y];(!c||S.tileID.equals(c)||S.tileID.isChildOf(c)||c.isChildOf(S.tileID))&&(S.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(c=>this.getTileByID(c))}getTileByID(c){return this._tiles[c]}getTerrainCoords(c){const y={};for(const S of this._renderableTilesKeys){const T=this._tiles[S].tileID;if(T.canonical.equals(c.canonical)){const D=c.clone();D.posMatrix=new Float64Array(16),s.aP(D.posMatrix,0,s.X,0,s.X,0,1),y[S]=D}else if(T.canonical.isChildOf(c.canonical)){const D=c.clone();D.posMatrix=new Float64Array(16);const N=T.canonical.z-c.canonical.z,B=T.canonical.x-(T.canonical.x>>N<>N<>N;s.aP(D.posMatrix,0,q,0,q,0,1),s.J(D.posMatrix,D.posMatrix,[-B*q,-G*q,0]),y[S]=D}else if(c.canonical.isChildOf(T.canonical)){const D=c.clone();D.posMatrix=new Float64Array(16);const N=c.canonical.z-T.canonical.z,B=c.canonical.x-(c.canonical.x>>N<>N<>N;s.aP(D.posMatrix,0,s.X,0,s.X,0,1),s.J(D.posMatrix,D.posMatrix,[B*q,G*q,0]),s.K(D.posMatrix,D.posMatrix,[1/2**N,1/2**N,0]),y[S]=D}}return y}getSourceTile(c,y){const S=this.sourceCache._source;let T=c.overscaledZ-this.deltaZoom;if(T>S.maxzoom&&(T=S.maxzoom),T=S.minzoom&&(!D||!D.dem);)D=this.sourceCache.getTileByID(c.scaledTo(T--).key);return D}tilesAfterTime(c=Date.now()){return Object.values(this._tiles).filter(y=>y.timeAdded>=c)}}class Yv{constructor(c,y,S){this.painter=c,this.sourceCache=new kA(y),this.options=S,this.exaggeration=typeof S.exaggeration=="number"?S.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(c,y,S,T=s.X){var D;if(!(y>=0&&y=0&&Sc.canonical.z&&(c.canonical.z>=T?D=c.canonical.z-T:s.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const N=c.canonical.x-(c.canonical.x>>D<>D<>8<<4|D>>8,y[N+3]=0;const S=new s.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(y.buffer)),T=new Y(c,S,c.gl.RGBA,{premultiply:!1});return T.bind(c.gl.NEAREST,c.gl.CLAMP_TO_EDGE),this._coordsTexture=T,T}pointCoordinate(c){this.painter.maybeDrawDepthAndCoords(!0);const y=new Uint8Array(4),S=this.painter.context,T=S.gl,D=Math.round(c.x*this.painter.pixelRatio/devicePixelRatio),N=Math.round(c.y*this.painter.pixelRatio/devicePixelRatio),B=Math.round(this.painter.height/devicePixelRatio);S.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),T.readPixels(D,B-N-1,1,1,T.RGBA,T.UNSIGNED_BYTE,y),S.bindFramebuffer.set(null);const G=y[0]+(y[2]>>4<<8),q=y[1]+((15&y[2])<<8),K=this.coordsIndex[255-y[3]],J=K&&this.sourceCache.getTileByID(K);if(!J)return null;const ie=this._coordsTextureSize,de=(1<c.id!==y),this._recentlyUsed.push(c.id)}stampObject(c){c.stamp=++this._stamp}getOrCreateFreeObject(){for(const y of this._recentlyUsed)if(!this._objects[y].inUse)return this._objects[y];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const c=this._createObject(this._objects.length);return this._objects.push(c),c}freeObject(c){c.inUse=!1}freeAllObjects(){for(const c of this._objects)this.freeObject(c)}isFull(){return!(this._objects.length!c.inUse)===!1}}const Du={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Rb{constructor(c,y){this.painter=c,this.terrain=y,this.pool=new LA(c.context,30,y.sourceCache.tileSize*y.qualityFactor)}destruct(){this.pool.destruct()}getTexture(c){return this.pool.getObjectForId(c.rtt[this._stacks.length-1].id).texture}prepareForRender(c,y){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=c._order.filter(S=>!c._layers[S].isHidden(y)),this._coordsDescendingInv={};for(const S in c.sourceCaches){this._coordsDescendingInv[S]={};const T=c.sourceCaches[S].getVisibleCoordinates();for(const D of T){const N=this.terrain.sourceCache.getTerrainCoords(D);for(const B in N)this._coordsDescendingInv[S][B]||(this._coordsDescendingInv[S][B]=[]),this._coordsDescendingInv[S][B].push(N[B])}}this._coordsDescendingInvStr={};for(const S of c._order){const T=c._layers[S],D=T.source;if(Du[T.type]&&!this._coordsDescendingInvStr[D]){this._coordsDescendingInvStr[D]={};for(const N in this._coordsDescendingInv[D])this._coordsDescendingInvStr[D][N]=this._coordsDescendingInv[D][N].map(B=>B.key).sort().join()}}for(const S of this._renderableTiles)for(const T in this._coordsDescendingInvStr){const D=this._coordsDescendingInvStr[T][S.tileID.key];D&&D!==S.rttCoords[T]&&(S.rtt=[])}}renderLayer(c){if(c.isHidden(this.painter.transform.zoom))return!1;const y=c.type,S=this.painter,T=this._renderableLayerIds[this._renderableLayerIds.length-1]===c.id;if(Du[y]&&(this._prevType&&Du[this._prevType]||this._stacks.push([]),this._prevType=y,this._stacks[this._stacks.length-1].push(c.id),!T))return!0;if(Du[this._prevType]||Du[y]&&T){this._prevType=y;const D=this._stacks.length-1,N=this._stacks[D]||[];for(const B of this._renderableTiles){if(this.pool.isFull()&&(Cb(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(B),B.rtt[D]){const q=this.pool.getObjectForId(B.rtt[D].id);if(q.stamp===B.rtt[D].stamp){this.pool.useObject(q);continue}}const G=this.pool.getOrCreateFreeObject();this.pool.useObject(G),this.pool.stampObject(G),B.rtt[D]={id:G.id,stamp:G.stamp},S.context.bindFramebuffer.set(G.fbo.framebuffer),S.context.clear({color:s.aM.transparent,stencil:0}),S.currentStencilSource=void 0;for(let q=0;q{M.touchstart=M.dragStart,M.touchmoveWindow=M.dragMove,M.touchend=M.dragEnd},RA={showCompass:!0,showZoom:!0,visualizePitch:!1};class NA{constructor(c,y,S=!1){this.mousedown=N=>{this.startMouse(s.e({},N,{ctrlKey:!0,preventDefault:()=>N.preventDefault()}),g.mousePos(this.element,N)),g.addEventListener(window,"mousemove",this.mousemove),g.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=N=>{this.moveMouse(N,g.mousePos(this.element,N))},this.mouseup=N=>{this.mouseRotate.dragEnd(N),this.mousePitch&&this.mousePitch.dragEnd(N),this.offTemp()},this.touchstart=N=>{N.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=g.touchPos(this.element,N.targetTouches)[0],this.startTouch(N,this._startPos),g.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),g.addEventListener(window,"touchend",this.touchend))},this.touchmove=N=>{N.targetTouches.length!==1?this.reset():(this._lastPos=g.touchPos(this.element,N.targetTouches)[0],this.moveTouch(N,this._lastPos))},this.touchend=N=>{N.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),this.touchRotate.reset(),this.touchPitch&&this.touchPitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()},this._clickTolerance=10;const T=c.dragRotate._mouseRotate.getClickTolerance(),D=c.dragRotate._mousePitch.getClickTolerance();this.element=y,this.mouseRotate=Vv({clickTolerance:T,enable:!0}),this.touchRotate=(({enable:N,clickTolerance:B,bearingDegreesPerPixelMoved:G=.8})=>{const q=new Bv;return new Jo({clickTolerance:B,move:(K,J)=>({bearingDelta:(J.x-K.x)*G}),moveStateManager:q,enable:N,assignEvents:Jv})})({clickTolerance:T,enable:!0}),this.map=c,S&&(this.mousePitch=Fv({clickTolerance:D,enable:!0}),this.touchPitch=(({enable:N,clickTolerance:B,pitchDegreesPerPixelMoved:G=-.5})=>{const q=new Bv;return new Jo({clickTolerance:B,move:(K,J)=>({pitchDelta:(J.y-K.y)*G}),moveStateManager:q,enable:N,assignEvents:Jv})})({clickTolerance:D,enable:!0})),g.addEventListener(y,"mousedown",this.mousedown),g.addEventListener(y,"touchstart",this.touchstart,{passive:!1}),g.addEventListener(y,"touchcancel",this.reset)}startMouse(c,y){this.mouseRotate.dragStart(c,y),this.mousePitch&&this.mousePitch.dragStart(c,y),g.disableDrag()}startTouch(c,y){this.touchRotate.dragStart(c,y),this.touchPitch&&this.touchPitch.dragStart(c,y),g.disableDrag()}moveMouse(c,y){const S=this.map,{bearingDelta:T}=this.mouseRotate.dragMove(c,y)||{};if(T&&S.setBearing(S.getBearing()+T),this.mousePitch){const{pitchDelta:D}=this.mousePitch.dragMove(c,y)||{};D&&S.setPitch(S.getPitch()+D)}}moveTouch(c,y){const S=this.map,{bearingDelta:T}=this.touchRotate.dragMove(c,y)||{};if(T&&S.setBearing(S.getBearing()+T),this.touchPitch){const{pitchDelta:D}=this.touchPitch.dragMove(c,y)||{};D&&S.setPitch(S.getPitch()+D)}}off(){const c=this.element;g.removeEventListener(c,"mousedown",this.mousedown),g.removeEventListener(c,"touchstart",this.touchstart,{passive:!1}),g.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),g.removeEventListener(window,"touchend",this.touchend),g.removeEventListener(c,"touchcancel",this.reset),this.offTemp()}offTemp(){g.enableDrag(),g.removeEventListener(window,"mousemove",this.mousemove),g.removeEventListener(window,"mouseup",this.mouseup),g.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),g.removeEventListener(window,"touchend",this.touchend)}}let pa;function fn(M,c,y){const S=new s.N(M.lng,M.lat);if(M=new s.N(M.lng,M.lat),c){const T=new s.N(M.lng-360,M.lat),D=new s.N(M.lng+360,M.lat),N=y.locationPoint(M).distSqr(c);y.locationPoint(T).distSqr(c)180;){const T=y.locationPoint(M);if(T.x>=0&&T.y>=0&&T.x<=y.width&&T.y<=y.height)break;M.lng>y.center.lng?M.lng-=360:M.lng+=360}return M.lng!==S.lng&&y.locationPoint(M).y>y.height/2-y.getHorizon()?M:S}const Mu={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 Pf(M,c,y){const S=M.classList;for(const T in Mu)S.remove(`maplibregl-${y}-anchor-${T}`);S.add(`maplibregl-${y}-anchor-${c}`)}class Rf extends s.E{constructor(c){if(super(),this._onKeyPress=y=>{const S=y.code,T=y.charCode||y.keyCode;S!=="Space"&&S!=="Enter"&&T!==32&&T!==13||this.togglePopup()},this._onMapClick=y=>{const S=y.originalEvent.target,T=this._element;this._popup&&(S===T||T.contains(S))&&this.togglePopup()},this._update=y=>{var S;if(!this._map)return;const T=this._map.loaded()&&!this._map.isMoving();((y==null?void 0:y.type)==="terrain"||(y==null?void 0:y.type)==="render"&&!T)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?fn(this._lngLat,this._flatPos,this._map.transform):(S=this._lngLat)===null||S===void 0?void 0:S.wrap(),this._flatPos=this._pos=this._map.project(this._lngLat)._add(this._offset),this._map.terrain&&(this._flatPos=this._map.transform.locationPoint(this._lngLat)._add(this._offset));let D="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?D=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(D=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let N="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?N="rotateX(0deg)":this._pitchAlignment==="map"&&(N=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||y&&y.type!=="moveend"||(this._pos=this._pos.round()),g.setTransform(this._element,`${Mu[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${N} ${D}`),f.frameAsync(new AbortController).then(()=>{this._updateOpacity(y&&y.type==="moveend")}).catch(()=>{})},this._onMove=y=>{if(!this._isDragging){const S=this._clickTolerance||this._map._clickTolerance;this._isDragging=y.point.dist(this._pointerdownPos)>=S}this._isDragging&&(this._pos=y.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new s.k("dragstart"))),this.fire(new s.k("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),this._state==="active"&&this.fire(new s.k("dragend")),this._state="inactive"},this._addDragHandler=y=>{this._element.contains(y.originalEvent.target)&&(y.preventDefault(),this._positionDelta=y.point.sub(this._pos).add(this._offset),this._pointerdownPos=y.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=c&&c.anchor||"center",this._color=c&&c.color||"#3FB1CE",this._scale=c&&c.scale||1,this._draggable=c&&c.draggable||!1,this._clickTolerance=c&&c.clickTolerance||0,this._subpixelPositioning=c&&c.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=c&&c.rotation||0,this._rotationAlignment=c&&c.rotationAlignment||"auto",this._pitchAlignment=c&&c.pitchAlignment&&c.pitchAlignment!=="auto"?c.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(c==null?void 0:c.opacity,c==null?void 0:c.opacityWhenCovered),c&&c.element)this._element=c.element,this._offset=s.P.convert(c&&c.offset||[0,0]);else{this._defaultMarker=!0,this._element=g.create("div");const y=g.createNS("http://www.w3.org/2000/svg","svg"),S=41,T=27;y.setAttributeNS(null,"display","block"),y.setAttributeNS(null,"height",`${S}px`),y.setAttributeNS(null,"width",`${T}px`),y.setAttributeNS(null,"viewBox",`0 0 ${T} ${S}`);const D=g.createNS("http://www.w3.org/2000/svg","g");D.setAttributeNS(null,"stroke","none"),D.setAttributeNS(null,"stroke-width","1"),D.setAttributeNS(null,"fill","none"),D.setAttributeNS(null,"fill-rule","evenodd");const N=g.createNS("http://www.w3.org/2000/svg","g");N.setAttributeNS(null,"fill-rule","nonzero");const B=g.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"transform","translate(3.0, 29.0)"),B.setAttributeNS(null,"fill","#000000");const G=[{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(const Te of G){const Ce=g.createNS("http://www.w3.org/2000/svg","ellipse");Ce.setAttributeNS(null,"opacity","0.04"),Ce.setAttributeNS(null,"cx","10.5"),Ce.setAttributeNS(null,"cy","5.80029008"),Ce.setAttributeNS(null,"rx",Te.rx),Ce.setAttributeNS(null,"ry",Te.ry),B.appendChild(Ce)}const q=g.createNS("http://www.w3.org/2000/svg","g");q.setAttributeNS(null,"fill",this._color);const K=g.createNS("http://www.w3.org/2000/svg","path");K.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"),q.appendChild(K);const J=g.createNS("http://www.w3.org/2000/svg","g");J.setAttributeNS(null,"opacity","0.25"),J.setAttributeNS(null,"fill","#000000");const ie=g.createNS("http://www.w3.org/2000/svg","path");ie.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"),J.appendChild(ie);const de=g.createNS("http://www.w3.org/2000/svg","g");de.setAttributeNS(null,"transform","translate(6.0, 7.0)"),de.setAttributeNS(null,"fill","#FFFFFF");const pe=g.createNS("http://www.w3.org/2000/svg","g");pe.setAttributeNS(null,"transform","translate(8.0, 8.0)");const _e=g.createNS("http://www.w3.org/2000/svg","circle");_e.setAttributeNS(null,"fill","#000000"),_e.setAttributeNS(null,"opacity","0.25"),_e.setAttributeNS(null,"cx","5.5"),_e.setAttributeNS(null,"cy","5.5"),_e.setAttributeNS(null,"r","5.4999962");const Se=g.createNS("http://www.w3.org/2000/svg","circle");Se.setAttributeNS(null,"fill","#FFFFFF"),Se.setAttributeNS(null,"cx","5.5"),Se.setAttributeNS(null,"cy","5.5"),Se.setAttributeNS(null,"r","5.4999962"),pe.appendChild(_e),pe.appendChild(Se),N.appendChild(B),N.appendChild(q),N.appendChild(J),N.appendChild(de),N.appendChild(pe),y.appendChild(N),y.setAttributeNS(null,"height",S*this._scale+"px"),y.setAttributeNS(null,"width",T*this._scale+"px"),this._element.appendChild(y),this._offset=s.P.convert(c&&c.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",y=>{y.preventDefault()}),this._element.addEventListener("mousedown",y=>{y.preventDefault()}),Pf(this._element,this._anchor,"marker"),c&&c.className)for(const y of c.className.split(" "))this._element.classList.add(y);this._popup=null}addTo(c){return this.remove(),this._map=c,this._element.setAttribute("aria-label",c._getUIString("Marker.Title")),c.getCanvasContainer().appendChild(this._element),c.on("move",this._update),c.on("moveend",this._update),c.on("terrain",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("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),g.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(c){return this._lngLat=s.N.convert(c),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(c){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),c){if(!("offset"in c.options)){const T=Math.abs(13.5)/Math.SQRT2;c.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[T,-1*(38.1-13.5+T)],"bottom-right":[-T,-1*(38.1-13.5+T)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=c,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(c){return this._subpixelPositioning=c,this}getPopup(){return this._popup}togglePopup(){const c=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:c?(c.isOpen()?c.remove():(c.setLngLat(this._lngLat),c.addTo(this._map)),this):this}_updateOpacity(c=!1){var y,S;if(!(!((y=this._map)===null||y===void 0)&&y.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(c)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const T=this._map,D=T.terrain.depthAtPoint(this._pos),N=T.terrain.getElevationForLngLatZoom(this._lngLat,T.transform.tileZoom);if(T.transform.lngLatToCameraDepth(this._lngLat,N)-D<.006)return void(this._element.style.opacity=this._opacity);const B=-this._offset.y/T.transform._pixelPerMeter,G=Math.sin(T.getPitch()*Math.PI/180)*B,q=T.terrain.depthAtPoint(new s.P(this._pos.x,this._pos.y-this._offset.y)),K=T.transform.lngLatToCameraDepth(this._lngLat,N+G)-q>.006;!((S=this._popup)===null||S===void 0)&&S.isOpen()&&K&&this._popup.remove(),this._element.style.opacity=K?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(c){return this._offset=s.P.convert(c),this._update(),this}addClassName(c){this._element.classList.add(c)}removeClassName(c){this._element.classList.remove(c)}toggleClassName(c){return this._element.classList.toggle(c)}setDraggable(c){return this._draggable=!!c,this._map&&(c?(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(c){return this._rotation=c||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(c){return this._rotationAlignment=c||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(c){return this._pitchAlignment=c&&c!=="auto"?c:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(c,y){return c===void 0&&y===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),c!==void 0&&(this._opacity=c),y!==void 0&&(this._opacityWhenCovered=y),this._map&&this._updateOpacity(!0),this}}const Ob={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let Dh=0,Mh=!1;const Io={maxWidth:100,unit:"metric"};function Ih(M,c,y){const S=y&&y.maxWidth||100,T=M._container.clientHeight/2,D=M.unproject([0,T]),N=M.unproject([S,T]),B=D.distanceTo(N);if(y&&y.unit==="imperial"){const G=3.2808*B;G>5280?Pt(c,S,G/5280,M._getUIString("ScaleControl.Miles")):Pt(c,S,G,M._getUIString("ScaleControl.Feet"))}else y&&y.unit==="nautical"?Pt(c,S,B/1852,M._getUIString("ScaleControl.NauticalMiles")):B>=1e3?Pt(c,S,B/1e3,M._getUIString("ScaleControl.Kilometers")):Pt(c,S,B,M._getUIString("ScaleControl.Meters"))}function Pt(M,c,y,S){const T=function(D){const N=Math.pow(10,`${Math.floor(D)}`.length-1);let B=D/N;return B=B>=10?10:B>=5?5:B>=3?3:B>=2?2:B>=1?1:function(G){const q=Math.pow(10,Math.ceil(-Math.log(G)/Math.LN10));return Math.round(G*q)/q}(B),N*B}(y);M.style.width=c*(T/y)+"px",M.innerHTML=`${T} ${S}`}const Qt={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},Nf=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function Of(M){if(M){if(typeof M=="number"){const c=Math.round(Math.abs(M)/Math.SQRT2);return{center:new s.P(0,0),top:new s.P(0,M),"top-left":new s.P(c,c),"top-right":new s.P(-c,c),bottom:new s.P(0,-M),"bottom-left":new s.P(c,-c),"bottom-right":new s.P(-c,-c),left:new s.P(M,0),right:new s.P(-M,0)}}if(M instanceof s.P||Array.isArray(M)){const c=s.P.convert(M);return{center:c,top:c,"top-left":c,"top-right":c,bottom:c,"bottom-left":c,"bottom-right":c,left:c,right:c}}return{center:s.P.convert(M.center||[0,0]),top:s.P.convert(M.top||[0,0]),"top-left":s.P.convert(M["top-left"]||[0,0]),"top-right":s.P.convert(M["top-right"]||[0,0]),bottom:s.P.convert(M.bottom||[0,0]),"bottom-left":s.P.convert(M["bottom-left"]||[0,0]),"bottom-right":s.P.convert(M["bottom-right"]||[0,0]),left:s.P.convert(M.left||[0,0]),right:s.P.convert(M.right||[0,0])}}return Of(new s.P(0,0))}const Qv=l;o.AJAXError=s.bh,o.Evented=s.E,o.LngLat=s.N,o.MercatorCoordinate=s.Z,o.Point=s.P,o.addProtocol=s.bi,o.config=s.a,o.removeProtocol=s.bj,o.AttributionControl=Au,o.BoxZoomHandler=fa,o.CanvasSource=Pn,o.CooperativeGesturesHandler=Eu,o.DoubleClickZoomHandler=ml,o.DragPanHandler=kb,o.DragRotateHandler=Lb,o.EdgeInsets=wu,o.FullscreenControl=class extends s.E{constructor(M={}){super(),this._onFullscreenChange=()=>{var c;let y=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((c=y==null?void 0:y.shadowRoot)===null||c===void 0)&&c.fullscreenElement;)y=y.shadowRoot.fullscreenElement;y===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,M&&M.container&&(M.container instanceof HTMLElement?this._container=M.container:s.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(M){return this._map=M,this._container||(this._container=this._map.getContainer()),this._controlContainer=g.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){g.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const M=this._fullscreenButton=g.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);g.create("span","maplibregl-ctrl-icon",M).setAttribute("aria-hidden","true"),M.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const M=this._getTitle();this._fullscreenButton.setAttribute("aria-label",M),this._fullscreenButton.title=M}_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 s.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new s.k("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()}},o.GeoJSONSource=lr,o.GeolocateControl=class extends s.E{constructor(M){super(),this._onSuccess=c=>{if(this._map){if(this._isOutOfMapMaxBounds(c))return this._setErrorState(),this.fire(new s.k("outofmaxbounds",c)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=c,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&&this._watchState!=="OFF"&&this._updateMarker(c),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(c),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new s.k("geolocate",c)),this._finish()}},this._updateCamera=c=>{const y=new s.N(c.coords.longitude,c.coords.latitude),S=c.coords.accuracy,T=this._map.getBearing(),D=s.e({bearing:T},this.options.fitBoundsOptions),N=Le.fromLngLat(y,S);this._map.fitBounds(N,D,{geolocateSource:!0})},this._updateMarker=c=>{if(c){const y=new s.N(c.coords.longitude,c.coords.latitude);this._accuracyCircleMarker.setLngLat(y).addTo(this._map),this._userLocationDotMarker.setLngLat(y).addTo(this._map),this._accuracy=c.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},this._onZoom=()=>{this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},this._onError=c=>{if(this._map){if(this.options.trackUserLocation)if(c.code===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._geolocateButton.disabled=!0;const y=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=y,this._geolocateButton.setAttribute("aria-label",y),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(c.code===3&&Mh)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new s.k("error",c)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",c=>c.preventDefault()),this._geolocateButton=g.create("button","maplibregl-ctrl-geolocate",this._container),g.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=c=>{if(this._map){if(c===!1){s.w("Geolocation support is not available so the GeolocateControl will be disabled.");const y=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=y,this._geolocateButton.setAttribute("aria-label",y)}else{const y=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=y,this._geolocateButton.setAttribute("aria-label",y)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=g.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new Rf({element:this._dotElement}),this._circleElement=g.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Rf({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",()=>this.trigger()),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",y=>{y.geolocateSource||this._watchState!=="ACTIVE_LOCK"||y.originalEvent&&y.originalEvent.type==="resize"||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active"),this.fire(new s.k("trackuserlocationend")),this.fire(new s.k("userlocationlostfocus")))})}},this.options=s.e({},Ob,M)}onAdd(M){return this._map=M,this._container=g.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return s._(this,arguments,void 0,function*(c=!1){if(pa!==void 0&&!c)return pa;if(window.navigator.permissions===void 0)return pa=!!window.navigator.geolocation,pa;try{pa=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{pa=!!window.navigator.geolocation}return pa})}().then(c=>this._finishSetupUI(c)),this._container}onRemove(){this._geolocationWatchID!==void 0&&(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(),g.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Dh=0,Mh=!1}_isOutOfMapMaxBounds(M){const c=this._map.getMaxBounds(),y=M.coords;return c&&(y.longitudec.getEast()||y.latitudec.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":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_updateCircleRadius(){const M=this._map.getBounds(),c=M.getSouthEast(),y=M.getNorthEast(),S=c.distanceTo(y),T=Math.ceil(this._accuracy/(S/this._map._container.clientHeight)*2);this._circleElement.style.width=`${T}px`,this._circleElement.style.height=`${T}px`}trigger(){if(!this._setup)return s.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 s.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Dh--,Mh=!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 s.k("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 s.k("trackuserlocationstart")),this.fire(new s.k("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(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){let M;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Dh++,Dh>1?(M={maximumAge:6e5,timeout:0},Mh=!0):(M=this.options.positionOptions,Mh=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,M)}}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)}},o.Hash=Tf,o.ImageSource=Tn,o.KeyboardHandler=ka,o.LngLatBounds=Le,o.LogoControl=jv,o.Map=class extends Pb{constructor(M){s.bf.mark(s.bg.create);const c=Object.assign(Object.assign({},PA),M);if(c.minZoom!=null&&c.maxZoom!=null&&c.minZoom>c.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(c.minPitch!=null&&c.maxPitch!=null&&c.minPitch>c.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(c.minPitch!=null&&c.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(c.maxPitch!=null&&c.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new Su(c.minZoom,c.maxZoom,c.minPitch,c.maxPitch,c.renderWorldCopies),{bearingSnap:c.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Rr,this._controls=[],this._mapId=s.a4(),this._contextLost=y=>{y.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new s.k("webglcontextlost",{originalEvent:y}))},this._contextRestored=y=>{this._setupPainter(),this.resize(),this._update(),this.fire(new s.k("webglcontextrestored",{originalEvent:y}))},this._onMapScroll=y=>{if(y.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=c.interactive,this._maxTileCacheSize=c.maxTileCacheSize,this._maxTileCacheZoomLevels=c.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=c.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=c.preserveDrawingBuffer===!0,this._antialias=c.antialias===!0,this._trackResize=c.trackResize===!0,this._bearingSnap=c.bearingSnap,this._refreshExpiredTiles=c.refreshExpiredTiles===!0,this._fadeDuration=c.fadeDuration,this._crossSourceCollisions=c.crossSourceCollisions===!0,this._collectResourceTiming=c.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Kv),c.locale),this._clickTolerance=c.clickTolerance,this._overridePixelRatio=c.pixelRatio,this._maxCanvasSize=c.maxCanvasSize,this.transformCameraUpdate=c.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=c.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=L.addThrottleControl(()=>this.isMoving()),this._requestManager=new O(c.transformRequest),typeof c.container=="string"){if(this._container=document.getElementById(c.container),!this._container)throw new Error(`Container '${c.container}' not found.`)}else{if(!(c.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=c.container}if(c.maxBounds&&this.setMaxBounds(c.maxBounds),this._setupContainer(),this._setupPainter(),this.on("move",()=>this._update(!1)).on("moveend",()=>this._update(!1)).on("zoom",()=>this._update(!0)).on("terrain",()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)}).once("idle",()=>{this._idleTriggered=!0}),typeof window<"u"){addEventListener("online",this._onWindowOnline,!1);let y=!1;const S=wh(T=>{this._trackResize&&!this._removed&&(this.resize(T),this.redraw())},50);this._resizeObserver=new ResizeObserver(T=>{y?S(T):y=!0}),this._resizeObserver.observe(this._container)}this.handlers=new Zv(this,c),this._hash=c.hash&&new Tf(typeof c.hash=="string"&&c.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:c.center,zoom:c.zoom,bearing:c.bearing,pitch:c.pitch}),c.bounds&&(this.resize(),this.fitBounds(c.bounds,s.e({},c.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=c.localIdeographFontFamily,this._validateStyle=c.validateStyle,c.style&&this.setStyle(c.style,{localIdeographFontFamily:c.localIdeographFontFamily}),c.attributionControl&&this.addControl(new Au(typeof c.attributionControl=="boolean"?void 0:c.attributionControl)),c.maplibreLogo&&this.addControl(new jv,c.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",y=>{this._update(y.dataType==="style"),this.fire(new s.k(`${y.dataType}data`,y))}),this.on("dataloading",y=>{this.fire(new s.k(`${y.dataType}dataloading`,y))}),this.on("dataabort",y=>{this.fire(new s.k("sourcedataabort",y))})}_getMapId(){return this._mapId}addControl(M,c){if(c===void 0&&(c=M.getDefaultPosition?M.getDefaultPosition():"top-right"),!M||!M.onAdd)return this.fire(new s.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const y=M.onAdd(this);this._controls.push(M);const S=this._controlPositions[c];return c.indexOf("bottom")!==-1?S.insertBefore(y,S.firstChild):S.appendChild(y),this}removeControl(M){if(!M||!M.onRemove)return this.fire(new s.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const c=this._controls.indexOf(M);return c>-1&&this._controls.splice(c,1),M.onRemove(this),this}hasControl(M){return this._controls.indexOf(M)>-1}calculateCameraOptionsFromTo(M,c,y,S){return S==null&&this.terrain&&(S=this.terrain.getElevationForLngLatZoom(y,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(M,c,y,S)}resize(M){var c;const y=this._containerDimensions(),S=y[0],T=y[1],D=this._getClampedPixelRatio(S,T);if(this._resizeCanvas(S,T,D),this.painter.resize(S,T,D),this.painter.overLimit()){const B=this.painter.context.gl;this._maxCanvasSize=[B.drawingBufferWidth,B.drawingBufferHeight];const G=this._getClampedPixelRatio(S,T);this._resizeCanvas(S,T,G),this.painter.resize(S,T,G)}this.transform.resize(S,T),(c=this._requestedCameraState)===null||c===void 0||c.resize(S,T);const N=!this._moving;return N&&(this.stop(),this.fire(new s.k("movestart",M)).fire(new s.k("move",M))),this.fire(new s.k("resize",M)),N&&this.fire(new s.k("moveend",M)),this}_getClampedPixelRatio(M,c){const{0:y,1:S}=this._maxCanvasSize,T=this.getPixelRatio(),D=M*T,N=c*T;return Math.min(D>y?y/D:1,N>S?S/N:1)*T}getPixelRatio(){var M;return(M=this._overridePixelRatio)!==null&&M!==void 0?M:devicePixelRatio}setPixelRatio(M){this._overridePixelRatio=M,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(M){return this.transform.setMaxBounds(Le.convert(M)),this._update()}setMinZoom(M){if((M=M??-2)>=-2&&M<=this.transform.maxZoom)return this.transform.minZoom=M,this._update(),this.getZoom()=this.transform.minZoom)return this.transform.maxZoom=M,this._update(),this.getZoom()>M&&this.setZoom(M),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(M){if((M=M??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(M>=0&&M<=this.transform.maxPitch)return this.transform.minPitch=M,this._update(),this.getPitch()85)throw new Error("maxPitch must be less than or equal to 85");if(M>=this.transform.minPitch)return this.transform.maxPitch=M,this._update(),this.getPitch()>M&&this.setPitch(M),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(M){return this.transform.renderWorldCopies=M,this._update()}project(M){return this.transform.locationPoint(s.N.convert(M),this.style&&this.terrain)}unproject(M){return this.transform.pointLocation(s.P.convert(M),this.terrain)}isMoving(){var M;return this._moving||((M=this.handlers)===null||M===void 0?void 0:M.isMoving())}isZooming(){var M;return this._zooming||((M=this.handlers)===null||M===void 0?void 0:M.isZooming())}isRotating(){var M;return this._rotating||((M=this.handlers)===null||M===void 0?void 0:M.isRotating())}_createDelegatedListener(M,c,y){if(M==="mouseenter"||M==="mouseover"){let S=!1;return{layers:c,listener:y,delegates:{mousemove:D=>{const N=c.filter(G=>this.getLayer(G)),B=N.length!==0?this.queryRenderedFeatures(D.point,{layers:N}):[];B.length?S||(S=!0,y.call(this,new gi(M,this,D.originalEvent,{features:B}))):S=!1},mouseout:()=>{S=!1}}}}if(M==="mouseleave"||M==="mouseout"){let S=!1;return{layers:c,listener:y,delegates:{mousemove:N=>{const B=c.filter(G=>this.getLayer(G));(B.length!==0?this.queryRenderedFeatures(N.point,{layers:B}):[]).length?S=!0:S&&(S=!1,y.call(this,new gi(M,this,N.originalEvent)))},mouseout:N=>{S&&(S=!1,y.call(this,new gi(M,this,N.originalEvent)))}}}}{const S=T=>{const D=c.filter(B=>this.getLayer(B)),N=D.length!==0?this.queryRenderedFeatures(T.point,{layers:D}):[];N.length&&(T.features=N,y.call(this,T),delete T.features)};return{layers:c,listener:y,delegates:{[M]:S}}}}_saveDelegatedListener(M,c){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[M]=this._delegatedListeners[M]||[],this._delegatedListeners[M].push(c)}_removeDelegatedListener(M,c,y){if(!this._delegatedListeners||!this._delegatedListeners[M])return;const S=this._delegatedListeners[M];for(let T=0;Tc.includes(N))){for(const N in D.delegates)this.off(N,D.delegates[N]);return void S.splice(T,1)}}}on(M,c,y){if(y===void 0)return super.on(M,c);const S=this._createDelegatedListener(M,typeof c=="string"?[c]:c,y);this._saveDelegatedListener(M,S);for(const T in S.delegates)this.on(T,S.delegates[T]);return this}once(M,c,y){if(y===void 0)return super.once(M,c);const S=typeof c=="string"?[c]:c,T=this._createDelegatedListener(M,S,y);for(const D in T.delegates){const N=T.delegates[D];T.delegates[D]=(...B)=>{this._removeDelegatedListener(M,S,y),N(...B)}}this._saveDelegatedListener(M,T);for(const D in T.delegates)this.once(D,T.delegates[D]);return this}off(M,c,y){return y===void 0?super.off(M,c):(this._removeDelegatedListener(M,typeof c=="string"?[c]:c,y),this)}queryRenderedFeatures(M,c){if(!this.style)return[];let y;const S=M instanceof s.P||Array.isArray(M),T=S?M:[[0,0],[this.transform.width,this.transform.height]];if(c=c||(S?{}:M)||{},T instanceof s.P||typeof T[0]=="number")y=[s.P.convert(T)];else{const D=s.P.convert(T[0]),N=s.P.convert(T[1]);y=[D,new s.P(N.x,D.y),N,new s.P(D.x,N.y),D]}return this.style.queryRenderedFeatures(y,c,this.transform)}querySourceFeatures(M,c){return this.style.querySourceFeatures(M,c)}setStyle(M,c){return(c=s.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},c)).diff!==!1&&c.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&M?(this._diffStyle(M,c),this):(this._localIdeographFontFamily=c.localIdeographFontFamily,this._updateStyle(M,c))}setTransformRequest(M){return this._requestManager.setTransformRequest(M),this}_getUIString(M){const c=this._locale[M];if(c==null)throw new Error(`Missing UI string '${M}'`);return c}_updateStyle(M,c){if(c.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(M,c));const y=this.style&&c.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!M)),M?(this.style=new sf(this,c||{}),this.style.setEventedParent(this,{style:this.style}),typeof M=="string"?this.style.loadURL(M,c,y):this.style.loadJSON(M,c,y),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new sf(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(M,c){if(typeof M=="string"){const y=this._requestManager.transformRequest(M,"Style");s.h(y,new AbortController).then(S=>{this._updateDiff(S.data,c)}).catch(S=>{S&&this.fire(new s.j(S))})}else typeof M=="object"&&this._updateDiff(M,c)}_updateDiff(M,c){try{this.style.setState(M,c)&&this._update(!0)}catch(y){s.w(`Unable to perform style diff: ${y.message||y.error||y}. Rebuilding the style from scratch.`),this._updateStyle(M,c)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():s.w("There is no style added to the map.")}addSource(M,c){return this._lazyInitEmptyStyle(),this.style.addSource(M,c),this._update(!0)}isSourceLoaded(M){const c=this.style&&this.style.sourceCaches[M];if(c!==void 0)return c.loaded();this.fire(new s.j(new Error(`There is no source with ID '${M}'`)))}setTerrain(M){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),M){const c=this.style.sourceCaches[M.source];if(!c)throw new Error(`cannot load terrain, because there exists no source with ID: ${M.source}`);this.terrain===null&&c.reload();for(const y in this.style._layers){const S=this.style._layers[y];S.type==="hillshade"&&S.source===M.source&&s.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.")}this.terrain=new Yv(this.painter,c,M),this.painter.renderToTexture=new Rb(this.painter,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._terrainDataCallback=y=>{y.dataType==="style"?this.terrain.sourceCache.freeRtt():y.dataType==="source"&&y.tile&&(y.sourceId!==M.source||this._elevationFreeze||(this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom)),this.terrain.sourceCache.freeRtt(y.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.minElevationForCurrentTile=0,this.transform.elevation=0;return this.fire(new s.k("terrain",{terrain:M})),this}getTerrain(){var M,c;return(c=(M=this.terrain)===null||M===void 0?void 0:M.options)!==null&&c!==void 0?c:null}areTilesLoaded(){const M=this.style&&this.style.sourceCaches;for(const c in M){const y=M[c]._tiles;for(const S in y){const T=y[S];if(T.state!=="loaded"&&T.state!=="errored")return!1}}return!0}removeSource(M){return this.style.removeSource(M),this._update(!0)}getSource(M){return this.style.getSource(M)}addImage(M,c,y={}){const{pixelRatio:S=1,sdf:T=!1,stretchX:D,stretchY:N,content:B,textFitWidth:G,textFitHeight:q}=y;if(this._lazyInitEmptyStyle(),!(c instanceof HTMLImageElement||s.b(c))){if(c.width===void 0||c.height===void 0)return this.fire(new s.j(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`")));{const{width:K,height:J,data:ie}=c,de=c;return this.style.addImage(M,{data:new s.R({width:K,height:J},new Uint8Array(ie)),pixelRatio:S,stretchX:D,stretchY:N,content:B,textFitWidth:G,textFitHeight:q,sdf:T,version:0,userImage:de}),de.onAdd&&de.onAdd(this,M),this}}{const{width:K,height:J,data:ie}=f.getImageData(c);this.style.addImage(M,{data:new s.R({width:K,height:J},ie),pixelRatio:S,stretchX:D,stretchY:N,content:B,textFitWidth:G,textFitHeight:q,sdf:T,version:0})}}updateImage(M,c){const y=this.style.getImage(M);if(!y)return this.fire(new s.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const S=c instanceof HTMLImageElement||s.b(c)?f.getImageData(c):c,{width:T,height:D,data:N}=S;if(T===void 0||D===void 0)return this.fire(new s.j(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(T!==y.data.width||D!==y.data.height)return this.fire(new s.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const B=!(c instanceof HTMLImageElement||s.b(c));return y.data.replace(N,B),this.style.updateImage(M,y),this}getImage(M){return this.style.getImage(M)}hasImage(M){return M?!!this.style.getImage(M):(this.fire(new s.j(new Error("Missing required image id"))),!1)}removeImage(M){this.style.removeImage(M)}loadImage(M){return L.getImage(this._requestManager.transformRequest(M,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(M,c){return this._lazyInitEmptyStyle(),this.style.addLayer(M,c),this._update(!0)}moveLayer(M,c){return this.style.moveLayer(M,c),this._update(!0)}removeLayer(M){return this.style.removeLayer(M),this._update(!0)}getLayer(M){return this.style.getLayer(M)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(M,c,y){return this.style.setLayerZoomRange(M,c,y),this._update(!0)}setFilter(M,c,y={}){return this.style.setFilter(M,c,y),this._update(!0)}getFilter(M){return this.style.getFilter(M)}setPaintProperty(M,c,y,S={}){return this.style.setPaintProperty(M,c,y,S),this._update(!0)}getPaintProperty(M,c){return this.style.getPaintProperty(M,c)}setLayoutProperty(M,c,y,S={}){return this.style.setLayoutProperty(M,c,y,S),this._update(!0)}getLayoutProperty(M,c){return this.style.getLayoutProperty(M,c)}setGlyphs(M,c={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(M,c),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(M,c,y={}){return this._lazyInitEmptyStyle(),this.style.addSprite(M,c,y,S=>{S||this._update(!0)}),this}removeSprite(M){return this._lazyInitEmptyStyle(),this.style.removeSprite(M),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(M,c={}){return this._lazyInitEmptyStyle(),this.style.setSprite(M,c,y=>{y||this._update(!0)}),this}setLight(M,c={}){return this._lazyInitEmptyStyle(),this.style.setLight(M,c),this._update(!0)}getLight(){return this.style.getLight()}setSky(M){return this._lazyInitEmptyStyle(),this.style.setSky(M),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(M,c){return this.style.setFeatureState(M,c),this._update()}removeFeatureState(M,c){return this.style.removeFeatureState(M,c),this._update()}getFeatureState(M){return this.style.getFeatureState(M)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let M=0,c=0;return this._container&&(M=this._container.clientWidth||400,c=this._container.clientHeight||300),[M,c]}_setupContainer(){const M=this._container;M.classList.add("maplibregl-map");const c=this._canvasContainer=g.create("div","maplibregl-canvas-container",M);this._interactive&&c.classList.add("maplibregl-interactive"),this._canvas=g.create("canvas","maplibregl-canvas",c),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");const y=this._containerDimensions(),S=this._getClampedPixelRatio(y[0],y[1]);this._resizeCanvas(y[0],y[1],S);const T=this._controlContainer=g.create("div","maplibregl-control-container",M),D=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(N=>{D[N]=g.create("div",`maplibregl-ctrl-${N} `,T)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(M,c,y){this._canvas.width=Math.floor(y*M),this._canvas.height=Math.floor(y*c),this._canvas.style.width=`${M}px`,this._canvas.style.height=`${c}px`}_setupPainter(){const M={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let c=null;this._canvas.addEventListener("webglcontextcreationerror",S=>{c={requestedAttributes:M},S&&(c.statusMessage=S.statusMessage,c.type=S.type)},{once:!0});const y=this._canvas.getContext("webgl2",M)||this._canvas.getContext("webgl",M);if(!y){const S="Failed to initialize WebGL";throw c?(c.message=S,new Error(JSON.stringify(c))):new Error(S)}this.painter=new Sf(y,this.transform),m.testSupport(y)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(M){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||M,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(M){return this._update(),this._renderTaskQueue.add(M)}_cancelRenderFrame(M){this._renderTaskQueue.remove(M)}_render(M){const c=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(M),this._removed)return;let y=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const T=this.transform.zoom,D=f.now();this.style.zoomHistory.update(T,D);const N=new s.z(T,{now:D,fadeDuration:c,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),B=N.crossFadingFactor();B===1&&B===this._crossFadingFactor||(y=!0,this._crossFadingFactor=B),this.style.update(N)}this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.terrain?(this.terrain.sourceCache.update(this.transform,this.terrain),this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this.transform.center,this.transform.tileZoom),this._elevationFreeze||(this.transform.elevation=this.terrain.getElevationForLngLatZoom(this.transform.center,this.transform.tileZoom))):(this.transform.minElevationForCurrentTile=0,this.transform.elevation=0),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,c,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:c,showPadding:this.showPadding}),this.fire(new s.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,s.bf.mark(s.bg.load),this.fire(new s.k("load"))),this.style&&(this.style.hasTransitions()||y)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const S=this._sourcesDirty||this._styleDirty||this._placementDirty;return S||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new s.k("idle")),!this._loaded||this._fullyLoaded||S||(this._fullyLoaded=!0,s.bf.mark(s.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var M;this._hash&&this._hash.remove();for(const y of this._controls)y.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),L.removeThrottleControl(this._imageQueueHandle),(M=this._resizeObserver)===null||M===void 0||M.disconnect();const c=this.painter.context.gl.getExtension("WEBGL_lose_context");c!=null&&c.loseContext&&c.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),g.remove(this._canvasContainer),g.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),s.bf.clearMetrics(),this._removed=!0,this.fire(new s.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,f.frameAsync(this._frameRequest).then(M=>{s.bf.frame(M),this._frameRequest=null,this._render(M)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(M){this._showTileBoundaries!==M&&(this._showTileBoundaries=M,this._update())}get showPadding(){return!!this._showPadding}set showPadding(M){this._showPadding!==M&&(this._showPadding=M,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(M){this._showCollisionBoxes!==M&&(this._showCollisionBoxes=M,M?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(M){this._showOverdrawInspector!==M&&(this._showOverdrawInspector=M,this._update())}get repaint(){return!!this._repaint}set repaint(M){this._repaint!==M&&(this._repaint=M,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(M){this._vertices=M,this._update()}get version(){return Nb}getCameraTargetElevation(){return this.transform.elevation}},o.MapMouseEvent=gi,o.MapTouchEvent=gl,o.MapWheelEvent=Db,o.Marker=Rf,o.NavigationControl=class{constructor(M){this._updateZoomButtons=()=>{const c=this._map.getZoom(),y=c===this._map.getMaxZoom(),S=c===this._map.getMinZoom();this._zoomInButton.disabled=y,this._zoomOutButton.disabled=S,this._zoomInButton.setAttribute("aria-disabled",y.toString()),this._zoomOutButton.setAttribute("aria-disabled",S.toString())},this._rotateCompassArrow=()=>{const c=this.options.visualizePitch?`scale(${1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)}) rotateX(${this._map.transform.pitch}deg) rotateZ(${this._map.transform.angle*(180/Math.PI)}deg)`:`rotate(${this._map.transform.angle*(180/Math.PI)}deg)`;this._compassIcon.style.transform=c},this._setButtonTitle=(c,y)=>{const S=this._map._getUIString(`NavigationControl.${y}`);c.title=S,c.setAttribute("aria-label",S)},this.options=s.e({},RA,M),this._container=g.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",c=>c.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",c=>this._map.zoomIn({},{originalEvent:c})),g.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",c=>this._map.zoomOut({},{originalEvent:c})),g.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",c=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:c}):this._map.resetNorth({},{originalEvent:c})}),this._compassIcon=g.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(M){return this._map=M,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._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new NA(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){g.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._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map}_createButton(M,c){const y=g.create("button",M,this._container);return y.type="button",y.addEventListener("click",c),y}},o.Popup=class extends s.E{constructor(M){super(),this.remove=()=>(this._content&&g.remove(this._content),this._container&&(g.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 s.k("close"))),this),this._onMouseUp=c=>{this._update(c.point)},this._onMouseMove=c=>{this._update(c.point)},this._onDrag=c=>{this._update(c.point)},this._update=c=>{var y;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=g.create("div","maplibregl-popup",this._map.getContainer()),this._tip=g.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const B of this.options.className.split(" "))this._container.classList.add(B);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=this._map.transform.renderWorldCopies&&!this._trackPointer?fn(this._lngLat,this._flatPos,this._map.transform):(y=this._lngLat)===null||y===void 0?void 0:y.wrap(),this._trackPointer&&!c)return;const S=this._flatPos=this._pos=this._trackPointer&&c?c:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&c?c:this._map.transform.locationPoint(this._lngLat));let T=this.options.anchor;const D=Of(this.options.offset);if(!T){const B=this._container.offsetWidth,G=this._container.offsetHeight;let q;q=S.y+D.bottom.ythis._map.transform.height-G?["bottom"]:[],S.xthis._map.transform.width-B/2&&q.push("right"),T=q.length===0?"bottom":q.join("-")}let N=S.add(D[T]);this.options.subpixelPositioning||(N=N.round()),g.setTransform(this._container,`${Mu[T]} translate(${N.x}px,${N.y}px)`),Pf(this._container,T,"popup")},this._onClose=()=>{this.remove()},this.options=s.e(Object.create(Qt),M)}addTo(M){return this._map&&this.remove(),this._map=M,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 s.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(M){return this._lngLat=s.N.convert(M),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(M){return this.setDOMContent(document.createTextNode(M))}setHTML(M){const c=document.createDocumentFragment(),y=document.createElement("body");let S;for(y.innerHTML=M;S=y.firstChild,S;)c.appendChild(S);return this.setDOMContent(c)}getMaxWidth(){var M;return(M=this._container)===null||M===void 0?void 0:M.style.maxWidth}setMaxWidth(M){return this.options.maxWidth=M,this._update(),this}setDOMContent(M){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=g.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(M),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(M){return this._container&&this._container.classList.add(M),this}removeClassName(M){return this._container&&this._container.classList.remove(M),this}setOffset(M){return this.options.offset=M,this._update(),this}toggleClassName(M){if(this._container)return this._container.classList.toggle(M)}setSubpixelPositioning(M){this.options.subpixelPositioning=M}_createCloseButton(){this.options.closeButton&&(this._closeButton=g.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const M=this._container.querySelector(Nf);M&&M.focus()}},o.RasterDEMTileSource=nr,o.RasterTileSource=Xt,o.ScaleControl=class{constructor(M){this._onMove=()=>{Ih(this._map,this._container,this.options)},this.setUnit=c=>{this.options.unit=c,Ih(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Io),M)}getDefaultPosition(){return"bottom-left"}onAdd(M){return this._map=M,this._container=g.create("div","maplibregl-ctrl maplibregl-ctrl-scale",M.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){g.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},o.ScrollZoomHandler=Xa,o.Style=sf,o.TerrainControl=class{constructor(M){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=M}onAdd(M){return this._map=M,this._container=g.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=g.create("button","maplibregl-ctrl-terrain",this._container),g.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(){g.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},o.TwoFingersTouchPitchHandler=Ah,o.TwoFingersTouchRotateHandler=Hv,o.TwoFingersTouchZoomHandler=Gv,o.TwoFingersTouchZoomRotateHandler=qv,o.VectorTileSource=Lt,o.VideoSource=Aa,o.addSourceType=(M,c)=>s._(void 0,void 0,void 0,function*(){if($t(M))throw new Error(`A source type called "${M}" already exists.`);((y,S)=>{mt[y]=S})(M,c)}),o.clearPrewarmedResources=function(){const M=Ht;M&&(M.isPreloaded()&&M.numActive()===1?(M.release(et),Ht=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()"))},o.getMaxParallelImageRequests=function(){return s.a.MAX_PARALLEL_IMAGE_REQUESTS},o.getRTLTextPluginStatus=function(){return Dn().getRTLTextPluginStatus()},o.getVersion=function(){return Qv},o.getWorkerCount=function(){return it.workerCount},o.getWorkerUrl=function(){return s.a.WORKER_URL},o.importScriptInWorkers=function(M){return rt().broadcast("IS",M)},o.prewarm=function(){st().acquire(et)},o.setMaxParallelImageRequests=function(M){s.a.MAX_PARALLEL_IMAGE_REQUESTS=M},o.setRTLTextPlugin=function(M,c){return Dn().setRTLTextPlugin(M,c)},o.setWorkerCount=function(M){it.workerCount=M},o.setWorkerUrl=function(M){s.a.WORKER_URL=M}});var a=t;return a})})(G$);var Tve=G$.exports;const nb=N4(Tve),Eve={},Cve={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-list-details"};function Ave(r,e){return P.openBlock(),P.createElementBlock("svg",Cve,e[0]||(e[0]=[P.createStaticVNode('',7)]))}const lA=fr(Eve,[["render",Ave]]),uA={pink:["#fde7e2","#feafbe","#fd58a4","#d7038e","#86007b"],blue:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],green:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],pink2:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],red:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],teal:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"]},Dve={components:{legendIcon:lA,closeIcon:uC},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:uA}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((r,e)=>r-e)},maxWidht(){var t;const r=((t=this.sizes)==null?void 0:t.length)-1;return this.calcSize(r)}},methods:{sizeClass(r){return this.resizeItem?`h-[${this.calcSize(r)}] w-[${this.calcSize(r)}] ${this.borderRadius}`:`h-[18px] w-[18px] ${this.borderRadius}`},calcSize(r){return`${10+r*2}px`},getOpacity(r){return(r+1)/this.sortedSizes.length}}},Mve={class:"w-full absolute max-w-[200px] bg-white border rounded-lg bottom-[10px] right-[50px]"},Ive={class:"flex items-center justify-between border-b border-[#0000001A] px-2"},kve={class:"w-full flex flex-col gap-[8px] px-2 py-2 max-h-[200px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent"},Lve={key:0,class:"flex flex-col w-full"},Pve={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},Rve={class:"flex flex-col gap-[6px]"},Nve={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"},Ove={key:1,class:"flex flex-col w-full"},zve={key:0,class:"text-xs font-semibold leading-[1.2] text-[#1F2937] mb-[8px]"},Bve={class:"flex flex-col gap-[6px]"},Vve={class:"flex flex-row items-center justify-start"},Fve={class:"text-xs text-[#1F2937] font-normal leading-[1.2]"};function $ve(r,e,t,n,i,a){var l,u;const o=P.resolveComponent("legendIcon"),s=P.resolveComponent("closeIcon");return P.openBlock(),P.createElementBlock(P.Fragment,null,[P.createElementVNode("div",{class:"flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]",onClick:e[0]||(e[0]=d=>i.isOpenLegend=!i.isOpenLegend)},[P.createVNode(o)]),i.isOpenLegend?(P.openBlock(),P.createBlock(P.Teleport,{key:0,to:`#wrapper-${t.mapId}`},[P.createElementVNode("div",Mve,[P.createElementVNode("div",Ive,[e[2]||(e[2]=P.createElementVNode("h3",{class:"text-[16px] font-normal text-black"},"Легенда",-1)),P.createElementVNode("button",{type:"button",class:"inline-flex items-center text-sm font-medium text-gray-500 rounded-lg gap-x-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 dark:hover:text-blue-500 dark:focus:text-blue-500",onClick:e[1]||(e[1]=d=>i.isOpenLegend=!1)},[P.createVNode(s,{class:"w-[20px]"})])]),P.createElementVNode("div",kve,[(l=t.colors)!=null&&l.length?(P.openBlock(),P.createElementBlock("div",Lve,[t.colorTitle?(P.openBlock(),P.createElementBlock("h4",Pve,P.toDisplayString(t.colorTitle),1)):P.createCommentVNode("",!0),P.createElementVNode("div",Rve,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.colors,(d,f)=>(P.openBlock(),P.createElementBlock("div",{key:f,class:"flex items-center gap-[10px]"},[d.color?(P.openBlock(),P.createElementBlock("div",{key:0,class:"w-[12px] h-[12px] rounded-full",style:P.normalizeStyle({backgroundColor:d.color})},null,4)):P.createCommentVNode("",!0),P.createElementVNode("p",Nve,P.toDisplayString(d.text||d.val),1)]))),128))])])):P.createCommentVNode("",!0),(u=t.sizes)!=null&&u.length?(P.openBlock(),P.createElementBlock("div",Ove,[r.sizeTitle?(P.openBlock(),P.createElementBlock("h4",zve,P.toDisplayString(r.sizeTitle),1)):P.createCommentVNode("",!0),P.createElementVNode("div",Bve,[a.sortedSizes.length?(P.openBlock(!0),P.createElementBlock(P.Fragment,{key:0},P.renderList(a.sortedSizes,(d,f)=>{var g,m,_,x,w;return P.openBlock(),P.createElementBlock("div",null,[P.createElementVNode("div",Vve,[P.createElementVNode("div",{class:P.normalizeClass([a.maxWidht?`w-[${a.maxWidht}]`:"","mr-[10px]"])},[P.createElementVNode("div",{class:P.normalizeClass(a.sizeClass(f)),style:P.normalizeStyle({backgroundColor:((m=(g=i.palette)==null?void 0:g[t.color])==null?void 0:m[f])||t.color})},null,6)],2),P.createElementVNode("p",Fve,P.toDisplayString(f===((_=a.sortedSizes)==null?void 0:_.length)-1?">"+d:f==((x=a.sortedSizes)==null?void 0:x.length)-1?">"+a.sortedSizes[((w=a.sortedSizes)==null?void 0:w.length)-1]:d+"-"+a.sortedSizes[f+1]),1)])])}),256)):P.createCommentVNode("",!0)])])):P.createCommentVNode("",!0)])])],8,["to"])):P.createCommentVNode("",!0)],64)}const Gve=fr(Dve,[["render",$ve]]);function U$(r,e,t){if(r!==null)for(var n,i,a,o,s,l,u,d=0,f=0,g,m=r.type,_=m==="FeatureCollection",x=m==="Feature",w=_?r.features.length:1,C=0;C{t[0]>n[0]&&(t[0]=n[0]),t[1]>n[1]&&(t[1]=n[1]),t[2]Number(t).toFixed(5)).join(", ")}}},Wve={class:"map__settings"},qve={ref:"attribution",class:"map__settings-attribution map__settings-item mt-[3px]"};function Zve(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",Wve,[P.createElementVNode("div",qve,[P.withDirectives(P.createElementVNode("div",{ref:"mouse",class:"map__settings-item",style:{"min-width":"115px"}},P.toDisplayString(a.getCoordinates),513),[[P.vShow,a.getCoordinates]])],512)])}const H$=fr(Hve,[["render",Zve]]),jve={mixins:[sA],props:{map:{type:Object,default:()=>null}},data(){return{baseLayers:[{id:"orto10",name:"Ortophoto 1:10К",url:"https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4954/2876.png"},{id:"graymap",name:"Сіра карта",url:"https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",service:"TMS",image:"https://data.gki.com.ua/api-user/rtile/positron/ua/10/601/348.png"}]}},watch:{map(r){r&&r.on("load",this.handleMapLoad)}},created(){this.baseLayers.forEach(r=>{const e={...r,basemap:!0};this.layerList.push(e)})},methods:{handleMapLoad(){this.changeBaseLayer("graymap")},isLayerInFocus(r){return r.id===this.activeLayer}}},Xve={class:"vs-map-slot-layers"},Yve=["onClick"],Kve=["src"];function Jve(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",Xve,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.baseLayers,o=>(P.openBlock(),P.createElementBlock("div",{key:o.id,class:P.normalizeClass(["vs-map-slot-layers__layer",{focused:a.isLayerInFocus(o)}]),onClick:s=>r.changeBaseLayer(o.id)},[P.createElementVNode("img",{src:o.image,class:"vs-map-slot-layers__image"},null,8,Kve)],10,Yve))),128))])}const W$=fr(jve,[["render",Jve]]),Qve={},eme={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-home"};function tme(r,e){return P.openBlock(),P.createElementBlock("svg",eme,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M5 12l-2 0l9 -9l9 9l-2 0"},null,-1),P.createElementVNode("path",{d:"M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"},null,-1),P.createElementVNode("path",{d:"M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"},null,-1)]))}const rme={props:["bbox","map"],components:{homeIcon:fr(Qve,[["render",tme]])},methods:{setBounds(){const r={type:"Feature",geometry:this==null?void 0:this.bbox},e=Uve(r);this.map.fitBounds(e)}}},nme={class:"z-100 flex justify-center items-center rounded-md w-[32px] h-[32px] cursor-pointer bg-white p-1 border-[2px]"};function ime(r,e,t,n,i,a){const o=P.resolveComponent("homeIcon");return P.openBlock(),P.createElementBlock("div",nme,[P.createVNode(o,{onClick:a.setBounds},null,8,["onClick"])])}const q$=fr(rme,[["render",ime]]),ame={},ome={class:"shrink-0 size-4",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"#9E9E9E",stroke:"#9E9E9E","stroke-width":"2","stroke-linecap":"#9E9E9E","stroke-linejoin":"#9E9E9E"};function sme(r,e){return P.openBlock(),P.createElementBlock("svg",ome,e[0]||(e[0]=[P.createElementVNode("circle",{cx:"12",cy:"12",r:"1"},null,-1),P.createElementVNode("circle",{cx:"12",cy:"5",r:"1"},null,-1),P.createElementVNode("circle",{cx:"12",cy:"19",r:"1"},null,-1)]))}const lme={components:{legendIcon:lA,menuIcon:fr(ame,[["render",sme]]),closeIcon:uC},props:["source","count","total","mapId"],data(){return{isOpenLegend:!1,palette:["#69D2E7","yellow","#FE4365"]}},methods:{calcSize(r){return r/this.maxValue*100*50/100}},computed:{maxValue(){var r,e,t,n,i,a;return((r=this.sizes)==null?void 0:r[0])>((t=this.sizes)==null?void 0:t[((e=this.sizes)==null?void 0:e.length)-1])?(n=this.sizes)==null?void 0:n[0]:(a=this.sizes)==null?void 0:a[((i=this.sizes)==null?void 0:i.length)-1]}}},ume={class:"w-full h-[calc(100%-40px)] bg-white"},cme={class:"w-full flex flex-col gap-[8px] h-[250px] overflow-auto [&::-webkit-scrollbar]:h-1.5 [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-gray-300 [&::-webkit-scrollbar-track]:bg-transparent text-xs"},hme={class:"relative min-w-full bg-white text-[12px]"},dme={class:"divide-gray-200 dark:divide-neutral-700"},fme={class:"px-2 py-1"},pme={class:"px-2 py-1"};function gme(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",ume,[P.createElementVNode("div",cme,[P.createElementVNode("table",hme,[e[0]||(e[0]=P.createElementVNode("thead",{class:"sticky top-[-1px] z-[1] bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},[P.createElementVNode("tr",null,[P.createElementVNode("th",{class:"px-2 py-1 text-start"},"Назва"),P.createElementVNode("th",{class:"px-2 py-1 text-start"},"Метрика")])],-1)),P.createElementVNode("tbody",dme,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(t.source,o=>(P.openBlock(),P.createElementBlock("tr",{key:o.id,class:"border-b cursor-pointer hover:bg-gray-100 odd:bg-gray-50"},[P.createElementVNode("td",fme,P.toDisplayString(o.title||"—"),1),P.createElementVNode("td",pme,P.toDisplayString(o.metric),1)]))),128))])])])])}const Z$=fr(lme,[["render",gme]]),vme={mixins:[Ca,sA,{components:{VsMapSetting:H$,VsMapSlotLayers:W$,VsMapLegend:Gve,VsMapGoHome:q$,VsList:Z$},data(){return{mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7"}},methods:{async createMap(){var e,t;const r={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new nb.Map({container:this.mapId,style:r,center:[31,48.5],zoom:((t=(e=this.data)==null?void 0:e.style)==null?void 0:t.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new nb.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",n=>{this.moveMouseHadler(n)}),this.map.on("mouseout",()=>{var n;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(n=this.popup)==null||n.remove()})},getPopoverTitle(r){var e,t,n,i,a;return(t=(e=this.data)==null?void 0:e.colors)!=null&&t.find(o=>o.val===r)?(a=(i=(n=this.data)==null?void 0:n.colors)==null?void 0:i.find(o=>o.val===r))==null?void 0:a.text:r},moveMouseHadler(r){var e;try{const t=this.map.queryRenderedFeatures(r.point),n=((e=t[0])==null?void 0:e.properties)||{};if(!t.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`
    ${this.getPopoverTitle((n==null?void 0:n.x)||(n==null?void 0:n.title)||(n==null?void 0:n.name))||""}
    Значення ${(n==null?void 0:n.metric)||0}
    `;const i=this.map.project(r.lngLat);this.popupElement.style.left=`${i.x}px`,this.popupElement.style.top=`${i.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}}],name:"VsMap",async mounted(){await this.getMapData(),await this.createMap()},methods:{async getMapData(){const e=await(await fetch(`/api/bi-map?widget=${this.widget}&dashboard=${this.dashboard}`)).json();this.data=e,this.$emit("update:widgetData",e),setTimeout(()=>{var t;return(t=this.map)==null?void 0:t.resize()})},async loadHandler(){const r=["#69D2E7","yellow","#FE4365"],e=this.data.colors?["match",["get","x"]].concat(this.data.colors.reduce((a,o,s)=>a.concat(o.val,(o==null?void 0:o.color)||r[s]),[])).concat(["gray"]):"blue",t=[5,7,9,11,13],n=this.data.sizes?["case"]:5;this.data.sizes&&(this.data.sizes.reverse().forEach((a,o)=>{n.push([">",["get","metric"],a]),n.push(t[o])}),n.push(5));const i={type:"circle",color:e,width:2,radius:n,stroke:"#eee"};Object.assign(i,this.data.style||{}),this.addVtileLayer({id:"bi",url:`${window.top.location.origin}/api/bi-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:i})}}},mme={class:"w-full h-full"},yme={class:"flex items-start justify-between mb-[6px] w-full"},_me={class:"text-gray-800 font-[600]"},bme=["id"],xme=["id"],wme={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"};function Sme(r,e,t,n,i,a){var d,f,g;const o=P.resolveComponent("VsMapSetting"),s=P.resolveComponent("VsMapSlotLayers"),l=P.resolveComponent("VsMapLegend"),u=P.resolveComponent("VsMapGoHome");return P.openBlock(),P.createElementBlock("div",mme,[P.createElementVNode("div",yme,[P.createElementVNode("h5",_me,P.toDisplayString(r.title),1)]),P.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${r.mapId}`},[P.createElementVNode("div",{id:r.mapId,class:"w-full flex items-end relative h-full min-h-[250px]"},null,8,xme),r.showSetting?(P.openBlock(),P.createBlock(o,{key:0,map:r.map,coordinates:r.coordinatesByMouse},null,8,["map","coordinates"])):P.createCommentVNode("",!0),P.createVNode(s,{map:r.map},null,8,["map"]),P.createElementVNode("div",wme,[P.createVNode(l,{mapId:r.mapId,colors:(d=r.data)==null?void 0:d.colors,sizes:(f=r.data)==null?void 0:f.sizes,color:r.color,resizeItem:"true"},null,8,["mapId","colors","sizes","color"]),P.createVNode(u,{map:r.map,bbox:(g=r.data)==null?void 0:g.bounds},null,8,["map","bbox"])])],8,bme)])}const Tme=Object.freeze(Object.defineProperty({__proto__:null,default:fr(vme,[["render",Sme]])},Symbol.toStringTag,{value:"Module"})),Eme={components:{legendIcon:lA,closeIcon:uC},props:{mapId:{type:String},colors:{type:Array},sizes:{type:Array,default:()=>[]},cluster:{type:[Boolean,String]},color:{type:String,default:"gray"},colorTitle:{type:String},sizesTitle:{type:String},resizeItem:{type:[Boolean,String],default:!1},changeOpacityItem:{type:[Boolean,String],default:!1}},data(){return{isOpenLegend:!1,palette:uA}},computed:{borderRadius(){return this.cluster?"rounded-sm":"rounded-full"},sortedSizes(){return[...this.sizes].sort((r,e)=>r-e)},maxWidht(){var t;const r=((t=this.sizes)==null?void 0:t.length)-1;return this.calcSize(r)}},methods:{sizeClass(r){return this.resizeItem?`h-[${this.calcSize(r)}] w-[${this.calcSize(r)}] ${this.borderRadius}`:`h-[10px] ${this.borderRadius}`},calcSize(r){return`${10+r*2}px`},getOpacity(r){return(r+1)/this.sortedSizes.length}}},Cme={key:0,class:"absolute flex items-end w-fit bottom-[10px] max-w-[80%] left-[50%] translate-x-[-50%] bg-[rgba(255,255,255,0.7)] p-[10px] rounded"},Ame={class:"w-[80px] mr-[10px]"},Dme=["title"],Mme={class:"text-[10px] mb-[2px] text-[#1F2937] font-normal leading-[1.2]"};function Ime(r,e,t,n,i,a){var o;return(o=t.sizes)!=null&&o.length?(P.openBlock(),P.createElementBlock("div",Cme,[P.createElementVNode("div",Ame,[e[0]||(e[0]=P.createElementVNode("p",{class:"text-[10px] mb-[2px] text-[#1F2937] leading-[1.2]"}," Дані відсутні ",-1)),P.createElementVNode("div",{class:P.normalizeClass([a.sizeClass(r.index),"w-full border border-gray-500"])},null,2)]),a.sortedSizes.length?(P.openBlock(!0),P.createElementBlock(P.Fragment,{key:0},P.renderList(a.sortedSizes,(s,l)=>{var u,d,f,g,m,_,x,w;return P.openBlock(),P.createElementBlock("div",{class:"w-[80px]",title:l===((u=a.sortedSizes)==null?void 0:u.length)-1?">"+s:l==((d=a.sortedSizes)==null?void 0:d.length)-1?">"+a.sortedSizes[((f=a.sortedSizes)==null?void 0:f.length)-1]:s+"-"+a.sortedSizes[l+1]},[P.createElementVNode("p",Mme,P.toDisplayString(l===((g=a.sortedSizes)==null?void 0:g.length)-1?">"+parseInt(s):l==((m=a.sortedSizes)==null?void 0:m.length)-1?">"+parseInt(a.sortedSizes[((_=a.sortedSizes)==null?void 0:_.length)-1]):parseInt(s)+"-"+parseInt(a.sortedSizes[l+1])),1),P.createElementVNode("div",{class:P.normalizeClass([a.sizeClass(l),"w-full border border-r-0 border-gray-500"]),style:P.normalizeStyle({backgroundColor:((w=(x=i.palette)==null?void 0:x[t.color])==null?void 0:w[l])||t.color})},null,6)],8,Dme)}),256)):P.createCommentVNode("",!0)])):P.createCommentVNode("",!0)}const kme=fr(Eme,[["render",Ime]]),Lme={},Pme={xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"icon icon-tabler icons-tabler-outline icon-tabler-map"};function Rme(r,e){return P.openBlock(),P.createElementBlock("svg",Pme,e[0]||(e[0]=[P.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),P.createElementVNode("path",{d:"M3 7l6 -3l6 3l6 -3v13l-6 3l-6 -3l-6 3v-13"},null,-1),P.createElementVNode("path",{d:"M9 4v13"},null,-1),P.createElementVNode("path",{d:"M15 7v13"},null,-1)]))}const Nme=fr(Lme,[["render",Rme]]),Ome={mixins:[Ca,sA],components:{VsMapSetting:H$,VsClusterLegend:kme,VsMapGoHome:q$,VsList:Z$,VsMapSlotLayers:W$,VsBar:Z0},data(){return{baseColor:"pink",kattotg:"",options:[{id:"map",text:"Карта",component:Nme},{id:"table",text:"Таблиця",component:yC},{id:"chart",text:"Віджет",component:B$}],activeTab:"map",mapId:`map-${Math.floor(Math.random()*1e3)}`,layerId:`layer${Math.floor(Math.random()*1e3)}`,map:null,hoverData:null,data:null,coordinatesByMouse:[],showSetting:!1,popup:null,color:"#69D2E7",label:"
    "}},async mounted(){await this.getMapData(),await this.createMap()},watch:{kattotg(){this.loadHandler()}},methods:{async getMapData(){const r=await _r.get(`/bi-cluster?widget=${this.widget}&dashboard=${this.dashboard}`);this.data=r.data,this.$emit("update:widgetData",this.data),setTimeout(()=>{var e;return(e=this.map)==null?void 0:e.resize()})},async loadHandler(){var n,i,a,o;this.baseColor=((n=this.data.style)==null?void 0:n.color)||"blue";const r=["case"];(o=(a=(i=this.data)==null?void 0:i.sizes)==null?void 0:a.toReversed())==null||o.forEach((s,l)=>{var u,d;r.push([">",["get","metric"],s]),r.push((d=(u=uA[this.baseColor])==null?void 0:u.toReversed())==null?void 0:d[l]),l++}),r.push("gray");const e={type:"polygon",color:r,opacity:.4};Object.assign(e,this.data.style||{}),this.map.getSource("bi")||this.addVtileLayer({id:"bi",url:`${window.location.origin}/api/bi-cluster-vtile/{z}/{x}/{y}.vmt?widget=${this.widget}&dashboard=${this.dashboard}&nocache=1`,style:e}),this.map.getLayer("highlighted")&&this.map.removeLayer("highlighted"),this.map.getSource("highlighted")&&this.map.removeSource("highlighted");const t=["case"];this.kattotg&&t.push(["==",["to-string",["get","name"]],String(this.kattotg)],"red"),t.push("transparent"),this.map.addLayer({id:"highlighted",type:"fill",source:"bi","source-layer":"bi",paint:{"fill-color":t,"fill-opacity":.6}})},async createMap(){var e,t;const r={version:8,glyphs:"https://cdn.softpro.ua/data/fonts/{fontstack}/{range}.pbf",sources:{},layers:[]};this.map=await new nb.Map({container:this.mapId,style:r,center:[31,48.5],zoom:((t=(e=this.data)==null?void 0:e.style)==null?void 0:t.zoom)||5,minZoom:3,maxZoom:20,attributionControl:!1}),this.map.addControl(new nb.NavigationControl({visualizePitch:!0})),this.map.on("load",()=>{this.loadHandler()}),this.map.on("mousemove",n=>{this.moveMouseHadler(n)}),this.map.on("mouseout",()=>{var n;this.showLegend=!1,this.showSetting=!1,this.coordinatesByMouse=0,(n=this.popup)==null||n.remove()})},moveMouseHadler(r){var e;try{const t=this.map.queryRenderedFeatures(r.point),n=((e=t[0])==null?void 0:e.properties)||{};if(!t.length){this.map.getCanvas().style.cursor="",this.popupElement&&this.popupElement.remove();return}this.map.getCanvas().style.cursor="pointer",this.popupElement&&this.popupElement.remove(),this.popupElement=document.createElement("div"),this.popupElement.className="absolute text-gray-800 border border-gray-200 rounded-lg shadow-md min-w-28",this.popupElement.style.backgroundColor="rgba(255, 255, 255, 0.7)",this.popupElement.innerHTML=`
    ${(n==null?void 0:n.x)||(n==null?void 0:n.title)||(n==null?void 0:n.name)||""}
    Значення ${(n==null?void 0:n.metric)||0}
    `;const i=this.map.project(r.lngLat);this.popupElement.style.left=`${i.x}px`,this.popupElement.style.top=`${i.y-60}px`,this.map.getContainer().appendChild(this.popupElement)}catch(t){console.error(t)}}}},zme={class:"h-full"},Bme={class:"flex items-start justify-between mb-[6px] w-full"},Vme={class:"text-gray-800 font-[600]"},Fme={class:"flex gap-2"},$me=["onClick"],Gme=["id"],Ume=["id"],Hme={class:"absolute flex flex-col right-[10px] top-[105px] gap-1"},Wme={class:"h-[calc(250px)]"};function qme(r,e,t,n,i,a){var g,m,_,x,w,C,A,L,O,V;const o=P.resolveComponent("VsMapSetting"),s=P.resolveComponent("VsMapSlotLayers"),l=P.resolveComponent("VsMapGoHome"),u=P.resolveComponent("VsClusterLegend"),d=P.resolveComponent("VsList"),f=P.resolveComponent("VsBar");return P.openBlock(),P.createElementBlock("div",zme,[P.createElementVNode("div",Bme,[P.createElementVNode("h3",Vme,P.toDisplayString(r.title),1),P.createElementVNode("div",Fme,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(i.options,F=>(P.openBlock(),P.createElementBlock("button",{class:P.normalizeClass(["p-1 text-gray-700 border rounded",[i.activeTab===(F==null?void 0:F.id)?"ring-2 ring-blue-500":""]]),onClick:$=>i.activeTab=F==null?void 0:F.id},[(P.openBlock(),P.createBlock(P.resolveDynamicComponent(F==null?void 0:F.component),{height:"16",width:"16"}))],10,$me))),256))])]),P.withDirectives(P.createElementVNode("div",{class:"relative w-full h-[calc(100%-40px)]",id:`wrapper-${i.mapId}`},[P.createElementVNode("div",{id:i.mapId,class:"h-full w-full flex items-end min-h-[250px]"},null,8,Ume),i.showSetting?(P.openBlock(),P.createBlock(o,{key:0,map:i.map,coordinates:i.coordinatesByMouse},null,8,["map","coordinates"])):P.createCommentVNode("",!0),P.createVNode(s,{map:i.map},null,8,["map"]),P.createElementVNode("div",Hme,[P.createVNode(l,{map:i.map,bbox:(g=i.data)==null?void 0:g.bounds},null,8,["map","bbox"])]),P.createVNode(u,{mapId:i.mapId,colors:(m=i.data)==null?void 0:m.colors,sizes:(_=i.data)==null?void 0:_.sizes,color:i.baseColor,changeOpacityItem:"true",cluster:"true"},null,8,["mapId","colors","sizes","color"])],8,Gme),[[P.vShow,i.activeTab=="map"]]),P.withDirectives(P.createVNode(d,{mapId:i.mapId,source:(x=i.data)==null?void 0:x.rows,total:((w=i.data)==null?void 0:w.total)||0,count:((C=i.data)==null?void 0:C.count)||0,onKattotg:e[0]||(e[0]=F=>i.kattotg=F)},null,8,["mapId","source","total","count"]),[[P.vShow,i.activeTab=="table"]]),P.withDirectives(P.createElementVNode("div",Wme,[(L=(A=i.data)==null?void 0:A.rows)!=null&&L.length?(P.openBlock(),P.createBlock(f,{key:0,source:(V=(O=i.data)==null?void 0:O.rows)==null?void 0:V.map(F=>({title:F==null?void 0:F.title,metric:F==null?void 0:F.metric}))},null,8,["source"])):P.createCommentVNode("",!0)],512),[[P.vShow,i.activeTab=="chart"]])])}const Zme=Object.freeze(Object.defineProperty({__proto__:null,default:fr(Ome,[["render",qme]])},Symbol.toStringTag,{value:"Module"})),jme={name:"VsTable",mixins:[Ca],data(){return{values:null,xs:null,products:null}},async mounted(){await this.getData(),this.prepareData()},methods:{onChangedData(){try{this.sourceData&&this.prepareData()}catch{}},prepareData(){try{const r=Array.from(new Set(this.sourceData.map(e=>e[this.dimensions[0]])));this.dimensions[0].includes("date")?this.xs=r.map(e=>rs(e)):this.xs=[...r],this.products=this.dimensions.filter((e,t)=>t!=0),this.values=this.products.map((e,t)=>({name:e,data:this.sourceData.filter(n=>parseFloat(n[e])).map(n=>An(parseFloat(n[e])))}))}catch(r){console.error(r)}}}},Xme={class:"flex flex-col h-full pt-[16px] pb-[16px] space-y-4 rounded-xl"},Yme={class:"overflow-auto h-full [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300"},Kme={class:"inline-block min-w-full align-middle"},Jme={class:"relative min-w-full divide-y divide-gray-200 text-[12px]"},Qme={class:"sticky top-0 bg-white w-full after:absolute after:content-[''] after:block after:w-full after:h-px after:bg-stone-200"},eye={class:"space-x-2"},tye={scope:"col",class:"xl:min-w-[120px] min-w-48"},rye={class:"flex items-center px-1 py-3 font-medium text-gray-800 text-start gap-x-1"},nye={class:"divide-y divide-gray-200"},iye={class:"text-gray-600"};function aye(r,e,t,n,i,a){return P.openBlock(),P.createElementBlock("div",Xme,[P.createElementVNode("div",Yme,[P.createElementVNode("div",Kme,[P.createElementVNode("table",Jme,[P.createElementVNode("thead",Qme,[P.createElementVNode("tr",eye,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.dimensions,o=>(P.openBlock(),P.createElementBlock("th",tye,[P.createElementVNode("div",rye,P.toDisplayString(o),1)]))),256))])]),P.createElementVNode("tbody",nye,[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.sourceData,(o,s)=>(P.openBlock(),P.createElementBlock("tr",{key:s},[(P.openBlock(!0),P.createElementBlock(P.Fragment,null,P.renderList(r.dimensions,(l,u)=>(P.openBlock(),P.createElementBlock("td",{key:u,class:"py-3 whitespace-nowrap"},[P.createElementVNode("span",iye,P.toDisplayString(o==null?void 0:o[l]),1)]))),128))]))),128))])])])])])}const oye=Object.freeze(Object.defineProperty({__proto__:null,default:fr(jme,[["render",aye]])},Symbol.toStringTag,{value:"Module"}));return F$});