@opengis/admin 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/add-page-D6D_vCdT.js +94 -0
  2. package/dist/{admin-interface-vPkHXzQK.js → admin-interface-BpAoXL6Y.js} +236 -208
  3. package/dist/{admin-view-BYF4ITZY.js → admin-view-Ctnb3YHc.js} +10 -10
  4. package/dist/admin.js +1 -1
  5. package/dist/admin.umd.cjs +618 -25
  6. package/dist/card-page-CDUWky8v.js +133 -0
  7. package/dist/{card-view-CjZRvfqy.js → card-view-BdtKFM_Q.js} +1 -1
  8. package/dist/edit-page-Bl7TSfk5.js +104 -0
  9. package/dist/import-file-bAV0TNST.js +29762 -0
  10. package/dist/style.css +1 -1
  11. package/package.json +18 -5
  12. package/plugin.js +1 -1
  13. package/server/plugins/vite.js +13 -8
  14. package/server/routes/data/controllers/cardData.js +1 -1
  15. package/server/routes/data/controllers/funcs/getFilterSQL/index.js +82 -0
  16. package/server/routes/data/controllers/funcs/getFilterSQL/util/formatValue.js +142 -0
  17. package/server/routes/data/controllers/funcs/getFilterSQL/util/getCustomQuery.js +13 -0
  18. package/server/routes/data/controllers/funcs/getFilterSQL/util/getFilterQuery.js +67 -0
  19. package/server/routes/data/controllers/funcs/getFilterSQL/util/getOptimizedQuery.js +12 -0
  20. package/server/routes/data/controllers/funcs/getFilterSQL/util/getTableSql.js +34 -0
  21. package/server/routes/data/controllers/tableData.js +12 -31
  22. package/server/routes/data/controllers/tableFilter.js +1 -1
  23. package/server/routes/data/controllers/utils/assignTokens.js +31 -0
  24. package/server/routes/data/index.mjs +1 -1
  25. package/server/routes/templates/controllers/getTemplate.js +2 -4
  26. package/server/templates/cls/itree.recrzone_category.json +74 -0
  27. package/dist/add-page-C-msiPrU.js +0 -64
  28. package/dist/card-page-HOwuHNjV.js +0 -49
  29. package/dist/edit-page-7yrRusn4.js +0 -58
  30. package/dist/form-TrZSpRSC.js +0 -38
  31. package/dist/import-file-DPHo57R5.js +0 -3726
  32. package/server/routes/data/controllers/metaFormat/getSelectVal.js +0 -19
  33. package/server/routes/data/controllers/metaFormat/index.js +0 -29
  34. package/server/routes/templates/funcs/addTempateFolder.js +0 -47
  35. package/server/routes/templates/funcs/getTemplate.js +0 -70
  36. package/server/routes/templates/funcs/getTemplatePath.js +0 -39
  37. package/server/routes/templates/funcs/loadTemplate.js +0 -1
  38. package/server/routes/templates/funcs/loadTemplateDir.js +0 -1
  39. package/server/routes/templates/funcs/loadTemplatePath.js +0 -1
  40. package/server/templates/interface/management.user_group.html +0 -1
  41. package/server/templates/interface/management.user_group.json +0 -10
  42. package/server/templates/interface/management.users.html +0 -1
  43. package/server/templates/interface/management.users.json +0 -10
  44. package/server/templates/map/dgm_level_line.xml +0 -52
  45. package/server/templates/pt/admin-menu-pt.html +0 -108
  46. package/server/templates/pt/management.user_group.table.pt.html +0 -127
  47. package/server/templates/pt/management.users.table.pt.html +0 -130
  48. package/server/templates/pt/table-standard-pt.html +0 -202
@@ -1,36 +1,629 @@
1
- (function(s,oe){typeof exports=="object"&&typeof module<"u"?module.exports=oe(require("vue")):typeof define=="function"&&define.amd?define(["vue"],oe):(s=typeof globalThis<"u"?globalThis:s||self,s.admin=oe(s.Vue))})(this,function(s){"use strict";function oe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Kn}=Object.prototype,{getPrototypeOf:De}=Object,xe=(e=>t=>{const n=Kn.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),z=e=>(e=e.toLowerCase(),t=>xe(t)===e),ke=e=>t=>typeof t===e,{isArray:se}=Array,fe=ke("undefined");function Wn(e){return e!==null&&!fe(e)&&e.constructor!==null&&!fe(e.constructor)&&H(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const gt=z("ArrayBuffer");function Gn(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&gt(e.buffer),t}const Jn=ke("string"),H=ke("function"),bt=ke("number"),Ce=e=>e!==null&&typeof e=="object",Zn=e=>e===!0||e===!1,Ne=e=>{if(xe(e)!=="object")return!1;const t=De(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},Qn=z("Date"),Xn=z("File"),Yn=z("Blob"),er=z("FileList"),tr=e=>Ce(e)&&H(e.pipe),nr=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||H(e.append)&&((t=xe(e))==="formdata"||t==="object"&&H(e.toString)&&e.toString()==="[object FormData]"))},rr=z("URLSearchParams"),[or,sr,ar,ir]=["ReadableStream","Request","Response","Headers"].map(z),lr=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pe(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,o;if(typeof e!="object"&&(e=[e]),se(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{const a=n?Object.getOwnPropertyNames(e):Object.keys(e),i=a.length;let l;for(r=0;r<i;r++)l=a[r],t.call(null,e[l],l,e)}}function yt(e,t){t=t.toLowerCase();const n=Object.keys(e);let r=n.length,o;for(;r-- >0;)if(o=n[r],t===o.toLowerCase())return o;return null}const Y=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,wt=e=>!fe(e)&&e!==Y;function Ie(){const{caseless:e}=wt(this)&&this||{},t={},n=(r,o)=>{const a=e&&yt(t,o)||o;Ne(t[a])&&Ne(r)?t[a]=Ie(t[a],r):Ne(r)?t[a]=Ie({},r):se(r)?t[a]=r.slice():t[a]=r};for(let r=0,o=arguments.length;r<o;r++)arguments[r]&&pe(arguments[r],n);return t}const cr=(e,t,n,{allOwnKeys:r}={})=>(pe(t,(o,a)=>{n&&H(o)?e[a]=oe(o,n):e[a]=o},{allOwnKeys:r}),e),ur=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),dr=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},fr=(e,t,n,r)=>{let o,a,i;const l={};if(t=t||{},e==null)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],(!r||r(i,e,t))&&!l[i]&&(t[i]=e[i],l[i]=!0);e=n!==!1&&De(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},pr=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},hr=e=>{if(!e)return null;if(se(e))return e;let t=e.length;if(!bt(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},mr=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&De(Uint8Array)),gr=(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let o;for(;(o=r.next())&&!o.done;){const a=o.value;t.call(e,a[0],a[1])}},br=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},yr=z("HTMLFormElement"),wr=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,o){return r.toUpperCase()+o}),Et=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Er=z("RegExp"),_t=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};pe(n,(o,a)=>{let i;(i=t(o,a,e))!==!1&&(r[a]=i||o)}),Object.defineProperties(e,r)},_r=e=>{_t(e,(t,n)=>{if(H(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(H(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},xr=(e,t)=>{const n={},r=o=>{o.forEach(a=>{n[a]=!0})};return se(e)?r(e):r(String(e).split(t)),n},kr=()=>{},Cr=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t,Me="abcdefghijklmnopqrstuvwxyz",xt="0123456789",kt={DIGIT:xt,ALPHA:Me,ALPHA_DIGIT:Me+Me.toUpperCase()+xt},Nr=(e=16,t=kt.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n};function Sr(e){return!!(e&&H(e.append)&&e[Symbol.toStringTag]==="FormData"&&e[Symbol.iterator])}const Rr=e=>{const t=new Array(10),n=(r,o)=>{if(Ce(r)){if(t.indexOf(r)>=0)return;if(!("toJSON"in r)){t[o]=r;const a=se(r)?[]:{};return pe(r,(i,l)=>{const u=n(i,o+1);!fe(u)&&(a[l]=u)}),t[o]=void 0,a}}return r};return n(e,0)},vr=z("AsyncFunction"),Vr=e=>e&&(Ce(e)||H(e))&&H(e.then)&&H(e.catch),Ct=((e,t)=>e?setImmediate:t?((n,r)=>(Y.addEventListener("message",({source:o,data:a})=>{o===Y&&a===n&&r.length&&r.shift()()},!1),o=>{r.push(o),Y.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",H(Y.postMessage)),$r=typeof queueMicrotask<"u"?queueMicrotask.bind(Y):typeof process<"u"&&process.nextTick||Ct,h={isArray:se,isArrayBuffer:gt,isBuffer:Wn,isFormData:nr,isArrayBufferView:Gn,isString:Jn,isNumber:bt,isBoolean:Zn,isObject:Ce,isPlainObject:Ne,isReadableStream:or,isRequest:sr,isResponse:ar,isHeaders:ir,isUndefined:fe,isDate:Qn,isFile:Xn,isBlob:Yn,isRegExp:Er,isFunction:H,isStream:tr,isURLSearchParams:rr,isTypedArray:mr,isFileList:er,forEach:pe,merge:Ie,extend:cr,trim:lr,stripBOM:ur,inherits:dr,toFlatObject:fr,kindOf:xe,kindOfTest:z,endsWith:pr,toArray:hr,forEachEntry:gr,matchAll:br,isHTMLForm:yr,hasOwnProperty:Et,hasOwnProp:Et,reduceDescriptors:_t,freezeMethods:_r,toObjectSet:xr,toCamelCase:wr,noop:kr,toFiniteNumber:Cr,findKey:yt,global:Y,isContextDefined:wt,ALPHABET:kt,generateString:Nr,isSpecCompliantForm:Sr,toJSONObject:Rr,isAsyncFn:vr,isThenable:Vr,setImmediate:Ct,asap:$r};function R(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}h.inherits(R,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:h.toJSONObject(this.config),code:this.code,status:this.status}}});const Nt=R.prototype,St={};["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(e=>{St[e]={value:e}}),Object.defineProperties(R,St),Object.defineProperty(Nt,"isAxiosError",{value:!0}),R.from=(e,t,n,r,o,a)=>{const i=Object.create(Nt);return h.toFlatObject(e,i,function(u){return u!==Error.prototype},l=>l!=="isAxiosError"),R.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};const Or=null;function Le(e){return h.isPlainObject(e)||h.isArray(e)}function Rt(e){return h.endsWith(e,"[]")?e.slice(0,-2):e}function vt(e,t,n){return e?e.concat(t).map(function(o,a){return o=Rt(o),!n&&a?"["+o+"]":o}).join(n?".":""):t}function Tr(e){return h.isArray(e)&&!e.some(Le)}const Pr=h.toFlatObject(h,{},null,function(t){return/^is[A-Z]/.test(t)});function Se(e,t,n){if(!h.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=h.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(y,w){return!h.isUndefined(w[y])});const r=n.metaTokens,o=n.visitor||c,a=n.dots,i=n.indexes,u=(n.Blob||typeof Blob<"u"&&Blob)&&h.isSpecCompliantForm(t);if(!h.isFunction(o))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(h.isDate(b))return b.toISOString();if(!u&&h.isBlob(b))throw new R("Blob is not supported. Use a Buffer instead.");return h.isArrayBuffer(b)||h.isTypedArray(b)?u&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function c(b,y,w){let N=b;if(b&&!w&&typeof b=="object"){if(h.endsWith(y,"{}"))y=r?y:y.slice(0,-2),b=JSON.stringify(b);else if(h.isArray(b)&&Tr(b)||(h.isFileList(b)||h.endsWith(y,"[]"))&&(N=h.toArray(b)))return y=Rt(y),N.forEach(function(k,D){!(h.isUndefined(k)||k===null)&&t.append(i===!0?vt([y],D,a):i===null?y:y+"[]",f(k))}),!1}return Le(b)?!0:(t.append(vt(w,y,a),f(b)),!1)}const d=[],p=Object.assign(Pr,{defaultVisitor:c,convertValue:f,isVisitable:Le});function m(b,y){if(!h.isUndefined(b)){if(d.indexOf(b)!==-1)throw Error("Circular reference detected in "+y.join("."));d.push(b),h.forEach(b,function(N,x){(!(h.isUndefined(N)||N===null)&&o.call(t,N,h.isString(x)?x.trim():x,y,p))===!0&&m(N,y?y.concat(x):[x])}),d.pop()}}if(!h.isObject(e))throw new TypeError("data must be an object");return m(e),t}function Vt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function je(e,t){this._pairs=[],e&&Se(e,this,t)}const $t=je.prototype;$t.append=function(t,n){this._pairs.push([t,n])},$t.toString=function(t){const n=t?function(r){return t.call(this,r,Vt)}:Vt;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};function Ar(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Ot(e,t,n){if(!t)return e;const r=n&&n.encode||Ar,o=n&&n.serialize;let a;if(o?a=o(t,n):a=h.isURLSearchParams(t)?t.toString():new je(t,n).toString(r),a){const i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class Tt{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){h.forEach(this.handlers,function(r){r!==null&&t(r)})}}const Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Br={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:je,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},Fe=typeof window<"u"&&typeof document<"u",Ue=typeof navigator=="object"&&navigator||void 0,Dr=Fe&&(!Ue||["ReactNative","NativeScript","NS"].indexOf(Ue.product)<0),Ir=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Mr=Fe&&window.location.href||"http://localhost",F={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Fe,hasStandardBrowserEnv:Dr,hasStandardBrowserWebWorkerEnv:Ir,navigator:Ue,origin:Mr},Symbol.toStringTag,{value:"Module"})),...Br};function Lr(e,t){return Se(e,new F.classes.URLSearchParams,Object.assign({visitor:function(n,r,o,a){return F.isNode&&h.isBuffer(n)?(this.append(r,n.toString("base64")),!1):a.defaultVisitor.apply(this,arguments)}},t))}function jr(e){return h.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function Fr(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}function At(e){function t(n,r,o,a){let i=n[a++];if(i==="__proto__")return!0;const l=Number.isFinite(+i),u=a>=n.length;return i=!i&&h.isArray(o)?o.length:i,u?(h.hasOwnProp(o,i)?o[i]=[o[i],r]:o[i]=r,!l):((!o[i]||!h.isObject(o[i]))&&(o[i]=[]),t(n,r,o[i],a)&&h.isArray(o[i])&&(o[i]=Fr(o[i])),!l)}if(h.isFormData(e)&&h.isFunction(e.entries)){const n={};return h.forEachEntry(e,(r,o)=>{t(jr(r),o,n,0)}),n}return null}function Ur(e,t,n){if(h.isString(e))try{return(t||JSON.parse)(e),h.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const he={transitional:Pt,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",o=r.indexOf("application/json")>-1,a=h.isObject(t);if(a&&h.isHTMLForm(t)&&(t=new FormData(t)),h.isFormData(t))return o?JSON.stringify(At(t)):t;if(h.isArrayBuffer(t)||h.isBuffer(t)||h.isStream(t)||h.isFile(t)||h.isBlob(t)||h.isReadableStream(t))return t;if(h.isArrayBufferView(t))return t.buffer;if(h.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let l;if(a){if(r.indexOf("application/x-www-form-urlencoded")>-1)return Lr(t,this.formSerializer).toString();if((l=h.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=this.env&&this.env.FormData;return Se(l?{"files[]":t}:t,u&&new u,this.formSerializer)}}return a||o?(n.setContentType("application/json",!1),Ur(t)):t}],transformResponse:[function(t){const n=this.transitional||he.transitional,r=n&&n.forcedJSONParsing,o=this.responseType==="json";if(h.isResponse(t)||h.isReadableStream(t))return t;if(t&&h.isString(t)&&(r&&!this.responseType||o)){const i=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t)}catch(l){if(i)throw l.name==="SyntaxError"?R.from(l,R.ERR_BAD_RESPONSE,this,null,this.response):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:F.classes.FormData,Blob:F.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};h.forEach(["delete","get","head","post","put","patch"],e=>{he.headers[e]={}});const Hr=h.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"]),qr=e=>{const t={};let n,r,o;return e&&e.split(`
2
- `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&Hr[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},Bt=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function Re(e){return e===!1||e==null?e:h.isArray(e)?e.map(Re):String(e)}function zr(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Kr=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function He(e,t,n,r,o){if(h.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!h.isString(t)){if(h.isString(r))return t.indexOf(r)!==-1;if(h.isRegExp(r))return r.test(t)}}function Wr(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Gr(e,t){const n=h.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,a,i){return this[r].call(this,t,o,a,i)},configurable:!0})})}class U{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function a(l,u,f){const c=me(u);if(!c)throw new Error("header name must be a non-empty string");const d=h.findKey(o,c);(!d||o[d]===void 0||f===!0||f===void 0&&o[d]!==!1)&&(o[d||u]=Re(l))}const i=(l,u)=>h.forEach(l,(f,c)=>a(f,c,u));if(h.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if(h.isString(t)&&(t=t.trim())&&!Kr(t))i(qr(t),n);else if(h.isHeaders(t))for(const[l,u]of t.entries())a(u,l,r);else t!=null&&a(n,t,r);return this}get(t,n){if(t=me(t),t){const r=h.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return zr(o);if(h.isFunction(n))return n.call(this,o,r);if(h.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=me(t),t){const r=h.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||He(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function a(i){if(i=me(i),i){const l=h.findKey(r,i);l&&(!n||He(r,r[l],l,n))&&(delete r[l],o=!0)}}return h.isArray(t)?t.forEach(a):a(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const a=n[r];(!t||He(this,this[a],a,t,!0))&&(delete this[a],o=!0)}return o}normalize(t){const n=this,r={};return h.forEach(this,(o,a)=>{const i=h.findKey(r,a);if(i){n[i]=Re(o),delete n[a];return}const l=t?Wr(a):String(a).trim();l!==a&&delete n[a],n[l]=Re(o),r[l]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return h.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&h.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
3
- `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[Bt]=this[Bt]={accessors:{}}).accessors,o=this.prototype;function a(i){const l=me(i);r[l]||(Gr(o,i),r[l]=!0)}return h.isArray(t)?t.forEach(a):a(t),this}}U.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),h.reduceDescriptors(U.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),h.freezeMethods(U);function qe(e,t){const n=this||he,r=t||n,o=U.from(r.headers);let a=r.data;return h.forEach(e,function(l){a=l.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function Dt(e){return!!(e&&e.__CANCEL__)}function ae(e,t,n){R.call(this,e??"canceled",R.ERR_CANCELED,t,n),this.name="CanceledError"}h.inherits(ae,R,{__CANCEL__:!0});function It(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new R("Request failed with status code "+n.status,[R.ERR_BAD_REQUEST,R.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function Jr(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function Zr(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,a=0,i;return t=t!==void 0?t:1e3,function(u){const f=Date.now(),c=r[a];i||(i=f),n[o]=u,r[o]=f;let d=a,p=0;for(;d!==o;)p+=n[d++],d=d%e;if(o=(o+1)%e,o===a&&(a=(a+1)%e),f-i<t)return;const m=c&&f-c;return m?Math.round(p*1e3/m):void 0}}function Qr(e,t){let n=0,r=1e3/t,o,a;const i=(f,c=Date.now())=>{n=c,o=null,a&&(clearTimeout(a),a=null),e.apply(null,f)};return[(...f)=>{const c=Date.now(),d=c-n;d>=r?i(f,c):(o=f,a||(a=setTimeout(()=>{a=null,i(o)},r-d)))},()=>o&&i(o)]}const ve=(e,t,n=3)=>{let r=0;const o=Zr(50,250);return Qr(a=>{const i=a.loaded,l=a.lengthComputable?a.total:void 0,u=i-r,f=o(u),c=i<=l;r=i;const d={loaded:i,total:l,progress:l?i/l:void 0,bytes:u,rate:f||void 0,estimated:f&&l&&c?(l-i)/f:void 0,event:a,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(d)},n)},Mt=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Lt=e=>(...t)=>h.asap(()=>e(...t)),Xr=F.hasStandardBrowserEnv?function(){const t=F.navigator&&/(msie|trident)/i.test(F.navigator.userAgent),n=document.createElement("a");let r;function o(a){let i=a;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const l=h.isString(i)?o(i):i;return l.protocol===r.protocol&&l.host===r.host}}():function(){return function(){return!0}}(),Yr=F.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];h.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),h.isString(r)&&i.push("path="+r),h.isString(o)&&i.push("domain="+o),a===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function eo(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function to(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function jt(e,t){return e&&!eo(t)?to(e,t):t}const Ft=e=>e instanceof U?{...e}:e;function ee(e,t){t=t||{};const n={};function r(f,c,d){return h.isPlainObject(f)&&h.isPlainObject(c)?h.merge.call({caseless:d},f,c):h.isPlainObject(c)?h.merge({},c):h.isArray(c)?c.slice():c}function o(f,c,d){if(h.isUndefined(c)){if(!h.isUndefined(f))return r(void 0,f,d)}else return r(f,c,d)}function a(f,c){if(!h.isUndefined(c))return r(void 0,c)}function i(f,c){if(h.isUndefined(c)){if(!h.isUndefined(f))return r(void 0,f)}else return r(void 0,c)}function l(f,c,d){if(d in t)return r(f,c);if(d in e)return r(void 0,f)}const u={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:l,headers:(f,c)=>o(Ft(f),Ft(c),!0)};return h.forEach(Object.keys(Object.assign({},e,t)),function(c){const d=u[c]||o,p=d(e[c],t[c],c);h.isUndefined(p)&&d!==l||(n[c]=p)}),n}const Ut=e=>{const t=ee({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:a,headers:i,auth:l}=t;t.headers=i=U.from(i),t.url=Ot(jt(t.baseURL,t.url),e.params,e.paramsSerializer),l&&i.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let u;if(h.isFormData(n)){if(F.hasStandardBrowserEnv||F.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((u=i.getContentType())!==!1){const[f,...c]=u?u.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([f||"multipart/form-data",...c].join("; "))}}if(F.hasStandardBrowserEnv&&(r&&h.isFunction(r)&&(r=r(t)),r||r!==!1&&Xr(t.url))){const f=o&&a&&Yr.read(a);f&&i.set(o,f)}return t},no=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=Ut(e);let a=o.data;const i=U.from(o.headers).normalize();let{responseType:l,onUploadProgress:u,onDownloadProgress:f}=o,c,d,p,m,b;function y(){m&&m(),b&&b(),o.cancelToken&&o.cancelToken.unsubscribe(c),o.signal&&o.signal.removeEventListener("abort",c)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function N(){if(!w)return;const k=U.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),S={data:!l||l==="text"||l==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:k,config:e,request:w};It(function(P){n(P),y()},function(P){r(P),y()},S),w=null}"onloadend"in w?w.onloadend=N:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(N)},w.onabort=function(){w&&(r(new R("Request aborted",R.ECONNABORTED,e,w)),w=null)},w.onerror=function(){r(new R("Network Error",R.ERR_NETWORK,e,w)),w=null},w.ontimeout=function(){let D=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const S=o.transitional||Pt;o.timeoutErrorMessage&&(D=o.timeoutErrorMessage),r(new R(D,S.clarifyTimeoutError?R.ETIMEDOUT:R.ECONNABORTED,e,w)),w=null},a===void 0&&i.setContentType(null),"setRequestHeader"in w&&h.forEach(i.toJSON(),function(D,S){w.setRequestHeader(S,D)}),h.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),l&&l!=="json"&&(w.responseType=o.responseType),f&&([p,b]=ve(f,!0),w.addEventListener("progress",p)),u&&w.upload&&([d,m]=ve(u),w.upload.addEventListener("progress",d),w.upload.addEventListener("loadend",m)),(o.cancelToken||o.signal)&&(c=k=>{w&&(r(!k||k.type?new ae(null,e,w):k),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(c),o.signal&&(o.signal.aborted?c():o.signal.addEventListener("abort",c)));const x=Jr(o.url);if(x&&F.protocols.indexOf(x)===-1){r(new R("Unsupported protocol "+x+":",R.ERR_BAD_REQUEST,e));return}w.send(a||null)})},ro=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const a=function(f){if(!o){o=!0,l();const c=f instanceof Error?f:this.reason;r.abort(c instanceof R?c:new ae(c instanceof Error?c.message:c))}};let i=t&&setTimeout(()=>{i=null,a(new R(`timeout ${t} of ms exceeded`,R.ETIMEDOUT))},t);const l=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(a):f.removeEventListener("abort",a)}),e=null)};e.forEach(f=>f.addEventListener("abort",a));const{signal:u}=r;return u.unsubscribe=()=>h.asap(l),u}},oo=function*(e,t){let n=e.byteLength;if(!t||n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},so=async function*(e,t){for await(const n of ao(e))yield*oo(n,t)},ao=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ht=(e,t,n,r)=>{const o=so(e,t);let a=0,i,l=u=>{i||(i=!0,r&&r(u))};return new ReadableStream({async pull(u){try{const{done:f,value:c}=await o.next();if(f){l(),u.close();return}let d=c.byteLength;if(n){let p=a+=d;n(p)}u.enqueue(new Uint8Array(c))}catch(f){throw l(f),f}},cancel(u){return l(u),o.return()}},{highWaterMark:2})},Ve=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",qt=Ve&&typeof ReadableStream=="function",io=Ve&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),zt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},lo=qt&&zt(()=>{let e=!1;const t=new Request(F.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),Kt=64*1024,ze=qt&&zt(()=>h.isReadableStream(new Response("").body)),$e={stream:ze&&(e=>e.body)};Ve&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!$e[t]&&($e[t]=h.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new R(`Response type '${t}' is not supported`,R.ERR_NOT_SUPPORT,r)})})})(new Response);const co=async e=>{if(e==null)return 0;if(h.isBlob(e))return e.size;if(h.isSpecCompliantForm(e))return(await new Request(F.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(h.isArrayBufferView(e)||h.isArrayBuffer(e))return e.byteLength;if(h.isURLSearchParams(e)&&(e=e+""),h.isString(e))return(await io(e)).byteLength},uo=async(e,t)=>{const n=h.toFiniteNumber(e.getContentLength());return n??co(t)},Ke={http:Or,xhr:no,fetch:Ve&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:a,timeout:i,onDownloadProgress:l,onUploadProgress:u,responseType:f,headers:c,withCredentials:d="same-origin",fetchOptions:p}=Ut(e);f=f?(f+"").toLowerCase():"text";let m=ro([o,a&&a.toAbortSignal()],i),b;const y=m&&m.unsubscribe&&(()=>{m.unsubscribe()});let w;try{if(u&&lo&&n!=="get"&&n!=="head"&&(w=await uo(c,r))!==0){let S=new Request(t,{method:"POST",body:r,duplex:"half"}),I;if(h.isFormData(r)&&(I=S.headers.get("content-type"))&&c.setContentType(I),S.body){const[P,ne]=Mt(w,ve(Lt(u)));r=Ht(S.body,Kt,P,ne)}}h.isString(d)||(d=d?"include":"omit");const N="credentials"in Request.prototype;b=new Request(t,{...p,signal:m,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:N?d:void 0});let x=await fetch(b);const k=ze&&(f==="stream"||f==="response");if(ze&&(l||k&&y)){const S={};["status","statusText","headers"].forEach(ue=>{S[ue]=x[ue]});const I=h.toFiniteNumber(x.headers.get("content-length")),[P,ne]=l&&Mt(I,ve(Lt(l),!0))||[];x=new Response(Ht(x.body,Kt,P,()=>{ne&&ne(),y&&y()}),S)}f=f||"text";let D=await $e[h.findKey($e,f)||"text"](x,e);return!k&&y&&y(),await new Promise((S,I)=>{It(S,I,{data:D,headers:U.from(x.headers),status:x.status,statusText:x.statusText,config:e,request:b})})}catch(N){throw y&&y(),N&&N.name==="TypeError"&&/fetch/i.test(N.message)?Object.assign(new R("Network Error",R.ERR_NETWORK,e,b),{cause:N.cause||N}):R.from(N,N&&N.code,e,b)}})};h.forEach(Ke,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wt=e=>`- ${e}`,fo=e=>h.isFunction(e)||e===null||e===!1,Gt={getAdapter:e=>{e=h.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){n=e[a];let i;if(r=n,!fo(n)&&(r=Ke[(i=String(n)).toLowerCase()],r===void 0))throw new R(`Unknown adapter '${i}'`);if(r)break;o[i||"#"+a]=r}if(!r){const a=Object.entries(o).map(([l,u])=>`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let i=t?a.length>1?`since :
4
- `+a.map(Wt).join(`
5
- `):" "+Wt(a[0]):"as no adapter specified";throw new R("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:Ke};function We(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new ae(null,e)}function Jt(e){return We(e),e.headers=U.from(e.headers),e.data=qe.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Gt.getAdapter(e.adapter||he.adapter)(e).then(function(r){return We(e),r.data=qe.call(e,e.transformResponse,r),r.headers=U.from(r.headers),r},function(r){return Dt(r)||(We(e),r&&r.response&&(r.response.data=qe.call(e,e.transformResponse,r.response),r.response.headers=U.from(r.response.headers))),Promise.reject(r)})}const Zt="1.7.7",Ge={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ge[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Qt={};Ge.transitional=function(t,n,r){function o(a,i){return"[Axios v"+Zt+"] Transitional option '"+a+"'"+i+(r?". "+r:"")}return(a,i,l)=>{if(t===!1)throw new R(o(i," has been removed"+(n?" in "+n:"")),R.ERR_DEPRECATED);return n&&!Qt[i]&&(Qt[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(a,i,l):!0}};function po(e,t,n){if(typeof e!="object")throw new R("options must be an object",R.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const l=e[a],u=l===void 0||i(l,a,e);if(u!==!0)throw new R("option "+a+" must be "+u,R.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new R("Unknown option "+a,R.ERR_BAD_OPTION)}}const Je={assertOptions:po,validators:Ge},J=Je.validators;class te{constructor(t){this.defaults=t,this.interceptors={request:new Tt,response:new Tt}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const a=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?a&&!String(r.stack).endsWith(a.replace(/^.+\n.+\n/,""))&&(r.stack+=`
6
- `+a):r.stack=a}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ee(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:a}=n;r!==void 0&&Je.assertOptions(r,{silentJSONParsing:J.transitional(J.boolean),forcedJSONParsing:J.transitional(J.boolean),clarifyTimeoutError:J.transitional(J.boolean)},!1),o!=null&&(h.isFunction(o)?n.paramsSerializer={serialize:o}:Je.assertOptions(o,{encode:J.function,serialize:J.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=a&&h.merge(a.common,a[n.method]);a&&h.forEach(["delete","get","head","post","put","patch","common"],b=>{delete a[b]}),n.headers=U.concat(i,a);const l=[];let u=!0;this.interceptors.request.forEach(function(y){typeof y.runWhen=="function"&&y.runWhen(n)===!1||(u=u&&y.synchronous,l.unshift(y.fulfilled,y.rejected))});const f=[];this.interceptors.response.forEach(function(y){f.push(y.fulfilled,y.rejected)});let c,d=0,p;if(!u){const b=[Jt.bind(this),void 0];for(b.unshift.apply(b,l),b.push.apply(b,f),p=b.length,c=Promise.resolve(n);d<p;)c=c.then(b[d++],b[d++]);return c}p=l.length;let m=n;for(d=0;d<p;){const b=l[d++],y=l[d++];try{m=b(m)}catch(w){y.call(this,w);break}}try{c=Jt.call(this,m)}catch(b){return Promise.reject(b)}for(d=0,p=f.length;d<p;)c=c.then(f[d++],f[d++]);return c}getUri(t){t=ee(this.defaults,t);const n=jt(t.baseURL,t.url);return Ot(n,t.params,t.paramsSerializer)}}h.forEach(["delete","get","head","options"],function(t){te.prototype[t]=function(n,r){return this.request(ee(r||{},{method:t,url:n,data:(r||{}).data}))}}),h.forEach(["post","put","patch"],function(t){function n(r){return function(a,i,l){return this.request(ee(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:a,data:i}))}}te.prototype[t]=n(),te.prototype[t+"Form"]=n(!0)});class Ze{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(a){n=a});const r=this;this.promise.then(o=>{if(!r._listeners)return;let a=r._listeners.length;for(;a-- >0;)r._listeners[a](o);r._listeners=null}),this.promise.then=o=>{let a;const i=new Promise(l=>{r.subscribe(l),a=l}).then(o);return i.cancel=function(){r.unsubscribe(a)},i},t(function(a,i,l){r.reason||(r.reason=new ae(a,i,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Ze(function(o){t=o}),cancel:t}}}function ho(e){return function(n){return e.apply(null,n)}}function mo(e){return h.isObject(e)&&e.isAxiosError===!0}const Qe={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(Qe).forEach(([e,t])=>{Qe[t]=e});function Xt(e){const t=new te(e),n=oe(te.prototype.request,t);return h.extend(n,te.prototype,t,{allOwnKeys:!0}),h.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return Xt(ee(e,o))},n}const O=Xt(he);O.Axios=te,O.CanceledError=ae,O.CancelToken=Ze,O.isCancel=Dt,O.VERSION=Zt,O.toFormData=Se,O.AxiosError=R,O.Cancel=O.CanceledError,O.all=function(t){return Promise.all(t)},O.spread=ho,O.isAxiosError=mo,O.mergeConfig=ee,O.AxiosHeaders=U,O.formToJSON=e=>At(h.isHTMLForm(e)?new FormData(e):e),O.getAdapter=Gt.getAdapter,O.HttpStatusCode=Qe,O.default=O;const B=(e,t)=>{const n=e.__vccOpts||e;for(const[r,o]of t)n[r]=o;return n},go={};function bo(e,t,n,r,o,a){const i=s.resolveComponent("router-view");return s.openBlock(),s.createBlock(i)}const yo=B(go,[["render",bo]]);function wo(){return Yt().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Yt(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Eo=typeof Proxy=="function",_o="devtools-plugin:setup",xo="plugin:settings:set";let ie,Xe;function ko(){var e;return ie!==void 0||(typeof window<"u"&&window.performance?(ie=!0,Xe=window.performance):typeof globalThis<"u"&&(!((e=globalThis.perf_hooks)===null||e===void 0)&&e.performance)?(ie=!0,Xe=globalThis.perf_hooks.performance):ie=!1),ie}function Co(){return ko()?Xe.now():Date.now()}class No{constructor(t,n){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=t,this.hook=n;const r={};if(t.settings)for(const i in t.settings){const l=t.settings[i];r[i]=l.defaultValue}const o=`__vue-devtools-plugin-settings__${t.id}`;let a=Object.assign({},r);try{const i=localStorage.getItem(o),l=JSON.parse(i);Object.assign(a,l)}catch{}this.fallbacks={getSettings(){return a},setSettings(i){try{localStorage.setItem(o,JSON.stringify(i))}catch{}a=i},now(){return Co()}},n&&n.on(xo,(i,l)=>{i===this.plugin.id&&this.fallbacks.setSettings(l)}),this.proxiedOn=new Proxy({},{get:(i,l)=>this.target?this.target.on[l]:(...u)=>{this.onQueue.push({method:l,args:u})}}),this.proxiedTarget=new Proxy({},{get:(i,l)=>this.target?this.target[l]:l==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(l)?(...u)=>(this.targetQueue.push({method:l,args:u,resolve:()=>{}}),this.fallbacks[l](...u)):(...u)=>new Promise(f=>{this.targetQueue.push({method:l,args:u,resolve:f})})})}async setRealTarget(t){this.target=t;for(const n of this.onQueue)this.target.on[n.method](...n.args);for(const n of this.targetQueue)n.resolve(await this.target[n.method](...n.args))}}function So(e,t){const n=e,r=Yt(),o=wo(),a=Eo&&n.enableEarlyProxy;if(o&&(r.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!a))o.emit(_o,e,t);else{const i=a?new No(n,o):null;(r.__VUE_DEVTOOLS_PLUGINS__=r.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:n,setupFn:t,proxy:i}),i&&t(i.proxiedTarget)}}/*!
1
+ (function(k,ka){typeof exports=="object"&&typeof module<"u"?module.exports=ka(require("vue")):typeof define=="function"&&define.amd?define(["vue"],ka):(k=typeof globalThis<"u"?globalThis:k||self,k.admin=ka(k.Vue))})(this,function(k){"use strict";function ka(n,i){return function(){return n.apply(i,arguments)}}const{toString:dx}=Object.prototype,{getPrototypeOf:md}=Object,yh=(n=>i=>{const o=dx.call(i);return n[o]||(n[o]=o.slice(8,-1).toLowerCase())})(Object.create(null)),Lr=n=>(n=n.toLowerCase(),i=>yh(i)===n),_h=n=>i=>typeof i===n,{isArray:Ea}=Array,Nl=_h("undefined");function px(n){return n!==null&&!Nl(n)&&n.constructor!==null&&!Nl(n.constructor)&&Jn(n.constructor.isBuffer)&&n.constructor.isBuffer(n)}const am=Lr("ArrayBuffer");function fx(n){let i;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?i=ArrayBuffer.isView(n):i=n&&n.buffer&&am(n.buffer),i}const mx=_h("string"),Jn=_h("function"),lm=_h("number"),xh=n=>n!==null&&typeof n=="object",gx=n=>n===!0||n===!1,bh=n=>{if(yh(n)!=="object")return!1;const i=md(n);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in n)&&!(Symbol.iterator in n)},yx=Lr("Date"),_x=Lr("File"),xx=Lr("Blob"),bx=Lr("FileList"),vx=n=>xh(n)&&Jn(n.pipe),wx=n=>{let i;return n&&(typeof FormData=="function"&&n instanceof FormData||Jn(n.append)&&((i=yh(n))==="formdata"||i==="object"&&Jn(n.toString)&&n.toString()==="[object FormData]"))},Sx=Lr("URLSearchParams"),[kx,Ex,Tx,Cx]=["ReadableStream","Request","Response","Headers"].map(Lr),Mx=n=>n.trim?n.trim():n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Vl(n,i,{allOwnKeys:o=!1}={}){if(n===null||typeof n>"u")return;let c,p;if(typeof n!="object"&&(n=[n]),Ea(n))for(c=0,p=n.length;c<p;c++)i.call(null,n[c],c,n);else{const b=o?Object.getOwnPropertyNames(n):Object.keys(n),_=b.length;let h;for(c=0;c<_;c++)h=b[c],i.call(null,n[h],h,n)}}function cm(n,i){i=i.toLowerCase();const o=Object.keys(n);let c=o.length,p;for(;c-- >0;)if(p=o[c],i===p.toLowerCase())return p;return null}const Ro=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,hm=n=>!Nl(n)&&n!==Ro;function gd(){const{caseless:n}=hm(this)&&this||{},i={},o=(c,p)=>{const b=n&&cm(i,p)||p;bh(i[b])&&bh(c)?i[b]=gd(i[b],c):bh(c)?i[b]=gd({},c):Ea(c)?i[b]=c.slice():i[b]=c};for(let c=0,p=arguments.length;c<p;c++)arguments[c]&&Vl(arguments[c],o);return i}const Px=(n,i,o,{allOwnKeys:c}={})=>(Vl(i,(p,b)=>{o&&Jn(p)?n[b]=ka(p,o):n[b]=p},{allOwnKeys:c}),n),Ix=n=>(n.charCodeAt(0)===65279&&(n=n.slice(1)),n),Ax=(n,i,o,c)=>{n.prototype=Object.create(i.prototype,c),n.prototype.constructor=n,Object.defineProperty(n,"super",{value:i.prototype}),o&&Object.assign(n.prototype,o)},Dx=(n,i,o,c)=>{let p,b,_;const h={};if(i=i||{},n==null)return i;do{for(p=Object.getOwnPropertyNames(n),b=p.length;b-- >0;)_=p[b],(!c||c(_,n,i))&&!h[_]&&(i[_]=n[_],h[_]=!0);n=o!==!1&&md(n)}while(n&&(!o||o(n,i))&&n!==Object.prototype);return i},zx=(n,i,o)=>{n=String(n),(o===void 0||o>n.length)&&(o=n.length),o-=i.length;const c=n.indexOf(i,o);return c!==-1&&c===o},Rx=n=>{if(!n)return null;if(Ea(n))return n;let i=n.length;if(!lm(i))return null;const o=new Array(i);for(;i-- >0;)o[i]=n[i];return o},Lx=(n=>i=>n&&i instanceof n)(typeof Uint8Array<"u"&&md(Uint8Array)),Ox=(n,i)=>{const c=(n&&n[Symbol.iterator]).call(n);let p;for(;(p=c.next())&&!p.done;){const b=p.value;i.call(n,b[0],b[1])}},Bx=(n,i)=>{let o;const c=[];for(;(o=n.exec(i))!==null;)c.push(o);return c},Fx=Lr("HTMLFormElement"),Nx=n=>n.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(o,c,p){return c.toUpperCase()+p}),um=(({hasOwnProperty:n})=>(i,o)=>n.call(i,o))(Object.prototype),Vx=Lr("RegExp"),dm=(n,i)=>{const o=Object.getOwnPropertyDescriptors(n),c={};Vl(o,(p,b)=>{let _;(_=i(p,b,n))!==!1&&(c[b]=_||p)}),Object.defineProperties(n,c)},$x=n=>{dm(n,(i,o)=>{if(Jn(n)&&["arguments","caller","callee"].indexOf(o)!==-1)return!1;const c=n[o];if(Jn(c)){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+o+"'")})}})},jx=(n,i)=>{const o={},c=p=>{p.forEach(b=>{o[b]=!0})};return Ea(n)?c(n):c(String(n).split(i)),o},Ux=()=>{},Hx=(n,i)=>n!=null&&Number.isFinite(n=+n)?n:i,yd="abcdefghijklmnopqrstuvwxyz",pm="0123456789",fm={DIGIT:pm,ALPHA:yd,ALPHA_DIGIT:yd+yd.toUpperCase()+pm},qx=(n=16,i=fm.ALPHA_DIGIT)=>{let o="";const{length:c}=i;for(;n--;)o+=i[Math.random()*c|0];return o};function Zx(n){return!!(n&&Jn(n.append)&&n[Symbol.toStringTag]==="FormData"&&n[Symbol.iterator])}const Wx=n=>{const i=new Array(10),o=(c,p)=>{if(xh(c)){if(i.indexOf(c)>=0)return;if(!("toJSON"in c)){i[p]=c;const b=Ea(c)?[]:{};return Vl(c,(_,h)=>{const M=o(_,p+1);!Nl(M)&&(b[h]=M)}),i[p]=void 0,b}}return c};return o(n,0)},Gx=Lr("AsyncFunction"),Yx=n=>n&&(xh(n)||Jn(n))&&Jn(n.then)&&Jn(n.catch),mm=((n,i)=>n?setImmediate:i?((o,c)=>(Ro.addEventListener("message",({source:p,data:b})=>{p===Ro&&b===o&&c.length&&c.shift()()},!1),p=>{c.push(p),Ro.postMessage(o,"*")}))(`axios@${Math.random()}`,[]):o=>setTimeout(o))(typeof setImmediate=="function",Jn(Ro.postMessage)),Xx=typeof queueMicrotask<"u"?queueMicrotask.bind(Ro):typeof process<"u"&&process.nextTick||mm,Ee={isArray:Ea,isArrayBuffer:am,isBuffer:px,isFormData:wx,isArrayBufferView:fx,isString:mx,isNumber:lm,isBoolean:gx,isObject:xh,isPlainObject:bh,isReadableStream:kx,isRequest:Ex,isResponse:Tx,isHeaders:Cx,isUndefined:Nl,isDate:yx,isFile:_x,isBlob:xx,isRegExp:Vx,isFunction:Jn,isStream:vx,isURLSearchParams:Sx,isTypedArray:Lx,isFileList:bx,forEach:Vl,merge:gd,extend:Px,trim:Mx,stripBOM:Ix,inherits:Ax,toFlatObject:Dx,kindOf:yh,kindOfTest:Lr,endsWith:zx,toArray:Rx,forEachEntry:Ox,matchAll:Bx,isHTMLForm:Fx,hasOwnProperty:um,hasOwnProp:um,reduceDescriptors:dm,freezeMethods:$x,toObjectSet:jx,toCamelCase:Nx,noop:Ux,toFiniteNumber:Hx,findKey:cm,global:Ro,isContextDefined:hm,ALPHABET:fm,generateString:qx,isSpecCompliantForm:Zx,toJSONObject:Wx,isAsyncFn:Gx,isThenable:Yx,setImmediate:mm,asap:Xx};function At(n,i,o,c,p){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=n,this.name="AxiosError",i&&(this.code=i),o&&(this.config=o),c&&(this.request=c),p&&(this.response=p,this.status=p.status?p.status:null)}Ee.inherits(At,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:Ee.toJSONObject(this.config),code:this.code,status:this.status}}});const gm=At.prototype,ym={};["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(n=>{ym[n]={value:n}}),Object.defineProperties(At,ym),Object.defineProperty(gm,"isAxiosError",{value:!0}),At.from=(n,i,o,c,p,b)=>{const _=Object.create(gm);return Ee.toFlatObject(n,_,function(M){return M!==Error.prototype},h=>h!=="isAxiosError"),At.call(_,n.message,i,o,c,p),_.cause=n,_.name=n.name,b&&Object.assign(_,b),_};const Kx=null;function _d(n){return Ee.isPlainObject(n)||Ee.isArray(n)}function _m(n){return Ee.endsWith(n,"[]")?n.slice(0,-2):n}function xm(n,i,o){return n?n.concat(i).map(function(p,b){return p=_m(p),!o&&b?"["+p+"]":p}).join(o?".":""):i}function Jx(n){return Ee.isArray(n)&&!n.some(_d)}const Qx=Ee.toFlatObject(Ee,{},null,function(i){return/^is[A-Z]/.test(i)});function vh(n,i,o){if(!Ee.isObject(n))throw new TypeError("target must be an object");i=i||new FormData,o=Ee.toFlatObject(o,{metaTokens:!0,dots:!1,indexes:!1},!1,function(ee,oe){return!Ee.isUndefined(oe[ee])});const c=o.metaTokens,p=o.visitor||D,b=o.dots,_=o.indexes,M=(o.Blob||typeof Blob<"u"&&Blob)&&Ee.isSpecCompliantForm(i);if(!Ee.isFunction(p))throw new TypeError("visitor must be a function");function A(Y){if(Y===null)return"";if(Ee.isDate(Y))return Y.toISOString();if(!M&&Ee.isBlob(Y))throw new At("Blob is not supported. Use a Buffer instead.");return Ee.isArrayBuffer(Y)||Ee.isTypedArray(Y)?M&&typeof Blob=="function"?new Blob([Y]):Buffer.from(Y):Y}function D(Y,ee,oe){let ue=Y;if(Y&&!oe&&typeof Y=="object"){if(Ee.endsWith(ee,"{}"))ee=c?ee:ee.slice(0,-2),Y=JSON.stringify(Y);else if(Ee.isArray(Y)&&Jx(Y)||(Ee.isFileList(Y)||Ee.endsWith(ee,"[]"))&&(ue=Ee.toArray(Y)))return ee=_m(ee),ue.forEach(function(_e,Ce){!(Ee.isUndefined(_e)||_e===null)&&i.append(_===!0?xm([ee],Ce,b):_===null?ee:ee+"[]",A(_e))}),!1}return _d(Y)?!0:(i.append(xm(oe,ee,b),A(Y)),!1)}const R=[],z=Object.assign(Qx,{defaultVisitor:D,convertValue:A,isVisitable:_d});function j(Y,ee){if(!Ee.isUndefined(Y)){if(R.indexOf(Y)!==-1)throw Error("Circular reference detected in "+ee.join("."));R.push(Y),Ee.forEach(Y,function(ue,be){(!(Ee.isUndefined(ue)||ue===null)&&p.call(i,ue,Ee.isString(be)?be.trim():be,ee,z))===!0&&j(ue,ee?ee.concat(be):[be])}),R.pop()}}if(!Ee.isObject(n))throw new TypeError("data must be an object");return j(n),i}function bm(n){const i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g,function(c){return i[c]})}function xd(n,i){this._pairs=[],n&&vh(n,this,i)}const vm=xd.prototype;vm.append=function(i,o){this._pairs.push([i,o])},vm.toString=function(i){const o=i?function(c){return i.call(this,c,bm)}:bm;return this._pairs.map(function(p){return o(p[0])+"="+o(p[1])},"").join("&")};function eb(n){return encodeURIComponent(n).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function wm(n,i,o){if(!i)return n;const c=o&&o.encode||eb,p=o&&o.serialize;let b;if(p?b=p(i,o):b=Ee.isURLSearchParams(i)?i.toString():new xd(i,o).toString(c),b){const _=n.indexOf("#");_!==-1&&(n=n.slice(0,_)),n+=(n.indexOf("?")===-1?"?":"&")+b}return n}class Sm{constructor(){this.handlers=[]}use(i,o,c){return this.handlers.push({fulfilled:i,rejected:o,synchronous:c?c.synchronous:!1,runWhen:c?c.runWhen:null}),this.handlers.length-1}eject(i){this.handlers[i]&&(this.handlers[i]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(i){Ee.forEach(this.handlers,function(c){c!==null&&i(c)})}}const km={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},tb={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:xd,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},bd=typeof window<"u"&&typeof document<"u",vd=typeof navigator=="object"&&navigator||void 0,ib=bd&&(!vd||["ReactNative","NativeScript","NS"].indexOf(vd.product)<0),nb=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",rb=bd&&window.location.href||"http://localhost",On={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:bd,hasStandardBrowserEnv:ib,hasStandardBrowserWebWorkerEnv:nb,navigator:vd,origin:rb},Symbol.toStringTag,{value:"Module"})),...tb};function sb(n,i){return vh(n,new On.classes.URLSearchParams,Object.assign({visitor:function(o,c,p,b){return On.isNode&&Ee.isBuffer(o)?(this.append(c,o.toString("base64")),!1):b.defaultVisitor.apply(this,arguments)}},i))}function ob(n){return Ee.matchAll(/\w+|\[(\w*)]/g,n).map(i=>i[0]==="[]"?"":i[1]||i[0])}function ab(n){const i={},o=Object.keys(n);let c;const p=o.length;let b;for(c=0;c<p;c++)b=o[c],i[b]=n[b];return i}function Em(n){function i(o,c,p,b){let _=o[b++];if(_==="__proto__")return!0;const h=Number.isFinite(+_),M=b>=o.length;return _=!_&&Ee.isArray(p)?p.length:_,M?(Ee.hasOwnProp(p,_)?p[_]=[p[_],c]:p[_]=c,!h):((!p[_]||!Ee.isObject(p[_]))&&(p[_]=[]),i(o,c,p[_],b)&&Ee.isArray(p[_])&&(p[_]=ab(p[_])),!h)}if(Ee.isFormData(n)&&Ee.isFunction(n.entries)){const o={};return Ee.forEachEntry(n,(c,p)=>{i(ob(c),p,o,0)}),o}return null}function lb(n,i,o){if(Ee.isString(n))try{return(i||JSON.parse)(n),Ee.trim(n)}catch(c){if(c.name!=="SyntaxError")throw c}return(o||JSON.stringify)(n)}const $l={transitional:km,adapter:["xhr","http","fetch"],transformRequest:[function(i,o){const c=o.getContentType()||"",p=c.indexOf("application/json")>-1,b=Ee.isObject(i);if(b&&Ee.isHTMLForm(i)&&(i=new FormData(i)),Ee.isFormData(i))return p?JSON.stringify(Em(i)):i;if(Ee.isArrayBuffer(i)||Ee.isBuffer(i)||Ee.isStream(i)||Ee.isFile(i)||Ee.isBlob(i)||Ee.isReadableStream(i))return i;if(Ee.isArrayBufferView(i))return i.buffer;if(Ee.isURLSearchParams(i))return o.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let h;if(b){if(c.indexOf("application/x-www-form-urlencoded")>-1)return sb(i,this.formSerializer).toString();if((h=Ee.isFileList(i))||c.indexOf("multipart/form-data")>-1){const M=this.env&&this.env.FormData;return vh(h?{"files[]":i}:i,M&&new M,this.formSerializer)}}return b||p?(o.setContentType("application/json",!1),lb(i)):i}],transformResponse:[function(i){const o=this.transitional||$l.transitional,c=o&&o.forcedJSONParsing,p=this.responseType==="json";if(Ee.isResponse(i)||Ee.isReadableStream(i))return i;if(i&&Ee.isString(i)&&(c&&!this.responseType||p)){const _=!(o&&o.silentJSONParsing)&&p;try{return JSON.parse(i)}catch(h){if(_)throw h.name==="SyntaxError"?At.from(h,At.ERR_BAD_RESPONSE,this,null,this.response):h}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:On.classes.FormData,Blob:On.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ee.forEach(["delete","get","head","post","put","patch"],n=>{$l.headers[n]={}});const cb=Ee.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"]),hb=n=>{const i={};let o,c,p;return n&&n.split(`
2
+ `).forEach(function(_){p=_.indexOf(":"),o=_.substring(0,p).trim().toLowerCase(),c=_.substring(p+1).trim(),!(!o||i[o]&&cb[o])&&(o==="set-cookie"?i[o]?i[o].push(c):i[o]=[c]:i[o]=i[o]?i[o]+", "+c:c)}),i},Tm=Symbol("internals");function jl(n){return n&&String(n).trim().toLowerCase()}function wh(n){return n===!1||n==null?n:Ee.isArray(n)?n.map(wh):String(n)}function ub(n){const i=Object.create(null),o=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let c;for(;c=o.exec(n);)i[c[1]]=c[2];return i}const db=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function wd(n,i,o,c,p){if(Ee.isFunction(c))return c.call(this,i,o);if(p&&(i=o),!!Ee.isString(i)){if(Ee.isString(c))return i.indexOf(c)!==-1;if(Ee.isRegExp(c))return c.test(i)}}function pb(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(i,o,c)=>o.toUpperCase()+c)}function fb(n,i){const o=Ee.toCamelCase(" "+i);["get","set","has"].forEach(c=>{Object.defineProperty(n,c+o,{value:function(p,b,_){return this[c].call(this,i,p,b,_)},configurable:!0})})}class Bn{constructor(i){i&&this.set(i)}set(i,o,c){const p=this;function b(h,M,A){const D=jl(M);if(!D)throw new Error("header name must be a non-empty string");const R=Ee.findKey(p,D);(!R||p[R]===void 0||A===!0||A===void 0&&p[R]!==!1)&&(p[R||M]=wh(h))}const _=(h,M)=>Ee.forEach(h,(A,D)=>b(A,D,M));if(Ee.isPlainObject(i)||i instanceof this.constructor)_(i,o);else if(Ee.isString(i)&&(i=i.trim())&&!db(i))_(hb(i),o);else if(Ee.isHeaders(i))for(const[h,M]of i.entries())b(M,h,c);else i!=null&&b(o,i,c);return this}get(i,o){if(i=jl(i),i){const c=Ee.findKey(this,i);if(c){const p=this[c];if(!o)return p;if(o===!0)return ub(p);if(Ee.isFunction(o))return o.call(this,p,c);if(Ee.isRegExp(o))return o.exec(p);throw new TypeError("parser must be boolean|regexp|function")}}}has(i,o){if(i=jl(i),i){const c=Ee.findKey(this,i);return!!(c&&this[c]!==void 0&&(!o||wd(this,this[c],c,o)))}return!1}delete(i,o){const c=this;let p=!1;function b(_){if(_=jl(_),_){const h=Ee.findKey(c,_);h&&(!o||wd(c,c[h],h,o))&&(delete c[h],p=!0)}}return Ee.isArray(i)?i.forEach(b):b(i),p}clear(i){const o=Object.keys(this);let c=o.length,p=!1;for(;c--;){const b=o[c];(!i||wd(this,this[b],b,i,!0))&&(delete this[b],p=!0)}return p}normalize(i){const o=this,c={};return Ee.forEach(this,(p,b)=>{const _=Ee.findKey(c,b);if(_){o[_]=wh(p),delete o[b];return}const h=i?pb(b):String(b).trim();h!==b&&delete o[b],o[h]=wh(p),c[h]=!0}),this}concat(...i){return this.constructor.concat(this,...i)}toJSON(i){const o=Object.create(null);return Ee.forEach(this,(c,p)=>{c!=null&&c!==!1&&(o[p]=i&&Ee.isArray(c)?c.join(", "):c)}),o}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([i,o])=>i+": "+o).join(`
3
+ `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(i){return i instanceof this?i:new this(i)}static concat(i,...o){const c=new this(i);return o.forEach(p=>c.set(p)),c}static accessor(i){const c=(this[Tm]=this[Tm]={accessors:{}}).accessors,p=this.prototype;function b(_){const h=jl(_);c[h]||(fb(p,_),c[h]=!0)}return Ee.isArray(i)?i.forEach(b):b(i),this}}Bn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ee.reduceDescriptors(Bn.prototype,({value:n},i)=>{let o=i[0].toUpperCase()+i.slice(1);return{get:()=>n,set(c){this[o]=c}}}),Ee.freezeMethods(Bn);function Sd(n,i){const o=this||$l,c=i||o,p=Bn.from(c.headers);let b=c.data;return Ee.forEach(n,function(h){b=h.call(o,b,p.normalize(),i?i.status:void 0)}),p.normalize(),b}function Cm(n){return!!(n&&n.__CANCEL__)}function Ta(n,i,o){At.call(this,n??"canceled",At.ERR_CANCELED,i,o),this.name="CanceledError"}Ee.inherits(Ta,At,{__CANCEL__:!0});function Mm(n,i,o){const c=o.config.validateStatus;!o.status||!c||c(o.status)?n(o):i(new At("Request failed with status code "+o.status,[At.ERR_BAD_REQUEST,At.ERR_BAD_RESPONSE][Math.floor(o.status/100)-4],o.config,o.request,o))}function mb(n){const i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return i&&i[1]||""}function gb(n,i){n=n||10;const o=new Array(n),c=new Array(n);let p=0,b=0,_;return i=i!==void 0?i:1e3,function(M){const A=Date.now(),D=c[b];_||(_=A),o[p]=M,c[p]=A;let R=b,z=0;for(;R!==p;)z+=o[R++],R=R%n;if(p=(p+1)%n,p===b&&(b=(b+1)%n),A-_<i)return;const j=D&&A-D;return j?Math.round(z*1e3/j):void 0}}function yb(n,i){let o=0,c=1e3/i,p,b;const _=(A,D=Date.now())=>{o=D,p=null,b&&(clearTimeout(b),b=null),n.apply(null,A)};return[(...A)=>{const D=Date.now(),R=D-o;R>=c?_(A,D):(p=A,b||(b=setTimeout(()=>{b=null,_(p)},c-R)))},()=>p&&_(p)]}const Sh=(n,i,o=3)=>{let c=0;const p=gb(50,250);return yb(b=>{const _=b.loaded,h=b.lengthComputable?b.total:void 0,M=_-c,A=p(M),D=_<=h;c=_;const R={loaded:_,total:h,progress:h?_/h:void 0,bytes:M,rate:A||void 0,estimated:A&&h&&D?(h-_)/A:void 0,event:b,lengthComputable:h!=null,[i?"download":"upload"]:!0};n(R)},o)},Pm=(n,i)=>{const o=n!=null;return[c=>i[0]({lengthComputable:o,total:n,loaded:c}),i[1]]},Im=n=>(...i)=>Ee.asap(()=>n(...i)),_b=On.hasStandardBrowserEnv?function(){const i=On.navigator&&/(msie|trident)/i.test(On.navigator.userAgent),o=document.createElement("a");let c;function p(b){let _=b;return i&&(o.setAttribute("href",_),_=o.href),o.setAttribute("href",_),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:o.pathname.charAt(0)==="/"?o.pathname:"/"+o.pathname}}return c=p(window.location.href),function(_){const h=Ee.isString(_)?p(_):_;return h.protocol===c.protocol&&h.host===c.host}}():function(){return function(){return!0}}(),xb=On.hasStandardBrowserEnv?{write(n,i,o,c,p,b){const _=[n+"="+encodeURIComponent(i)];Ee.isNumber(o)&&_.push("expires="+new Date(o).toGMTString()),Ee.isString(c)&&_.push("path="+c),Ee.isString(p)&&_.push("domain="+p),b===!0&&_.push("secure"),document.cookie=_.join("; ")},read(n){const i=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return i?decodeURIComponent(i[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function bb(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function vb(n,i){return i?n.replace(/\/?\/$/,"")+"/"+i.replace(/^\/+/,""):n}function Am(n,i){return n&&!bb(i)?vb(n,i):i}const Dm=n=>n instanceof Bn?{...n}:n;function Lo(n,i){i=i||{};const o={};function c(A,D,R){return Ee.isPlainObject(A)&&Ee.isPlainObject(D)?Ee.merge.call({caseless:R},A,D):Ee.isPlainObject(D)?Ee.merge({},D):Ee.isArray(D)?D.slice():D}function p(A,D,R){if(Ee.isUndefined(D)){if(!Ee.isUndefined(A))return c(void 0,A,R)}else return c(A,D,R)}function b(A,D){if(!Ee.isUndefined(D))return c(void 0,D)}function _(A,D){if(Ee.isUndefined(D)){if(!Ee.isUndefined(A))return c(void 0,A)}else return c(void 0,D)}function h(A,D,R){if(R in i)return c(A,D);if(R in n)return c(void 0,A)}const M={url:b,method:b,data:b,baseURL:_,transformRequest:_,transformResponse:_,paramsSerializer:_,timeout:_,timeoutMessage:_,withCredentials:_,withXSRFToken:_,adapter:_,responseType:_,xsrfCookieName:_,xsrfHeaderName:_,onUploadProgress:_,onDownloadProgress:_,decompress:_,maxContentLength:_,maxBodyLength:_,beforeRedirect:_,transport:_,httpAgent:_,httpsAgent:_,cancelToken:_,socketPath:_,responseEncoding:_,validateStatus:h,headers:(A,D)=>p(Dm(A),Dm(D),!0)};return Ee.forEach(Object.keys(Object.assign({},n,i)),function(D){const R=M[D]||p,z=R(n[D],i[D],D);Ee.isUndefined(z)&&R!==h||(o[D]=z)}),o}const zm=n=>{const i=Lo({},n);let{data:o,withXSRFToken:c,xsrfHeaderName:p,xsrfCookieName:b,headers:_,auth:h}=i;i.headers=_=Bn.from(_),i.url=wm(Am(i.baseURL,i.url),n.params,n.paramsSerializer),h&&_.set("Authorization","Basic "+btoa((h.username||"")+":"+(h.password?unescape(encodeURIComponent(h.password)):"")));let M;if(Ee.isFormData(o)){if(On.hasStandardBrowserEnv||On.hasStandardBrowserWebWorkerEnv)_.setContentType(void 0);else if((M=_.getContentType())!==!1){const[A,...D]=M?M.split(";").map(R=>R.trim()).filter(Boolean):[];_.setContentType([A||"multipart/form-data",...D].join("; "))}}if(On.hasStandardBrowserEnv&&(c&&Ee.isFunction(c)&&(c=c(i)),c||c!==!1&&_b(i.url))){const A=p&&b&&xb.read(b);A&&_.set(p,A)}return i},wb=typeof XMLHttpRequest<"u"&&function(n){return new Promise(function(o,c){const p=zm(n);let b=p.data;const _=Bn.from(p.headers).normalize();let{responseType:h,onUploadProgress:M,onDownloadProgress:A}=p,D,R,z,j,Y;function ee(){j&&j(),Y&&Y(),p.cancelToken&&p.cancelToken.unsubscribe(D),p.signal&&p.signal.removeEventListener("abort",D)}let oe=new XMLHttpRequest;oe.open(p.method.toUpperCase(),p.url,!0),oe.timeout=p.timeout;function ue(){if(!oe)return;const _e=Bn.from("getAllResponseHeaders"in oe&&oe.getAllResponseHeaders()),Qe={data:!h||h==="text"||h==="json"?oe.responseText:oe.response,status:oe.status,statusText:oe.statusText,headers:_e,config:n,request:oe};Mm(function(Ae){o(Ae),ee()},function(Ae){c(Ae),ee()},Qe),oe=null}"onloadend"in oe?oe.onloadend=ue:oe.onreadystatechange=function(){!oe||oe.readyState!==4||oe.status===0&&!(oe.responseURL&&oe.responseURL.indexOf("file:")===0)||setTimeout(ue)},oe.onabort=function(){oe&&(c(new At("Request aborted",At.ECONNABORTED,n,oe)),oe=null)},oe.onerror=function(){c(new At("Network Error",At.ERR_NETWORK,n,oe)),oe=null},oe.ontimeout=function(){let Ce=p.timeout?"timeout of "+p.timeout+"ms exceeded":"timeout exceeded";const Qe=p.transitional||km;p.timeoutErrorMessage&&(Ce=p.timeoutErrorMessage),c(new At(Ce,Qe.clarifyTimeoutError?At.ETIMEDOUT:At.ECONNABORTED,n,oe)),oe=null},b===void 0&&_.setContentType(null),"setRequestHeader"in oe&&Ee.forEach(_.toJSON(),function(Ce,Qe){oe.setRequestHeader(Qe,Ce)}),Ee.isUndefined(p.withCredentials)||(oe.withCredentials=!!p.withCredentials),h&&h!=="json"&&(oe.responseType=p.responseType),A&&([z,Y]=Sh(A,!0),oe.addEventListener("progress",z)),M&&oe.upload&&([R,j]=Sh(M),oe.upload.addEventListener("progress",R),oe.upload.addEventListener("loadend",j)),(p.cancelToken||p.signal)&&(D=_e=>{oe&&(c(!_e||_e.type?new Ta(null,n,oe):_e),oe.abort(),oe=null)},p.cancelToken&&p.cancelToken.subscribe(D),p.signal&&(p.signal.aborted?D():p.signal.addEventListener("abort",D)));const be=mb(p.url);if(be&&On.protocols.indexOf(be)===-1){c(new At("Unsupported protocol "+be+":",At.ERR_BAD_REQUEST,n));return}oe.send(b||null)})},Sb=(n,i)=>{const{length:o}=n=n?n.filter(Boolean):[];if(i||o){let c=new AbortController,p;const b=function(A){if(!p){p=!0,h();const D=A instanceof Error?A:this.reason;c.abort(D instanceof At?D:new Ta(D instanceof Error?D.message:D))}};let _=i&&setTimeout(()=>{_=null,b(new At(`timeout ${i} of ms exceeded`,At.ETIMEDOUT))},i);const h=()=>{n&&(_&&clearTimeout(_),_=null,n.forEach(A=>{A.unsubscribe?A.unsubscribe(b):A.removeEventListener("abort",b)}),n=null)};n.forEach(A=>A.addEventListener("abort",b));const{signal:M}=c;return M.unsubscribe=()=>Ee.asap(h),M}},kb=function*(n,i){let o=n.byteLength;if(!i||o<i){yield n;return}let c=0,p;for(;c<o;)p=c+i,yield n.slice(c,p),c=p},Eb=async function*(n,i){for await(const o of Tb(n))yield*kb(o,i)},Tb=async function*(n){if(n[Symbol.asyncIterator]){yield*n;return}const i=n.getReader();try{for(;;){const{done:o,value:c}=await i.read();if(o)break;yield c}}finally{await i.cancel()}},Rm=(n,i,o,c)=>{const p=Eb(n,i);let b=0,_,h=M=>{_||(_=!0,c&&c(M))};return new ReadableStream({async pull(M){try{const{done:A,value:D}=await p.next();if(A){h(),M.close();return}let R=D.byteLength;if(o){let z=b+=R;o(z)}M.enqueue(new Uint8Array(D))}catch(A){throw h(A),A}},cancel(M){return h(M),p.return()}},{highWaterMark:2})},kh=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",Lm=kh&&typeof ReadableStream=="function",Cb=kh&&(typeof TextEncoder=="function"?(n=>i=>n.encode(i))(new TextEncoder):async n=>new Uint8Array(await new Response(n).arrayBuffer())),Om=(n,...i)=>{try{return!!n(...i)}catch{return!1}},Mb=Lm&&Om(()=>{let n=!1;const i=new Request(On.origin,{body:new ReadableStream,method:"POST",get duplex(){return n=!0,"half"}}).headers.has("Content-Type");return n&&!i}),Bm=64*1024,kd=Lm&&Om(()=>Ee.isReadableStream(new Response("").body)),Eh={stream:kd&&(n=>n.body)};kh&&(n=>{["text","arrayBuffer","blob","formData","stream"].forEach(i=>{!Eh[i]&&(Eh[i]=Ee.isFunction(n[i])?o=>o[i]():(o,c)=>{throw new At(`Response type '${i}' is not supported`,At.ERR_NOT_SUPPORT,c)})})})(new Response);const Pb=async n=>{if(n==null)return 0;if(Ee.isBlob(n))return n.size;if(Ee.isSpecCompliantForm(n))return(await new Request(On.origin,{method:"POST",body:n}).arrayBuffer()).byteLength;if(Ee.isArrayBufferView(n)||Ee.isArrayBuffer(n))return n.byteLength;if(Ee.isURLSearchParams(n)&&(n=n+""),Ee.isString(n))return(await Cb(n)).byteLength},Ib=async(n,i)=>{const o=Ee.toFiniteNumber(n.getContentLength());return o??Pb(i)},Ed={http:Kx,xhr:wb,fetch:kh&&(async n=>{let{url:i,method:o,data:c,signal:p,cancelToken:b,timeout:_,onDownloadProgress:h,onUploadProgress:M,responseType:A,headers:D,withCredentials:R="same-origin",fetchOptions:z}=zm(n);A=A?(A+"").toLowerCase():"text";let j=Sb([p,b&&b.toAbortSignal()],_),Y;const ee=j&&j.unsubscribe&&(()=>{j.unsubscribe()});let oe;try{if(M&&Mb&&o!=="get"&&o!=="head"&&(oe=await Ib(D,c))!==0){let Qe=new Request(i,{method:"POST",body:c,duplex:"half"}),mt;if(Ee.isFormData(c)&&(mt=Qe.headers.get("content-type"))&&D.setContentType(mt),Qe.body){const[Ae,St]=Pm(oe,Sh(Im(M)));c=Rm(Qe.body,Bm,Ae,St)}}Ee.isString(R)||(R=R?"include":"omit");const ue="credentials"in Request.prototype;Y=new Request(i,{...z,signal:j,method:o.toUpperCase(),headers:D.normalize().toJSON(),body:c,duplex:"half",credentials:ue?R:void 0});let be=await fetch(Y);const _e=kd&&(A==="stream"||A==="response");if(kd&&(h||_e&&ee)){const Qe={};["status","statusText","headers"].forEach(wt=>{Qe[wt]=be[wt]});const mt=Ee.toFiniteNumber(be.headers.get("content-length")),[Ae,St]=h&&Pm(mt,Sh(Im(h),!0))||[];be=new Response(Rm(be.body,Bm,Ae,()=>{St&&St(),ee&&ee()}),Qe)}A=A||"text";let Ce=await Eh[Ee.findKey(Eh,A)||"text"](be,n);return!_e&&ee&&ee(),await new Promise((Qe,mt)=>{Mm(Qe,mt,{data:Ce,headers:Bn.from(be.headers),status:be.status,statusText:be.statusText,config:n,request:Y})})}catch(ue){throw ee&&ee(),ue&&ue.name==="TypeError"&&/fetch/i.test(ue.message)?Object.assign(new At("Network Error",At.ERR_NETWORK,n,Y),{cause:ue.cause||ue}):At.from(ue,ue&&ue.code,n,Y)}})};Ee.forEach(Ed,(n,i)=>{if(n){try{Object.defineProperty(n,"name",{value:i})}catch{}Object.defineProperty(n,"adapterName",{value:i})}});const Fm=n=>`- ${n}`,Ab=n=>Ee.isFunction(n)||n===null||n===!1,Nm={getAdapter:n=>{n=Ee.isArray(n)?n:[n];const{length:i}=n;let o,c;const p={};for(let b=0;b<i;b++){o=n[b];let _;if(c=o,!Ab(o)&&(c=Ed[(_=String(o)).toLowerCase()],c===void 0))throw new At(`Unknown adapter '${_}'`);if(c)break;p[_||"#"+b]=c}if(!c){const b=Object.entries(p).map(([h,M])=>`adapter ${h} `+(M===!1?"is not supported by the environment":"is not available in the build"));let _=i?b.length>1?`since :
4
+ `+b.map(Fm).join(`
5
+ `):" "+Fm(b[0]):"as no adapter specified";throw new At("There is no suitable adapter to dispatch the request "+_,"ERR_NOT_SUPPORT")}return c},adapters:Ed};function Td(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new Ta(null,n)}function Vm(n){return Td(n),n.headers=Bn.from(n.headers),n.data=Sd.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),Nm.getAdapter(n.adapter||$l.adapter)(n).then(function(c){return Td(n),c.data=Sd.call(n,n.transformResponse,c),c.headers=Bn.from(c.headers),c},function(c){return Cm(c)||(Td(n),c&&c.response&&(c.response.data=Sd.call(n,n.transformResponse,c.response),c.response.headers=Bn.from(c.response.headers))),Promise.reject(c)})}const $m="1.7.7",Cd={};["object","boolean","number","function","string","symbol"].forEach((n,i)=>{Cd[n]=function(c){return typeof c===n||"a"+(i<1?"n ":" ")+n}});const jm={};Cd.transitional=function(i,o,c){function p(b,_){return"[Axios v"+$m+"] Transitional option '"+b+"'"+_+(c?". "+c:"")}return(b,_,h)=>{if(i===!1)throw new At(p(_," has been removed"+(o?" in "+o:"")),At.ERR_DEPRECATED);return o&&!jm[_]&&(jm[_]=!0,console.warn(p(_," has been deprecated since v"+o+" and will be removed in the near future"))),i?i(b,_,h):!0}};function Db(n,i,o){if(typeof n!="object")throw new At("options must be an object",At.ERR_BAD_OPTION_VALUE);const c=Object.keys(n);let p=c.length;for(;p-- >0;){const b=c[p],_=i[b];if(_){const h=n[b],M=h===void 0||_(h,b,n);if(M!==!0)throw new At("option "+b+" must be "+M,At.ERR_BAD_OPTION_VALUE);continue}if(o!==!0)throw new At("Unknown option "+b,At.ERR_BAD_OPTION)}}const Md={assertOptions:Db,validators:Cd},Hs=Md.validators;class Oo{constructor(i){this.defaults=i,this.interceptors={request:new Sm,response:new Sm}}async request(i,o){try{return await this._request(i,o)}catch(c){if(c instanceof Error){let p;Error.captureStackTrace?Error.captureStackTrace(p={}):p=new Error;const b=p.stack?p.stack.replace(/^.+\n/,""):"";try{c.stack?b&&!String(c.stack).endsWith(b.replace(/^.+\n.+\n/,""))&&(c.stack+=`
6
+ `+b):c.stack=b}catch{}}throw c}}_request(i,o){typeof i=="string"?(o=o||{},o.url=i):o=i||{},o=Lo(this.defaults,o);const{transitional:c,paramsSerializer:p,headers:b}=o;c!==void 0&&Md.assertOptions(c,{silentJSONParsing:Hs.transitional(Hs.boolean),forcedJSONParsing:Hs.transitional(Hs.boolean),clarifyTimeoutError:Hs.transitional(Hs.boolean)},!1),p!=null&&(Ee.isFunction(p)?o.paramsSerializer={serialize:p}:Md.assertOptions(p,{encode:Hs.function,serialize:Hs.function},!0)),o.method=(o.method||this.defaults.method||"get").toLowerCase();let _=b&&Ee.merge(b.common,b[o.method]);b&&Ee.forEach(["delete","get","head","post","put","patch","common"],Y=>{delete b[Y]}),o.headers=Bn.concat(_,b);const h=[];let M=!0;this.interceptors.request.forEach(function(ee){typeof ee.runWhen=="function"&&ee.runWhen(o)===!1||(M=M&&ee.synchronous,h.unshift(ee.fulfilled,ee.rejected))});const A=[];this.interceptors.response.forEach(function(ee){A.push(ee.fulfilled,ee.rejected)});let D,R=0,z;if(!M){const Y=[Vm.bind(this),void 0];for(Y.unshift.apply(Y,h),Y.push.apply(Y,A),z=Y.length,D=Promise.resolve(o);R<z;)D=D.then(Y[R++],Y[R++]);return D}z=h.length;let j=o;for(R=0;R<z;){const Y=h[R++],ee=h[R++];try{j=Y(j)}catch(oe){ee.call(this,oe);break}}try{D=Vm.call(this,j)}catch(Y){return Promise.reject(Y)}for(R=0,z=A.length;R<z;)D=D.then(A[R++],A[R++]);return D}getUri(i){i=Lo(this.defaults,i);const o=Am(i.baseURL,i.url);return wm(o,i.params,i.paramsSerializer)}}Ee.forEach(["delete","get","head","options"],function(i){Oo.prototype[i]=function(o,c){return this.request(Lo(c||{},{method:i,url:o,data:(c||{}).data}))}}),Ee.forEach(["post","put","patch"],function(i){function o(c){return function(b,_,h){return this.request(Lo(h||{},{method:i,headers:c?{"Content-Type":"multipart/form-data"}:{},url:b,data:_}))}}Oo.prototype[i]=o(),Oo.prototype[i+"Form"]=o(!0)});class Pd{constructor(i){if(typeof i!="function")throw new TypeError("executor must be a function.");let o;this.promise=new Promise(function(b){o=b});const c=this;this.promise.then(p=>{if(!c._listeners)return;let b=c._listeners.length;for(;b-- >0;)c._listeners[b](p);c._listeners=null}),this.promise.then=p=>{let b;const _=new Promise(h=>{c.subscribe(h),b=h}).then(p);return _.cancel=function(){c.unsubscribe(b)},_},i(function(b,_,h){c.reason||(c.reason=new Ta(b,_,h),o(c.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(i){if(this.reason){i(this.reason);return}this._listeners?this._listeners.push(i):this._listeners=[i]}unsubscribe(i){if(!this._listeners)return;const o=this._listeners.indexOf(i);o!==-1&&this._listeners.splice(o,1)}toAbortSignal(){const i=new AbortController,o=c=>{i.abort(c)};return this.subscribe(o),i.signal.unsubscribe=()=>this.unsubscribe(o),i.signal}static source(){let i;return{token:new Pd(function(p){i=p}),cancel:i}}}function zb(n){return function(o){return n.apply(null,o)}}function Rb(n){return Ee.isObject(n)&&n.isAxiosError===!0}const Id={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(Id).forEach(([n,i])=>{Id[i]=n});function Um(n){const i=new Oo(n),o=ka(Oo.prototype.request,i);return Ee.extend(o,Oo.prototype,i,{allOwnKeys:!0}),Ee.extend(o,i,null,{allOwnKeys:!0}),o.create=function(p){return Um(Lo(n,p))},o}const ft=Um($l);ft.Axios=Oo,ft.CanceledError=Ta,ft.CancelToken=Pd,ft.isCancel=Cm,ft.VERSION=$m,ft.toFormData=vh,ft.AxiosError=At,ft.Cancel=ft.CanceledError,ft.all=function(i){return Promise.all(i)},ft.spread=zb,ft.isAxiosError=Rb,ft.mergeConfig=Lo,ft.AxiosHeaders=Bn,ft.formToJSON=n=>Em(Ee.isHTMLForm(n)?new FormData(n):n),ft.getAdapter=Nm.getAdapter,ft.HttpStatusCode=Id,ft.default=ft;const Pt=(n,i)=>{const o=n.__vccOpts||n;for(const[c,p]of i)o[c]=p;return o},Lb={};function Ob(n,i,o,c,p,b){const _=k.resolveComponent("router-view");return k.openBlock(),k.createBlock(_)}const Bb=Pt(Lb,[["render",Ob]]);function Fb(){return Hm().__VUE_DEVTOOLS_GLOBAL_HOOK__}function Hm(){return typeof navigator<"u"&&typeof window<"u"?window:typeof globalThis<"u"?globalThis:{}}const Nb=typeof Proxy=="function",Vb="devtools-plugin:setup",$b="plugin:settings:set";let Ca,Ad;function jb(){var n;return Ca!==void 0||(typeof window<"u"&&window.performance?(Ca=!0,Ad=window.performance):typeof globalThis<"u"&&(!((n=globalThis.perf_hooks)===null||n===void 0)&&n.performance)?(Ca=!0,Ad=globalThis.perf_hooks.performance):Ca=!1),Ca}function Ub(){return jb()?Ad.now():Date.now()}class Hb{constructor(i,o){this.target=null,this.targetQueue=[],this.onQueue=[],this.plugin=i,this.hook=o;const c={};if(i.settings)for(const _ in i.settings){const h=i.settings[_];c[_]=h.defaultValue}const p=`__vue-devtools-plugin-settings__${i.id}`;let b=Object.assign({},c);try{const _=localStorage.getItem(p),h=JSON.parse(_);Object.assign(b,h)}catch{}this.fallbacks={getSettings(){return b},setSettings(_){try{localStorage.setItem(p,JSON.stringify(_))}catch{}b=_},now(){return Ub()}},o&&o.on($b,(_,h)=>{_===this.plugin.id&&this.fallbacks.setSettings(h)}),this.proxiedOn=new Proxy({},{get:(_,h)=>this.target?this.target.on[h]:(...M)=>{this.onQueue.push({method:h,args:M})}}),this.proxiedTarget=new Proxy({},{get:(_,h)=>this.target?this.target[h]:h==="on"?this.proxiedOn:Object.keys(this.fallbacks).includes(h)?(...M)=>(this.targetQueue.push({method:h,args:M,resolve:()=>{}}),this.fallbacks[h](...M)):(...M)=>new Promise(A=>{this.targetQueue.push({method:h,args:M,resolve:A})})})}async setRealTarget(i){this.target=i;for(const o of this.onQueue)this.target.on[o.method](...o.args);for(const o of this.targetQueue)o.resolve(await this.target[o.method](...o.args))}}function qb(n,i){const o=n,c=Hm(),p=Fb(),b=Nb&&o.enableEarlyProxy;if(p&&(c.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__||!b))p.emit(Vb,n,i);else{const _=b?new Hb(o,p):null;(c.__VUE_DEVTOOLS_PLUGINS__=c.__VUE_DEVTOOLS_PLUGINS__||[]).push({pluginDescriptor:o,setupFn:i,proxy:_}),_&&i(_.proxiedTarget)}}/*!
7
7
  * vue-router v4.4.5
8
8
  * (c) 2024 Eduardo San Martin Morote
9
9
  * @license MIT
10
- */const K=typeof document<"u";function en(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Ro(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&en(e.default)}const T=Object.assign;function Ye(e,t){const n={};for(const r in t){const o=t[r];n[r]=q(o)?o.map(e):e(o)}return n}const ge=()=>{},q=Array.isArray;function v(e){const t=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+e].concat(t))}const tn=/#/g,vo=/&/g,Vo=/\//g,$o=/=/g,Oo=/\?/g,nn=/\+/g,To=/%5B/g,Po=/%5D/g,rn=/%5E/g,Ao=/%60/g,on=/%7B/g,Bo=/%7C/g,sn=/%7D/g,Do=/%20/g;function et(e){return encodeURI(""+e).replace(Bo,"|").replace(To,"[").replace(Po,"]")}function Io(e){return et(e).replace(on,"{").replace(sn,"}").replace(rn,"^")}function tt(e){return et(e).replace(nn,"%2B").replace(Do,"+").replace(tn,"%23").replace(vo,"%26").replace(Ao,"`").replace(on,"{").replace(sn,"}").replace(rn,"^")}function Mo(e){return tt(e).replace($o,"%3D")}function Lo(e){return et(e).replace(tn,"%23").replace(Oo,"%3F")}function jo(e){return e==null?"":Lo(e).replace(Vo,"%2F")}function le(e){try{return decodeURIComponent(""+e)}catch{process.env.NODE_ENV!=="production"&&v(`Error decoding "${e}". Using original value`)}return""+e}const Fo=/\/$/,Uo=e=>e.replace(Fo,"");function nt(e,t,n="/"){let r,o={},a="",i="";const l=t.indexOf("#");let u=t.indexOf("?");return l<u&&l>=0&&(u=-1),u>-1&&(r=t.slice(0,u),a=t.slice(u+1,l>-1?l:t.length),o=e(a)),l>-1&&(r=r||t.slice(0,l),i=t.slice(l,t.length)),r=zo(r??t,n),{fullPath:r+(a&&"?")+a+i,path:r,query:o,hash:le(i)}}function Ho(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function an(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function ln(e,t,n){const r=t.matched.length-1,o=n.matched.length-1;return r>-1&&r===o&&Z(t.matched[r],n.matched[o])&&cn(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function Z(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function cn(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!qo(e[n],t[n]))return!1;return!0}function qo(e,t){return q(e)?un(e,t):q(t)?un(t,e):e===t}function un(e,t){return q(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function zo(e,t){if(e.startsWith("/"))return e;if(process.env.NODE_ENV!=="production"&&!t.startsWith("/"))return v(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`),e;if(!e)return t;const n=t.split("/"),r=e.split("/"),o=r[r.length-1];(o===".."||o===".")&&r.push("");let a=n.length-1,i,l;for(i=0;i<r.length;i++)if(l=r[i],l!==".")if(l==="..")a>1&&a--;else break;return n.slice(0,a).join("/")+"/"+r.slice(i).join("/")}const Q={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var be;(function(e){e.pop="pop",e.push="push"})(be||(be={}));var ye;(function(e){e.back="back",e.forward="forward",e.unknown=""})(ye||(ye={}));function Ko(e){if(!e)if(K){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),Uo(e)}const Wo=/^[^#]+#/;function Go(e,t){return e.replace(Wo,"#")+t}function Jo(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const Oe=()=>({left:window.scrollX,top:window.scrollY});function Zo(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#");if(process.env.NODE_ENV!=="production"&&typeof e.el=="string"&&(!r||!document.getElementById(e.el.slice(1))))try{const a=document.querySelector(e.el);if(r&&a){v(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);return}}catch{v(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}const o=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!o){process.env.NODE_ENV!=="production"&&v(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);return}t=Jo(o,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function dn(e,t){return(history.state?history.state.position-t:-1)+e}const rt=new Map;function Qo(e,t){rt.set(e,t)}function Xo(e){const t=rt.get(e);return rt.delete(e),t}let Yo=()=>location.protocol+"//"+location.host;function fn(e,t){const{pathname:n,search:r,hash:o}=t,a=e.indexOf("#");if(a>-1){let l=o.includes(e.slice(a))?e.slice(a).length:1,u=o.slice(l);return u[0]!=="/"&&(u="/"+u),an(u,"")}return an(n,e)+r+o}function es(e,t,n,r){let o=[],a=[],i=null;const l=({state:p})=>{const m=fn(e,location),b=n.value,y=t.value;let w=0;if(p){if(n.value=m,t.value=p,i&&i===b){i=null;return}w=y?p.position-y.position:0}else r(m);o.forEach(N=>{N(n.value,b,{delta:w,type:be.pop,direction:w?w>0?ye.forward:ye.back:ye.unknown})})};function u(){i=n.value}function f(p){o.push(p);const m=()=>{const b=o.indexOf(p);b>-1&&o.splice(b,1)};return a.push(m),m}function c(){const{history:p}=window;p.state&&p.replaceState(T({},p.state,{scroll:Oe()}),"")}function d(){for(const p of a)p();a=[],window.removeEventListener("popstate",l),window.removeEventListener("beforeunload",c)}return window.addEventListener("popstate",l),window.addEventListener("beforeunload",c,{passive:!0}),{pauseListeners:u,listen:f,destroy:d}}function pn(e,t,n,r=!1,o=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:o?Oe():null}}function ts(e){const{history:t,location:n}=window,r={value:fn(e,n)},o={value:t.state};o.value||a(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(u,f,c){const d=e.indexOf("#"),p=d>-1?(n.host&&document.querySelector("base")?e:e.slice(d))+u:Yo()+e+u;try{t[c?"replaceState":"pushState"](f,"",p),o.value=f}catch(m){process.env.NODE_ENV!=="production"?v("Error with push/replace State",m):console.error(m),n[c?"replace":"assign"](p)}}function i(u,f){const c=T({},t.state,pn(o.value.back,u,o.value.forward,!0),f,{position:o.value.position});a(u,c,!0),r.value=u}function l(u,f){const c=T({},o.value,t.state,{forward:u,scroll:Oe()});process.env.NODE_ENV!=="production"&&!t.state&&v(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
10
+ */const ps=typeof document<"u";function qm(n){return typeof n=="object"||"displayName"in n||"props"in n||"__vccOpts"in n}function Zb(n){return n.__esModule||n[Symbol.toStringTag]==="Module"||n.default&&qm(n.default)}const ii=Object.assign;function Dd(n,i){const o={};for(const c in i){const p=i[c];o[c]=Qn(p)?p.map(n):n(p)}return o}const Ul=()=>{},Qn=Array.isArray;function Ft(n){const i=Array.from(arguments).slice(1);console.warn.apply(console,["[Vue Router warn]: "+n].concat(i))}const Zm=/#/g,Wb=/&/g,Gb=/\//g,Yb=/=/g,Xb=/\?/g,Wm=/\+/g,Kb=/%5B/g,Jb=/%5D/g,Gm=/%5E/g,Qb=/%60/g,Ym=/%7B/g,ev=/%7C/g,Xm=/%7D/g,tv=/%20/g;function zd(n){return encodeURI(""+n).replace(ev,"|").replace(Kb,"[").replace(Jb,"]")}function iv(n){return zd(n).replace(Ym,"{").replace(Xm,"}").replace(Gm,"^")}function Rd(n){return zd(n).replace(Wm,"%2B").replace(tv,"+").replace(Zm,"%23").replace(Wb,"%26").replace(Qb,"`").replace(Ym,"{").replace(Xm,"}").replace(Gm,"^")}function nv(n){return Rd(n).replace(Yb,"%3D")}function rv(n){return zd(n).replace(Zm,"%23").replace(Xb,"%3F")}function sv(n){return n==null?"":rv(n).replace(Gb,"%2F")}function Ma(n){try{return decodeURIComponent(""+n)}catch{process.env.NODE_ENV!=="production"&&Ft(`Error decoding "${n}". Using original value`)}return""+n}const ov=/\/$/,av=n=>n.replace(ov,"");function Ld(n,i,o="/"){let c,p={},b="",_="";const h=i.indexOf("#");let M=i.indexOf("?");return h<M&&h>=0&&(M=-1),M>-1&&(c=i.slice(0,M),b=i.slice(M+1,h>-1?h:i.length),p=n(b)),h>-1&&(c=c||i.slice(0,h),_=i.slice(h,i.length)),c=hv(c??i,o),{fullPath:c+(b&&"?")+b+_,path:c,query:p,hash:Ma(_)}}function lv(n,i){const o=i.query?n(i.query):"";return i.path+(o&&"?")+o+(i.hash||"")}function Km(n,i){return!i||!n.toLowerCase().startsWith(i.toLowerCase())?n:n.slice(i.length)||"/"}function Jm(n,i,o){const c=i.matched.length-1,p=o.matched.length-1;return c>-1&&c===p&&qs(i.matched[c],o.matched[p])&&Qm(i.params,o.params)&&n(i.query)===n(o.query)&&i.hash===o.hash}function qs(n,i){return(n.aliasOf||n)===(i.aliasOf||i)}function Qm(n,i){if(Object.keys(n).length!==Object.keys(i).length)return!1;for(const o in n)if(!cv(n[o],i[o]))return!1;return!0}function cv(n,i){return Qn(n)?eg(n,i):Qn(i)?eg(i,n):n===i}function eg(n,i){return Qn(i)?n.length===i.length&&n.every((o,c)=>o===i[c]):n.length===1&&n[0]===i}function hv(n,i){if(n.startsWith("/"))return n;if(process.env.NODE_ENV!=="production"&&!i.startsWith("/"))return Ft(`Cannot resolve a relative location without an absolute path. Trying to resolve "${n}" from "${i}". It should look like "/${i}".`),n;if(!n)return i;const o=i.split("/"),c=n.split("/"),p=c[c.length-1];(p===".."||p===".")&&c.push("");let b=o.length-1,_,h;for(_=0;_<c.length;_++)if(h=c[_],h!==".")if(h==="..")b>1&&b--;else break;return o.slice(0,b).join("/")+"/"+c.slice(_).join("/")}const Zs={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};var Hl;(function(n){n.pop="pop",n.push="push"})(Hl||(Hl={}));var ql;(function(n){n.back="back",n.forward="forward",n.unknown=""})(ql||(ql={}));function uv(n){if(!n)if(ps){const i=document.querySelector("base");n=i&&i.getAttribute("href")||"/",n=n.replace(/^\w+:\/\/[^\/]+/,"")}else n="/";return n[0]!=="/"&&n[0]!=="#"&&(n="/"+n),av(n)}const dv=/^[^#]+#/;function pv(n,i){return n.replace(dv,"#")+i}function fv(n,i){const o=document.documentElement.getBoundingClientRect(),c=n.getBoundingClientRect();return{behavior:i.behavior,left:c.left-o.left-(i.left||0),top:c.top-o.top-(i.top||0)}}const Th=()=>({left:window.scrollX,top:window.scrollY});function mv(n){let i;if("el"in n){const o=n.el,c=typeof o=="string"&&o.startsWith("#");if(process.env.NODE_ENV!=="production"&&typeof n.el=="string"&&(!c||!document.getElementById(n.el.slice(1))))try{const b=document.querySelector(n.el);if(c&&b){Ft(`The selector "${n.el}" should be passed as "el: document.querySelector('${n.el}')" because it starts with "#".`);return}}catch{Ft(`The selector "${n.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);return}const p=typeof o=="string"?c?document.getElementById(o.slice(1)):document.querySelector(o):o;if(!p){process.env.NODE_ENV!=="production"&&Ft(`Couldn't find element using selector "${n.el}" returned by scrollBehavior.`);return}i=fv(p,n)}else i=n;"scrollBehavior"in document.documentElement.style?window.scrollTo(i):window.scrollTo(i.left!=null?i.left:window.scrollX,i.top!=null?i.top:window.scrollY)}function tg(n,i){return(history.state?history.state.position-i:-1)+n}const Od=new Map;function gv(n,i){Od.set(n,i)}function yv(n){const i=Od.get(n);return Od.delete(n),i}let _v=()=>location.protocol+"//"+location.host;function ig(n,i){const{pathname:o,search:c,hash:p}=i,b=n.indexOf("#");if(b>-1){let h=p.includes(n.slice(b))?n.slice(b).length:1,M=p.slice(h);return M[0]!=="/"&&(M="/"+M),Km(M,"")}return Km(o,n)+c+p}function xv(n,i,o,c){let p=[],b=[],_=null;const h=({state:z})=>{const j=ig(n,location),Y=o.value,ee=i.value;let oe=0;if(z){if(o.value=j,i.value=z,_&&_===Y){_=null;return}oe=ee?z.position-ee.position:0}else c(j);p.forEach(ue=>{ue(o.value,Y,{delta:oe,type:Hl.pop,direction:oe?oe>0?ql.forward:ql.back:ql.unknown})})};function M(){_=o.value}function A(z){p.push(z);const j=()=>{const Y=p.indexOf(z);Y>-1&&p.splice(Y,1)};return b.push(j),j}function D(){const{history:z}=window;z.state&&z.replaceState(ii({},z.state,{scroll:Th()}),"")}function R(){for(const z of b)z();b=[],window.removeEventListener("popstate",h),window.removeEventListener("beforeunload",D)}return window.addEventListener("popstate",h),window.addEventListener("beforeunload",D,{passive:!0}),{pauseListeners:M,listen:A,destroy:R}}function ng(n,i,o,c=!1,p=!1){return{back:n,current:i,forward:o,replaced:c,position:window.history.length,scroll:p?Th():null}}function bv(n){const{history:i,location:o}=window,c={value:ig(n,o)},p={value:i.state};p.value||b(c.value,{back:null,current:c.value,forward:null,position:i.length-1,replaced:!0,scroll:null},!0);function b(M,A,D){const R=n.indexOf("#"),z=R>-1?(o.host&&document.querySelector("base")?n:n.slice(R))+M:_v()+n+M;try{i[D?"replaceState":"pushState"](A,"",z),p.value=A}catch(j){process.env.NODE_ENV!=="production"?Ft("Error with push/replace State",j):console.error(j),o[D?"replace":"assign"](z)}}function _(M,A){const D=ii({},i.state,ng(p.value.back,M,p.value.forward,!0),A,{position:p.value.position});b(M,D,!0),c.value=M}function h(M,A){const D=ii({},p.value,i.state,{forward:M,scroll:Th()});process.env.NODE_ENV!=="production"&&!i.state&&Ft(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
11
11
 
12
12
  history.replaceState(history.state, '', url)
13
13
 
14
- You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),a(c.current,c,!0);const d=T({},pn(r.value,u,null),{position:c.position+1},f);a(u,d,!1),r.value=u}return{location:r,state:o,push:l,replace:i}}function ns(e){e=Ko(e);const t=ts(e),n=es(e,t.state,t.location,t.replace);function r(a,i=!0){i||n.pauseListeners(),history.go(a)}const o=T({location:"",base:e,go:r,createHref:Go.bind(null,e)},t,n);return Object.defineProperty(o,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(o,"state",{enumerable:!0,get:()=>t.state.value}),o}function Te(e){return typeof e=="string"||e&&typeof e=="object"}function hn(e){return typeof e=="string"||typeof e=="symbol"}const ot=Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var mn;(function(e){e[e.aborted=4]="aborted",e[e.cancelled=8]="cancelled",e[e.duplicated=16]="duplicated"})(mn||(mn={}));const rs={1({location:e,currentLocation:t}){return`No match for
15
- ${JSON.stringify(e)}${t?`
14
+ You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`),b(D.current,D,!0);const R=ii({},ng(c.value,M,null),{position:D.position+1},A);b(M,R,!1),c.value=M}return{location:c,state:p,push:h,replace:_}}function vv(n){n=uv(n);const i=bv(n),o=xv(n,i.state,i.location,i.replace);function c(b,_=!0){_||o.pauseListeners(),history.go(b)}const p=ii({location:"",base:n,go:c,createHref:pv.bind(null,n)},i,o);return Object.defineProperty(p,"location",{enumerable:!0,get:()=>i.location.value}),Object.defineProperty(p,"state",{enumerable:!0,get:()=>i.state.value}),p}function Ch(n){return typeof n=="string"||n&&typeof n=="object"}function rg(n){return typeof n=="string"||typeof n=="symbol"}const Bd=Symbol(process.env.NODE_ENV!=="production"?"navigation failure":"");var sg;(function(n){n[n.aborted=4]="aborted",n[n.cancelled=8]="cancelled",n[n.duplicated=16]="duplicated"})(sg||(sg={}));const wv={1({location:n,currentLocation:i}){return`No match for
15
+ ${JSON.stringify(n)}${i?`
16
16
  while being at
17
- `+JSON.stringify(t):""}`},2({from:e,to:t}){return`Redirected from "${e.fullPath}" to "${ss(t)}" via a navigation guard.`},4({from:e,to:t}){return`Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`},8({from:e,to:t}){return`Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`},16({from:e,to:t}){return`Avoided redundant navigation to current location: "${e.fullPath}".`}};function ce(e,t){return process.env.NODE_ENV!=="production"?T(new Error(rs[e](t)),{type:e,[ot]:!0},t):T(new Error,{type:e,[ot]:!0},t)}function W(e,t){return e instanceof Error&&ot in e&&(t==null||!!(e.type&t))}const os=["params","query","hash"];function ss(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of os)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}const gn="[^/]+?",as={sensitive:!1,strict:!1,start:!0,end:!0},is=/[.+*?^${}()[\]/\\]/g;function ls(e,t){const n=T({},as,t),r=[];let o=n.start?"^":"";const a=[];for(const f of e){const c=f.length?[]:[90];n.strict&&!f.length&&(o+="/");for(let d=0;d<f.length;d++){const p=f[d];let m=40+(n.sensitive?.25:0);if(p.type===0)d||(o+="/"),o+=p.value.replace(is,"\\$&"),m+=40;else if(p.type===1){const{value:b,repeatable:y,optional:w,regexp:N}=p;a.push({name:b,repeatable:y,optional:w});const x=N||gn;if(x!==gn){m+=10;try{new RegExp(`(${x})`)}catch(D){throw new Error(`Invalid custom RegExp for param "${b}" (${x}): `+D.message)}}let k=y?`((?:${x})(?:/(?:${x}))*)`:`(${x})`;d||(k=w&&f.length<2?`(?:/${k})`:"/"+k),w&&(k+="?"),o+=k,m+=20,w&&(m+=-8),y&&(m+=-20),x===".*"&&(m+=-50)}c.push(m)}r.push(c)}if(n.strict&&n.end){const f=r.length-1;r[f][r[f].length-1]+=.7000000000000001}n.strict||(o+="/?"),n.end?o+="$":n.strict&&(o+="(?:/|$)");const i=new RegExp(o,n.sensitive?"":"i");function l(f){const c=f.match(i),d={};if(!c)return null;for(let p=1;p<c.length;p++){const m=c[p]||"",b=a[p-1];d[b.name]=m&&b.repeatable?m.split("/"):m}return d}function u(f){let c="",d=!1;for(const p of e){(!d||!c.endsWith("/"))&&(c+="/"),d=!1;for(const m of p)if(m.type===0)c+=m.value;else if(m.type===1){const{value:b,repeatable:y,optional:w}=m,N=b in f?f[b]:"";if(q(N)&&!y)throw new Error(`Provided param "${b}" is an array but it is not repeatable (* or + modifiers)`);const x=q(N)?N.join("/"):N;if(!x)if(w)p.length<2&&(c.endsWith("/")?c=c.slice(0,-1):d=!0);else throw new Error(`Missing required param "${b}"`);c+=x}}return c||"/"}return{re:i,score:r,keys:a,parse:l,stringify:u}}function cs(e,t){let n=0;for(;n<e.length&&n<t.length;){const r=t[n]-e[n];if(r)return r;n++}return e.length<t.length?e.length===1&&e[0]===80?-1:1:e.length>t.length?t.length===1&&t[0]===80?1:-1:0}function bn(e,t){let n=0;const r=e.score,o=t.score;for(;n<r.length&&n<o.length;){const a=cs(r[n],o[n]);if(a)return a;n++}if(Math.abs(o.length-r.length)===1){if(yn(r))return 1;if(yn(o))return-1}return o.length-r.length}function yn(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const us={type:0,value:""},ds=/[a-zA-Z0-9_]/;function fs(e){if(!e)return[[]];if(e==="/")return[[us]];if(!e.startsWith("/"))throw new Error(process.env.NODE_ENV!=="production"?`Route paths should start with a "/": "${e}" should be "/${e}".`:`Invalid path "${e}"`);function t(m){throw new Error(`ERR (${n})/"${f}": ${m}`)}let n=0,r=n;const o=[];let a;function i(){a&&o.push(a),a=[]}let l=0,u,f="",c="";function d(){f&&(n===0?a.push({type:0,value:f}):n===1||n===2||n===3?(a.length>1&&(u==="*"||u==="+")&&t(`A repeatable param (${f}) must be alone in its segment. eg: '/:ids+.`),a.push({type:1,value:f,regexp:c,repeatable:u==="*"||u==="+",optional:u==="*"||u==="?"})):t("Invalid state to consume buffer"),f="")}function p(){f+=u}for(;l<e.length;){if(u=e[l++],u==="\\"&&n!==2){r=n,n=4;continue}switch(n){case 0:u==="/"?(f&&d(),i()):u===":"?(d(),n=1):p();break;case 4:p(),n=r;break;case 1:u==="("?n=2:ds.test(u)?p():(d(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&l--);break;case 2:u===")"?c[c.length-1]=="\\"?c=c.slice(0,-1)+u:n=3:c+=u;break;case 3:d(),n=0,u!=="*"&&u!=="?"&&u!=="+"&&l--,c="";break;default:t("Unknown state");break}}return n===2&&t(`Unfinished custom RegExp for param "${f}"`),d(),i(),o}function ps(e,t,n){const r=ls(fs(e.path),n);if(process.env.NODE_ENV!=="production"){const a=new Set;for(const i of r.keys)a.has(i.name)&&v(`Found duplicated params with name "${i.name}" for path "${e.path}". Only the last one will be available on "$route.params".`),a.add(i.name)}const o=T(r,{record:e,parent:t,children:[],alias:[]});return t&&!o.record.aliasOf==!t.record.aliasOf&&t.children.push(o),o}function hs(e,t){const n=[],r=new Map;t=xn({strict:!1,end:!0,sensitive:!1},t);function o(d){return r.get(d)}function a(d,p,m){const b=!m,y=En(d);process.env.NODE_ENV!=="production"&&ys(y,p),y.aliasOf=m&&m.record;const w=xn(t,d),N=[y];if("alias"in d){const D=typeof d.alias=="string"?[d.alias]:d.alias;for(const S of D)N.push(En(T({},y,{components:m?m.record.components:y.components,path:S,aliasOf:m?m.record:y})))}let x,k;for(const D of N){const{path:S}=D;if(p&&S[0]!=="/"){const I=p.record.path,P=I[I.length-1]==="/"?"":"/";D.path=p.record.path+(S&&P+S)}if(process.env.NODE_ENV!=="production"&&D.path==="*")throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
18
- See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(x=ps(D,p,w),process.env.NODE_ENV!=="production"&&p&&S[0]==="/"&&ws(x,p),m?(m.alias.push(x),process.env.NODE_ENV!=="production"&&bs(m,x)):(k=k||x,k!==x&&k.alias.push(x),b&&d.name&&!_n(x)&&i(d.name)),kn(x)&&u(x),y.children){const I=y.children;for(let P=0;P<I.length;P++)a(I[P],x,m&&m.children[P])}m=m||x}return k?()=>{i(k)}:ge}function i(d){if(hn(d)){const p=r.get(d);p&&(r.delete(d),n.splice(n.indexOf(p),1),p.children.forEach(i),p.alias.forEach(i))}else{const p=n.indexOf(d);p>-1&&(n.splice(p,1),d.record.name&&r.delete(d.record.name),d.children.forEach(i),d.alias.forEach(i))}}function l(){return n}function u(d){const p=Es(d,n);n.splice(p,0,d),d.record.name&&!_n(d)&&r.set(d.record.name,d)}function f(d,p){let m,b={},y,w;if("name"in d&&d.name){if(m=r.get(d.name),!m)throw ce(1,{location:d});if(process.env.NODE_ENV!=="production"){const k=Object.keys(d.params||{}).filter(D=>!m.keys.find(S=>S.name===D));k.length&&v(`Discarded invalid param(s) "${k.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}w=m.record.name,b=T(wn(p.params,m.keys.filter(k=>!k.optional).concat(m.parent?m.parent.keys.filter(k=>k.optional):[]).map(k=>k.name)),d.params&&wn(d.params,m.keys.map(k=>k.name))),y=m.stringify(b)}else if(d.path!=null)y=d.path,process.env.NODE_ENV!=="production"&&!y.startsWith("/")&&v(`The Matcher cannot resolve relative paths but received "${y}". Unless you directly called \`matcher.resolve("${y}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),m=n.find(k=>k.re.test(y)),m&&(b=m.parse(y),w=m.record.name);else{if(m=p.name?r.get(p.name):n.find(k=>k.re.test(p.path)),!m)throw ce(1,{location:d,currentLocation:p});w=m.record.name,b=T({},p.params,d.params),y=m.stringify(b)}const N=[];let x=m;for(;x;)N.unshift(x.record),x=x.parent;return{name:w,path:y,params:b,matched:N,meta:gs(N)}}e.forEach(d=>a(d));function c(){n.length=0,r.clear()}return{addRoute:a,resolve:f,removeRoute:i,clearRoutes:c,getRoutes:l,getRecordMatcher:o}}function wn(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function En(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:ms(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function ms(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function _n(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function gs(e){return e.reduce((t,n)=>T(t,n.meta),{})}function xn(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}function st(e,t){return e.name===t.name&&e.optional===t.optional&&e.repeatable===t.repeatable}function bs(e,t){for(const n of e.keys)if(!n.optional&&!t.keys.find(st.bind(null,n)))return v(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);for(const n of t.keys)if(!n.optional&&!e.keys.find(st.bind(null,n)))return v(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`)}function ys(e,t){t&&t.record.name&&!e.name&&!e.path&&v(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)}function ws(e,t){for(const n of t.keys)if(!e.keys.find(st.bind(null,n)))return v(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`)}function Es(e,t){let n=0,r=t.length;for(;n!==r;){const a=n+r>>1;bn(e,t[a])<0?r=a:n=a+1}const o=_s(e);return o&&(r=t.lastIndexOf(o,r-1),process.env.NODE_ENV!=="production"&&r<0&&v(`Finding ancestor route "${o.record.path}" failed for "${e.record.path}"`)),r}function _s(e){let t=e;for(;t=t.parent;)if(kn(t)&&bn(e,t)===0)return t}function kn({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function xs(e){const t={};if(e===""||e==="?")return t;const r=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;o<r.length;++o){const a=r[o].replace(nn," "),i=a.indexOf("="),l=le(i<0?a:a.slice(0,i)),u=i<0?null:le(a.slice(i+1));if(l in t){let f=t[l];q(f)||(f=t[l]=[f]),f.push(u)}else t[l]=u}return t}function Cn(e){let t="";for(let n in e){const r=e[n];if(n=Mo(n),r==null){r!==void 0&&(t+=(t.length?"&":"")+n);continue}(q(r)?r.map(a=>a&&tt(a)):[r&&tt(r)]).forEach(a=>{a!==void 0&&(t+=(t.length?"&":"")+n,a!=null&&(t+="="+a))})}return t}function ks(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=q(r)?r.map(o=>o==null?null:""+o):r==null?r:""+r)}return t}const Cs=Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),Nn=Symbol(process.env.NODE_ENV!=="production"?"router view depth":""),at=Symbol(process.env.NODE_ENV!=="production"?"router":""),Sn=Symbol(process.env.NODE_ENV!=="production"?"route location":""),it=Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function we(){let e=[];function t(r){return e.push(r),()=>{const o=e.indexOf(r);o>-1&&e.splice(o,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function X(e,t,n,r,o,a=i=>i()){const i=r&&(r.enterCallbacks[o]=r.enterCallbacks[o]||[]);return()=>new Promise((l,u)=>{const f=p=>{p===!1?u(ce(4,{from:n,to:t})):p instanceof Error?u(p):Te(p)?u(ce(2,{from:t,to:p})):(i&&r.enterCallbacks[o]===i&&typeof p=="function"&&i.push(p),l())},c=a(()=>e.call(r&&r.instances[o],t,n,process.env.NODE_ENV!=="production"?Ns(f,t,n):f));let d=Promise.resolve(c);if(e.length<3&&(d=d.then(f)),process.env.NODE_ENV!=="production"&&e.length>2){const p=`The "next" callback was never called inside of ${e.name?'"'+e.name+'"':""}:
19
- ${e.toString()}
20
- . If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof c=="object"&&"then"in c)d=d.then(m=>f._called?m:(v(p),Promise.reject(new Error("Invalid navigation guard"))));else if(c!==void 0&&!f._called){v(p),u(new Error("Invalid navigation guard"));return}}d.catch(p=>u(p))})}function Ns(e,t,n){let r=0;return function(){r++===1&&v(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),e._called=!0,r===1&&e.apply(null,arguments)}}function lt(e,t,n,r,o=a=>a()){const a=[];for(const i of e){process.env.NODE_ENV!=="production"&&!i.components&&!i.children.length&&v(`Record with path "${i.path}" is either missing a "component(s)" or "children" property.`);for(const l in i.components){let u=i.components[l];if(process.env.NODE_ENV!=="production"){if(!u||typeof u!="object"&&typeof u!="function")throw v(`Component "${l}" in record with path "${i.path}" is not a valid component. Received "${String(u)}".`),new Error("Invalid route component");if("then"in u){v(`Component "${l}" in record with path "${i.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);const f=u;u=()=>f}else u.__asyncLoader&&!u.__warnedDefineAsync&&(u.__warnedDefineAsync=!0,v(`Component "${l}" in record with path "${i.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(t!=="beforeRouteEnter"&&!i.instances[l]))if(en(u)){const c=(u.__vccOpts||u)[t];c&&a.push(X(c,n,r,i,l,o))}else{let f=u();process.env.NODE_ENV!=="production"&&!("catch"in f)&&(v(`Component "${l}" in record with path "${i.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),f=Promise.resolve(f)),a.push(()=>f.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${l}" at "${i.path}"`);const d=Ro(c)?c.default:c;i.mods[l]=c,i.components[l]=d;const m=(d.__vccOpts||d)[t];return m&&X(m,n,r,i,l,o)()}))}}}return a}function Rn(e){const t=s.inject(at),n=s.inject(Sn);let r=!1,o=null;const a=s.computed(()=>{const c=s.unref(e.to);return process.env.NODE_ENV!=="production"&&(!r||c!==o)&&(Te(c)||(r?v(`Invalid value for prop "to" in useLink()
21
- - to:`,c,`
22
- - previous to:`,o,`
23
- - props:`,e):v(`Invalid value for prop "to" in useLink()
24
- - to:`,c,`
25
- - props:`,e)),o=c,r=!0),t.resolve(c)}),i=s.computed(()=>{const{matched:c}=a.value,{length:d}=c,p=c[d-1],m=n.matched;if(!p||!m.length)return-1;const b=m.findIndex(Z.bind(null,p));if(b>-1)return b;const y=vn(c[d-2]);return d>1&&vn(p)===y&&m[m.length-1].path!==y?m.findIndex(Z.bind(null,c[d-2])):b}),l=s.computed(()=>i.value>-1&&vs(n.params,a.value.params)),u=s.computed(()=>i.value>-1&&i.value===n.matched.length-1&&cn(n.params,a.value.params));function f(c={}){return Rs(c)?t[s.unref(e.replace)?"replace":"push"](s.unref(e.to)).catch(ge):Promise.resolve()}if(process.env.NODE_ENV!=="production"&&K){const c=s.getCurrentInstance();if(c){const d={route:a.value,isActive:l.value,isExactActive:u.value,error:null};c.__vrl_devtools=c.__vrl_devtools||[],c.__vrl_devtools.push(d),s.watchEffect(()=>{d.route=a.value,d.isActive=l.value,d.isExactActive=u.value,d.error=Te(s.unref(e.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:a,href:s.computed(()=>a.value.href),isActive:l,isExactActive:u,navigate:f}}const Ss=s.defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:Rn,setup(e,{slots:t}){const n=s.reactive(Rn(e)),{options:r}=s.inject(at),o=s.computed(()=>({[Vn(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[Vn(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const a=t.default&&t.default(n);return e.custom?a:s.h("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:o.value},a)}}});function Rs(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function vs(e,t){for(const n in t){const r=t[n],o=e[n];if(typeof r=="string"){if(r!==o)return!1}else if(!q(o)||o.length!==r.length||r.some((a,i)=>a!==o[i]))return!1}return!0}function vn(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const Vn=(e,t,n)=>e??t??n,Vs=s.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){process.env.NODE_ENV!=="production"&&Os();const r=s.inject(it),o=s.computed(()=>e.route||r.value),a=s.inject(Nn,0),i=s.computed(()=>{let f=s.unref(a);const{matched:c}=o.value;let d;for(;(d=c[f])&&!d.components;)f++;return f}),l=s.computed(()=>o.value.matched[i.value]);s.provide(Nn,s.computed(()=>i.value+1)),s.provide(Cs,l),s.provide(it,o);const u=s.ref();return s.watch(()=>[u.value,l.value,e.name],([f,c,d],[p,m,b])=>{c&&(c.instances[d]=f,m&&m!==c&&f&&f===p&&(c.leaveGuards.size||(c.leaveGuards=m.leaveGuards),c.updateGuards.size||(c.updateGuards=m.updateGuards))),f&&c&&(!m||!Z(c,m)||!p)&&(c.enterCallbacks[d]||[]).forEach(y=>y(f))},{flush:"post"}),()=>{const f=o.value,c=e.name,d=l.value,p=d&&d.components[c];if(!p)return $n(n.default,{Component:p,route:f});const m=d.props[c],b=m?m===!0?f.params:typeof m=="function"?m(f):m:null,y=N=>{N.component.isUnmounted&&(d.instances[c]=null)},w=s.h(p,T({},b,t,{onVnodeUnmounted:y,ref:u}));if(process.env.NODE_ENV!=="production"&&K&&w.ref){const N={depth:i.value,name:d.name,path:d.path,meta:d.meta};(q(w.ref)?w.ref.map(k=>k.i):[w.ref.i]).forEach(k=>{k.__vrv_devtools=N})}return $n(n.default,{Component:w,route:f})||w}}});function $n(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const $s=Vs;function Os(){const e=s.getCurrentInstance(),t=e.parent&&e.parent.type.name,n=e.parent&&e.parent.subTree&&e.parent.subTree.type;if(t&&(t==="KeepAlive"||t.includes("Transition"))&&typeof n=="object"&&n.name==="RouterView"){const r=t==="KeepAlive"?"keep-alive":"transition";v(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
17
+ `+JSON.stringify(i):""}`},2({from:n,to:i}){return`Redirected from "${n.fullPath}" to "${kv(i)}" via a navigation guard.`},4({from:n,to:i}){return`Navigation aborted from "${n.fullPath}" to "${i.fullPath}" via a navigation guard.`},8({from:n,to:i}){return`Navigation cancelled from "${n.fullPath}" to "${i.fullPath}" with a new navigation.`},16({from:n,to:i}){return`Avoided redundant navigation to current location: "${n.fullPath}".`}};function Pa(n,i){return process.env.NODE_ENV!=="production"?ii(new Error(wv[n](i)),{type:n,[Bd]:!0},i):ii(new Error,{type:n,[Bd]:!0},i)}function fs(n,i){return n instanceof Error&&Bd in n&&(i==null||!!(n.type&i))}const Sv=["params","query","hash"];function kv(n){if(typeof n=="string")return n;if(n.path!=null)return n.path;const i={};for(const o of Sv)o in n&&(i[o]=n[o]);return JSON.stringify(i,null,2)}const og="[^/]+?",Ev={sensitive:!1,strict:!1,start:!0,end:!0},Tv=/[.+*?^${}()[\]/\\]/g;function Cv(n,i){const o=ii({},Ev,i),c=[];let p=o.start?"^":"";const b=[];for(const A of n){const D=A.length?[]:[90];o.strict&&!A.length&&(p+="/");for(let R=0;R<A.length;R++){const z=A[R];let j=40+(o.sensitive?.25:0);if(z.type===0)R||(p+="/"),p+=z.value.replace(Tv,"\\$&"),j+=40;else if(z.type===1){const{value:Y,repeatable:ee,optional:oe,regexp:ue}=z;b.push({name:Y,repeatable:ee,optional:oe});const be=ue||og;if(be!==og){j+=10;try{new RegExp(`(${be})`)}catch(Ce){throw new Error(`Invalid custom RegExp for param "${Y}" (${be}): `+Ce.message)}}let _e=ee?`((?:${be})(?:/(?:${be}))*)`:`(${be})`;R||(_e=oe&&A.length<2?`(?:/${_e})`:"/"+_e),oe&&(_e+="?"),p+=_e,j+=20,oe&&(j+=-8),ee&&(j+=-20),be===".*"&&(j+=-50)}D.push(j)}c.push(D)}if(o.strict&&o.end){const A=c.length-1;c[A][c[A].length-1]+=.7000000000000001}o.strict||(p+="/?"),o.end?p+="$":o.strict&&(p+="(?:/|$)");const _=new RegExp(p,o.sensitive?"":"i");function h(A){const D=A.match(_),R={};if(!D)return null;for(let z=1;z<D.length;z++){const j=D[z]||"",Y=b[z-1];R[Y.name]=j&&Y.repeatable?j.split("/"):j}return R}function M(A){let D="",R=!1;for(const z of n){(!R||!D.endsWith("/"))&&(D+="/"),R=!1;for(const j of z)if(j.type===0)D+=j.value;else if(j.type===1){const{value:Y,repeatable:ee,optional:oe}=j,ue=Y in A?A[Y]:"";if(Qn(ue)&&!ee)throw new Error(`Provided param "${Y}" is an array but it is not repeatable (* or + modifiers)`);const be=Qn(ue)?ue.join("/"):ue;if(!be)if(oe)z.length<2&&(D.endsWith("/")?D=D.slice(0,-1):R=!0);else throw new Error(`Missing required param "${Y}"`);D+=be}}return D||"/"}return{re:_,score:c,keys:b,parse:h,stringify:M}}function Mv(n,i){let o=0;for(;o<n.length&&o<i.length;){const c=i[o]-n[o];if(c)return c;o++}return n.length<i.length?n.length===1&&n[0]===80?-1:1:n.length>i.length?i.length===1&&i[0]===80?1:-1:0}function ag(n,i){let o=0;const c=n.score,p=i.score;for(;o<c.length&&o<p.length;){const b=Mv(c[o],p[o]);if(b)return b;o++}if(Math.abs(p.length-c.length)===1){if(lg(c))return 1;if(lg(p))return-1}return p.length-c.length}function lg(n){const i=n[n.length-1];return n.length>0&&i[i.length-1]<0}const Pv={type:0,value:""},Iv=/[a-zA-Z0-9_]/;function Av(n){if(!n)return[[]];if(n==="/")return[[Pv]];if(!n.startsWith("/"))throw new Error(process.env.NODE_ENV!=="production"?`Route paths should start with a "/": "${n}" should be "/${n}".`:`Invalid path "${n}"`);function i(j){throw new Error(`ERR (${o})/"${A}": ${j}`)}let o=0,c=o;const p=[];let b;function _(){b&&p.push(b),b=[]}let h=0,M,A="",D="";function R(){A&&(o===0?b.push({type:0,value:A}):o===1||o===2||o===3?(b.length>1&&(M==="*"||M==="+")&&i(`A repeatable param (${A}) must be alone in its segment. eg: '/:ids+.`),b.push({type:1,value:A,regexp:D,repeatable:M==="*"||M==="+",optional:M==="*"||M==="?"})):i("Invalid state to consume buffer"),A="")}function z(){A+=M}for(;h<n.length;){if(M=n[h++],M==="\\"&&o!==2){c=o,o=4;continue}switch(o){case 0:M==="/"?(A&&R(),_()):M===":"?(R(),o=1):z();break;case 4:z(),o=c;break;case 1:M==="("?o=2:Iv.test(M)?z():(R(),o=0,M!=="*"&&M!=="?"&&M!=="+"&&h--);break;case 2:M===")"?D[D.length-1]=="\\"?D=D.slice(0,-1)+M:o=3:D+=M;break;case 3:R(),o=0,M!=="*"&&M!=="?"&&M!=="+"&&h--,D="";break;default:i("Unknown state");break}}return o===2&&i(`Unfinished custom RegExp for param "${A}"`),R(),_(),p}function Dv(n,i,o){const c=Cv(Av(n.path),o);if(process.env.NODE_ENV!=="production"){const b=new Set;for(const _ of c.keys)b.has(_.name)&&Ft(`Found duplicated params with name "${_.name}" for path "${n.path}". Only the last one will be available on "$route.params".`),b.add(_.name)}const p=ii(c,{record:n,parent:i,children:[],alias:[]});return i&&!p.record.aliasOf==!i.record.aliasOf&&i.children.push(p),p}function zv(n,i){const o=[],c=new Map;i=dg({strict:!1,end:!0,sensitive:!1},i);function p(R){return c.get(R)}function b(R,z,j){const Y=!j,ee=hg(R);process.env.NODE_ENV!=="production"&&Bv(ee,z),ee.aliasOf=j&&j.record;const oe=dg(i,R),ue=[ee];if("alias"in R){const Ce=typeof R.alias=="string"?[R.alias]:R.alias;for(const Qe of Ce)ue.push(hg(ii({},ee,{components:j?j.record.components:ee.components,path:Qe,aliasOf:j?j.record:ee})))}let be,_e;for(const Ce of ue){const{path:Qe}=Ce;if(z&&Qe[0]!=="/"){const mt=z.record.path,Ae=mt[mt.length-1]==="/"?"":"/";Ce.path=z.record.path+(Qe&&Ae+Qe)}if(process.env.NODE_ENV!=="production"&&Ce.path==="*")throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
18
+ See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);if(be=Dv(Ce,z,oe),process.env.NODE_ENV!=="production"&&z&&Qe[0]==="/"&&Fv(be,z),j?(j.alias.push(be),process.env.NODE_ENV!=="production"&&Ov(j,be)):(_e=_e||be,_e!==be&&_e.alias.push(be),Y&&R.name&&!ug(be)&&_(R.name)),pg(be)&&M(be),ee.children){const mt=ee.children;for(let Ae=0;Ae<mt.length;Ae++)b(mt[Ae],be,j&&j.children[Ae])}j=j||be}return _e?()=>{_(_e)}:Ul}function _(R){if(rg(R)){const z=c.get(R);z&&(c.delete(R),o.splice(o.indexOf(z),1),z.children.forEach(_),z.alias.forEach(_))}else{const z=o.indexOf(R);z>-1&&(o.splice(z,1),R.record.name&&c.delete(R.record.name),R.children.forEach(_),R.alias.forEach(_))}}function h(){return o}function M(R){const z=Nv(R,o);o.splice(z,0,R),R.record.name&&!ug(R)&&c.set(R.record.name,R)}function A(R,z){let j,Y={},ee,oe;if("name"in R&&R.name){if(j=c.get(R.name),!j)throw Pa(1,{location:R});if(process.env.NODE_ENV!=="production"){const _e=Object.keys(R.params||{}).filter(Ce=>!j.keys.find(Qe=>Qe.name===Ce));_e.length&&Ft(`Discarded invalid param(s) "${_e.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`)}oe=j.record.name,Y=ii(cg(z.params,j.keys.filter(_e=>!_e.optional).concat(j.parent?j.parent.keys.filter(_e=>_e.optional):[]).map(_e=>_e.name)),R.params&&cg(R.params,j.keys.map(_e=>_e.name))),ee=j.stringify(Y)}else if(R.path!=null)ee=R.path,process.env.NODE_ENV!=="production"&&!ee.startsWith("/")&&Ft(`The Matcher cannot resolve relative paths but received "${ee}". Unless you directly called \`matcher.resolve("${ee}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`),j=o.find(_e=>_e.re.test(ee)),j&&(Y=j.parse(ee),oe=j.record.name);else{if(j=z.name?c.get(z.name):o.find(_e=>_e.re.test(z.path)),!j)throw Pa(1,{location:R,currentLocation:z});oe=j.record.name,Y=ii({},z.params,R.params),ee=j.stringify(Y)}const ue=[];let be=j;for(;be;)ue.unshift(be.record),be=be.parent;return{name:oe,path:ee,params:Y,matched:ue,meta:Lv(ue)}}n.forEach(R=>b(R));function D(){o.length=0,c.clear()}return{addRoute:b,resolve:A,removeRoute:_,clearRoutes:D,getRoutes:h,getRecordMatcher:p}}function cg(n,i){const o={};for(const c of i)c in n&&(o[c]=n[c]);return o}function hg(n){const i={path:n.path,redirect:n.redirect,name:n.name,meta:n.meta||{},aliasOf:n.aliasOf,beforeEnter:n.beforeEnter,props:Rv(n),children:n.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in n?n.components||null:n.component&&{default:n.component}};return Object.defineProperty(i,"mods",{value:{}}),i}function Rv(n){const i={},o=n.props||!1;if("component"in n)i.default=o;else for(const c in n.components)i[c]=typeof o=="object"?o[c]:o;return i}function ug(n){for(;n;){if(n.record.aliasOf)return!0;n=n.parent}return!1}function Lv(n){return n.reduce((i,o)=>ii(i,o.meta),{})}function dg(n,i){const o={};for(const c in n)o[c]=c in i?i[c]:n[c];return o}function Fd(n,i){return n.name===i.name&&n.optional===i.optional&&n.repeatable===i.repeatable}function Ov(n,i){for(const o of n.keys)if(!o.optional&&!i.keys.find(Fd.bind(null,o)))return Ft(`Alias "${i.record.path}" and the original record: "${n.record.path}" must have the exact same param named "${o.name}"`);for(const o of i.keys)if(!o.optional&&!n.keys.find(Fd.bind(null,o)))return Ft(`Alias "${i.record.path}" and the original record: "${n.record.path}" must have the exact same param named "${o.name}"`)}function Bv(n,i){i&&i.record.name&&!n.name&&!n.path&&Ft(`The route named "${String(i.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`)}function Fv(n,i){for(const o of i.keys)if(!n.keys.find(Fd.bind(null,o)))return Ft(`Absolute path "${n.record.path}" must have the exact same param named "${o.name}" as its parent "${i.record.path}".`)}function Nv(n,i){let o=0,c=i.length;for(;o!==c;){const b=o+c>>1;ag(n,i[b])<0?c=b:o=b+1}const p=Vv(n);return p&&(c=i.lastIndexOf(p,c-1),process.env.NODE_ENV!=="production"&&c<0&&Ft(`Finding ancestor route "${p.record.path}" failed for "${n.record.path}"`)),c}function Vv(n){let i=n;for(;i=i.parent;)if(pg(i)&&ag(n,i)===0)return i}function pg({record:n}){return!!(n.name||n.components&&Object.keys(n.components).length||n.redirect)}function $v(n){const i={};if(n===""||n==="?")return i;const c=(n[0]==="?"?n.slice(1):n).split("&");for(let p=0;p<c.length;++p){const b=c[p].replace(Wm," "),_=b.indexOf("="),h=Ma(_<0?b:b.slice(0,_)),M=_<0?null:Ma(b.slice(_+1));if(h in i){let A=i[h];Qn(A)||(A=i[h]=[A]),A.push(M)}else i[h]=M}return i}function fg(n){let i="";for(let o in n){const c=n[o];if(o=nv(o),c==null){c!==void 0&&(i+=(i.length?"&":"")+o);continue}(Qn(c)?c.map(b=>b&&Rd(b)):[c&&Rd(c)]).forEach(b=>{b!==void 0&&(i+=(i.length?"&":"")+o,b!=null&&(i+="="+b))})}return i}function jv(n){const i={};for(const o in n){const c=n[o];c!==void 0&&(i[o]=Qn(c)?c.map(p=>p==null?null:""+p):c==null?c:""+c)}return i}const Uv=Symbol(process.env.NODE_ENV!=="production"?"router view location matched":""),mg=Symbol(process.env.NODE_ENV!=="production"?"router view depth":""),Nd=Symbol(process.env.NODE_ENV!=="production"?"router":""),gg=Symbol(process.env.NODE_ENV!=="production"?"route location":""),Vd=Symbol(process.env.NODE_ENV!=="production"?"router view location":"");function Zl(){let n=[];function i(c){return n.push(c),()=>{const p=n.indexOf(c);p>-1&&n.splice(p,1)}}function o(){n=[]}return{add:i,list:()=>n.slice(),reset:o}}function Ws(n,i,o,c,p,b=_=>_()){const _=c&&(c.enterCallbacks[p]=c.enterCallbacks[p]||[]);return()=>new Promise((h,M)=>{const A=z=>{z===!1?M(Pa(4,{from:o,to:i})):z instanceof Error?M(z):Ch(z)?M(Pa(2,{from:i,to:z})):(_&&c.enterCallbacks[p]===_&&typeof z=="function"&&_.push(z),h())},D=b(()=>n.call(c&&c.instances[p],i,o,process.env.NODE_ENV!=="production"?Hv(A,i,o):A));let R=Promise.resolve(D);if(n.length<3&&(R=R.then(A)),process.env.NODE_ENV!=="production"&&n.length>2){const z=`The "next" callback was never called inside of ${n.name?'"'+n.name+'"':""}:
19
+ ${n.toString()}
20
+ . If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;if(typeof D=="object"&&"then"in D)R=R.then(j=>A._called?j:(Ft(z),Promise.reject(new Error("Invalid navigation guard"))));else if(D!==void 0&&!A._called){Ft(z),M(new Error("Invalid navigation guard"));return}}R.catch(z=>M(z))})}function Hv(n,i,o){let c=0;return function(){c++===1&&Ft(`The "next" callback was called more than once in one navigation guard when going from "${o.fullPath}" to "${i.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`),n._called=!0,c===1&&n.apply(null,arguments)}}function $d(n,i,o,c,p=b=>b()){const b=[];for(const _ of n){process.env.NODE_ENV!=="production"&&!_.components&&!_.children.length&&Ft(`Record with path "${_.path}" is either missing a "component(s)" or "children" property.`);for(const h in _.components){let M=_.components[h];if(process.env.NODE_ENV!=="production"){if(!M||typeof M!="object"&&typeof M!="function")throw Ft(`Component "${h}" in record with path "${_.path}" is not a valid component. Received "${String(M)}".`),new Error("Invalid route component");if("then"in M){Ft(`Component "${h}" in record with path "${_.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);const A=M;M=()=>A}else M.__asyncLoader&&!M.__warnedDefineAsync&&(M.__warnedDefineAsync=!0,Ft(`Component "${h}" in record with path "${_.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`))}if(!(i!=="beforeRouteEnter"&&!_.instances[h]))if(qm(M)){const D=(M.__vccOpts||M)[i];D&&b.push(Ws(D,o,c,_,h,p))}else{let A=M();process.env.NODE_ENV!=="production"&&!("catch"in A)&&(Ft(`Component "${h}" in record with path "${_.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`),A=Promise.resolve(A)),b.push(()=>A.then(D=>{if(!D)throw new Error(`Couldn't resolve component "${h}" at "${_.path}"`);const R=Zb(D)?D.default:D;_.mods[h]=D,_.components[h]=R;const j=(R.__vccOpts||R)[i];return j&&Ws(j,o,c,_,h,p)()}))}}}return b}function yg(n){const i=k.inject(Nd),o=k.inject(gg);let c=!1,p=null;const b=k.computed(()=>{const D=k.unref(n.to);return process.env.NODE_ENV!=="production"&&(!c||D!==p)&&(Ch(D)||(c?Ft(`Invalid value for prop "to" in useLink()
21
+ - to:`,D,`
22
+ - previous to:`,p,`
23
+ - props:`,n):Ft(`Invalid value for prop "to" in useLink()
24
+ - to:`,D,`
25
+ - props:`,n)),p=D,c=!0),i.resolve(D)}),_=k.computed(()=>{const{matched:D}=b.value,{length:R}=D,z=D[R-1],j=o.matched;if(!z||!j.length)return-1;const Y=j.findIndex(qs.bind(null,z));if(Y>-1)return Y;const ee=_g(D[R-2]);return R>1&&_g(z)===ee&&j[j.length-1].path!==ee?j.findIndex(qs.bind(null,D[R-2])):Y}),h=k.computed(()=>_.value>-1&&Wv(o.params,b.value.params)),M=k.computed(()=>_.value>-1&&_.value===o.matched.length-1&&Qm(o.params,b.value.params));function A(D={}){return Zv(D)?i[k.unref(n.replace)?"replace":"push"](k.unref(n.to)).catch(Ul):Promise.resolve()}if(process.env.NODE_ENV!=="production"&&ps){const D=k.getCurrentInstance();if(D){const R={route:b.value,isActive:h.value,isExactActive:M.value,error:null};D.__vrl_devtools=D.__vrl_devtools||[],D.__vrl_devtools.push(R),k.watchEffect(()=>{R.route=b.value,R.isActive=h.value,R.isExactActive=M.value,R.error=Ch(k.unref(n.to))?null:'Invalid "to" value'},{flush:"post"})}}return{route:b,href:k.computed(()=>b.value.href),isActive:h,isExactActive:M,navigate:A}}const qv=k.defineComponent({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"}},useLink:yg,setup(n,{slots:i}){const o=k.reactive(yg(n)),{options:c}=k.inject(Nd),p=k.computed(()=>({[xg(n.activeClass,c.linkActiveClass,"router-link-active")]:o.isActive,[xg(n.exactActiveClass,c.linkExactActiveClass,"router-link-exact-active")]:o.isExactActive}));return()=>{const b=i.default&&i.default(o);return n.custom?b:k.h("a",{"aria-current":o.isExactActive?n.ariaCurrentValue:null,href:o.href,onClick:o.navigate,class:p.value},b)}}});function Zv(n){if(!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)&&!n.defaultPrevented&&!(n.button!==void 0&&n.button!==0)){if(n.currentTarget&&n.currentTarget.getAttribute){const i=n.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(i))return}return n.preventDefault&&n.preventDefault(),!0}}function Wv(n,i){for(const o in i){const c=i[o],p=n[o];if(typeof c=="string"){if(c!==p)return!1}else if(!Qn(p)||p.length!==c.length||c.some((b,_)=>b!==p[_]))return!1}return!0}function _g(n){return n?n.aliasOf?n.aliasOf.path:n.path:""}const xg=(n,i,o)=>n??i??o,Gv=k.defineComponent({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(n,{attrs:i,slots:o}){process.env.NODE_ENV!=="production"&&Xv();const c=k.inject(Vd),p=k.computed(()=>n.route||c.value),b=k.inject(mg,0),_=k.computed(()=>{let A=k.unref(b);const{matched:D}=p.value;let R;for(;(R=D[A])&&!R.components;)A++;return A}),h=k.computed(()=>p.value.matched[_.value]);k.provide(mg,k.computed(()=>_.value+1)),k.provide(Uv,h),k.provide(Vd,p);const M=k.ref();return k.watch(()=>[M.value,h.value,n.name],([A,D,R],[z,j,Y])=>{D&&(D.instances[R]=A,j&&j!==D&&A&&A===z&&(D.leaveGuards.size||(D.leaveGuards=j.leaveGuards),D.updateGuards.size||(D.updateGuards=j.updateGuards))),A&&D&&(!j||!qs(D,j)||!z)&&(D.enterCallbacks[R]||[]).forEach(ee=>ee(A))},{flush:"post"}),()=>{const A=p.value,D=n.name,R=h.value,z=R&&R.components[D];if(!z)return bg(o.default,{Component:z,route:A});const j=R.props[D],Y=j?j===!0?A.params:typeof j=="function"?j(A):j:null,ee=ue=>{ue.component.isUnmounted&&(R.instances[D]=null)},oe=k.h(z,ii({},Y,i,{onVnodeUnmounted:ee,ref:M}));if(process.env.NODE_ENV!=="production"&&ps&&oe.ref){const ue={depth:_.value,name:R.name,path:R.path,meta:R.meta};(Qn(oe.ref)?oe.ref.map(_e=>_e.i):[oe.ref.i]).forEach(_e=>{_e.__vrv_devtools=ue})}return bg(o.default,{Component:oe,route:A})||oe}}});function bg(n,i){if(!n)return null;const o=n(i);return o.length===1?o[0]:o}const Yv=Gv;function Xv(){const n=k.getCurrentInstance(),i=n.parent&&n.parent.type.name,o=n.parent&&n.parent.subTree&&n.parent.subTree.type;if(i&&(i==="KeepAlive"||i.includes("Transition"))&&typeof o=="object"&&o.name==="RouterView"){const c=i==="KeepAlive"?"keep-alive":"transition";Ft(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
26
26
  Use slot props instead:
27
27
 
28
28
  <router-view v-slot="{ Component }">
29
- <${r}>
29
+ <${c}>
30
30
  <component :is="Component" />
31
- </${r}>
32
- </router-view>`)}}function Ee(e,t){const n=T({},e,{matched:e.matched.map(r=>Us(r,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:e.fullPath,tooltip:t,value:n}}}function Pe(e){return{_custom:{display:e}}}let Ts=0;function Ps(e,t,n){if(t.__hasDevtools)return;t.__hasDevtools=!0;const r=Ts++;So({id:"org.vuejs.router"+(r?"."+r:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:e},o=>{typeof o.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),o.on.inspectComponent((c,d)=>{c.instanceData&&c.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Ee(t.currentRoute.value,"Current Route")})}),o.on.visitComponentTree(({treeNode:c,componentInstance:d})=>{if(d.__vrv_devtools){const p=d.__vrv_devtools;c.tags.push({label:(p.name?`${p.name.toString()}: `:"")+p.path,textColor:0,tooltip:"This component is rendered by &lt;router-view&gt;",backgroundColor:On})}q(d.__vrl_devtools)&&(d.__devtoolsApi=o,d.__vrl_devtools.forEach(p=>{let m=p.route.path,b=An,y="",w=0;p.error?(m=p.error,b=Ms,w=Ls):p.isExactActive?(b=Pn,y="This is exactly active"):p.isActive&&(b=Tn,y="This link is active"),c.tags.push({label:m,textColor:w,tooltip:y,backgroundColor:b})}))}),s.watch(t.currentRoute,()=>{u(),o.notifyComponentUpdate(),o.sendInspectorTree(l),o.sendInspectorState(l)});const a="router:navigations:"+r;o.addTimelineLayer({id:a,label:`Router${r?" "+r:""} Navigations`,color:4237508}),t.onError((c,d)=>{o.addTimelineEvent({layerId:a,event:{title:"Error during Navigation",subtitle:d.fullPath,logType:"error",time:o.now(),data:{error:c},groupId:d.meta.__navigationId}})});let i=0;t.beforeEach((c,d)=>{const p={guard:Pe("beforeEach"),from:Ee(d,"Current Location during this navigation"),to:Ee(c,"Target location")};Object.defineProperty(c.meta,"__navigationId",{value:i++}),o.addTimelineEvent({layerId:a,event:{time:o.now(),title:"Start of navigation",subtitle:c.fullPath,data:p,groupId:c.meta.__navigationId}})}),t.afterEach((c,d,p)=>{const m={guard:Pe("afterEach")};p?(m.failure={_custom:{type:Error,readOnly:!0,display:p?p.message:"",tooltip:"Navigation Failure",value:p}},m.status=Pe("❌")):m.status=Pe("✅"),m.from=Ee(d,"Current Location during this navigation"),m.to=Ee(c,"Target location"),o.addTimelineEvent({layerId:a,event:{title:"End of navigation",subtitle:c.fullPath,time:o.now(),data:m,logType:p?"warning":"default",groupId:c.meta.__navigationId}})});const l="router-inspector:"+r;o.addInspector({id:l,label:"Routes"+(r?" "+r:""),icon:"book",treeFilterPlaceholder:"Search routes"});function u(){if(!f)return;const c=f;let d=n.getRoutes().filter(p=>!p.parent||!p.parent.record.components);d.forEach(In),c.filter&&(d=d.filter(p=>ct(p,c.filter.toLowerCase()))),d.forEach(p=>Dn(p,t.currentRoute.value)),c.rootNodes=d.map(Bn)}let f;o.on.getInspectorTree(c=>{f=c,c.app===e&&c.inspectorId===l&&u()}),o.on.getInspectorState(c=>{if(c.app===e&&c.inspectorId===l){const p=n.getRoutes().find(m=>m.record.__vd_id===c.nodeId);p&&(c.state={options:Bs(p)})}}),o.sendInspectorTree(l),o.sendInspectorState(l)})}function As(e){return e.optional?e.repeatable?"*":"?":e.repeatable?"+":""}function Bs(e){const{record:t}=e,n=[{editable:!1,key:"path",value:t.path}];return t.name!=null&&n.push({editable:!1,key:"name",value:t.name}),n.push({editable:!1,key:"regexp",value:e.re}),e.keys.length&&n.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:e.keys.map(r=>`${r.name}${As(r)}`).join(" "),tooltip:"Param keys",value:e.keys}}}),t.redirect!=null&&n.push({editable:!1,key:"redirect",value:t.redirect}),e.alias.length&&n.push({editable:!1,key:"aliases",value:e.alias.map(r=>r.record.path)}),Object.keys(e.record.meta).length&&n.push({editable:!1,key:"meta",value:e.record.meta}),n.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:e.score.map(r=>r.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:e.score}}}),n}const On=15485081,Tn=2450411,Pn=8702998,Ds=2282478,An=16486972,Is=6710886,Ms=16704226,Ls=12131356;function Bn(e){const t=[],{record:n}=e;n.name!=null&&t.push({label:String(n.name),textColor:0,backgroundColor:Ds}),n.aliasOf&&t.push({label:"alias",textColor:0,backgroundColor:An}),e.__vd_match&&t.push({label:"matches",textColor:0,backgroundColor:On}),e.__vd_exactActive&&t.push({label:"exact",textColor:0,backgroundColor:Pn}),e.__vd_active&&t.push({label:"active",textColor:0,backgroundColor:Tn}),n.redirect&&t.push({label:typeof n.redirect=="string"?`redirect: ${n.redirect}`:"redirects",textColor:16777215,backgroundColor:Is});let r=n.__vd_id;return r==null&&(r=String(js++),n.__vd_id=r),{id:r,label:n.path,tags:t,children:e.children.map(Bn)}}let js=0;const Fs=/^\/(.*)\/([a-z]*)$/;function Dn(e,t){const n=t.matched.length&&Z(t.matched[t.matched.length-1],e.record);e.__vd_exactActive=e.__vd_active=n,n||(e.__vd_active=t.matched.some(r=>Z(r,e.record))),e.children.forEach(r=>Dn(r,t))}function In(e){e.__vd_match=!1,e.children.forEach(In)}function ct(e,t){const n=String(e.re).match(Fs);if(e.__vd_match=!1,!n||n.length<3)return!1;if(new RegExp(n[1].replace(/\$$/,""),n[2]).test(t))return e.children.forEach(i=>ct(i,t)),e.record.path!=="/"||t==="/"?(e.__vd_match=e.re.test(t),!0):!1;const o=e.record.path.toLowerCase(),a=le(o);return!t.startsWith("/")&&(a.includes(t)||o.includes(t))||a.startsWith(t)||o.startsWith(t)||e.record.name&&String(e.record.name).includes(t)?!0:e.children.some(i=>ct(i,t))}function Us(e,t){const n={};for(const r in e)t.includes(r)||(n[r]=e[r]);return n}function Hs(e){const t=hs(e.routes,e),n=e.parseQuery||xs,r=e.stringifyQuery||Cn,o=e.history;if(process.env.NODE_ENV!=="production"&&!o)throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');const a=we(),i=we(),l=we(),u=s.shallowRef(Q);let f=Q;K&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=Ye.bind(null,g=>""+g),d=Ye.bind(null,jo),p=Ye.bind(null,le);function m(g,_){let E,C;return hn(g)?(E=t.getRecordMatcher(g),process.env.NODE_ENV!=="production"&&!E&&v(`Parent route "${String(g)}" not found when adding child route`,_),C=_):C=g,t.addRoute(C,E)}function b(g){const _=t.getRecordMatcher(g);_?t.removeRoute(_):process.env.NODE_ENV!=="production"&&v(`Cannot remove non-existent route "${String(g)}"`)}function y(){return t.getRoutes().map(g=>g.record)}function w(g){return!!t.getRecordMatcher(g)}function N(g,_){if(_=T({},_||u.value),typeof g=="string"){const V=nt(n,g,_.path),M=t.resolve({path:V.path},_),re=o.createHref(V.fullPath);return process.env.NODE_ENV!=="production"&&(re.startsWith("//")?v(`Location "${g}" resolved to "${re}". A resolved location cannot start with multiple slashes.`):M.matched.length||v(`No match found for location with path "${g}"`)),T(V,M,{params:p(M.params),hash:le(V.hash),redirectedFrom:void 0,href:re})}if(process.env.NODE_ENV!=="production"&&!Te(g))return v(`router.resolve() was passed an invalid location. This will fail in production.
33
- - Location:`,g),N({});let E;if(g.path!=null)process.env.NODE_ENV!=="production"&&"params"in g&&!("name"in g)&&Object.keys(g.params).length&&v(`Path "${g.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),E=T({},g,{path:nt(n,g.path,_.path).path});else{const V=T({},g.params);for(const M in V)V[M]==null&&delete V[M];E=T({},g,{params:d(V)}),_.params=d(_.params)}const C=t.resolve(E,_),A=g.hash||"";process.env.NODE_ENV!=="production"&&A&&!A.startsWith("#")&&v(`A \`hash\` should always start with the character "#". Replace "${A}" with "#${A}".`),C.params=c(p(C.params));const L=Ho(r,T({},g,{hash:Io(A),path:C.path})),$=o.createHref(L);return process.env.NODE_ENV!=="production"&&($.startsWith("//")?v(`Location "${g}" resolved to "${$}". A resolved location cannot start with multiple slashes.`):C.matched.length||v(`No match found for location with path "${g.path!=null?g.path:g}"`)),T({fullPath:L,hash:A,query:r===Cn?ks(g.query):g.query||{}},C,{redirectedFrom:void 0,href:$})}function x(g){return typeof g=="string"?nt(n,g,u.value.path):T({},g)}function k(g,_){if(f!==g)return ce(8,{from:_,to:g})}function D(g){return P(g)}function S(g){return D(T(x(g),{replace:!0}))}function I(g){const _=g.matched[g.matched.length-1];if(_&&_.redirect){const{redirect:E}=_;let C=typeof E=="function"?E(g):E;if(typeof C=="string"&&(C=C.includes("?")||C.includes("#")?C=x(C):{path:C},C.params={}),process.env.NODE_ENV!=="production"&&C.path==null&&!("name"in C))throw v(`Invalid redirect found:
34
- ${JSON.stringify(C,null,2)}
35
- when navigating to "${g.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return T({query:g.query,hash:g.hash,params:C.path!=null?{}:g.params},C)}}function P(g,_){const E=f=N(g),C=u.value,A=g.state,L=g.force,$=g.replace===!0,V=I(E);if(V)return P(T(x(V),{state:typeof V=="object"?T({},A,V.state):A,force:L,replace:$}),_||E);const M=E;M.redirectedFrom=_;let re;return!L&&ln(r,C,E)&&(re=ce(16,{to:M,from:C}),qn(C,C,!0,!1)),(re?Promise.resolve(re):jn(M,C)).catch(j=>W(j)?W(j,2)?j:pt(j):ft(j,M,C)).then(j=>{if(j){if(W(j,2))return process.env.NODE_ENV!=="production"&&ln(r,N(j.to),M)&&_&&(_._count=_._count?_._count+1:1)>30?(v(`Detected a possibly infinite redirection in a navigation guard when going from "${C.fullPath}" to "${M.fullPath}". Aborting to avoid a Stack Overflow.
36
- Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):P(T({replace:$},x(j.to),{state:typeof j.to=="object"?T({},A,j.to.state):A,force:L}),_||M)}else j=Un(M,C,!0,$,A);return Fn(M,C,j),j})}function ne(g,_){const E=k(g,_);return E?Promise.reject(E):Promise.resolve()}function ue(g){const _=Be.values().next().value;return _&&typeof _.runWithContext=="function"?_.runWithContext(g):g()}function jn(g,_){let E;const[C,A,L]=qs(g,_);E=lt(C.reverse(),"beforeRouteLeave",g,_);for(const V of C)V.leaveGuards.forEach(M=>{E.push(X(M,g,_))});const $=ne.bind(null,g,_);return E.push($),de(E).then(()=>{E=[];for(const V of a.list())E.push(X(V,g,_));return E.push($),de(E)}).then(()=>{E=lt(A,"beforeRouteUpdate",g,_);for(const V of A)V.updateGuards.forEach(M=>{E.push(X(M,g,_))});return E.push($),de(E)}).then(()=>{E=[];for(const V of L)if(V.beforeEnter)if(q(V.beforeEnter))for(const M of V.beforeEnter)E.push(X(M,g,_));else E.push(X(V.beforeEnter,g,_));return E.push($),de(E)}).then(()=>(g.matched.forEach(V=>V.enterCallbacks={}),E=lt(L,"beforeRouteEnter",g,_,ue),E.push($),de(E))).then(()=>{E=[];for(const V of i.list())E.push(X(V,g,_));return E.push($),de(E)}).catch(V=>W(V,8)?V:Promise.reject(V))}function Fn(g,_,E){l.list().forEach(C=>ue(()=>C(g,_,E)))}function Un(g,_,E,C,A){const L=k(g,_);if(L)return L;const $=_===Q,V=K?history.state:{};E&&(C||$?o.replace(g.fullPath,T({scroll:$&&V&&V.scroll},A)):o.push(g.fullPath,A)),u.value=g,qn(g,_,E,$),pt()}let _e;function Ol(){_e||(_e=o.listen((g,_,E)=>{if(!zn.listening)return;const C=N(g),A=I(C);if(A){P(T(A,{replace:!0}),C).catch(ge);return}f=C;const L=u.value;K&&Qo(dn(L.fullPath,E.delta),Oe()),jn(C,L).catch($=>W($,12)?$:W($,2)?(P($.to,C).then(V=>{W(V,20)&&!E.delta&&E.type===be.pop&&o.go(-1,!1)}).catch(ge),Promise.reject()):(E.delta&&o.go(-E.delta,!1),ft($,C,L))).then($=>{$=$||Un(C,L,!1),$&&(E.delta&&!W($,8)?o.go(-E.delta,!1):E.type===be.pop&&W($,20)&&o.go(-1,!1)),Fn(C,L,$)}).catch(ge)}))}let dt=we(),Hn=we(),Ae;function ft(g,_,E){pt(g);const C=Hn.list();return C.length?C.forEach(A=>A(g,_,E)):(process.env.NODE_ENV!=="production"&&v("uncaught error during route navigation:"),console.error(g)),Promise.reject(g)}function Tl(){return Ae&&u.value!==Q?Promise.resolve():new Promise((g,_)=>{dt.add([g,_])})}function pt(g){return Ae||(Ae=!g,Ol(),dt.list().forEach(([_,E])=>g?E(g):_()),dt.reset()),g}function qn(g,_,E,C){const{scrollBehavior:A}=e;if(!K||!A)return Promise.resolve();const L=!E&&Xo(dn(g.fullPath,0))||(C||!E)&&history.state&&history.state.scroll||null;return s.nextTick().then(()=>A(g,_,L)).then($=>$&&Zo($)).catch($=>ft($,g,_))}const ht=g=>o.go(g);let mt;const Be=new Set,zn={currentRoute:u,listening:!0,addRoute:m,removeRoute:b,clearRoutes:t.clearRoutes,hasRoute:w,getRoutes:y,resolve:N,options:e,push:D,replace:S,go:ht,back:()=>ht(-1),forward:()=>ht(1),beforeEach:a.add,beforeResolve:i.add,afterEach:l.add,onError:Hn.add,isReady:Tl,install(g){const _=this;g.component("RouterLink",Ss),g.component("RouterView",$s),g.config.globalProperties.$router=_,Object.defineProperty(g.config.globalProperties,"$route",{enumerable:!0,get:()=>s.unref(u)}),K&&!mt&&u.value===Q&&(mt=!0,D(o.location).catch(A=>{process.env.NODE_ENV!=="production"&&v("Unexpected error when starting the router:",A)}));const E={};for(const A in Q)Object.defineProperty(E,A,{get:()=>u.value[A],enumerable:!0});g.provide(at,_),g.provide(Sn,s.shallowReactive(E)),g.provide(it,u);const C=g.unmount;Be.add(g),g.unmount=function(){Be.delete(g),Be.size<1&&(f=Q,_e&&_e(),_e=null,u.value=Q,mt=!1,Ae=!1),C()},process.env.NODE_ENV!=="production"&&K&&Ps(g,_,t)}};function de(g){return g.reduce((_,E)=>_.then(()=>ue(E)),Promise.resolve())}return zn}function qs(e,t){const n=[],r=[],o=[],a=Math.max(t.matched.length,e.matched.length);for(let i=0;i<a;i++){const l=t.matched[i];l&&(e.matched.find(f=>Z(f,l))?r.push(l):n.push(l));const u=e.matched[i];u&&(t.matched.find(f=>Z(f,u))||o.push(u))}return[n,r,o]}const zs=[{name:"edit",path:"/edit",component:()=>Promise.resolve().then(()=>ma)},{name:"add",path:"/add",component:()=>Promise.resolve().then(()=>ka)},{name:"card-view",path:"/card",component:()=>Promise.resolve().then(()=>Ln),children:[{name:"table",path:":table",component:()=>Promise.resolve().then(()=>Ln),children:[{name:"card",path:":id",component:()=>Promise.resolve().then(()=>Ta)}]}]}],Ks={},Ws={class:"bg-gray-200 w-full px-16 md:px-0 h-screen flex items-center justify-center"},Gs={class:"bg-white border border-gray-200 flex flex-col items-center justify-center px-4 md:px-8 lg:px-24 py-8 rounded-lg shadow-2xl"};function Js(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("div",Ws,[s.createElementVNode("div",Gs,[t[2]||(t[2]=s.createElementVNode("p",{class:"text-6xl md:text-7xl lg:text-9xl font-bold tracking-wider text-gray-300"}," 404 ",-1)),t[3]||(t[3]=s.createElementVNode("p",{class:"text-2xl md:text-3xl lg:text-5xl font-bold tracking-wider text-gray-500 mt-4"}," Сторінку не знайдено ",-1)),t[4]||(t[4]=s.createElementVNode("p",{class:"text-gray-500 mt-4 pb-4 border-b-2 text-center"}," Вибачте, така сторінка не існує ",-1)),s.createElementVNode("div",{onClick:t[0]||(t[0]=i=>e.$router.push("/")),class:"flex cursor-pointer items-center space-x-2 bg-blue-600 hover:bg-blue-700 text-gray-100 px-4 py-2 mt-6 rounded transition duration-150",title:"Return Home"},t[1]||(t[1]=[s.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[s.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1),s.createElementVNode("span",null,"Повернутись на головну",-1)]))])])}const Zs=B(Ks,[["render",Js]]),Qs=()=>{const e=zs.map(n=>({...n}));return{router:Hs({history:ns(),routes:[{path:"/404",name:"404",component:Zs},{path:"/",name:"global",component:()=>Promise.resolve().then(()=>si),children:[...e,{path:"/:catchAll(.*)",component:()=>Promise.resolve().then(()=>$l)}]}]}),routerData:e}},Xs={props:{value:{type:[String],default:()=>""}},data(){return{}}};function Ys(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("div",null,s.toDisplayString(n.value),1)}const ut=B(Xs,[["render",Ys]]),ea={props:{value:{type:[String],default:()=>""}},data(){return{}}},ta={class:"p-2 ps-1.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium bg-green-100 text-green-800 rounded-md"};function na(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("div",ta,s.toDisplayString(n.value),1)}const ra=B(ea,[["render",na]]),oa={props:{data:Object,name:String},computed:{getValue(){var e;return(e=this.data)==null?void 0:e[this.name]}}};function sa(e,t,n,r,o,a){const i=s.resolveComponent("VsSwitch");return s.openBlock(),s.createBlock(i,{modelValue:a.getValue,"onUpdate:modelValue":t[0]||(t[0]=l=>a.getValue=l),disabled:"true"},null,8,["modelValue"])}const aa={"table-format-text":ut,"table-format-select":ut,"table-format-badge":ra,"table-format-swetch":B(oa,[["render",sa]]),"table-format-html":ut},ia={admin:{install(e){O.defaults.baseURL&&(O.defaults.baseURL=O.defaults.baseURL);const{router:t}=Qs();e.component("admin",yo),e.config.globalProperties={...e.config.globalProperties,$componentsConfig:aa,$router:t},e.use(t)}}},G=s.ref(null),Mn={sur_name:{ua:"Прізвище",type:"text",validators:["required"]},user_name:{ua:"Ім'я",type:"text",validators:["required"]},father_name:{ua:"По батькові",type:"text"},email:{ua:"Email",type:"email",validators:["required"]},phone:{ua:"Номер телефону",type:"text"},avatar:{ua:"Аватар",type:"file"}},la={data(){return{formValues:{}}},computed:{form(){return Mn}},mounted(){},methods:{flattenMenu(e){const t=[];return e.forEach(n=>{n.menu?t.push(...this.flattenMenu(n.menu)):t.push(n)}),t}}},ca={style:{width:"calc(100vw - 260px)"}},ua={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},da={class:"flex items-center gap-[6px]"},fa={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},pa={class:"bg-white w-full rounded-xl border p-[20px]"};function ha(e,t,n,r,o,a){const i=s.resolveComponent("VsForm");return s.openBlock(),s.createElementBlock("div",ca,[s.createElementVNode("div",ua,[t[3]||(t[3]=s.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),s.createElementVNode("div",da,[s.createElementVNode("button",{onClick:t[0]||(t[0]=l=>e.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-100 text-gray-800 shadow bg-white focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),t[2]||(t[2]=s.createElementVNode("button",{class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ",-1))])]),s.createElementVNode("div",fa,[s.createElementVNode("div",pa,[s.createVNode(i,{scheme:a.form,modelValue:o.formValues,"onUpdate:modelValue":t[1]||(t[1]=l=>o.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])])])])}const ma=Object.freeze(Object.defineProperty({__proto__:null,default:B(la,[["render",ha]])},Symbol.toStringTag,{value:"Module"})),ga={data(){return{formValues:{}}},computed:{form(){return Mn}},mounted(){},methods:{flattenMenu(e){const t=[];return e.forEach(n=>{n.menu?t.push(...this.flattenMenu(n.menu)):t.push(n)}),t}},async createObject(){try{await axios.post("/api/",this.formValues),await this.$router.replace("")}catch{}}},ba={style:{width:"calc(100vw - 260px)"}},ya={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},wa={class:"flex items-center gap-[6px]"},Ea={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},_a={class:"bg-white w-full rounded-xl border p-[20px]"};function xa(e,t,n,r,o,a){const i=s.resolveComponent("VsForm");return s.openBlock(),s.createElementBlock("div",ba,[s.createElementVNode("div",ya,[t[3]||(t[3]=s.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),s.createElementVNode("div",wa,[s.createElementVNode("button",{onClick:t[0]||(t[0]=l=>e.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),t[2]||(t[2]=s.createElementVNode("button",{class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ",-1))])]),s.createElementVNode("div",Ea,[s.createElementVNode("div",_a,[s.createVNode(i,{scheme:a.form,modelValue:o.formValues,"onUpdate:modelValue":t[1]||(t[1]=l=>o.formValues=l),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])])])])}const ka=Object.freeze(Object.defineProperty({__proto__:null,default:B(ga,[["render",xa]])},Symbol.toStringTag,{value:"Module"})),Ca={};function Na(e,t,n,r,o,a){const i=s.resolveComponent("router-view");return s.openBlock(),s.createBlock(i)}const Ln=Object.freeze(Object.defineProperty({__proto__:null,default:B(Ca,[["render",Na]])},Symbol.toStringTag,{value:"Module"})),Sa={data(){return{objectData:null}},mounted(){this.getObjectData()},methods:{async getObjectData(){var n,r;const{table:e,id:t}=(n=this.$route)==null?void 0:n.params;(!e||!t)&&this.$router.replace("/404");try{const{data:o}=await O.get(`/api/table-data/${e}/${t}`);this.objectData=(r=o==null?void 0:o.data)==null?void 0:r.general_info,console.log(o==null?void 0:o.rows)}catch{}}}},Ra={style:{width:"calc(100vw - 260px)"}},va={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},Va={class:"p-[20px]"},$a=["innerHTML"];function Oa(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("div",Ra,[t[0]||(t[0]=s.createElementVNode("div",{class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},[s.createElementVNode("h2",{class:"text-xl font-medium"},"Створити"),s.createElementVNode("div",{class:"flex items-center gap-[6px]"},[s.createElementVNode("button",{class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"}," Редагувати ")])],-1)),s.createElementVNode("div",va,[s.createElementVNode("div",Va,[s.createElementVNode("div",{class:"bg-white w-full rounded-xl border p-[20px]",innerHTML:o.objectData},null,8,$a)])])])}const Ta=Object.freeze(Object.defineProperty({__proto__:null,default:B(Sa,[["render",Oa]])},Symbol.toStringTag,{value:"Module"})),Pa={},Aa={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-logout"};function Ba(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",Aa,t[0]||(t[0]=[s.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),s.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),s.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),s.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const Da=B(Pa,[["render",Ba]]),Ia={},Ma={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function La(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",Ma,t[0]||(t[0]=[s.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const ja=B(Ia,[["render",La]]),Fa={},Ua={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-chevron-down"};function Ha(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",Ua,t[0]||(t[0]=[s.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),s.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const qa={components:{IconChevronDown:B(Fa,[["render",Ha]])},props:{route:Object},data(){return{isOpen:!1}}},za={key:0,class:""},Ka={class:"ml-[30px] before:block before:absolute relative w-[196px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},Wa={key:1};function Ga(e,t,n,r,o,a){var u,f,c,d,p,m;const i=s.resolveComponent("IconChevronDown"),l=s.resolveComponent("router-link");return(u=n.route)!=null&&u.menu?(s.openBlock(),s.createElementBlock("div",za,[s.createElementVNode("button",{onClick:t[0]||(t[0]=b=>o.isOpen=!o.isOpen),class:"flex cursor-pointer gap-x-3 py-2 px-3 mb-[6px] text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-gray-800 rounded-lg items-center focus:bg-gray-100 hover:bg-gray-100 duration-300"},[s.createTextVNode(s.toDisplayString((f=n.route)==null?void 0:f.ua)+" ",1),s.createVNode(i,{class:s.normalizeClass([[o.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"16",height:"16"},null,8,["class"])]),s.createVNode(s.Transition,{name:"fade"},{default:s.withCtx(()=>{var b;return[s.withDirectives(s.createElementVNode("ul",Ka,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList((b=n.route)==null?void 0:b.menu,(y,w)=>{var N,x;return s.openBlock(),s.createElementBlock("li",{key:w,class:"w-full"},[s.createVNode(l,{to:"/"+(y==null?void 0:y.path),class:s.normalizeClass([[((x=(N=e.$route)==null?void 0:N.path)==null?void 0:x.includes(y==null?void 0:y.path))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(y==null?void 0:y.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[s.vShow,o.isOpen]])]}),_:1})])):(s.openBlock(),s.createElementBlock("div",Wa,[s.createVNode(l,{to:(c=n.route)==null?void 0:c.path,class:s.normalizeClass([[((m=(d=e.$route)==null?void 0:d.path)==null?void 0:m.includes((p=n.route)==null?void 0:p.path))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:s.withCtx(()=>{var b;return[s.createTextVNode(s.toDisplayString((b=n.route)==null?void 0:b.ua),1)]}),_:1},8,["to","class"])]))}const Ja={components:{IconLogout:Da,NavbarItem:B(qa,[["render",Ga]]),IconLogo:ja},data(){return{activeIndex:null,data:null,searchValue:""}},computed:{data(){var e,t;return(e=this.searchValue)!=null&&e.trim()?(t=this.flattenMenu(G.value))==null?void 0:t.filter(n=>{var r,o,a;return(a=(r=n==null?void 0:n.ua)==null?void 0:r.toLowerCase())==null?void 0:a.includes((o=this.searchValue)==null?void 0:o.toLowerCase())}):G.value}},methods:{flattenMenu(e){const t=[];return e.forEach(n=>{n.menu?t.push(...this.flattenMenu(n.menu)):t.push(n)}),t}}},Za={class:"flex flex-col h-[100vh] border-r w-[300px]"},Qa={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},Xa={class:"pb-3 w-full flex flex-col flex-wrap"},Ya={key:0,class:"flex flex-col gap-[6px]"},ei={key:1,class:"text-gray-800 text-lg mt-[20px]"};function ti(e,t,n,r,o,a){var u;const i=s.resolveComponent("IconLogo"),l=s.resolveComponent("NavbarItem");return s.openBlock(),s.createElementBlock("div",Za,[s.createVNode(i,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),s.withDirectives(s.createElementVNode("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=f=>o.searchValue=f),placeholder:"Пошук по меню",class:"h-[40px] block rounded-lg border mx-[10px] pl-[10px] focus:border-blue-600 focus:border-[2px] outline-none"},null,512),[[s.vModelText,o.searchValue]]),s.createElementVNode("div",Qa,[s.createElementVNode("nav",Xa,[(u=a.data)!=null&&u.length?(s.openBlock(),s.createElementBlock("ul",Ya,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.data,(f,c)=>(s.openBlock(),s.createElementBlock("li",{key:c},[s.createVNode(l,{route:f},null,8,["route"])]))),128))])):(s.openBlock(),s.createElementBlock("div",ei,"Нічього не знайдено"))])])])}const ni={components:{navbar:B(Ja,[["render",ti]])},mounted(){this.getMenu()},computed:{isMenu(){return G.value}},methods:{async getMenu(){try{const{data:e}=await O.get("/api/user-menu");G.value=e}catch{}}}},ri={class:"admin-wrapper"};function oi(e,t,n,r,o,a){const i=s.resolveComponent("navbar"),l=s.resolveComponent("router-view");return s.openBlock(),s.createElementBlock("div",ri,[s.createVNode(i),a.isMenu?(s.openBlock(),s.createBlock(l,{key:0})):s.createCommentVNode("",!0)])}const si=Object.freeze(Object.defineProperty({__proto__:null,default:B(ni,[["render",oi],["__scopeId","data-v-3a278cfb"]])},Symbol.toStringTag,{value:"Module"})),ai={},ii={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-adjustments-horizontal"};function li(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",ii,t[0]||(t[0]=[s.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 6l8 0"></path><path d="M16 6l4 0"></path><path d="M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 12l2 0"></path><path d="M10 12l10 0"></path><path d="M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 18l11 0"></path><path d="M19 18l1 0"></path>',10)]))}const ci=B(ai,[["render",li]]),ui={},di={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-dots-vertical"};function fi(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",di,t[0]||(t[0]=[s.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),s.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),s.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),s.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const pi=B(ui,[["render",fi]]),hi={},mi={class:"flex-shrink-0 size-3.5",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"};function gi(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",mi,t[0]||(t[0]=[s.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const bi=B(hi,[["render",gi]]),yi={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},wi={style:{display:"none"}},Ei=["height","width","fill"];function _i(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock(s.Fragment,null,[(s.openBlock(),s.createElementBlock("svg",wi,t[0]||(t[0]=[s.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[s.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(s.openBlock(),s.createElementBlock("svg",{height:n.height,width:n.width,fill:n.color},t[1]||(t[1]=[s.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,Ei))],64)}const xi={components:{IconMore:pi,IconDelete:bi,IconEdit:B(yi,[["render",_i]])},emits:["updateTable"],props:{item:Object,table:String},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var e;try{const{data:t}=await O.get(`/api/table/${this.table}/${(e=this.item)==null?void 0:e.id}`);this.formValue=t}catch(t){console.error(t)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var e;try{O.delete(`/api/table/${this.table}/${(e=this.item)==null?void 0:e.id}`),this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),this.$emit("update-table"),this.isDeleteConfirm=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},ki={class:"hs-dropdown [--placement:bottom-right] inline-flex"},Ci={id:"hs-pro-dupc1",type:"button",class:"gap-x-2 p-2 rounded-lg hover:border-transparent focus:outline-none text-black hover:bg-gray-50"},Ni={class:"pt-[7px] pb-[7px] flex flex-col items-start"},Si={class:"p-4"},Ri={class:"mt-4 flex justify-end gap-x-3"};function vi(e,t,n,r,o,a){const i=s.resolveComponent("IconMore"),l=s.resolveComponent("IconEdit"),u=s.resolveComponent("router-link"),f=s.resolveComponent("IconDelete"),c=s.resolveComponent("VsPopover"),d=s.resolveComponent("VsDialog");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",ki,[s.createVNode(c,{trigger:"click",placement:"left"},{reference:s.withCtx(()=>[s.createElementVNode("button",Ci,[s.createVNode(i,{height:"16",width:"16"})])]),default:s.withCtx(()=>{var p,m,b;return[s.createElementVNode("div",Ni,[s.createVNode(u,{to:`/edit?table=${(m=(p=e.$route)==null?void 0:p.params)==null?void 0:m.catchAll}&id=${(b=n.item)==null?void 0:b.id}`,class:"w-[100px] ml-[2px] flex items-center justify-center gap-x-3 rounded-lg text-[13px] text-gray-800"},{default:s.withCtx(()=>[s.createVNode(l,{color:"#000"}),t[4]||(t[4]=s.createTextVNode(" Редагувати "))]),_:1},8,["to"]),t[6]||(t[6]=s.createElementVNode("div",{class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto mt-[10px] mb-[10px]"},null,-1)),s.createElementVNode("button",{onClick:t[0]||(t[0]=s.withModifiers((...y)=>a.openConfirm&&a.openConfirm(...y),["stop"])),type:"button",class:"w-[100px] flex items-center justify-center gap-x-3 rounded-lg text-[14px] text-red-500"},[s.createVNode(f),t[5]||(t[5]=s.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]}),_:1})]),s.createVNode(d,{visible:o.isDeleteConfirm,"onUpdate:visible":t[3]||(t[3]=p=>o.isDeleteConfirm=p),title:"Ви впевнені?"},{default:s.withCtx(()=>[s.createElementVNode("div",Si,[t[7]||(t[7]=s.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),s.createElementVNode("div",Ri,[s.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm 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:t[1]||(t[1]=p=>o.isDeleteConfirm=!1)}," Скасувати "),s.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:t[2]||(t[2]=(...p)=>a.deleteElement&&a.deleteElement(...p))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const Vi=B(xi,[["render",vi]]),$i={},Oi={class:"flex-shrink-0 mt-0.5 size-3.5",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"};function Ti(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",Oi,t[0]||(t[0]=[s.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),s.createElementVNode("path",{d:"M7 20V4"},null,-1),s.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),s.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const Pi=B($i,[["render",Ti]]),Ai={props:{columns:{type:Object,default:()=>{}},table:{type:String,default:()=>""}},data(){return{tableFormats:["json","csv","xlsx"],format:"",cols:[]}},methods:{async exportTable(){try{const e=await O.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(",")},responseType:"blob"}),t=new Blob([e.data],{type:"application/octet-stream"}),n=window.URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(n),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})}catch(e){console.error("Ошибка при экспорте файла:",e),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(e){this.format=e}}},Bi={class:"p-4"},Di={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},Ii={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},Mi={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},Li={class:"mt-2 space-y-2"},ji=["id","onChange"],Fi=["for"],Ui={class:"pb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},Hi={class:"text-center"};function qi(e,t,n,r,o,a){const i=s.resolveComponent("VsCheckbox");return s.openBlock(),s.createElementBlock(s.Fragment,null,[t[4]||(t[4]=s.createElementVNode("div",{class:"dark:border-neutral-700"},null,-1)),s.createElementVNode("div",Bi,[s.createElementVNode("div",Di,[t[2]||(t[2]=s.createElementVNode("label",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Виберіть стовпці таблиці для експорту: ",-1)),s.createElementVNode("div",Ii,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.columns,(l,u)=>(s.openBlock(),s.createElementBlock("div",{class:"flex items-center",key:u,style:{width:"calc((100% - 10px) / 2)"}},[s.createVNode(i,{class:"py-0 shrink-0 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",modelValue:o.cols,"onUpdate:modelValue":t[0]||(t[0]=f=>o.cols=f),value:l==null?void 0:l.name,label:l==null?void 0:l.ua},null,8,["modelValue","value","label"])]))),128))])]),s.createElementVNode("div",Mi,[t[3]||(t[3]=s.createElementVNode("label",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Виберіть формат таблиці: ",-1)),s.createElementVNode("div",Li,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.tableFormats,(l,u)=>(s.openBlock(),s.createElementBlock("div",{class:"flex items-center",key:u},[s.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"shrink-0 border-gray-300 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:l,onChange:f=>a.selectFormat(l)},null,40,ji),s.createElementVNode("label",{for:l,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+s.toDisplayString(l),9,Fi)]))),128))])]),s.createElementVNode("div",Ui,[s.createElementVNode("div",Hi,[s.createElementVNode("button",{type:"button",class:"p-2 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:t[1]||(t[1]=(...l)=>a.exportTable&&a.exportTable(...l))}," Завантажити таблицю ")])])])],64)}const zi={components:{IconExport:Pi,AdminTableExportForm:B(Ai,[["render",qi]])},props:{table:String,columns:Array},data(){return{isOpen:!1}}};function Ki(e,t,n,r,o,a){const i=s.resolveComponent("IconExport"),l=s.resolveComponent("AdminTableExportForm"),u=s.resolveComponent("VsDialog");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("button",{onClick:t[0]||(t[0]=f=>o.isOpen=!0),class:"py-2 px-3 relative flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},[s.createVNode(i,{height:"16",width:"16"}),t[2]||(t[2]=s.createTextVNode(" Експорт "))]),s.createVNode(u,{visible:o.isOpen,"onUpdate:visible":t[1]||(t[1]=f=>o.isOpen=f),title:"Експорт таблиці"},{default:s.withCtx(()=>[s.createVNode(l,{table:n.table,columns:n.columns},null,8,["table","columns"])]),_:1},8,["visible"])],64)}const Wi=B(zi,[["render",Ki]]),Gi={},Ji={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-columns"};function Zi(e,t,n,r,o,a){return s.openBlock(),s.createElementBlock("svg",Ji,t[0]||(t[0]=[s.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const Qi=B(Gi,[["render",Zi]]),Xi={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(e){this.$emit("update-column",{...this.column,hidden:!e})}},mounted(){var e;((e=this.column)==null?void 0:e.hidden)!==!0&&(this.value=!0)}},Yi={class:"flex w-full gap-[8px] items-centr"};function el(e,t,n,r,o,a){var i,l;return s.openBlock(),s.createElementBlock("label",Yi,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=u=>o.value=u),type:"checkbox"},null,512),[[s.vModelCheckbox,o.value]]),s.createTextVNode(" "+s.toDisplayString(((i=n.column)==null?void 0:i.ua)||((l=n.column)==null?void 0:l.title)),1)])}const tl={components:{IconColumns:Qi,AdminTableColumnsHiddenItem:B(Xi,[["render",el]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(e){const t=this.columns.findIndex(r=>(r==null?void 0:r.name)===(e==null?void 0:e.name)),n=this.columns;n[t]=e,this.$emit("update-columns",[...n])}}},nl={class:"py-2 px-3 flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},rl={class:"flex flex-col gap-[3px] h-[400px] w-[300px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function ol(e,t,n,r,o,a){const i=s.resolveComponent("IconColumns"),l=s.resolveComponent("AdminTableColumnsHiddenItem"),u=s.resolveComponent("VsPopover");return s.openBlock(),s.createBlock(u,{trigger:"click",placement:"bottom"},{reference:s.withCtx(()=>[s.createElementVNode("button",nl,[s.createVNode(i,{height:"20",width:"16"})])]),default:s.withCtx(()=>[s.createElementVNode("div",null,[t[0]||(t[0]=s.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),s.createElementVNode("ul",rl,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(n.columns,(f,c)=>(s.openBlock(),s.createElementBlock("li",{key:c},[s.createVNode(l,{column:f,onUpdateColumn:a.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const sl={props:{table:String},components:{IconFilter:ci,AdminTableControl:Vi,AdminTableExport:Wi,AdminTableColumnsHidden:B(tl,[["render",ol]])},data(){return{tableData:{},isFilters:!1,filterScheme:[],page:1,searchValue:"",limit:20,filters:null}},mounted(){var e,t;this.page=((t=(e=this.$route)==null?void 0:e.query)==null?void 0:t.page)||1,this.getTableData(),this.getFilters()},computed:{defaultPage(){var e,t;return((t=(e=this.$route)==null?void 0:e.query)==null?void 0:t.page)||1},getFilterScheme(){var e;return(e=this.tableData)==null?void 0:e.filters},columns(){var e,t;return(t=(e=this.tableData)==null?void 0:e.columns)==null?void 0:t.filter(n=>(n==null?void 0:n.hidden)!==!0)}},watch:{table(){this.getTableData()},searchValue(){this.getTableData()}},methods:{async getTableData(){try{const{data:e}=await O.get(`/api/template/table/${this.table}`),t=await O.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null}});this.tableData={...this.tableData,...e,...(t==null?void 0:t.data)||{}}}catch{}},async getFilters(){var e;try{const{data:t}=await O.get(`/api/table-filter/${this.table}`);this.filterScheme=(e=t==null?void 0:t.list)==null?void 0:e.map(n=>({...n,label:(n==null?void 0:n.label)||(n==null?void 0:n.ua)}))}catch{}},async handlePageChange(e){const t=this.$route.query;this.page=e,!(!(t!=null&&t.page)&&e===1||t.page===e)&&(await this.$router.replace({query:{...t,page:e}}),await this.getTableData())},async changeLimit(e){this.limit=await e,this.defaultPage=1,await this.getTableData()},closeFilter({target:e}){this.isFilters&&e.classList.contains("filter-container")&&(this.isFilters=!1)},async filterChange({url:e}){this.filters=e,this.page=1,await this.getTableData()}}},al={class:"w-[calc(100vw - 320px)]"},il={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},ll={class:"text-xl font-medium"},cl={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},ul={class:"bg-white w-full rounded-xl border p-[20px]"},dl={class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px]"},fl={class:"flex gap-[6px] ml-auto"},pl={class:"space-y-5 flex items-start w-full justify-start"},hl={style:{height:"calc(100vh - 250px)"},class:"overflow-x-auto w-full [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},ml={class:"inline-block align-middle"},gl={class:"divide-y divide-gray-200 dark:divide-neutral-700 relative"},bl={class:"sticky top-0 bg-white"},yl={class:"border-t border-stone-200"},wl={class:"pe-4 py-3 gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"},El={class:"divide-y divide-gray-200 dark:divide-neutral-700"},_l=["onClick"],xl={class:"text-center sticky right-0 bg-white"},kl={class:"p-[20px] flex justify-end w-full"},Cl={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px]"};function Nl(e,t,n,r,o,a){var m,b,y,w,N,x,k,D;const i=s.resolveComponent("router-link"),l=s.resolveComponent("AdminTableColumnsHidden"),u=s.resolveComponent("AdminTableExport"),f=s.resolveComponent("IconFilter"),c=s.resolveComponent("AdminTableControl"),d=s.resolveComponent("VsPagination"),p=s.resolveComponent("VsFilter");return s.openBlock(),s.createElementBlock(s.Fragment,null,[s.createElementVNode("div",al,[s.createElementVNode("div",il,[s.createElementVNode("h2",ll,s.toDisplayString((b=(m=o.tableData)==null?void 0:m.title_full)==null?void 0:b.ua),1),s.createVNode(i,{to:`/add?table=${(w=(y=e.$route)==null?void 0:y.params)==null?void 0:w.catchAll}`,class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg bg-blue-500 text-gray-800 shadow-sm hover:bg-blue-700 hover:text-white duration-300"},{default:s.withCtx(()=>t[5]||(t[5]=[s.createTextVNode(" Додати ")])),_:1},8,["to"])]),s.createElementVNode("div",cl,[s.createElementVNode("div",ul,[s.createElementVNode("div",dl,[s.withDirectives(s.createElementVNode("input",{"onUpdate:modelValue":t[0]||(t[0]=S=>o.searchValue=S),class:"py-2 pl-[15px] h-[38px] w-[400px] block w-full border rounded-lg text-sm focus:border-blue-600 focus:border-[2px] outline-none",placeholder:"Пошук..."},null,512),[[s.vModelText,o.searchValue]]),s.createElementVNode("div",fl,[s.createVNode(l,{columns:(N=o.tableData)==null?void 0:N.columns,onUpdateColumns:t[1]||(t[1]=S=>o.tableData.columns=S)},null,8,["columns"]),s.createVNode(u,{table:n.table,columns:(x=o.tableData)==null?void 0:x.columns},null,8,["table","columns"]),s.createElementVNode("button",{onClick:t[2]||(t[2]=S=>o.isFilters=!o.isFilters),class:"py-2 px-3 flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},[s.createVNode(f,{height:"16",width:"16"}),t[6]||(t[6]=s.createTextVNode(" Фільтри "))])])]),s.createElementVNode("div",pl,[s.createElementVNode("div",hl,[s.createElementVNode("div",ml,[s.createElementVNode("table",gl,[s.createElementVNode("thead",bl,[s.createElementVNode("tr",yl,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.columns,S=>(s.openBlock(),s.createElementBlock("th",{class:"min-w-[200px] text-start",key:S.name},[s.createElementVNode("div",wl,s.toDisplayString((S==null?void 0:S.ua)||S.name),1)]))),128)),t[7]||(t[7]=s.createElementVNode("th",{class:"min-w-[150px] sticky right-0 top-0 bg-white z-[10]"}," Дія ",-1))])]),s.createElementVNode("tbody",El,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList((k=o.tableData)==null?void 0:k.rows,(S,I)=>(s.openBlock(),s.createElementBlock("tr",{key:I},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.columns,P=>(s.openBlock(),s.createElementBlock("td",{onClick:ne=>e.$router.push(`/card/${n.table}/${S==null?void 0:S.id}`),class:"size-px min-w-[200px] whitespace-nowrap text-start pe-4 py-3 text-sm text-gray-600",key:P.name},[(s.openBlock(),s.createBlock(s.resolveDynamicComponent(e.$componentsConfig[`table-format-${(P==null?void 0:P.format)||e.text}`]),{name:P==null?void 0:P.name,data:S,value:S==null?void 0:S[P==null?void 0:P.name]},null,8,["name","data","value"]))],8,_l))),128)),s.createElementVNode("td",xl,[s.createVNode(c,{item:S,table:n.table,onUpdateTable:a.getTableData},null,8,["item","table","onUpdateTable"])])]))),128))])])])])]),s.createElementVNode("div",kl,[s.createVNode(d,{goTo:!1,class:"justify-end",style:{width:"calc(50% + 100px)"},"default-page":a.defaultPage,total:((D=o.tableData)==null?void 0:D.total)||0,pageSize:o.limit,onPageChange:a.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:a.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])])])])]),s.createVNode(s.Transition,{name:"fade"},{default:s.withCtx(()=>{var S;return[s.withDirectives(s.createElementVNode("div",{onClick:t[4]||(t[4]=(...I)=>a.closeFilter&&a.closeFilter(...I)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 overflow-x-auto bg-[rgba(0,0,0,0.5)] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[s.createElementVNode("div",Cl,[(S=o.filterScheme)!=null&&S.length?(s.openBlock(),s.createBlock(p,{key:0,ref:"filter",scheme:o.filterScheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:a.filterChange,closeFilterBtn:!0,onFilterClose:t[3]||(t[3]=I=>o.isFilters=!1)},null,8,["scheme","onFilterChange"])):s.createCommentVNode("",!0)])],512),[[s.vShow,o.isFilters]])]}),_:1})],64)}const Sl={components:{AdminTable:B(sl,[["render",Nl]])},data(){return{table:!1,interface:""}},watch:{$route:{async handler(){G!=null&&G.value||await this.getMenu(),await this.checkPageType()},deep:!0}},async mounted(){await this.checkPageType()},methods:{flattenMenu(e){const t=[];return e.forEach(n=>{n.menu?t.push(...this.flattenMenu(n.menu)):t.push(n)}),t},async getMenu(){try{const{data:e}=await O.get("/api/user-menu");G.value=e}catch{}},async checkPageType(){const e=this.flattenMenu(G.value);e!=null&&e.length||this.$router.replace("/404");const t=e==null?void 0:e.find(r=>{var o,a;return(r==null?void 0:r.path)==((a=(o=this.$route)==null?void 0:o.params)==null?void 0:a.catchAll)});t||this.$router.replace("/404");const n=t==null?void 0:t.table;this.table=n||!1,!n&&this.getInterface()},async getInterface(){var e,t;try{const{data:n}=await O.get(`/api/template/interface/${((t=(e=this.$route)==null?void 0:e.params)==null?void 0:t.catchAll)||""}`);this.interface=n||""}catch{this.interface=""}}}},Rl={key:1,class:"w-full"},vl=["innerHTML"];function Vl(e,t,n,r,o,a){const i=s.resolveComponent("AdminTable");return o.table?(s.openBlock(),s.createBlock(i,{key:0,table:o.table},null,8,["table"])):(s.openBlock(),s.createElementBlock("div",Rl,[s.createElementVNode("div",{innerHTML:o.interface},null,8,vl)]))}const $l=Object.freeze(Object.defineProperty({__proto__:null,default:B(Sl,[["render",Vl]])},Symbol.toStringTag,{value:"Module"}));return ia});
31
+ </${c}>
32
+ </router-view>`)}}function Wl(n,i){const o=ii({},n,{matched:n.matched.map(c=>a1(c,["instances","children","aliasOf"]))});return{_custom:{type:null,readOnly:!0,display:n.fullPath,tooltip:i,value:o}}}function Mh(n){return{_custom:{display:n}}}let Kv=0;function Jv(n,i,o){if(i.__hasDevtools)return;i.__hasDevtools=!0;const c=Kv++;qb({id:"org.vuejs.router"+(c?"."+c:""),label:"Vue Router",packageName:"vue-router",homepage:"https://router.vuejs.org",logo:"https://router.vuejs.org/logo.png",componentStateTypes:["Routing"],app:n},p=>{typeof p.now!="function"&&console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),p.on.inspectComponent((D,R)=>{D.instanceData&&D.instanceData.state.push({type:"Routing",key:"$route",editable:!1,value:Wl(i.currentRoute.value,"Current Route")})}),p.on.visitComponentTree(({treeNode:D,componentInstance:R})=>{if(R.__vrv_devtools){const z=R.__vrv_devtools;D.tags.push({label:(z.name?`${z.name.toString()}: `:"")+z.path,textColor:0,tooltip:"This component is rendered by &lt;router-view&gt;",backgroundColor:vg})}Qn(R.__vrl_devtools)&&(R.__devtoolsApi=p,R.__vrl_devtools.forEach(z=>{let j=z.route.path,Y=kg,ee="",oe=0;z.error?(j=z.error,Y=n1,oe=r1):z.isExactActive?(Y=Sg,ee="This is exactly active"):z.isActive&&(Y=wg,ee="This link is active"),D.tags.push({label:j,textColor:oe,tooltip:ee,backgroundColor:Y})}))}),k.watch(i.currentRoute,()=>{M(),p.notifyComponentUpdate(),p.sendInspectorTree(h),p.sendInspectorState(h)});const b="router:navigations:"+c;p.addTimelineLayer({id:b,label:`Router${c?" "+c:""} Navigations`,color:4237508}),i.onError((D,R)=>{p.addTimelineEvent({layerId:b,event:{title:"Error during Navigation",subtitle:R.fullPath,logType:"error",time:p.now(),data:{error:D},groupId:R.meta.__navigationId}})});let _=0;i.beforeEach((D,R)=>{const z={guard:Mh("beforeEach"),from:Wl(R,"Current Location during this navigation"),to:Wl(D,"Target location")};Object.defineProperty(D.meta,"__navigationId",{value:_++}),p.addTimelineEvent({layerId:b,event:{time:p.now(),title:"Start of navigation",subtitle:D.fullPath,data:z,groupId:D.meta.__navigationId}})}),i.afterEach((D,R,z)=>{const j={guard:Mh("afterEach")};z?(j.failure={_custom:{type:Error,readOnly:!0,display:z?z.message:"",tooltip:"Navigation Failure",value:z}},j.status=Mh("❌")):j.status=Mh("✅"),j.from=Wl(R,"Current Location during this navigation"),j.to=Wl(D,"Target location"),p.addTimelineEvent({layerId:b,event:{title:"End of navigation",subtitle:D.fullPath,time:p.now(),data:j,logType:z?"warning":"default",groupId:D.meta.__navigationId}})});const h="router-inspector:"+c;p.addInspector({id:h,label:"Routes"+(c?" "+c:""),icon:"book",treeFilterPlaceholder:"Search routes"});function M(){if(!A)return;const D=A;let R=o.getRoutes().filter(z=>!z.parent||!z.parent.record.components);R.forEach(Cg),D.filter&&(R=R.filter(z=>jd(z,D.filter.toLowerCase()))),R.forEach(z=>Tg(z,i.currentRoute.value)),D.rootNodes=R.map(Eg)}let A;p.on.getInspectorTree(D=>{A=D,D.app===n&&D.inspectorId===h&&M()}),p.on.getInspectorState(D=>{if(D.app===n&&D.inspectorId===h){const z=o.getRoutes().find(j=>j.record.__vd_id===D.nodeId);z&&(D.state={options:e1(z)})}}),p.sendInspectorTree(h),p.sendInspectorState(h)})}function Qv(n){return n.optional?n.repeatable?"*":"?":n.repeatable?"+":""}function e1(n){const{record:i}=n,o=[{editable:!1,key:"path",value:i.path}];return i.name!=null&&o.push({editable:!1,key:"name",value:i.name}),o.push({editable:!1,key:"regexp",value:n.re}),n.keys.length&&o.push({editable:!1,key:"keys",value:{_custom:{type:null,readOnly:!0,display:n.keys.map(c=>`${c.name}${Qv(c)}`).join(" "),tooltip:"Param keys",value:n.keys}}}),i.redirect!=null&&o.push({editable:!1,key:"redirect",value:i.redirect}),n.alias.length&&o.push({editable:!1,key:"aliases",value:n.alias.map(c=>c.record.path)}),Object.keys(n.record.meta).length&&o.push({editable:!1,key:"meta",value:n.record.meta}),o.push({key:"score",editable:!1,value:{_custom:{type:null,readOnly:!0,display:n.score.map(c=>c.join(", ")).join(" | "),tooltip:"Score used to sort routes",value:n.score}}}),o}const vg=15485081,wg=2450411,Sg=8702998,t1=2282478,kg=16486972,i1=6710886,n1=16704226,r1=12131356;function Eg(n){const i=[],{record:o}=n;o.name!=null&&i.push({label:String(o.name),textColor:0,backgroundColor:t1}),o.aliasOf&&i.push({label:"alias",textColor:0,backgroundColor:kg}),n.__vd_match&&i.push({label:"matches",textColor:0,backgroundColor:vg}),n.__vd_exactActive&&i.push({label:"exact",textColor:0,backgroundColor:Sg}),n.__vd_active&&i.push({label:"active",textColor:0,backgroundColor:wg}),o.redirect&&i.push({label:typeof o.redirect=="string"?`redirect: ${o.redirect}`:"redirects",textColor:16777215,backgroundColor:i1});let c=o.__vd_id;return c==null&&(c=String(s1++),o.__vd_id=c),{id:c,label:o.path,tags:i,children:n.children.map(Eg)}}let s1=0;const o1=/^\/(.*)\/([a-z]*)$/;function Tg(n,i){const o=i.matched.length&&qs(i.matched[i.matched.length-1],n.record);n.__vd_exactActive=n.__vd_active=o,o||(n.__vd_active=i.matched.some(c=>qs(c,n.record))),n.children.forEach(c=>Tg(c,i))}function Cg(n){n.__vd_match=!1,n.children.forEach(Cg)}function jd(n,i){const o=String(n.re).match(o1);if(n.__vd_match=!1,!o||o.length<3)return!1;if(new RegExp(o[1].replace(/\$$/,""),o[2]).test(i))return n.children.forEach(_=>jd(_,i)),n.record.path!=="/"||i==="/"?(n.__vd_match=n.re.test(i),!0):!1;const p=n.record.path.toLowerCase(),b=Ma(p);return!i.startsWith("/")&&(b.includes(i)||p.includes(i))||b.startsWith(i)||p.startsWith(i)||n.record.name&&String(n.record.name).includes(i)?!0:n.children.some(_=>jd(_,i))}function a1(n,i){const o={};for(const c in n)i.includes(c)||(o[c]=n[c]);return o}function l1(n){const i=zv(n.routes,n),o=n.parseQuery||$v,c=n.stringifyQuery||fg,p=n.history;if(process.env.NODE_ENV!=="production"&&!p)throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');const b=Zl(),_=Zl(),h=Zl(),M=k.shallowRef(Zs);let A=Zs;ps&&n.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const D=Dd.bind(null,ke=>""+ke),R=Dd.bind(null,sv),z=Dd.bind(null,Ma);function j(ke,He){let Ze,ot;return rg(ke)?(Ze=i.getRecordMatcher(ke),process.env.NODE_ENV!=="production"&&!Ze&&Ft(`Parent route "${String(ke)}" not found when adding child route`,He),ot=He):ot=ke,i.addRoute(ot,Ze)}function Y(ke){const He=i.getRecordMatcher(ke);He?i.removeRoute(He):process.env.NODE_ENV!=="production"&&Ft(`Cannot remove non-existent route "${String(ke)}"`)}function ee(){return i.getRoutes().map(ke=>ke.record)}function oe(ke){return!!i.getRecordMatcher(ke)}function ue(ke,He){if(He=ii({},He||M.value),typeof ke=="string"){const bt=Ld(o,ke,He.path),ri=i.resolve({path:bt.path},He),xe=p.createHref(bt.fullPath);return process.env.NODE_ENV!=="production"&&(xe.startsWith("//")?Ft(`Location "${ke}" resolved to "${xe}". A resolved location cannot start with multiple slashes.`):ri.matched.length||Ft(`No match found for location with path "${ke}"`)),ii(bt,ri,{params:z(ri.params),hash:Ma(bt.hash),redirectedFrom:void 0,href:xe})}if(process.env.NODE_ENV!=="production"&&!Ch(ke))return Ft(`router.resolve() was passed an invalid location. This will fail in production.
33
+ - Location:`,ke),ue({});let Ze;if(ke.path!=null)process.env.NODE_ENV!=="production"&&"params"in ke&&!("name"in ke)&&Object.keys(ke.params).length&&Ft(`Path "${ke.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`),Ze=ii({},ke,{path:Ld(o,ke.path,He.path).path});else{const bt=ii({},ke.params);for(const ri in bt)bt[ri]==null&&delete bt[ri];Ze=ii({},ke,{params:R(bt)}),He.params=R(He.params)}const ot=i.resolve(Ze,He),Vt=ke.hash||"";process.env.NODE_ENV!=="production"&&Vt&&!Vt.startsWith("#")&&Ft(`A \`hash\` should always start with the character "#". Replace "${Vt}" with "#${Vt}".`),ot.params=D(z(ot.params));const Qt=lv(c,ii({},ke,{hash:iv(Vt),path:ot.path})),kt=p.createHref(Qt);return process.env.NODE_ENV!=="production"&&(kt.startsWith("//")?Ft(`Location "${ke}" resolved to "${kt}". A resolved location cannot start with multiple slashes.`):ot.matched.length||Ft(`No match found for location with path "${ke.path!=null?ke.path:ke}"`)),ii({fullPath:Qt,hash:Vt,query:c===fg?jv(ke.query):ke.query||{}},ot,{redirectedFrom:void 0,href:kt})}function be(ke){return typeof ke=="string"?Ld(o,ke,M.value.path):ii({},ke)}function _e(ke,He){if(A!==ke)return Pa(8,{from:He,to:ke})}function Ce(ke){return Ae(ke)}function Qe(ke){return Ce(ii(be(ke),{replace:!0}))}function mt(ke){const He=ke.matched[ke.matched.length-1];if(He&&He.redirect){const{redirect:Ze}=He;let ot=typeof Ze=="function"?Ze(ke):Ze;if(typeof ot=="string"&&(ot=ot.includes("?")||ot.includes("#")?ot=be(ot):{path:ot},ot.params={}),process.env.NODE_ENV!=="production"&&ot.path==null&&!("name"in ot))throw Ft(`Invalid redirect found:
34
+ ${JSON.stringify(ot,null,2)}
35
+ when navigating to "${ke.fullPath}". A redirect must contain a name or path. This will break in production.`),new Error("Invalid redirect");return ii({query:ke.query,hash:ke.hash,params:ot.path!=null?{}:ke.params},ot)}}function Ae(ke,He){const Ze=A=ue(ke),ot=M.value,Vt=ke.state,Qt=ke.force,kt=ke.replace===!0,bt=mt(Ze);if(bt)return Ae(ii(be(bt),{state:typeof bt=="object"?ii({},Vt,bt.state):Vt,force:Qt,replace:kt}),He||Ze);const ri=Ze;ri.redirectedFrom=He;let xe;return!Qt&&Jm(c,ot,Ze)&&(xe=Pa(16,{to:ri,from:ot}),Hi(ot,ot,!0,!1)),(xe?Promise.resolve(xe):Nt(ri,ot)).catch(wi=>fs(wi)?fs(wi,2)?wi:kn(wi):Sr(wi,ri,ot)).then(wi=>{if(wi){if(fs(wi,2))return process.env.NODE_ENV!=="production"&&Jm(c,ue(wi.to),ri)&&He&&(He._count=He._count?He._count+1:1)>30?(Ft(`Detected a possibly infinite redirection in a navigation guard when going from "${ot.fullPath}" to "${ri.fullPath}". Aborting to avoid a Stack Overflow.
36
+ Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`),Promise.reject(new Error("Infinite redirect in navigation guard"))):Ae(ii({replace:kt},be(wi.to),{state:typeof wi.to=="object"?ii({},Vt,wi.to.state):Vt,force:Qt}),He||ri)}else wi=Sn(ri,ot,!0,kt,Vt);return Ct(ri,ot,wi),wi})}function St(ke,He){const Ze=_e(ke,He);return Ze?Promise.reject(Ze):Promise.resolve()}function wt(ke){const He=En.values().next().value;return He&&typeof He.runWithContext=="function"?He.runWithContext(ke):ke()}function Nt(ke,He){let Ze;const[ot,Vt,Qt]=c1(ke,He);Ze=$d(ot.reverse(),"beforeRouteLeave",ke,He);for(const bt of ot)bt.leaveGuards.forEach(ri=>{Ze.push(Ws(ri,ke,He))});const kt=St.bind(null,ke,He);return Ze.push(kt),Cn(Ze).then(()=>{Ze=[];for(const bt of b.list())Ze.push(Ws(bt,ke,He));return Ze.push(kt),Cn(Ze)}).then(()=>{Ze=$d(Vt,"beforeRouteUpdate",ke,He);for(const bt of Vt)bt.updateGuards.forEach(ri=>{Ze.push(Ws(ri,ke,He))});return Ze.push(kt),Cn(Ze)}).then(()=>{Ze=[];for(const bt of Qt)if(bt.beforeEnter)if(Qn(bt.beforeEnter))for(const ri of bt.beforeEnter)Ze.push(Ws(ri,ke,He));else Ze.push(Ws(bt.beforeEnter,ke,He));return Ze.push(kt),Cn(Ze)}).then(()=>(ke.matched.forEach(bt=>bt.enterCallbacks={}),Ze=$d(Qt,"beforeRouteEnter",ke,He,wt),Ze.push(kt),Cn(Ze))).then(()=>{Ze=[];for(const bt of _.list())Ze.push(Ws(bt,ke,He));return Ze.push(kt),Cn(Ze)}).catch(bt=>fs(bt,8)?bt:Promise.reject(bt))}function Ct(ke,He,Ze){h.list().forEach(ot=>wt(()=>ot(ke,He,Ze)))}function Sn(ke,He,Ze,ot,Vt){const Qt=_e(ke,He);if(Qt)return Qt;const kt=He===Zs,bt=ps?history.state:{};Ze&&(ot||kt?p.replace(ke.fullPath,ii({scroll:kt&&bt&&bt.scroll},Vt)):p.push(ke.fullPath,Vt)),M.value=ke,Hi(ke,He,Ze,kt),kn()}let zt;function pi(){zt||(zt=p.listen((ke,He,Ze)=>{if(!Tn.listening)return;const ot=ue(ke),Vt=mt(ot);if(Vt){Ae(ii(Vt,{replace:!0}),ot).catch(Ul);return}A=ot;const Qt=M.value;ps&&gv(tg(Qt.fullPath,Ze.delta),Th()),Nt(ot,Qt).catch(kt=>fs(kt,12)?kt:fs(kt,2)?(Ae(kt.to,ot).then(bt=>{fs(bt,20)&&!Ze.delta&&Ze.type===Hl.pop&&p.go(-1,!1)}).catch(Ul),Promise.reject()):(Ze.delta&&p.go(-Ze.delta,!1),Sr(kt,ot,Qt))).then(kt=>{kt=kt||Sn(ot,Qt,!1),kt&&(Ze.delta&&!fs(kt,8)?p.go(-Ze.delta,!1):Ze.type===Hl.pop&&fs(kt,20)&&p.go(-1,!1)),Ct(ot,Qt,kt)}).catch(Ul)}))}let rn=Zl(),tr=Zl(),Ui;function Sr(ke,He,Ze){kn(ke);const ot=tr.list();return ot.length?ot.forEach(Vt=>Vt(ke,He,Ze)):(process.env.NODE_ENV!=="production"&&Ft("uncaught error during route navigation:"),console.error(ke)),Promise.reject(ke)}function jn(){return Ui&&M.value!==Zs?Promise.resolve():new Promise((ke,He)=>{rn.add([ke,He])})}function kn(ke){return Ui||(Ui=!ke,pi(),rn.list().forEach(([He,Ze])=>ke?Ze(ke):He()),rn.reset()),ke}function Hi(ke,He,Ze,ot){const{scrollBehavior:Vt}=n;if(!ps||!Vt)return Promise.resolve();const Qt=!Ze&&yv(tg(ke.fullPath,0))||(ot||!Ze)&&history.state&&history.state.scroll||null;return k.nextTick().then(()=>Vt(ke,He,Qt)).then(kt=>kt&&mv(kt)).catch(kt=>Sr(kt,ke,He))}const sn=ke=>p.go(ke);let kr;const En=new Set,Tn={currentRoute:M,listening:!0,addRoute:j,removeRoute:Y,clearRoutes:i.clearRoutes,hasRoute:oe,getRoutes:ee,resolve:ue,options:n,push:Ce,replace:Qe,go:sn,back:()=>sn(-1),forward:()=>sn(1),beforeEach:b.add,beforeResolve:_.add,afterEach:h.add,onError:tr.add,isReady:jn,install(ke){const He=this;ke.component("RouterLink",qv),ke.component("RouterView",Yv),ke.config.globalProperties.$router=He,Object.defineProperty(ke.config.globalProperties,"$route",{enumerable:!0,get:()=>k.unref(M)}),ps&&!kr&&M.value===Zs&&(kr=!0,Ce(p.location).catch(Vt=>{process.env.NODE_ENV!=="production"&&Ft("Unexpected error when starting the router:",Vt)}));const Ze={};for(const Vt in Zs)Object.defineProperty(Ze,Vt,{get:()=>M.value[Vt],enumerable:!0});ke.provide(Nd,He),ke.provide(gg,k.shallowReactive(Ze)),ke.provide(Vd,M);const ot=ke.unmount;En.add(ke),ke.unmount=function(){En.delete(ke),En.size<1&&(A=Zs,zt&&zt(),zt=null,M.value=Zs,kr=!1,Ui=!1),ot()},process.env.NODE_ENV!=="production"&&ps&&Jv(ke,He,i)}};function Cn(ke){return ke.reduce((He,Ze)=>He.then(()=>wt(Ze)),Promise.resolve())}return Tn}function c1(n,i){const o=[],c=[],p=[],b=Math.max(i.matched.length,n.matched.length);for(let _=0;_<b;_++){const h=i.matched[_];h&&(n.matched.find(A=>qs(A,h))?c.push(h):o.push(h));const M=n.matched[_];M&&(i.matched.find(A=>qs(A,M))||p.push(M))}return[o,c,p]}const h1=[{name:"edit",path:"/edit",component:()=>Promise.resolve().then(()=>YT)},{name:"add",path:"/add",component:()=>Promise.resolve().then(()=>nC)},{name:"card-view",path:"/card",component:()=>Promise.resolve().then(()=>C_),children:[{name:"table",path:":table",component:()=>Promise.resolve().then(()=>C_),children:[{name:"card",path:":id",component:()=>Promise.resolve().then(()=>vC)}]}]}],u1={},d1={class:"bg-gray-200 w-full px-16 md:px-0 h-screen flex items-center justify-center"},p1={class:"bg-white border border-gray-200 flex flex-col items-center justify-center px-4 md:px-8 lg:px-24 py-8 rounded-lg shadow-2xl"};function f1(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",d1,[k.createElementVNode("div",p1,[i[2]||(i[2]=k.createElementVNode("p",{class:"text-6xl md:text-7xl lg:text-9xl font-bold tracking-wider text-gray-300"}," 404 ",-1)),i[3]||(i[3]=k.createElementVNode("p",{class:"text-2xl md:text-3xl lg:text-5xl font-bold tracking-wider text-gray-500 mt-4"}," Сторінку не знайдено ",-1)),i[4]||(i[4]=k.createElementVNode("p",{class:"text-gray-500 mt-4 pb-4 border-b-2 text-center"}," Вибачте, така сторінка не існує ",-1)),k.createElementVNode("div",{onClick:i[0]||(i[0]=_=>n.$router.push("/")),class:"flex cursor-pointer items-center space-x-2 bg-blue-600 hover:bg-blue-700 text-gray-100 px-4 py-2 mt-6 rounded transition duration-150",title:"Return Home"},i[1]||(i[1]=[k.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor"},[k.createElementVNode("path",{"fill-rule":"evenodd",d:"M9.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L7.414 9H15a1 1 0 110 2H7.414l2.293 2.293a1 1 0 010 1.414z","clip-rule":"evenodd"})],-1),k.createElementVNode("span",null,"Повернутись на головну",-1)]))])])}const m1=Pt(u1,[["render",f1]]),g1=n=>{const i=h1.map(c=>({...c}));return{router:l1({history:vv(),routes:[{path:"/404",name:"404",component:m1},{path:"/",name:"global",component:()=>Promise.resolve().then(()=>GC),children:[...i,...n,{path:"/:catchAll(.*)",component:()=>Promise.resolve().then(()=>xP)}]}]}),routerData:i}},y1={props:{value:{type:[String,Number,Array,Boolean],default:()=>""}},data(){return{}}};function _1(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",null,k.toDisplayString(o.value),1)}const Mg=Pt(y1,[["render",_1]]),x1={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var n;return(n=this.data)==null?void 0:n[this.name+"_data"]}},methods:{getBGColor(n){let i;if(/^#([A-Fa-f0-9]{3}){1,2}$/.test(n))return i=n.substring(1).split(""),i.length==3&&(i=[i[0],i[0],i[1],i[1],i[2],i[2]]),i="0x"+i.join(""),"rgba("+[i>>16&255,i>>8&255,i&255].join(",")+",0.2)";throw new Error("Bad Hex")}}},b1={class:"w-full flex justify-center"},v1={key:1};function w1(n,i,o,c,p,b){var _,h,M;return k.openBlock(),k.createElementBlock("div",b1,[b.getData?(k.openBlock(),k.createElementBlock("div",{key:0,class:"p-2 ps-1.5 px-2 inline-flex items-center gap-x-1.5 text-xs font-medium text-black rounded-md",style:k.normalizeStyle({backgroundColor:b.getBGColor((_=b.getData)==null?void 0:_.color),color:(h=b.getData)==null?void 0:h.color})},k.toDisplayString((M=b.getData)==null?void 0:M.text),5)):(k.openBlock(),k.createElementBlock("div",v1,"-"))])}const S1=Pt(x1,[["render",w1]]),k1={},E1={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-check"};function T1(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",E1,i[0]||(i[0]=[k.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),k.createElementVNode("path",{d:"M5 12l5 5l10 -10"},null,-1)]))}const C1={components:{IconCheck:Pt(k1,[["render",T1]])},props:{value:Boolean}},M1={class:"px-[20px]"},P1={key:1};function I1(n,i,o,c,p,b){const _=k.resolveComponent("IconCheck");return k.openBlock(),k.createElementBlock("div",M1,[o.value?(k.openBlock(),k.createBlock(_,{key:0,height:"24",width:"24",class:"text-blue-500"})):(k.openBlock(),k.createElementBlock("div",P1))])}const Pg=Pt(C1,[["render",I1]]),A1={props:{value:{type:[String,Number],default:()=>""},data:Object,name:String},computed:{getData(){var n;return(n=this.data)==null?void 0:n[this.name+"_data"]}}},D1={class:"w-full flex justify-center"},z1={key:0},R1={key:1};function L1(n,i,o,c,p,b){var _;return k.openBlock(),k.createElementBlock("div",D1,[b.getData?(k.openBlock(),k.createElementBlock("div",z1,k.toDisplayString((_=b.getData)==null?void 0:_.text),1)):(k.openBlock(),k.createElementBlock("div",R1,"-"))])}const O1={"table-format-text":Mg,"table-format-select":Pt(A1,[["render",L1]]),"table-format-badge":S1,"table-format-swetch":Pg,"table-format-check":Pg,"table-format-html":Mg},B1=[{path:"/",ua:"Головна",component:"vs-dashboard"},{ua:"Активи",en:"Green Fund",icon:"fa fa-pagelines",menu:[{path:"rest_zone",table:"rest_zone.table",ua:"Зони відпочинку",en:"Rest zones"},{path:"street_furniture",table:"street_furniture.table",ua:"Елементи благоустрою",en:"Improvements"},{path:"green_space",table:"green_space.table",ua:"Зелені насадження",en:"Green space"},{path:"itree-map",ua:"Карта зелених насаджень",en:"Green space map"},{path:"itree.event_report",ua:"Події, генерація звіту"}]},{ua:"Взаємодія з громадськістю",en:"Engaging with the public",icon:"fa fa-users",menu:[{path:"itree.invent_street_furniture",table:"itree.invent_street_furniture.table",ua:"Інвентаризація елементів благоустрою"},{path:"itree.invent_greenspace",table:"itree.invent_street_furniture.table",ua:"Інвентаризація зелених насаджень"},{path:"itree.pictures",ua:"Світлини",en:"Pictures"},{path:"itree.application",ua:"Звернення громадян",en:"Citizen appeals"}]}],Ig=n=>{const i=[];return n.forEach(o=>{o.menu?i.push(...Ig(o.menu)):i.push(o)}),i};function Ag(n,i,o){if(n!==null)for(var c,p,b,_,h,M,A,D=0,R=0,z,j=n.type,Y=j==="FeatureCollection",ee=j==="Feature",oe=Y?n.features.length:1,ue=0;ue<oe;ue++){A=Y?n.features[ue].geometry:ee?n.geometry:n,z=A?A.type==="GeometryCollection":!1,h=z?A.geometries.length:1;for(var be=0;be<h;be++){var _e=0,Ce=0;if(_=z?A.geometries[be]:A,_!==null){M=_.coordinates;var Qe=_.type;switch(D=0,Qe){case null:break;case"Point":if(i(M,R,ue,_e,Ce)===!1)return!1;R++,_e++;break;case"LineString":case"MultiPoint":for(c=0;c<M.length;c++){if(i(M[c],R,ue,_e,Ce)===!1)return!1;R++,Qe==="MultiPoint"&&_e++}Qe==="LineString"&&_e++;break;case"Polygon":case"MultiLineString":for(c=0;c<M.length;c++){for(p=0;p<M[c].length-D;p++){if(i(M[c][p],R,ue,_e,Ce)===!1)return!1;R++}Qe==="MultiLineString"&&_e++,Qe==="Polygon"&&Ce++}Qe==="Polygon"&&_e++;break;case"MultiPolygon":for(c=0;c<M.length;c++){for(Ce=0,p=0;p<M[c].length;p++){for(b=0;b<M[c][p].length-D;b++){if(i(M[c][p][b],R,ue,_e,Ce)===!1)return!1;R++}Ce++}_e++}break;case"GeometryCollection":for(c=0;c<_.geometries.length;c++)if(Ag(_.geometries[c],i)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Dg(n,i={}){if(n.bbox!=null&&i.recompute!==!0)return n.bbox;const o=[1/0,1/0,-1/0,-1/0];return Ag(n,c=>{o[0]>c[0]&&(o[0]=c[0]),o[1]>c[1]&&(o[1]=c[1]),o[2]<c[0]&&(o[2]=c[0]),o[3]<c[1]&&(o[3]=c[1])}),o}var F1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function N1(n,i,o={}){const c={type:"Feature"};return(o.id===0||o.id)&&(c.id=o.id),o.bbox&&(c.bbox=o.bbox),c.properties={},c.geometry=n,c}function zg(n,i={}){const o={type:"FeatureCollection"};return i.id&&(o.id=i.id),i.bbox&&(o.bbox=i.bbox),o.features=n,o}var Rg={exports:{}};/**
37
+ * MapLibre GL JS
38
+ * @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.0/LICENSE.txt
39
+ */(function(n,i){(function(o,c){n.exports=c()})(F1,function(){var o={},c={};function p(_,h,M){if(c[_]=M,_==="index"){var A="var sharedModule = {}; ("+c.shared+")(sharedModule); ("+c.worker+")(sharedModule);",D={};return c.shared(D),c.index(o,D),typeof window<"u"&&o.setWorkerUrl(window.URL.createObjectURL(new Blob([A],{type:"text/javascript"}))),o}}p("shared",["exports"],function(_){function h(r,t,s,l){return new(s||(s=Promise))(function(f,y){function x(C){try{S(l.next(C))}catch(P){y(P)}}function v(C){try{S(l.throw(C))}catch(P){y(P)}}function S(C){var P;C.done?f(C.value):(P=C.value,P instanceof s?P:new s(function(L){L(P)})).then(x,v)}S((l=l.apply(r,t||[])).next())})}function M(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}typeof SuppressedError=="function"&&SuppressedError;var A=D;function D(r,t){this.x=r,this.y=t}D.prototype={clone:function(){return new D(this.x,this.y)},add:function(r){return this.clone()._add(r)},sub:function(r){return this.clone()._sub(r)},multByPoint:function(r){return this.clone()._multByPoint(r)},divByPoint:function(r){return this.clone()._divByPoint(r)},mult:function(r){return this.clone()._mult(r)},div:function(r){return this.clone()._div(r)},rotate:function(r){return this.clone()._rotate(r)},rotateAround:function(r,t){return this.clone()._rotateAround(r,t)},matMult:function(r){return this.clone()._matMult(r)},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(r){return this.x===r.x&&this.y===r.y},dist:function(r){return Math.sqrt(this.distSqr(r))},distSqr:function(r){var t=r.x-this.x,s=r.y-this.y;return t*t+s*s},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(r){return Math.atan2(this.y-r.y,this.x-r.x)},angleWith:function(r){return this.angleWithSep(r.x,r.y)},angleWithSep:function(r,t){return Math.atan2(this.x*t-this.y*r,this.x*r+this.y*t)},_matMult:function(r){var t=r[2]*this.x+r[3]*this.y;return this.x=r[0]*this.x+r[1]*this.y,this.y=t,this},_add:function(r){return this.x+=r.x,this.y+=r.y,this},_sub:function(r){return this.x-=r.x,this.y-=r.y,this},_mult:function(r){return this.x*=r,this.y*=r,this},_div:function(r){return this.x/=r,this.y/=r,this},_multByPoint:function(r){return this.x*=r.x,this.y*=r.y,this},_divByPoint:function(r){return this.x/=r.x,this.y/=r.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var r=this.y;return this.y=this.x,this.x=-r,this},_rotate:function(r){var t=Math.cos(r),s=Math.sin(r),l=s*this.x+t*this.y;return this.x=t*this.x-s*this.y,this.y=l,this},_rotateAround:function(r,t){var s=Math.cos(r),l=Math.sin(r),f=t.y+l*(this.x-t.x)+s*(this.y-t.y);return this.x=t.x+s*(this.x-t.x)-l*(this.y-t.y),this.y=f,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},D.convert=function(r){return r instanceof D?r:Array.isArray(r)?new D(r[0],r[1]):r};var R=M(A),z=j;function j(r,t,s,l){this.cx=3*r,this.bx=3*(s-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(l-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=s,this.p2y=l}j.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var s=r,l=0;l<8;l++){var f=this.sampleCurveX(s)-r;if(Math.abs(f)<t)return s;var y=this.sampleCurveDerivativeX(s);if(Math.abs(y)<1e-6)break;s-=f/y}var x=0,v=1;for(s=r,l=0;l<20&&(f=this.sampleCurveX(s),!(Math.abs(f-r)<t));l++)r>f?x=s:v=s,s=.5*(v-x)+x;return s},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Y=M(z);let ee,oe;function ue(){return ee==null&&(ee=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")&&typeof createImageBitmap=="function"),ee}function be(){if(oe==null&&(oe=!1,ue())){const t=new OffscreenCanvas(5,5).getContext("2d",{willReadFrequently:!0});if(t){for(let l=0;l<5*5;l++){const f=4*l;t.fillStyle=`rgb(${f},${f+1},${f+2})`,t.fillRect(l%5,Math.floor(l/5),1,1)}const s=t.getImageData(0,0,5,5).data;for(let l=0;l<5*5*4;l++)if(l%4!=3&&s[l]!==l){oe=!0;break}}}return oe||!1}function _e(r,t,s,l){const f=new Y(r,t,s,l);return y=>f.solve(y)}const Ce=_e(.25,.1,.25,1);function Qe(r,t,s){return Math.min(s,Math.max(t,r))}function mt(r,t,s){const l=s-t,f=((r-t)%l+l)%l+t;return f===t?s:f}function Ae(r,...t){for(const s of t)for(const l in s)r[l]=s[l];return r}let St=1;function wt(r,t,s){const l={};for(const f in r)l[f]=t.call(this,r[f],f,r);return l}function Nt(r,t,s){const l={};for(const f in r)t.call(this,r[f],f,r)&&(l[f]=r[f]);return l}function Ct(r){return Array.isArray(r)?r.map(Ct):typeof r=="object"&&r?wt(r,Ct):r}const Sn={};function zt(r){Sn[r]||(typeof console<"u"&&console.warn(r),Sn[r]=!0)}function pi(r,t,s){return(s.y-r.y)*(t.x-r.x)>(t.y-r.y)*(s.x-r.x)}function rn(r){return typeof WorkerGlobalScope<"u"&&r!==void 0&&r instanceof WorkerGlobalScope}let tr=null;function Ui(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap}const Sr="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";function jn(r,t,s,l,f){return h(this,void 0,void 0,function*(){if(typeof VideoFrame>"u")throw new Error("VideoFrame not supported");const y=new VideoFrame(r,{timestamp:0});try{const x=y==null?void 0:y.format;if(!x||!x.startsWith("BGR")&&!x.startsWith("RGB"))throw new Error(`Unrecognized format ${x}`);const v=x.startsWith("BGR"),S=new Uint8ClampedArray(l*f*4);if(yield y.copyTo(S,function(C,P,L,F,$){const H=4*Math.max(-P,0),q=(Math.max(0,L)-L)*F*4+H,K=4*F,ie=Math.max(0,P),ge=Math.max(0,L);return{rect:{x:ie,y:ge,width:Math.min(C.width,P+F)-ie,height:Math.min(C.height,L+$)-ge},layout:[{offset:q,stride:K}]}}(r,t,s,l,f)),v)for(let C=0;C<S.length;C+=4){const P=S[C];S[C]=S[C+2],S[C+2]=P}return S}finally{y.close()}})}let kn,Hi;const sn="AbortError";function kr(){return new Error(sn)}const En={MAX_PARALLEL_IMAGE_REQUESTS:16,MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:8,MAX_TILE_CACHE_ZOOM_LEVELS:5,REGISTERED_PROTOCOLS:{},WORKER_URL:""};function Tn(r){return En.REGISTERED_PROTOCOLS[r.substring(0,r.indexOf("://"))]}const Cn="global-dispatcher";class ke extends Error{constructor(t,s,l,f){super(`AJAXError: ${s} (${t}): ${l}`),this.status=t,this.statusText=s,this.url=l,this.body=f}}const He=()=>rn(self)?self.worker&&self.worker.referrer:(window.location.protocol==="blob:"?window.parent:window).location.href,Ze=function(r,t){if(/:\/\//.test(r.url)&&!/^https?:|^file:/.test(r.url)){const l=Tn(r.url);if(l)return l(r,t);if(rn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,targetMapId:Cn},t)}if(!(/^file:/.test(s=r.url)||/^file:/.test(He())&&!/^\w+:/.test(s))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return function(l,f){return h(this,void 0,void 0,function*(){const y=new Request(l.url,{method:l.method||"GET",body:l.body,credentials:l.credentials,headers:l.headers,cache:l.cache,referrer:He(),signal:f.signal});l.type!=="json"||y.headers.has("Accept")||y.headers.set("Accept","application/json");const x=yield fetch(y);if(!x.ok){const C=yield x.blob();throw new ke(x.status,x.statusText,l.url,C)}let v;v=l.type==="arrayBuffer"||l.type==="image"?x.arrayBuffer():l.type==="json"?x.json():x.text();const S=yield v;if(f.signal.aborted)throw kr();return{data:S,cacheControl:x.headers.get("Cache-Control"),expires:x.headers.get("Expires")}})}(r,t);if(rn(self)&&self.worker&&self.worker.actor)return self.worker.actor.sendAsync({type:"GR",data:r,mustQueue:!0,targetMapId:Cn},t)}var s;return function(l,f){return new Promise((y,x)=>{var v;const S=new XMLHttpRequest;S.open(l.method||"GET",l.url,!0),l.type!=="arrayBuffer"&&l.type!=="image"||(S.responseType="arraybuffer");for(const C in l.headers)S.setRequestHeader(C,l.headers[C]);l.type==="json"&&(S.responseType="text",!((v=l.headers)===null||v===void 0)&&v.Accept||S.setRequestHeader("Accept","application/json")),S.withCredentials=l.credentials==="include",S.onerror=()=>{x(new Error(S.statusText))},S.onload=()=>{if(!f.signal.aborted)if((S.status>=200&&S.status<300||S.status===0)&&S.response!==null){let C=S.response;if(l.type==="json")try{C=JSON.parse(S.response)}catch(P){return void x(P)}y({data:C,cacheControl:S.getResponseHeader("Cache-Control"),expires:S.getResponseHeader("Expires")})}else{const C=new Blob([S.response],{type:S.getResponseHeader("Content-Type")});x(new ke(S.status,S.statusText,l.url,C))}},f.signal.addEventListener("abort",()=>{S.abort(),x(kr())}),S.send(l.body)})}(r,t)};function ot(r){if(!r||r.indexOf("://")<=0||r.indexOf("data:image/")===0||r.indexOf("blob:")===0)return!0;const t=new URL(r),s=window.location;return t.protocol===s.protocol&&t.host===s.host}function Vt(r,t,s){s[r]&&s[r].indexOf(t)!==-1||(s[r]=s[r]||[],s[r].push(t))}function Qt(r,t,s){if(s&&s[r]){const l=s[r].indexOf(t);l!==-1&&s[r].splice(l,1)}}class kt{constructor(t,s={}){Ae(this,s),this.type=t}}class bt extends kt{constructor(t,s={}){super("error",Ae({error:t},s))}}class ri{on(t,s){return this._listeners=this._listeners||{},Vt(t,s,this._listeners),this}off(t,s){return Qt(t,s,this._listeners),Qt(t,s,this._oneTimeListeners),this}once(t,s){return s?(this._oneTimeListeners=this._oneTimeListeners||{},Vt(t,s,this._oneTimeListeners),this):new Promise(l=>this.once(t,l))}fire(t,s){typeof t=="string"&&(t=new kt(t,s||{}));const l=t.type;if(this.listens(l)){t.target=this;const f=this._listeners&&this._listeners[l]?this._listeners[l].slice():[];for(const v of f)v.call(this,t);const y=this._oneTimeListeners&&this._oneTimeListeners[l]?this._oneTimeListeners[l].slice():[];for(const v of y)Qt(l,v,this._oneTimeListeners),v.call(this,t);const x=this._eventedParent;x&&(Ae(t,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(t))}else t instanceof bt&&console.error(t.error);return this}listens(t){return this._listeners&&this._listeners[t]&&this._listeners[t].length>0||this._oneTimeListeners&&this._oneTimeListeners[t]&&this._oneTimeListeners[t].length>0||this._eventedParent&&this._eventedParent.listens(t)}setEventedParent(t,s){return this._eventedParent=t,this._eventedParentData=s,this}}var xe={$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 wi=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Go(r,t){const s={};for(const l in r)l!=="ref"&&(s[l]=r[l]);return wi.forEach(l=>{l in t&&(s[l]=t[l])}),s}function Wt(r,t){if(Array.isArray(r)){if(!Array.isArray(t)||r.length!==t.length)return!1;for(let s=0;s<r.length;s++)if(!Wt(r[s],t[s]))return!1;return!0}if(typeof r=="object"&&r!==null&&t!==null){if(typeof t!="object"||Object.keys(r).length!==Object.keys(t).length)return!1;for(const s in r)if(!Wt(r[s],t[s]))return!1;return!0}return r===t}function Si(r,t){r.push(t)}function Yo(r,t,s){Si(s,{command:"addSource",args:[r,t[r]]})}function is(r,t,s){Si(t,{command:"removeSource",args:[r]}),s[r]=!0}function $r(r,t,s,l){is(r,s,l),Yo(r,t,s)}function Js(r,t,s){let l;for(l in r[s])if(Object.prototype.hasOwnProperty.call(r[s],l)&&l!=="data"&&!Wt(r[s][l],t[s][l]))return!1;for(l in t[s])if(Object.prototype.hasOwnProperty.call(t[s],l)&&l!=="data"&&!Wt(r[s][l],t[s][l]))return!1;return!0}function Un(r,t,s,l,f,y){r=r||{},t=t||{};for(const x in r)Object.prototype.hasOwnProperty.call(r,x)&&(Wt(r[x],t[x])||s.push({command:y,args:[l,x,t[x],f]}));for(const x in t)Object.prototype.hasOwnProperty.call(t,x)&&!Object.prototype.hasOwnProperty.call(r,x)&&(Wt(r[x],t[x])||s.push({command:y,args:[l,x,t[x],f]}))}function Xo(r){return r.id}function Ko(r,t){return r[t.id]=t,r}class ze{constructor(t,s,l,f){this.message=(t?`${t}: `:"")+l,f&&(this.identifier=f),s!=null&&s.__line__&&(this.line=s.__line__)}}function Er(r,...t){for(const s of t)for(const l in s)r[l]=s[l];return r}class on extends Error{constructor(t,s){super(s),this.message=s,this.key=t}}class Tr{constructor(t,s=[]){this.parent=t,this.bindings={};for(const[l,f]of s)this.bindings[l]=f}concat(t){return new Tr(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const ns={kind:"null"},Fe={kind:"number"},Tt={kind:"string"},pt={kind:"boolean"},fn={kind:"color"},ir={kind:"object"},xt={kind:"value"},Cr={kind:"collator"},jr={kind:"formatted"},rs={kind:"padding"},Mr={kind:"resolvedImage"},te={kind:"variableAnchorOffsetCollection"};function V(r,t){return{kind:"array",itemType:r,N:t}}function N(r){if(r.kind==="array"){const t=N(r.itemType);return typeof r.N=="number"?`array<${t}, ${r.N}>`:r.itemType.kind==="value"?"array":`array<${t}>`}return r.kind}const W=[ns,Fe,Tt,pt,fn,jr,ir,V(xt),rs,Mr,te];function J(r,t){if(t.kind==="error")return null;if(r.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!J(r.itemType,t.itemType))&&(typeof r.N!="number"||r.N===t.N))return null}else{if(r.kind===t.kind)return null;if(r.kind==="value"){for(const s of W)if(!J(s,t))return null}}return`Expected ${N(r)} but found ${N(t)} instead.`}function ce(r,t){return t.some(s=>s.kind===r.kind)}function de(r,t){return t.some(s=>s==="null"?r===null:s==="array"?Array.isArray(r):s==="object"?r&&!Array.isArray(r)&&typeof r=="object":s===typeof r)}function me(r,t){return r.kind==="array"&&t.kind==="array"?r.itemType.kind===t.itemType.kind&&typeof r.N=="number":r.kind===t.kind}const se=.96422,Se=.82521,Pe=4/29,ve=6/29,Le=3*ve*ve,at=ve*ve*ve,lt=Math.PI/180,jt=180/Math.PI;function vt(r){return(r%=360)<0&&(r+=360),r}function Ut([r,t,s,l]){let f,y;const x=Di((.2225045*(r=Rt(r))+.7168786*(t=Rt(t))+.0606169*(s=Rt(s)))/1);r===t&&t===s?f=y=x:(f=Di((.4360747*r+.3850649*t+.1430804*s)/se),y=Di((.0139322*r+.0971045*t+.7141733*s)/Se));const v=116*x-16;return[v<0?0:v,500*(f-x),200*(x-y),l]}function Rt(r){return r<=.04045?r/12.92:Math.pow((r+.055)/1.055,2.4)}function Di(r){return r>at?Math.pow(r,1/3):r/Le+Pe}function ki([r,t,s,l]){let f=(r+16)/116,y=isNaN(t)?f:f+t/500,x=isNaN(s)?f:f-s/200;return f=1*ei(f),y=se*ei(y),x=Se*ei(x),[Mt(3.1338561*y-1.6168667*f-.4906146*x),Mt(-.9787684*y+1.9161415*f+.033454*x),Mt(.0719453*y-.2289914*f+1.4052427*x),l]}function Mt(r){return(r=r<=.00304?12.92*r:1.055*Math.pow(r,1/2.4)-.055)<0?0:r>1?1:r}function ei(r){return r>ve?r*r*r:Le*(r-Pe)}function xi(r){return parseInt(r.padEnd(2,r),16)/255}function Fi(r,t){return qi(t?r/100:r,0,1)}function qi(r,t,s){return Math.min(Math.max(t,r),s)}function an(r){return!r.some(Number.isNaN)}const Qs={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 ti{constructor(t,s,l,f=1,y=!0){this.r=t,this.g=s,this.b=l,this.a=f,y||(this.r*=f,this.g*=f,this.b*=f,f||this.overwriteGetter("rgb",[t,s,l,f]))}static parse(t){if(t instanceof ti)return t;if(typeof t!="string")return;const s=function(l){if((l=l.toLowerCase().trim())==="transparent")return[0,0,0,0];const f=Qs[l];if(f){const[x,v,S]=f;return[x/255,v/255,S/255,1]}if(l.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(l)){const x=l.length<6?1:2;let v=1;return[xi(l.slice(v,v+=x)),xi(l.slice(v,v+=x)),xi(l.slice(v,v+=x)),xi(l.slice(v,v+x)||"ff")]}if(l.startsWith("rgb")){const x=l.match(/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(x){const[v,S,C,P,L,F,$,H,q,K,ie,ge]=x,le=[P||" ",$||" ",K].join("");if(le===" "||le===" /"||le===",,"||le===",,,"){const fe=[C,F,q].join(""),we=fe==="%%%"?100:fe===""?255:0;if(we){const Ie=[qi(+S/we,0,1),qi(+L/we,0,1),qi(+H/we,0,1),ie?Fi(+ie,ge):1];if(an(Ie))return Ie}}return}}const y=l.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(y){const[x,v,S,C,P,L,F,$,H]=y,q=[S||" ",P||" ",F].join("");if(q===" "||q===" /"||q===",,"||q===",,,"){const K=[+v,qi(+C,0,100),qi(+L,0,100),$?Fi(+$,H):1];if(an(K))return function([ie,ge,le,fe]){function we(Ie){const qe=(Ie+ie/30)%12,ct=ge*Math.min(le,1-le);return le-ct*Math.max(-1,Math.min(qe-3,9-qe,1))}return ie=vt(ie),ge/=100,le/=100,[we(0),we(8),we(4),fe]}(K)}}}(t);return s?new ti(...s,!1):void 0}get rgb(){const{r:t,g:s,b:l,a:f}=this,y=f||1/0;return this.overwriteGetter("rgb",[t/y,s/y,l/y,f])}get hcl(){return this.overwriteGetter("hcl",function(t){const[s,l,f,y]=Ut(t),x=Math.sqrt(l*l+f*f);return[Math.round(1e4*x)?vt(Math.atan2(f,l)*jt):NaN,x,s,y]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Ut(this.rgb))}overwriteGetter(t,s){return Object.defineProperty(this,t,{value:s}),s}toString(){const[t,s,l,f]=this.rgb;return`rgba(${[t,s,l].map(y=>Math.round(255*y)).join(",")},${f})`}}ti.black=new ti(0,0,0,1),ti.white=new ti(1,1,1,1),ti.transparent=new ti(0,0,0,0),ti.red=new ti(1,0,0,1);class cc{constructor(t,s,l){this.sensitivity=t?s?"variant":"case":s?"accent":"base",this.locale=l,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,s){return this.collator.compare(t,s)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class hc{constructor(t,s,l,f,y){this.text=t,this.image=s,this.scale=l,this.fontStack=f,this.textColor=y}}class Mn{constructor(t){this.sections=t}static fromString(t){return new Mn([new hc(t,null,null,null,null)])}isEmpty(){return this.sections.length===0||!this.sections.some(t=>t.text.length!==0||t.image&&t.image.name.length!==0)}static factory(t){return t instanceof Mn?t:Mn.fromString(t)}toString(){return this.sections.length===0?"":this.sections.map(t=>t.text).join("")}}class Pn{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Pn)return t;if(typeof t=="number")return new Pn([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const s of t)if(typeof s!="number")return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Pn(t)}}toString(){return JSON.stringify(this.values)}}const qp=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Hn{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Hn)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let s=0;s<t.length;s+=2){const l=t[s],f=t[s+1];if(typeof l!="string"||!qp.has(l)||!Array.isArray(f)||f.length!==2||typeof f[0]!="number"||typeof f[1]!="number")return}return new Hn(t)}}toString(){return JSON.stringify(this.values)}}class In{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new In({name:t,available:!1}):null}}function eo(r,t,s,l){return typeof r=="number"&&r>=0&&r<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof s=="number"&&s>=0&&s<=255?l===void 0||typeof l=="number"&&l>=0&&l<=1?null:`Invalid rgba value [${[r,t,s,l].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${(typeof l=="number"?[r,t,s,l]:[r,t,s]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Cs(r){if(r===null||typeof r=="string"||typeof r=="boolean"||typeof r=="number"||r instanceof ti||r instanceof cc||r instanceof Mn||r instanceof Pn||r instanceof Hn||r instanceof In)return!0;if(Array.isArray(r)){for(const t of r)if(!Cs(t))return!1;return!0}if(typeof r=="object"){for(const t in r)if(!Cs(r[t]))return!1;return!0}return!1}function zi(r){if(r===null)return ns;if(typeof r=="string")return Tt;if(typeof r=="boolean")return pt;if(typeof r=="number")return Fe;if(r instanceof ti)return fn;if(r instanceof cc)return Cr;if(r instanceof Mn)return jr;if(r instanceof Pn)return rs;if(r instanceof Hn)return te;if(r instanceof In)return Mr;if(Array.isArray(r)){const t=r.length;let s;for(const l of r){const f=zi(l);if(s){if(s===f)continue;s=xt;break}s=f}return V(s||xt,t)}return ir}function Jo(r){const t=typeof r;return r===null?"":t==="string"||t==="number"||t==="boolean"?String(r):r instanceof ti||r instanceof Mn||r instanceof Pn||r instanceof Hn||r instanceof In?r.toString():JSON.stringify(r)}class nr{constructor(t,s){this.type=t,this.value=s}static parse(t,s){if(t.length!==2)return s.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!Cs(t[1]))return s.error("invalid value");const l=t[1];let f=zi(l);const y=s.expectedType;return f.kind!=="array"||f.N!==0||!y||y.kind!=="array"||typeof y.N=="number"&&y.N!==0||(f=y),new nr(f,l)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ii{constructor(t){this.name="ExpressionEvaluationError",this.message=t}toJSON(){return this.message}}const qa={string:Tt,number:Fe,boolean:pt,object:ir};class rr{constructor(t,s){this.type=t,this.args=s}static parse(t,s){if(t.length<2)return s.error("Expected at least one argument.");let l,f=1;const y=t[0];if(y==="array"){let v,S;if(t.length>2){const C=t[1];if(typeof C!="string"||!(C in qa)||C==="object")return s.error('The item type argument of "array" must be one of string, number, boolean',1);v=qa[C],f++}else v=xt;if(t.length>3){if(t[2]!==null&&(typeof t[2]!="number"||t[2]<0||t[2]!==Math.floor(t[2])))return s.error('The length argument to "array" must be a positive integer literal',2);S=t[2],f++}l=V(v,S)}else{if(!qa[y])throw new Error(`Types doesn't contain name = ${y}`);l=qa[y]}const x=[];for(;f<t.length;f++){const v=s.parse(t[f],f,xt);if(!v)return null;x.push(v)}return new rr(l,x)}evaluate(t){for(let s=0;s<this.args.length;s++){const l=this.args[s].evaluate(t);if(!J(this.type,zi(l)))return l;if(s===this.args.length-1)throw new Ii(`Expected value to be of type ${N(this.type)}, but found ${N(zi(l))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const uc={"to-boolean":pt,"to-color":fn,"to-number":Fe,"to-string":Tt};class sr{constructor(t,s){this.type=t,this.args=s}static parse(t,s){if(t.length<2)return s.error("Expected at least one argument.");const l=t[0];if(!uc[l])throw new Error(`Can't parse ${l} as it is not part of the known types`);if((l==="to-boolean"||l==="to-string")&&t.length!==2)return s.error("Expected one argument.");const f=uc[l],y=[];for(let x=1;x<t.length;x++){const v=s.parse(t[x],x,xt);if(!v)return null;y.push(v)}return new sr(f,y)}evaluate(t){switch(this.type.kind){case"boolean":return!!this.args[0].evaluate(t);case"color":{let s,l;for(const f of this.args){if(s=f.evaluate(t),l=null,s instanceof ti)return s;if(typeof s=="string"){const y=t.parseColor(s);if(y)return y}else if(Array.isArray(s)&&(l=s.length<3||s.length>4?`Invalid rbga value ${JSON.stringify(s)}: expected an array containing either three or four numeric values.`:eo(s[0],s[1],s[2],s[3]),!l))return new ti(s[0]/255,s[1]/255,s[2]/255,s[3])}throw new Ii(l||`Could not parse color from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"padding":{let s;for(const l of this.args){s=l.evaluate(t);const f=Pn.parse(s);if(f)return f}throw new Ii(`Could not parse padding from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"variableAnchorOffsetCollection":{let s;for(const l of this.args){s=l.evaluate(t);const f=Hn.parse(s);if(f)return f}throw new Ii(`Could not parse variableAnchorOffsetCollection from value '${typeof s=="string"?s:JSON.stringify(s)}'`)}case"number":{let s=null;for(const l of this.args){if(s=l.evaluate(t),s===null)return 0;const f=Number(s);if(!isNaN(f))return f}throw new Ii(`Could not convert ${JSON.stringify(s)} to number.`)}case"formatted":return Mn.fromString(Jo(this.args[0].evaluate(t)));case"resolvedImage":return In.fromString(Jo(this.args[0].evaluate(t)));default:return Jo(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Zp=["Unknown","Point","LineString","Polygon"];class Za{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"?Zp[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(t){let s=this._parseColorCache[t];return s||(s=this._parseColorCache[t]=ti.parse(t)),s}}class Ms{constructor(t,s,l=[],f,y=new Tr,x=[]){this.registry=t,this.path=l,this.key=l.map(v=>`[${v}]`).join(""),this.scope=y,this.errors=x,this.expectedType=f,this._isConstant=s}parse(t,s,l,f,y={}){return s?this.concat(s,l,f)._parse(t,y):this._parse(t,y)}_parse(t,s){function l(f,y,x){return x==="assert"?new rr(y,[f]):x==="coerce"?new sr(y,[f]):f}if(t!==null&&typeof t!="string"&&typeof t!="boolean"&&typeof t!="number"||(t=["literal",t]),Array.isArray(t)){if(t.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const f=t[0];if(typeof f!="string")return this.error(`Expression name must be a string, but found ${typeof f} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const y=this.registry[f];if(y){let x=y.parse(t,this);if(!x)return null;if(this.expectedType){const v=this.expectedType,S=x.type;if(v.kind!=="string"&&v.kind!=="number"&&v.kind!=="boolean"&&v.kind!=="object"&&v.kind!=="array"||S.kind!=="value")if(v.kind!=="color"&&v.kind!=="formatted"&&v.kind!=="resolvedImage"||S.kind!=="value"&&S.kind!=="string")if(v.kind!=="padding"||S.kind!=="value"&&S.kind!=="number"&&S.kind!=="array")if(v.kind!=="variableAnchorOffsetCollection"||S.kind!=="value"&&S.kind!=="array"){if(this.checkSubtype(v,S))return null}else x=l(x,v,s.typeAnnotation||"coerce");else x=l(x,v,s.typeAnnotation||"coerce");else x=l(x,v,s.typeAnnotation||"coerce");else x=l(x,v,s.typeAnnotation||"assert")}if(!(x instanceof nr)&&x.type.kind!=="resolvedImage"&&this._isConstant(x)){const v=new Za;try{x=new nr(x.type,x.evaluate(v))}catch(S){return this.error(S.message),null}}return x}return this.error(`Unknown expression "${f}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(t===void 0?"'undefined' value invalid. Use null instead.":typeof t=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof t} instead.`)}concat(t,s,l){const f=typeof t=="number"?this.path.concat(t):this.path,y=l?this.scope.concat(l):this.scope;return new Ms(this.registry,this._isConstant,f,s||null,y,this.errors)}error(t,...s){const l=`${this.key}${s.map(f=>`[${f}]`).join("")}`;this.errors.push(new on(l,t))}checkSubtype(t,s){const l=J(t,s);return l&&this.error(l),l}}class ss{constructor(t,s){this.type=s.type,this.bindings=[].concat(t),this.result=s}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const s of this.bindings)t(s[1]);t(this.result)}static parse(t,s){if(t.length<4)return s.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const l=[];for(let y=1;y<t.length-1;y+=2){const x=t[y];if(typeof x!="string")return s.error(`Expected string, but found ${typeof x} instead.`,y);if(/[^a-zA-Z0-9_]/.test(x))return s.error("Variable names must contain only alphanumeric characters or '_'.",y);const v=s.parse(t[y+1],y+1);if(!v)return null;l.push([x,v])}const f=s.parse(t[t.length-1],t.length-1,s.expectedType,l);return f?new ss(l,f):null}outputDefined(){return this.result.outputDefined()}}class Gt{constructor(t,s){this.type=s.type,this.name=t,this.boundExpression=s}static parse(t,s){if(t.length!==2||typeof t[1]!="string")return s.error("'var' expression requires exactly one string literal argument.");const l=t[1];return s.scope.has(l)?new Gt(l,s.scope.get(l)):s.error(`Unknown variable "${l}". Make sure "${l}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class dc{constructor(t,s,l){this.type=t,this.index=s,this.input=l}static parse(t,s){if(t.length!==3)return s.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const l=s.parse(t[1],1,Fe),f=s.parse(t[2],2,V(s.expectedType||xt));return l&&f?new dc(f.type.itemType,l,f):null}evaluate(t){const s=this.index.evaluate(t),l=this.input.evaluate(t);if(s<0)throw new Ii(`Array index out of bounds: ${s} < 0.`);if(s>=l.length)throw new Ii(`Array index out of bounds: ${s} > ${l.length-1}.`);if(s!==Math.floor(s))throw new Ii(`Array index must be an integer, but found ${s} instead.`);return l[s]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class pc{constructor(t,s){this.type=pt,this.needle=t,this.haystack=s}static parse(t,s){if(t.length!==3)return s.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const l=s.parse(t[1],1,xt),f=s.parse(t[2],2,xt);return l&&f?ce(l.type,[pt,Tt,Fe,ns,xt])?new pc(l,f):s.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(l.type)} instead`):null}evaluate(t){const s=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!l)return!1;if(!de(s,["boolean","string","number","null"]))throw new Ii(`Expected first argument to be of type boolean, string, number or null, but found ${N(zi(s))} instead.`);if(!de(l,["string","array"]))throw new Ii(`Expected second argument to be of type array or string, but found ${N(zi(l))} instead.`);return l.indexOf(s)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class to{constructor(t,s,l){this.type=Fe,this.needle=t,this.haystack=s,this.fromIndex=l}static parse(t,s){if(t.length<=2||t.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const l=s.parse(t[1],1,xt),f=s.parse(t[2],2,xt);if(!l||!f)return null;if(!ce(l.type,[pt,Tt,Fe,ns,xt]))return s.error(`Expected first argument to be of type boolean, string, number or null, but found ${N(l.type)} instead`);if(t.length===4){const y=s.parse(t[3],3,Fe);return y?new to(l,f,y):null}return new to(l,f)}evaluate(t){const s=this.needle.evaluate(t),l=this.haystack.evaluate(t);if(!de(s,["boolean","string","number","null"]))throw new Ii(`Expected first argument to be of type boolean, string, number or null, but found ${N(zi(s))} instead.`);let f;if(this.fromIndex&&(f=this.fromIndex.evaluate(t)),de(l,["string"])){const y=l.indexOf(s,f);return y===-1?-1:[...l.slice(0,y)].length}if(de(l,["array"]))return l.indexOf(s,f);throw new Ii(`Expected second argument to be of type array or string, but found ${N(zi(l))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class fc{constructor(t,s,l,f,y,x){this.inputType=t,this.type=s,this.input=l,this.cases=f,this.outputs=y,this.otherwise=x}static parse(t,s){if(t.length<5)return s.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return s.error("Expected an even number of arguments.");let l,f;s.expectedType&&s.expectedType.kind!=="value"&&(f=s.expectedType);const y={},x=[];for(let C=2;C<t.length-1;C+=2){let P=t[C];const L=t[C+1];Array.isArray(P)||(P=[P]);const F=s.concat(C);if(P.length===0)return F.error("Expected at least one branch label.");for(const H of P){if(typeof H!="number"&&typeof H!="string")return F.error("Branch labels must be numbers or strings.");if(typeof H=="number"&&Math.abs(H)>Number.MAX_SAFE_INTEGER)return F.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if(typeof H=="number"&&Math.floor(H)!==H)return F.error("Numeric branch labels must be integer values.");if(l){if(F.checkSubtype(l,zi(H)))return null}else l=zi(H);if(y[String(H)]!==void 0)return F.error("Branch labels must be unique.");y[String(H)]=x.length}const $=s.parse(L,C,f);if(!$)return null;f=f||$.type,x.push($)}const v=s.parse(t[1],1,xt);if(!v)return null;const S=s.parse(t[t.length-1],t.length-1,f);return S?v.type.kind!=="value"&&s.concat(1).checkSubtype(l,v.type)?null:new fc(l,f,v,y,x,S):null}evaluate(t){const s=this.input.evaluate(t);return(zi(s)===this.inputType&&this.outputs[this.cases[s]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class Wa{constructor(t,s,l){this.type=t,this.branches=s,this.otherwise=l}static parse(t,s){if(t.length<4)return s.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return s.error("Expected an odd number of arguments.");let l;s.expectedType&&s.expectedType.kind!=="value"&&(l=s.expectedType);const f=[];for(let x=1;x<t.length-1;x+=2){const v=s.parse(t[x],x,pt);if(!v)return null;const S=s.parse(t[x+1],x+1,l);if(!S)return null;f.push([v,S]),l=l||S.type}const y=s.parse(t[t.length-1],t.length-1,l);if(!y)return null;if(!l)throw new Error("Can't infer output type");return new Wa(l,f,y)}evaluate(t){for(const[s,l]of this.branches)if(s.evaluate(t))return l.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[s,l]of this.branches)t(s),t(l);t(this.otherwise)}outputDefined(){return this.branches.every(([t,s])=>s.outputDefined())&&this.otherwise.outputDefined()}}class Qo{constructor(t,s,l,f){this.type=t,this.input=s,this.beginIndex=l,this.endIndex=f}static parse(t,s){if(t.length<=2||t.length>=5)return s.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const l=s.parse(t[1],1,xt),f=s.parse(t[2],2,Fe);if(!l||!f)return null;if(!ce(l.type,[V(xt),Tt,xt]))return s.error(`Expected first argument to be of type array or string, but found ${N(l.type)} instead`);if(t.length===4){const y=s.parse(t[3],3,Fe);return y?new Qo(l.type,l,f,y):null}return new Qo(l.type,l,f)}evaluate(t){const s=this.input.evaluate(t),l=this.beginIndex.evaluate(t);let f;if(this.endIndex&&(f=this.endIndex.evaluate(t)),de(s,["string"]))return[...s].slice(l,f).join("");if(de(s,["array"]))return s.slice(l,f);throw new Ii(`Expected first argument to be of type array or string, but found ${N(zi(s))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function Ga(r,t){const s=r.length-1;let l,f,y=0,x=s,v=0;for(;y<=x;)if(v=Math.floor((y+x)/2),l=r[v],f=r[v+1],l<=t){if(v===s||t<f)return v;y=v+1}else{if(!(l>t))throw new Ii("Input is not a number.");x=v-1}return 0}class io{constructor(t,s,l){this.type=t,this.input=s,this.labels=[],this.outputs=[];for(const[f,y]of l)this.labels.push(f),this.outputs.push(y)}static parse(t,s){if(t.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return s.error("Expected an even number of arguments.");const l=s.parse(t[1],1,Fe);if(!l)return null;const f=[];let y=null;s.expectedType&&s.expectedType.kind!=="value"&&(y=s.expectedType);for(let x=1;x<t.length;x+=2){const v=x===1?-1/0:t[x],S=t[x+1],C=x,P=x+1;if(typeof v!="number")return s.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',C);if(f.length&&f[f.length-1][0]>=v)return s.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',C);const L=s.parse(S,P,y);if(!L)return null;y=y||L.type,f.push([v,L])}return new io(y,l,f)}evaluate(t){const s=this.labels,l=this.outputs;if(s.length===1)return l[0].evaluate(t);const f=this.input.evaluate(t);if(f<=s[0])return l[0].evaluate(t);const y=s.length;return f>=s[y-1]?l[y-1].evaluate(t):l[Ga(s,f)].evaluate(t)}eachChild(t){t(this.input);for(const s of this.outputs)t(s)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function pu(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Wp=fu;function fu(r,t,s,l){this.cx=3*r,this.bx=3*(s-r)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(l-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=r,this.p1y=t,this.p2x=s,this.p2y=l}fu.prototype={sampleCurveX:function(r){return((this.ax*r+this.bx)*r+this.cx)*r},sampleCurveY:function(r){return((this.ay*r+this.by)*r+this.cy)*r},sampleCurveDerivativeX:function(r){return(3*this.ax*r+2*this.bx)*r+this.cx},solveCurveX:function(r,t){if(t===void 0&&(t=1e-6),r<0)return 0;if(r>1)return 1;for(var s=r,l=0;l<8;l++){var f=this.sampleCurveX(s)-r;if(Math.abs(f)<t)return s;var y=this.sampleCurveDerivativeX(s);if(Math.abs(y)<1e-6)break;s-=f/y}var x=0,v=1;for(s=r,l=0;l<20&&(f=this.sampleCurveX(s),!(Math.abs(f-r)<t));l++)r>f?x=s:v=s,s=.5*(v-x)+x;return s},solve:function(r,t){return this.sampleCurveY(this.solveCurveX(r,t))}};var Gp=pu(Wp);function Ps(r,t,s){return r+s*(t-r)}function ea(r,t,s){return r.map((l,f)=>Ps(l,t[f],s))}const mn={number:Ps,color:function(r,t,s,l="rgb"){switch(l){case"rgb":{const[f,y,x,v]=ea(r.rgb,t.rgb,s);return new ti(f,y,x,v,!1)}case"hcl":{const[f,y,x,v]=r.hcl,[S,C,P,L]=t.hcl;let F,$;if(isNaN(f)||isNaN(S))isNaN(f)?isNaN(S)?F=NaN:(F=S,x!==1&&x!==0||($=C)):(F=f,P!==1&&P!==0||($=y));else{let ge=S-f;S>f&&ge>180?ge-=360:S<f&&f-S>180&&(ge+=360),F=f+s*ge}const[H,q,K,ie]=function([ge,le,fe,we]){return ge=isNaN(ge)?0:ge*lt,ki([fe,Math.cos(ge)*le,Math.sin(ge)*le,we])}([F,$??Ps(y,C,s),Ps(x,P,s),Ps(v,L,s)]);return new ti(H,q,K,ie,!1)}case"lab":{const[f,y,x,v]=ki(ea(r.lab,t.lab,s));return new ti(f,y,x,v,!1)}}},array:ea,padding:function(r,t,s){return new Pn(ea(r.values,t.values,s))},variableAnchorOffsetCollection:function(r,t,s){const l=r.values,f=t.values;if(l.length!==f.length)throw new Ii(`Cannot interpolate values of different length. from: ${r.toString()}, to: ${t.toString()}`);const y=[];for(let x=0;x<l.length;x+=2){if(l[x]!==f[x])throw new Ii(`Cannot interpolate values containing mismatched anchors. from[${x}]: ${l[x]}, to[${x}]: ${f[x]}`);y.push(l[x]);const[v,S]=l[x+1],[C,P]=f[x+1];y.push([Ps(v,C,s),Ps(S,P,s)])}return new Hn(y)}};class gn{constructor(t,s,l,f,y){this.type=t,this.operator=s,this.interpolation=l,this.input=f,this.labels=[],this.outputs=[];for(const[x,v]of y)this.labels.push(x),this.outputs.push(v)}static interpolationFactor(t,s,l,f){let y=0;if(t.name==="exponential")y=Ya(s,t.base,l,f);else if(t.name==="linear")y=Ya(s,1,l,f);else if(t.name==="cubic-bezier"){const x=t.controlPoints;y=new Gp(x[0],x[1],x[2],x[3]).solve(Ya(s,1,l,f))}return y}static parse(t,s){let[l,f,y,...x]=t;if(!Array.isArray(f)||f.length===0)return s.error("Expected an interpolation type expression.",1);if(f[0]==="linear")f={name:"linear"};else if(f[0]==="exponential"){const C=f[1];if(typeof C!="number")return s.error("Exponential interpolation requires a numeric base.",1,1);f={name:"exponential",base:C}}else{if(f[0]!=="cubic-bezier")return s.error(`Unknown interpolation type ${String(f[0])}`,1,0);{const C=f.slice(1);if(C.length!==4||C.some(P=>typeof P!="number"||P<0||P>1))return s.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);f={name:"cubic-bezier",controlPoints:C}}}if(t.length-1<4)return s.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return s.error("Expected an even number of arguments.");if(y=s.parse(y,2,Fe),!y)return null;const v=[];let S=null;l==="interpolate-hcl"||l==="interpolate-lab"?S=fn:s.expectedType&&s.expectedType.kind!=="value"&&(S=s.expectedType);for(let C=0;C<x.length;C+=2){const P=x[C],L=x[C+1],F=C+3,$=C+4;if(typeof P!="number")return s.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',F);if(v.length&&v[v.length-1][0]>=P)return s.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',F);const H=s.parse(L,$,S);if(!H)return null;S=S||H.type,v.push([P,H])}return me(S,Fe)||me(S,fn)||me(S,rs)||me(S,te)||me(S,V(Fe))?new gn(S,l,f,y,v):s.error(`Type ${N(S)} is not interpolatable.`)}evaluate(t){const s=this.labels,l=this.outputs;if(s.length===1)return l[0].evaluate(t);const f=this.input.evaluate(t);if(f<=s[0])return l[0].evaluate(t);const y=s.length;if(f>=s[y-1])return l[y-1].evaluate(t);const x=Ga(s,f),v=gn.interpolationFactor(this.interpolation,f,s[x],s[x+1]),S=l[x].evaluate(t),C=l[x+1].evaluate(t);switch(this.operator){case"interpolate":return mn[this.type.kind](S,C,v);case"interpolate-hcl":return mn.color(S,C,v,"hcl");case"interpolate-lab":return mn.color(S,C,v,"lab")}}eachChild(t){t(this.input);for(const s of this.outputs)t(s)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function Ya(r,t,s,l){const f=l-s,y=r-s;return f===0?0:t===1?y/f:(Math.pow(t,y)-1)/(Math.pow(t,f)-1)}class Xa{constructor(t,s){this.type=t,this.args=s}static parse(t,s){if(t.length<2)return s.error("Expectected at least one argument.");let l=null;const f=s.expectedType;f&&f.kind!=="value"&&(l=f);const y=[];for(const v of t.slice(1)){const S=s.parse(v,1+y.length,l,void 0,{typeAnnotation:"omit"});if(!S)return null;l=l||S.type,y.push(S)}if(!l)throw new Error("No output type");const x=f&&y.some(v=>J(f,v.type));return new Xa(x?xt:l,y)}evaluate(t){let s,l=null,f=0;for(const y of this.args)if(f++,l=y.evaluate(t),l&&l instanceof In&&!l.available&&(s||(s=l.name),l=null,f===this.args.length&&(l=s)),l!==null)break;return l}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function Ka(r,t){return r==="=="||r==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function mu(r,t,s,l){return l.compare(t,s)===0}function no(r,t,s){const l=r!=="=="&&r!=="!=";return class ux{constructor(y,x,v){this.type=pt,this.lhs=y,this.rhs=x,this.collator=v,this.hasUntypedArgument=y.type.kind==="value"||x.type.kind==="value"}static parse(y,x){if(y.length!==3&&y.length!==4)return x.error("Expected two or three arguments.");const v=y[0];let S=x.parse(y[1],1,xt);if(!S)return null;if(!Ka(v,S.type))return x.concat(1).error(`"${v}" comparisons are not supported for type '${N(S.type)}'.`);let C=x.parse(y[2],2,xt);if(!C)return null;if(!Ka(v,C.type))return x.concat(2).error(`"${v}" comparisons are not supported for type '${N(C.type)}'.`);if(S.type.kind!==C.type.kind&&S.type.kind!=="value"&&C.type.kind!=="value")return x.error(`Cannot compare types '${N(S.type)}' and '${N(C.type)}'.`);l&&(S.type.kind==="value"&&C.type.kind!=="value"?S=new rr(C.type,[S]):S.type.kind!=="value"&&C.type.kind==="value"&&(C=new rr(S.type,[C])));let P=null;if(y.length===4){if(S.type.kind!=="string"&&C.type.kind!=="string"&&S.type.kind!=="value"&&C.type.kind!=="value")return x.error("Cannot use collator to compare non-string types.");if(P=x.parse(y[3],3,Cr),!P)return null}return new ux(S,C,P)}evaluate(y){const x=this.lhs.evaluate(y),v=this.rhs.evaluate(y);if(l&&this.hasUntypedArgument){const S=zi(x),C=zi(v);if(S.kind!==C.kind||S.kind!=="string"&&S.kind!=="number")throw new Ii(`Expected arguments for "${r}" to be (string, string) or (number, number), but found (${S.kind}, ${C.kind}) instead.`)}if(this.collator&&!l&&this.hasUntypedArgument){const S=zi(x),C=zi(v);if(S.kind!=="string"||C.kind!=="string")return t(y,x,v)}return this.collator?s(y,x,v,this.collator.evaluate(y)):t(y,x,v)}eachChild(y){y(this.lhs),y(this.rhs),this.collator&&y(this.collator)}outputDefined(){return!0}}}const Yp=no("==",function(r,t,s){return t===s},mu),gu=no("!=",function(r,t,s){return t!==s},function(r,t,s,l){return!mu(0,t,s,l)}),yu=no("<",function(r,t,s){return t<s},function(r,t,s,l){return l.compare(t,s)<0}),Xp=no(">",function(r,t,s){return t>s},function(r,t,s,l){return l.compare(t,s)>0}),Kp=no("<=",function(r,t,s){return t<=s},function(r,t,s,l){return l.compare(t,s)<=0}),_u=no(">=",function(r,t,s){return t>=s},function(r,t,s,l){return l.compare(t,s)>=0});class ta{constructor(t,s,l){this.type=Cr,this.locale=l,this.caseSensitive=t,this.diacriticSensitive=s}static parse(t,s){if(t.length!==2)return s.error("Expected one argument.");const l=t[1];if(typeof l!="object"||Array.isArray(l))return s.error("Collator options argument must be an object.");const f=s.parse(l["case-sensitive"]!==void 0&&l["case-sensitive"],1,pt);if(!f)return null;const y=s.parse(l["diacritic-sensitive"]!==void 0&&l["diacritic-sensitive"],1,pt);if(!y)return null;let x=null;return l.locale&&(x=s.parse(l.locale,1,Tt),!x)?null:new ta(f,y,x)}evaluate(t){return new cc(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class mc{constructor(t,s,l,f,y){this.type=Tt,this.number=t,this.locale=s,this.currency=l,this.minFractionDigits=f,this.maxFractionDigits=y}static parse(t,s){if(t.length!==3)return s.error("Expected two arguments.");const l=s.parse(t[1],1,Fe);if(!l)return null;const f=t[2];if(typeof f!="object"||Array.isArray(f))return s.error("NumberFormat options argument must be an object.");let y=null;if(f.locale&&(y=s.parse(f.locale,1,Tt),!y))return null;let x=null;if(f.currency&&(x=s.parse(f.currency,1,Tt),!x))return null;let v=null;if(f["min-fraction-digits"]&&(v=s.parse(f["min-fraction-digits"],1,Fe),!v))return null;let S=null;return f["max-fraction-digits"]&&(S=s.parse(f["max-fraction-digits"],1,Fe),!S)?null:new mc(l,y,x,v,S)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class Ja{constructor(t){this.type=jr,this.sections=t}static parse(t,s){if(t.length<2)return s.error("Expected at least one argument.");const l=t[1];if(!Array.isArray(l)&&typeof l=="object")return s.error("First argument must be an image or text section.");const f=[];let y=!1;for(let x=1;x<=t.length-1;++x){const v=t[x];if(y&&typeof v=="object"&&!Array.isArray(v)){y=!1;let S=null;if(v["font-scale"]&&(S=s.parse(v["font-scale"],1,Fe),!S))return null;let C=null;if(v["text-font"]&&(C=s.parse(v["text-font"],1,V(Tt)),!C))return null;let P=null;if(v["text-color"]&&(P=s.parse(v["text-color"],1,fn),!P))return null;const L=f[f.length-1];L.scale=S,L.font=C,L.textColor=P}else{const S=s.parse(t[x],1,xt);if(!S)return null;const C=S.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return s.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");y=!0,f.push({content:S,scale:null,font:null,textColor:null})}}return new Ja(f)}evaluate(t){return new Mn(this.sections.map(s=>{const l=s.content.evaluate(t);return zi(l)===Mr?new hc("",l,null,null,null):new hc(Jo(l),null,s.scale?s.scale.evaluate(t):null,s.font?s.font.evaluate(t).join(","):null,s.textColor?s.textColor.evaluate(t):null)}))}eachChild(t){for(const s of this.sections)t(s.content),s.scale&&t(s.scale),s.font&&t(s.font),s.textColor&&t(s.textColor)}outputDefined(){return!1}}class gc{constructor(t){this.type=Mr,this.input=t}static parse(t,s){if(t.length!==2)return s.error("Expected two arguments.");const l=s.parse(t[1],1,Tt);return l?new gc(l):s.error("No image name provided.")}evaluate(t){const s=this.input.evaluate(t),l=In.fromString(s);return l&&t.availableImages&&(l.available=t.availableImages.indexOf(s)>-1),l}eachChild(t){t(this.input)}outputDefined(){return!1}}class yc{constructor(t){this.type=Fe,this.input=t}static parse(t,s){if(t.length!==2)return s.error(`Expected 1 argument, but found ${t.length-1} instead.`);const l=s.parse(t[1],1);return l?l.type.kind!=="array"&&l.type.kind!=="string"&&l.type.kind!=="value"?s.error(`Expected argument of type string or array, but found ${N(l.type)} instead.`):new yc(l):null}evaluate(t){const s=this.input.evaluate(t);if(typeof s=="string")return[...s].length;if(Array.isArray(s))return s.length;throw new Ii(`Expected value to be of type string or array, but found ${N(zi(s))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const Pr=8192;function Jp(r,t){const s=(180+r[0])/360,l=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r[1]*Math.PI/360)))/360,f=Math.pow(2,t.z);return[Math.round(s*f*Pr),Math.round(l*f*Pr)]}function _c(r,t){const s=Math.pow(2,t.z);return[(f=(r[0]/Pr+t.x)/s,360*f-180),(l=(r[1]/Pr+t.y)/s,360/Math.PI*Math.atan(Math.exp((180-360*l)*Math.PI/180))-90)];var l,f}function Is(r,t){r[0]=Math.min(r[0],t[0]),r[1]=Math.min(r[1],t[1]),r[2]=Math.max(r[2],t[0]),r[3]=Math.max(r[3],t[1])}function os(r,t){return!(r[0]<=t[0]||r[2]>=t[2]||r[1]<=t[1]||r[3]>=t[3])}function Xt(r,t,s){const l=r[0]-t[0],f=r[1]-t[1],y=r[0]-s[0],x=r[1]-s[1];return l*x-y*f==0&&l*y<=0&&f*x<=0}function Qa(r,t,s,l){return(f=[l[0]-s[0],l[1]-s[1]])[0]*(y=[t[0]-r[0],t[1]-r[1]])[1]-f[1]*y[0]!=0&&!(!bu(r,t,s,l)||!bu(s,l,r,t));var f,y}function Qp(r,t,s){for(const l of s)for(let f=0;f<l.length-1;++f)if(Qa(r,t,l[f],l[f+1]))return!0;return!1}function ro(r,t,s=!1){let l=!1;for(const v of t)for(let S=0;S<v.length-1;S++){if(Xt(r,v[S],v[S+1]))return s;(y=v[S])[1]>(f=r)[1]!=(x=v[S+1])[1]>f[1]&&f[0]<(x[0]-y[0])*(f[1]-y[1])/(x[1]-y[1])+y[0]&&(l=!l)}var f,y,x;return l}function ef(r,t){for(const s of t)if(ro(r,s))return!0;return!1}function xu(r,t){for(const s of r)if(!ro(s,t))return!1;for(let s=0;s<r.length-1;++s)if(Qp(r[s],r[s+1],t))return!1;return!0}function tf(r,t){for(const s of t)if(xu(r,s))return!0;return!1}function bu(r,t,s,l){const f=l[0]-s[0],y=l[1]-s[1],x=(r[0]-s[0])*y-f*(r[1]-s[1]),v=(t[0]-s[0])*y-f*(t[1]-s[1]);return x>0&&v<0||x<0&&v>0}function xc(r,t,s){const l=[];for(let f=0;f<r.length;f++){const y=[];for(let x=0;x<r[f].length;x++){const v=Jp(r[f][x],s);Is(t,v),y.push(v)}l.push(y)}return l}function vu(r,t,s){const l=[];for(let f=0;f<r.length;f++){const y=xc(r[f],t,s);l.push(y)}return l}function wu(r,t,s,l){if(r[0]<s[0]||r[0]>s[2]){const f=.5*l;let y=r[0]-s[0]>f?-l:s[0]-r[0]>f?l:0;y===0&&(y=r[0]-s[2]>f?-l:s[2]-r[0]>f?l:0),r[0]+=y}Is(t,r)}function Su(r,t,s,l){const f=Math.pow(2,l.z)*Pr,y=[l.x*Pr,l.y*Pr],x=[];for(const v of r)for(const S of v){const C=[S.x+y[0],S.y+y[1]];wu(C,t,s,f),x.push(C)}return x}function ku(r,t,s,l){const f=Math.pow(2,l.z)*Pr,y=[l.x*Pr,l.y*Pr],x=[];for(const S of r){const C=[];for(const P of S){const L=[P.x+y[0],P.y+y[1]];Is(t,L),C.push(L)}x.push(C)}if(t[2]-t[0]<=f/2){(v=t)[0]=v[1]=1/0,v[2]=v[3]=-1/0;for(const S of x)for(const C of S)wu(C,t,s,f)}var v;return x}class As{constructor(t,s){this.type=pt,this.geojson=t,this.geometries=s}static parse(t,s){if(t.length!==2)return s.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Cs(t[1])){const l=t[1];if(l.type==="FeatureCollection"){const f=[];for(const y of l.features){const{type:x,coordinates:v}=y.geometry;x==="Polygon"&&f.push(v),x==="MultiPolygon"&&f.push(...v)}if(f.length)return new As(l,{type:"MultiPolygon",coordinates:f})}else if(l.type==="Feature"){const f=l.geometry.type;if(f==="Polygon"||f==="MultiPolygon")return new As(l,l.geometry)}else if(l.type==="Polygon"||l.type==="MultiPolygon")return new As(l,l)}return s.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(s,l){const f=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=s.canonicalID();if(l.type==="Polygon"){const v=xc(l.coordinates,y,x),S=Su(s.geometry(),f,y,x);if(!os(f,y))return!1;for(const C of S)if(!ro(C,v))return!1}if(l.type==="MultiPolygon"){const v=vu(l.coordinates,y,x),S=Su(s.geometry(),f,y,x);if(!os(f,y))return!1;for(const C of S)if(!ef(C,v))return!1}return!0}(t,this.geometries);if(t.geometryType()==="LineString")return function(s,l){const f=[1/0,1/0,-1/0,-1/0],y=[1/0,1/0,-1/0,-1/0],x=s.canonicalID();if(l.type==="Polygon"){const v=xc(l.coordinates,y,x),S=ku(s.geometry(),f,y,x);if(!os(f,y))return!1;for(const C of S)if(!xu(C,v))return!1}if(l.type==="MultiPolygon"){const v=vu(l.coordinates,y,x),S=ku(s.geometry(),f,y,x);if(!os(f,y))return!1;for(const C of S)if(!tf(C,v))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}let Eu=class{constructor(r=[],t=(s,l)=>s<l?-1:s>l?1:0){if(this.data=r,this.length=this.data.length,this.compare=t,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(r){this.data.push(r),this._up(this.length++)}pop(){if(this.length===0)return;const r=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),r}peek(){return this.data[0]}_up(r){const{data:t,compare:s}=this,l=t[r];for(;r>0;){const f=r-1>>1,y=t[f];if(s(l,y)>=0)break;t[r]=y,r=f}t[r]=l}_down(r){const{data:t,compare:s}=this,l=this.length>>1,f=t[r];for(;r<l;){let y=1+(r<<1);const x=y+1;if(x<this.length&&s(t[x],t[y])<0&&(y=x),s(t[y],f)>=0)break;t[r]=t[y],r=y}t[r]=f}};function nf(r,t,s,l,f){Tu(r,t,s,l||r.length-1,f||rf)}function Tu(r,t,s,l,f){for(;l>s;){if(l-s>600){var y=l-s+1,x=t-s+1,v=Math.log(y),S=.5*Math.exp(2*v/3),C=.5*Math.sqrt(v*S*(y-S)/y)*(x-y/2<0?-1:1);Tu(r,t,Math.max(s,Math.floor(t-x*S/y+C)),Math.min(l,Math.floor(t+(y-x)*S/y+C)),f)}var P=r[t],L=s,F=l;for(ia(r,s,t),f(r[l],P)>0&&ia(r,s,l);L<F;){for(ia(r,L,F),L++,F--;f(r[L],P)<0;)L++;for(;f(r[F],P)>0;)F--}f(r[s],P)===0?ia(r,s,F):ia(r,++F,l),F<=t&&(s=F+1),t<=F&&(l=F-1)}}function ia(r,t,s){var l=r[t];r[t]=r[s],r[s]=l}function rf(r,t){return r<t?-1:r>t?1:0}function el(r,t){if(r.length<=1)return[r];const s=[];let l,f;for(const y of r){const x=of(y);x!==0&&(y.area=Math.abs(x),f===void 0&&(f=x<0),f===x<0?(l&&s.push(l),l=[y]):l.push(y))}if(l&&s.push(l),t>1)for(let y=0;y<s.length;y++)s[y].length<=t||(nf(s[y],t,1,s[y].length-1,sf),s[y]=s[y].slice(0,t));return s}function sf(r,t){return t.area-r.area}function of(r){let t=0;for(let s,l,f=0,y=r.length,x=y-1;f<y;x=f++)s=r[f],l=r[x],t+=(l.x-s.x)*(s.y+l.y);return t}const Cu=1/298.257223563,Mu=Cu*(2-Cu),Pu=Math.PI/180;class bc{constructor(t){const s=6378.137*Pu*1e3,l=Math.cos(t*Pu),f=1/(1-Mu*(1-l*l)),y=Math.sqrt(f);this.kx=s*y*l,this.ky=s*y*f*(1-Mu)}distance(t,s){const l=this.wrap(t[0]-s[0])*this.kx,f=(t[1]-s[1])*this.ky;return Math.sqrt(l*l+f*f)}pointOnLine(t,s){let l,f,y,x,v=1/0;for(let S=0;S<t.length-1;S++){let C=t[S][0],P=t[S][1],L=this.wrap(t[S+1][0]-C)*this.kx,F=(t[S+1][1]-P)*this.ky,$=0;L===0&&F===0||($=(this.wrap(s[0]-C)*this.kx*L+(s[1]-P)*this.ky*F)/(L*L+F*F),$>1?(C=t[S+1][0],P=t[S+1][1]):$>0&&(C+=L/this.kx*$,P+=F/this.ky*$)),L=this.wrap(s[0]-C)*this.kx,F=(s[1]-P)*this.ky;const H=L*L+F*F;H<v&&(v=H,l=C,f=P,y=S,x=$)}return{point:[l,f],index:y,t:Math.max(0,Math.min(1,x))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function Iu(r,t){return t[0]-r[0]}function tl(r){return r[1]-r[0]+1}function Ur(r,t){return r[1]>=r[0]&&r[1]<t}function vc(r,t){if(r[0]>r[1])return[null,null];const s=tl(r);if(t){if(s===2)return[r,null];const f=Math.floor(s/2);return[[r[0],r[0]+f],[r[0]+f,r[1]]]}if(s===1)return[r,null];const l=Math.floor(s/2)-1;return[[r[0],r[0]+l],[r[0]+l+1,r[1]]]}function wc(r,t){if(!Ur(t,r.length))return[1/0,1/0,-1/0,-1/0];const s=[1/0,1/0,-1/0,-1/0];for(let l=t[0];l<=t[1];++l)Is(s,r[l]);return s}function Sc(r){const t=[1/0,1/0,-1/0,-1/0];for(const s of r)for(const l of s)Is(t,l);return t}function il(r){return r[0]!==-1/0&&r[1]!==-1/0&&r[2]!==1/0&&r[3]!==1/0}function kc(r,t,s){if(!il(r)||!il(t))return NaN;let l=0,f=0;return r[2]<t[0]&&(l=t[0]-r[2]),r[0]>t[2]&&(l=r[0]-t[2]),r[1]>t[3]&&(f=r[1]-t[3]),r[3]<t[1]&&(f=t[1]-r[3]),s.distance([0,0],[l,f])}function Ds(r,t,s){const l=s.pointOnLine(t,r);return s.distance(r,l.point)}function Ec(r,t,s,l,f){const y=Math.min(Ds(r,[s,l],f),Ds(t,[s,l],f)),x=Math.min(Ds(s,[r,t],f),Ds(l,[r,t],f));return Math.min(y,x)}function af(r,t,s,l,f){if(!Ur(t,r.length)||!Ur(l,s.length))return 1/0;let y=1/0;for(let x=t[0];x<t[1];++x){const v=r[x],S=r[x+1];for(let C=l[0];C<l[1];++C){const P=s[C],L=s[C+1];if(Qa(v,S,P,L))return 0;y=Math.min(y,Ec(v,S,P,L,f))}}return y}function Ci(r,t,s,l,f){if(!Ur(t,r.length)||!Ur(l,s.length))return NaN;let y=1/0;for(let x=t[0];x<=t[1];++x)for(let v=l[0];v<=l[1];++v)if(y=Math.min(y,f.distance(r[x],s[v])),y===0)return y;return y}function lf(r,t,s){if(ro(r,t,!0))return 0;let l=1/0;for(const f of t){const y=f[0],x=f[f.length-1];if(y!==x&&(l=Math.min(l,Ds(r,[x,y],s)),l===0))return l;const v=s.pointOnLine(f,r);if(l=Math.min(l,s.distance(r,v.point)),l===0)return l}return l}function It(r,t,s,l){if(!Ur(t,r.length))return NaN;for(let y=t[0];y<=t[1];++y)if(ro(r[y],s,!0))return 0;let f=1/0;for(let y=t[0];y<t[1];++y){const x=r[y],v=r[y+1];for(const S of s)for(let C=0,P=S.length,L=P-1;C<P;L=C++){const F=S[L],$=S[C];if(Qa(x,v,F,$))return 0;f=Math.min(f,Ec(x,v,F,$,l))}}return f}function nl(r,t){for(const s of r)for(const l of s)if(ro(l,t,!0))return!0;return!1}function hi(r,t,s,l=1/0){const f=Sc(r),y=Sc(t);if(l!==1/0&&kc(f,y,s)>=l)return l;if(os(f,y)){if(nl(r,t))return 0}else if(nl(t,r))return 0;let x=1/0;for(const v of r)for(let S=0,C=v.length,P=C-1;S<C;P=S++){const L=v[P],F=v[S];for(const $ of t)for(let H=0,q=$.length,K=q-1;H<q;K=H++){const ie=$[K],ge=$[H];if(Qa(L,F,ie,ge))return 0;x=Math.min(x,Ec(L,F,ie,ge,s))}}return x}function si(r,t,s,l,f,y){if(!y)return;const x=kc(wc(l,y),f,s);x<t&&r.push([x,y,[0,0]])}function zs(r,t,s,l,f,y,x){if(!y||!x)return;const v=kc(wc(l,y),wc(f,x),s);v<t&&r.push([v,y,x])}function na(r,t,s,l,f=1/0){let y=Math.min(l.distance(r[0],s[0][0]),f);if(y===0)return y;const x=new Eu([[0,[0,r.length-1],[0,0]]],Iu),v=Sc(s);for(;x.length>0;){const S=x.pop();if(S[0]>=y)continue;const C=S[1],P=t?50:100;if(tl(C)<=P){if(!Ur(C,r.length))return NaN;if(t){const L=It(r,C,s,l);if(isNaN(L)||L===0)return L;y=Math.min(y,L)}else for(let L=C[0];L<=C[1];++L){const F=lf(r[L],s,l);if(y=Math.min(y,F),y===0)return 0}}else{const L=vc(C,t);si(x,y,l,r,v,L[0]),si(x,y,l,r,v,L[1])}}return y}function ra(r,t,s,l,f,y=1/0){let x=Math.min(y,f.distance(r[0],s[0]));if(x===0)return x;const v=new Eu([[0,[0,r.length-1],[0,s.length-1]]],Iu);for(;v.length>0;){const S=v.pop();if(S[0]>=x)continue;const C=S[1],P=S[2],L=t?50:100,F=l?50:100;if(tl(C)<=L&&tl(P)<=F){if(!Ur(C,r.length)&&Ur(P,s.length))return NaN;let $;if(t&&l)$=af(r,C,s,P,f),x=Math.min(x,$);else if(t&&!l){const H=r.slice(C[0],C[1]+1);for(let q=P[0];q<=P[1];++q)if($=Ds(s[q],H,f),x=Math.min(x,$),x===0)return x}else if(!t&&l){const H=s.slice(P[0],P[1]+1);for(let q=C[0];q<=C[1];++q)if($=Ds(r[q],H,f),x=Math.min(x,$),x===0)return x}else $=Ci(r,C,s,P,f),x=Math.min(x,$)}else{const $=vc(C,t),H=vc(P,l);zs(v,x,f,r,s,$[0],H[0]),zs(v,x,f,r,s,$[0],H[1]),zs(v,x,f,r,s,$[1],H[0]),zs(v,x,f,r,s,$[1],H[1])}}return x}function Tc(r){return r.type==="MultiPolygon"?r.coordinates.map(t=>({type:"Polygon",coordinates:t})):r.type==="MultiLineString"?r.coordinates.map(t=>({type:"LineString",coordinates:t})):r.type==="MultiPoint"?r.coordinates.map(t=>({type:"Point",coordinates:t})):[r]}class Rs{constructor(t,s){this.type=Fe,this.geojson=t,this.geometries=s}static parse(t,s){if(t.length!==2)return s.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(Cs(t[1])){const l=t[1];if(l.type==="FeatureCollection")return new Rs(l,l.features.map(f=>Tc(f.geometry)).flat());if(l.type==="Feature")return new Rs(l,Tc(l.geometry));if("type"in l&&"coordinates"in l)return new Rs(l,Tc(l))}return s.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(t.geometry()!=null&&t.canonicalID()!=null){if(t.geometryType()==="Point")return function(s,l){const f=s.geometry(),y=f.flat().map(S=>_c([S.x,S.y],s.canonical));if(f.length===0)return NaN;const x=new bc(y[0][1]);let v=1/0;for(const S of l){switch(S.type){case"Point":v=Math.min(v,ra(y,!1,[S.coordinates],!1,x,v));break;case"LineString":v=Math.min(v,ra(y,!1,S.coordinates,!0,x,v));break;case"Polygon":v=Math.min(v,na(y,!1,S.coordinates,x,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="LineString")return function(s,l){const f=s.geometry(),y=f.flat().map(S=>_c([S.x,S.y],s.canonical));if(f.length===0)return NaN;const x=new bc(y[0][1]);let v=1/0;for(const S of l){switch(S.type){case"Point":v=Math.min(v,ra(y,!0,[S.coordinates],!1,x,v));break;case"LineString":v=Math.min(v,ra(y,!0,S.coordinates,!0,x,v));break;case"Polygon":v=Math.min(v,na(y,!0,S.coordinates,x,v))}if(v===0)return v}return v}(t,this.geometries);if(t.geometryType()==="Polygon")return function(s,l){const f=s.geometry();if(f.length===0||f[0].length===0)return NaN;const y=el(f,0).map(S=>S.map(C=>C.map(P=>_c([P.x,P.y],s.canonical)))),x=new bc(y[0][0][0][1]);let v=1/0;for(const S of l)for(const C of y){switch(S.type){case"Point":v=Math.min(v,na([S.coordinates],!1,C,x,v));break;case"LineString":v=Math.min(v,na(S.coordinates,!0,C,x,v));break;case"Polygon":v=Math.min(v,hi(C,S.coordinates,x,v))}if(v===0)return v}return v}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}const so={"==":Yp,"!=":gu,">":Xp,"<":yu,">=":_u,"<=":Kp,array:rr,at:dc,boolean:rr,case:Wa,coalesce:Xa,collator:ta,format:Ja,image:gc,in:pc,"index-of":to,interpolate:gn,"interpolate-hcl":gn,"interpolate-lab":gn,length:yc,let:ss,literal:nr,match:fc,number:rr,"number-format":mc,object:rr,slice:Qo,step:io,string:rr,"to-boolean":sr,"to-color":sr,"to-number":sr,"to-string":sr,var:Gt,within:As,distance:Rs};class qn{constructor(t,s,l,f){this.name=t,this.type=s,this._evaluate=l,this.args=f}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,s){const l=t[0],f=qn.definitions[l];if(!f)return s.error(`Unknown expression "${l}". If you wanted a literal array, use ["literal", [...]].`,0);const y=Array.isArray(f)?f[0]:f.type,x=Array.isArray(f)?[[f[1],f[2]]]:f.overloads,v=x.filter(([C])=>!Array.isArray(C)||C.length===t.length-1);let S=null;for(const[C,P]of v){S=new Ms(s.registry,sa,s.path,null,s.scope);const L=[];let F=!1;for(let $=1;$<t.length;$++){const H=t[$],q=Array.isArray(C)?C[$-1]:C.type,K=S.parse(H,1+L.length,q);if(!K){F=!0;break}L.push(K)}if(!F)if(Array.isArray(C)&&C.length!==L.length)S.error(`Expected ${C.length} arguments, but found ${L.length} instead.`);else{for(let $=0;$<L.length;$++){const H=Array.isArray(C)?C[$]:C.type,q=L[$];S.concat($+1).checkSubtype(H,q.type)}if(S.errors.length===0)return new qn(l,y,P,L)}}if(v.length===1)s.errors.push(...S.errors);else{const C=(v.length?v:x).map(([L])=>{return F=L,Array.isArray(F)?`(${F.map(N).join(", ")})`:`(${N(F.type)}...)`;var F}).join(" | "),P=[];for(let L=1;L<t.length;L++){const F=s.parse(t[L],1+P.length);if(!F)return null;P.push(N(F.type))}s.error(`Expected arguments of type ${C}, but found (${P.join(", ")}) instead.`)}return null}static register(t,s){qn.definitions=s;for(const l in s)t[l]=qn}}function Cc(r,[t,s,l,f]){t=t.evaluate(r),s=s.evaluate(r),l=l.evaluate(r);const y=f?f.evaluate(r):1,x=eo(t,s,l,y);if(x)throw new Ii(x);return new ti(t/255,s/255,l/255,y,!1)}function Mc(r,t){return r in t}function Pc(r,t){const s=t[r];return s===void 0?null:s}function Ls(r){return{type:r}}function sa(r){if(r instanceof Gt)return sa(r.boundExpression);if(r instanceof qn&&r.name==="error"||r instanceof ta||r instanceof As||r instanceof Rs)return!1;const t=r instanceof sr||r instanceof rr;let s=!0;return r.eachChild(l=>{s=t?s&&sa(l):s&&l instanceof nr}),!!s&&oa(r)&&aa(r,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function oa(r){if(r instanceof qn&&(r.name==="get"&&r.args.length===1||r.name==="feature-state"||r.name==="has"&&r.args.length===1||r.name==="properties"||r.name==="geometry-type"||r.name==="id"||/^filter-/.test(r.name))||r instanceof As||r instanceof Rs)return!1;let t=!0;return r.eachChild(s=>{t&&!oa(s)&&(t=!1)}),t}function oo(r){if(r instanceof qn&&r.name==="feature-state")return!1;let t=!0;return r.eachChild(s=>{t&&!oo(s)&&(t=!1)}),t}function aa(r,t){if(r instanceof qn&&t.indexOf(r.name)>=0)return!1;let s=!0;return r.eachChild(l=>{s&&!aa(l,t)&&(s=!1)}),s}function rl(r){return{result:"success",value:r}}function ao(r){return{result:"error",value:r}}function lo(r){return r["property-type"]==="data-driven"||r["property-type"]==="cross-faded-data-driven"}function Au(r){return!!r.expression&&r.expression.parameters.indexOf("zoom")>-1}function Ic(r){return!!r.expression&&r.expression.interpolated}function qt(r){return r instanceof Number?"number":r instanceof String?"string":r instanceof Boolean?"boolean":Array.isArray(r)?"array":r===null?"null":typeof r}function sl(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)}function cf(r){return r}function Du(r,t){const s=t.type==="color",l=r.stops&&typeof r.stops[0][0]=="object",f=l||!(l||r.property!==void 0),y=r.type||(Ic(t)?"exponential":"interval");if(s||t.type==="padding"){const P=s?ti.parse:Pn.parse;(r=Er({},r)).stops&&(r.stops=r.stops.map(L=>[L[0],P(L[1])])),r.default=P(r.default?r.default:t.default)}if(r.colorSpace&&(x=r.colorSpace)!=="rgb"&&x!=="hcl"&&x!=="lab")throw new Error(`Unknown color space: "${r.colorSpace}"`);var x;let v,S,C;if(y==="exponential")v=Ru;else if(y==="interval")v=ol;else if(y==="categorical"){v=zu,S=Object.create(null);for(const P of r.stops)S[P[0]]=P[1];C=typeof r.stops[0][0]}else{if(y!=="identity")throw new Error(`Unknown function type "${y}"`);v=Lu}if(l){const P={},L=[];for(let H=0;H<r.stops.length;H++){const q=r.stops[H],K=q[0].zoom;P[K]===void 0&&(P[K]={zoom:K,type:r.type,property:r.property,default:r.default,stops:[]},L.push(K)),P[K].stops.push([q[0].value,q[1]])}const F=[];for(const H of L)F.push([P[H].zoom,Du(P[H],t)]);const $={name:"linear"};return{kind:"composite",interpolationType:$,interpolationFactor:gn.interpolationFactor.bind(void 0,$),zoomStops:F.map(H=>H[0]),evaluate:({zoom:H},q)=>Ru({stops:F,base:r.base},t,H).evaluate(H,q)}}if(f){const P=y==="exponential"?{name:"exponential",base:r.base!==void 0?r.base:1}:null;return{kind:"camera",interpolationType:P,interpolationFactor:gn.interpolationFactor.bind(void 0,P),zoomStops:r.stops.map(L=>L[0]),evaluate:({zoom:L})=>v(r,t,L,S,C)}}return{kind:"source",evaluate(P,L){const F=L&&L.properties?L.properties[r.property]:void 0;return F===void 0?co(r.default,t.default):v(r,t,F,S,C)}}}function co(r,t,s){return r!==void 0?r:t!==void 0?t:s!==void 0?s:void 0}function zu(r,t,s,l,f){return co(typeof s===f?l[s]:void 0,r.default,t.default)}function ol(r,t,s){if(qt(s)!=="number")return co(r.default,t.default);const l=r.stops.length;if(l===1||s<=r.stops[0][0])return r.stops[0][1];if(s>=r.stops[l-1][0])return r.stops[l-1][1];const f=Ga(r.stops.map(y=>y[0]),s);return r.stops[f][1]}function Ru(r,t,s){const l=r.base!==void 0?r.base:1;if(qt(s)!=="number")return co(r.default,t.default);const f=r.stops.length;if(f===1||s<=r.stops[0][0])return r.stops[0][1];if(s>=r.stops[f-1][0])return r.stops[f-1][1];const y=Ga(r.stops.map(P=>P[0]),s),x=function(P,L,F,$){const H=$-F,q=P-F;return H===0?0:L===1?q/H:(Math.pow(L,q)-1)/(Math.pow(L,H)-1)}(s,l,r.stops[y][0],r.stops[y+1][0]),v=r.stops[y][1],S=r.stops[y+1][1],C=mn[t.type]||cf;return typeof v.evaluate=="function"?{evaluate(...P){const L=v.evaluate.apply(void 0,P),F=S.evaluate.apply(void 0,P);if(L!==void 0&&F!==void 0)return C(L,F,x,r.colorSpace)}}:C(v,S,x,r.colorSpace)}function Lu(r,t,s){switch(t.type){case"color":s=ti.parse(s);break;case"formatted":s=Mn.fromString(s.toString());break;case"resolvedImage":s=In.fromString(s.toString());break;case"padding":s=Pn.parse(s);break;default:qt(s)===t.type||t.type==="enum"&&t.values[s]||(s=void 0)}return co(s,r.default,t.default)}qn.register(so,{error:[{kind:"error"},[Tt],(r,[t])=>{throw new Ii(t.evaluate(r))}],typeof:[Tt,[xt],(r,[t])=>N(zi(t.evaluate(r)))],"to-rgba":[V(Fe,4),[fn],(r,[t])=>{const[s,l,f,y]=t.evaluate(r).rgb;return[255*s,255*l,255*f,y]}],rgb:[fn,[Fe,Fe,Fe],Cc],rgba:[fn,[Fe,Fe,Fe,Fe],Cc],has:{type:pt,overloads:[[[Tt],(r,[t])=>Mc(t.evaluate(r),r.properties())],[[Tt,ir],(r,[t,s])=>Mc(t.evaluate(r),s.evaluate(r))]]},get:{type:xt,overloads:[[[Tt],(r,[t])=>Pc(t.evaluate(r),r.properties())],[[Tt,ir],(r,[t,s])=>Pc(t.evaluate(r),s.evaluate(r))]]},"feature-state":[xt,[Tt],(r,[t])=>Pc(t.evaluate(r),r.featureState||{})],properties:[ir,[],r=>r.properties()],"geometry-type":[Tt,[],r=>r.geometryType()],id:[xt,[],r=>r.id()],zoom:[Fe,[],r=>r.globals.zoom],"heatmap-density":[Fe,[],r=>r.globals.heatmapDensity||0],"line-progress":[Fe,[],r=>r.globals.lineProgress||0],accumulated:[xt,[],r=>r.globals.accumulated===void 0?null:r.globals.accumulated],"+":[Fe,Ls(Fe),(r,t)=>{let s=0;for(const l of t)s+=l.evaluate(r);return s}],"*":[Fe,Ls(Fe),(r,t)=>{let s=1;for(const l of t)s*=l.evaluate(r);return s}],"-":{type:Fe,overloads:[[[Fe,Fe],(r,[t,s])=>t.evaluate(r)-s.evaluate(r)],[[Fe],(r,[t])=>-t.evaluate(r)]]},"/":[Fe,[Fe,Fe],(r,[t,s])=>t.evaluate(r)/s.evaluate(r)],"%":[Fe,[Fe,Fe],(r,[t,s])=>t.evaluate(r)%s.evaluate(r)],ln2:[Fe,[],()=>Math.LN2],pi:[Fe,[],()=>Math.PI],e:[Fe,[],()=>Math.E],"^":[Fe,[Fe,Fe],(r,[t,s])=>Math.pow(t.evaluate(r),s.evaluate(r))],sqrt:[Fe,[Fe],(r,[t])=>Math.sqrt(t.evaluate(r))],log10:[Fe,[Fe],(r,[t])=>Math.log(t.evaluate(r))/Math.LN10],ln:[Fe,[Fe],(r,[t])=>Math.log(t.evaluate(r))],log2:[Fe,[Fe],(r,[t])=>Math.log(t.evaluate(r))/Math.LN2],sin:[Fe,[Fe],(r,[t])=>Math.sin(t.evaluate(r))],cos:[Fe,[Fe],(r,[t])=>Math.cos(t.evaluate(r))],tan:[Fe,[Fe],(r,[t])=>Math.tan(t.evaluate(r))],asin:[Fe,[Fe],(r,[t])=>Math.asin(t.evaluate(r))],acos:[Fe,[Fe],(r,[t])=>Math.acos(t.evaluate(r))],atan:[Fe,[Fe],(r,[t])=>Math.atan(t.evaluate(r))],min:[Fe,Ls(Fe),(r,t)=>Math.min(...t.map(s=>s.evaluate(r)))],max:[Fe,Ls(Fe),(r,t)=>Math.max(...t.map(s=>s.evaluate(r)))],abs:[Fe,[Fe],(r,[t])=>Math.abs(t.evaluate(r))],round:[Fe,[Fe],(r,[t])=>{const s=t.evaluate(r);return s<0?-Math.round(-s):Math.round(s)}],floor:[Fe,[Fe],(r,[t])=>Math.floor(t.evaluate(r))],ceil:[Fe,[Fe],(r,[t])=>Math.ceil(t.evaluate(r))],"filter-==":[pt,[Tt,xt],(r,[t,s])=>r.properties()[t.value]===s.value],"filter-id-==":[pt,[xt],(r,[t])=>r.id()===t.value],"filter-type-==":[pt,[Tt],(r,[t])=>r.geometryType()===t.value],"filter-<":[pt,[Tt,xt],(r,[t,s])=>{const l=r.properties()[t.value],f=s.value;return typeof l==typeof f&&l<f}],"filter-id-<":[pt,[xt],(r,[t])=>{const s=r.id(),l=t.value;return typeof s==typeof l&&s<l}],"filter->":[pt,[Tt,xt],(r,[t,s])=>{const l=r.properties()[t.value],f=s.value;return typeof l==typeof f&&l>f}],"filter-id->":[pt,[xt],(r,[t])=>{const s=r.id(),l=t.value;return typeof s==typeof l&&s>l}],"filter-<=":[pt,[Tt,xt],(r,[t,s])=>{const l=r.properties()[t.value],f=s.value;return typeof l==typeof f&&l<=f}],"filter-id-<=":[pt,[xt],(r,[t])=>{const s=r.id(),l=t.value;return typeof s==typeof l&&s<=l}],"filter->=":[pt,[Tt,xt],(r,[t,s])=>{const l=r.properties()[t.value],f=s.value;return typeof l==typeof f&&l>=f}],"filter-id->=":[pt,[xt],(r,[t])=>{const s=r.id(),l=t.value;return typeof s==typeof l&&s>=l}],"filter-has":[pt,[xt],(r,[t])=>t.value in r.properties()],"filter-has-id":[pt,[],r=>r.id()!==null&&r.id()!==void 0],"filter-type-in":[pt,[V(Tt)],(r,[t])=>t.value.indexOf(r.geometryType())>=0],"filter-id-in":[pt,[V(xt)],(r,[t])=>t.value.indexOf(r.id())>=0],"filter-in-small":[pt,[Tt,V(xt)],(r,[t,s])=>s.value.indexOf(r.properties()[t.value])>=0],"filter-in-large":[pt,[Tt,V(xt)],(r,[t,s])=>function(l,f,y,x){for(;y<=x;){const v=y+x>>1;if(f[v]===l)return!0;f[v]>l?x=v-1:y=v+1}return!1}(r.properties()[t.value],s.value,0,s.value.length-1)],all:{type:pt,overloads:[[[pt,pt],(r,[t,s])=>t.evaluate(r)&&s.evaluate(r)],[Ls(pt),(r,t)=>{for(const s of t)if(!s.evaluate(r))return!1;return!0}]]},any:{type:pt,overloads:[[[pt,pt],(r,[t,s])=>t.evaluate(r)||s.evaluate(r)],[Ls(pt),(r,t)=>{for(const s of t)if(s.evaluate(r))return!0;return!1}]]},"!":[pt,[pt],(r,[t])=>!t.evaluate(r)],"is-supported-script":[pt,[Tt],(r,[t])=>{const s=r.globals&&r.globals.isSupportedScript;return!s||s(t.evaluate(r))}],upcase:[Tt,[Tt],(r,[t])=>t.evaluate(r).toUpperCase()],downcase:[Tt,[Tt],(r,[t])=>t.evaluate(r).toLowerCase()],concat:[Tt,Ls(xt),(r,t)=>t.map(s=>Jo(s.evaluate(r))).join("")],"resolved-locale":[Tt,[Cr],(r,[t])=>t.evaluate(r).resolvedLocale()]});class al{constructor(t,s){var l;this.expression=t,this._warningHistory={},this._evaluator=new Za,this._defaultValue=s?(l=s).type==="color"&&sl(l.default)?new ti(0,0,0,0):l.type==="color"?ti.parse(l.default)||null:l.type==="padding"?Pn.parse(l.default)||null:l.type==="variableAnchorOffsetCollection"?Hn.parse(l.default)||null:l.default===void 0?null:l.default:null,this._enumValues=s&&s.type==="enum"?s.values:null}evaluateWithoutErrorHandling(t,s,l,f,y,x){return this._evaluator.globals=t,this._evaluator.feature=s,this._evaluator.featureState=l,this._evaluator.canonical=f,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x,this.expression.evaluate(this._evaluator)}evaluate(t,s,l,f,y,x){this._evaluator.globals=t,this._evaluator.feature=s||null,this._evaluator.featureState=l||null,this._evaluator.canonical=f,this._evaluator.availableImages=y||null,this._evaluator.formattedSection=x||null;try{const v=this.expression.evaluate(this._evaluator);if(v==null||typeof v=="number"&&v!=v)return this._defaultValue;if(this._enumValues&&!(v in this._enumValues))throw new Ii(`Expected value to be one of ${Object.keys(this._enumValues).map(S=>JSON.stringify(S)).join(", ")}, but found ${JSON.stringify(v)} instead.`);return v}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}}}function ll(r){return Array.isArray(r)&&r.length>0&&typeof r[0]=="string"&&r[0]in so}function ho(r,t){const s=new Ms(so,sa,[],t?function(f){const y={color:fn,string:Tt,number:Fe,enum:Tt,boolean:pt,formatted:jr,padding:rs,resolvedImage:Mr,variableAnchorOffsetCollection:te};return f.type==="array"?V(y[f.value]||xt,f.length):y[f.type]}(t):void 0),l=s.parse(r,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return l?rl(new al(l,t)):ao(s.errors)}class uo{constructor(t,s){this.kind=t,this._styleExpression=s,this.isStateDependent=t!=="constant"&&!oo(s.expression)}evaluateWithoutErrorHandling(t,s,l,f,y,x){return this._styleExpression.evaluateWithoutErrorHandling(t,s,l,f,y,x)}evaluate(t,s,l,f,y,x){return this._styleExpression.evaluate(t,s,l,f,y,x)}}class po{constructor(t,s,l,f){this.kind=t,this.zoomStops=l,this._styleExpression=s,this.isStateDependent=t!=="camera"&&!oo(s.expression),this.interpolationType=f}evaluateWithoutErrorHandling(t,s,l,f,y,x){return this._styleExpression.evaluateWithoutErrorHandling(t,s,l,f,y,x)}evaluate(t,s,l,f,y,x){return this._styleExpression.evaluate(t,s,l,f,y,x)}interpolationFactor(t,s,l){return this.interpolationType?gn.interpolationFactor(this.interpolationType,t,s,l):0}}function Ac(r,t){const s=ho(r,t);if(s.result==="error")return s;const l=s.value.expression,f=oa(l);if(!f&&!lo(t))return ao([new on("","data expressions not supported")]);const y=aa(l,["zoom"]);if(!y&&!Au(t))return ao([new on("","zoom expressions not supported")]);const x=la(l);return x||y?x instanceof on?ao([x]):x instanceof gn&&!Ic(t)?ao([new on("",'"interpolate" expressions cannot be used with this property')]):rl(x?new po(f?"camera":"composite",s.value,x.labels,x instanceof gn?x.interpolation:void 0):new uo(f?"constant":"source",s.value)):ao([new on("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class fo{constructor(t,s){this._parameters=t,this._specification=s,Er(this,Du(this._parameters,this._specification))}static deserialize(t){return new fo(t._parameters,t._specification)}static serialize(t){return{_parameters:t._parameters,_specification:t._specification}}}function la(r){let t=null;if(r instanceof ss)t=la(r.result);else if(r instanceof Xa){for(const s of r.args)if(t=la(s),t)break}else(r instanceof io||r instanceof gn)&&r.input instanceof qn&&r.input.name==="zoom"&&(t=r);return t instanceof on||r.eachChild(s=>{const l=la(s);l instanceof on?t=l:!t&&l?t=new on("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&l&&t!==l&&(t=new on("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function cl(r){if(r===!0||r===!1)return!0;if(!Array.isArray(r)||r.length===0)return!1;switch(r[0]){case"has":return r.length>=2&&r[1]!=="$id"&&r[1]!=="$type";case"in":return r.length>=3&&(typeof r[1]!="string"||Array.isArray(r[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return r.length!==3||Array.isArray(r[1])||Array.isArray(r[2]);case"any":case"all":for(const t of r.slice(1))if(!cl(t)&&typeof t!="boolean")return!1;return!0;default:return!0}}const hl={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Dc(r){if(r==null)return{filter:()=>!0,needGeometry:!1};cl(r)||(r=ul(r));const t=ho(r,hl);if(t.result==="error")throw new Error(t.value.map(s=>`${s.key}: ${s.message}`).join(", "));return{filter:(s,l,f)=>t.value.evaluate(s,l,{},f),needGeometry:Ou(r)}}function hf(r,t){return r<t?-1:r>t?1:0}function Ou(r){if(!Array.isArray(r))return!1;if(r[0]==="within"||r[0]==="distance")return!0;for(let t=1;t<r.length;t++)if(Ou(r[t]))return!0;return!1}function ul(r){if(!r)return!0;const t=r[0];return r.length<=1?t!=="any":t==="=="?zc(r[1],r[2],"=="):t==="!="?Yi(zc(r[1],r[2],"==")):t==="<"||t===">"||t==="<="||t===">="?zc(r[1],r[2],t):t==="any"?(s=r.slice(1),["any"].concat(s.map(ul))):t==="all"?["all"].concat(r.slice(1).map(ul)):t==="none"?["all"].concat(r.slice(1).map(ul).map(Yi)):t==="in"?ca(r[1],r.slice(2)):t==="!in"?Yi(ca(r[1],r.slice(2))):t==="has"?ha(r[1]):t!=="!has"||Yi(ha(r[1]));var s}function zc(r,t,s){switch(r){case"$type":return[`filter-type-${s}`,t];case"$id":return[`filter-id-${s}`,t];default:return[`filter-${s}`,r,t]}}function ca(r,t){if(t.length===0)return!1;switch(r){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(s=>typeof s!=typeof t[0])?["filter-in-large",r,["literal",t.sort(hf)]]:["filter-in-small",r,["literal",t]]}}function ha(r){switch(r){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",r]}}function Yi(r){return["!",r]}function Os(r){const t=typeof r;if(t==="number"||t==="boolean"||t==="string"||r==null)return JSON.stringify(r);if(Array.isArray(r)){let f="[";for(const y of r)f+=`${Os(y)},`;return`${f}]`}const s=Object.keys(r).sort();let l="{";for(let f=0;f<s.length;f++)l+=`${JSON.stringify(s[f])}:${Os(r[s[f]])},`;return`${l}}`}function Bu(r){let t="";for(const s of wi)t+=`/${Os(r[s])}`;return t}function Fu(r){const t=r.value;return t?[new ze(r.key,t,"constants have been deprecated as of v8")]:[]}function Mi(r){return r instanceof Number||r instanceof String||r instanceof Boolean?r.valueOf():r}function or(r){if(Array.isArray(r))return r.map(or);if(r instanceof Object&&!(r instanceof Number||r instanceof String||r instanceof Boolean)){const t={};for(const s in r)t[s]=or(r[s]);return t}return Mi(r)}function An(r){const t=r.key,s=r.value,l=r.valueSpec||{},f=r.objectElementValidators||{},y=r.style,x=r.styleSpec,v=r.validateSpec;let S=[];const C=qt(s);if(C!=="object")return[new ze(t,s,`object expected, ${C} found`)];for(const P in s){const L=P.split(".")[0],F=l[L]||l["*"];let $;if(f[L])$=f[L];else if(l[L])$=v;else if(f["*"])$=f["*"];else{if(!l["*"]){S.push(new ze(t,s[P],`unknown property "${P}"`));continue}$=v}S=S.concat($({key:(t&&`${t}.`)+P,value:s[P],valueSpec:F,style:y,styleSpec:x,object:s,objectKey:P,validateSpec:v},s))}for(const P in l)f[P]||l[P].required&&l[P].default===void 0&&s[P]===void 0&&S.push(new ze(t,s,`missing required property "${P}"`));return S}function ua(r){const t=r.value,s=r.valueSpec,l=r.style,f=r.styleSpec,y=r.key,x=r.arrayElementValidator||r.validateSpec;if(qt(t)!=="array")return[new ze(y,t,`array expected, ${qt(t)} found`)];if(s.length&&t.length!==s.length)return[new ze(y,t,`array length ${s.length} expected, length ${t.length} found`)];if(s["min-length"]&&t.length<s["min-length"])return[new ze(y,t,`array length at least ${s["min-length"]} expected, length ${t.length} found`)];let v={type:s.value,values:s.values};f.$version<7&&(v.function=s.function),qt(s.value)==="object"&&(v=s.value);let S=[];for(let C=0;C<t.length;C++)S=S.concat(x({array:t,arrayIndex:C,value:t[C],valueSpec:v,validateSpec:r.validateSpec,style:l,styleSpec:f,key:`${y}[${C}]`}));return S}function Rc(r){const t=r.key,s=r.value,l=r.valueSpec;let f=qt(s);return f==="number"&&s!=s&&(f="NaN"),f!=="number"?[new ze(t,s,`number expected, ${f} found`)]:"minimum"in l&&s<l.minimum?[new ze(t,s,`${s} is less than the minimum value ${l.minimum}`)]:"maximum"in l&&s>l.maximum?[new ze(t,s,`${s} is greater than the maximum value ${l.maximum}`)]:[]}function dl(r){const t=r.valueSpec,s=Mi(r.value.type);let l,f,y,x={};const v=s!=="categorical"&&r.value.property===void 0,S=!v,C=qt(r.value.stops)==="array"&&qt(r.value.stops[0])==="array"&&qt(r.value.stops[0][0])==="object",P=An({key:r.key,value:r.value,valueSpec:r.styleSpec.function,validateSpec:r.validateSpec,style:r.style,styleSpec:r.styleSpec,objectElementValidators:{stops:function($){if(s==="identity")return[new ze($.key,$.value,'identity function may not have a "stops" property')];let H=[];const q=$.value;return H=H.concat(ua({key:$.key,value:q,valueSpec:$.valueSpec,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,arrayElementValidator:L})),qt(q)==="array"&&q.length===0&&H.push(new ze($.key,q,"array must have at least one stop")),H},default:function($){return $.validateSpec({key:$.key,value:$.value,valueSpec:t,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec})}}});return s==="identity"&&v&&P.push(new ze(r.key,r.value,'missing required property "property"')),s==="identity"||r.value.stops||P.push(new ze(r.key,r.value,'missing required property "stops"')),s==="exponential"&&r.valueSpec.expression&&!Ic(r.valueSpec)&&P.push(new ze(r.key,r.value,"exponential functions not supported")),r.styleSpec.$version>=8&&(S&&!lo(r.valueSpec)?P.push(new ze(r.key,r.value,"property functions not supported")):v&&!Au(r.valueSpec)&&P.push(new ze(r.key,r.value,"zoom functions not supported"))),s!=="categorical"&&!C||r.value.property!==void 0||P.push(new ze(r.key,r.value,'"property" property is required')),P;function L($){let H=[];const q=$.value,K=$.key;if(qt(q)!=="array")return[new ze(K,q,`array expected, ${qt(q)} found`)];if(q.length!==2)return[new ze(K,q,`array length 2 expected, length ${q.length} found`)];if(C){if(qt(q[0])!=="object")return[new ze(K,q,`object expected, ${qt(q[0])} found`)];if(q[0].zoom===void 0)return[new ze(K,q,"object stop key must have zoom")];if(q[0].value===void 0)return[new ze(K,q,"object stop key must have value")];if(y&&y>Mi(q[0].zoom))return[new ze(K,q[0].zoom,"stop zoom values must appear in ascending order")];Mi(q[0].zoom)!==y&&(y=Mi(q[0].zoom),f=void 0,x={}),H=H.concat(An({key:`${K}[0]`,value:q[0],valueSpec:{zoom:{}},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec,objectElementValidators:{zoom:Rc,value:F}}))}else H=H.concat(F({key:`${K}[0]`,value:q[0],valueSpec:{},validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec},q));return ll(or(q[1]))?H.concat([new ze(`${K}[1]`,q[1],"expressions are not allowed in function stops.")]):H.concat($.validateSpec({key:`${K}[1]`,value:q[1],valueSpec:t,validateSpec:$.validateSpec,style:$.style,styleSpec:$.styleSpec}))}function F($,H){const q=qt($.value),K=Mi($.value),ie=$.value!==null?$.value:H;if(l){if(q!==l)return[new ze($.key,ie,`${q} stop domain type must match previous stop domain type ${l}`)]}else l=q;if(q!=="number"&&q!=="string"&&q!=="boolean")return[new ze($.key,ie,"stop domain value must be a number, string, or boolean")];if(q!=="number"&&s!=="categorical"){let ge=`number expected, ${q} found`;return lo(t)&&s===void 0&&(ge+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ze($.key,ie,ge)]}return s!=="categorical"||q!=="number"||isFinite(K)&&Math.floor(K)===K?s!=="categorical"&&q==="number"&&f!==void 0&&K<f?[new ze($.key,ie,"stop domain values must appear in ascending order")]:(f=K,s==="categorical"&&K in x?[new ze($.key,ie,"stop domain values must be unique")]:(x[K]=!0,[])):[new ze($.key,ie,`integer expected, found ${K}`)]}}function mo(r){const t=(r.expressionContext==="property"?Ac:ho)(or(r.value),r.valueSpec);if(t.result==="error")return t.value.map(l=>new ze(`${r.key}${l.key}`,r.value,l.message));const s=t.value.expression||t.value._styleExpression.expression;if(r.expressionContext==="property"&&r.propertyKey==="text-font"&&!s.outputDefined())return[new ze(r.key,r.value,`Invalid data expression for "${r.propertyKey}". Output values must be contained as literals within the expression.`)];if(r.expressionContext==="property"&&r.propertyType==="layout"&&!oo(s))return[new ze(r.key,r.value,'"feature-state" data expressions are not supported with layout properties.')];if(r.expressionContext==="filter"&&!oo(s))return[new ze(r.key,r.value,'"feature-state" data expressions are not supported with filters.')];if(r.expressionContext&&r.expressionContext.indexOf("cluster")===0){if(!aa(s,["zoom","feature-state"]))return[new ze(r.key,r.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(r.expressionContext==="cluster-initial"&&!oa(s))return[new ze(r.key,r.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Hr(r){const t=r.key,s=r.value,l=r.valueSpec,f=[];return Array.isArray(l.values)?l.values.indexOf(Mi(s))===-1&&f.push(new ze(t,s,`expected one of [${l.values.join(", ")}], ${JSON.stringify(s)} found`)):Object.keys(l.values).indexOf(Mi(s))===-1&&f.push(new ze(t,s,`expected one of [${Object.keys(l.values).join(", ")}], ${JSON.stringify(s)} found`)),f}function Lc(r){return cl(or(r.value))?mo(Er({},r,{expressionContext:"filter",valueSpec:{value:"boolean"}})):pl(r)}function pl(r){const t=r.value,s=r.key;if(qt(t)!=="array")return[new ze(s,t,`array expected, ${qt(t)} found`)];const l=r.styleSpec;let f,y=[];if(t.length<1)return[new ze(s,t,"filter array must have at least 1 element")];switch(y=y.concat(Hr({key:`${s}[0]`,value:t[0],valueSpec:l.filter_operator,style:r.style,styleSpec:r.styleSpec})),Mi(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&Mi(t[1])==="$type"&&y.push(new ze(s,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":t.length!==3&&y.push(new ze(s,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(f=qt(t[1]),f!=="string"&&y.push(new ze(`${s}[1]`,t[1],`string expected, ${f} found`)));for(let x=2;x<t.length;x++)f=qt(t[x]),Mi(t[1])==="$type"?y=y.concat(Hr({key:`${s}[${x}]`,value:t[x],valueSpec:l.geometry_type,style:r.style,styleSpec:r.styleSpec})):f!=="string"&&f!=="number"&&f!=="boolean"&&y.push(new ze(`${s}[${x}]`,t[x],`string, number, or boolean expected, ${f} found`));break;case"any":case"all":case"none":for(let x=1;x<t.length;x++)y=y.concat(pl({key:`${s}[${x}]`,value:t[x],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":f=qt(t[1]),t.length!==2?y.push(new ze(s,t,`filter array for "${t[0]}" operator must have 2 elements`)):f!=="string"&&y.push(new ze(`${s}[1]`,t[1],`string expected, ${f} found`))}return y}function Oc(r,t){const s=r.key,l=r.validateSpec,f=r.style,y=r.styleSpec,x=r.value,v=r.objectKey,S=y[`${t}_${r.layerType}`];if(!S)return[];const C=v.match(/^(.*)-transition$/);if(t==="paint"&&C&&S[C[1]]&&S[C[1]].transition)return l({key:s,value:x,valueSpec:y.transition,style:f,styleSpec:y});const P=r.valueSpec||S[v];if(!P)return[new ze(s,x,`unknown property "${v}"`)];let L;if(qt(x)==="string"&&lo(P)&&!P.tokens&&(L=/^{([^}]+)}$/.exec(x)))return[new ze(s,x,`"${v}" does not support interpolation syntax
40
+ Use an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(L[1])} }\`.`)];const F=[];return r.layerType==="symbol"&&(v==="text-field"&&f&&!f.glyphs&&F.push(new ze(s,x,'use of "text-field" requires a style "glyphs" property')),v==="text-font"&&sl(or(x))&&Mi(x.type)==="identity"&&F.push(new ze(s,x,'"text-font" does not support identity functions'))),F.concat(l({key:r.key,value:x,valueSpec:P,style:f,styleSpec:y,expressionContext:"property",propertyType:t,propertyKey:v}))}function fl(r){return Oc(r,"paint")}function Bc(r){return Oc(r,"layout")}function Fc(r){let t=[];const s=r.value,l=r.key,f=r.style,y=r.styleSpec;s.type||s.ref||t.push(new ze(l,s,'either "type" or "ref" is required'));let x=Mi(s.type);const v=Mi(s.ref);if(s.id){const S=Mi(s.id);for(let C=0;C<r.arrayIndex;C++){const P=f.layers[C];Mi(P.id)===S&&t.push(new ze(l,s.id,`duplicate layer id "${s.id}", previously used at line ${P.id.__line__}`))}}if("ref"in s){let S;["type","source","source-layer","filter","layout"].forEach(C=>{C in s&&t.push(new ze(l,s[C],`"${C}" is prohibited for ref layers`))}),f.layers.forEach(C=>{Mi(C.id)===v&&(S=C)}),S?S.ref?t.push(new ze(l,s.ref,"ref cannot reference another ref layer")):x=Mi(S.type):t.push(new ze(l,s.ref,`ref layer "${v}" not found`))}else if(x!=="background")if(s.source){const S=f.sources&&f.sources[s.source],C=S&&Mi(S.type);S?C==="vector"&&x==="raster"?t.push(new ze(l,s.source,`layer "${s.id}" requires a raster source`)):C!=="raster-dem"&&x==="hillshade"?t.push(new ze(l,s.source,`layer "${s.id}" requires a raster-dem source`)):C==="raster"&&x!=="raster"?t.push(new ze(l,s.source,`layer "${s.id}" requires a vector source`)):C!=="vector"||s["source-layer"]?C==="raster-dem"&&x!=="hillshade"?t.push(new ze(l,s.source,"raster-dem source can only be used with layer type 'hillshade'.")):x!=="line"||!s.paint||!s.paint["line-gradient"]||C==="geojson"&&S.lineMetrics||t.push(new ze(l,s,`layer "${s.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ze(l,s,`layer "${s.id}" must specify a "source-layer"`)):t.push(new ze(l,s.source,`source "${s.source}" not found`))}else t.push(new ze(l,s,'missing required property "source"'));return t=t.concat(An({key:l,value:s,valueSpec:y.layer,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,objectElementValidators:{"*":()=>[],type:()=>r.validateSpec({key:`${l}.type`,value:s.type,valueSpec:y.layer.type,style:r.style,styleSpec:r.styleSpec,validateSpec:r.validateSpec,object:s,objectKey:"type"}),filter:Lc,layout:S=>An({layer:s,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":C=>Bc(Er({layerType:x},C))}}),paint:S=>An({layer:s,key:S.key,value:S.value,style:S.style,styleSpec:S.styleSpec,validateSpec:S.validateSpec,objectElementValidators:{"*":C=>fl(Er({layerType:x},C))}})}})),t}function Bs(r){const t=r.value,s=r.key,l=qt(t);return l!=="string"?[new ze(s,t,`string expected, ${l} found`)]:[]}const ml={promoteId:function({key:r,value:t}){if(qt(t)==="string")return Bs({key:r,value:t});{const s=[];for(const l in t)s.push(...Bs({key:`${r}.${l}`,value:t[l]}));return s}}};function da(r){const t=r.value,s=r.key,l=r.styleSpec,f=r.style,y=r.validateSpec;if(!t.type)return[new ze(s,t,'"type" is required')];const x=Mi(t.type);let v;switch(x){case"vector":case"raster":return v=An({key:s,value:t,valueSpec:l[`source_${x.replace("-","_")}`],style:r.style,styleSpec:l,objectElementValidators:ml,validateSpec:y}),v;case"raster-dem":return v=function(S){var C;const P=(C=S.sourceName)!==null&&C!==void 0?C:"",L=S.value,F=S.styleSpec,$=F.source_raster_dem,H=S.style;let q=[];const K=qt(L);if(L===void 0)return q;if(K!=="object")return q.push(new ze("source_raster_dem",L,`object expected, ${K} found`)),q;const ie=Mi(L.encoding)==="custom",ge=["redFactor","greenFactor","blueFactor","baseShift"],le=S.value.encoding?`"${S.value.encoding}"`:"Default";for(const fe in L)!ie&&ge.includes(fe)?q.push(new ze(fe,L[fe],`In "${P}": "${fe}" is only valid when "encoding" is set to "custom". ${le} encoding found`)):$[fe]?q=q.concat(S.validateSpec({key:fe,value:L[fe],valueSpec:$[fe],validateSpec:S.validateSpec,style:H,styleSpec:F})):q.push(new ze(fe,L[fe],`unknown property "${fe}"`));return q}({sourceName:s,value:t,style:r.style,styleSpec:l,validateSpec:y}),v;case"geojson":if(v=An({key:s,value:t,valueSpec:l.source_geojson,style:f,styleSpec:l,validateSpec:y,objectElementValidators:ml}),t.cluster)for(const S in t.clusterProperties){const[C,P]=t.clusterProperties[S],L=typeof C=="string"?[C,["accumulated"],["get",S]]:C;v.push(...mo({key:`${s}.${S}.map`,value:P,validateSpec:y,expressionContext:"cluster-map"})),v.push(...mo({key:`${s}.${S}.reduce`,value:L,validateSpec:y,expressionContext:"cluster-reduce"}))}return v;case"video":return An({key:s,value:t,valueSpec:l.source_video,style:f,validateSpec:y,styleSpec:l});case"image":return An({key:s,value:t,valueSpec:l.source_image,style:f,validateSpec:y,styleSpec:l});case"canvas":return[new ze(s,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Hr({key:`${s}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:f,validateSpec:y,styleSpec:l})}}function Nc(r){const t=r.value,s=r.styleSpec,l=s.light,f=r.style;let y=[];const x=qt(t);if(t===void 0)return y;if(x!=="object")return y=y.concat([new ze("light",t,`object expected, ${x} found`)]),y;for(const v in t){const S=v.match(/^(.*)-transition$/);y=y.concat(S&&l[S[1]]&&l[S[1]].transition?r.validateSpec({key:v,value:t[v],valueSpec:s.transition,validateSpec:r.validateSpec,style:f,styleSpec:s}):l[v]?r.validateSpec({key:v,value:t[v],valueSpec:l[v],validateSpec:r.validateSpec,style:f,styleSpec:s}):[new ze(v,t[v],`unknown property "${v}"`)])}return y}function Vc(r){const t=r.value,s=r.styleSpec,l=s.sky,f=r.style,y=qt(t);if(t===void 0)return[];if(y!=="object")return[new ze("sky",t,`object expected, ${y} found`)];let x=[];for(const v in t)x=x.concat(l[v]?r.validateSpec({key:v,value:t[v],valueSpec:l[v],style:f,styleSpec:s}):[new ze(v,t[v],`unknown property "${v}"`)]);return x}function $c(r){const t=r.value,s=r.styleSpec,l=s.terrain,f=r.style;let y=[];const x=qt(t);if(t===void 0)return y;if(x!=="object")return y=y.concat([new ze("terrain",t,`object expected, ${x} found`)]),y;for(const v in t)y=y.concat(l[v]?r.validateSpec({key:v,value:t[v],valueSpec:l[v],validateSpec:r.validateSpec,style:f,styleSpec:s}):[new ze(v,t[v],`unknown property "${v}"`)]);return y}function jc(r){let t=[];const s=r.value,l=r.key;if(Array.isArray(s)){const f=[],y=[];for(const x in s)s[x].id&&f.includes(s[x].id)&&t.push(new ze(l,s,`all the sprites' ids must be unique, but ${s[x].id} is duplicated`)),f.push(s[x].id),s[x].url&&y.includes(s[x].url)&&t.push(new ze(l,s,`all the sprites' URLs must be unique, but ${s[x].url} is duplicated`)),y.push(s[x].url),t=t.concat(An({key:`${l}[${x}]`,value:s[x],valueSpec:{id:{type:"string",required:!0},url:{type:"string",required:!0}},validateSpec:r.validateSpec}));return t}return Bs({key:l,value:s})}const gl={"*":()=>[],array:ua,boolean:function(r){const t=r.value,s=r.key,l=qt(t);return l!=="boolean"?[new ze(s,t,`boolean expected, ${l} found`)]:[]},number:Rc,color:function(r){const t=r.key,s=r.value,l=qt(s);return l!=="string"?[new ze(t,s,`color expected, ${l} found`)]:ti.parse(String(s))?[]:[new ze(t,s,`color expected, "${s}" found`)]},constants:Fu,enum:Hr,filter:Lc,function:dl,layer:Fc,object:An,source:da,light:Nc,sky:Vc,terrain:$c,projection:function(r){const t=r.value,s=r.styleSpec,l=s.projection,f=r.style,y=qt(t);if(t===void 0)return[];if(y!=="object")return[new ze("projection",t,`object expected, ${y} found`)];let x=[];for(const v in t)x=x.concat(l[v]?r.validateSpec({key:v,value:t[v],valueSpec:l[v],style:f,styleSpec:s}):[new ze(v,t[v],`unknown property "${v}"`)]);return x},string:Bs,formatted:function(r){return Bs(r).length===0?[]:mo(r)},resolvedImage:function(r){return Bs(r).length===0?[]:mo(r)},padding:function(r){const t=r.key,s=r.value;if(qt(s)==="array"){if(s.length<1||s.length>4)return[new ze(t,s,`padding requires 1 to 4 values; ${s.length} values found`)];const l={type:"number"};let f=[];for(let y=0;y<s.length;y++)f=f.concat(r.validateSpec({key:`${t}[${y}]`,value:s[y],validateSpec:r.validateSpec,valueSpec:l}));return f}return Rc({key:t,value:s,valueSpec:{}})},variableAnchorOffsetCollection:function(r){const t=r.key,s=r.value,l=qt(s),f=r.styleSpec;if(l!=="array"||s.length<1||s.length%2!=0)return[new ze(t,s,"variableAnchorOffsetCollection requires a non-empty array of even length")];let y=[];for(let x=0;x<s.length;x+=2)y=y.concat(Hr({key:`${t}[${x}]`,value:s[x],valueSpec:f.layout_symbol["text-anchor"]})),y=y.concat(ua({key:`${t}[${x+1}]`,value:s[x+1],valueSpec:{length:2,value:"number"},validateSpec:r.validateSpec,style:r.style,styleSpec:f}));return y},sprite:jc};function go(r){const t=r.value,s=r.valueSpec,l=r.styleSpec;return r.validateSpec=go,s.expression&&sl(Mi(t))?dl(r):s.expression&&ll(or(t))?mo(r):s.type&&gl[s.type]?gl[s.type](r):An(Er({},r,{valueSpec:s.type?l[s.type]:s}))}function Nu(r){const t=r.value,s=r.key,l=Bs(r);return l.length||(t.indexOf("{fontstack}")===-1&&l.push(new ze(s,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&l.push(new ze(s,t,'"glyphs" url must include a "{range}" token'))),l}function Zn(r,t=xe){let s=[];return s=s.concat(go({key:"",value:r,valueSpec:t.$root,styleSpec:t,style:r,validateSpec:go,objectElementValidators:{glyphs:Nu,"*":()=>[]}})),r.constants&&(s=s.concat(Fu({key:"constants",value:r.constants,style:r,styleSpec:t,validateSpec:go}))),Uc(s)}function Ir(r){return function(t){return r({...t,validateSpec:go})}}function Uc(r){return[].concat(r).sort((t,s)=>t.line-s.line)}function ar(r){return function(...t){return Uc(r.apply(this,t))}}Zn.source=ar(Ir(da)),Zn.sprite=ar(Ir(jc)),Zn.glyphs=ar(Ir(Nu)),Zn.light=ar(Ir(Nc)),Zn.sky=ar(Ir(Vc)),Zn.terrain=ar(Ir($c)),Zn.layer=ar(Ir(Fc)),Zn.filter=ar(Ir(Lc)),Zn.paintProperty=ar(Ir(fl)),Zn.layoutProperty=ar(Ir(Bc));const Fs=Zn,uf=Fs.light,df=Fs.sky,Vu=Fs.paintProperty,$u=Fs.layoutProperty;function Hc(r,t){let s=!1;if(t&&t.length)for(const l of t)r.fire(new bt(new Error(l.message))),s=!0;return s}class yo{constructor(t,s,l){const f=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;const x=new Int32Array(this.arrayBuffer);t=x[0],this.d=(s=x[1])+2*(l=x[2]);for(let S=0;S<this.d*this.d;S++){const C=x[3+S],P=x[3+S+1];f.push(C===P?null:x.subarray(C,P))}const v=x[3+f.length+1];this.keys=x.subarray(x[3+f.length],v),this.bboxes=x.subarray(v),this.insert=this._insertReadonly}else{this.d=s+2*l;for(let x=0;x<this.d*this.d;x++)f.push([]);this.keys=[],this.bboxes=[]}this.n=s,this.extent=t,this.padding=l,this.scale=s/t,this.uid=0;const y=l/s*t;this.min=-y,this.max=t+y}insert(t,s,l,f,y){this._forEachCell(s,l,f,y,this._insertCell,this.uid++,void 0,void 0),this.keys.push(t),this.bboxes.push(s),this.bboxes.push(l),this.bboxes.push(f),this.bboxes.push(y)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(t,s,l,f,y,x){this.cells[y].push(x)}query(t,s,l,f,y){const x=this.min,v=this.max;if(t<=x&&s<=x&&v<=l&&v<=f&&!y)return Array.prototype.slice.call(this.keys);{const S=[];return this._forEachCell(t,s,l,f,this._queryCell,S,{},y),S}}_queryCell(t,s,l,f,y,x,v,S){const C=this.cells[y];if(C!==null){const P=this.keys,L=this.bboxes;for(let F=0;F<C.length;F++){const $=C[F];if(v[$]===void 0){const H=4*$;(S?S(L[H+0],L[H+1],L[H+2],L[H+3]):t<=L[H+2]&&s<=L[H+3]&&l>=L[H+0]&&f>=L[H+1])?(v[$]=!0,x.push(P[$])):v[$]=!1}}}}_forEachCell(t,s,l,f,y,x,v,S){const C=this._convertToCellCoord(t),P=this._convertToCellCoord(s),L=this._convertToCellCoord(l),F=this._convertToCellCoord(f);for(let $=C;$<=L;$++)for(let H=P;H<=F;H++){const q=this.d*H+$;if((!S||S(this._convertFromCellCoord($),this._convertFromCellCoord(H),this._convertFromCellCoord($+1),this._convertFromCellCoord(H+1)))&&y.call(this,t,s,l,f,q,x,v,S))return}}_convertFromCellCoord(t){return(t-this.padding)/this.scale}_convertToCellCoord(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const t=this.cells,s=3+this.cells.length+1+1;let l=0;for(let x=0;x<this.cells.length;x++)l+=this.cells[x].length;const f=new Int32Array(s+l+this.keys.length+this.bboxes.length);f[0]=this.extent,f[1]=this.n,f[2]=this.padding;let y=s;for(let x=0;x<t.length;x++){const v=t[x];f[3+x]=y,f.set(v,y),y+=v.length}return f[3+t.length]=y,f.set(this.keys,y),y+=this.keys.length,f[3+t.length+1]=y,f.set(this.bboxes,y),y+=this.bboxes.length,f.buffer}static serialize(t,s){const l=t.toArrayBuffer();return s&&s.push(l),{buffer:l}}static deserialize(t){return new yo(t.buffer)}}const Wn={};function Xe(r,t,s={}){if(Wn[r])throw new Error(`${r} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:r,writeable:!1}),Wn[r]={klass:t,omit:s.omit||[],shallow:s.shallow||[]}}Xe("Object",Object),Xe("TransferableGridIndex",yo),Xe("Color",ti),Xe("Error",Error),Xe("AJAXError",ke),Xe("ResolvedImage",In),Xe("StylePropertyFunction",fo),Xe("StyleExpression",al,{omit:["_evaluator"]}),Xe("ZoomDependentExpression",po),Xe("ZoomConstantExpression",uo),Xe("CompoundExpression",qn,{omit:["_evaluate"]});for(const r in so)so[r]._classRegistryKey||Xe(`Expression_${r}`,so[r]);function yl(r){return r&&typeof ArrayBuffer<"u"&&(r instanceof ArrayBuffer||r.constructor&&r.constructor.name==="ArrayBuffer")}function qc(r){return r.$name||r.constructor._classRegistryKey}function ju(r){return!function(t){if(t===null||typeof t!="object")return!1;const s=qc(t);return!(!s||s==="Object")}(r)&&(r==null||typeof r=="boolean"||typeof r=="number"||typeof r=="string"||r instanceof Boolean||r instanceof Number||r instanceof String||r instanceof Date||r instanceof RegExp||r instanceof Blob||r instanceof Error||yl(r)||Ui(r)||ArrayBuffer.isView(r)||r instanceof ImageData)}function _o(r,t){if(ju(r))return(yl(r)||Ui(r))&&t&&t.push(r),ArrayBuffer.isView(r)&&t&&t.push(r.buffer),r instanceof ImageData&&t&&t.push(r.data.buffer),r;if(Array.isArray(r)){const y=[];for(const x of r)y.push(_o(x,t));return y}if(typeof r!="object")throw new Error("can't serialize object of type "+typeof r);const s=qc(r);if(!s)throw new Error(`can't serialize object of unregistered class ${r.constructor.name}`);if(!Wn[s])throw new Error(`${s} is not registered.`);const{klass:l}=Wn[s],f=l.serialize?l.serialize(r,t):{};if(l.serialize){if(t&&f===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const y in r){if(!r.hasOwnProperty(y)||Wn[s].omit.indexOf(y)>=0)continue;const x=r[y];f[y]=Wn[s].shallow.indexOf(y)>=0?x:_o(x,t)}r instanceof Error&&(f.message=r.message)}if(f.$name)throw new Error("$name property is reserved for worker serialization logic.");return s!=="Object"&&(f.$name=s),f}function xo(r){if(ju(r))return r;if(Array.isArray(r))return r.map(xo);if(typeof r!="object")throw new Error("can't deserialize object of type "+typeof r);const t=qc(r)||"Object";if(!Wn[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:s}=Wn[t];if(!s)throw new Error(`can't deserialize unregistered class ${t}`);if(s.deserialize)return s.deserialize(r);const l=Object.create(s.prototype);for(const f of Object.keys(r)){if(f==="$name")continue;const y=r[f];l[f]=Wn[t].shallow.indexOf(f)>=0?y:xo(y)}return l}class Zc{constructor(){this.first=!0}update(t,s){const l=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=l,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=l,!0):(this.lastFloorZoom>l?(this.lastIntegerZoom=l+1,this.lastIntegerZoomTime=s):this.lastFloorZoom<l&&(this.lastIntegerZoom=l,this.lastIntegerZoomTime=s),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=l,!0))}}const Ot={"Latin-1 Supplement":r=>r>=128&&r<=255,"Hangul Jamo":r=>r>=4352&&r<=4607,Khmer:r=>r>=6016&&r<=6143,"General Punctuation":r=>r>=8192&&r<=8303,"Letterlike Symbols":r=>r>=8448&&r<=8527,"Number Forms":r=>r>=8528&&r<=8591,"Miscellaneous Technical":r=>r>=8960&&r<=9215,"Control Pictures":r=>r>=9216&&r<=9279,"Optical Character Recognition":r=>r>=9280&&r<=9311,"Enclosed Alphanumerics":r=>r>=9312&&r<=9471,"Geometric Shapes":r=>r>=9632&&r<=9727,"Miscellaneous Symbols":r=>r>=9728&&r<=9983,"Miscellaneous Symbols and Arrows":r=>r>=11008&&r<=11263,"Ideographic Description Characters":r=>r>=12272&&r<=12287,"CJK Symbols and Punctuation":r=>r>=12288&&r<=12351,Katakana:r=>r>=12448&&r<=12543,Kanbun:r=>r>=12688&&r<=12703,"CJK Strokes":r=>r>=12736&&r<=12783,"Enclosed CJK Letters and Months":r=>r>=12800&&r<=13055,"CJK Compatibility":r=>r>=13056&&r<=13311,"Yijing Hexagram Symbols":r=>r>=19904&&r<=19967,"Private Use Area":r=>r>=57344&&r<=63743,"Vertical Forms":r=>r>=65040&&r<=65055,"CJK Compatibility Forms":r=>r>=65072&&r<=65103,"Small Form Variants":r=>r>=65104&&r<=65135,"Halfwidth and Fullwidth Forms":r=>r>=65280&&r<=65519};function Wc(r){for(const t of r)if(Yc(t.charCodeAt(0)))return!0;return!1}function pf(r){for(const t of r)if(!bo(t.charCodeAt(0)))return!1;return!0}function Gc(r){const t=r.map(s=>{try{return new RegExp(`\\p{sc=${s}}`,"u").source}catch{return null}}).filter(s=>s);return new RegExp(t.join("|"),"u")}const ff=Gc(["Arab","Dupl","Mong","Ougr","Syrc"]);function bo(r){return!ff.test(String.fromCodePoint(r))}const Uu=Gc(["Bopo","Hani","Hira","Kana","Kits","Nshu","Tang","Yiii"]);function Yc(r){return!(r!==746&&r!==747&&(r<4352||!(Ot["CJK Compatibility Forms"](r)&&!(r>=65097&&r<=65103)||Ot["CJK Compatibility"](r)||Ot["CJK Strokes"](r)||!(!Ot["CJK Symbols and Punctuation"](r)||r>=12296&&r<=12305||r>=12308&&r<=12319||r===12336)||Ot["Enclosed CJK Letters and Months"](r)||Ot["Ideographic Description Characters"](r)||Ot.Kanbun(r)||Ot.Katakana(r)&&r!==12540||!(!Ot["Halfwidth and Fullwidth Forms"](r)||r===65288||r===65289||r===65293||r>=65306&&r<=65310||r===65339||r===65341||r===65343||r>=65371&&r<=65503||r===65507||r>=65512&&r<=65519)||!(!Ot["Small Form Variants"](r)||r>=65112&&r<=65118||r>=65123&&r<=65126)||Ot["Vertical Forms"](r)||Ot["Yijing Hexagram Symbols"](r)||new RegExp("\\p{sc=Cans}","u").test(String.fromCodePoint(r))||new RegExp("\\p{sc=Hang}","u").test(String.fromCodePoint(r))||Uu.test(String.fromCodePoint(r)))))}function Hu(r){return!(Yc(r)||function(t){return!!(Ot["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Ot["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Ot["Letterlike Symbols"](t)||Ot["Number Forms"](t)||Ot["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Ot["Control Pictures"](t)&&t!==9251||Ot["Optical Character Recognition"](t)||Ot["Enclosed Alphanumerics"](t)||Ot["Geometric Shapes"](t)||Ot["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ot["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ot["CJK Symbols and Punctuation"](t)||Ot.Katakana(t)||Ot["Private Use Area"](t)||Ot["CJK Compatibility Forms"](t)||Ot["Small Form Variants"](t)||Ot["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(r))}const mf=Gc(["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 Xc(r){return mf.test(String.fromCodePoint(r))}function gf(r,t){return!(!t&&Xc(r)||r>=2304&&r<=3583||r>=3840&&r<=4255||Ot.Khmer(r))}function yf(r){for(const t of r)if(Xc(t.charCodeAt(0)))return!0;return!1}const Dn=new class{constructor(){this.applyArabicShaping=null,this.processBidirectionalText=null,this.processStyledBidirectionalText=null,this.pluginStatus="unavailable",this.pluginURL=null}setState(r){this.pluginStatus=r.pluginStatus,this.pluginURL=r.pluginURL}getState(){return{pluginStatus:this.pluginStatus,pluginURL:this.pluginURL}}setMethods(r){this.applyArabicShaping=r.applyArabicShaping,this.processBidirectionalText=r.processBidirectionalText,this.processStyledBidirectionalText=r.processStyledBidirectionalText}isParsed(){return this.applyArabicShaping!=null&&this.processBidirectionalText!=null&&this.processStyledBidirectionalText!=null}getPluginURL(){return this.pluginURL}getRTLTextPluginStatus(){return this.pluginStatus}};class fi{constructor(t,s){this.zoom=t,s?(this.now=s.now,this.fadeDuration=s.fadeDuration,this.zoomHistory=s.zoomHistory,this.transition=s.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Zc,this.transition={})}isSupportedScript(t){return function(s,l){for(const f of s)if(!gf(f.charCodeAt(0),l))return!1;return!0}(t,Dn.getRTLTextPluginStatus()==="loaded")}crossFadingFactor(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const t=this.zoom,s=t-Math.floor(t),l=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:s+(1-s)*l}:{fromScale:.5,toScale:1,t:1-(1-l)*s}}}class vo{constructor(t,s){this.property=t,this.value=s,this.expression=function(l,f){if(sl(l))return new fo(l,f);if(ll(l)){const y=Ac(l,f);if(y.result==="error")throw new Error(y.value.map(x=>`${x.key}: ${x.message}`).join(", "));return y.value}{let y=l;return f.type==="color"&&typeof l=="string"?y=ti.parse(l):f.type!=="padding"||typeof l!="number"&&!Array.isArray(l)?f.type==="variableAnchorOffsetCollection"&&Array.isArray(l)&&(y=Hn.parse(l)):y=Pn.parse(l),{kind:"constant",evaluate:()=>y}}}(s===void 0?t.specification.default:s,t.specification)}isDataDriven(){return this.expression.kind==="source"||this.expression.kind==="composite"}possiblyEvaluate(t,s,l){return this.property.possiblyEvaluate(this,t,s,l)}}class _l{constructor(t){this.property=t,this.value=new vo(t,void 0)}transitioned(t,s){return new qu(this.property,this.value,s,Ae({},t.transition,this.transition),t.now)}untransitioned(){return new qu(this.property,this.value,null,{},0)}}class xl{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}getValue(t){return Ct(this._values[t].value.value)}setValue(t,s){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _l(this._values[t].property)),this._values[t].value=new vo(this._values[t].property,s===null?void 0:Ct(s))}getTransition(t){return Ct(this._values[t].transition)}setTransition(t,s){Object.prototype.hasOwnProperty.call(this._values,t)||(this._values[t]=new _l(this._values[t].property)),this._values[t].transition=Ct(s)||void 0}serialize(){const t={};for(const s of Object.keys(this._values)){const l=this.getValue(s);l!==void 0&&(t[s]=l);const f=this.getTransition(s);f!==void 0&&(t[`${s}-transition`]=f)}return t}transitioned(t,s){const l=new pa(this._properties);for(const f of Object.keys(this._values))l._values[f]=this._values[f].transitioned(t,s._values[f]);return l}untransitioned(){const t=new pa(this._properties);for(const s of Object.keys(this._values))t._values[s]=this._values[s].untransitioned();return t}}class qu{constructor(t,s,l,f,y){this.property=t,this.value=s,this.begin=y+f.delay||0,this.end=this.begin+f.duration||0,t.specification.transition&&(f.delay||f.duration)&&(this.prior=l)}possiblyEvaluate(t,s,l){const f=t.now||0,y=this.value.possiblyEvaluate(t,s,l),x=this.prior;if(x){if(f>this.end)return this.prior=null,y;if(this.value.isDataDriven())return this.prior=null,y;if(f<this.begin)return x.possiblyEvaluate(t,s,l);{const v=(f-this.begin)/(this.end-this.begin);return this.property.interpolate(x.possiblyEvaluate(t,s,l),y,function(S){if(S<=0)return 0;if(S>=1)return 1;const C=S*S,P=C*S;return 4*(S<.5?P:3*(S-C)+P-.75)}(v))}}return y}}class pa{constructor(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)}possiblyEvaluate(t,s,l){const f=new ma(this._properties);for(const y of Object.keys(this._values))f._values[y]=this._values[y].possiblyEvaluate(t,s,l);return f}hasTransition(){for(const t of Object.keys(this._values))if(this._values[t].prior)return!0;return!1}}class fa{constructor(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}hasValue(t){return this._values[t].value!==void 0}getValue(t){return Ct(this._values[t].value)}setValue(t,s){this._values[t]=new vo(this._values[t].property,s===null?void 0:Ct(s))}serialize(){const t={};for(const s of Object.keys(this._values)){const l=this.getValue(s);l!==void 0&&(t[s]=l)}return t}possiblyEvaluate(t,s,l){const f=new ma(this._properties);for(const y of Object.keys(this._values))f._values[y]=this._values[y].possiblyEvaluate(t,s,l);return f}}class Ar{constructor(t,s,l){this.property=t,this.value=s,this.parameters=l}isConstant(){return this.value.kind==="constant"}constantOr(t){return this.value.kind==="constant"?this.value.value:t}evaluate(t,s,l,f){return this.property.evaluate(this.value,this.parameters,t,s,l,f)}}class ma{constructor(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)}get(t){return this._values[t]}}class et{constructor(t){this.specification=t}possiblyEvaluate(t,s){if(t.isDataDriven())throw new Error("Value should not be data driven");return t.expression.evaluate(s)}interpolate(t,s,l){const f=mn[this.specification.type];return f?f(t,s,l):t}}class ht{constructor(t,s){this.specification=t,this.overrides=s}possiblyEvaluate(t,s,l,f){return new Ar(this,t.expression.kind==="constant"||t.expression.kind==="camera"?{kind:"constant",value:t.expression.evaluate(s,null,{},l,f)}:t.expression,s)}interpolate(t,s,l){if(t.value.kind!=="constant"||s.value.kind!=="constant")return t;if(t.value.value===void 0||s.value.value===void 0)return new Ar(this,{kind:"constant",value:void 0},t.parameters);const f=mn[this.specification.type];if(f){const y=f(t.value.value,s.value.value,l);return new Ar(this,{kind:"constant",value:y},t.parameters)}return t}evaluate(t,s,l,f,y,x){return t.kind==="constant"?t.value:t.evaluate(s,l,f,y,x)}}class bl extends ht{possiblyEvaluate(t,s,l,f){if(t.value===void 0)return new Ar(this,{kind:"constant",value:void 0},s);if(t.expression.kind==="constant"){const y=t.expression.evaluate(s,null,{},l,f),x=t.property.specification.type==="resolvedImage"&&typeof y!="string"?y.name:y,v=this._calculate(x,x,x,s);return new Ar(this,{kind:"constant",value:v},s)}if(t.expression.kind==="camera"){const y=this._calculate(t.expression.evaluate({zoom:s.zoom-1}),t.expression.evaluate({zoom:s.zoom}),t.expression.evaluate({zoom:s.zoom+1}),s);return new Ar(this,{kind:"constant",value:y},s)}return new Ar(this,t.expression,s)}evaluate(t,s,l,f,y,x){if(t.kind==="source"){const v=t.evaluate(s,l,f,y,x);return this._calculate(v,v,v,s)}return t.kind==="composite"?this._calculate(t.evaluate({zoom:Math.floor(s.zoom)-1},l,f),t.evaluate({zoom:Math.floor(s.zoom)},l,f),t.evaluate({zoom:Math.floor(s.zoom)+1},l,f),s):t.value}_calculate(t,s,l,f){return f.zoom>f.zoomHistory.lastIntegerZoom?{from:t,to:s}:{from:l,to:s}}interpolate(t){return t}}class vl{constructor(t){this.specification=t}possiblyEvaluate(t,s,l,f){if(t.value!==void 0){if(t.expression.kind==="constant"){const y=t.expression.evaluate(s,null,{},l,f);return this._calculate(y,y,y,s)}return this._calculate(t.expression.evaluate(new fi(Math.floor(s.zoom-1),s)),t.expression.evaluate(new fi(Math.floor(s.zoom),s)),t.expression.evaluate(new fi(Math.floor(s.zoom+1),s)),s)}}_calculate(t,s,l,f){return f.zoom>f.zoomHistory.lastIntegerZoom?{from:t,to:s}:{from:l,to:s}}interpolate(t){return t}}class Kc{constructor(t){this.specification=t}possiblyEvaluate(t,s,l,f){return!!t.expression.evaluate(s,null,{},l,f)}interpolate(){return!1}}class g{constructor(t){this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const s in t){const l=t[s];l.specification.overridable&&this.overridableProperties.push(s);const f=this.defaultPropertyValues[s]=new vo(l,void 0),y=this.defaultTransitionablePropertyValues[s]=new _l(l);this.defaultTransitioningPropertyValues[s]=y.untransitioned(),this.defaultPossiblyEvaluatedValues[s]=f.possiblyEvaluate({})}}}Xe("DataDrivenProperty",ht),Xe("DataConstantProperty",et),Xe("CrossFadedDataDrivenProperty",bl),Xe("CrossFadedProperty",vl),Xe("ColorRampProperty",Kc);const e="-transition";class a extends ri{constructor(t,s){if(super(),this.id=t.id,this.type=t.type,this._featureFilter={filter:()=>!0,needGeometry:!1},t.type!=="custom"&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,t.type!=="background"&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),s.layout&&(this._unevaluatedLayout=new fa(s.layout)),s.paint)){this._transitionablePaint=new xl(s.paint);for(const l in t.paint)this.setPaintProperty(l,t.paint[l],{validate:!1});for(const l in t.layout)this.setLayoutProperty(l,t.layout[l],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new ma(s.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(t){return t==="visibility"?this.visibility:this._unevaluatedLayout.getValue(t)}setLayoutProperty(t,s,l={}){s!=null&&this._validate($u,`layers.${this.id}.layout.${t}`,t,s,l)||(t!=="visibility"?this._unevaluatedLayout.setValue(t,s):this.visibility=s)}getPaintProperty(t){return t.endsWith(e)?this._transitionablePaint.getTransition(t.slice(0,-11)):this._transitionablePaint.getValue(t)}setPaintProperty(t,s,l={}){if(s!=null&&this._validate(Vu,`layers.${this.id}.paint.${t}`,t,s,l))return!1;if(t.endsWith(e))return this._transitionablePaint.setTransition(t.slice(0,-11),s||void 0),!1;{const f=this._transitionablePaint._values[t],y=f.property.specification["property-type"]==="cross-faded-data-driven",x=f.value.isDataDriven(),v=f.value;this._transitionablePaint.setValue(t,s),this._handleSpecialPaintPropertyUpdate(t);const S=this._transitionablePaint._values[t].value;return S.isDataDriven()||x||y||this._handleOverridablePaintPropertyUpdate(t,v,S)}}_handleSpecialPaintPropertyUpdate(t){}_handleOverridablePaintPropertyUpdate(t,s,l){return!1}isHidden(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||this.visibility==="none"}updateTransitions(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(t,s){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,s)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,s)}serialize(){const t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),Nt(t,(s,l)=>!(s===void 0||l==="layout"&&!Object.keys(s).length||l==="paint"&&!Object.keys(s).length))}_validate(t,s,l,f,y={}){return(!y||y.validate!==!1)&&Hc(this,t.call(Fs,{key:s,layerType:this.type,objectKey:l,value:f,styleSpec:xe,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const t in this.paint._values){const s=this.paint.get(t);if(s instanceof Ar&&lo(s.property.specification)&&(s.value.kind==="source"||s.value.kind==="composite")&&s.value.isStateDependent)return!0}return!1}}const u={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class d{constructor(t,s){this._structArray=t,this._pos1=s*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class m{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(t,s){return t._trim(),s&&(t.isTransferred=!0,s.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}}static deserialize(t){const s=Object.create(this.prototype);return s.arrayBuffer=t.arrayBuffer,s.length=t.length,s.capacity=t.arrayBuffer.byteLength/s.bytesPerElement,s._refreshViews(),s}_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(t){this.reserve(t),this.length=t}reserve(t){if(t>this.capacity){this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const s=this.uint8;this._refreshViews(),s&&this.uint8.set(s)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function w(r,t=1){let s=0,l=0;return{members:r.map(f=>{const y=u[f.type].BYTES_PER_ELEMENT,x=s=E(s,Math.max(t,y)),v=f.components||1;return l=Math.max(l,y),s+=y*v,{name:f.name,type:f.type,components:v,offset:x}}),size:E(s,Math.max(l,t)),alignment:t}}function E(r,t){return Math.ceil(r/t)*t}class T extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,s)}emplace(t,s,l){const f=2*t;return this.int16[f+0]=s,this.int16[f+1]=l,t}}T.prototype.bytesPerElement=4,Xe("StructArrayLayout2i4",T);class I extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l){const f=this.length;return this.resize(f+1),this.emplace(f,t,s,l)}emplace(t,s,l,f){const y=3*t;return this.int16[y+0]=s,this.int16[y+1]=l,this.int16[y+2]=f,t}}I.prototype.bytesPerElement=6,Xe("StructArrayLayout3i6",I);class O extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f){const y=this.length;return this.resize(y+1),this.emplace(y,t,s,l,f)}emplace(t,s,l,f,y){const x=4*t;return this.int16[x+0]=s,this.int16[x+1]=l,this.int16[x+2]=f,this.int16[x+3]=y,t}}O.prototype.bytesPerElement=8,Xe("StructArrayLayout4i8",O);class B extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,s,l,f,y,x)}emplace(t,s,l,f,y,x,v){const S=6*t;return this.int16[S+0]=s,this.int16[S+1]=l,this.int16[S+2]=f,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=v,t}}B.prototype.bytesPerElement=12,Xe("StructArrayLayout2i4i12",B);class U extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,s,l,f,y,x)}emplace(t,s,l,f,y,x,v){const S=4*t,C=8*t;return this.int16[S+0]=s,this.int16[S+1]=l,this.uint8[C+4]=f,this.uint8[C+5]=y,this.uint8[C+6]=x,this.uint8[C+7]=v,t}}U.prototype.bytesPerElement=8,Xe("StructArrayLayout2i4ub8",U);class Z extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,s)}emplace(t,s,l){const f=2*t;return this.float32[f+0]=s,this.float32[f+1]=l,t}}Z.prototype.bytesPerElement=8,Xe("StructArrayLayout2f8",Z);class G extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x,v,S,C,P){const L=this.length;return this.resize(L+1),this.emplace(L,t,s,l,f,y,x,v,S,C,P)}emplace(t,s,l,f,y,x,v,S,C,P,L){const F=10*t;return this.uint16[F+0]=s,this.uint16[F+1]=l,this.uint16[F+2]=f,this.uint16[F+3]=y,this.uint16[F+4]=x,this.uint16[F+5]=v,this.uint16[F+6]=S,this.uint16[F+7]=C,this.uint16[F+8]=P,this.uint16[F+9]=L,t}}G.prototype.bytesPerElement=20,Xe("StructArrayLayout10ui20",G);class Q extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x,v,S,C,P,L,F){const $=this.length;return this.resize($+1),this.emplace($,t,s,l,f,y,x,v,S,C,P,L,F)}emplace(t,s,l,f,y,x,v,S,C,P,L,F,$){const H=12*t;return this.int16[H+0]=s,this.int16[H+1]=l,this.int16[H+2]=f,this.int16[H+3]=y,this.uint16[H+4]=x,this.uint16[H+5]=v,this.uint16[H+6]=S,this.uint16[H+7]=C,this.int16[H+8]=P,this.int16[H+9]=L,this.int16[H+10]=F,this.int16[H+11]=$,t}}Q.prototype.bytesPerElement=24,Xe("StructArrayLayout4i4ui4i24",Q);class ne extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,s,l){const f=this.length;return this.resize(f+1),this.emplace(f,t,s,l)}emplace(t,s,l,f){const y=3*t;return this.float32[y+0]=s,this.float32[y+1]=l,this.float32[y+2]=f,t}}ne.prototype.bytesPerElement=12,Xe("StructArrayLayout3f12",ne);class re extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(t){const s=this.length;return this.resize(s+1),this.emplace(s,t)}emplace(t,s){return this.uint32[1*t+0]=s,t}}re.prototype.bytesPerElement=4,Xe("StructArrayLayout1ul4",re);class ae extends m{_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(t,s,l,f,y,x,v,S,C){const P=this.length;return this.resize(P+1),this.emplace(P,t,s,l,f,y,x,v,S,C)}emplace(t,s,l,f,y,x,v,S,C,P){const L=10*t,F=5*t;return this.int16[L+0]=s,this.int16[L+1]=l,this.int16[L+2]=f,this.int16[L+3]=y,this.int16[L+4]=x,this.int16[L+5]=v,this.uint32[F+3]=S,this.uint16[L+8]=C,this.uint16[L+9]=P,t}}ae.prototype.bytesPerElement=20,Xe("StructArrayLayout6i1ul2ui20",ae);class X extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,s,l,f,y,x)}emplace(t,s,l,f,y,x,v){const S=6*t;return this.int16[S+0]=s,this.int16[S+1]=l,this.int16[S+2]=f,this.int16[S+3]=y,this.int16[S+4]=x,this.int16[S+5]=v,t}}X.prototype.bytesPerElement=12,Xe("StructArrayLayout2i2i2i12",X);class he extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y){const x=this.length;return this.resize(x+1),this.emplace(x,t,s,l,f,y)}emplace(t,s,l,f,y,x){const v=4*t,S=8*t;return this.float32[v+0]=s,this.float32[v+1]=l,this.float32[v+2]=f,this.int16[S+6]=y,this.int16[S+7]=x,t}}he.prototype.bytesPerElement=16,Xe("StructArrayLayout2f1f2i16",he);class pe extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(t,s,l,f,y,x){const v=this.length;return this.resize(v+1),this.emplace(v,t,s,l,f,y,x)}emplace(t,s,l,f,y,x,v){const S=16*t,C=4*t,P=8*t;return this.uint8[S+0]=s,this.uint8[S+1]=l,this.float32[C+1]=f,this.float32[C+2]=y,this.int16[P+6]=x,this.int16[P+7]=v,t}}pe.prototype.bytesPerElement=16,Xe("StructArrayLayout2ub2f2i16",pe);class ye extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,s,l){const f=this.length;return this.resize(f+1),this.emplace(f,t,s,l)}emplace(t,s,l,f){const y=3*t;return this.uint16[y+0]=s,this.uint16[y+1]=l,this.uint16[y+2]=f,t}}ye.prototype.bytesPerElement=6,Xe("StructArrayLayout3ui6",ye);class Me extends m{_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(t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie){const ge=this.length;return this.resize(ge+1),this.emplace(ge,t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie)}emplace(t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie,ge){const le=24*t,fe=12*t,we=48*t;return this.int16[le+0]=s,this.int16[le+1]=l,this.uint16[le+2]=f,this.uint16[le+3]=y,this.uint32[fe+2]=x,this.uint32[fe+3]=v,this.uint32[fe+4]=S,this.uint16[le+10]=C,this.uint16[le+11]=P,this.uint16[le+12]=L,this.float32[fe+7]=F,this.float32[fe+8]=$,this.uint8[we+36]=H,this.uint8[we+37]=q,this.uint8[we+38]=K,this.uint32[fe+10]=ie,this.int16[le+22]=ge,t}}Me.prototype.bytesPerElement=48,Xe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Me);class De extends m{_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(t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie,ge,le,fe,we,Ie,qe,ct,je,Ve,nt,Ke){const Ge=this.length;return this.resize(Ge+1),this.emplace(Ge,t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie,ge,le,fe,we,Ie,qe,ct,je,Ve,nt,Ke)}emplace(t,s,l,f,y,x,v,S,C,P,L,F,$,H,q,K,ie,ge,le,fe,we,Ie,qe,ct,je,Ve,nt,Ke,Ge){const Te=32*t,st=16*t;return this.int16[Te+0]=s,this.int16[Te+1]=l,this.int16[Te+2]=f,this.int16[Te+3]=y,this.int16[Te+4]=x,this.int16[Te+5]=v,this.int16[Te+6]=S,this.int16[Te+7]=C,this.uint16[Te+8]=P,this.uint16[Te+9]=L,this.uint16[Te+10]=F,this.uint16[Te+11]=$,this.uint16[Te+12]=H,this.uint16[Te+13]=q,this.uint16[Te+14]=K,this.uint16[Te+15]=ie,this.uint16[Te+16]=ge,this.uint16[Te+17]=le,this.uint16[Te+18]=fe,this.uint16[Te+19]=we,this.uint16[Te+20]=Ie,this.uint16[Te+21]=qe,this.uint16[Te+22]=ct,this.uint32[st+12]=je,this.float32[st+13]=Ve,this.float32[st+14]=nt,this.uint16[Te+30]=Ke,this.uint16[Te+31]=Ge,t}}De.prototype.bytesPerElement=64,Xe("StructArrayLayout8i15ui1ul2f2ui64",De);class $e extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t){const s=this.length;return this.resize(s+1),this.emplace(s,t)}emplace(t,s){return this.float32[1*t+0]=s,t}}$e.prototype.bytesPerElement=4,Xe("StructArrayLayout1f4",$e);class We extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,s,l){const f=this.length;return this.resize(f+1),this.emplace(f,t,s,l)}emplace(t,s,l,f){const y=3*t;return this.uint16[6*t+0]=s,this.float32[y+1]=l,this.float32[y+2]=f,t}}We.prototype.bytesPerElement=12,Xe("StructArrayLayout1ui2f12",We);class Be extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,s,l){const f=this.length;return this.resize(f+1),this.emplace(f,t,s,l)}emplace(t,s,l,f){const y=4*t;return this.uint32[2*t+0]=s,this.uint16[y+2]=l,this.uint16[y+3]=f,t}}Be.prototype.bytesPerElement=8,Xe("StructArrayLayout1ul2ui8",Be);class Oe extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t,s){const l=this.length;return this.resize(l+1),this.emplace(l,t,s)}emplace(t,s,l){const f=2*t;return this.uint16[f+0]=s,this.uint16[f+1]=l,t}}Oe.prototype.bytesPerElement=4,Xe("StructArrayLayout2ui4",Oe);class tt extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(t){const s=this.length;return this.resize(s+1),this.emplace(s,t)}emplace(t,s){return this.uint16[1*t+0]=s,t}}tt.prototype.bytesPerElement=2,Xe("StructArrayLayout1ui2",tt);class _t extends m{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(t,s,l,f){const y=this.length;return this.resize(y+1),this.emplace(y,t,s,l,f)}emplace(t,s,l,f,y){const x=4*t;return this.float32[x+0]=s,this.float32[x+1]=l,this.float32[x+2]=f,this.float32[x+3]=y,t}}_t.prototype.bytesPerElement=16,Xe("StructArrayLayout4f16",_t);class Ne extends d{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new R(this.anchorPointX,this.anchorPointY)}}Ne.prototype.size=20;class Ue extends ae{get(t){return new Ne(this,t)}}Xe("CollisionBoxArray",Ue);class gt extends d{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(t){this._structArray.uint8[this._pos1+37]=t}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(t){this._structArray.uint8[this._pos1+38]=t}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(t){this._structArray.uint32[this._pos4+10]=t}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}gt.prototype.size=48;class mi extends Me{get(t){return new gt(this,t)}}Xe("PlacedSymbolArray",mi);class Et extends d{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(t){this._structArray.uint32[this._pos4+12]=t}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]}}Et.prototype.size=64;class Lt extends De{get(t){return new Et(this,t)}}Xe("SymbolInstanceArray",Lt);class gi extends $e{getoffsetX(t){return this.float32[1*t+0]}}Xe("GlyphOffsetArray",gi);class Xi extends I{getx(t){return this.int16[3*t+0]}gety(t){return this.int16[3*t+1]}gettileUnitDistanceFromAnchor(t){return this.int16[3*t+2]}}Xe("SymbolLineVertexArray",Xi);class lr extends d{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]}}lr.prototype.size=12;class yi extends We{get(t){return new lr(this,t)}}Xe("TextAnchorOffsetArray",yi);class yn extends d{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]}}yn.prototype.size=8;class ln extends Be{get(t){return new yn(this,t)}}Xe("FeatureIndexArray",ln);class Ki extends T{}class cn extends T{}class Dr extends T{}class wo extends B{}class wl extends U{}class So extends Z{}class Gn extends G{}class Sl extends Q{}class Jc extends ne{}class Yn extends re{}class Xn extends X{}class as extends pe{}class cr extends ye{}class Zi extends Oe{}const Ji=w([{name:"a_pos",components:2,type:"Int16"}],4),{members:zn}=Ji;class Bt{constructor(t=[]){this.segments=t}prepareSegment(t,s,l,f){let y=this.segments[this.segments.length-1];return t>Bt.MAX_VERTEX_ARRAY_LENGTH&&zt(`Max vertices per segment is ${Bt.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${t}`),(!y||y.vertexLength+t>Bt.MAX_VERTEX_ARRAY_LENGTH||y.sortKey!==f)&&(y={vertexOffset:s.length,primitiveOffset:l.length,vertexLength:0,primitiveLength:0},f!==void 0&&(y.sortKey=f),this.segments.push(y)),y}get(){return this.segments}destroy(){for(const t of this.segments)for(const s in t.vaos)t.vaos[s].destroy()}static simpleSegment(t,s,l,f){return new Bt([{vertexOffset:t,primitiveOffset:s,vertexLength:l,primitiveLength:f,vaos:{},sortKey:0}])}}function Ns(r,t){return 256*(r=Qe(Math.floor(r),0,255))+Qe(Math.floor(t),0,255)}Bt.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Xe("SegmentVector",Bt);const ko=w([{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 Eo={exports:{}},Zu={exports:{}};Zu.exports=function(r,t){var s,l,f,y,x,v,S,C;for(l=r.length-(s=3&r.length),f=t,x=3432918353,v=461845907,C=0;C<l;)S=255&r.charCodeAt(C)|(255&r.charCodeAt(++C))<<8|(255&r.charCodeAt(++C))<<16|(255&r.charCodeAt(++C))<<24,++C,f=27492+(65535&(y=5*(65535&(f=(f^=S=(65535&(S=(S=(65535&S)*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295)<<13|f>>>19))+((5*(f>>>16)&65535)<<16)&4294967295))+((58964+(y>>>16)&65535)<<16);switch(S=0,s){case 3:S^=(255&r.charCodeAt(C+2))<<16;case 2:S^=(255&r.charCodeAt(C+1))<<8;case 1:f^=S=(65535&(S=(S=(65535&(S^=255&r.charCodeAt(C)))*x+(((S>>>16)*x&65535)<<16)&4294967295)<<15|S>>>17))*v+(((S>>>16)*v&65535)<<16)&4294967295}return f^=r.length,f=2246822507*(65535&(f^=f>>>16))+((2246822507*(f>>>16)&65535)<<16)&4294967295,f=3266489909*(65535&(f^=f>>>13))+((3266489909*(f>>>16)&65535)<<16)&4294967295,(f^=f>>>16)>>>0};var _f=Zu.exports,Wu={exports:{}};Wu.exports=function(r,t){for(var s,l=r.length,f=t^l,y=0;l>=4;)s=1540483477*(65535&(s=255&r.charCodeAt(y)|(255&r.charCodeAt(++y))<<8|(255&r.charCodeAt(++y))<<16|(255&r.charCodeAt(++y))<<24))+((1540483477*(s>>>16)&65535)<<16),f=1540483477*(65535&f)+((1540483477*(f>>>16)&65535)<<16)^(s=1540483477*(65535&(s^=s>>>24))+((1540483477*(s>>>16)&65535)<<16)),l-=4,++y;switch(l){case 3:f^=(255&r.charCodeAt(y+2))<<16;case 2:f^=(255&r.charCodeAt(y+1))<<8;case 1:f=1540483477*(65535&(f^=255&r.charCodeAt(y)))+((1540483477*(f>>>16)&65535)<<16)}return f=1540483477*(65535&(f^=f>>>13))+((1540483477*(f>>>16)&65535)<<16),(f^=f>>>15)>>>0};var ls=_f,Gu=Wu.exports;Eo.exports=ls,Eo.exports.murmur3=ls,Eo.exports.murmur2=Gu;var kl=M(Eo.exports);class ga{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(t,s,l,f){this.ids.push(El(t)),this.positions.push(s,l,f)}getPositions(t){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const s=El(t);let l=0,f=this.ids.length-1;for(;l<f;){const x=l+f>>1;this.ids[x]>=s?f=x:l=x+1}const y=[];for(;this.ids[l]===s;)y.push({index:this.positions[3*l],start:this.positions[3*l+1],end:this.positions[3*l+2]}),l++;return y}static serialize(t,s){const l=new Float64Array(t.ids),f=new Uint32Array(t.positions);return Tl(l,f,0,l.length-1),s&&s.push(l.buffer,f.buffer),{ids:l,positions:f}}static deserialize(t){const s=new ga;return s.ids=t.ids,s.positions=t.positions,s.indexed=!0,s}}function El(r){const t=+r;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:kl(String(r))}function Tl(r,t,s,l){for(;s<l;){const f=r[s+l>>1];let y=s-1,x=l+1;for(;;){do y++;while(r[y]<f);do x--;while(r[x]>f);if(y>=x)break;To(r,y,x),To(t,3*y,3*x),To(t,3*y+1,3*x+1),To(t,3*y+2,3*x+2)}x-s<l-x?(Tl(r,t,s,x),s=x+1):(Tl(r,t,x+1,l),l=x)}}function To(r,t,s){const l=r[t];r[t]=r[s],r[s]=l}Xe("FeaturePositionMap",ga);class ya{constructor(t,s){this.gl=t.gl,this.location=s}}class Yu extends ya{constructor(t,s){super(t,s),this.current=0}set(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))}}class M_ extends ya{constructor(t,s){super(t,s),this.current=[0,0,0,0]}set(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))}}class P_ extends ya{constructor(t,s){super(t,s),this.current=ti.transparent}set(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))}}const bP=new Float32Array(16);function xf(r){return[Ns(255*r.r,255*r.g),Ns(255*r.b,255*r.a)]}class Qc{constructor(t,s,l){this.value=t,this.uniformNames=s.map(f=>`u_${f}`),this.type=l}setUniform(t,s,l){t.set(l.constantOr(this.value))}getBinding(t,s,l){return this.type==="color"?new P_(t,s):new Yu(t,s)}}class Cl{constructor(t,s){this.uniformNames=s.map(l=>`u_${l}`),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(t,s){this.pixelRatioFrom=s.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=s.tlbr,this.patternTo=t.tlbr}setUniform(t,s,l,f){const y=f==="u_pattern_to"?this.patternTo:f==="u_pattern_from"?this.patternFrom:f==="u_pixel_ratio_to"?this.pixelRatioTo:f==="u_pixel_ratio_from"?this.pixelRatioFrom:null;y&&t.set(y)}getBinding(t,s,l){return l.substr(0,9)==="u_pattern"?new M_(t,s):new Yu(t,s)}}class Vs{constructor(t,s,l,f){this.expression=t,this.type=l,this.maxValue=0,this.paintVertexAttributes=s.map(y=>({name:`a_${y}`,type:"Float32",components:l==="color"?2:1,offset:0})),this.paintVertexArray=new f}populatePaintArray(t,s,l,f,y){const x=this.paintVertexArray.length,v=this.expression.evaluate(new fi(0),s,{},f,[],y);this.paintVertexArray.resize(t),this._setPaintValue(x,t,v)}updatePaintArray(t,s,l,f){const y=this.expression.evaluate({zoom:0},l,f);this._setPaintValue(t,s,y)}_setPaintValue(t,s,l){if(this.type==="color"){const f=xf(l);for(let y=t;y<s;y++)this.paintVertexArray.emplace(y,f[0],f[1])}else{for(let f=t;f<s;f++)this.paintVertexArray.emplace(f,l);this.maxValue=Math.max(this.maxValue,Math.abs(l))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class qr{constructor(t,s,l,f,y,x){this.expression=t,this.uniformNames=s.map(v=>`u_${v}_t`),this.type=l,this.useIntegerZoom=f,this.zoom=y,this.maxValue=0,this.paintVertexAttributes=s.map(v=>({name:`a_${v}`,type:"Float32",components:l==="color"?4:2,offset:0})),this.paintVertexArray=new x}populatePaintArray(t,s,l,f,y){const x=this.expression.evaluate(new fi(this.zoom),s,{},f,[],y),v=this.expression.evaluate(new fi(this.zoom+1),s,{},f,[],y),S=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(S,t,x,v)}updatePaintArray(t,s,l,f){const y=this.expression.evaluate({zoom:this.zoom},l,f),x=this.expression.evaluate({zoom:this.zoom+1},l,f);this._setPaintValue(t,s,y,x)}_setPaintValue(t,s,l,f){if(this.type==="color"){const y=xf(l),x=xf(f);for(let v=t;v<s;v++)this.paintVertexArray.emplace(v,y[0],y[1],x[0],x[1])}else{for(let y=t;y<s;y++)this.paintVertexArray.emplace(y,l,f);this.maxValue=Math.max(this.maxValue,Math.abs(l),Math.abs(f))}}upload(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(t,s){const l=this.useIntegerZoom?Math.floor(s.zoom):s.zoom,f=Qe(this.expression.interpolationFactor(l,this.zoom,this.zoom+1),0,1);t.set(f)}getBinding(t,s,l){return new Yu(t,s)}}class Co{constructor(t,s,l,f,y,x){this.expression=t,this.type=s,this.useIntegerZoom=l,this.zoom=f,this.layerId=x,this.zoomInPaintVertexArray=new y,this.zoomOutPaintVertexArray=new y}populatePaintArray(t,s,l){const f=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(f,t,s.patterns&&s.patterns[this.layerId],l)}updatePaintArray(t,s,l,f,y){this._setPaintValues(t,s,l.patterns&&l.patterns[this.layerId],y)}_setPaintValues(t,s,l,f){if(!f||!l)return;const{min:y,mid:x,max:v}=l,S=f[y],C=f[x],P=f[v];if(S&&C&&P)for(let L=t;L<s;L++)this.zoomInPaintVertexArray.emplace(L,C.tl[0],C.tl[1],C.br[0],C.br[1],S.tl[0],S.tl[1],S.br[0],S.br[1],C.pixelRatio,S.pixelRatio),this.zoomOutPaintVertexArray.emplace(L,C.tl[0],C.tl[1],C.br[0],C.br[1],P.tl[0],P.tl[1],P.br[0],P.br[1],C.pixelRatio,P.pixelRatio)}upload(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,ko.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,ko.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class I_{constructor(t,s,l){this.binders={},this._buffers=[];const f=[];for(const y in t.paint._values){if(!l(y))continue;const x=t.paint.get(y);if(!(x instanceof Ar&&lo(x.property.specification)))continue;const v=vP(y,t.type),S=x.value,C=x.property.specification.type,P=x.property.useIntegerZoom,L=x.property.specification["property-type"],F=L==="cross-faded"||L==="cross-faded-data-driven";if(S.kind==="constant")this.binders[y]=F?new Cl(S.value,v):new Qc(S.value,v,C),f.push(`/u_${y}`);else if(S.kind==="source"||F){const $=A_(y,C,"source");this.binders[y]=F?new Co(S,C,P,s,$,t.id):new Vs(S,v,C,$),f.push(`/a_${y}`)}else{const $=A_(y,C,"composite");this.binders[y]=new qr(S,v,C,P,s,$),f.push(`/z_${y}`)}}this.cacheKey=f.sort().join("")}getMaxValue(t){const s=this.binders[t];return s instanceof Vs||s instanceof qr?s.maxValue:0}populatePaintArrays(t,s,l,f,y){for(const x in this.binders){const v=this.binders[x];(v instanceof Vs||v instanceof qr||v instanceof Co)&&v.populatePaintArray(t,s,l,f,y)}}setConstantPatternPositions(t,s){for(const l in this.binders){const f=this.binders[l];f instanceof Cl&&f.setConstantPatternPositions(t,s)}}updatePaintArrays(t,s,l,f,y){let x=!1;for(const v in t){const S=s.getPositions(v);for(const C of S){const P=l.feature(C.index);for(const L in this.binders){const F=this.binders[L];if((F instanceof Vs||F instanceof qr||F instanceof Co)&&F.expression.isStateDependent===!0){const $=f.paint.get(L);F.expression=$.value,F.updatePaintArray(C.start,C.end,P,t[v],y),x=!0}}}}return x}defines(){const t=[];for(const s in this.binders){const l=this.binders[s];(l instanceof Qc||l instanceof Cl)&&t.push(...l.uniformNames.map(f=>`#define HAS_UNIFORM_${f}`))}return t}getBinderAttributes(){const t=[];for(const s in this.binders){const l=this.binders[s];if(l instanceof Vs||l instanceof qr)for(let f=0;f<l.paintVertexAttributes.length;f++)t.push(l.paintVertexAttributes[f].name);else if(l instanceof Co)for(let f=0;f<ko.members.length;f++)t.push(ko.members[f].name)}return t}getBinderUniforms(){const t=[];for(const s in this.binders){const l=this.binders[s];if(l instanceof Qc||l instanceof Cl||l instanceof qr)for(const f of l.uniformNames)t.push(f)}return t}getPaintVertexBuffers(){return this._buffers}getUniforms(t,s){const l=[];for(const f in this.binders){const y=this.binders[f];if(y instanceof Qc||y instanceof Cl||y instanceof qr){for(const x of y.uniformNames)if(s[x]){const v=y.getBinding(t,s[x],x);l.push({name:x,property:f,binding:v})}}}return l}setUniforms(t,s,l,f){for(const{name:y,property:x,binding:v}of s)this.binders[x].setUniform(v,f,l.get(x),y)}updatePaintBuffers(t){this._buffers=[];for(const s in this.binders){const l=this.binders[s];if(t&&l instanceof Co){const f=t.fromScale===2?l.zoomInPaintVertexBuffer:l.zoomOutPaintVertexBuffer;f&&this._buffers.push(f)}else(l instanceof Vs||l instanceof qr)&&l.paintVertexBuffer&&this._buffers.push(l.paintVertexBuffer)}}upload(t){for(const s in this.binders){const l=this.binders[s];(l instanceof Vs||l instanceof qr||l instanceof Co)&&l.upload(t)}this.updatePaintBuffers()}destroy(){for(const t in this.binders){const s=this.binders[t];(s instanceof Vs||s instanceof qr||s instanceof Co)&&s.destroy()}}}class _a{constructor(t,s,l=()=>!0){this.programConfigurations={};for(const f of t)this.programConfigurations[f.id]=new I_(f,s,l);this.needsUpload=!1,this._featureMap=new ga,this._bufferOffset=0}populatePaintArrays(t,s,l,f,y,x){for(const v in this.programConfigurations)this.programConfigurations[v].populatePaintArrays(t,s,f,y,x);s.id!==void 0&&this._featureMap.add(s.id,l,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0}updatePaintArrays(t,s,l,f){for(const y of l)this.needsUpload=this.programConfigurations[y.id].updatePaintArrays(t,this._featureMap,s,y,f)||this.needsUpload}get(t){return this.programConfigurations[t]}upload(t){if(this.needsUpload){for(const s in this.programConfigurations)this.programConfigurations[s].upload(t);this.needsUpload=!1}}destroy(){for(const t in this.programConfigurations)this.programConfigurations[t].destroy()}}function vP(r,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-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"]}[r]||[r.replace(`${t}-`,"").replace(/-/g,"_")]}function A_(r,t,s){const l={color:{source:Z,composite:_t},number:{source:$e,composite:Z}},f=function(y){return{"line-pattern":{source:Gn,composite:Gn},"fill-pattern":{source:Gn,composite:Gn},"fill-extrusion-pattern":{source:Gn,composite:Gn}}[y]}(r);return f&&f[s]||l[t][s]}Xe("ConstantBinder",Qc),Xe("CrossFadedConstantBinder",Cl),Xe("SourceExpressionBinder",Vs),Xe("CrossFadedCompositeBinder",Co),Xe("CompositeExpressionBinder",qr),Xe("ProgramConfiguration",I_,{omit:["_buffers"]}),Xe("ProgramConfigurationSet",_a);const Ri=8192,bf=Math.pow(2,14)-1,D_=-bf-1;function xa(r){const t=Ri/r.extent,s=r.loadGeometry();for(let l=0;l<s.length;l++){const f=s[l];for(let y=0;y<f.length;y++){const x=f[y],v=Math.round(x.x*t),S=Math.round(x.y*t);x.x=Qe(v,D_,bf),x.y=Qe(S,D_,bf),(v<x.x||v>x.x+1||S<x.y||S>x.y+1)&&zt("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return s}function ba(r,t){return{type:r.type,id:r.id,properties:r.properties,geometry:t?xa(r):[]}}function Xu(r,t,s,l,f){r.emplaceBack(2*t+(l+1)/2,2*s+(f+1)/2)}class vf{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new cn,this.indexArray=new cr,this.segments=new Bt,this.programConfigurations=new _a(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(t,s,l){const f=this.layers[0],y=[];let x=null,v=!1;f.type==="circle"&&(x=f.layout.get("circle-sort-key"),v=!x.isConstant());for(const{feature:S,id:C,index:P,sourceLayerIndex:L}of t){const F=this.layers[0]._featureFilter.needGeometry,$=ba(S,F);if(!this.layers[0]._featureFilter.filter(new fi(this.zoom),$,l))continue;const H=v?x.evaluate($,{},l):void 0,q={id:C,properties:S.properties,type:S.type,sourceLayerIndex:L,index:P,geometry:F?$.geometry:xa(S),patterns:{},sortKey:H};y.push(q)}v&&y.sort((S,C)=>S.sortKey-C.sortKey);for(const S of y){const{geometry:C,index:P,sourceLayerIndex:L}=S,F=t[P].feature;this.addFeature(S,C,P,l),s.featureIndex.insert(F,C,P,L,this.index)}}update(t,s,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,s,this.stateDependentLayers,l)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zn),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(t,s,l,f){for(const y of s)for(const x of y){const v=x.x,S=x.y;if(v<0||v>=Ri||S<0||S>=Ri)continue;const C=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey),P=C.vertexLength;Xu(this.layoutVertexArray,v,S,-1,-1),Xu(this.layoutVertexArray,v,S,1,-1),Xu(this.layoutVertexArray,v,S,1,1),Xu(this.layoutVertexArray,v,S,-1,1),this.indexArray.emplaceBack(P,P+1,P+2),this.indexArray.emplaceBack(P,P+3,P+2),C.vertexLength+=4,C.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,{},f)}}function z_(r,t){for(let s=0;s<r.length;s++)if(Ml(t,r[s]))return!0;for(let s=0;s<t.length;s++)if(Ml(r,t[s]))return!0;return!!wf(r,t)}function wP(r,t,s){return!!Ml(r,t)||!!Sf(t,r,s)}function R_(r,t){if(r.length===1)return O_(t,r[0]);for(let s=0;s<t.length;s++){const l=t[s];for(let f=0;f<l.length;f++)if(Ml(r,l[f]))return!0}for(let s=0;s<r.length;s++)if(O_(t,r[s]))return!0;for(let s=0;s<t.length;s++)if(wf(r,t[s]))return!0;return!1}function SP(r,t,s){if(r.length>1){if(wf(r,t))return!0;for(let l=0;l<t.length;l++)if(Sf(t[l],r,s))return!0}for(let l=0;l<r.length;l++)if(Sf(r[l],t,s))return!0;return!1}function wf(r,t){if(r.length===0||t.length===0)return!1;for(let s=0;s<r.length-1;s++){const l=r[s],f=r[s+1];for(let y=0;y<t.length-1;y++)if(kP(l,f,t[y],t[y+1]))return!0}return!1}function kP(r,t,s,l){return pi(r,s,l)!==pi(t,s,l)&&pi(r,t,s)!==pi(r,t,l)}function Sf(r,t,s){const l=s*s;if(t.length===1)return r.distSqr(t[0])<l;for(let f=1;f<t.length;f++)if(L_(r,t[f-1],t[f])<l)return!0;return!1}function L_(r,t,s){const l=t.distSqr(s);if(l===0)return r.distSqr(t);const f=((r.x-t.x)*(s.x-t.x)+(r.y-t.y)*(s.y-t.y))/l;return r.distSqr(f<0?t:f>1?s:s.sub(t)._mult(f)._add(t))}function O_(r,t){let s,l,f,y=!1;for(let x=0;x<r.length;x++){s=r[x];for(let v=0,S=s.length-1;v<s.length;S=v++)l=s[v],f=s[S],l.y>t.y!=f.y>t.y&&t.x<(f.x-l.x)*(t.y-l.y)/(f.y-l.y)+l.x&&(y=!y)}return y}function Ml(r,t){let s=!1;for(let l=0,f=r.length-1;l<r.length;f=l++){const y=r[l],x=r[f];y.y>t.y!=x.y>t.y&&t.x<(x.x-y.x)*(t.y-y.y)/(x.y-y.y)+y.x&&(s=!s)}return s}function EP(r,t,s){const l=s[0],f=s[2];if(r.x<l.x&&t.x<l.x||r.x>f.x&&t.x>f.x||r.y<l.y&&t.y<l.y||r.y>f.y&&t.y>f.y)return!1;const y=pi(r,t,s[0]);return y!==pi(r,t,s[1])||y!==pi(r,t,s[2])||y!==pi(r,t,s[3])}function eh(r,t,s){const l=t.paint.get(r).value;return l.kind==="constant"?l.value:s.programConfigurations.get(t.id).getMaxValue(r)}function Ku(r){return Math.sqrt(r[0]*r[0]+r[1]*r[1])}function Ju(r,t,s,l,f){if(!t[0]&&!t[1])return r;const y=R.convert(t)._mult(f);s==="viewport"&&y._rotate(-l);const x=[];for(let v=0;v<r.length;v++)x.push(r[v].sub(y));return x}let B_,F_;Xe("CircleBucket",vf,{omit:["layers"]});var TP={get paint(){return F_=F_||new g({"circle-radius":new ht(xe.paint_circle["circle-radius"]),"circle-color":new ht(xe.paint_circle["circle-color"]),"circle-blur":new ht(xe.paint_circle["circle-blur"]),"circle-opacity":new ht(xe.paint_circle["circle-opacity"]),"circle-translate":new et(xe.paint_circle["circle-translate"]),"circle-translate-anchor":new et(xe.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new et(xe.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new et(xe.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new ht(xe.paint_circle["circle-stroke-width"]),"circle-stroke-color":new ht(xe.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new ht(xe.paint_circle["circle-stroke-opacity"])})},get layout(){return B_=B_||new g({"circle-sort-key":new ht(xe.layout_circle["circle-sort-key"])})}},_n=1e-6,Pl=typeof Float32Array<"u"?Float32Array:Array;function kf(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function N_(r,t,s){var l=t[0],f=t[1],y=t[2],x=t[3],v=t[4],S=t[5],C=t[6],P=t[7],L=t[8],F=t[9],$=t[10],H=t[11],q=t[12],K=t[13],ie=t[14],ge=t[15],le=s[0],fe=s[1],we=s[2],Ie=s[3];return r[0]=le*l+fe*v+we*L+Ie*q,r[1]=le*f+fe*S+we*F+Ie*K,r[2]=le*y+fe*C+we*$+Ie*ie,r[3]=le*x+fe*P+we*H+Ie*ge,r[4]=(le=s[4])*l+(fe=s[5])*v+(we=s[6])*L+(Ie=s[7])*q,r[5]=le*f+fe*S+we*F+Ie*K,r[6]=le*y+fe*C+we*$+Ie*ie,r[7]=le*x+fe*P+we*H+Ie*ge,r[8]=(le=s[8])*l+(fe=s[9])*v+(we=s[10])*L+(Ie=s[11])*q,r[9]=le*f+fe*S+we*F+Ie*K,r[10]=le*y+fe*C+we*$+Ie*ie,r[11]=le*x+fe*P+we*H+Ie*ge,r[12]=(le=s[12])*l+(fe=s[13])*v+(we=s[14])*L+(Ie=s[15])*q,r[13]=le*f+fe*S+we*F+Ie*K,r[14]=le*y+fe*C+we*$+Ie*ie,r[15]=le*x+fe*P+we*H+Ie*ge,r}Math.hypot||(Math.hypot=function(){for(var r=0,t=arguments.length;t--;)r+=arguments[t]*arguments[t];return Math.sqrt(r)});var th,CP=N_;function Qu(r,t,s){var l=t[0],f=t[1],y=t[2],x=t[3];return r[0]=s[0]*l+s[4]*f+s[8]*y+s[12]*x,r[1]=s[1]*l+s[5]*f+s[9]*y+s[13]*x,r[2]=s[2]*l+s[6]*f+s[10]*y+s[14]*x,r[3]=s[3]*l+s[7]*f+s[11]*y+s[15]*x,r}th=new Pl(4),Pl!=Float32Array&&(th[0]=0,th[1]=0,th[2]=0,th[3]=0);class MP extends a{constructor(t){super(t,TP)}createBucket(t){return new vf(t)}queryRadius(t){const s=t;return eh("circle-radius",this,s)+eh("circle-stroke-width",this,s)+Ku(this.paint.get("circle-translate"))}queryIntersectsFeature(t,s,l,f,y,x,v,S){const C=Ju(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),x.angle,v),P=this.paint.get("circle-radius").evaluate(s,l)+this.paint.get("circle-stroke-width").evaluate(s,l),L=this.paint.get("circle-pitch-alignment")==="map",F=L?C:function(H,q){return H.map(K=>V_(K,q))}(C,S),$=L?P*v:P;for(const H of f)for(const q of H){const K=L?q:V_(q,S);let ie=$;const ge=Qu([],[q.x,q.y,0,1],S);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ie*=ge[3]/x.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ie*=x.cameraToCenterDistance/ge[3]),wP(F,K,ie))return!0}return!1}}function V_(r,t){const s=Qu([],[r.x,r.y,0,1],t);return new R(s[0]/s[3],s[1]/s[3])}class $_ extends vf{}let j_;Xe("HeatmapBucket",$_,{omit:["layers"]});var PP={get paint(){return j_=j_||new g({"heatmap-radius":new ht(xe.paint_heatmap["heatmap-radius"]),"heatmap-weight":new ht(xe.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new et(xe.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Kc(xe.paint_heatmap["heatmap-color"]),"heatmap-opacity":new et(xe.paint_heatmap["heatmap-opacity"])})}};function Ef(r,{width:t,height:s},l,f){if(f){if(f instanceof Uint8ClampedArray)f=new Uint8Array(f.buffer);else if(f.length!==t*s*l)throw new RangeError(`mismatched image size. expected: ${f.length} but got: ${t*s*l}`)}else f=new Uint8Array(t*s*l);return r.width=t,r.height=s,r.data=f,r}function U_(r,{width:t,height:s},l){if(t===r.width&&s===r.height)return;const f=Ef({},{width:t,height:s},l);Tf(r,f,{x:0,y:0},{x:0,y:0},{width:Math.min(r.width,t),height:Math.min(r.height,s)},l),r.width=t,r.height=s,r.data=f.data}function Tf(r,t,s,l,f,y){if(f.width===0||f.height===0)return t;if(f.width>r.width||f.height>r.height||s.x>r.width-f.width||s.y>r.height-f.height)throw new RangeError("out of range source coordinates for image copy");if(f.width>t.width||f.height>t.height||l.x>t.width-f.width||l.y>t.height-f.height)throw new RangeError("out of range destination coordinates for image copy");const x=r.data,v=t.data;if(x===v)throw new Error("srcData equals dstData, so image is already copied");for(let S=0;S<f.height;S++){const C=((s.y+S)*r.width+s.x)*y,P=((l.y+S)*t.width+l.x)*y;for(let L=0;L<f.width*y;L++)v[P+L]=x[C+L]}return t}class ih{constructor(t,s){Ef(this,t,1,s)}resize(t){U_(this,t,1)}clone(){return new ih({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,s,l,f,y){Tf(t,s,l,f,y,1)}}class hr{constructor(t,s){Ef(this,t,4,s)}resize(t){U_(this,t,4)}replace(t,s){s?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t}clone(){return new hr({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(t,s,l,f,y){Tf(t,s,l,f,y,4)}}function H_(r){const t={},s=r.resolution||256,l=r.clips?r.clips.length:1,f=r.image||new hr({width:s,height:l});if(Math.log(s)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${s}`);const y=(x,v,S)=>{t[r.evaluationKey]=S;const C=r.expression.evaluate(t);f.data[x+v+0]=Math.floor(255*C.r/C.a),f.data[x+v+1]=Math.floor(255*C.g/C.a),f.data[x+v+2]=Math.floor(255*C.b/C.a),f.data[x+v+3]=Math.floor(255*C.a)};if(r.clips)for(let x=0,v=0;x<l;++x,v+=4*s)for(let S=0,C=0;S<s;S++,C+=4){const P=S/(s-1),{start:L,end:F}=r.clips[x];y(v,C,L*(1-P)+F*P)}else for(let x=0,v=0;x<s;x++,v+=4)y(0,v,x/(s-1));return f}Xe("AlphaImage",ih),Xe("RGBAImage",hr);const Cf="big-fb";class IP extends a{createBucket(t){return new $_(t)}constructor(t){super(t,PP),this.heatmapFbos=new Map,this._updateColorRamp()}_handleSpecialPaintPropertyUpdate(t){t==="heatmap-color"&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=H_({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbos.has(Cf)&&this.heatmapFbos.delete(Cf)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"}}let q_;var AP={get paint(){return q_=q_||new g({"hillshade-illumination-direction":new et(xe.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new et(xe.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new et(xe.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new et(xe.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new et(xe.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new et(xe.paint_hillshade["hillshade-accent-color"])})}};class DP extends a{constructor(t){super(t,AP)}hasOffscreenPass(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"}}const zP=w([{name:"a_pos",components:2,type:"Int16"}],4),{members:RP}=zP;function Z_(r,t,s=2){const l=t&&t.length,f=l?t[0]*s:r.length;let y=W_(r,0,f,s,!0);const x=[];if(!y||y.next===y.prev)return x;let v,S,C;if(l&&(y=function(P,L,F,$){const H=[];for(let q=0,K=L.length;q<K;q++){const ie=W_(P,L[q]*$,q<K-1?L[q+1]*$:P.length,$,!1);ie===ie.next&&(ie.steiner=!0),H.push(jP(ie))}H.sort(NP);for(let q=0;q<H.length;q++)F=VP(H[q],F);return F}(r,t,y,s)),r.length>80*s){v=1/0,S=1/0;let P=-1/0,L=-1/0;for(let F=s;F<f;F+=s){const $=r[F],H=r[F+1];$<v&&(v=$),H<S&&(S=H),$>P&&(P=$),H>L&&(L=H)}C=Math.max(P-v,L-S),C=C!==0?32767/C:0}return nh(y,x,s,v,S,C,0),x}function W_(r,t,s,l,f){let y;if(f===function(x,v,S,C){let P=0;for(let L=v,F=S-C;L<S;L+=C)P+=(x[F]-x[L])*(x[L+1]+x[F+1]),F=L;return P}(r,t,s,l)>0)for(let x=t;x<s;x+=l)y=X_(x/l|0,r[x],r[x+1],y);else for(let x=s-l;x>=t;x-=l)y=X_(x/l|0,r[x],r[x+1],y);return y&&ed(y,y.next)&&(sh(y),y=y.next),y}function va(r,t){if(!r)return r;t||(t=r);let s,l=r;do if(s=!1,l.steiner||!ed(l,l.next)&&Ai(l.prev,l,l.next)!==0)l=l.next;else{if(sh(l),l=t=l.prev,l===l.next)break;s=!0}while(s||l!==t);return t}function nh(r,t,s,l,f,y,x){if(!r)return;!x&&y&&function(S,C,P,L){let F=S;do F.z===0&&(F.z=Mf(F.x,F.y,C,P,L)),F.prevZ=F.prev,F.nextZ=F.next,F=F.next;while(F!==S);F.prevZ.nextZ=null,F.prevZ=null,function($){let H,q=1;do{let K,ie=$;$=null;let ge=null;for(H=0;ie;){H++;let le=ie,fe=0;for(let Ie=0;Ie<q&&(fe++,le=le.nextZ,le);Ie++);let we=q;for(;fe>0||we>0&&le;)fe!==0&&(we===0||!le||ie.z<=le.z)?(K=ie,ie=ie.nextZ,fe--):(K=le,le=le.nextZ,we--),ge?ge.nextZ=K:$=K,K.prevZ=ge,ge=K;ie=le}ge.nextZ=null,q*=2}while(H>1)}(F)}(r,l,f,y);let v=r;for(;r.prev!==r.next;){const S=r.prev,C=r.next;if(y?OP(r,l,f,y):LP(r))t.push(S.i,r.i,C.i),sh(r),r=C.next,v=C.next;else if((r=C)===v){x?x===1?nh(r=BP(va(r),t),t,s,l,f,y,2):x===2&&FP(r,t,s,l,f,y):nh(va(r),t,s,l,f,y,1);break}}}function LP(r){const t=r.prev,s=r,l=r.next;if(Ai(t,s,l)>=0)return!1;const f=t.x,y=s.x,x=l.x,v=t.y,S=s.y,C=l.y,P=f<y?f<x?f:x:y<x?y:x,L=v<S?v<C?v:C:S<C?S:C,F=f>y?f>x?f:x:y>x?y:x,$=v>S?v>C?v:C:S>C?S:C;let H=l.next;for(;H!==t;){if(H.x>=P&&H.x<=F&&H.y>=L&&H.y<=$&&Il(f,v,y,S,x,C,H.x,H.y)&&Ai(H.prev,H,H.next)>=0)return!1;H=H.next}return!0}function OP(r,t,s,l){const f=r.prev,y=r,x=r.next;if(Ai(f,y,x)>=0)return!1;const v=f.x,S=y.x,C=x.x,P=f.y,L=y.y,F=x.y,$=v<S?v<C?v:C:S<C?S:C,H=P<L?P<F?P:F:L<F?L:F,q=v>S?v>C?v:C:S>C?S:C,K=P>L?P>F?P:F:L>F?L:F,ie=Mf($,H,t,s,l),ge=Mf(q,K,t,s,l);let le=r.prevZ,fe=r.nextZ;for(;le&&le.z>=ie&&fe&&fe.z<=ge;){if(le.x>=$&&le.x<=q&&le.y>=H&&le.y<=K&&le!==f&&le!==x&&Il(v,P,S,L,C,F,le.x,le.y)&&Ai(le.prev,le,le.next)>=0||(le=le.prevZ,fe.x>=$&&fe.x<=q&&fe.y>=H&&fe.y<=K&&fe!==f&&fe!==x&&Il(v,P,S,L,C,F,fe.x,fe.y)&&Ai(fe.prev,fe,fe.next)>=0))return!1;fe=fe.nextZ}for(;le&&le.z>=ie;){if(le.x>=$&&le.x<=q&&le.y>=H&&le.y<=K&&le!==f&&le!==x&&Il(v,P,S,L,C,F,le.x,le.y)&&Ai(le.prev,le,le.next)>=0)return!1;le=le.prevZ}for(;fe&&fe.z<=ge;){if(fe.x>=$&&fe.x<=q&&fe.y>=H&&fe.y<=K&&fe!==f&&fe!==x&&Il(v,P,S,L,C,F,fe.x,fe.y)&&Ai(fe.prev,fe,fe.next)>=0)return!1;fe=fe.nextZ}return!0}function BP(r,t){let s=r;do{const l=s.prev,f=s.next.next;!ed(l,f)&&G_(l,s,s.next,f)&&rh(l,f)&&rh(f,l)&&(t.push(l.i,s.i,f.i),sh(s),sh(s.next),s=r=f),s=s.next}while(s!==r);return va(s)}function FP(r,t,s,l,f,y){let x=r;do{let v=x.next.next;for(;v!==x.prev;){if(x.i!==v.i&&UP(x,v)){let S=Y_(x,v);return x=va(x,x.next),S=va(S,S.next),nh(x,t,s,l,f,y,0),void nh(S,t,s,l,f,y,0)}v=v.next}x=x.next}while(x!==r)}function NP(r,t){return r.x-t.x}function VP(r,t){const s=function(f,y){let x=y;const v=f.x,S=f.y;let C,P=-1/0;do{if(S<=x.y&&S>=x.next.y&&x.next.y!==x.y){const q=x.x+(S-x.y)*(x.next.x-x.x)/(x.next.y-x.y);if(q<=v&&q>P&&(P=q,C=x.x<x.next.x?x:x.next,q===v))return C}x=x.next}while(x!==y);if(!C)return null;const L=C,F=C.x,$=C.y;let H=1/0;x=C;do{if(v>=x.x&&x.x>=F&&v!==x.x&&Il(S<$?v:P,S,F,$,S<$?P:v,S,x.x,x.y)){const q=Math.abs(S-x.y)/(v-x.x);rh(x,f)&&(q<H||q===H&&(x.x>C.x||x.x===C.x&&$P(C,x)))&&(C=x,H=q)}x=x.next}while(x!==L);return C}(r,t);if(!s)return t;const l=Y_(s,r);return va(l,l.next),va(s,s.next)}function $P(r,t){return Ai(r.prev,r,t.prev)<0&&Ai(t.next,r,r.next)<0}function Mf(r,t,s,l,f){return(r=1431655765&((r=858993459&((r=252645135&((r=16711935&((r=(r-s)*f|0)|r<<8))|r<<4))|r<<2))|r<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-l)*f|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function jP(r){let t=r,s=r;do(t.x<s.x||t.x===s.x&&t.y<s.y)&&(s=t),t=t.next;while(t!==r);return s}function Il(r,t,s,l,f,y,x,v){return(f-x)*(t-v)>=(r-x)*(y-v)&&(r-x)*(l-v)>=(s-x)*(t-v)&&(s-x)*(y-v)>=(f-x)*(l-v)}function UP(r,t){return r.next.i!==t.i&&r.prev.i!==t.i&&!function(s,l){let f=s;do{if(f.i!==s.i&&f.next.i!==s.i&&f.i!==l.i&&f.next.i!==l.i&&G_(f,f.next,s,l))return!0;f=f.next}while(f!==s);return!1}(r,t)&&(rh(r,t)&&rh(t,r)&&function(s,l){let f=s,y=!1;const x=(s.x+l.x)/2,v=(s.y+l.y)/2;do f.y>v!=f.next.y>v&&f.next.y!==f.y&&x<(f.next.x-f.x)*(v-f.y)/(f.next.y-f.y)+f.x&&(y=!y),f=f.next;while(f!==s);return y}(r,t)&&(Ai(r.prev,r,t.prev)||Ai(r,t.prev,t))||ed(r,t)&&Ai(r.prev,r,r.next)>0&&Ai(t.prev,t,t.next)>0)}function Ai(r,t,s){return(t.y-r.y)*(s.x-t.x)-(t.x-r.x)*(s.y-t.y)}function ed(r,t){return r.x===t.x&&r.y===t.y}function G_(r,t,s,l){const f=id(Ai(r,t,s)),y=id(Ai(r,t,l)),x=id(Ai(s,l,r)),v=id(Ai(s,l,t));return f!==y&&x!==v||!(f!==0||!td(r,s,t))||!(y!==0||!td(r,l,t))||!(x!==0||!td(s,r,l))||!(v!==0||!td(s,t,l))}function td(r,t,s){return t.x<=Math.max(r.x,s.x)&&t.x>=Math.min(r.x,s.x)&&t.y<=Math.max(r.y,s.y)&&t.y>=Math.min(r.y,s.y)}function id(r){return r>0?1:r<0?-1:0}function rh(r,t){return Ai(r.prev,r,r.next)<0?Ai(r,t,r.next)>=0&&Ai(r,r.prev,t)>=0:Ai(r,t,r.prev)<0||Ai(r,r.next,t)<0}function Y_(r,t){const s=Pf(r.i,r.x,r.y),l=Pf(t.i,t.x,t.y),f=r.next,y=t.prev;return r.next=t,t.prev=r,s.next=f,f.prev=s,l.next=s,s.prev=l,y.next=l,l.prev=y,l}function X_(r,t,s,l){const f=Pf(r,t,s);return l?(f.next=l.next,f.prev=l,l.next.prev=f,l.next=f):(f.prev=f,f.next=f),f}function sh(r){r.next.prev=r.prev,r.prev.next=r.next,r.prevZ&&(r.prevZ.nextZ=r.nextZ),r.nextZ&&(r.nextZ.prevZ=r.prevZ)}function Pf(r,t,s){return{i:r,x:t,y:s,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function If(r,t,s){const l=s.patternDependencies;let f=!1;for(const y of t){const x=y.paint.get(`${r}-pattern`);x.isConstant()||(f=!0);const v=x.constantOr(null);v&&(f=!0,l[v.to]=!0,l[v.from]=!0)}return f}function Af(r,t,s,l,f){const y=f.patternDependencies;for(const x of t){const v=x.paint.get(`${r}-pattern`).value;if(v.kind!=="constant"){let S=v.evaluate({zoom:l-1},s,{},f.availableImages),C=v.evaluate({zoom:l},s,{},f.availableImages),P=v.evaluate({zoom:l+1},s,{},f.availableImages);S=S&&S.name?S.name:S,C=C&&C.name?C.name:C,P=P&&P.name?P.name:P,y[S]=!0,y[C]=!0,y[P]=!0,s.patterns[x.id]={min:S,mid:C,max:P}}}return s}class Df{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new Dr,this.indexArray=new cr,this.indexArray2=new Zi,this.programConfigurations=new _a(t.layers,t.zoom),this.segments=new Bt,this.segments2=new Bt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(t,s,l){this.hasPattern=If("fill",this.layers,s);const f=this.layers[0].layout.get("fill-sort-key"),y=!f.isConstant(),x=[];for(const{feature:v,id:S,index:C,sourceLayerIndex:P}of t){const L=this.layers[0]._featureFilter.needGeometry,F=ba(v,L);if(!this.layers[0]._featureFilter.filter(new fi(this.zoom),F,l))continue;const $=y?f.evaluate(F,{},l,s.availableImages):void 0,H={id:S,properties:v.properties,type:v.type,sourceLayerIndex:P,index:C,geometry:L?F.geometry:xa(v),patterns:{},sortKey:$};x.push(H)}y&&x.sort((v,S)=>v.sortKey-S.sortKey);for(const v of x){const{geometry:S,index:C,sourceLayerIndex:P}=v;if(this.hasPattern){const L=Af("fill",this.layers,v,this.zoom,s);this.patternFeatures.push(L)}else this.addFeature(v,S,C,l,{});s.featureIndex.insert(t[C].feature,S,C,P,this.index)}}update(t,s,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,s,this.stateDependentLayers,l)}addFeatures(t,s,l){for(const f of this.patternFeatures)this.addFeature(f,f.geometry,f.index,s,l)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,RP),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),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(t,s,l,f,y){for(const x of el(s,500)){let v=0;for(const $ of x)v+=$.length;const S=this.segments.prepareSegment(v,this.layoutVertexArray,this.indexArray),C=S.vertexLength,P=[],L=[];for(const $ of x){if($.length===0)continue;$!==x[0]&&L.push(P.length/2);const H=this.segments2.prepareSegment($.length,this.layoutVertexArray,this.indexArray2),q=H.vertexLength;this.layoutVertexArray.emplaceBack($[0].x,$[0].y),this.indexArray2.emplaceBack(q+$.length-1,q),P.push($[0].x),P.push($[0].y);for(let K=1;K<$.length;K++)this.layoutVertexArray.emplaceBack($[K].x,$[K].y),this.indexArray2.emplaceBack(q+K-1,q+K),P.push($[K].x),P.push($[K].y);H.vertexLength+=$.length,H.primitiveLength+=$.length}const F=Z_(P,L);for(let $=0;$<F.length;$+=3)this.indexArray.emplaceBack(C+F[$],C+F[$+1],C+F[$+2]);S.vertexLength+=v,S.primitiveLength+=F.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,y,f)}}let K_,J_;Xe("FillBucket",Df,{omit:["layers","patternFeatures"]});var HP={get paint(){return J_=J_||new g({"fill-antialias":new et(xe.paint_fill["fill-antialias"]),"fill-opacity":new ht(xe.paint_fill["fill-opacity"]),"fill-color":new ht(xe.paint_fill["fill-color"]),"fill-outline-color":new ht(xe.paint_fill["fill-outline-color"]),"fill-translate":new et(xe.paint_fill["fill-translate"]),"fill-translate-anchor":new et(xe.paint_fill["fill-translate-anchor"]),"fill-pattern":new bl(xe.paint_fill["fill-pattern"])})},get layout(){return K_=K_||new g({"fill-sort-key":new ht(xe.layout_fill["fill-sort-key"])})}};class qP extends a{constructor(t){super(t,HP)}recalculate(t,s){super.recalculate(t,s);const l=this.paint._values["fill-outline-color"];l.value.kind==="constant"&&l.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(t){return new Df(t)}queryRadius(){return Ku(this.paint.get("fill-translate"))}queryIntersectsFeature(t,s,l,f,y,x,v){return R_(Ju(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),x.angle,v),f)}isTileClipped(){return!0}}const ZP=w([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),WP=w([{name:"a_centroid",components:2,type:"Int16"}],4),{members:GP}=ZP;var Mo={},YP=A,Q_=Al;function Al(r,t,s,l,f){this.properties={},this.extent=s,this.type=0,this._pbf=r,this._geometry=-1,this._keys=l,this._values=f,r.readFields(XP,this,t)}function XP(r,t,s){r==1?t.id=s.readVarint():r==2?function(l,f){for(var y=l.readVarint()+l.pos;l.pos<y;){var x=f._keys[l.readVarint()],v=f._values[l.readVarint()];f.properties[x]=v}}(s,t):r==3?t.type=s.readVarint():r==4&&(t._geometry=s.pos)}function KP(r){for(var t,s,l=0,f=0,y=r.length,x=y-1;f<y;x=f++)l+=((s=r[x]).x-(t=r[f]).x)*(t.y+s.y);return l}Al.types=["Unknown","Point","LineString","Polygon"],Al.prototype.loadGeometry=function(){var r=this._pbf;r.pos=this._geometry;for(var t,s=r.readVarint()+r.pos,l=1,f=0,y=0,x=0,v=[];r.pos<s;){if(f<=0){var S=r.readVarint();l=7&S,f=S>>3}if(f--,l===1||l===2)y+=r.readSVarint(),x+=r.readSVarint(),l===1&&(t&&v.push(t),t=[]),t.push(new YP(y,x));else{if(l!==7)throw new Error("unknown command "+l);t&&t.push(t[0].clone())}}return t&&v.push(t),v},Al.prototype.bbox=function(){var r=this._pbf;r.pos=this._geometry;for(var t=r.readVarint()+r.pos,s=1,l=0,f=0,y=0,x=1/0,v=-1/0,S=1/0,C=-1/0;r.pos<t;){if(l<=0){var P=r.readVarint();s=7&P,l=P>>3}if(l--,s===1||s===2)(f+=r.readSVarint())<x&&(x=f),f>v&&(v=f),(y+=r.readSVarint())<S&&(S=y),y>C&&(C=y);else if(s!==7)throw new Error("unknown command "+s)}return[x,S,v,C]},Al.prototype.toGeoJSON=function(r,t,s){var l,f,y=this.extent*Math.pow(2,s),x=this.extent*r,v=this.extent*t,S=this.loadGeometry(),C=Al.types[this.type];function P($){for(var H=0;H<$.length;H++){var q=$[H];$[H]=[360*(q.x+x)/y-180,360/Math.PI*Math.atan(Math.exp((180-360*(q.y+v)/y)*Math.PI/180))-90]}}switch(this.type){case 1:var L=[];for(l=0;l<S.length;l++)L[l]=S[l][0];P(S=L);break;case 2:for(l=0;l<S.length;l++)P(S[l]);break;case 3:for(S=function($){var H=$.length;if(H<=1)return[$];for(var q,K,ie=[],ge=0;ge<H;ge++){var le=KP($[ge]);le!==0&&(K===void 0&&(K=le<0),K===le<0?(q&&ie.push(q),q=[$[ge]]):q.push($[ge]))}return q&&ie.push(q),ie}(S),l=0;l<S.length;l++)for(f=0;f<S[l].length;f++)P(S[l][f])}S.length===1?S=S[0]:C="Multi"+C;var F={type:"Feature",geometry:{type:C,coordinates:S},properties:this.properties};return"id"in this&&(F.id=this.id),F};var JP=Q_,e0=t0;function t0(r,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=r,this._keys=[],this._values=[],this._features=[],r.readFields(QP,this,t),this.length=this._features.length}function QP(r,t,s){r===15?t.version=s.readVarint():r===1?t.name=s.readString():r===5?t.extent=s.readVarint():r===2?t._features.push(s.pos):r===3?t._keys.push(s.readString()):r===4&&t._values.push(function(l){for(var f=null,y=l.readVarint()+l.pos;l.pos<y;){var x=l.readVarint()>>3;f=x===1?l.readString():x===2?l.readFloat():x===3?l.readDouble():x===4?l.readVarint64():x===5?l.readVarint():x===6?l.readSVarint():x===7?l.readBoolean():null}return f}(s))}t0.prototype.feature=function(r){if(r<0||r>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[r];var t=this._pbf.readVarint()+this._pbf.pos;return new JP(this._pbf,t,this.extent,this._keys,this._values)};var eI=e0;function tI(r,t,s){if(r===3){var l=new eI(s,s.readVarint()+s.pos);l.length&&(t[l.name]=l)}}Mo.VectorTile=function(r,t){this.layers=r.readFields(tI,{},t)},Mo.VectorTileFeature=Q_,Mo.VectorTileLayer=e0;const iI=Mo.VectorTileFeature.types,zf=Math.pow(2,13);function oh(r,t,s,l,f,y,x,v){r.emplaceBack(t,s,2*Math.floor(l*zf)+x,f*zf*2,y*zf*2,Math.round(v))}class Rf{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new wo,this.centroidVertexArray=new Ki,this.indexArray=new cr,this.programConfigurations=new _a(t.layers,t.zoom),this.segments=new Bt,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(t,s,l){this.features=[],this.hasPattern=If("fill-extrusion",this.layers,s);for(const{feature:f,id:y,index:x,sourceLayerIndex:v}of t){const S=this.layers[0]._featureFilter.needGeometry,C=ba(f,S);if(!this.layers[0]._featureFilter.filter(new fi(this.zoom),C,l))continue;const P={id:y,sourceLayerIndex:v,index:x,geometry:S?C.geometry:xa(f),properties:f.properties,type:f.type,patterns:{}};this.hasPattern?this.features.push(Af("fill-extrusion",this.layers,P,this.zoom,s)):this.addFeature(P,P.geometry,x,l,{}),s.featureIndex.insert(f,P.geometry,x,v,this.index,!0)}}addFeatures(t,s,l){for(const f of this.features){const{geometry:y}=f;this.addFeature(f,y,f.index,s,l)}}update(t,s,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,s,this.stateDependentLayers,l)}isEmpty(){return this.layoutVertexArray.length===0&&this.centroidVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,GP),this.centroidVertexBuffer=t.createVertexBuffer(this.centroidVertexArray,WP.members,!0),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(t,s,l,f,y){for(const x of el(s,500)){const v={x:0,y:0,vertexCount:0};let S=0;for(const H of x)S+=H.length;let C=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const H of x){if(H.length===0||rI(H))continue;let q=0;for(let K=0;K<H.length;K++){const ie=H[K];if(K>=1){const ge=H[K-1];if(!nI(ie,ge)){C.vertexLength+4>Bt.MAX_VERTEX_ARRAY_LENGTH&&(C=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const le=ie.sub(ge)._perp()._unit(),fe=ge.dist(ie);q+fe>32768&&(q=0),oh(this.layoutVertexArray,ie.x,ie.y,le.x,le.y,0,0,q),oh(this.layoutVertexArray,ie.x,ie.y,le.x,le.y,0,1,q),v.x+=2*ie.x,v.y+=2*ie.y,v.vertexCount+=2,q+=fe,oh(this.layoutVertexArray,ge.x,ge.y,le.x,le.y,0,0,q),oh(this.layoutVertexArray,ge.x,ge.y,le.x,le.y,0,1,q),v.x+=2*ge.x,v.y+=2*ge.y,v.vertexCount+=2;const we=C.vertexLength;this.indexArray.emplaceBack(we,we+2,we+1),this.indexArray.emplaceBack(we+1,we+2,we+3),C.vertexLength+=4,C.primitiveLength+=2}}}}if(C.vertexLength+S>Bt.MAX_VERTEX_ARRAY_LENGTH&&(C=this.segments.prepareSegment(S,this.layoutVertexArray,this.indexArray)),iI[t.type]!=="Polygon")continue;const P=[],L=[],F=C.vertexLength;for(const H of x)if(H.length!==0){H!==x[0]&&L.push(P.length/2);for(let q=0;q<H.length;q++){const K=H[q];oh(this.layoutVertexArray,K.x,K.y,0,0,1,1,0),v.x+=K.x,v.y+=K.y,v.vertexCount+=1,P.push(K.x),P.push(K.y)}}const $=Z_(P,L);for(let H=0;H<$.length;H+=3)this.indexArray.emplaceBack(F+$[H],F+$[H+2],F+$[H+1]);C.primitiveLength+=$.length/3,C.vertexLength+=S;for(let H=0;H<v.vertexCount;H++){const q=Math.floor(v.x/v.vertexCount),K=Math.floor(v.y/v.vertexCount);this.centroidVertexArray.emplaceBack(q,K)}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,y,f)}}function nI(r,t){return r.x===t.x&&(r.x<0||r.x>Ri)||r.y===t.y&&(r.y<0||r.y>Ri)}function rI(r){return r.every(t=>t.x<0)||r.every(t=>t.x>Ri)||r.every(t=>t.y<0)||r.every(t=>t.y>Ri)}let i0;Xe("FillExtrusionBucket",Rf,{omit:["layers","features"]});var sI={get paint(){return i0=i0||new g({"fill-extrusion-opacity":new et(xe["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new ht(xe["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new et(xe["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new et(xe["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new bl(xe["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new ht(xe["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new ht(xe["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new et(xe["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})}};class oI extends a{constructor(t){super(t,sI)}createBucket(t){return new Rf(t)}queryRadius(){return Ku(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(t,s,l,f,y,x,v,S){const C=Ju(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),x.angle,v),P=this.paint.get("fill-extrusion-height").evaluate(s,l),L=this.paint.get("fill-extrusion-base").evaluate(s,l),F=function(H,q,K,ie){const ge=[];for(const le of H){const fe=[le.x,le.y,0,1];Qu(fe,fe,q),ge.push(new R(fe[0]/fe[3],fe[1]/fe[3]))}return ge}(C,S),$=function(H,q,K,ie){const ge=[],le=[],fe=ie[8]*q,we=ie[9]*q,Ie=ie[10]*q,qe=ie[11]*q,ct=ie[8]*K,je=ie[9]*K,Ve=ie[10]*K,nt=ie[11]*K;for(const Ke of H){const Ge=[],Te=[];for(const st of Ke){const it=st.x,yt=st.y,ci=ie[0]*it+ie[4]*yt+ie[12],ai=ie[1]*it+ie[5]*yt+ie[13],Ni=ie[2]*it+ie[6]*yt+ie[14],zr=ie[3]*it+ie[7]*yt+ie[15],en=Ni+Ie,Vi=zr+qe,xn=ci+ct,bn=ai+je,vn=Ni+Ve,Pi=zr+nt,$i=new R((ci+fe)/Vi,(ai+we)/Vi);$i.z=en/Vi,Ge.push($i);const hn=new R(xn/Pi,bn/Pi);hn.z=vn/Pi,Te.push(hn)}ge.push(Ge),le.push(Te)}return[ge,le]}(f,L,P,S);return function(H,q,K){let ie=1/0;R_(K,q)&&(ie=n0(K,q[0]));for(let ge=0;ge<q.length;ge++){const le=q[ge],fe=H[ge];for(let we=0;we<le.length-1;we++){const Ie=le[we],qe=[Ie,le[we+1],fe[we+1],fe[we],Ie];z_(K,qe)&&(ie=Math.min(ie,n0(K,qe)))}}return ie!==1/0&&ie}($[0],$[1],F)}}function ah(r,t){return r.x*t.x+r.y*t.y}function n0(r,t){if(r.length===1){let s=0;const l=t[s++];let f;for(;!f||l.equals(f);)if(f=t[s++],!f)return 1/0;for(;s<t.length;s++){const y=t[s],x=r[0],v=f.sub(l),S=y.sub(l),C=x.sub(l),P=ah(v,v),L=ah(v,S),F=ah(S,S),$=ah(C,v),H=ah(C,S),q=P*F-L*L,K=(F*$-L*H)/q,ie=(P*H-L*$)/q,ge=l.z*(1-K-ie)+f.z*K+y.z*ie;if(isFinite(ge))return ge}return 1/0}{let s=1/0;for(const l of t)s=Math.min(s,l.z);return s}}const aI=w([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:lI}=aI,cI=w([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:hI}=cI,uI=Mo.VectorTileFeature.types,dI=Math.cos(Math.PI/180*37.5),r0=Math.pow(2,14)/.5;class Lf{constructor(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(s=>s.id),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(s=>{this.gradients[s.id]={}}),this.layoutVertexArray=new wl,this.layoutVertexArray2=new So,this.indexArray=new cr,this.programConfigurations=new _a(t.layers,t.zoom),this.segments=new Bt,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(s=>s.isStateDependent()).map(s=>s.id)}populate(t,s,l){this.hasPattern=If("line",this.layers,s);const f=this.layers[0].layout.get("line-sort-key"),y=!f.isConstant(),x=[];for(const{feature:v,id:S,index:C,sourceLayerIndex:P}of t){const L=this.layers[0]._featureFilter.needGeometry,F=ba(v,L);if(!this.layers[0]._featureFilter.filter(new fi(this.zoom),F,l))continue;const $=y?f.evaluate(F,{},l):void 0,H={id:S,properties:v.properties,type:v.type,sourceLayerIndex:P,index:C,geometry:L?F.geometry:xa(v),patterns:{},sortKey:$};x.push(H)}y&&x.sort((v,S)=>v.sortKey-S.sortKey);for(const v of x){const{geometry:S,index:C,sourceLayerIndex:P}=v;if(this.hasPattern){const L=Af("line",this.layers,v,this.zoom,s);this.patternFeatures.push(L)}else this.addFeature(v,S,C,l,{});s.featureIndex.insert(t[C].feature,S,C,P,this.index)}}update(t,s,l){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,s,this.stateDependentLayers,l)}addFeatures(t,s,l){for(const f of this.patternFeatures)this.addFeature(f,f.geometry,f.index,s,l)}isEmpty(){return this.layoutVertexArray.length===0}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(t){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,hI)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,lI),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(t){if(t.properties&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(t.properties,"mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}}addFeature(t,s,l,f,y){const x=this.layers[0].layout,v=x.get("line-join").evaluate(t,{}),S=x.get("line-cap"),C=x.get("line-miter-limit"),P=x.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(const L of s)this.addLine(L,t,v,S,C,P);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,l,y,f)}addLine(t,s,l,f,y,x){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let ie=0;ie<t.length-1;ie++)this.totalDistance+=t[ie].dist(t[ie+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const v=uI[s.type]==="Polygon";let S=t.length;for(;S>=2&&t[S-1].equals(t[S-2]);)S--;let C=0;for(;C<S-1&&t[C].equals(t[C+1]);)C++;if(S<(v?3:2))return;l==="bevel"&&(y=1.05);const P=this.overscaling<=16?15*Ri/(512*this.overscaling):0,L=this.segments.prepareSegment(10*S,this.layoutVertexArray,this.indexArray);let F,$,H,q,K;this.e1=this.e2=-1,v&&(F=t[S-2],K=t[C].sub(F)._unit()._perp());for(let ie=C;ie<S;ie++){if(H=ie===S-1?v?t[C+1]:void 0:t[ie+1],H&&t[ie].equals(H))continue;K&&(q=K),F&&($=F),F=t[ie],K=H?H.sub(F)._unit()._perp():q,q=q||K;let ge=q.add(K);ge.x===0&&ge.y===0||ge._unit();const le=q.x*K.x+q.y*K.y,fe=ge.x*K.x+ge.y*K.y,we=fe!==0?1/fe:1/0,Ie=2*Math.sqrt(2-2*fe),qe=fe<dI&&$&&H,ct=q.x*K.y-q.y*K.x>0;if(qe&&ie>C){const nt=F.dist($);if(nt>2*P){const Ke=F.sub(F.sub($)._mult(P/nt)._round());this.updateDistance($,Ke),this.addCurrentVertex(Ke,q,0,0,L),$=Ke}}const je=$&&H;let Ve=je?l:v?"butt":f;if(je&&Ve==="round"&&(we<x?Ve="miter":we<=2&&(Ve="fakeround")),Ve==="miter"&&we>y&&(Ve="bevel"),Ve==="bevel"&&(we>2&&(Ve="flipbevel"),we<y&&(Ve="miter")),$&&this.updateDistance($,F),Ve==="miter")ge._mult(we),this.addCurrentVertex(F,ge,0,0,L);else if(Ve==="flipbevel"){if(we>100)ge=K.mult(-1);else{const nt=we*q.add(K).mag()/q.sub(K).mag();ge._perp()._mult(nt*(ct?-1:1))}this.addCurrentVertex(F,ge,0,0,L),this.addCurrentVertex(F,ge.mult(-1),0,0,L)}else if(Ve==="bevel"||Ve==="fakeround"){const nt=-Math.sqrt(we*we-1),Ke=ct?nt:0,Ge=ct?0:nt;if($&&this.addCurrentVertex(F,q,Ke,Ge,L),Ve==="fakeround"){const Te=Math.round(180*Ie/Math.PI/20);for(let st=1;st<Te;st++){let it=st/Te;if(it!==.5){const ci=it-.5;it+=it*ci*(it-1)*((1.0904+le*(le*(3.55645-1.43519*le)-3.2452))*ci*ci+(.848013+le*(.215638*le-1.06021)))}const yt=K.sub(q)._mult(it)._add(q)._unit()._mult(ct?-1:1);this.addHalfVertex(F,yt.x,yt.y,!1,ct,0,L)}}H&&this.addCurrentVertex(F,K,-Ke,-Ge,L)}else if(Ve==="butt")this.addCurrentVertex(F,ge,0,0,L);else if(Ve==="square"){const nt=$?1:-1;this.addCurrentVertex(F,ge,nt,nt,L)}else Ve==="round"&&($&&(this.addCurrentVertex(F,q,0,0,L),this.addCurrentVertex(F,q,1,1,L,!0)),H&&(this.addCurrentVertex(F,K,-1,-1,L,!0),this.addCurrentVertex(F,K,0,0,L)));if(qe&&ie<S-1){const nt=F.dist(H);if(nt>2*P){const Ke=F.add(H.sub(F)._mult(P/nt)._round());this.updateDistance(F,Ke),this.addCurrentVertex(Ke,K,0,0,L),F=Ke}}}}addCurrentVertex(t,s,l,f,y,x=!1){const v=s.y*f-s.x,S=-s.y-s.x*f;this.addHalfVertex(t,s.x+s.y*l,s.y-s.x*l,x,!1,l,y),this.addHalfVertex(t,v,S,x,!0,-f,y),this.distance>r0/2&&this.totalDistance===0&&(this.distance=0,this.updateScaledDistance(),this.addCurrentVertex(t,s,l,f,y,x))}addHalfVertex({x:t,y:s},l,f,y,x,v,S){const C=.5*(this.lineClips?this.scaledDistance*(r0-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t<<1)+(y?1:0),(s<<1)+(x?1:0),Math.round(63*l)+128,Math.round(63*f)+128,1+(v===0?0:v<0?-1:1)|(63&C)<<2,C>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const P=S.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,P),S.primitiveLength++),x?this.e2=P:this.e1=P}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(t,s){this.distance+=t.dist(s),this.updateScaledDistance()}}let s0,o0;Xe("LineBucket",Lf,{omit:["layers","patternFeatures"]});var a0={get paint(){return o0=o0||new g({"line-opacity":new ht(xe.paint_line["line-opacity"]),"line-color":new ht(xe.paint_line["line-color"]),"line-translate":new et(xe.paint_line["line-translate"]),"line-translate-anchor":new et(xe.paint_line["line-translate-anchor"]),"line-width":new ht(xe.paint_line["line-width"]),"line-gap-width":new ht(xe.paint_line["line-gap-width"]),"line-offset":new ht(xe.paint_line["line-offset"]),"line-blur":new ht(xe.paint_line["line-blur"]),"line-dasharray":new vl(xe.paint_line["line-dasharray"]),"line-pattern":new bl(xe.paint_line["line-pattern"]),"line-gradient":new Kc(xe.paint_line["line-gradient"])})},get layout(){return s0=s0||new g({"line-cap":new et(xe.layout_line["line-cap"]),"line-join":new ht(xe.layout_line["line-join"]),"line-miter-limit":new et(xe.layout_line["line-miter-limit"]),"line-round-limit":new et(xe.layout_line["line-round-limit"]),"line-sort-key":new ht(xe.layout_line["line-sort-key"])})}};class pI extends ht{possiblyEvaluate(t,s){return s=new fi(Math.floor(s.zoom),{now:s.now,fadeDuration:s.fadeDuration,zoomHistory:s.zoomHistory,transition:s.transition}),super.possiblyEvaluate(t,s)}evaluate(t,s,l,f){return s=Ae({},s,{zoom:Math.floor(s.zoom)}),super.evaluate(t,s,l,f)}}let nd;class fI extends a{constructor(t){super(t,a0),this.gradientVersion=0,nd||(nd=new pI(a0.paint.properties["line-width"].specification),nd.useIntegerZoom=!0)}_handleSpecialPaintPropertyUpdate(t){if(t==="line-gradient"){const s=this.gradientExpression();this.stepInterpolant=!!function(l){return l._styleExpression!==void 0}(s)&&s._styleExpression.expression instanceof io,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER}}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(t,s){super.recalculate(t,s),this.paint._values["line-floorwidth"]=nd.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)}createBucket(t){return new Lf(t)}queryRadius(t){const s=t,l=l0(eh("line-width",this,s),eh("line-gap-width",this,s)),f=eh("line-offset",this,s);return l/2+Math.abs(f)+Ku(this.paint.get("line-translate"))}queryIntersectsFeature(t,s,l,f,y,x,v){const S=Ju(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),x.angle,v),C=v/2*l0(this.paint.get("line-width").evaluate(s,l),this.paint.get("line-gap-width").evaluate(s,l)),P=this.paint.get("line-offset").evaluate(s,l);return P&&(f=function(L,F){const $=[];for(let H=0;H<L.length;H++){const q=L[H],K=[];for(let ie=0;ie<q.length;ie++){const ge=q[ie-1],le=q[ie],fe=q[ie+1],we=ie===0?new R(0,0):le.sub(ge)._unit()._perp(),Ie=ie===q.length-1?new R(0,0):fe.sub(le)._unit()._perp(),qe=we._add(Ie)._unit(),ct=qe.x*Ie.x+qe.y*Ie.y;ct!==0&&qe._mult(1/ct),K.push(qe._mult(F)._add(le))}$.push(K)}return $}(f,P*v)),function(L,F,$){for(let H=0;H<F.length;H++){const q=F[H];if(L.length>=3){for(let K=0;K<q.length;K++)if(Ml(L,q[K]))return!0}if(SP(L,q,$))return!0}return!1}(S,f,C)}isTileClipped(){return!0}}function l0(r,t){return t>0?t+2*r:r}const mI=w([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gI=w([{name:"a_projected_pos",components:3,type:"Float32"}],4);w([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const yI=w([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"},{name:"a_box_real",components:2,type:"Int16"}]);w([{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 c0=w([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),_I=w([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function xI(r,t,s){return r.sections.forEach(l=>{l.text=function(f,y,x){const v=y.layout.get("text-transform").evaluate(x,{});return v==="uppercase"?f=f.toLocaleUpperCase():v==="lowercase"&&(f=f.toLocaleLowerCase()),Dn.applyArabicShaping&&(f=Dn.applyArabicShaping(f)),f}(l.text,t,s)}),r}w([{name:"triangle",components:3,type:"Uint16"}]),w([{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"}]),w([{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"}]),w([{type:"Float32",name:"offsetX"}]),w([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]),w([{type:"Uint16",name:"textAnchor"},{type:"Float32",components:2,name:"textOffset"}]);const lh={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var Oi=24,h0=oi,u0=function(r,t,s,l,f){var y,x,v=8*f-l-1,S=(1<<v)-1,C=S>>1,P=-7,L=f-1,F=-1,$=r[t+L];for(L+=F,y=$&(1<<-P)-1,$>>=-P,P+=v;P>0;y=256*y+r[t+L],L+=F,P-=8);for(x=y&(1<<-P)-1,y>>=-P,P+=l;P>0;x=256*x+r[t+L],L+=F,P-=8);if(y===0)y=1-C;else{if(y===S)return x?NaN:1/0*($?-1:1);x+=Math.pow(2,l),y-=C}return($?-1:1)*x*Math.pow(2,y-l)},d0=function(r,t,s,l,f,y){var x,v,S,C=8*y-f-1,P=(1<<C)-1,L=P>>1,F=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,$=0,H=1,q=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,x=P):(x=Math.floor(Math.log(t)/Math.LN2),t*(S=Math.pow(2,-x))<1&&(x--,S*=2),(t+=x+L>=1?F/S:F*Math.pow(2,1-L))*S>=2&&(x++,S/=2),x+L>=P?(v=0,x=P):x+L>=1?(v=(t*S-1)*Math.pow(2,f),x+=L):(v=t*Math.pow(2,L-1)*Math.pow(2,f),x=0));f>=8;r[s+$]=255&v,$+=H,v/=256,f-=8);for(x=x<<f|v,C+=f;C>0;r[s+$]=255&x,$+=H,x/=256,C-=8);r[s+$-H]|=128*q};function oi(r){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(r)?r:new Uint8Array(r||0),this.pos=0,this.type=0,this.length=this.buf.length}oi.Varint=0,oi.Fixed64=1,oi.Bytes=2,oi.Fixed32=5;var Of=4294967296,p0=1/Of,f0=typeof TextDecoder>"u"?null:new TextDecoder("utf-8");function $s(r){return r.type===oi.Bytes?r.readVarint()+r.pos:r.pos+1}function Dl(r,t,s){return s?4294967296*t+(r>>>0):4294967296*(t>>>0)+(r>>>0)}function m0(r,t,s){var l=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));s.realloc(l);for(var f=s.pos-1;f>=r;f--)s.buf[f+l]=s.buf[f]}function bI(r,t){for(var s=0;s<r.length;s++)t.writeVarint(r[s])}function vI(r,t){for(var s=0;s<r.length;s++)t.writeSVarint(r[s])}function wI(r,t){for(var s=0;s<r.length;s++)t.writeFloat(r[s])}function SI(r,t){for(var s=0;s<r.length;s++)t.writeDouble(r[s])}function kI(r,t){for(var s=0;s<r.length;s++)t.writeBoolean(r[s])}function EI(r,t){for(var s=0;s<r.length;s++)t.writeFixed32(r[s])}function TI(r,t){for(var s=0;s<r.length;s++)t.writeSFixed32(r[s])}function CI(r,t){for(var s=0;s<r.length;s++)t.writeFixed64(r[s])}function MI(r,t){for(var s=0;s<r.length;s++)t.writeSFixed64(r[s])}function rd(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+16777216*r[t+3]}function zl(r,t,s){r[s]=t,r[s+1]=t>>>8,r[s+2]=t>>>16,r[s+3]=t>>>24}function g0(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16)+(r[t+3]<<24)}oi.prototype={destroy:function(){this.buf=null},readFields:function(r,t,s){for(s=s||this.length;this.pos<s;){var l=this.readVarint(),f=l>>3,y=this.pos;this.type=7&l,r(f,t,this),this.pos===y&&this.skip(l)}return t},readMessage:function(r,t){return this.readFields(r,t,this.readVarint()+this.pos)},readFixed32:function(){var r=rd(this.buf,this.pos);return this.pos+=4,r},readSFixed32:function(){var r=g0(this.buf,this.pos);return this.pos+=4,r},readFixed64:function(){var r=rd(this.buf,this.pos)+rd(this.buf,this.pos+4)*Of;return this.pos+=8,r},readSFixed64:function(){var r=rd(this.buf,this.pos)+g0(this.buf,this.pos+4)*Of;return this.pos+=8,r},readFloat:function(){var r=u0(this.buf,this.pos,!0,23,4);return this.pos+=4,r},readDouble:function(){var r=u0(this.buf,this.pos,!0,52,8);return this.pos+=8,r},readVarint:function(r){var t,s,l=this.buf;return t=127&(s=l[this.pos++]),s<128?t:(t|=(127&(s=l[this.pos++]))<<7,s<128?t:(t|=(127&(s=l[this.pos++]))<<14,s<128?t:(t|=(127&(s=l[this.pos++]))<<21,s<128?t:function(f,y,x){var v,S,C=x.buf;if(v=(112&(S=C[x.pos++]))>>4,S<128||(v|=(127&(S=C[x.pos++]))<<3,S<128)||(v|=(127&(S=C[x.pos++]))<<10,S<128)||(v|=(127&(S=C[x.pos++]))<<17,S<128)||(v|=(127&(S=C[x.pos++]))<<24,S<128)||(v|=(1&(S=C[x.pos++]))<<31,S<128))return Dl(f,v,y);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(s=l[this.pos]))<<28,r,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var r=this.readVarint();return r%2==1?(r+1)/-2:r/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var r=this.readVarint()+this.pos,t=this.pos;return this.pos=r,r-t>=12&&f0?function(s,l,f){return f0.decode(s.subarray(l,f))}(this.buf,t,r):function(s,l,f){for(var y="",x=l;x<f;){var v,S,C,P=s[x],L=null,F=P>239?4:P>223?3:P>191?2:1;if(x+F>f)break;F===1?P<128&&(L=P):F===2?(192&(v=s[x+1]))==128&&(L=(31&P)<<6|63&v)<=127&&(L=null):F===3?(S=s[x+2],(192&(v=s[x+1]))==128&&(192&S)==128&&((L=(15&P)<<12|(63&v)<<6|63&S)<=2047||L>=55296&&L<=57343)&&(L=null)):F===4&&(S=s[x+2],C=s[x+3],(192&(v=s[x+1]))==128&&(192&S)==128&&(192&C)==128&&((L=(15&P)<<18|(63&v)<<12|(63&S)<<6|63&C)<=65535||L>=1114112)&&(L=null)),L===null?(L=65533,F=1):L>65535&&(L-=65536,y+=String.fromCharCode(L>>>10&1023|55296),L=56320|1023&L),y+=String.fromCharCode(L),x+=F}return y}(this.buf,t,r)},readBytes:function(){var r=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,r);return this.pos=r,t},readPackedVarint:function(r,t){if(this.type!==oi.Bytes)return r.push(this.readVarint(t));var s=$s(this);for(r=r||[];this.pos<s;)r.push(this.readVarint(t));return r},readPackedSVarint:function(r){if(this.type!==oi.Bytes)return r.push(this.readSVarint());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readSVarint());return r},readPackedBoolean:function(r){if(this.type!==oi.Bytes)return r.push(this.readBoolean());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readBoolean());return r},readPackedFloat:function(r){if(this.type!==oi.Bytes)return r.push(this.readFloat());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readFloat());return r},readPackedDouble:function(r){if(this.type!==oi.Bytes)return r.push(this.readDouble());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readDouble());return r},readPackedFixed32:function(r){if(this.type!==oi.Bytes)return r.push(this.readFixed32());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readFixed32());return r},readPackedSFixed32:function(r){if(this.type!==oi.Bytes)return r.push(this.readSFixed32());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed32());return r},readPackedFixed64:function(r){if(this.type!==oi.Bytes)return r.push(this.readFixed64());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readFixed64());return r},readPackedSFixed64:function(r){if(this.type!==oi.Bytes)return r.push(this.readSFixed64());var t=$s(this);for(r=r||[];this.pos<t;)r.push(this.readSFixed64());return r},skip:function(r){var t=7&r;if(t===oi.Varint)for(;this.buf[this.pos++]>127;);else if(t===oi.Bytes)this.pos=this.readVarint()+this.pos;else if(t===oi.Fixed32)this.pos+=4;else{if(t!==oi.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(r,t){this.writeVarint(r<<3|t)},realloc:function(r){for(var t=this.length||16;t<this.pos+r;)t*=2;if(t!==this.length){var s=new Uint8Array(t);s.set(this.buf),this.buf=s,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(r){this.realloc(4),zl(this.buf,r,this.pos),this.pos+=4},writeSFixed32:function(r){this.realloc(4),zl(this.buf,r,this.pos),this.pos+=4},writeFixed64:function(r){this.realloc(8),zl(this.buf,-1&r,this.pos),zl(this.buf,Math.floor(r*p0),this.pos+4),this.pos+=8},writeSFixed64:function(r){this.realloc(8),zl(this.buf,-1&r,this.pos),zl(this.buf,Math.floor(r*p0),this.pos+4),this.pos+=8},writeVarint:function(r){(r=+r||0)>268435455||r<0?function(t,s){var l,f;if(t>=0?(l=t%4294967296|0,f=t/4294967296|0):(f=~(-t/4294967296),4294967295^(l=~(-t%4294967296))?l=l+1|0:(l=0,f=f+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");s.realloc(10),function(y,x,v){v.buf[v.pos++]=127&y|128,y>>>=7,v.buf[v.pos++]=127&y|128,y>>>=7,v.buf[v.pos++]=127&y|128,y>>>=7,v.buf[v.pos++]=127&y|128,v.buf[v.pos]=127&(y>>>=7)}(l,0,s),function(y,x){var v=(7&y)<<4;x.buf[x.pos++]|=v|((y>>>=3)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y|((y>>>=7)?128:0),y&&(x.buf[x.pos++]=127&y)))))}(f,s)}(r,this):(this.realloc(4),this.buf[this.pos++]=127&r|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=127&(r>>>=7)|(r>127?128:0),r<=127||(this.buf[this.pos++]=r>>>7&127))))},writeSVarint:function(r){this.writeVarint(r<0?2*-r-1:2*r)},writeBoolean:function(r){this.writeVarint(!!r)},writeString:function(r){r=String(r),this.realloc(4*r.length),this.pos++;var t=this.pos;this.pos=function(l,f,y){for(var x,v,S=0;S<f.length;S++){if((x=f.charCodeAt(S))>55295&&x<57344){if(!v){x>56319||S+1===f.length?(l[y++]=239,l[y++]=191,l[y++]=189):v=x;continue}if(x<56320){l[y++]=239,l[y++]=191,l[y++]=189,v=x;continue}x=v-55296<<10|x-56320|65536,v=null}else v&&(l[y++]=239,l[y++]=191,l[y++]=189,v=null);x<128?l[y++]=x:(x<2048?l[y++]=x>>6|192:(x<65536?l[y++]=x>>12|224:(l[y++]=x>>18|240,l[y++]=x>>12&63|128),l[y++]=x>>6&63|128),l[y++]=63&x|128)}return y}(this.buf,r,this.pos);var s=this.pos-t;s>=128&&m0(t,s,this),this.pos=t-1,this.writeVarint(s),this.pos+=s},writeFloat:function(r){this.realloc(4),d0(this.buf,r,this.pos,!0,23,4),this.pos+=4},writeDouble:function(r){this.realloc(8),d0(this.buf,r,this.pos,!0,52,8),this.pos+=8},writeBytes:function(r){var t=r.length;this.writeVarint(t),this.realloc(t);for(var s=0;s<t;s++)this.buf[this.pos++]=r[s]},writeRawMessage:function(r,t){this.pos++;var s=this.pos;r(t,this);var l=this.pos-s;l>=128&&m0(s,l,this),this.pos=s-1,this.writeVarint(l),this.pos+=l},writeMessage:function(r,t,s){this.writeTag(r,oi.Bytes),this.writeRawMessage(t,s)},writePackedVarint:function(r,t){t.length&&this.writeMessage(r,bI,t)},writePackedSVarint:function(r,t){t.length&&this.writeMessage(r,vI,t)},writePackedBoolean:function(r,t){t.length&&this.writeMessage(r,kI,t)},writePackedFloat:function(r,t){t.length&&this.writeMessage(r,wI,t)},writePackedDouble:function(r,t){t.length&&this.writeMessage(r,SI,t)},writePackedFixed32:function(r,t){t.length&&this.writeMessage(r,EI,t)},writePackedSFixed32:function(r,t){t.length&&this.writeMessage(r,TI,t)},writePackedFixed64:function(r,t){t.length&&this.writeMessage(r,CI,t)},writePackedSFixed64:function(r,t){t.length&&this.writeMessage(r,MI,t)},writeBytesField:function(r,t){this.writeTag(r,oi.Bytes),this.writeBytes(t)},writeFixed32Field:function(r,t){this.writeTag(r,oi.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(r,t){this.writeTag(r,oi.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(r,t){this.writeTag(r,oi.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(r,t){this.writeTag(r,oi.Fixed64),this.writeSFixed64(t)},writeVarintField:function(r,t){this.writeTag(r,oi.Varint),this.writeVarint(t)},writeSVarintField:function(r,t){this.writeTag(r,oi.Varint),this.writeSVarint(t)},writeStringField:function(r,t){this.writeTag(r,oi.Bytes),this.writeString(t)},writeFloatField:function(r,t){this.writeTag(r,oi.Fixed32),this.writeFloat(t)},writeDoubleField:function(r,t){this.writeTag(r,oi.Fixed64),this.writeDouble(t)},writeBooleanField:function(r,t){this.writeVarintField(r,!!t)}};var Bf=M(h0);const Ff=3;function PI(r,t,s){r===1&&s.readMessage(II,t)}function II(r,t,s){if(r===3){const{id:l,bitmap:f,width:y,height:x,left:v,top:S,advance:C}=s.readMessage(AI,{});t.push({id:l,bitmap:new ih({width:y+2*Ff,height:x+2*Ff},f),metrics:{width:y,height:x,left:v,top:S,advance:C}})}}function AI(r,t,s){r===1?t.id=s.readVarint():r===2?t.bitmap=s.readBytes():r===3?t.width=s.readVarint():r===4?t.height=s.readVarint():r===5?t.left=s.readSVarint():r===6?t.top=s.readSVarint():r===7&&(t.advance=s.readVarint())}const y0=Ff;function _0(r){let t=0,s=0;for(const x of r)t+=x.w*x.h,s=Math.max(s,x.w);r.sort((x,v)=>v.h-x.h);const l=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),s),h:1/0}];let f=0,y=0;for(const x of r)for(let v=l.length-1;v>=0;v--){const S=l[v];if(!(x.w>S.w||x.h>S.h)){if(x.x=S.x,x.y=S.y,y=Math.max(y,x.y+x.h),f=Math.max(f,x.x+x.w),x.w===S.w&&x.h===S.h){const C=l.pop();v<l.length&&(l[v]=C)}else x.h===S.h?(S.x+=x.w,S.w-=x.w):x.w===S.w?(S.y+=x.h,S.h-=x.h):(l.push({x:S.x+x.w,y:S.y,w:S.w-x.w,h:x.h}),S.y+=x.h,S.h-=x.h);break}}return{w:f,h:y,fill:t/(f*y)||0}}const Rn=1;class Nf{constructor(t,{pixelRatio:s,version:l,stretchX:f,stretchY:y,content:x,textFitWidth:v,textFitHeight:S}){this.paddedRect=t,this.pixelRatio=s,this.stretchX=f,this.stretchY=y,this.content=x,this.version=l,this.textFitWidth=v,this.textFitHeight=S}get tl(){return[this.paddedRect.x+Rn,this.paddedRect.y+Rn]}get br(){return[this.paddedRect.x+this.paddedRect.w-Rn,this.paddedRect.y+this.paddedRect.h-Rn]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2*Rn)/this.pixelRatio,(this.paddedRect.h-2*Rn)/this.pixelRatio]}}class x0{constructor(t,s){const l={},f={};this.haveRenderCallbacks=[];const y=[];this.addImages(t,l,y),this.addImages(s,f,y);const{w:x,h:v}=_0(y),S=new hr({width:x||1,height:v||1});for(const C in t){const P=t[C],L=l[C].paddedRect;hr.copy(P.data,S,{x:0,y:0},{x:L.x+Rn,y:L.y+Rn},P.data)}for(const C in s){const P=s[C],L=f[C].paddedRect,F=L.x+Rn,$=L.y+Rn,H=P.data.width,q=P.data.height;hr.copy(P.data,S,{x:0,y:0},{x:F,y:$},P.data),hr.copy(P.data,S,{x:0,y:q-1},{x:F,y:$-1},{width:H,height:1}),hr.copy(P.data,S,{x:0,y:0},{x:F,y:$+q},{width:H,height:1}),hr.copy(P.data,S,{x:H-1,y:0},{x:F-1,y:$},{width:1,height:q}),hr.copy(P.data,S,{x:0,y:0},{x:F+H,y:$},{width:1,height:q})}this.image=S,this.iconPositions=l,this.patternPositions=f}addImages(t,s,l){for(const f in t){const y=t[f],x={x:0,y:0,w:y.data.width+2*Rn,h:y.data.height+2*Rn};l.push(x),s[f]=new Nf(x,y),y.hasRenderCallback&&this.haveRenderCallbacks.push(f)}}patchUpdatedImages(t,s){t.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const l in t.updatedImages)this.patchUpdatedImage(this.iconPositions[l],t.getImage(l),s),this.patchUpdatedImage(this.patternPositions[l],t.getImage(l),s)}patchUpdatedImage(t,s,l){if(!t||!s||t.version===s.version)return;t.version=s.version;const[f,y]=t.tl;l.update(s.data,void 0,{x:f,y})}}var Po;Xe("ImagePosition",Nf),Xe("ImageAtlas",x0),_.ah=void 0,(Po=_.ah||(_.ah={}))[Po.none=0]="none",Po[Po.horizontal=1]="horizontal",Po[Po.vertical=2]="vertical",Po[Po.horizontalOnly=3]="horizontalOnly";const ch=-17;class hh{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(t,s){const l=new hh;return l.scale=t||1,l.fontStack=s,l}static forImage(t){const s=new hh;return s.imageName=t,s}}class Rl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(t,s){const l=new Rl;for(let f=0;f<t.sections.length;f++){const y=t.sections[f];y.image?l.addImageSection(y):l.addTextSection(y,s)}return l}length(){return this.text.length}getSection(t){return this.sections[this.sectionIndex[t]]}getSectionIndex(t){return this.sectionIndex[t]}getCharCode(t){return this.text.charCodeAt(t)}verticalizePunctuation(){this.text=function(t){let s="";for(let l=0;l<t.length;l++){const f=t.charCodeAt(l+1)||null,y=t.charCodeAt(l-1)||null;s+=f&&Hu(f)&&!lh[t[l+1]]||y&&Hu(y)&&!lh[t[l-1]]||!lh[t[l]]?t[l]:lh[t[l]]}return s}(this.text)}trim(){let t=0;for(let l=0;l<this.text.length&&od[this.text.charCodeAt(l)];l++)t++;let s=this.text.length;for(let l=this.text.length-1;l>=0&&l>=t&&od[this.text.charCodeAt(l)];l--)s--;this.text=this.text.substring(t,s),this.sectionIndex=this.sectionIndex.slice(t,s)}substring(t,s){const l=new Rl;return l.text=this.text.substring(t,s),l.sectionIndex=this.sectionIndex.slice(t,s),l.sections=this.sections,l}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce((t,s)=>Math.max(t,this.sections[s].scale),0)}addTextSection(t,s){this.text+=t.text,this.sections.push(hh.forText(t.scale,t.fontStack||s));const l=this.sections.length-1;for(let f=0;f<t.text.length;++f)this.sectionIndex.push(l)}addImageSection(t){const s=t.image?t.image.name:"";if(s.length===0)return void zt("Can't add FormattedSection with an empty image.");const l=this.getNextImageSectionCharCode();l?(this.text+=String.fromCharCode(l),this.sections.push(hh.forImage(s)),this.sectionIndex.push(this.sections.length-1)):zt("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function sd(r,t,s,l,f,y,x,v,S,C,P,L,F,$,H){const q=Rl.fromFeature(r,f);let K;L===_.ah.vertical&&q.verticalizePunctuation();const{processBidirectionalText:ie,processStyledBidirectionalText:ge}=Dn;if(ie&&q.sections.length===1){K=[];const we=ie(q.toString(),Vf(q,C,y,t,l,$));for(const Ie of we){const qe=new Rl;qe.text=Ie,qe.sections=q.sections;for(let ct=0;ct<Ie.length;ct++)qe.sectionIndex.push(0);K.push(qe)}}else if(ge){K=[];const we=ge(q.text,q.sectionIndex,Vf(q,C,y,t,l,$));for(const Ie of we){const qe=new Rl;qe.text=Ie[0],qe.sectionIndex=Ie[1],qe.sections=q.sections,K.push(qe)}}else K=function(we,Ie){const qe=[],ct=we.text;let je=0;for(const Ve of Ie)qe.push(we.substring(je,Ve)),je=Ve;return je<ct.length&&qe.push(we.substring(je,ct.length)),qe}(q,Vf(q,C,y,t,l,$));const le=[],fe={positionedLines:le,text:q.toString(),top:P[1],bottom:P[1],left:P[0],right:P[0],writingMode:L,iconsInText:!1,verticalizable:!1};return function(we,Ie,qe,ct,je,Ve,nt,Ke,Ge,Te,st,it){let yt=0,ci=ch,ai=0,Ni=0;const zr=Ke==="right"?1:Ke==="left"?0:.5;let en=0;for(const Pi of je){Pi.trim();const $i=Pi.getMaxScale(),hn=($i-1)*Oi,tn={positionedGlyphs:[],lineOffset:0};we.positionedLines[en]=tn;const wn=tn.positionedGlyphs;let nn=0;if(!Pi.length()){ci+=Ve,++en;continue}for(let Ln=0;Ln<Pi.length();Ln++){const Zt=Pi.getSection(Ln),ui=Pi.getSectionIndex(Ln),_i=Pi.getCharCode(Ln);let Kn=0,Ei=null,Fl=null,hs=null,us=Oi;const Rr=!(Ge===_.ah.horizontal||!st&&!Yc(_i)||st&&(od[_i]||(Vi=_i,new RegExp("\\p{sc=Arab}","u").test(String.fromCodePoint(Vi)))));if(Zt.imageName){const pr=ct[Zt.imageName];if(!pr)continue;hs=Zt.imageName,we.iconsInText=we.iconsInText||!0,Fl=pr.paddedRect;const Wi=pr.displaySize;Zt.scale=Zt.scale*Oi/it,Ei={width:Wi[0],height:Wi[1],left:Rn,top:-y0,advance:Rr?Wi[1]:Wi[0]},Kn=hn+(Oi-Wi[1]*Zt.scale),us=Ei.advance;const js=Rr?Wi[0]*Zt.scale-Oi*$i:Wi[1]*Zt.scale-Oi*$i;js>0&&js>nn&&(nn=js)}else{const pr=qe[Zt.fontStack],Wi=pr&&pr[_i];if(Wi&&Wi.rect)Fl=Wi.rect,Ei=Wi.metrics;else{const js=Ie[Zt.fontStack],gh=js&&js[_i];if(!gh)continue;Ei=gh.metrics}Kn=($i-Zt.scale)*Oi}Rr?(we.verticalizable=!0,wn.push({glyph:_i,imageName:hs,x:yt,y:ci+Kn,vertical:Rr,scale:Zt.scale,fontStack:Zt.fontStack,sectionIndex:ui,metrics:Ei,rect:Fl}),yt+=us*Zt.scale+Te):(wn.push({glyph:_i,imageName:hs,x:yt,y:ci+Kn,vertical:Rr,scale:Zt.scale,fontStack:Zt.fontStack,sectionIndex:ui,metrics:Ei,rect:Fl}),yt+=Ei.advance*Zt.scale+Te)}wn.length!==0&&(ai=Math.max(yt-Te,ai),LI(wn,0,wn.length-1,zr,nn)),yt=0;const dr=Ve*$i+nn;tn.lineOffset=Math.max(nn,hn),ci+=dr,Ni=Math.max(dr,Ni),++en}var Vi;const xn=ci-ch,{horizontalAlign:bn,verticalAlign:vn}=$f(nt);(function(Pi,$i,hn,tn,wn,nn,dr,Ln,Zt){const ui=($i-hn)*wn;let _i=0;_i=nn!==dr?-Ln*tn-ch:(-tn*Zt+.5)*dr;for(const Kn of Pi)for(const Ei of Kn.positionedGlyphs)Ei.x+=ui,Ei.y+=_i})(we.positionedLines,zr,bn,vn,ai,Ni,Ve,xn,je.length),we.top+=-vn*xn,we.bottom=we.top+xn,we.left+=-bn*ai,we.right=we.left+ai}(fe,t,s,l,K,x,v,S,L,C,F,H),!function(we){for(const Ie of we)if(Ie.positionedGlyphs.length!==0)return!1;return!0}(le)&&fe}const od={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},DI={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},zI={40:!0};function b0(r,t,s,l,f,y){if(t.imageName){const x=l[t.imageName];return x?x.displaySize[0]*t.scale*Oi/y+f:0}{const x=s[t.fontStack],v=x&&x[r];return v?v.metrics.advance*t.scale+f:0}}function v0(r,t,s,l){const f=Math.pow(r-t,2);return l?r<t?f/2:2*f:f+Math.abs(s)*s}function RI(r,t,s){let l=0;return r===10&&(l-=1e4),s&&(l+=150),r!==40&&r!==65288||(l+=50),t!==41&&t!==65289||(l+=50),l}function w0(r,t,s,l,f,y){let x=null,v=v0(t,s,f,y);for(const S of l){const C=v0(t-S.x,s,f,y)+S.badness;C<=v&&(x=S,v=C)}return{index:r,x:t,priorBreak:x,badness:v}}function S0(r){return r?S0(r.priorBreak).concat(r.index):[]}function Vf(r,t,s,l,f,y){if(!r)return[];const x=[],v=function(L,F,$,H,q,K){let ie=0;for(let ge=0;ge<L.length();ge++){const le=L.getSection(ge);ie+=b0(L.getCharCode(ge),le,H,q,F,K)}return ie/Math.max(1,Math.ceil(ie/$))}(r,t,s,l,f,y),S=r.text.indexOf("​")>=0;let C=0;for(let L=0;L<r.length();L++){const F=r.getSection(L),$=r.getCharCode(L);if(od[$]||(C+=b0($,F,l,f,t,y)),L<r.length()-1){const H=!((P=$)<11904)&&(!!Ot["CJK Compatibility Forms"](P)||!!Ot["CJK Compatibility"](P)||!!Ot["CJK Strokes"](P)||!!Ot["CJK Symbols and Punctuation"](P)||!!Ot["Enclosed CJK Letters and Months"](P)||!!Ot["Halfwidth and Fullwidth Forms"](P)||!!Ot["Ideographic Description Characters"](P)||!!Ot["Vertical Forms"](P)||Uu.test(String.fromCodePoint(P)));(DI[$]||H||F.imageName||L!==r.length()-2&&zI[r.getCharCode(L+1)])&&x.push(w0(L+1,C,v,x,RI($,r.getCharCode(L+1),H&&S),!1))}}var P;return S0(w0(r.length(),C,v,x,0,!0))}function $f(r){let t=.5,s=.5;switch(r){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(r){case"bottom":case"bottom-right":case"bottom-left":s=1;break;case"top":case"top-right":case"top-left":s=0}return{horizontalAlign:t,verticalAlign:s}}function LI(r,t,s,l,f){if(!l&&!f)return;const y=r[s],x=(r[s].x+y.metrics.advance*y.scale)*l;for(let v=t;v<=s;v++)r[v].x-=x,r[v].y+=f}function OI(r,t,s){const{horizontalAlign:l,verticalAlign:f}=$f(s),y=t[0]-r.displaySize[0]*l,x=t[1]-r.displaySize[1]*f;return{image:r,top:x,bottom:x+r.displaySize[1],left:y,right:y+r.displaySize[0]}}function k0(r){var t,s;let l=r.left,f=r.top,y=r.right-l,x=r.bottom-f;const v=(t=r.image.textFitWidth)!==null&&t!==void 0?t:"stretchOrShrink",S=(s=r.image.textFitHeight)!==null&&s!==void 0?s:"stretchOrShrink",C=(r.image.content[2]-r.image.content[0])/(r.image.content[3]-r.image.content[1]);if(S==="proportional"){if(v==="stretchOnly"&&y/x<C||v==="proportional"){const P=Math.ceil(x*C);l*=P/y,y=P}}else if(v==="proportional"&&S==="stretchOnly"&&C!==0&&y/x>C){const P=Math.ceil(y/C);f*=P/x,x=P}return{x1:l,y1:f,x2:l+y,y2:f+x}}function E0(r,t,s,l,f,y){const x=r.image;let v;if(x.content){const K=x.content,ie=x.pixelRatio||1;v=[K[0]/ie,K[1]/ie,x.displaySize[0]-K[2]/ie,x.displaySize[1]-K[3]/ie]}const S=t.left*y,C=t.right*y;let P,L,F,$;s==="width"||s==="both"?($=f[0]+S-l[3],L=f[0]+C+l[1]):($=f[0]+(S+C-x.displaySize[0])/2,L=$+x.displaySize[0]);const H=t.top*y,q=t.bottom*y;return s==="height"||s==="both"?(P=f[1]+H-l[0],F=f[1]+q+l[2]):(P=f[1]+(H+q-x.displaySize[1])/2,F=P+x.displaySize[1]),{image:x,top:P,right:L,bottom:F,left:$,collisionPadding:v}}const uh=255,cs=128,Io=uh*cs;function T0(r,t){const{expression:s}=t;if(s.kind==="constant")return{kind:"constant",layoutSize:s.evaluate(new fi(r+1))};if(s.kind==="source")return{kind:"source"};{const{zoomStops:l,interpolationType:f}=s;let y=0;for(;y<l.length&&l[y]<=r;)y++;y=Math.max(0,y-1);let x=y;for(;x<l.length&&l[x]<r+1;)x++;x=Math.min(l.length-1,x);const v=l[y],S=l[x];return s.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:S,interpolationType:f}:{kind:"camera",minZoom:v,maxZoom:S,minSize:s.evaluate(new fi(v)),maxSize:s.evaluate(new fi(S)),interpolationType:f}}}function jf(r,t,s){let l="never";const f=r.get(t);return f?l=f:r.get(s)&&(l="always"),l}const BI=Mo.VectorTileFeature.types,FI=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ad(r,t,s,l,f,y,x,v,S,C,P,L,F){const $=v?Math.min(Io,Math.round(v[0])):0,H=v?Math.min(Io,Math.round(v[1])):0;r.emplaceBack(t,s,Math.round(32*l),Math.round(32*f),y,x,($<<1)+(S?1:0),H,16*C,16*P,256*L,256*F)}function Uf(r,t,s){r.emplaceBack(t.x,t.y,s),r.emplaceBack(t.x,t.y,s),r.emplaceBack(t.x,t.y,s),r.emplaceBack(t.x,t.y,s)}function NI(r){for(const t of r.sections)if(yf(t.text))return!0;return!1}class Hf{constructor(t){this.layoutVertexArray=new Sl,this.indexArray=new cr,this.programConfigurations=t,this.segments=new Bt,this.dynamicLayoutVertexArray=new Jc,this.opacityVertexArray=new Yn,this.hasVisibleVertices=!1,this.placedSymbolArray=new mi}isEmpty(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0}upload(t,s,l,f){this.isEmpty()||(l&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,mI.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,s),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,gI.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,FI,!0),this.opacityVertexBuffer.itemSize=1),(l||f)&&this.programConfigurations.upload(t))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}Xe("SymbolBuffers",Hf);class qf{constructor(t,s,l){this.layoutVertexArray=new t,this.layoutAttributes=s,this.indexArray=new l,this.segments=new Bt,this.collisionVertexArray=new as}upload(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,yI.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}Xe("CollisionBuffers",qf);class Ll{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map(x=>x.id),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=kf([]),this.placementViewportMatrix=kf([]);const s=this.layers[0]._unevaluatedLayout._values;this.textSizeData=T0(this.zoom,s["text-size"]),this.iconSizeData=T0(this.zoom,s["icon-size"]);const l=this.layers[0].layout,f=l.get("symbol-sort-key"),y=l.get("symbol-z-order");this.canOverlap=jf(l,"text-overlap","text-allow-overlap")!=="never"||jf(l,"icon-overlap","icon-allow-overlap")!=="never"||l.get("text-ignore-placement")||l.get("icon-ignore-placement"),this.sortFeaturesByKey=y!=="viewport-y"&&!f.isConstant(),this.sortFeaturesByY=(y==="viewport-y"||y==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,l.get("symbol-placement")==="point"&&(this.writingModes=l.get("text-writing-mode").map(x=>_.ah[x])),this.stateDependentLayerIds=this.layers.filter(x=>x.isStateDependent()).map(x=>x.id),this.sourceID=t.sourceID}createArrays(){this.text=new Hf(new _a(this.layers,this.zoom,t=>/^text/.test(t))),this.icon=new Hf(new _a(this.layers,this.zoom,t=>/^icon/.test(t))),this.glyphOffsetArray=new gi,this.lineVertexArray=new Xi,this.symbolInstances=new Lt,this.textAnchorOffsets=new yi}calculateGlyphDependencies(t,s,l,f,y){for(let x=0;x<t.length;x++)if(s[t.charCodeAt(x)]=!0,(l||f)&&y){const v=lh[t.charAt(x)];v&&(s[v.charCodeAt(0)]=!0)}}populate(t,s,l){const f=this.layers[0],y=f.layout,x=y.get("text-font"),v=y.get("text-field"),S=y.get("icon-image"),C=(v.value.kind!=="constant"||v.value.value instanceof Mn&&!v.value.value.isEmpty()||v.value.value.toString().length>0)&&(x.value.kind!=="constant"||x.value.value.length>0),P=S.value.kind!=="constant"||!!S.value.value||Object.keys(S.parameters).length>0,L=y.get("symbol-sort-key");if(this.features=[],!C&&!P)return;const F=s.iconDependencies,$=s.glyphDependencies,H=s.availableImages,q=new fi(this.zoom);for(const{feature:K,id:ie,index:ge,sourceLayerIndex:le}of t){const fe=f._featureFilter.needGeometry,we=ba(K,fe);if(!f._featureFilter.filter(q,we,l))continue;let Ie,qe;if(fe||(we.geometry=xa(K)),C){const je=f.getValueAndResolveTokens("text-field",we,l,H),Ve=Mn.factory(je),nt=this.hasRTLText=this.hasRTLText||NI(Ve);(!nt||Dn.getRTLTextPluginStatus()==="unavailable"||nt&&Dn.isParsed())&&(Ie=xI(Ve,f,we))}if(P){const je=f.getValueAndResolveTokens("icon-image",we,l,H);qe=je instanceof In?je:In.fromString(je)}if(!Ie&&!qe)continue;const ct=this.sortFeaturesByKey?L.evaluate(we,{},l):void 0;if(this.features.push({id:ie,text:Ie,icon:qe,index:ge,sourceLayerIndex:le,geometry:we.geometry,properties:K.properties,type:BI[K.type],sortKey:ct}),qe&&(F[qe.name]=!0),Ie){const je=x.evaluate(we,{},l).join(","),Ve=y.get("text-rotation-alignment")!=="viewport"&&y.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(_.ah.vertical)>=0;for(const nt of Ie.sections)if(nt.image)F[nt.image.name]=!0;else{const Ke=Wc(Ie.toString()),Ge=nt.fontStack||je,Te=$[Ge]=$[Ge]||{};this.calculateGlyphDependencies(nt.text,Te,Ve,this.allowVerticalPlacement,Ke)}}}y.get("symbol-placement")==="line"&&(this.features=function(K){const ie={},ge={},le=[];let fe=0;function we(je){le.push(K[je]),fe++}function Ie(je,Ve,nt){const Ke=ge[je];return delete ge[je],ge[Ve]=Ke,le[Ke].geometry[0].pop(),le[Ke].geometry[0]=le[Ke].geometry[0].concat(nt[0]),Ke}function qe(je,Ve,nt){const Ke=ie[Ve];return delete ie[Ve],ie[je]=Ke,le[Ke].geometry[0].shift(),le[Ke].geometry[0]=nt[0].concat(le[Ke].geometry[0]),Ke}function ct(je,Ve,nt){const Ke=nt?Ve[0][Ve[0].length-1]:Ve[0][0];return`${je}:${Ke.x}:${Ke.y}`}for(let je=0;je<K.length;je++){const Ve=K[je],nt=Ve.geometry,Ke=Ve.text?Ve.text.toString():null;if(!Ke){we(je);continue}const Ge=ct(Ke,nt),Te=ct(Ke,nt,!0);if(Ge in ge&&Te in ie&&ge[Ge]!==ie[Te]){const st=qe(Ge,Te,nt),it=Ie(Ge,Te,le[st].geometry);delete ie[Ge],delete ge[Te],ge[ct(Ke,le[it].geometry,!0)]=it,le[st].geometry=null}else Ge in ge?Ie(Ge,Te,nt):Te in ie?qe(Ge,Te,nt):(we(je),ie[Ge]=fe-1,ge[Te]=fe-1)}return le.filter(je=>je.geometry)}(this.features)),this.sortFeaturesByKey&&this.features.sort((K,ie)=>K.sortKey-ie.sortKey)}update(t,s,l){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,s,this.layers,l),this.icon.programConfigurations.updatePaintArrays(t,s,this.layers,l))}isEmpty(){return this.symbolInstances.length===0&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,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(t,s){const l=this.lineVertexArray.length;if(t.segment!==void 0){let f=t.dist(s[t.segment+1]),y=t.dist(s[t.segment]);const x={};for(let v=t.segment+1;v<s.length;v++)x[v]={x:s[v].x,y:s[v].y,tileUnitDistanceFromAnchor:f},v<s.length-1&&(f+=s[v+1].dist(s[v]));for(let v=t.segment||0;v>=0;v--)x[v]={x:s[v].x,y:s[v].y,tileUnitDistanceFromAnchor:y},v>0&&(y+=s[v-1].dist(s[v]));for(let v=0;v<s.length;v++){const S=x[v];this.lineVertexArray.emplaceBack(S.x,S.y,S.tileUnitDistanceFromAnchor)}}return{lineStartIndex:l,lineLength:this.lineVertexArray.length-l}}addSymbols(t,s,l,f,y,x,v,S,C,P,L,F){const $=t.indexArray,H=t.layoutVertexArray,q=t.segments.prepareSegment(4*s.length,H,$,this.canOverlap?x.sortKey:void 0),K=this.glyphOffsetArray.length,ie=q.vertexLength,ge=this.allowVerticalPlacement&&v===_.ah.vertical?Math.PI/2:0,le=x.text&&x.text.sections;for(let fe=0;fe<s.length;fe++){const{tl:we,tr:Ie,bl:qe,br:ct,tex:je,pixelOffsetTL:Ve,pixelOffsetBR:nt,minFontScaleX:Ke,minFontScaleY:Ge,glyphOffset:Te,isSDF:st,sectionIndex:it}=s[fe],yt=q.vertexLength,ci=Te[1];ad(H,S.x,S.y,we.x,ci+we.y,je.x,je.y,l,st,Ve.x,Ve.y,Ke,Ge),ad(H,S.x,S.y,Ie.x,ci+Ie.y,je.x+je.w,je.y,l,st,nt.x,Ve.y,Ke,Ge),ad(H,S.x,S.y,qe.x,ci+qe.y,je.x,je.y+je.h,l,st,Ve.x,nt.y,Ke,Ge),ad(H,S.x,S.y,ct.x,ci+ct.y,je.x+je.w,je.y+je.h,l,st,nt.x,nt.y,Ke,Ge),Uf(t.dynamicLayoutVertexArray,S,ge),$.emplaceBack(yt,yt+1,yt+2),$.emplaceBack(yt+1,yt+2,yt+3),q.vertexLength+=4,q.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Te[0]),fe!==s.length-1&&it===s[fe+1].sectionIndex||t.programConfigurations.populatePaintArrays(H.length,x,x.index,{},F,le&&le[it])}t.placedSymbolArray.emplaceBack(S.x,S.y,K,this.glyphOffsetArray.length-K,ie,C,P,S.segment,l?l[0]:0,l?l[1]:0,f[0],f[1],v,0,!1,0,L)}_addCollisionDebugVertex(t,s,l,f,y,x){return s.emplaceBack(0,0),t.emplaceBack(l.x,l.y,f,y,Math.round(x.x),Math.round(x.y))}addCollisionDebugVertices(t,s,l,f,y,x,v){const S=y.segments.prepareSegment(4,y.layoutVertexArray,y.indexArray),C=S.vertexLength,P=y.layoutVertexArray,L=y.collisionVertexArray,F=v.anchorX,$=v.anchorY;this._addCollisionDebugVertex(P,L,x,F,$,new R(t,s)),this._addCollisionDebugVertex(P,L,x,F,$,new R(l,s)),this._addCollisionDebugVertex(P,L,x,F,$,new R(l,f)),this._addCollisionDebugVertex(P,L,x,F,$,new R(t,f)),S.vertexLength+=4;const H=y.indexArray;H.emplaceBack(C,C+1),H.emplaceBack(C+1,C+2),H.emplaceBack(C+2,C+3),H.emplaceBack(C+3,C),S.primitiveLength+=4}addDebugCollisionBoxes(t,s,l,f){for(let y=t;y<s;y++){const x=this.collisionBoxArray.get(y);this.addCollisionDebugVertices(x.x1,x.y1,x.x2,x.y2,f?this.textCollisionBox:this.iconCollisionBox,x.anchorPoint,l)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new qf(Xn,c0.members,Zi),this.iconCollisionBox=new qf(Xn,c0.members,Zi);for(let t=0;t<this.symbolInstances.length;t++){const s=this.symbolInstances.get(t);this.addDebugCollisionBoxes(s.textBoxStartIndex,s.textBoxEndIndex,s,!0),this.addDebugCollisionBoxes(s.verticalTextBoxStartIndex,s.verticalTextBoxEndIndex,s,!0),this.addDebugCollisionBoxes(s.iconBoxStartIndex,s.iconBoxEndIndex,s,!1),this.addDebugCollisionBoxes(s.verticalIconBoxStartIndex,s.verticalIconBoxEndIndex,s,!1)}}_deserializeCollisionBoxesForSymbol(t,s,l,f,y,x,v,S,C){const P={};for(let L=s;L<l;L++){const F=t.get(L);P.textBox={x1:F.x1,y1:F.y1,x2:F.x2,y2:F.y2,anchorPointX:F.anchorPointX,anchorPointY:F.anchorPointY},P.textFeatureIndex=F.featureIndex;break}for(let L=f;L<y;L++){const F=t.get(L);P.verticalTextBox={x1:F.x1,y1:F.y1,x2:F.x2,y2:F.y2,anchorPointX:F.anchorPointX,anchorPointY:F.anchorPointY},P.verticalTextFeatureIndex=F.featureIndex;break}for(let L=x;L<v;L++){const F=t.get(L);P.iconBox={x1:F.x1,y1:F.y1,x2:F.x2,y2:F.y2,anchorPointX:F.anchorPointX,anchorPointY:F.anchorPointY},P.iconFeatureIndex=F.featureIndex;break}for(let L=S;L<C;L++){const F=t.get(L);P.verticalIconBox={x1:F.x1,y1:F.y1,x2:F.x2,y2:F.y2,anchorPointX:F.anchorPointX,anchorPointY:F.anchorPointY},P.verticalIconFeatureIndex=F.featureIndex;break}return P}deserializeCollisionBoxes(t){this.collisionArrays=[];for(let s=0;s<this.symbolInstances.length;s++){const l=this.symbolInstances.get(s);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,l.textBoxStartIndex,l.textBoxEndIndex,l.verticalTextBoxStartIndex,l.verticalTextBoxEndIndex,l.iconBoxStartIndex,l.iconBoxEndIndex,l.verticalIconBoxStartIndex,l.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(t,s){const l=t.placedSymbolArray.get(s),f=l.vertexStartIndex+4*l.numGlyphs;for(let y=l.vertexStartIndex;y<f;y+=4)t.indexArray.emplaceBack(y,y+1,y+2),t.indexArray.emplaceBack(y+1,y+2,y+3)}getSortedSymbolIndexes(t){if(this.sortedAngle===t&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;const s=Math.sin(t),l=Math.cos(t),f=[],y=[],x=[];for(let v=0;v<this.symbolInstances.length;++v){x.push(v);const S=this.symbolInstances.get(v);f.push(0|Math.round(s*S.anchorX+l*S.anchorY)),y.push(S.featureIndex)}return x.sort((v,S)=>f[v]-f[S]||y[S]-y[v]),x}addToSortKeyRanges(t,s){const l=this.sortKeyRanges[this.sortKeyRanges.length-1];l&&l.sortKey===s?l.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:s,symbolInstanceStart:t,symbolInstanceEnd:t+1})}sortFeatures(t){if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const s of this.symbolInstanceIndexes){const l=this.symbolInstances.get(s);this.featureSortOrder.push(l.featureIndex),[l.rightJustifiedTextSymbolIndex,l.centerJustifiedTextSymbolIndex,l.leftJustifiedTextSymbolIndex].forEach((f,y,x)=>{f>=0&&x.indexOf(f)===y&&this.addIndicesForPlacedSymbol(this.text,f)}),l.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,l.verticalPlacedTextSymbolIndex),l.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.placedIconSymbolIndex),l.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,l.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}let C0,M0;Xe("SymbolBucket",Ll,{omit:["layers","collisionBoxArray","features","compareText"]}),Ll.MAX_GLYPHS=65535,Ll.addDynamicAttributes=Uf;var Zf={get paint(){return M0=M0||new g({"icon-opacity":new ht(xe.paint_symbol["icon-opacity"]),"icon-color":new ht(xe.paint_symbol["icon-color"]),"icon-halo-color":new ht(xe.paint_symbol["icon-halo-color"]),"icon-halo-width":new ht(xe.paint_symbol["icon-halo-width"]),"icon-halo-blur":new ht(xe.paint_symbol["icon-halo-blur"]),"icon-translate":new et(xe.paint_symbol["icon-translate"]),"icon-translate-anchor":new et(xe.paint_symbol["icon-translate-anchor"]),"text-opacity":new ht(xe.paint_symbol["text-opacity"]),"text-color":new ht(xe.paint_symbol["text-color"],{runtimeType:fn,getOverride:r=>r.textColor,hasOverride:r=>!!r.textColor}),"text-halo-color":new ht(xe.paint_symbol["text-halo-color"]),"text-halo-width":new ht(xe.paint_symbol["text-halo-width"]),"text-halo-blur":new ht(xe.paint_symbol["text-halo-blur"]),"text-translate":new et(xe.paint_symbol["text-translate"]),"text-translate-anchor":new et(xe.paint_symbol["text-translate-anchor"])})},get layout(){return C0=C0||new g({"symbol-placement":new et(xe.layout_symbol["symbol-placement"]),"symbol-spacing":new et(xe.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new et(xe.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new ht(xe.layout_symbol["symbol-sort-key"]),"symbol-z-order":new et(xe.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new et(xe.layout_symbol["icon-allow-overlap"]),"icon-overlap":new et(xe.layout_symbol["icon-overlap"]),"icon-ignore-placement":new et(xe.layout_symbol["icon-ignore-placement"]),"icon-optional":new et(xe.layout_symbol["icon-optional"]),"icon-rotation-alignment":new et(xe.layout_symbol["icon-rotation-alignment"]),"icon-size":new ht(xe.layout_symbol["icon-size"]),"icon-text-fit":new et(xe.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new et(xe.layout_symbol["icon-text-fit-padding"]),"icon-image":new ht(xe.layout_symbol["icon-image"]),"icon-rotate":new ht(xe.layout_symbol["icon-rotate"]),"icon-padding":new ht(xe.layout_symbol["icon-padding"]),"icon-keep-upright":new et(xe.layout_symbol["icon-keep-upright"]),"icon-offset":new ht(xe.layout_symbol["icon-offset"]),"icon-anchor":new ht(xe.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new et(xe.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new et(xe.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new et(xe.layout_symbol["text-rotation-alignment"]),"text-field":new ht(xe.layout_symbol["text-field"]),"text-font":new ht(xe.layout_symbol["text-font"]),"text-size":new ht(xe.layout_symbol["text-size"]),"text-max-width":new ht(xe.layout_symbol["text-max-width"]),"text-line-height":new et(xe.layout_symbol["text-line-height"]),"text-letter-spacing":new ht(xe.layout_symbol["text-letter-spacing"]),"text-justify":new ht(xe.layout_symbol["text-justify"]),"text-radial-offset":new ht(xe.layout_symbol["text-radial-offset"]),"text-variable-anchor":new et(xe.layout_symbol["text-variable-anchor"]),"text-variable-anchor-offset":new ht(xe.layout_symbol["text-variable-anchor-offset"]),"text-anchor":new ht(xe.layout_symbol["text-anchor"]),"text-max-angle":new et(xe.layout_symbol["text-max-angle"]),"text-writing-mode":new et(xe.layout_symbol["text-writing-mode"]),"text-rotate":new ht(xe.layout_symbol["text-rotate"]),"text-padding":new et(xe.layout_symbol["text-padding"]),"text-keep-upright":new et(xe.layout_symbol["text-keep-upright"]),"text-transform":new ht(xe.layout_symbol["text-transform"]),"text-offset":new ht(xe.layout_symbol["text-offset"]),"text-allow-overlap":new et(xe.layout_symbol["text-allow-overlap"]),"text-overlap":new et(xe.layout_symbol["text-overlap"]),"text-ignore-placement":new et(xe.layout_symbol["text-ignore-placement"]),"text-optional":new et(xe.layout_symbol["text-optional"])})}};class P0{constructor(t){if(t.property.overrides===void 0)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=t.property.overrides?t.property.overrides.runtimeType:ns,this.defaultValue=t}evaluate(t){if(t.formattedSection){const s=this.defaultValue.property.overrides;if(s&&s.hasOverride(t.formattedSection))return s.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default}eachChild(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}Xe("FormatSectionOverride",P0,{omit:["defaultValue"]});class ld extends a{constructor(t){super(t,Zf)}recalculate(t,s){if(super.recalculate(t,s),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 l=this.layout.get("text-writing-mode");if(l){const f=[];for(const y of l)f.indexOf(y)<0&&f.push(y);this.layout._values["text-writing-mode"]=f}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(t,s,l,f){const y=this.layout.get(t).evaluate(s,{},l,f),x=this._unevaluatedLayout._values[t];return x.isDataDriven()||ll(x.value)||!y?y:function(v,S){return S.replace(/{([^{}]+)}/g,(C,P)=>v&&P in v?String(v[P]):"")}(s.properties,y)}createBucket(t){return new Ll(t)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const t of Zf.paint.overridableProperties){if(!ld.hasPaintOverride(this.layout,t))continue;const s=this.paint.get(t),l=new P0(s),f=new al(l,s.property.specification);let y=null;y=s.value.kind==="constant"||s.value.kind==="source"?new uo("source",f):new po("composite",f,s.value.zoomStops),this.paint._values[t]=new Ar(s.property,y,s.parameters)}}_handleOverridablePaintPropertyUpdate(t,s,l){return!(!this.layout||s.isDataDriven()||l.isDataDriven())&&ld.hasPaintOverride(this.layout,t)}static hasPaintOverride(t,s){const l=t.get("text-field"),f=Zf.paint.properties[s];let y=!1;const x=v=>{for(const S of v)if(f.overrides&&f.overrides.hasOverride(S))return void(y=!0)};if(l.value.kind==="constant"&&l.value.value instanceof Mn)x(l.value.value.sections);else if(l.value.kind==="source"){const v=C=>{y||(C instanceof nr&&zi(C.value)===jr?x(C.value.sections):C instanceof Ja?x(C.sections):C.eachChild(v))},S=l.value;S._styleExpression&&v(S._styleExpression.expression)}return y}}let I0;var VI={get paint(){return I0=I0||new g({"background-color":new et(xe.paint_background["background-color"]),"background-pattern":new vl(xe.paint_background["background-pattern"]),"background-opacity":new et(xe.paint_background["background-opacity"])})}};class $I extends a{constructor(t){super(t,VI)}}let A0;var jI={get paint(){return A0=A0||new g({"raster-opacity":new et(xe.paint_raster["raster-opacity"]),"raster-hue-rotate":new et(xe.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new et(xe.paint_raster["raster-brightness-min"]),"raster-brightness-max":new et(xe.paint_raster["raster-brightness-max"]),"raster-saturation":new et(xe.paint_raster["raster-saturation"]),"raster-contrast":new et(xe.paint_raster["raster-contrast"]),"raster-resampling":new et(xe.paint_raster["raster-resampling"]),"raster-fade-duration":new et(xe.paint_raster["raster-fade-duration"])})}};class UI extends a{constructor(t){super(t,jI)}}class HI extends a{constructor(t){super(t,{}),this.onAdd=s=>{this.implementation.onAdd&&this.implementation.onAdd(s,s.painter.context.gl)},this.onRemove=s=>{this.implementation.onRemove&&this.implementation.onRemove(s,s.painter.context.gl)},this.implementation=t}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 qI{constructor(t){this._methodToThrottle=t,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 Wf=63710088e-1;class Ao{constructor(t,s){if(isNaN(t)||isNaN(s))throw new Error(`Invalid LngLat object: (${t}, ${s})`);if(this.lng=+t,this.lat=+s,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Ao(mt(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(t){const s=Math.PI/180,l=this.lat*s,f=t.lat*s,y=Math.sin(l)*Math.sin(f)+Math.cos(l)*Math.cos(f)*Math.cos((t.lng-this.lng)*s);return Wf*Math.acos(Math.min(y,1))}static convert(t){if(t instanceof Ao)return t;if(Array.isArray(t)&&(t.length===2||t.length===3))return new Ao(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&typeof t=="object"&&t!==null)return new Ao(Number("lng"in t?t.lng:t.lon),Number(t.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}const D0=2*Math.PI*Wf;function z0(r){return D0*Math.cos(r*Math.PI/180)}function R0(r){return(180+r)/360}function L0(r){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360}function O0(r,t){return r/z0(t)}function Gf(r){return 360/Math.PI*Math.atan(Math.exp((180-360*r)*Math.PI/180))-90}class dh{constructor(t,s,l=0){this.x=+t,this.y=+s,this.z=+l}static fromLngLat(t,s=0){const l=Ao.convert(t);return new dh(R0(l.lng),L0(l.lat),O0(s,l.lat))}toLngLat(){return new Ao(360*this.x-180,Gf(this.y))}toAltitude(){return this.z*z0(Gf(this.y))}meterInMercatorCoordinateUnits(){return 1/D0*(t=Gf(this.y),1/Math.cos(t*Math.PI/180));var t}}function B0(r,t,s){var l=2*Math.PI*6378137/256/Math.pow(2,s);return[r*l-2*Math.PI*6378137/2,t*l-2*Math.PI*6378137/2]}class Yf{constructor(t,s,l){if(!function(f,y,x){return!(f<0||f>25||x<0||x>=Math.pow(2,f)||y<0||y>=Math.pow(2,f))}(t,s,l))throw new Error(`x=${s}, y=${l}, z=${t} outside of bounds. 0<=x<${Math.pow(2,t)}, 0<=y<${Math.pow(2,t)} 0<=z<=25 `);this.z=t,this.x=s,this.y=l,this.key=ph(0,t,t,s,l)}equals(t){return this.z===t.z&&this.x===t.x&&this.y===t.y}url(t,s,l){const f=(x=this.y,v=this.z,S=B0(256*(y=this.x),256*(x=Math.pow(2,v)-x-1),v),C=B0(256*(y+1),256*(x+1),v),S[0]+","+S[1]+","+C[0]+","+C[1]);var y,x,v,S,C;const P=function(L,F,$){let H,q="";for(let K=L;K>0;K--)H=1<<K-1,q+=(F&H?1:0)+($&H?2:0);return q}(this.z,this.x,this.y);return t[(this.x+this.y)%t.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String(l==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,s>1?"@2x":"").replace(/{quadkey}/g,P).replace(/{bbox-epsg-3857}/g,f)}isChildOf(t){const s=this.z-t.z;return s>0&&t.x===this.x>>s&&t.y===this.y>>s}getTilePoint(t){const s=Math.pow(2,this.z);return new R((t.x*s-this.x)*Ri,(t.y*s-this.y)*Ri)}toString(){return`${this.z}/${this.x}/${this.y}`}}class F0{constructor(t,s){this.wrap=t,this.canonical=s,this.key=ph(t,s.z,s.z,s.x,s.y)}}class ur{constructor(t,s,l,f,y){if(t<l)throw new Error(`overscaledZ should be >= z; overscaledZ = ${t}; z = ${l}`);this.overscaledZ=t,this.wrap=s,this.canonical=new Yf(l,+f,+y),this.key=ph(s,t,l,f,y)}clone(){return new ur(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)}scaledTo(t){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const s=this.canonical.z-t;return t>this.canonical.z?new ur(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new ur(t,this.wrap,t,this.canonical.x>>s,this.canonical.y>>s)}calculateScaledKey(t,s){if(t>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${t}; overscaledZ = ${this.overscaledZ}`);const l=this.canonical.z-t;return t>this.canonical.z?ph(this.wrap*+s,t,this.canonical.z,this.canonical.x,this.canonical.y):ph(this.wrap*+s,t,t,this.canonical.x>>l,this.canonical.y>>l)}isChildOf(t){if(t.wrap!==this.wrap)return!1;const s=this.canonical.z-t.canonical.z;return t.overscaledZ===0||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>s&&t.canonical.y===this.canonical.y>>s}children(t){if(this.overscaledZ>=t)return[new ur(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const s=this.canonical.z+1,l=2*this.canonical.x,f=2*this.canonical.y;return[new ur(s,this.wrap,s,l,f),new ur(s,this.wrap,s,l+1,f),new ur(s,this.wrap,s,l,f+1),new ur(s,this.wrap,s,l+1,f+1)]}isLessThan(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))}wrapped(){return new ur(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(t){return new ur(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new F0(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(t){return this.canonical.getTilePoint(new dh(t.x-this.wrap,t.y))}}function ph(r,t,s,l,f){(r*=2)<0&&(r=-1*r-1);const y=1<<s;return(y*y*r+y*f+l).toString(36)+s.toString(36)+t.toString(36)}Xe("CanonicalTileID",Yf),Xe("OverscaledTileID",ur,{omit:["posMatrix"]});class N0{constructor(t,s,l,f=1,y=1,x=1,v=0){if(this.uid=t,s.height!==s.width)throw new RangeError("DEM tiles must be square");if(l&&!["mapbox","terrarium","custom"].includes(l))return void zt(`"${l}" is not a valid encoding type. Valid types include "mapbox", "terrarium" and "custom".`);this.stride=s.height;const S=this.dim=s.height-2;switch(this.data=new Uint32Array(s.data.buffer),l){case"terrarium":this.redFactor=256,this.greenFactor=1,this.blueFactor=1/256,this.baseShift=32768;break;case"custom":this.redFactor=f,this.greenFactor=y,this.blueFactor=x,this.baseShift=v;break;default:this.redFactor=6553.6,this.greenFactor=25.6,this.blueFactor=.1,this.baseShift=1e4}for(let C=0;C<S;C++)this.data[this._idx(-1,C)]=this.data[this._idx(0,C)],this.data[this._idx(S,C)]=this.data[this._idx(S-1,C)],this.data[this._idx(C,-1)]=this.data[this._idx(C,0)],this.data[this._idx(C,S)]=this.data[this._idx(C,S-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(S,-1)]=this.data[this._idx(S-1,0)],this.data[this._idx(-1,S)]=this.data[this._idx(0,S-1)],this.data[this._idx(S,S)]=this.data[this._idx(S-1,S-1)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let C=0;C<S;C++)for(let P=0;P<S;P++){const L=this.get(C,P);L>this.max&&(this.max=L),L<this.min&&(this.min=L)}}get(t,s){const l=new Uint8Array(this.data.buffer),f=4*this._idx(t,s);return this.unpack(l[f],l[f+1],l[f+2])}getUnpackVector(){return[this.redFactor,this.greenFactor,this.blueFactor,this.baseShift]}_idx(t,s){if(t<-1||t>=this.dim+1||s<-1||s>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(s+1)*this.stride+(t+1)}unpack(t,s,l){return t*this.redFactor+s*this.greenFactor+l*this.blueFactor-this.baseShift}getPixels(){return new hr({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(t,s,l){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");let f=s*this.dim,y=s*this.dim+this.dim,x=l*this.dim,v=l*this.dim+this.dim;switch(s){case-1:f=y-1;break;case 1:y=f+1}switch(l){case-1:x=v-1;break;case 1:v=x+1}const S=-s*this.dim,C=-l*this.dim;for(let P=x;P<v;P++)for(let L=f;L<y;L++)this.data[this._idx(L,P)]=t.data[this._idx(L+S,P+C)]}}Xe("DEMData",N0);class V0{constructor(t){this._stringToNumber={},this._numberToString=[];for(let s=0;s<t.length;s++){const l=t[s];this._stringToNumber[l]=s,this._numberToString[s]=l}}encode(t){return this._stringToNumber[t]}decode(t){if(t>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${t} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[t]}}class $0{constructor(t,s,l,f,y){this.type="Feature",this._vectorTileFeature=t,t._z=s,t._x=l,t._y=f,this.properties=t.properties,this.id=y}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(t){this._geometry=t}toJSON(){const t={geometry:this.geometry};for(const s in this)s!=="_geometry"&&s!=="_vectorTileFeature"&&(t[s]=this[s]);return t}}class j0{constructor(t,s){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new yo(Ri,16,0),this.grid3D=new yo(Ri,16,0),this.featureIndexArray=new ln,this.promoteId=s}insert(t,s,l,f,y,x){const v=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(l,f,y);const S=x?this.grid3D:this.grid;for(let C=0;C<s.length;C++){const P=s[C],L=[1/0,1/0,-1/0,-1/0];for(let F=0;F<P.length;F++){const $=P[F];L[0]=Math.min(L[0],$.x),L[1]=Math.min(L[1],$.y),L[2]=Math.max(L[2],$.x),L[3]=Math.max(L[3],$.y)}L[0]<Ri&&L[1]<Ri&&L[2]>=0&&L[3]>=0&&S.insert(v,L[0],L[1],L[2],L[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new Mo.VectorTile(new Bf(this.rawTileData)).layers,this.sourceLayerCoder=new V0(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(t,s,l,f){this.loadVTLayers();const y=t.params||{},x=Ri/t.tileSize/t.scale,v=Dc(y.filter),S=t.queryGeometry,C=t.queryPadding*x,P=H0(S),L=this.grid.query(P.minX-C,P.minY-C,P.maxX+C,P.maxY+C),F=H0(t.cameraQueryGeometry),$=this.grid3D.query(F.minX-C,F.minY-C,F.maxX+C,F.maxY+C,(K,ie,ge,le)=>function(fe,we,Ie,qe,ct){for(const Ve of fe)if(we<=Ve.x&&Ie<=Ve.y&&qe>=Ve.x&&ct>=Ve.y)return!0;const je=[new R(we,Ie),new R(we,ct),new R(qe,ct),new R(qe,Ie)];if(fe.length>2){for(const Ve of je)if(Ml(fe,Ve))return!0}for(let Ve=0;Ve<fe.length-1;Ve++)if(EP(fe[Ve],fe[Ve+1],je))return!0;return!1}(t.cameraQueryGeometry,K-C,ie-C,ge+C,le+C));for(const K of $)L.push(K);L.sort(ZI);const H={};let q;for(let K=0;K<L.length;K++){const ie=L[K];if(ie===q)continue;q=ie;const ge=this.featureIndexArray.get(ie);let le=null;this.loadMatchingFeature(H,ge.bucketIndex,ge.sourceLayerIndex,ge.featureIndex,v,y.layers,y.availableImages,s,l,f,(fe,we,Ie)=>(le||(le=xa(fe)),we.queryIntersectsFeature(S,fe,Ie,le,this.z,t.transform,x,t.pixelPosMatrix)))}return H}loadMatchingFeature(t,s,l,f,y,x,v,S,C,P,L){const F=this.bucketLayerIDs[s];if(x&&!function(K,ie){for(let ge=0;ge<K.length;ge++)if(ie.indexOf(K[ge])>=0)return!0;return!1}(x,F))return;const $=this.sourceLayerCoder.decode(l),H=this.vtLayers[$].feature(f);if(y.needGeometry){const K=ba(H,!0);if(!y.filter(new fi(this.tileID.overscaledZ),K,this.tileID.canonical))return}else if(!y.filter(new fi(this.tileID.overscaledZ),H))return;const q=this.getId(H,$);for(let K=0;K<F.length;K++){const ie=F[K];if(x&&x.indexOf(ie)<0)continue;const ge=S[ie];if(!ge)continue;let le={};q&&P&&(le=P.getState(ge.sourceLayer||"_geojsonTileLayer",q));const fe=Ae({},C[ie]);fe.paint=U0(fe.paint,ge.paint,H,le,v),fe.layout=U0(fe.layout,ge.layout,H,le,v);const we=!L||L(H,ge,le);if(!we)continue;const Ie=new $0(H,this.z,this.x,this.y,q);Ie.layer=fe;let qe=t[ie];qe===void 0&&(qe=t[ie]=[]),qe.push({featureIndex:f,feature:Ie,intersectionZ:we})}}lookupSymbolFeatures(t,s,l,f,y,x,v,S){const C={};this.loadVTLayers();const P=Dc(y);for(const L of t)this.loadMatchingFeature(C,l,f,L,P,x,v,S,s);return C}hasLayer(t){for(const s of this.bucketLayerIDs)for(const l of s)if(t===l)return!0;return!1}getId(t,s){let l=t.id;return this.promoteId&&(l=t.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[s]],typeof l=="boolean"&&(l=Number(l))),l}}function U0(r,t,s,l,f){return wt(r,(y,x)=>{const v=t instanceof ma?t.get(x):null;return v&&v.evaluate?v.evaluate(s,l,f):v})}function H0(r){let t=1/0,s=1/0,l=-1/0,f=-1/0;for(const y of r)t=Math.min(t,y.x),s=Math.min(s,y.y),l=Math.max(l,y.x),f=Math.max(f,y.y);return{minX:t,minY:s,maxX:l,maxY:f}}function ZI(r,t){return t-r}function q0(r,t,s,l,f){const y=[];for(let x=0;x<r.length;x++){const v=r[x];let S;for(let C=0;C<v.length-1;C++){let P=v[C],L=v[C+1];P.x<t&&L.x<t||(P.x<t?P=new R(t,P.y+(t-P.x)/(L.x-P.x)*(L.y-P.y))._round():L.x<t&&(L=new R(t,P.y+(t-P.x)/(L.x-P.x)*(L.y-P.y))._round()),P.y<s&&L.y<s||(P.y<s?P=new R(P.x+(s-P.y)/(L.y-P.y)*(L.x-P.x),s)._round():L.y<s&&(L=new R(P.x+(s-P.y)/(L.y-P.y)*(L.x-P.x),s)._round()),P.x>=l&&L.x>=l||(P.x>=l?P=new R(l,P.y+(l-P.x)/(L.x-P.x)*(L.y-P.y))._round():L.x>=l&&(L=new R(l,P.y+(l-P.x)/(L.x-P.x)*(L.y-P.y))._round()),P.y>=f&&L.y>=f||(P.y>=f?P=new R(P.x+(f-P.y)/(L.y-P.y)*(L.x-P.x),f)._round():L.y>=f&&(L=new R(P.x+(f-P.y)/(L.y-P.y)*(L.x-P.x),f)._round()),S&&P.equals(S[S.length-1])||(S=[P],y.push(S)),S.push(L)))))}}return y}Xe("FeatureIndex",j0,{omit:["rawTileData","sourceLayerCoder"]});class Do extends R{constructor(t,s,l,f){super(t,s),this.angle=l,f!==void 0&&(this.segment=f)}clone(){return new Do(this.x,this.y,this.angle,this.segment)}}function Z0(r,t,s,l,f){if(t.segment===void 0||s===0)return!0;let y=t,x=t.segment+1,v=0;for(;v>-s/2;){if(x--,x<0)return!1;v-=r[x].dist(y),y=r[x]}v+=r[x].dist(r[x+1]),x++;const S=[];let C=0;for(;v<s/2;){const P=r[x],L=r[x+1];if(!L)return!1;let F=r[x-1].angleTo(P)-P.angleTo(L);for(F=Math.abs((F+3*Math.PI)%(2*Math.PI)-Math.PI),S.push({distance:v,angleDelta:F}),C+=F;v-S[0].distance>l;)C-=S.shift().angleDelta;if(C>f)return!1;x++,v+=P.dist(L)}return!0}function W0(r){let t=0;for(let s=0;s<r.length-1;s++)t+=r[s].dist(r[s+1]);return t}function G0(r,t,s){return r?.6*t*s:0}function Y0(r,t){return Math.max(r?r.right-r.left:0,t?t.right-t.left:0)}function WI(r,t,s,l,f,y){const x=G0(s,f,y),v=Y0(s,l)*y;let S=0;const C=W0(r)/2;for(let P=0;P<r.length-1;P++){const L=r[P],F=r[P+1],$=L.dist(F);if(S+$>C){const H=(C-S)/$,q=mn.number(L.x,F.x,H),K=mn.number(L.y,F.y,H),ie=new Do(q,K,F.angleTo(L),P);return ie._round(),!x||Z0(r,ie,v,x,t)?ie:void 0}S+=$}}function GI(r,t,s,l,f,y,x,v,S){const C=G0(l,y,x),P=Y0(l,f),L=P*x,F=r[0].x===0||r[0].x===S||r[0].y===0||r[0].y===S;return t-L<t/4&&(t=L+t/4),X0(r,F?t/2*v%t:(P/2+2*y)*x*v%t,t,C,s,L,F,!1,S)}function X0(r,t,s,l,f,y,x,v,S){const C=y/2,P=W0(r);let L=0,F=t-s,$=[];for(let H=0;H<r.length-1;H++){const q=r[H],K=r[H+1],ie=q.dist(K),ge=K.angleTo(q);for(;F+s<L+ie;){F+=s;const le=(F-L)/ie,fe=mn.number(q.x,K.x,le),we=mn.number(q.y,K.y,le);if(fe>=0&&fe<S&&we>=0&&we<S&&F-C>=0&&F+C<=P){const Ie=new Do(fe,we,ge,H);Ie._round(),l&&!Z0(r,Ie,y,l,f)||$.push(Ie)}}L+=ie}return v||$.length||x||($=X0(r,L/2,s,l,f,y,x,!0,S)),$}Xe("Anchor",Do);const Ol=Rn;function K0(r,t,s,l){const f=[],y=r.image,x=y.pixelRatio,v=y.paddedRect.w-2*Ol,S=y.paddedRect.h-2*Ol;let C={x1:r.left,y1:r.top,x2:r.right,y2:r.bottom};const P=y.stretchX||[[0,v]],L=y.stretchY||[[0,S]],F=(Te,st)=>Te+st[1]-st[0],$=P.reduce(F,0),H=L.reduce(F,0),q=v-$,K=S-H;let ie=0,ge=$,le=0,fe=H,we=0,Ie=q,qe=0,ct=K;if(y.content&&l){const Te=y.content,st=Te[2]-Te[0],it=Te[3]-Te[1];(y.textFitWidth||y.textFitHeight)&&(C=k0(r)),ie=cd(P,0,Te[0]),le=cd(L,0,Te[1]),ge=cd(P,Te[0],Te[2]),fe=cd(L,Te[1],Te[3]),we=Te[0]-ie,qe=Te[1]-le,Ie=st-ge,ct=it-fe}const je=C.x1,Ve=C.y1,nt=C.x2-je,Ke=C.y2-Ve,Ge=(Te,st,it,yt)=>{const ci=hd(Te.stretch-ie,ge,nt,je),ai=ud(Te.fixed-we,Ie,Te.stretch,$),Ni=hd(st.stretch-le,fe,Ke,Ve),zr=ud(st.fixed-qe,ct,st.stretch,H),en=hd(it.stretch-ie,ge,nt,je),Vi=ud(it.fixed-we,Ie,it.stretch,$),xn=hd(yt.stretch-le,fe,Ke,Ve),bn=ud(yt.fixed-qe,ct,yt.stretch,H),vn=new R(ci,Ni),Pi=new R(en,Ni),$i=new R(en,xn),hn=new R(ci,xn),tn=new R(ai/x,zr/x),wn=new R(Vi/x,bn/x),nn=t*Math.PI/180;if(nn){const Zt=Math.sin(nn),ui=Math.cos(nn),_i=[ui,-Zt,Zt,ui];vn._matMult(_i),Pi._matMult(_i),hn._matMult(_i),$i._matMult(_i)}const dr=Te.stretch+Te.fixed,Ln=st.stretch+st.fixed;return{tl:vn,tr:Pi,bl:hn,br:$i,tex:{x:y.paddedRect.x+Ol+dr,y:y.paddedRect.y+Ol+Ln,w:it.stretch+it.fixed-dr,h:yt.stretch+yt.fixed-Ln},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:tn,pixelOffsetBR:wn,minFontScaleX:Ie/x/nt,minFontScaleY:ct/x/Ke,isSDF:s}};if(l&&(y.stretchX||y.stretchY)){const Te=J0(P,q,$),st=J0(L,K,H);for(let it=0;it<Te.length-1;it++){const yt=Te[it],ci=Te[it+1];for(let ai=0;ai<st.length-1;ai++)f.push(Ge(yt,st[ai],ci,st[ai+1]))}}else f.push(Ge({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:S+1}));return f}function cd(r,t,s){let l=0;for(const f of r)l+=Math.max(t,Math.min(s,f[1]))-Math.max(t,Math.min(s,f[0]));return l}function J0(r,t,s){const l=[{fixed:-Ol,stretch:0}];for(const[f,y]of r){const x=l[l.length-1];l.push({fixed:f-x.stretch,stretch:x.stretch}),l.push({fixed:f-x.stretch,stretch:x.stretch+(y-f)})}return l.push({fixed:t+Ol,stretch:s}),l}function hd(r,t,s,l){return r/t*s+l}function ud(r,t,s,l){return r-t*s/l}class dd{constructor(t,s,l,f,y,x,v,S,C,P){var L;if(this.boxStartIndex=t.length,C){let F=x.top,$=x.bottom;const H=x.collisionPadding;H&&(F-=H[1],$+=H[3]);let q=$-F;q>0&&(q=Math.max(10,q),this.circleDiameter=q)}else{const F=!((L=x.image)===null||L===void 0)&&L.content&&(x.image.textFitWidth||x.image.textFitHeight)?k0(x):{x1:x.left,y1:x.top,x2:x.right,y2:x.bottom};F.y1=F.y1*v-S[0],F.y2=F.y2*v+S[2],F.x1=F.x1*v-S[3],F.x2=F.x2*v+S[1];const $=x.collisionPadding;if($&&(F.x1-=$[0]*v,F.y1-=$[1]*v,F.x2+=$[2]*v,F.y2+=$[3]*v),P){const H=new R(F.x1,F.y1),q=new R(F.x2,F.y1),K=new R(F.x1,F.y2),ie=new R(F.x2,F.y2),ge=P*Math.PI/180;H._rotate(ge),q._rotate(ge),K._rotate(ge),ie._rotate(ge),F.x1=Math.min(H.x,q.x,K.x,ie.x),F.x2=Math.max(H.x,q.x,K.x,ie.x),F.y1=Math.min(H.y,q.y,K.y,ie.y),F.y2=Math.max(H.y,q.y,K.y,ie.y)}t.emplaceBack(s.x,s.y,F.x1,F.y1,F.x2,F.y2,l,f,y)}this.boxEndIndex=t.length}}class YI{constructor(t=[],s=(l,f)=>l<f?-1:l>f?1:0){if(this.data=t,this.length=this.data.length,this.compare=s,this.length>0)for(let l=(this.length>>1)-1;l>=0;l--)this._down(l)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(this.length===0)return;const t=this.data[0],s=this.data.pop();return--this.length>0&&(this.data[0]=s,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:s,compare:l}=this,f=s[t];for(;t>0;){const y=t-1>>1,x=s[y];if(l(f,x)>=0)break;s[t]=x,t=y}s[t]=f}_down(t){const{data:s,compare:l}=this,f=this.length>>1,y=s[t];for(;t<f;){let x=1+(t<<1);const v=x+1;if(v<this.length&&l(s[v],s[x])<0&&(x=v),l(s[x],y)>=0)break;s[t]=s[x],t=x}s[t]=y}}function XI(r,t=1,s=!1){let l=1/0,f=1/0,y=-1/0,x=-1/0;const v=r[0];for(let $=0;$<v.length;$++){const H=v[$];(!$||H.x<l)&&(l=H.x),(!$||H.y<f)&&(f=H.y),(!$||H.x>y)&&(y=H.x),(!$||H.y>x)&&(x=H.y)}const S=Math.min(y-l,x-f);let C=S/2;const P=new YI([],KI);if(S===0)return new R(l,f);for(let $=l;$<y;$+=S)for(let H=f;H<x;H+=S)P.push(new Bl($+C,H+C,C,r));let L=function($){let H=0,q=0,K=0;const ie=$[0];for(let ge=0,le=ie.length,fe=le-1;ge<le;fe=ge++){const we=ie[ge],Ie=ie[fe],qe=we.x*Ie.y-Ie.x*we.y;q+=(we.x+Ie.x)*qe,K+=(we.y+Ie.y)*qe,H+=3*qe}return new Bl(q/H,K/H,0,$)}(r),F=P.length;for(;P.length;){const $=P.pop();($.d>L.d||!L.d)&&(L=$,s&&console.log("found best %d after %d probes",Math.round(1e4*$.d)/1e4,F)),$.max-L.d<=t||(C=$.h/2,P.push(new Bl($.p.x-C,$.p.y-C,C,r)),P.push(new Bl($.p.x+C,$.p.y-C,C,r)),P.push(new Bl($.p.x-C,$.p.y+C,C,r)),P.push(new Bl($.p.x+C,$.p.y+C,C,r)),F+=4)}return s&&(console.log(`num probes: ${F}`),console.log(`best distance: ${L.d}`)),L.p}function KI(r,t){return t.max-r.max}function Bl(r,t,s,l){this.p=new R(r,t),this.h=s,this.d=function(f,y){let x=!1,v=1/0;for(let S=0;S<y.length;S++){const C=y[S];for(let P=0,L=C.length,F=L-1;P<L;F=P++){const $=C[P],H=C[F];$.y>f.y!=H.y>f.y&&f.x<(H.x-$.x)*(f.y-$.y)/(H.y-$.y)+$.x&&(x=!x),v=Math.min(v,L_(f,$,H))}}return(x?1:-1)*Math.sqrt(v)}(this.p,l),this.max=this.d+this.h*Math.SQRT2}var Qi;_.aq=void 0,(Qi=_.aq||(_.aq={}))[Qi.center=1]="center",Qi[Qi.left=2]="left",Qi[Qi.right=3]="right",Qi[Qi.top=4]="top",Qi[Qi.bottom=5]="bottom",Qi[Qi["top-left"]=6]="top-left",Qi[Qi["top-right"]=7]="top-right",Qi[Qi["bottom-left"]=8]="bottom-left",Qi[Qi["bottom-right"]=9]="bottom-right";const zo=7,Xf=Number.POSITIVE_INFINITY;function Q0(r,t){return t[1]!==Xf?function(s,l,f){let y=0,x=0;switch(l=Math.abs(l),f=Math.abs(f),s){case"top-right":case"top-left":case"top":x=f-zo;break;case"bottom-right":case"bottom-left":case"bottom":x=-f+zo}switch(s){case"top-right":case"bottom-right":case"right":y=-l;break;case"top-left":case"bottom-left":case"left":y=l}return[y,x]}(r,t[0],t[1]):function(s,l){let f=0,y=0;l<0&&(l=0);const x=l/Math.SQRT2;switch(s){case"top-right":case"top-left":y=x-zo;break;case"bottom-right":case"bottom-left":y=-x+zo;break;case"bottom":y=-l+zo;break;case"top":y=l-zo}switch(s){case"top-right":case"bottom-right":f=-x;break;case"top-left":case"bottom-left":f=x;break;case"left":f=l;break;case"right":f=-l}return[f,y]}(r,t[0])}function ex(r,t,s){var l;const f=r.layout,y=(l=f.get("text-variable-anchor-offset"))===null||l===void 0?void 0:l.evaluate(t,{},s);if(y){const v=y.values,S=[];for(let C=0;C<v.length;C+=2){const P=S[C]=v[C],L=v[C+1].map(F=>F*Oi);P.startsWith("top")?L[1]-=zo:P.startsWith("bottom")&&(L[1]+=zo),S[C+1]=L}return new Hn(S)}const x=f.get("text-variable-anchor");if(x){let v;v=r._unevaluatedLayout.getValue("text-radial-offset")!==void 0?[f.get("text-radial-offset").evaluate(t,{},s)*Oi,Xf]:f.get("text-offset").evaluate(t,{},s).map(C=>C*Oi);const S=[];for(const C of x)S.push(C,Q0(C,v));return new Hn(S)}return null}function Kf(r){switch(r){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function JI(r,t,s,l,f,y,x,v,S,C,P){let L=y.textMaxSize.evaluate(t,{});L===void 0&&(L=x);const F=r.layers[0].layout,$=F.get("icon-offset").evaluate(t,{},P),H=ix(s.horizontal),q=x/24,K=r.tilePixelRatio*q,ie=r.tilePixelRatio*L/24,ge=r.tilePixelRatio*v,le=r.tilePixelRatio*F.get("symbol-spacing"),fe=F.get("text-padding")*r.tilePixelRatio,we=function(Te,st,it,yt=1){const ci=Te.get("icon-padding").evaluate(st,{},it),ai=ci&&ci.values;return[ai[0]*yt,ai[1]*yt,ai[2]*yt,ai[3]*yt]}(F,t,P,r.tilePixelRatio),Ie=F.get("text-max-angle")/180*Math.PI,qe=F.get("text-rotation-alignment")!=="viewport"&&F.get("symbol-placement")!=="point",ct=F.get("icon-rotation-alignment")==="map"&&F.get("symbol-placement")!=="point",je=F.get("symbol-placement"),Ve=le/2,nt=F.get("icon-text-fit");let Ke;l&&nt!=="none"&&(r.allowVerticalPlacement&&s.vertical&&(Ke=E0(l,s.vertical,nt,F.get("icon-text-fit-padding"),$,q)),H&&(l=E0(l,H,nt,F.get("icon-text-fit-padding"),$,q)));const Ge=(Te,st)=>{st.x<0||st.x>=Ri||st.y<0||st.y>=Ri||function(it,yt,ci,ai,Ni,zr,en,Vi,xn,bn,vn,Pi,$i,hn,tn,wn,nn,dr,Ln,Zt,ui,_i,Kn,Ei,Fl){const hs=it.addToLineVertexArray(yt,ci);let us,Rr,pr,Wi,js=0,gh=0,ox=0,ax=0,sm=-1,om=-1;const Us={};let lx=kl("");if(it.allowVerticalPlacement&&ai.vertical){const un=Vi.layout.get("text-rotate").evaluate(ui,{},Ei)+90;pr=new dd(xn,yt,bn,vn,Pi,ai.vertical,$i,hn,tn,un),en&&(Wi=new dd(xn,yt,bn,vn,Pi,en,nn,dr,tn,un))}if(Ni){const un=Vi.layout.get("icon-rotate").evaluate(ui,{}),fr=Vi.layout.get("icon-text-fit")!=="none",wa=K0(Ni,un,Kn,fr),Wr=en?K0(en,un,Kn,fr):void 0;Rr=new dd(xn,yt,bn,vn,Pi,Ni,nn,dr,!1,un),js=4*wa.length;const Sa=it.iconSizeData;let ds=null;Sa.kind==="source"?(ds=[cs*Vi.layout.get("icon-size").evaluate(ui,{})],ds[0]>Io&&zt(`${it.layerIds[0]}: Value for "icon-size" is >= ${uh}. Reduce your "icon-size".`)):Sa.kind==="composite"&&(ds=[cs*_i.compositeIconSizes[0].evaluate(ui,{},Ei),cs*_i.compositeIconSizes[1].evaluate(ui,{},Ei)],(ds[0]>Io||ds[1]>Io)&&zt(`${it.layerIds[0]}: Value for "icon-size" is >= ${uh}. Reduce your "icon-size".`)),it.addSymbols(it.icon,wa,ds,Zt,Ln,ui,_.ah.none,yt,hs.lineStartIndex,hs.lineLength,-1,Ei),sm=it.icon.placedSymbolArray.length-1,Wr&&(gh=4*Wr.length,it.addSymbols(it.icon,Wr,ds,Zt,Ln,ui,_.ah.vertical,yt,hs.lineStartIndex,hs.lineLength,-1,Ei),om=it.icon.placedSymbolArray.length-1)}const cx=Object.keys(ai.horizontal);for(const un of cx){const fr=ai.horizontal[un];if(!us){lx=kl(fr.text);const Wr=Vi.layout.get("text-rotate").evaluate(ui,{},Ei);us=new dd(xn,yt,bn,vn,Pi,fr,$i,hn,tn,Wr)}const wa=fr.positionedLines.length===1;if(ox+=tx(it,yt,fr,zr,Vi,tn,ui,wn,hs,ai.vertical?_.ah.horizontal:_.ah.horizontalOnly,wa?cx:[un],Us,sm,_i,Ei),wa)break}ai.vertical&&(ax+=tx(it,yt,ai.vertical,zr,Vi,tn,ui,wn,hs,_.ah.vertical,["vertical"],Us,om,_i,Ei));const tA=us?us.boxStartIndex:it.collisionBoxArray.length,iA=us?us.boxEndIndex:it.collisionBoxArray.length,nA=pr?pr.boxStartIndex:it.collisionBoxArray.length,rA=pr?pr.boxEndIndex:it.collisionBoxArray.length,sA=Rr?Rr.boxStartIndex:it.collisionBoxArray.length,oA=Rr?Rr.boxEndIndex:it.collisionBoxArray.length,aA=Wi?Wi.boxStartIndex:it.collisionBoxArray.length,lA=Wi?Wi.boxEndIndex:it.collisionBoxArray.length;let Zr=-1;const fd=(un,fr)=>un&&un.circleDiameter?Math.max(un.circleDiameter,fr):fr;Zr=fd(us,Zr),Zr=fd(pr,Zr),Zr=fd(Rr,Zr),Zr=fd(Wi,Zr);const hx=Zr>-1?1:0;hx&&(Zr*=Fl/Oi),it.glyphOffsetArray.length>=Ll.MAX_GLYPHS&&zt("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),ui.sortKey!==void 0&&it.addToSortKeyRanges(it.symbolInstances.length,ui.sortKey);const cA=ex(Vi,ui,Ei),[hA,uA]=function(un,fr){const wa=un.length,Wr=fr==null?void 0:fr.values;if((Wr==null?void 0:Wr.length)>0)for(let Sa=0;Sa<Wr.length;Sa+=2){const ds=Wr[Sa+1];un.emplaceBack(_.aq[Wr[Sa]],ds[0],ds[1])}return[wa,un.length]}(it.textAnchorOffsets,cA);it.symbolInstances.emplaceBack(yt.x,yt.y,Us.right>=0?Us.right:-1,Us.center>=0?Us.center:-1,Us.left>=0?Us.left:-1,Us.vertical||-1,sm,om,lx,tA,iA,nA,rA,sA,oA,aA,lA,bn,ox,ax,js,gh,hx,0,$i,Zr,hA,uA)}(r,st,Te,s,l,f,Ke,r.layers[0],r.collisionBoxArray,t.index,t.sourceLayerIndex,r.index,K,[fe,fe,fe,fe],qe,S,ge,we,ct,$,t,y,C,P,x)};if(je==="line")for(const Te of q0(t.geometry,0,0,Ri,Ri)){const st=GI(Te,le,Ie,s.vertical||H,l,24,ie,r.overscaling,Ri);for(const it of st)H&&QI(r,H.text,Ve,it)||Ge(Te,it)}else if(je==="line-center"){for(const Te of t.geometry)if(Te.length>1){const st=WI(Te,Ie,s.vertical||H,l,24,ie);st&&Ge(Te,st)}}else if(t.type==="Polygon")for(const Te of el(t.geometry,0)){const st=XI(Te,16);Ge(Te[0],new Do(st.x,st.y,0))}else if(t.type==="LineString")for(const Te of t.geometry)Ge(Te,new Do(Te[0].x,Te[0].y,0));else if(t.type==="Point")for(const Te of t.geometry)for(const st of Te)Ge([st],new Do(st.x,st.y,0))}function tx(r,t,s,l,f,y,x,v,S,C,P,L,F,$,H){const q=function(ge,le,fe,we,Ie,qe,ct,je){const Ve=we.layout.get("text-rotate").evaluate(qe,{})*Math.PI/180,nt=[];for(const Ke of le.positionedLines)for(const Ge of Ke.positionedGlyphs){if(!Ge.rect)continue;const Te=Ge.rect||{};let st=y0+1,it=!0,yt=1,ci=0;const ai=(Ie||je)&&Ge.vertical,Ni=Ge.metrics.advance*Ge.scale/2;if(je&&le.verticalizable&&(ci=Ke.lineOffset/2-(Ge.imageName?-(Oi-Ge.metrics.width*Ge.scale)/2:(Ge.scale-1)*Oi)),Ge.imageName){const Zt=ct[Ge.imageName];it=Zt.sdf,yt=Zt.pixelRatio,st=Rn/yt}const zr=Ie?[Ge.x+Ni,Ge.y]:[0,0];let en=Ie?[0,0]:[Ge.x+Ni+fe[0],Ge.y+fe[1]-ci],Vi=[0,0];ai&&(Vi=en,en=[0,0]);const xn=Ge.metrics.isDoubleResolution?2:1,bn=(Ge.metrics.left-st)*Ge.scale-Ni+en[0],vn=(-Ge.metrics.top-st)*Ge.scale+en[1],Pi=bn+Te.w/xn*Ge.scale/yt,$i=vn+Te.h/xn*Ge.scale/yt,hn=new R(bn,vn),tn=new R(Pi,vn),wn=new R(bn,$i),nn=new R(Pi,$i);if(ai){const Zt=new R(-Ni,Ni-ch),ui=-Math.PI/2,_i=Oi/2-Ni,Kn=new R(5-ch-_i,-(Ge.imageName?_i:0)),Ei=new R(...Vi);hn._rotateAround(ui,Zt)._add(Kn)._add(Ei),tn._rotateAround(ui,Zt)._add(Kn)._add(Ei),wn._rotateAround(ui,Zt)._add(Kn)._add(Ei),nn._rotateAround(ui,Zt)._add(Kn)._add(Ei)}if(Ve){const Zt=Math.sin(Ve),ui=Math.cos(Ve),_i=[ui,-Zt,Zt,ui];hn._matMult(_i),tn._matMult(_i),wn._matMult(_i),nn._matMult(_i)}const dr=new R(0,0),Ln=new R(0,0);nt.push({tl:hn,tr:tn,bl:wn,br:nn,tex:Te,writingMode:le.writingMode,glyphOffset:zr,sectionIndex:Ge.sectionIndex,isSDF:it,pixelOffsetTL:dr,pixelOffsetBR:Ln,minFontScaleX:0,minFontScaleY:0})}return nt}(0,s,v,f,y,x,l,r.allowVerticalPlacement),K=r.textSizeData;let ie=null;K.kind==="source"?(ie=[cs*f.layout.get("text-size").evaluate(x,{})],ie[0]>Io&&zt(`${r.layerIds[0]}: Value for "text-size" is >= ${uh}. Reduce your "text-size".`)):K.kind==="composite"&&(ie=[cs*$.compositeTextSizes[0].evaluate(x,{},H),cs*$.compositeTextSizes[1].evaluate(x,{},H)],(ie[0]>Io||ie[1]>Io)&&zt(`${r.layerIds[0]}: Value for "text-size" is >= ${uh}. Reduce your "text-size".`)),r.addSymbols(r.text,q,ie,v,y,x,C,t,S.lineStartIndex,S.lineLength,F,H);for(const ge of P)L[ge]=r.text.placedSymbolArray.length-1;return 4*q.length}function ix(r){for(const t in r)return r[t];return null}function QI(r,t,s,l){const f=r.compareText;if(t in f){const y=f[t];for(let x=y.length-1;x>=0;x--)if(l.dist(y[x])<s)return!0}else f[t]=[];return f[t].push(l),!1}const nx=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];class Jf{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");const[s,l]=new Uint8Array(t,0,2);if(s!==219)throw new Error("Data does not appear to be in a KDBush format.");const f=l>>4;if(f!==1)throw new Error(`Got v${f} data when expected v1.`);const y=nx[15&l];if(!y)throw new Error("Unrecognized array type.");const[x]=new Uint16Array(t,2,1),[v]=new Uint32Array(t,4,1);return new Jf(v,x,y,t)}constructor(t,s=64,l=Float64Array,f){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+s,2),65535),this.ArrayType=l,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;const y=nx.indexOf(this.ArrayType),x=2*t*this.ArrayType.BYTES_PER_ELEMENT,v=t*this.IndexArrayType.BYTES_PER_ELEMENT,S=(8-v%8)%8;if(y<0)throw new Error(`Unexpected typed array class: ${l}.`);f&&f instanceof ArrayBuffer?(this.data=f,this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+S,2*t),this._pos=2*t,this._finished=!0):(this.data=new ArrayBuffer(8+x+v+S),this.ids=new this.IndexArrayType(this.data,8,t),this.coords=new this.ArrayType(this.data,8+v+S,2*t),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,16+y]),new Uint16Array(this.data,2,1)[0]=s,new Uint32Array(this.data,4,1)[0]=t)}add(t,s){const l=this._pos>>1;return this.ids[l]=l,this.coords[this._pos++]=t,this.coords[this._pos++]=s,l}finish(){const t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Qf(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,s,l,f){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:y,coords:x,nodeSize:v}=this,S=[0,y.length-1,0],C=[];for(;S.length;){const P=S.pop()||0,L=S.pop()||0,F=S.pop()||0;if(L-F<=v){for(let K=F;K<=L;K++){const ie=x[2*K],ge=x[2*K+1];ie>=t&&ie<=l&&ge>=s&&ge<=f&&C.push(y[K])}continue}const $=F+L>>1,H=x[2*$],q=x[2*$+1];H>=t&&H<=l&&q>=s&&q<=f&&C.push(y[$]),(P===0?t<=H:s<=q)&&(S.push(F),S.push($-1),S.push(1-P)),(P===0?l>=H:f>=q)&&(S.push($+1),S.push(L),S.push(1-P))}return C}within(t,s,l){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");const{ids:f,coords:y,nodeSize:x}=this,v=[0,f.length-1,0],S=[],C=l*l;for(;v.length;){const P=v.pop()||0,L=v.pop()||0,F=v.pop()||0;if(L-F<=x){for(let K=F;K<=L;K++)sx(y[2*K],y[2*K+1],t,s)<=C&&S.push(f[K]);continue}const $=F+L>>1,H=y[2*$],q=y[2*$+1];sx(H,q,t,s)<=C&&S.push(f[$]),(P===0?t-l<=H:s-l<=q)&&(v.push(F),v.push($-1),v.push(1-P)),(P===0?t+l>=H:s+l>=q)&&(v.push($+1),v.push(L),v.push(1-P))}return S}}function Qf(r,t,s,l,f,y){if(f-l<=s)return;const x=l+f>>1;rx(r,t,x,l,f,y),Qf(r,t,s,l,x-1,1-y),Qf(r,t,s,x+1,f,1-y)}function rx(r,t,s,l,f,y){for(;f>l;){if(f-l>600){const C=f-l+1,P=s-l+1,L=Math.log(C),F=.5*Math.exp(2*L/3),$=.5*Math.sqrt(L*F*(C-F)/C)*(P-C/2<0?-1:1);rx(r,t,s,Math.max(l,Math.floor(s-P*F/C+$)),Math.min(f,Math.floor(s+(C-P)*F/C+$)),y)}const x=t[2*s+y];let v=l,S=f;for(fh(r,t,l,s),t[2*f+y]>x&&fh(r,t,l,f);v<S;){for(fh(r,t,v,S),v++,S--;t[2*v+y]<x;)v++;for(;t[2*S+y]>x;)S--}t[2*l+y]===x?fh(r,t,l,S):(S++,fh(r,t,S,f)),S<=s&&(l=S+1),s<=S&&(f=S-1)}}function fh(r,t,s,l){em(r,s,l),em(t,2*s,2*l),em(t,2*s+1,2*l+1)}function em(r,t,s){const l=r[t];r[t]=r[s],r[s]=l}function sx(r,t,s,l){const f=r-s,y=t-l;return f*f+y*y}var tm;_.bg=void 0,(tm=_.bg||(_.bg={})).create="create",tm.load="load",tm.fullLoad="fullLoad";let pd=null,mh=[];const im=1e3/60,nm="loadTime",rm="fullLoadTime",eA={mark(r){performance.mark(r)},frame(r){const t=r;pd!=null&&mh.push(t-pd),pd=t},clearMetrics(){pd=null,mh=[],performance.clearMeasures(nm),performance.clearMeasures(rm);for(const r in _.bg)performance.clearMarks(_.bg[r])},getPerformanceMetrics(){performance.measure(nm,_.bg.create,_.bg.load),performance.measure(rm,_.bg.create,_.bg.fullLoad);const r=performance.getEntriesByName(nm)[0].duration,t=performance.getEntriesByName(rm)[0].duration,s=mh.length,l=1/(mh.reduce((y,x)=>y+x,0)/s/1e3),f=mh.filter(y=>y>im).reduce((y,x)=>y+(x-im)/im,0);return{loadTime:r,fullLoadTime:t,fps:l,percentDroppedFrames:f/(s+f)*100,totalFrames:s}}};_.$=class extends O{},_.A=Pl,_.B=df,_.C=function(r){if(tr==null){const t=r.navigator?r.navigator.userAgent:null;tr=!!r.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return tr},_.D=et,_.E=ri,_.F=class{constructor(r,t){this.target=r,this.mapId=t,this.resolveRejects={},this.tasks={},this.taskQueue=[],this.abortControllers={},this.messageHandlers={},this.invoker=new qI(()=>this.process()),this.subscription=function(s,l,f,y){return s.addEventListener(l,f,!1),{unsubscribe:()=>{s.removeEventListener(l,f,!1)}}}(this.target,"message",s=>this.receive(s)),this.globalScope=rn(self)?r:window}registerMessageHandler(r,t){this.messageHandlers[r]=t}sendAsync(r,t){return new Promise((s,l)=>{const f=Math.round(1e18*Math.random()).toString(36).substring(0,10);this.resolveRejects[f]={resolve:s,reject:l},t&&t.signal.addEventListener("abort",()=>{delete this.resolveRejects[f];const v={id:f,type:"<cancel>",origin:location.origin,targetMapId:r.targetMapId,sourceMapId:this.mapId};this.target.postMessage(v)},{once:!0});const y=[],x=Object.assign(Object.assign({},r),{id:f,sourceMapId:this.mapId,origin:location.origin,data:_o(r.data,y)});this.target.postMessage(x,{transfer:y})})}receive(r){const t=r.data,s=t.id;if(!(t.origin!=="file://"&&location.origin!=="file://"&&t.origin!=="resource://android"&&location.origin!=="resource://android"&&t.origin!==location.origin||t.targetMapId&&this.mapId!==t.targetMapId)){if(t.type==="<cancel>"){delete this.tasks[s];const l=this.abortControllers[s];return delete this.abortControllers[s],void(l&&l.abort())}if(rn(self)||t.mustQueue)return this.tasks[s]=t,this.taskQueue.push(s),void this.invoker.trigger();this.processTask(s,t)}}process(){if(this.taskQueue.length===0)return;const r=this.taskQueue.shift(),t=this.tasks[r];delete this.tasks[r],this.taskQueue.length>0&&this.invoker.trigger(),t&&this.processTask(r,t)}processTask(r,t){return h(this,void 0,void 0,function*(){if(t.type==="<response>"){const f=this.resolveRejects[r];return delete this.resolveRejects[r],f?void(t.error?f.reject(xo(t.error)):f.resolve(xo(t.data))):void 0}if(!this.messageHandlers[t.type])return void this.completeTask(r,new Error(`Could not find a registered handler for ${t.type}, map ID: ${this.mapId}, available handlers: ${Object.keys(this.messageHandlers).join(", ")}`));const s=xo(t.data),l=new AbortController;this.abortControllers[r]=l;try{const f=yield this.messageHandlers[t.type](t.sourceMapId,s,l);this.completeTask(r,null,f)}catch(f){this.completeTask(r,f)}})}completeTask(r,t,s){const l=[];delete this.abortControllers[r];const f={id:r,type:"<response>",sourceMapId:this.mapId,origin:location.origin,error:t?_o(t):null,data:_o(s,l)};this.target.postMessage(f,{transfer:l})}remove(){this.invoker.remove(),this.subscription.unsubscribe()}},_.G=Cn,_.H=function(){var r=new Pl(16);return Pl!=Float32Array&&(r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=0,r[12]=0,r[13]=0,r[14]=0),r[0]=1,r[5]=1,r[10]=1,r[15]=1,r},_.I=Nf,_.J=function(r,t,s){var l,f,y,x,v,S,C,P,L,F,$,H,q=s[0],K=s[1],ie=s[2];return t===r?(r[12]=t[0]*q+t[4]*K+t[8]*ie+t[12],r[13]=t[1]*q+t[5]*K+t[9]*ie+t[13],r[14]=t[2]*q+t[6]*K+t[10]*ie+t[14],r[15]=t[3]*q+t[7]*K+t[11]*ie+t[15]):(f=t[1],y=t[2],x=t[3],v=t[4],S=t[5],C=t[6],P=t[7],L=t[8],F=t[9],$=t[10],H=t[11],r[0]=l=t[0],r[1]=f,r[2]=y,r[3]=x,r[4]=v,r[5]=S,r[6]=C,r[7]=P,r[8]=L,r[9]=F,r[10]=$,r[11]=H,r[12]=l*q+v*K+L*ie+t[12],r[13]=f*q+S*K+F*ie+t[13],r[14]=y*q+C*K+$*ie+t[14],r[15]=x*q+P*K+H*ie+t[15]),r},_.K=function(r,t,s){var l=s[0],f=s[1],y=s[2];return r[0]=t[0]*l,r[1]=t[1]*l,r[2]=t[2]*l,r[3]=t[3]*l,r[4]=t[4]*f,r[5]=t[5]*f,r[6]=t[6]*f,r[7]=t[7]*f,r[8]=t[8]*y,r[9]=t[9]*y,r[10]=t[10]*y,r[11]=t[11]*y,r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},_.L=N_,_.M=function(r,t){const s={};for(let l=0;l<t.length;l++){const f=t[l];f in r&&(s[f]=r[f])}return s},_.N=Ao,_.O=R0,_.P=R,_.Q=L0,_.R=hr,_.S=ur,_.T=xl,_.U=ue,_.V=be,_.W=jn,_.X=Ri,_.Y=w,_.Z=dh,_._=h,_.a=En,_.a$=function(r,t){var s=r[0],l=r[1],f=r[2],y=r[3],x=r[4],v=r[5],S=r[6],C=r[7],P=r[8],L=r[9],F=r[10],$=r[11],H=r[12],q=r[13],K=r[14],ie=r[15],ge=t[0],le=t[1],fe=t[2],we=t[3],Ie=t[4],qe=t[5],ct=t[6],je=t[7],Ve=t[8],nt=t[9],Ke=t[10],Ge=t[11],Te=t[12],st=t[13],it=t[14],yt=t[15];return Math.abs(s-ge)<=_n*Math.max(1,Math.abs(s),Math.abs(ge))&&Math.abs(l-le)<=_n*Math.max(1,Math.abs(l),Math.abs(le))&&Math.abs(f-fe)<=_n*Math.max(1,Math.abs(f),Math.abs(fe))&&Math.abs(y-we)<=_n*Math.max(1,Math.abs(y),Math.abs(we))&&Math.abs(x-Ie)<=_n*Math.max(1,Math.abs(x),Math.abs(Ie))&&Math.abs(v-qe)<=_n*Math.max(1,Math.abs(v),Math.abs(qe))&&Math.abs(S-ct)<=_n*Math.max(1,Math.abs(S),Math.abs(ct))&&Math.abs(C-je)<=_n*Math.max(1,Math.abs(C),Math.abs(je))&&Math.abs(P-Ve)<=_n*Math.max(1,Math.abs(P),Math.abs(Ve))&&Math.abs(L-nt)<=_n*Math.max(1,Math.abs(L),Math.abs(nt))&&Math.abs(F-Ke)<=_n*Math.max(1,Math.abs(F),Math.abs(Ke))&&Math.abs($-Ge)<=_n*Math.max(1,Math.abs($),Math.abs(Ge))&&Math.abs(H-Te)<=_n*Math.max(1,Math.abs(H),Math.abs(Te))&&Math.abs(q-st)<=_n*Math.max(1,Math.abs(q),Math.abs(st))&&Math.abs(K-it)<=_n*Math.max(1,Math.abs(K),Math.abs(it))&&Math.abs(ie-yt)<=_n*Math.max(1,Math.abs(ie),Math.abs(yt))},_.a0=Bt,_.a1=Yf,_.a2=ze,_.a3=r=>{const t=window.document.createElement("video");return t.muted=!0,new Promise(s=>{t.onloadstart=()=>{s(t)};for(const l of r){const f=window.document.createElement("source");ot(l)||(t.crossOrigin="Anonymous"),f.src=l,t.appendChild(f)}})},_.a4=function(){return St++},_.a5=Ue,_.a6=Ll,_.a7=Dc,_.a8=ba,_.a9=$0,_.aA=function(r){if(r.type==="custom")return new HI(r);switch(r.type){case"background":return new $I(r);case"circle":return new MP(r);case"fill":return new qP(r);case"fill-extrusion":return new oI(r);case"heatmap":return new IP(r);case"hillshade":return new DP(r);case"line":return new fI(r);case"raster":return new UI(r);case"symbol":return new ld(r)}},_.aB=Ct,_.aC=function(r,t){if(!r)return[{command:"setStyle",args:[t]}];let s=[];try{if(!Wt(r.version,t.version))return[{command:"setStyle",args:[t]}];Wt(r.center,t.center)||s.push({command:"setCenter",args:[t.center]}),Wt(r.zoom,t.zoom)||s.push({command:"setZoom",args:[t.zoom]}),Wt(r.bearing,t.bearing)||s.push({command:"setBearing",args:[t.bearing]}),Wt(r.pitch,t.pitch)||s.push({command:"setPitch",args:[t.pitch]}),Wt(r.sprite,t.sprite)||s.push({command:"setSprite",args:[t.sprite]}),Wt(r.glyphs,t.glyphs)||s.push({command:"setGlyphs",args:[t.glyphs]}),Wt(r.transition,t.transition)||s.push({command:"setTransition",args:[t.transition]}),Wt(r.light,t.light)||s.push({command:"setLight",args:[t.light]}),Wt(r.terrain,t.terrain)||s.push({command:"setTerrain",args:[t.terrain]}),Wt(r.sky,t.sky)||s.push({command:"setSky",args:[t.sky]}),Wt(r.projection,t.projection)||s.push({command:"setProjection",args:[t.projection]});const l={},f=[];(function(x,v,S,C){let P;for(P in v=v||{},x=x||{})Object.prototype.hasOwnProperty.call(x,P)&&(Object.prototype.hasOwnProperty.call(v,P)||is(P,S,C));for(P in v)Object.prototype.hasOwnProperty.call(v,P)&&(Object.prototype.hasOwnProperty.call(x,P)?Wt(x[P],v[P])||(x[P].type==="geojson"&&v[P].type==="geojson"&&Js(x,v,P)?Si(S,{command:"setGeoJSONSourceData",args:[P,v[P].data]}):$r(P,v,S,C)):Yo(P,v,S))})(r.sources,t.sources,f,l);const y=[];r.layers&&r.layers.forEach(x=>{"source"in x&&l[x.source]?s.push({command:"removeLayer",args:[x.id]}):y.push(x)}),s=s.concat(f),function(x,v,S){v=v||[];const C=(x=x||[]).map(Xo),P=v.map(Xo),L=x.reduce(Ko,{}),F=v.reduce(Ko,{}),$=C.slice(),H=Object.create(null);let q,K,ie,ge,le;for(let fe=0,we=0;fe<C.length;fe++)q=C[fe],Object.prototype.hasOwnProperty.call(F,q)?we++:(Si(S,{command:"removeLayer",args:[q]}),$.splice($.indexOf(q,we),1));for(let fe=0,we=0;fe<P.length;fe++)q=P[P.length-1-fe],$[$.length-1-fe]!==q&&(Object.prototype.hasOwnProperty.call(L,q)?(Si(S,{command:"removeLayer",args:[q]}),$.splice($.lastIndexOf(q,$.length-we),1)):we++,ge=$[$.length-fe],Si(S,{command:"addLayer",args:[F[q],ge]}),$.splice($.length-fe,0,q),H[q]=!0);for(let fe=0;fe<P.length;fe++)if(q=P[fe],K=L[q],ie=F[q],!H[q]&&!Wt(K,ie))if(Wt(K.source,ie.source)&&Wt(K["source-layer"],ie["source-layer"])&&Wt(K.type,ie.type)){for(le in Un(K.layout,ie.layout,S,q,null,"setLayoutProperty"),Un(K.paint,ie.paint,S,q,null,"setPaintProperty"),Wt(K.filter,ie.filter)||Si(S,{command:"setFilter",args:[q,ie.filter]}),Wt(K.minzoom,ie.minzoom)&&Wt(K.maxzoom,ie.maxzoom)||Si(S,{command:"setLayerZoomRange",args:[q,ie.minzoom,ie.maxzoom]}),K)Object.prototype.hasOwnProperty.call(K,le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?Un(K[le],ie[le],S,q,le.slice(6),"setPaintProperty"):Wt(K[le],ie[le])||Si(S,{command:"setLayerProperty",args:[q,le,ie[le]]}));for(le in ie)Object.prototype.hasOwnProperty.call(ie,le)&&!Object.prototype.hasOwnProperty.call(K,le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?Un(K[le],ie[le],S,q,le.slice(6),"setPaintProperty"):Wt(K[le],ie[le])||Si(S,{command:"setLayerProperty",args:[q,le,ie[le]]}))}else Si(S,{command:"removeLayer",args:[q]}),ge=$[$.lastIndexOf(q)+1],Si(S,{command:"addLayer",args:[ie,ge]})}(y,t.layers,s)}catch(l){console.warn("Unable to compute style diff:",l),s=[{command:"setStyle",args:[t]}]}return s},_.aD=function(r){const t=[],s=r.id;return s===void 0&&t.push({message:`layers.${s}: missing required property "id"`}),r.render===void 0&&t.push({message:`layers.${s}: missing required method "render"`}),r.renderingMode&&r.renderingMode!=="2d"&&r.renderingMode!=="3d"&&t.push({message:`layers.${s}: property "renderingMode" must be either "2d" or "3d"`}),t},_.aE=function r(t,s){if(Array.isArray(t)){if(!Array.isArray(s)||t.length!==s.length)return!1;for(let l=0;l<t.length;l++)if(!r(t[l],s[l]))return!1;return!0}if(typeof t=="object"&&t!==null&&s!==null){if(typeof s!="object"||Object.keys(t).length!==Object.keys(s).length)return!1;for(const l in t)if(!r(t[l],s[l]))return!1;return!0}return t===s},_.aF=wt,_.aG=Nt,_.aH=class extends ya{constructor(r,t){super(r,t),this.current=0}set(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))}},_.aI=Yu,_.aJ=class extends ya{constructor(r,t){super(r,t),this.current=bP}set(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(let t=1;t<16;t++)if(r[t]!==this.current[t]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}}},_.aK=M_,_.aL=P_,_.aM=ti,_.aN=class extends ya{constructor(r,t){super(r,t),this.current=[0,0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))}},_.aO=class extends ya{constructor(r,t){super(r,t),this.current=[0,0]}set(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))}},_.aP=function(r,t,s,l,f,y,x){var v=1/(t-s),S=1/(l-f),C=1/(y-x);return r[0]=-2*v,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*S,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*C,r[11]=0,r[12]=(t+s)*v,r[13]=(f+l)*S,r[14]=(x+y)*C,r[15]=1,r},_.aQ=CP,_.aR=class extends he{},_.aS=_I,_.aT=class extends ye{},_.aU=Cf,_.aV=function(r){return r<=1?1:Math.pow(2,Math.ceil(Math.log(r)/Math.LN2))},_.aW=H_,_.aX=Ki,_.aY=cr,_.aZ=class extends tt{},_.a_=function(r,t){return r[0]===t[0]&&r[1]===t[1]&&r[2]===t[2]&&r[3]===t[3]&&r[4]===t[4]&&r[5]===t[5]&&r[6]===t[6]&&r[7]===t[7]&&r[8]===t[8]&&r[9]===t[9]&&r[10]===t[10]&&r[11]===t[11]&&r[12]===t[12]&&r[13]===t[13]&&r[14]===t[14]&&r[15]===t[15]},_.aa=function(r){const t={};if(r.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(s,l,f,y)=>{const x=f||y;return t[l]=!x||x.toLowerCase(),""}),t["max-age"]){const s=parseInt(t["max-age"],10);isNaN(s)?delete t["max-age"]:t["max-age"]=s}return t},_.ab=function(r,t){const s=[];for(const l in r)l in t||s.push(l);return s},_.ac=Qe,_.ad=function(r,t,s){var l=Math.sin(s),f=Math.cos(s),y=t[0],x=t[1],v=t[2],S=t[3],C=t[4],P=t[5],L=t[6],F=t[7];return t!==r&&(r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[0]=y*f+C*l,r[1]=x*f+P*l,r[2]=v*f+L*l,r[3]=S*f+F*l,r[4]=C*f-y*l,r[5]=P*f-x*l,r[6]=L*f-v*l,r[7]=F*f-S*l,r},_.ae=function(r){var t=new Pl(16);return t[0]=r[0],t[1]=r[1],t[2]=r[2],t[3]=r[3],t[4]=r[4],t[5]=r[5],t[6]=r[6],t[7]=r[7],t[8]=r[8],t[9]=r[9],t[10]=r[10],t[11]=r[11],t[12]=r[12],t[13]=r[13],t[14]=r[14],t[15]=r[15],t},_.af=Qu,_.ag=function(r,t){let s=0,l=0;if(r.kind==="constant")l=r.layoutSize;else if(r.kind!=="source"){const{interpolationType:f,minZoom:y,maxZoom:x}=r,v=f?Qe(gn.interpolationFactor(f,t,y,x),0,1):0;r.kind==="camera"?l=mn.number(r.minSize,r.maxSize,v):s=v}return{uSizeT:s,uSize:l}},_.ai=function(r,{uSize:t,uSizeT:s},{lowerSize:l,upperSize:f}){return r.kind==="source"?l/cs:r.kind==="composite"?mn.number(l/cs,f/cs,s):t},_.aj=Uf,_.ak=function(r,t,s,l){const f=t.y-r.y,y=t.x-r.x,x=l.y-s.y,v=l.x-s.x,S=x*y-v*f;if(S===0)return null;const C=(v*(r.y-s.y)-x*(r.x-s.x))/S;return new R(r.x+C*y,r.y+C*f)},_.al=q0,_.am=z_,_.an=kf,_.ao=function(r){let t=1/0,s=1/0,l=-1/0,f=-1/0;for(const y of r)t=Math.min(t,y.x),s=Math.min(s,y.y),l=Math.max(l,y.x),f=Math.max(f,y.y);return[t,s,l,f]},_.ap=Oi,_.ar=jf,_.as=function(r,t){var s=t[0],l=t[1],f=t[2],y=t[3],x=t[4],v=t[5],S=t[6],C=t[7],P=t[8],L=t[9],F=t[10],$=t[11],H=t[12],q=t[13],K=t[14],ie=t[15],ge=s*v-l*x,le=s*S-f*x,fe=s*C-y*x,we=l*S-f*v,Ie=l*C-y*v,qe=f*C-y*S,ct=P*q-L*H,je=P*K-F*H,Ve=P*ie-$*H,nt=L*K-F*q,Ke=L*ie-$*q,Ge=F*ie-$*K,Te=ge*Ge-le*Ke+fe*nt+we*Ve-Ie*je+qe*ct;return Te?(r[0]=(v*Ge-S*Ke+C*nt)*(Te=1/Te),r[1]=(f*Ke-l*Ge-y*nt)*Te,r[2]=(q*qe-K*Ie+ie*we)*Te,r[3]=(F*Ie-L*qe-$*we)*Te,r[4]=(S*Ve-x*Ge-C*je)*Te,r[5]=(s*Ge-f*Ve+y*je)*Te,r[6]=(K*fe-H*qe-ie*le)*Te,r[7]=(P*qe-F*fe+$*le)*Te,r[8]=(x*Ke-v*Ve+C*ct)*Te,r[9]=(l*Ve-s*Ke-y*ct)*Te,r[10]=(H*Ie-q*fe+ie*ge)*Te,r[11]=(L*fe-P*Ie-$*ge)*Te,r[12]=(v*je-x*nt-S*ct)*Te,r[13]=(s*nt-l*je+f*ct)*Te,r[14]=(q*le-H*we-K*ge)*Te,r[15]=(P*we-L*le+F*ge)*Te,r):null},_.at=Kf,_.au=$f,_.av=Jf,_.aw=function(){const r={},t=xe.$version;for(const s in xe.$root){const l=xe.$root[s];if(l.required){let f=null;f=s==="version"?t:l.type==="array"?[]:{},f!=null&&(r[s]=f)}}return r},_.ax=Zc,_.ay=He,_.az=function(r){r=r.slice();const t=Object.create(null);for(let s=0;s<r.length;s++)t[r[s].id]=r[s];for(let s=0;s<r.length;s++)"ref"in r[s]&&(r[s]=Go(r[s],t[r[s].ref]));return r},_.b=Ui,_.b0=function(r,t){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[4]=t[4],r[5]=t[5],r[6]=t[6],r[7]=t[7],r[8]=t[8],r[9]=t[9],r[10]=t[10],r[11]=t[11],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15],r},_.b1=function(r,t,s){return r[0]=t[0]*s[0],r[1]=t[1]*s[1],r[2]=t[2]*s[2],r[3]=t[3]*s[3],r},_.b2=function(r,t){return r[0]*t[0]+r[1]*t[1]+r[2]*t[2]+r[3]*t[3]},_.b3=mt,_.b4=F0,_.b5=O0,_.b6=function(r,t,s,l,f){var y,x=1/Math.tan(t/2);return r[0]=x/s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=x,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,f!=null&&f!==1/0?(r[10]=(f+l)*(y=1/(l-f)),r[14]=2*f*l*y):(r[10]=-1,r[14]=-2*l),r},_.b7=function(r,t,s){var l=Math.sin(s),f=Math.cos(s),y=t[4],x=t[5],v=t[6],S=t[7],C=t[8],P=t[9],L=t[10],F=t[11];return t!==r&&(r[0]=t[0],r[1]=t[1],r[2]=t[2],r[3]=t[3],r[12]=t[12],r[13]=t[13],r[14]=t[14],r[15]=t[15]),r[4]=y*f+C*l,r[5]=x*f+P*l,r[6]=v*f+L*l,r[7]=S*f+F*l,r[8]=C*f-y*l,r[9]=P*f-x*l,r[10]=L*f-v*l,r[11]=F*f-S*l,r},_.b8=_e,_.b9=Ce,_.bA=h0,_.bB=function(r){return r.message===sn},_.bC=ho,_.bD=Dn,_.ba=function(r){return r*Math.PI/180},_.bb=function(r,t){const{x:s,y:l}=dh.fromLngLat(t);return!(r<0||r>25||l<0||l>=1||s<0||s>=1)},_.bc=function(r,t){return r[0]=t[0],r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=t[1],r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=t[2],r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r},_.bd=class extends I{},_.be=Wf,_.bf=eA,_.bh=ke,_.bi=function(r,t){En.REGISTERED_PROTOCOLS[r]=t},_.bj=function(r){delete En.REGISTERED_PROTOCOLS[r]},_.bk=function(r,t){const s={};for(let f=0;f<r.length;f++){const y=t&&t[r[f].id]||Bu(r[f]);t&&(t[r[f].id]=y);let x=s[y];x||(x=s[y]=[]),x.push(r[f])}const l=[];for(const f in s)l.push(s[f]);return l},_.bl=Xe,_.bm=V0,_.bn=j0,_.bo=x0,_.bp=function(r){r.bucket.createArrays(),r.bucket.tilePixelRatio=Ri/(512*r.bucket.overscaling),r.bucket.compareText={},r.bucket.iconsNeedLinear=!1;const t=r.bucket.layers[0],s=t.layout,l=t._unevaluatedLayout._values,f={layoutIconSize:l["icon-size"].possiblyEvaluate(new fi(r.bucket.zoom+1),r.canonical),layoutTextSize:l["text-size"].possiblyEvaluate(new fi(r.bucket.zoom+1),r.canonical),textMaxSize:l["text-size"].possiblyEvaluate(new fi(18))};if(r.bucket.textSizeData.kind==="composite"){const{minZoom:C,maxZoom:P}=r.bucket.textSizeData;f.compositeTextSizes=[l["text-size"].possiblyEvaluate(new fi(C),r.canonical),l["text-size"].possiblyEvaluate(new fi(P),r.canonical)]}if(r.bucket.iconSizeData.kind==="composite"){const{minZoom:C,maxZoom:P}=r.bucket.iconSizeData;f.compositeIconSizes=[l["icon-size"].possiblyEvaluate(new fi(C),r.canonical),l["icon-size"].possiblyEvaluate(new fi(P),r.canonical)]}const y=s.get("text-line-height")*Oi,x=s.get("text-rotation-alignment")!=="viewport"&&s.get("symbol-placement")!=="point",v=s.get("text-keep-upright"),S=s.get("text-size");for(const C of r.bucket.features){const P=s.get("text-font").evaluate(C,{},r.canonical).join(","),L=S.evaluate(C,{},r.canonical),F=f.layoutTextSize.evaluate(C,{},r.canonical),$=f.layoutIconSize.evaluate(C,{},r.canonical),H={horizontal:{},vertical:void 0},q=C.text;let K,ie=[0,0];if(q){const fe=q.toString(),we=s.get("text-letter-spacing").evaluate(C,{},r.canonical)*Oi,Ie=pf(fe)?we:0,qe=s.get("text-anchor").evaluate(C,{},r.canonical),ct=ex(t,C,r.canonical);if(!ct){const Ke=s.get("text-radial-offset").evaluate(C,{},r.canonical);ie=Ke?Q0(qe,[Ke*Oi,Xf]):s.get("text-offset").evaluate(C,{},r.canonical).map(Ge=>Ge*Oi)}let je=x?"center":s.get("text-justify").evaluate(C,{},r.canonical);const Ve=s.get("symbol-placement")==="point"?s.get("text-max-width").evaluate(C,{},r.canonical)*Oi:1/0,nt=()=>{r.bucket.allowVerticalPlacement&&Wc(fe)&&(H.vertical=sd(q,r.glyphMap,r.glyphPositions,r.imagePositions,P,Ve,y,qe,"left",Ie,ie,_.ah.vertical,!0,F,L))};if(!x&&ct){const Ke=new Set;if(je==="auto")for(let Te=0;Te<ct.values.length;Te+=2)Ke.add(Kf(ct.values[Te]));else Ke.add(je);let Ge=!1;for(const Te of Ke)if(!H.horizontal[Te])if(Ge)H.horizontal[Te]=H.horizontal[0];else{const st=sd(q,r.glyphMap,r.glyphPositions,r.imagePositions,P,Ve,y,"center",Te,Ie,ie,_.ah.horizontal,!1,F,L);st&&(H.horizontal[Te]=st,Ge=st.positionedLines.length===1)}nt()}else{je==="auto"&&(je=Kf(qe));const Ke=sd(q,r.glyphMap,r.glyphPositions,r.imagePositions,P,Ve,y,qe,je,Ie,ie,_.ah.horizontal,!1,F,L);Ke&&(H.horizontal[je]=Ke),nt(),Wc(fe)&&x&&v&&(H.vertical=sd(q,r.glyphMap,r.glyphPositions,r.imagePositions,P,Ve,y,qe,je,Ie,ie,_.ah.vertical,!1,F,L))}}let ge=!1;if(C.icon&&C.icon.name){const fe=r.imageMap[C.icon.name];fe&&(K=OI(r.imagePositions[C.icon.name],s.get("icon-offset").evaluate(C,{},r.canonical),s.get("icon-anchor").evaluate(C,{},r.canonical)),ge=!!fe.sdf,r.bucket.sdfIcons===void 0?r.bucket.sdfIcons=ge:r.bucket.sdfIcons!==ge&&zt("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(fe.pixelRatio!==r.bucket.pixelRatio||s.get("icon-rotate").constantOr(1)!==0)&&(r.bucket.iconsNeedLinear=!0))}const le=ix(H.horizontal)||H.vertical;r.bucket.iconsInText=!!le&&le.iconsInText,(le||K)&&JI(r.bucket,C,H,K,r.imageMap,f,F,$,ie,ge,r.canonical)}r.showCollisionBoxes&&r.bucket.generateCollisionDebugBuffers()},_.bq=Lf,_.br=Df,_.bs=Rf,_.bt=Mo,_.bu=Bf,_.bv=class{constructor(r){this._marks={start:[r.url,"start"].join("#"),end:[r.url,"end"].join("#"),measure:r.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let r=performance.getEntriesByName(this._marks.measure);return r.length===0&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),r=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),r}},_.bw=function(r,t,s,l,f){return h(this,void 0,void 0,function*(){if(be())try{return yield jn(r,t,s,l,f)}catch{}return function(y,x,v,S,C){const P=y.width,L=y.height;kn&&Hi||(kn=new OffscreenCanvas(P,L),Hi=kn.getContext("2d",{willReadFrequently:!0})),kn.width=P,kn.height=L,Hi.drawImage(y,0,0,P,L);const F=Hi.getImageData(x,v,S,C);return Hi.clearRect(0,0,P,L),F.data}(r,t,s,l,f)})},_.bx=N0,_.by=M,_.bz=A,_.c=kr,_.d=r=>h(void 0,void 0,void 0,function*(){if(r.byteLength===0)return createImageBitmap(new ImageData(1,1));const t=new Blob([new Uint8Array(r)],{type:"image/png"});try{return createImageBitmap(t)}catch(s){throw new Error(`Could not load image because of ${s.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`)}}),_.e=Ae,_.f=r=>new Promise((t,s)=>{const l=new Image;l.onload=()=>{t(l),URL.revokeObjectURL(l.src),l.onload=null,window.requestAnimationFrame(()=>{l.src=Sr})},l.onerror=()=>s(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 f=new Blob([new Uint8Array(r)],{type:"image/png"});l.src=r.byteLength?URL.createObjectURL(f):Sr}),_.g=Tn,_.h=(r,t)=>Ze(Ae(r,{type:"json"}),t),_.i=rn,_.j=bt,_.k=kt,_.l=(r,t)=>Ze(Ae(r,{type:"arrayBuffer"}),t),_.m=Ze,_.n=function(r){return new Bf(r).readFields(PI,[])},_.o=ih,_.p=_0,_.q=g,_.r=uf,_.s=ot,_.t=Hc,_.u=Fs,_.v=xe,_.w=zt,_.x=function([r,t,s]){return t+=90,t*=Math.PI/180,s*=Math.PI/180,{x:r*Math.cos(t)*Math.sin(s),y:r*Math.sin(t)*Math.sin(s),z:r*Math.cos(s)}},_.y=mn,_.z=fi}),p("worker",["./shared"],function(_){class h{constructor(V){this.keyCache={},V&&this.replace(V)}replace(V){this._layerConfigs={},this._layers={},this.update(V,[])}update(V,N){for(const J of V){this._layerConfigs[J.id]=J;const ce=this._layers[J.id]=_.aA(J);ce._featureFilter=_.a7(ce.filter),this.keyCache[J.id]&&delete this.keyCache[J.id]}for(const J of N)delete this.keyCache[J],delete this._layerConfigs[J],delete this._layers[J];this.familiesBySource={};const W=_.bk(Object.values(this._layerConfigs),this.keyCache);for(const J of W){const ce=J.map(ve=>this._layers[ve.id]),de=ce[0];if(de.visibility==="none")continue;const me=de.source||"";let se=this.familiesBySource[me];se||(se=this.familiesBySource[me]={});const Se=de.sourceLayer||"_geojsonTileLayer";let Pe=se[Se];Pe||(Pe=se[Se]=[]),Pe.push(ce)}}}class M{constructor(V){const N={},W=[];for(const me in V){const se=V[me],Se=N[me]={};for(const Pe in se){const ve=se[+Pe];if(!ve||ve.bitmap.width===0||ve.bitmap.height===0)continue;const Le={x:0,y:0,w:ve.bitmap.width+2,h:ve.bitmap.height+2};W.push(Le),Se[Pe]={rect:Le,metrics:ve.metrics}}}const{w:J,h:ce}=_.p(W),de=new _.o({width:J||1,height:ce||1});for(const me in V){const se=V[me];for(const Se in se){const Pe=se[+Se];if(!Pe||Pe.bitmap.width===0||Pe.bitmap.height===0)continue;const ve=N[me][Se].rect;_.o.copy(Pe.bitmap,de,{x:0,y:0},{x:ve.x+1,y:ve.y+1},Pe.bitmap)}}this.image=de,this.positions=N}}_.bl("GlyphAtlas",M);class A{constructor(V){this.tileID=new _.S(V.tileID.overscaledZ,V.tileID.wrap,V.tileID.canonical.z,V.tileID.canonical.x,V.tileID.canonical.y),this.uid=V.uid,this.zoom=V.zoom,this.pixelRatio=V.pixelRatio,this.tileSize=V.tileSize,this.source=V.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=V.showCollisionBoxes,this.collectResourceTiming=!!V.collectResourceTiming,this.returnDependencies=!!V.returnDependencies,this.promoteId=V.promoteId,this.inFlightDependencies=[]}parse(V,N,W,J){return _._(this,void 0,void 0,function*(){this.status="parsing",this.data=V,this.collisionBoxArray=new _.a5;const ce=new _.bm(Object.keys(V.layers).sort()),de=new _.bn(this.tileID,this.promoteId);de.bucketLayerIDs=[];const me={},se={featureIndex:de,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:W},Se=N.familiesBySource[this.source];for(const Mt in Se){const ei=V.layers[Mt];if(!ei)continue;ei.version===1&&_.w(`Vector tile source "${this.source}" layer "${Mt}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const xi=ce.encode(Mt),Fi=[];for(let qi=0;qi<ei.length;qi++){const an=ei.feature(qi),Qs=de.getId(an,Mt);Fi.push({feature:an,id:Qs,index:qi,sourceLayerIndex:xi})}for(const qi of Se[Mt]){const an=qi[0];an.source!==this.source&&_.w(`layer.source = ${an.source} does not equal this.source = ${this.source}`),an.minzoom&&this.zoom<Math.floor(an.minzoom)||an.maxzoom&&this.zoom>=an.maxzoom||an.visibility!=="none"&&(D(qi,this.zoom,W),(me[an.id]=an.createBucket({index:de.bucketLayerIDs.length,layers:qi,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:xi,sourceID:this.source})).populate(Fi,se,this.tileID.canonical),de.bucketLayerIDs.push(qi.map(Qs=>Qs.id)))}}const Pe=_.aF(se.glyphDependencies,Mt=>Object.keys(Mt).map(Number));this.inFlightDependencies.forEach(Mt=>Mt==null?void 0:Mt.abort()),this.inFlightDependencies=[];let ve=Promise.resolve({});if(Object.keys(Pe).length){const Mt=new AbortController;this.inFlightDependencies.push(Mt),ve=J.sendAsync({type:"GG",data:{stacks:Pe,source:this.source,tileID:this.tileID,type:"glyphs"}},Mt)}const Le=Object.keys(se.iconDependencies);let at=Promise.resolve({});if(Le.length){const Mt=new AbortController;this.inFlightDependencies.push(Mt),at=J.sendAsync({type:"GI",data:{icons:Le,source:this.source,tileID:this.tileID,type:"icons"}},Mt)}const lt=Object.keys(se.patternDependencies);let jt=Promise.resolve({});if(lt.length){const Mt=new AbortController;this.inFlightDependencies.push(Mt),jt=J.sendAsync({type:"GI",data:{icons:lt,source:this.source,tileID:this.tileID,type:"patterns"}},Mt)}const[vt,Ut,Rt]=yield Promise.all([ve,at,jt]),Di=new M(vt),ki=new _.bo(Ut,Rt);for(const Mt in me){const ei=me[Mt];ei instanceof _.a6?(D(ei.layers,this.zoom,W),_.bp({bucket:ei,glyphMap:vt,glyphPositions:Di.positions,imageMap:Ut,imagePositions:ki.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):ei.hasPattern&&(ei instanceof _.bq||ei instanceof _.br||ei instanceof _.bs)&&(D(ei.layers,this.zoom,W),ei.addFeatures(se,this.tileID.canonical,ki.patternPositions))}return this.status="done",{buckets:Object.values(me).filter(Mt=>!Mt.isEmpty()),featureIndex:de,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Di.image,imageAtlas:ki,glyphMap:this.returnDependencies?vt:null,iconMap:this.returnDependencies?Ut:null,glyphPositions:this.returnDependencies?Di.positions:null}})}}function D(te,V,N){const W=new _.z(V);for(const J of te)J.recalculate(W,N)}class R{constructor(V,N,W){this.actor=V,this.layerIndex=N,this.availableImages=W,this.fetching={},this.loading={},this.loaded={}}loadVectorTile(V,N){return _._(this,void 0,void 0,function*(){const W=yield _.l(V.request,N);try{return{vectorTile:new _.bt.VectorTile(new _.bu(W.data)),rawData:W.data,cacheControl:W.cacheControl,expires:W.expires}}catch(J){const ce=new Uint8Array(W.data);let de=`Unable to parse the tile at ${V.request.url}, `;throw de+=ce[0]===31&&ce[1]===139?"please make sure the data is not gzipped and that you have configured the relevant header in the server":`got error: ${J.message}`,new Error(de)}})}loadTile(V){return _._(this,void 0,void 0,function*(){const N=V.uid,W=!!(V&&V.request&&V.request.collectResourceTiming)&&new _.bv(V.request),J=new A(V);this.loading[N]=J;const ce=new AbortController;J.abort=ce;try{const de=yield this.loadVectorTile(V,ce);if(delete this.loading[N],!de)return null;const me=de.rawData,se={};de.expires&&(se.expires=de.expires),de.cacheControl&&(se.cacheControl=de.cacheControl);const Se={};if(W){const ve=W.finish();ve&&(Se.resourceTiming=JSON.parse(JSON.stringify(ve)))}J.vectorTile=de.vectorTile;const Pe=J.parse(de.vectorTile,this.layerIndex,this.availableImages,this.actor);this.loaded[N]=J,this.fetching[N]={rawTileData:me,cacheControl:se,resourceTiming:Se};try{const ve=yield Pe;return _.e({rawTileData:me.slice(0)},ve,se,Se)}finally{delete this.fetching[N]}}catch(de){throw delete this.loading[N],J.status="done",this.loaded[N]=J,de}})}reloadTile(V){return _._(this,void 0,void 0,function*(){const N=V.uid;if(!this.loaded||!this.loaded[N])throw new Error("Should not be trying to reload a tile that was never loaded or has been removed");const W=this.loaded[N];if(W.showCollisionBoxes=V.showCollisionBoxes,W.status==="parsing"){const J=yield W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor);let ce;if(this.fetching[N]){const{rawTileData:de,cacheControl:me,resourceTiming:se}=this.fetching[N];delete this.fetching[N],ce=_.e({rawTileData:de.slice(0)},J,me,se)}else ce=J;return ce}if(W.status==="done"&&W.vectorTile)return W.parse(W.vectorTile,this.layerIndex,this.availableImages,this.actor)})}abortTile(V){return _._(this,void 0,void 0,function*(){const N=this.loading,W=V.uid;N&&N[W]&&N[W].abort&&(N[W].abort.abort(),delete N[W])})}removeTile(V){return _._(this,void 0,void 0,function*(){this.loaded&&this.loaded[V.uid]&&delete this.loaded[V.uid]})}}class z{constructor(){this.loaded={}}loadTile(V){return _._(this,void 0,void 0,function*(){const{uid:N,encoding:W,rawImageData:J,redFactor:ce,greenFactor:de,blueFactor:me,baseShift:se}=V,Se=J.width+2,Pe=J.height+2,ve=_.b(J)?new _.R({width:Se,height:Pe},yield _.bw(J,-1,-1,Se,Pe)):J,Le=new _.bx(N,ve,W,ce,de,me,se);return this.loaded=this.loaded||{},this.loaded[N]=Le,Le})}removeTile(V){const N=this.loaded,W=V.uid;N&&N[W]&&delete N[W]}}function j(te,V){if(te.length!==0){Y(te[0],V);for(var N=1;N<te.length;N++)Y(te[N],!V)}}function Y(te,V){for(var N=0,W=0,J=0,ce=te.length,de=ce-1;J<ce;de=J++){var me=(te[J][0]-te[de][0])*(te[de][1]+te[J][1]),se=N+me;W+=Math.abs(N)>=Math.abs(me)?N-se+me:me-se+N,N=se}N+W>=0!=!!V&&te.reverse()}var ee=_.by(function te(V,N){var W,J=V&&V.type;if(J==="FeatureCollection")for(W=0;W<V.features.length;W++)te(V.features[W],N);else if(J==="GeometryCollection")for(W=0;W<V.geometries.length;W++)te(V.geometries[W],N);else if(J==="Feature")te(V.geometry,N);else if(J==="Polygon")j(V.coordinates,N);else if(J==="MultiPolygon")for(W=0;W<V.coordinates.length;W++)j(V.coordinates[W],N);return V});const oe=_.bt.VectorTileFeature.prototype.toGeoJSON;var ue={exports:{}},be=_.bz,_e=_.bt.VectorTileFeature,Ce=Qe;function Qe(te,V){this.options=V||{},this.features=te,this.length=te.length}function mt(te,V){this.id=typeof te.id=="number"?te.id:void 0,this.type=te.type,this.rawGeometry=te.type===1?[te.geometry]:te.geometry,this.properties=te.tags,this.extent=V||4096}Qe.prototype.feature=function(te){return new mt(this.features[te],this.options.extent)},mt.prototype.loadGeometry=function(){var te=this.rawGeometry;this.geometry=[];for(var V=0;V<te.length;V++){for(var N=te[V],W=[],J=0;J<N.length;J++)W.push(new be(N[J][0],N[J][1]));this.geometry.push(W)}return this.geometry},mt.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var te=this.geometry,V=1/0,N=-1/0,W=1/0,J=-1/0,ce=0;ce<te.length;ce++)for(var de=te[ce],me=0;me<de.length;me++){var se=de[me];V=Math.min(V,se.x),N=Math.max(N,se.x),W=Math.min(W,se.y),J=Math.max(J,se.y)}return[V,W,N,J]},mt.prototype.toGeoJSON=_e.prototype.toGeoJSON;var Ae=_.bA,St=Ce;function wt(te){var V=new Ae;return function(N,W){for(var J in N.layers)W.writeMessage(3,Nt,N.layers[J])}(te,V),V.finish()}function Nt(te,V){var N;V.writeVarintField(15,te.version||1),V.writeStringField(1,te.name||""),V.writeVarintField(5,te.extent||4096);var W={keys:[],values:[],keycache:{},valuecache:{}};for(N=0;N<te.length;N++)W.feature=te.feature(N),V.writeMessage(2,Ct,W);var J=W.keys;for(N=0;N<J.length;N++)V.writeStringField(3,J[N]);var ce=W.values;for(N=0;N<ce.length;N++)V.writeMessage(4,tr,ce[N])}function Ct(te,V){var N=te.feature;N.id!==void 0&&V.writeVarintField(1,N.id),V.writeMessage(2,Sn,te),V.writeVarintField(3,N.type),V.writeMessage(4,rn,N)}function Sn(te,V){var N=te.feature,W=te.keys,J=te.values,ce=te.keycache,de=te.valuecache;for(var me in N.properties){var se=N.properties[me],Se=ce[me];if(se!==null){Se===void 0&&(W.push(me),ce[me]=Se=W.length-1),V.writeVarint(Se);var Pe=typeof se;Pe!=="string"&&Pe!=="boolean"&&Pe!=="number"&&(se=JSON.stringify(se));var ve=Pe+":"+se,Le=de[ve];Le===void 0&&(J.push(se),de[ve]=Le=J.length-1),V.writeVarint(Le)}}}function zt(te,V){return(V<<3)+(7&te)}function pi(te){return te<<1^te>>31}function rn(te,V){for(var N=te.loadGeometry(),W=te.type,J=0,ce=0,de=N.length,me=0;me<de;me++){var se=N[me],Se=1;W===1&&(Se=se.length),V.writeVarint(zt(1,Se));for(var Pe=W===3?se.length-1:se.length,ve=0;ve<Pe;ve++){ve===1&&W!==1&&V.writeVarint(zt(2,Pe-1));var Le=se[ve].x-J,at=se[ve].y-ce;V.writeVarint(pi(Le)),V.writeVarint(pi(at)),J+=Le,ce+=at}W===3&&V.writeVarint(zt(7,1))}}function tr(te,V){var N=typeof te;N==="string"?V.writeStringField(1,te):N==="boolean"?V.writeBooleanField(7,te):N==="number"&&(te%1!=0?V.writeDoubleField(3,te):te<0?V.writeSVarintField(6,te):V.writeVarintField(5,te))}ue.exports=wt,ue.exports.fromVectorTileJs=wt,ue.exports.fromGeojsonVt=function(te,V){V=V||{};var N={};for(var W in te)N[W]=new St(te[W].features,V),N[W].name=W,N[W].version=V.version,N[W].extent=V.extent;return wt({layers:N})},ue.exports.GeoJSONWrapper=St;var Ui=_.by(ue.exports);const Sr={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:te=>te},jn=Math.fround||(kn=new Float32Array(1),te=>(kn[0]=+te,kn[0]));var kn;const Hi=3,sn=5,kr=6;class En{constructor(V){this.options=Object.assign(Object.create(Sr),V),this.trees=new Array(this.options.maxZoom+1),this.stride=this.options.reduce?7:6,this.clusterProps=[]}load(V){const{log:N,minZoom:W,maxZoom:J}=this.options;N&&console.time("total time");const ce=`prepare ${V.length} points`;N&&console.time(ce),this.points=V;const de=[];for(let se=0;se<V.length;se++){const Se=V[se];if(!Se.geometry)continue;const[Pe,ve]=Se.geometry.coordinates,Le=jn(ke(Pe)),at=jn(He(ve));de.push(Le,at,1/0,se,-1,1),this.options.reduce&&de.push(0)}let me=this.trees[J+1]=this._createTree(de);N&&console.timeEnd(ce);for(let se=J;se>=W;se--){const Se=+Date.now();me=this.trees[se]=this._createTree(this._cluster(me,se)),N&&console.log("z%d: %d clusters in %dms",se,me.numItems,+Date.now()-Se)}return N&&console.timeEnd("total time"),this}getClusters(V,N){let W=((V[0]+180)%360+360)%360-180;const J=Math.max(-90,Math.min(90,V[1]));let ce=V[2]===180?180:((V[2]+180)%360+360)%360-180;const de=Math.max(-90,Math.min(90,V[3]));if(V[2]-V[0]>=360)W=-180,ce=180;else if(W>ce){const ve=this.getClusters([W,J,180,de],N),Le=this.getClusters([-180,J,ce,de],N);return ve.concat(Le)}const me=this.trees[this._limitZoom(N)],se=me.range(ke(W),He(de),ke(ce),He(J)),Se=me.data,Pe=[];for(const ve of se){const Le=this.stride*ve;Pe.push(Se[Le+sn]>1?Tn(Se,Le,this.clusterProps):this.points[Se[Le+Hi]])}return Pe}getChildren(V){const N=this._getOriginId(V),W=this._getOriginZoom(V),J="No cluster with the specified id.",ce=this.trees[W];if(!ce)throw new Error(J);const de=ce.data;if(N*this.stride>=de.length)throw new Error(J);const me=this.options.radius/(this.options.extent*Math.pow(2,W-1)),se=ce.within(de[N*this.stride],de[N*this.stride+1],me),Se=[];for(const Pe of se){const ve=Pe*this.stride;de[ve+4]===V&&Se.push(de[ve+sn]>1?Tn(de,ve,this.clusterProps):this.points[de[ve+Hi]])}if(Se.length===0)throw new Error(J);return Se}getLeaves(V,N,W){const J=[];return this._appendLeaves(J,V,N=N||10,W=W||0,0),J}getTile(V,N,W){const J=this.trees[this._limitZoom(V)],ce=Math.pow(2,V),{extent:de,radius:me}=this.options,se=me/de,Se=(W-se)/ce,Pe=(W+1+se)/ce,ve={features:[]};return this._addTileFeatures(J.range((N-se)/ce,Se,(N+1+se)/ce,Pe),J.data,N,W,ce,ve),N===0&&this._addTileFeatures(J.range(1-se/ce,Se,1,Pe),J.data,ce,W,ce,ve),N===ce-1&&this._addTileFeatures(J.range(0,Se,se/ce,Pe),J.data,-1,W,ce,ve),ve.features.length?ve:null}getClusterExpansionZoom(V){let N=this._getOriginZoom(V)-1;for(;N<=this.options.maxZoom;){const W=this.getChildren(V);if(N++,W.length!==1)break;V=W[0].properties.cluster_id}return N}_appendLeaves(V,N,W,J,ce){const de=this.getChildren(N);for(const me of de){const se=me.properties;if(se&&se.cluster?ce+se.point_count<=J?ce+=se.point_count:ce=this._appendLeaves(V,se.cluster_id,W,J,ce):ce<J?ce++:V.push(me),V.length===W)break}return ce}_createTree(V){const N=new _.av(V.length/this.stride|0,this.options.nodeSize,Float32Array);for(let W=0;W<V.length;W+=this.stride)N.add(V[W],V[W+1]);return N.finish(),N.data=V,N}_addTileFeatures(V,N,W,J,ce,de){for(const me of V){const se=me*this.stride,Se=N[se+sn]>1;let Pe,ve,Le;if(Se)Pe=Cn(N,se,this.clusterProps),ve=N[se],Le=N[se+1];else{const jt=this.points[N[se+Hi]];Pe=jt.properties;const[vt,Ut]=jt.geometry.coordinates;ve=ke(vt),Le=He(Ut)}const at={type:1,geometry:[[Math.round(this.options.extent*(ve*ce-W)),Math.round(this.options.extent*(Le*ce-J))]],tags:Pe};let lt;lt=Se||this.options.generateId?N[se+Hi]:this.points[N[se+Hi]].id,lt!==void 0&&(at.id=lt),de.features.push(at)}}_limitZoom(V){return Math.max(this.options.minZoom,Math.min(Math.floor(+V),this.options.maxZoom+1))}_cluster(V,N){const{radius:W,extent:J,reduce:ce,minPoints:de}=this.options,me=W/(J*Math.pow(2,N)),se=V.data,Se=[],Pe=this.stride;for(let ve=0;ve<se.length;ve+=Pe){if(se[ve+2]<=N)continue;se[ve+2]=N;const Le=se[ve],at=se[ve+1],lt=V.within(se[ve],se[ve+1],me),jt=se[ve+sn];let vt=jt;for(const Ut of lt){const Rt=Ut*Pe;se[Rt+2]>N&&(vt+=se[Rt+sn])}if(vt>jt&&vt>=de){let Ut,Rt=Le*jt,Di=at*jt,ki=-1;const Mt=((ve/Pe|0)<<5)+(N+1)+this.points.length;for(const ei of lt){const xi=ei*Pe;if(se[xi+2]<=N)continue;se[xi+2]=N;const Fi=se[xi+sn];Rt+=se[xi]*Fi,Di+=se[xi+1]*Fi,se[xi+4]=Mt,ce&&(Ut||(Ut=this._map(se,ve,!0),ki=this.clusterProps.length,this.clusterProps.push(Ut)),ce(Ut,this._map(se,xi)))}se[ve+4]=Mt,Se.push(Rt/vt,Di/vt,1/0,Mt,-1,vt),ce&&Se.push(ki)}else{for(let Ut=0;Ut<Pe;Ut++)Se.push(se[ve+Ut]);if(vt>1)for(const Ut of lt){const Rt=Ut*Pe;if(!(se[Rt+2]<=N)){se[Rt+2]=N;for(let Di=0;Di<Pe;Di++)Se.push(se[Rt+Di])}}}}return Se}_getOriginId(V){return V-this.points.length>>5}_getOriginZoom(V){return(V-this.points.length)%32}_map(V,N,W){if(V[N+sn]>1){const de=this.clusterProps[V[N+kr]];return W?Object.assign({},de):de}const J=this.points[V[N+Hi]].properties,ce=this.options.map(J);return W&&ce===J?Object.assign({},ce):ce}}function Tn(te,V,N){return{type:"Feature",id:te[V+Hi],properties:Cn(te,V,N),geometry:{type:"Point",coordinates:[(W=te[V],360*(W-.5)),Ze(te[V+1])]}};var W}function Cn(te,V,N){const W=te[V+sn],J=W>=1e4?`${Math.round(W/1e3)}k`:W>=1e3?Math.round(W/100)/10+"k":W,ce=te[V+kr],de=ce===-1?{}:Object.assign({},N[ce]);return Object.assign(de,{cluster:!0,cluster_id:te[V+Hi],point_count:W,point_count_abbreviated:J})}function ke(te){return te/360+.5}function He(te){const V=Math.sin(te*Math.PI/180),N=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return N<0?0:N>1?1:N}function Ze(te){const V=(180-360*te)*Math.PI/180;return 360*Math.atan(Math.exp(V))/Math.PI-90}function ot(te,V,N,W){let J=W;const ce=V+(N-V>>1);let de,me=N-V;const se=te[V],Se=te[V+1],Pe=te[N],ve=te[N+1];for(let Le=V+3;Le<N;Le+=3){const at=Vt(te[Le],te[Le+1],se,Se,Pe,ve);if(at>J)de=Le,J=at;else if(at===J){const lt=Math.abs(Le-ce);lt<me&&(de=Le,me=lt)}}J>W&&(de-V>3&&ot(te,V,de,W),te[de+2]=J,N-de>3&&ot(te,de,N,W))}function Vt(te,V,N,W,J,ce){let de=J-N,me=ce-W;if(de!==0||me!==0){const se=((te-N)*de+(V-W)*me)/(de*de+me*me);se>1?(N=J,W=ce):se>0&&(N+=de*se,W+=me*se)}return de=te-N,me=V-W,de*de+me*me}function Qt(te,V,N,W){const J={id:te??null,type:V,geometry:N,tags:W,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};if(V==="Point"||V==="MultiPoint"||V==="LineString")kt(J,N);else if(V==="Polygon")kt(J,N[0]);else if(V==="MultiLineString")for(const ce of N)kt(J,ce);else if(V==="MultiPolygon")for(const ce of N)kt(J,ce[0]);return J}function kt(te,V){for(let N=0;N<V.length;N+=3)te.minX=Math.min(te.minX,V[N]),te.minY=Math.min(te.minY,V[N+1]),te.maxX=Math.max(te.maxX,V[N]),te.maxY=Math.max(te.maxY,V[N+1])}function bt(te,V,N,W){if(!V.geometry)return;const J=V.geometry.coordinates;if(J&&J.length===0)return;const ce=V.geometry.type,de=Math.pow(N.tolerance/((1<<N.maxZoom)*N.extent),2);let me=[],se=V.id;if(N.promoteId?se=V.properties[N.promoteId]:N.generateId&&(se=W||0),ce==="Point")ri(J,me);else if(ce==="MultiPoint")for(const Se of J)ri(Se,me);else if(ce==="LineString")xe(J,me,de,!1);else if(ce==="MultiLineString"){if(N.lineMetrics){for(const Se of J)me=[],xe(Se,me,de,!1),te.push(Qt(se,"LineString",me,V.properties));return}wi(J,me,de,!1)}else if(ce==="Polygon")wi(J,me,de,!0);else{if(ce!=="MultiPolygon"){if(ce==="GeometryCollection"){for(const Se of V.geometry.geometries)bt(te,{id:se,geometry:Se,properties:V.properties},N,W);return}throw new Error("Input data is not a valid GeoJSON object.")}for(const Se of J){const Pe=[];wi(Se,Pe,de,!0),me.push(Pe)}}te.push(Qt(se,ce,me,V.properties))}function ri(te,V){V.push(Go(te[0]),Wt(te[1]),0)}function xe(te,V,N,W){let J,ce,de=0;for(let se=0;se<te.length;se++){const Se=Go(te[se][0]),Pe=Wt(te[se][1]);V.push(Se,Pe,0),se>0&&(de+=W?(J*Pe-Se*ce)/2:Math.sqrt(Math.pow(Se-J,2)+Math.pow(Pe-ce,2))),J=Se,ce=Pe}const me=V.length-3;V[2]=1,ot(V,0,me,N),V[me+2]=1,V.size=Math.abs(de),V.start=0,V.end=V.size}function wi(te,V,N,W){for(let J=0;J<te.length;J++){const ce=[];xe(te[J],ce,N,W),V.push(ce)}}function Go(te){return te/360+.5}function Wt(te){const V=Math.sin(te*Math.PI/180),N=.5-.25*Math.log((1+V)/(1-V))/Math.PI;return N<0?0:N>1?1:N}function Si(te,V,N,W,J,ce,de,me){if(W/=V,ce>=(N/=V)&&de<W)return te;if(de<N||ce>=W)return null;const se=[];for(const Se of te){const Pe=Se.geometry;let ve=Se.type;const Le=J===0?Se.minX:Se.minY,at=J===0?Se.maxX:Se.maxY;if(Le>=N&&at<W){se.push(Se);continue}if(at<N||Le>=W)continue;let lt=[];if(ve==="Point"||ve==="MultiPoint")Yo(Pe,lt,N,W,J);else if(ve==="LineString")is(Pe,lt,N,W,J,!1,me.lineMetrics);else if(ve==="MultiLineString")Js(Pe,lt,N,W,J,!1);else if(ve==="Polygon")Js(Pe,lt,N,W,J,!0);else if(ve==="MultiPolygon")for(const jt of Pe){const vt=[];Js(jt,vt,N,W,J,!0),vt.length&&lt.push(vt)}if(lt.length){if(me.lineMetrics&&ve==="LineString"){for(const jt of lt)se.push(Qt(Se.id,ve,jt,Se.tags));continue}ve!=="LineString"&&ve!=="MultiLineString"||(lt.length===1?(ve="LineString",lt=lt[0]):ve="MultiLineString"),ve!=="Point"&&ve!=="MultiPoint"||(ve=lt.length===3?"Point":"MultiPoint"),se.push(Qt(Se.id,ve,lt,Se.tags))}}return se.length?se:null}function Yo(te,V,N,W,J){for(let ce=0;ce<te.length;ce+=3){const de=te[ce+J];de>=N&&de<=W&&Un(V,te[ce],te[ce+1],te[ce+2])}}function is(te,V,N,W,J,ce,de){let me=$r(te);const se=J===0?Xo:Ko;let Se,Pe,ve=te.start;for(let vt=0;vt<te.length-3;vt+=3){const Ut=te[vt],Rt=te[vt+1],Di=te[vt+2],ki=te[vt+3],Mt=te[vt+4],ei=J===0?Ut:Rt,xi=J===0?ki:Mt;let Fi=!1;de&&(Se=Math.sqrt(Math.pow(Ut-ki,2)+Math.pow(Rt-Mt,2))),ei<N?xi>N&&(Pe=se(me,Ut,Rt,ki,Mt,N),de&&(me.start=ve+Se*Pe)):ei>W?xi<W&&(Pe=se(me,Ut,Rt,ki,Mt,W),de&&(me.start=ve+Se*Pe)):Un(me,Ut,Rt,Di),xi<N&&ei>=N&&(Pe=se(me,Ut,Rt,ki,Mt,N),Fi=!0),xi>W&&ei<=W&&(Pe=se(me,Ut,Rt,ki,Mt,W),Fi=!0),!ce&&Fi&&(de&&(me.end=ve+Se*Pe),V.push(me),me=$r(te)),de&&(ve+=Se)}let Le=te.length-3;const at=te[Le],lt=te[Le+1],jt=J===0?at:lt;jt>=N&&jt<=W&&Un(me,at,lt,te[Le+2]),Le=me.length-3,ce&&Le>=3&&(me[Le]!==me[0]||me[Le+1]!==me[1])&&Un(me,me[0],me[1],me[2]),me.length&&V.push(me)}function $r(te){const V=[];return V.size=te.size,V.start=te.start,V.end=te.end,V}function Js(te,V,N,W,J,ce){for(const de of te)is(de,V,N,W,J,ce,!1)}function Un(te,V,N,W){te.push(V,N,W)}function Xo(te,V,N,W,J,ce){const de=(ce-V)/(W-V);return Un(te,ce,N+(J-N)*de,1),de}function Ko(te,V,N,W,J,ce){const de=(ce-N)/(J-N);return Un(te,V+(W-V)*de,ce,1),de}function ze(te,V){const N=[];for(let W=0;W<te.length;W++){const J=te[W],ce=J.type;let de;if(ce==="Point"||ce==="MultiPoint"||ce==="LineString")de=Er(J.geometry,V);else if(ce==="MultiLineString"||ce==="Polygon"){de=[];for(const me of J.geometry)de.push(Er(me,V))}else if(ce==="MultiPolygon"){de=[];for(const me of J.geometry){const se=[];for(const Se of me)se.push(Er(Se,V));de.push(se)}}N.push(Qt(J.id,ce,de,J.tags))}return N}function Er(te,V){const N=[];N.size=te.size,te.start!==void 0&&(N.start=te.start,N.end=te.end);for(let W=0;W<te.length;W+=3)N.push(te[W]+V,te[W+1],te[W+2]);return N}function on(te,V){if(te.transformed)return te;const N=1<<te.z,W=te.x,J=te.y;for(const ce of te.features){const de=ce.geometry,me=ce.type;if(ce.geometry=[],me===1)for(let se=0;se<de.length;se+=2)ce.geometry.push(Tr(de[se],de[se+1],V,N,W,J));else for(let se=0;se<de.length;se++){const Se=[];for(let Pe=0;Pe<de[se].length;Pe+=2)Se.push(Tr(de[se][Pe],de[se][Pe+1],V,N,W,J));ce.geometry.push(Se)}}return te.transformed=!0,te}function Tr(te,V,N,W,J,ce){return[Math.round(N*(te*W-J)),Math.round(N*(V*W-ce))]}function ns(te,V,N,W,J){const ce=V===J.maxZoom?0:J.tolerance/((1<<V)*J.extent),de={features:[],numPoints:0,numSimplified:0,numFeatures:te.length,source:null,x:N,y:W,z:V,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0};for(const me of te)Fe(de,me,ce,J);return de}function Fe(te,V,N,W){const J=V.geometry,ce=V.type,de=[];if(te.minX=Math.min(te.minX,V.minX),te.minY=Math.min(te.minY,V.minY),te.maxX=Math.max(te.maxX,V.maxX),te.maxY=Math.max(te.maxY,V.maxY),ce==="Point"||ce==="MultiPoint")for(let me=0;me<J.length;me+=3)de.push(J[me],J[me+1]),te.numPoints++,te.numSimplified++;else if(ce==="LineString")Tt(de,J,te,N,!1,!1);else if(ce==="MultiLineString"||ce==="Polygon")for(let me=0;me<J.length;me++)Tt(de,J[me],te,N,ce==="Polygon",me===0);else if(ce==="MultiPolygon")for(let me=0;me<J.length;me++){const se=J[me];for(let Se=0;Se<se.length;Se++)Tt(de,se[Se],te,N,!0,Se===0)}if(de.length){let me=V.tags||null;if(ce==="LineString"&&W.lineMetrics){me={};for(const Se in V.tags)me[Se]=V.tags[Se];me.mapbox_clip_start=J.start/J.size,me.mapbox_clip_end=J.end/J.size}const se={geometry:de,type:ce==="Polygon"||ce==="MultiPolygon"?3:ce==="LineString"||ce==="MultiLineString"?2:1,tags:me};V.id!==null&&(se.id=V.id),te.features.push(se)}}function Tt(te,V,N,W,J,ce){const de=W*W;if(W>0&&V.size<(J?de:W))return void(N.numPoints+=V.length/3);const me=[];for(let se=0;se<V.length;se+=3)(W===0||V[se+2]>de)&&(N.numSimplified++,me.push(V[se],V[se+1])),N.numPoints++;J&&function(se,Se){let Pe=0;for(let ve=0,Le=se.length,at=Le-2;ve<Le;at=ve,ve+=2)Pe+=(se[ve]-se[at])*(se[ve+1]+se[at+1]);if(Pe>0===Se)for(let ve=0,Le=se.length;ve<Le/2;ve+=2){const at=se[ve],lt=se[ve+1];se[ve]=se[Le-2-ve],se[ve+1]=se[Le-1-ve],se[Le-2-ve]=at,se[Le-1-ve]=lt}}(me,ce),te.push(me)}const pt={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0};class fn{constructor(V,N){const W=(N=this.options=function(ce,de){for(const me in de)ce[me]=de[me];return ce}(Object.create(pt),N)).debug;if(W&&console.time("preprocess data"),N.maxZoom<0||N.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(N.promoteId&&N.generateId)throw new Error("promoteId and generateId cannot be used together.");let J=function(ce,de){const me=[];if(ce.type==="FeatureCollection")for(let se=0;se<ce.features.length;se++)bt(me,ce.features[se],de,se);else bt(me,ce.type==="Feature"?ce:{geometry:ce},de);return me}(V,N);this.tiles={},this.tileCoords=[],W&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",N.indexMaxZoom,N.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),J=function(ce,de){const me=de.buffer/de.extent;let se=ce;const Se=Si(ce,1,-1-me,me,0,-1,2,de),Pe=Si(ce,1,1-me,2+me,0,-1,2,de);return(Se||Pe)&&(se=Si(ce,1,-me,1+me,0,-1,2,de)||[],Se&&(se=ze(Se,1).concat(se)),Pe&&(se=se.concat(ze(Pe,-1)))),se}(J,N),J.length&&this.splitTile(J,0,0,0),W&&(J.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}splitTile(V,N,W,J,ce,de,me){const se=[V,N,W,J],Se=this.options,Pe=Se.debug;for(;se.length;){J=se.pop(),W=se.pop(),N=se.pop(),V=se.pop();const ve=1<<N,Le=ir(N,W,J);let at=this.tiles[Le];if(!at&&(Pe>1&&console.time("creation"),at=this.tiles[Le]=ns(V,N,W,J,Se),this.tileCoords.push({z:N,x:W,y:J}),Pe)){Pe>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",N,W,J,at.numFeatures,at.numPoints,at.numSimplified),console.timeEnd("creation"));const Fi=`z${N}`;this.stats[Fi]=(this.stats[Fi]||0)+1,this.total++}if(at.source=V,ce==null){if(N===Se.indexMaxZoom||at.numPoints<=Se.indexMaxPoints)continue}else{if(N===Se.maxZoom||N===ce)continue;if(ce!=null){const Fi=ce-N;if(W!==de>>Fi||J!==me>>Fi)continue}}if(at.source=null,V.length===0)continue;Pe>1&&console.time("clipping");const lt=.5*Se.buffer/Se.extent,jt=.5-lt,vt=.5+lt,Ut=1+lt;let Rt=null,Di=null,ki=null,Mt=null,ei=Si(V,ve,W-lt,W+vt,0,at.minX,at.maxX,Se),xi=Si(V,ve,W+jt,W+Ut,0,at.minX,at.maxX,Se);V=null,ei&&(Rt=Si(ei,ve,J-lt,J+vt,1,at.minY,at.maxY,Se),Di=Si(ei,ve,J+jt,J+Ut,1,at.minY,at.maxY,Se),ei=null),xi&&(ki=Si(xi,ve,J-lt,J+vt,1,at.minY,at.maxY,Se),Mt=Si(xi,ve,J+jt,J+Ut,1,at.minY,at.maxY,Se),xi=null),Pe>1&&console.timeEnd("clipping"),se.push(Rt||[],N+1,2*W,2*J),se.push(Di||[],N+1,2*W,2*J+1),se.push(ki||[],N+1,2*W+1,2*J),se.push(Mt||[],N+1,2*W+1,2*J+1)}}getTile(V,N,W){V=+V,N=+N,W=+W;const J=this.options,{extent:ce,debug:de}=J;if(V<0||V>24)return null;const me=1<<V,se=ir(V,N=N+me&me-1,W);if(this.tiles[se])return on(this.tiles[se],ce);de>1&&console.log("drilling down to z%d-%d-%d",V,N,W);let Se,Pe=V,ve=N,Le=W;for(;!Se&&Pe>0;)Pe--,ve>>=1,Le>>=1,Se=this.tiles[ir(Pe,ve,Le)];return Se&&Se.source?(de>1&&(console.log("found parent tile z%d-%d-%d",Pe,ve,Le),console.time("drilling down")),this.splitTile(Se.source,Pe,ve,Le,V,N,W),de>1&&console.timeEnd("drilling down"),this.tiles[se]?on(this.tiles[se],ce):null):null}}function ir(te,V,N){return 32*((1<<te)*N+V)+te}function xt(te,V){return V?te.properties[V]:te.id}function Cr(te,V){if(te==null)return!0;if(te.type==="Feature")return xt(te,V)!=null;if(te.type==="FeatureCollection"){const N=new Set;for(const W of te.features){const J=xt(W,V);if(J==null||N.has(J))return!1;N.add(J)}return!0}return!1}function jr(te,V){const N=new Map;if(te!=null)if(te.type==="Feature")N.set(xt(te,V),te);else for(const W of te.features)N.set(xt(W,V),W);return N}class rs extends R{constructor(){super(...arguments),this._dataUpdateable=new Map}loadVectorTile(V,N){return _._(this,void 0,void 0,function*(){const W=V.tileID.canonical;if(!this._geoJSONIndex)throw new Error("Unable to parse the data into a cluster or geojson");const J=this._geoJSONIndex.getTile(W.z,W.x,W.y);if(!J)return null;const ce=new class{constructor(me){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=_.X,this.length=me.length,this._features=me}feature(me){return new class{constructor(se){this._feature=se,this.extent=_.X,this.type=se.type,this.properties=se.tags,"id"in se&&!isNaN(se.id)&&(this.id=parseInt(se.id,10))}loadGeometry(){if(this._feature.type===1){const se=[];for(const Se of this._feature.geometry)se.push([new _.P(Se[0],Se[1])]);return se}{const se=[];for(const Se of this._feature.geometry){const Pe=[];for(const ve of Se)Pe.push(new _.P(ve[0],ve[1]));se.push(Pe)}return se}}toGeoJSON(se,Se,Pe){return oe.call(this,se,Se,Pe)}}(this._features[me])}}(J.features);let de=Ui(ce);return de.byteOffset===0&&de.byteLength===de.buffer.byteLength||(de=new Uint8Array(de)),{vectorTile:ce,rawData:de.buffer}})}loadData(V){return _._(this,void 0,void 0,function*(){var N;(N=this._pendingRequest)===null||N===void 0||N.abort();const W=!!(V&&V.request&&V.request.collectResourceTiming)&&new _.bv(V.request);this._pendingRequest=new AbortController;try{this._pendingData=this.loadAndProcessGeoJSON(V,this._pendingRequest),this._geoJSONIndex=V.cluster?new En(function({superclusterOptions:de,clusterProperties:me}){if(!me||!de)return de;const se={},Se={},Pe={accumulated:null,zoom:0},ve={properties:null},Le=Object.keys(me);for(const at of Le){const[lt,jt]=me[at],vt=_.bC(jt),Ut=_.bC(typeof lt=="string"?[lt,["accumulated"],["get",at]]:lt);se[at]=vt.value,Se[at]=Ut.value}return de.map=at=>{ve.properties=at;const lt={};for(const jt of Le)lt[jt]=se[jt].evaluate(Pe,ve);return lt},de.reduce=(at,lt)=>{ve.properties=lt;for(const jt of Le)Pe.accumulated=at[jt],at[jt]=Se[jt].evaluate(Pe,ve)},de}(V)).load((yield this._pendingData).features):(J=yield this._pendingData,new fn(J,V.geojsonVtOptions)),this.loaded={};const ce={};if(W){const de=W.finish();de&&(ce.resourceTiming={},ce.resourceTiming[V.source]=JSON.parse(JSON.stringify(de)))}return ce}catch(ce){if(delete this._pendingRequest,_.bB(ce))return{abandoned:!0};throw ce}var J})}getData(){return _._(this,void 0,void 0,function*(){return this._pendingData})}reloadTile(V){const N=this.loaded;return N&&N[V.uid]?super.reloadTile(V):this.loadTile(V)}loadAndProcessGeoJSON(V,N){return _._(this,void 0,void 0,function*(){let W=yield this.loadGeoJSON(V,N);if(delete this._pendingRequest,typeof W!="object")throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(ee(W,!0),V.filter){const J=_.bC(V.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(J.result==="error")throw new Error(J.value.map(de=>`${de.key}: ${de.message}`).join(", "));W={type:"FeatureCollection",features:W.features.filter(de=>J.value.evaluate({zoom:0},de))}}return W})}loadGeoJSON(V,N){return _._(this,void 0,void 0,function*(){const{promoteId:W}=V;if(V.request){const J=yield _.h(V.request,N);return this._dataUpdateable=Cr(J.data,W)?jr(J.data,W):void 0,J.data}if(typeof V.data=="string")try{const J=JSON.parse(V.data);return this._dataUpdateable=Cr(J,W)?jr(J,W):void 0,J}catch{throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`)}if(!V.dataDiff)throw new Error(`Input data given to '${V.source}' is not a valid GeoJSON object.`);if(!this._dataUpdateable)throw new Error(`Cannot update existing geojson data in ${V.source}`);return function(J,ce,de){var me,se,Se,Pe;if(ce.removeAll&&J.clear(),ce.remove)for(const ve of ce.remove)J.delete(ve);if(ce.add)for(const ve of ce.add){const Le=xt(ve,de);Le!=null&&J.set(Le,ve)}if(ce.update)for(const ve of ce.update){let Le=J.get(ve.id);if(Le==null)continue;const at=!ve.removeAllProperties&&(((me=ve.removeProperties)===null||me===void 0?void 0:me.length)>0||((se=ve.addOrUpdateProperties)===null||se===void 0?void 0:se.length)>0);if((ve.newGeometry||ve.removeAllProperties||at)&&(Le=Object.assign({},Le),J.set(ve.id,Le),at&&(Le.properties=Object.assign({},Le.properties))),ve.newGeometry&&(Le.geometry=ve.newGeometry),ve.removeAllProperties)Le.properties={};else if(((Se=ve.removeProperties)===null||Se===void 0?void 0:Se.length)>0)for(const lt of ve.removeProperties)Object.prototype.hasOwnProperty.call(Le.properties,lt)&&delete Le.properties[lt];if(((Pe=ve.addOrUpdateProperties)===null||Pe===void 0?void 0:Pe.length)>0)for(const{key:lt,value:jt}of ve.addOrUpdateProperties)Le.properties[lt]=jt}}(this._dataUpdateable,V.dataDiff,W),{type:"FeatureCollection",features:Array.from(this._dataUpdateable.values())}})}removeSource(V){return _._(this,void 0,void 0,function*(){this._pendingRequest&&this._pendingRequest.abort()})}getClusterExpansionZoom(V){return this._geoJSONIndex.getClusterExpansionZoom(V.clusterId)}getClusterChildren(V){return this._geoJSONIndex.getChildren(V.clusterId)}getClusterLeaves(V){return this._geoJSONIndex.getLeaves(V.clusterId,V.limit,V.offset)}}class Mr{constructor(V){this.self=V,this.actor=new _.F(V),this.layerIndexes={},this.availableImages={},this.workerSources={},this.demWorkerSources={},this.externalWorkerSourceTypes={},this.self.registerWorkerSource=(N,W)=>{if(this.externalWorkerSourceTypes[N])throw new Error(`Worker source with name "${N}" already registered.`);this.externalWorkerSourceTypes[N]=W},this.self.addProtocol=_.bi,this.self.removeProtocol=_.bj,this.self.registerRTLTextPlugin=N=>{if(_.bD.isParsed())throw new Error("RTL text plugin already registered.");_.bD.setMethods(N)},this.actor.registerMessageHandler("LDT",(N,W)=>this._getDEMWorkerSource(N,W.source).loadTile(W)),this.actor.registerMessageHandler("RDT",(N,W)=>_._(this,void 0,void 0,function*(){this._getDEMWorkerSource(N,W.source).removeTile(W)})),this.actor.registerMessageHandler("GCEZ",(N,W)=>_._(this,void 0,void 0,function*(){return this._getWorkerSource(N,W.type,W.source).getClusterExpansionZoom(W)})),this.actor.registerMessageHandler("GCC",(N,W)=>_._(this,void 0,void 0,function*(){return this._getWorkerSource(N,W.type,W.source).getClusterChildren(W)})),this.actor.registerMessageHandler("GCL",(N,W)=>_._(this,void 0,void 0,function*(){return this._getWorkerSource(N,W.type,W.source).getClusterLeaves(W)})),this.actor.registerMessageHandler("LD",(N,W)=>this._getWorkerSource(N,W.type,W.source).loadData(W)),this.actor.registerMessageHandler("GD",(N,W)=>this._getWorkerSource(N,W.type,W.source).getData()),this.actor.registerMessageHandler("LT",(N,W)=>this._getWorkerSource(N,W.type,W.source).loadTile(W)),this.actor.registerMessageHandler("RT",(N,W)=>this._getWorkerSource(N,W.type,W.source).reloadTile(W)),this.actor.registerMessageHandler("AT",(N,W)=>this._getWorkerSource(N,W.type,W.source).abortTile(W)),this.actor.registerMessageHandler("RMT",(N,W)=>this._getWorkerSource(N,W.type,W.source).removeTile(W)),this.actor.registerMessageHandler("RS",(N,W)=>_._(this,void 0,void 0,function*(){if(!this.workerSources[N]||!this.workerSources[N][W.type]||!this.workerSources[N][W.type][W.source])return;const J=this.workerSources[N][W.type][W.source];delete this.workerSources[N][W.type][W.source],J.removeSource!==void 0&&J.removeSource(W)})),this.actor.registerMessageHandler("RM",N=>_._(this,void 0,void 0,function*(){delete this.layerIndexes[N],delete this.availableImages[N],delete this.workerSources[N],delete this.demWorkerSources[N]})),this.actor.registerMessageHandler("SR",(N,W)=>_._(this,void 0,void 0,function*(){this.referrer=W})),this.actor.registerMessageHandler("SRPS",(N,W)=>this._syncRTLPluginState(N,W)),this.actor.registerMessageHandler("IS",(N,W)=>_._(this,void 0,void 0,function*(){this.self.importScripts(W)})),this.actor.registerMessageHandler("SI",(N,W)=>this._setImages(N,W)),this.actor.registerMessageHandler("UL",(N,W)=>_._(this,void 0,void 0,function*(){this._getLayerIndex(N).update(W.layers,W.removedIds)})),this.actor.registerMessageHandler("SL",(N,W)=>_._(this,void 0,void 0,function*(){this._getLayerIndex(N).replace(W)}))}_setImages(V,N){return _._(this,void 0,void 0,function*(){this.availableImages[V]=N;for(const W in this.workerSources[V]){const J=this.workerSources[V][W];for(const ce in J)J[ce].availableImages=N}})}_syncRTLPluginState(V,N){return _._(this,void 0,void 0,function*(){if(_.bD.isParsed())return _.bD.getState();if(N.pluginStatus!=="loading")return _.bD.setState(N),N;const W=N.pluginURL;if(this.self.importScripts(W),_.bD.isParsed()){const J={pluginStatus:"loaded",pluginURL:W};return _.bD.setState(J),J}throw _.bD.setState({pluginStatus:"error",pluginURL:""}),new Error(`RTL Text Plugin failed to import scripts from ${W}`)})}_getAvailableImages(V){let N=this.availableImages[V];return N||(N=[]),N}_getLayerIndex(V){let N=this.layerIndexes[V];return N||(N=this.layerIndexes[V]=new h),N}_getWorkerSource(V,N,W){if(this.workerSources[V]||(this.workerSources[V]={}),this.workerSources[V][N]||(this.workerSources[V][N]={}),!this.workerSources[V][N][W]){const J={sendAsync:(ce,de)=>(ce.targetMapId=V,this.actor.sendAsync(ce,de))};switch(N){case"vector":this.workerSources[V][N][W]=new R(J,this._getLayerIndex(V),this._getAvailableImages(V));break;case"geojson":this.workerSources[V][N][W]=new rs(J,this._getLayerIndex(V),this._getAvailableImages(V));break;default:this.workerSources[V][N][W]=new this.externalWorkerSourceTypes[N](J,this._getLayerIndex(V),this._getAvailableImages(V))}}return this.workerSources[V][N][W]}_getDEMWorkerSource(V,N){return this.demWorkerSources[V]||(this.demWorkerSources[V]={}),this.demWorkerSources[V][N]||(this.demWorkerSources[V][N]=new z),this.demWorkerSources[V][N]}}return _.i(self)&&(self.worker=new Mr(self)),Mr}),p("index",["exports","./shared"],function(_,h){var M="4.7.0";let A,D;const R={now:typeof performance<"u"&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frameAsync:g=>new Promise((e,a)=>{const u=requestAnimationFrame(e);g.signal.addEventListener("abort",()=>{cancelAnimationFrame(u),a(h.c())})}),getImageData(g,e=0){return this.getImageCanvasContext(g).getImageData(-e,-e,g.width+2*e,g.height+2*e)},getImageCanvasContext(g){const e=window.document.createElement("canvas"),a=e.getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas 2d context");return e.width=g.width,e.height=g.height,a.drawImage(g,0,0,g.width,g.height),a},resolveURL:g=>(A||(A=document.createElement("a")),A.href=g,A.href),hardwareConcurrency:typeof navigator<"u"&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(D==null&&(D=matchMedia("(prefers-reduced-motion: reduce)")),D.matches)}};class z{static testProp(e){if(!z.docStyle)return e[0];for(let a=0;a<e.length;a++)if(e[a]in z.docStyle)return e[a];return e[0]}static create(e,a,u){const d=window.document.createElement(e);return a!==void 0&&(d.className=a),u&&u.appendChild(d),d}static createNS(e,a){return window.document.createElementNS(e,a)}static disableDrag(){z.docStyle&&z.selectProp&&(z.userSelect=z.docStyle[z.selectProp],z.docStyle[z.selectProp]="none")}static enableDrag(){z.docStyle&&z.selectProp&&(z.docStyle[z.selectProp]=z.userSelect)}static setTransform(e,a){e.style[z.transformProp]=a}static addEventListener(e,a,u,d={}){e.addEventListener(a,u,"passive"in d?d:d.capture)}static removeEventListener(e,a,u,d={}){e.removeEventListener(a,u,"passive"in d?d:d.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",z.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",z.suppressClickInternal,!0),window.setTimeout(()=>{window.removeEventListener("click",z.suppressClickInternal,!0)},0)}static getScale(e){const a=e.getBoundingClientRect();return{x:a.width/e.offsetWidth||1,y:a.height/e.offsetHeight||1,boundingClientRect:a}}static getPoint(e,a,u){const d=a.boundingClientRect;return new h.P((u.clientX-d.left)/a.x-e.clientLeft,(u.clientY-d.top)/a.y-e.clientTop)}static mousePos(e,a){const u=z.getScale(e);return z.getPoint(e,u,a)}static touchPos(e,a){const u=[],d=z.getScale(e);for(let m=0;m<a.length;m++)u.push(z.getPoint(e,d,a[m]));return u}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}z.docStyle=typeof window<"u"&&window.document&&window.document.documentElement.style,z.selectProp=z.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),z.transformProp=z.testProp(["transform","WebkitTransform"]);const j={supported:!1,testSupport:function(g){!oe&&ee&&(ue?be(g):Y=g)}};let Y,ee,oe=!1,ue=!1;function be(g){const e=g.createTexture();g.bindTexture(g.TEXTURE_2D,e);try{if(g.texImage2D(g.TEXTURE_2D,0,g.RGBA,g.RGBA,g.UNSIGNED_BYTE,ee),g.isContextLost())return;j.supported=!0}catch{}g.deleteTexture(e),oe=!0}var _e;typeof document<"u"&&(ee=document.createElement("img"),ee.onload=()=>{Y&&be(Y),Y=null,ue=!0},ee.onerror=()=>{oe=!0,Y=null},ee.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA="),function(g){let e,a,u,d;g.resetRequestQueue=()=>{e=[],a=0,u=0,d={}},g.addThrottleControl=T=>{const I=u++;return d[I]=T,I},g.removeThrottleControl=T=>{delete d[T],w()},g.getImage=(T,I,O=!0)=>new Promise((B,U)=>{j.supported&&(T.headers||(T.headers={}),T.headers.accept="image/webp,*/*"),h.e(T,{type:"image"}),e.push({abortController:I,requestParameters:T,supportImageRefresh:O,state:"queued",onError:Z=>{U(Z)},onSuccess:Z=>{B(Z)}}),w()});const m=T=>h._(this,void 0,void 0,function*(){T.state="running";const{requestParameters:I,supportImageRefresh:O,onError:B,onSuccess:U,abortController:Z}=T,G=O===!1&&!h.i(self)&&!h.g(I.url)&&(!I.headers||Object.keys(I.headers).reduce((re,ae)=>re&&ae==="accept",!0));a++;const Q=G?E(I,Z):h.m(I,Z);try{const re=yield Q;delete T.abortController,T.state="completed",re.data instanceof HTMLImageElement||h.b(re.data)?U(re):re.data&&U({data:yield(ne=re.data,typeof createImageBitmap=="function"?h.d(ne):h.f(ne)),cacheControl:re.cacheControl,expires:re.expires})}catch(re){delete T.abortController,B(re)}finally{a--,w()}var ne}),w=()=>{const T=(()=>{for(const I of Object.keys(d))if(d[I]())return!0;return!1})()?h.a.MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME:h.a.MAX_PARALLEL_IMAGE_REQUESTS;for(let I=a;I<T&&e.length>0;I++){const O=e.shift();O.abortController.signal.aborted?I--:m(O)}},E=(T,I)=>new Promise((O,B)=>{const U=new Image,Z=T.url,G=T.credentials;G&&G==="include"?U.crossOrigin="use-credentials":(G&&G==="same-origin"||!h.s(Z))&&(U.crossOrigin="anonymous"),I.signal.addEventListener("abort",()=>{U.src="",B(h.c())}),U.fetchPriority="high",U.onload=()=>{U.onerror=U.onload=null,O({data:U})},U.onerror=()=>{U.onerror=U.onload=null,I.signal.aborted||B(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."))},U.src=Z})}(_e||(_e={})),_e.resetRequestQueue();class Ce{constructor(e){this._transformRequestFn=e}transformRequest(e,a){return this._transformRequestFn&&this._transformRequestFn(e,a)||{url:e}}setTransformRequest(e){this._transformRequestFn=e}}function Qe(g){var e=new h.A(3);return e[0]=g[0],e[1]=g[1],e[2]=g[2],e}var mt,Ae=function(g,e,a){return g[0]=e[0]-a[0],g[1]=e[1]-a[1],g[2]=e[2]-a[2],g};mt=new h.A(3),h.A!=Float32Array&&(mt[0]=0,mt[1]=0,mt[2]=0);var St=function(g){var e=g[0],a=g[1];return e*e+a*a};function wt(g){const e=[];if(typeof g=="string")e.push({id:"default",url:g});else if(g&&g.length>0){const a=[];for(const{id:u,url:d}of g){const m=`${u}${d}`;a.indexOf(m)===-1&&(a.push(m),e.push({id:u,url:d}))}}return e}function Nt(g,e,a){const u=g.split("?");return u[0]+=`${e}${a}`,u.join("?")}(function(){var g=new h.A(2);h.A!=Float32Array&&(g[0]=0,g[1]=0)})();class Ct{constructor(e,a,u,d){this.context=e,this.format=u,this.texture=e.gl.createTexture(),this.update(a,d)}update(e,a,u){const{width:d,height:m}=e,w=!(this.size&&this.size[0]===d&&this.size[1]===m||u),{context:E}=this,{gl:T}=E;if(this.useMipmap=!!(a&&a.useMipmap),T.bindTexture(T.TEXTURE_2D,this.texture),E.pixelStoreUnpackFlipY.set(!1),E.pixelStoreUnpack.set(1),E.pixelStoreUnpackPremultiplyAlpha.set(this.format===T.RGBA&&(!a||a.premultiply!==!1)),w)this.size=[d,m],e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||h.b(e)?T.texImage2D(T.TEXTURE_2D,0,this.format,this.format,T.UNSIGNED_BYTE,e):T.texImage2D(T.TEXTURE_2D,0,this.format,d,m,0,this.format,T.UNSIGNED_BYTE,e.data);else{const{x:I,y:O}=u||{x:0,y:0};e instanceof HTMLImageElement||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageData||h.b(e)?T.texSubImage2D(T.TEXTURE_2D,0,I,O,T.RGBA,T.UNSIGNED_BYTE,e):T.texSubImage2D(T.TEXTURE_2D,0,I,O,d,m,T.RGBA,T.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&T.generateMipmap(T.TEXTURE_2D)}bind(e,a,u){const{context:d}=this,{gl:m}=d;m.bindTexture(m.TEXTURE_2D,this.texture),u!==m.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(u=m.LINEAR),e!==this.filter&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,e),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,u||e),this.filter=e),a!==this.wrap&&(m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,a),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,a),this.wrap=a)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function Sn(g){const{userImage:e}=g;return!!(e&&e.render&&e.render())&&(g.data.replace(new Uint8Array(e.data.buffer)),!0)}class zt extends h.E{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new h.R({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:a,promiseResolve:u}of this.requestors)u(this._getImagesForIds(a));this.requestors=[]}}getImage(e){const a=this.images[e];if(a&&!a.data&&a.spriteData){const u=a.spriteData;a.data=new h.R({width:u.width,height:u.height},u.context.getImageData(u.x,u.y,u.width,u.height).data),a.spriteData=null}return a}addImage(e,a){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,a)&&(this.images[e]=a)}_validate(e,a){let u=!0;const d=a.data||a.spriteData;return this._validateStretch(a.stretchX,d&&d.width)||(this.fire(new h.j(new Error(`Image "${e}" has invalid "stretchX" value`))),u=!1),this._validateStretch(a.stretchY,d&&d.height)||(this.fire(new h.j(new Error(`Image "${e}" has invalid "stretchY" value`))),u=!1),this._validateContent(a.content,a)||(this.fire(new h.j(new Error(`Image "${e}" has invalid "content" value`))),u=!1),u}_validateStretch(e,a){if(!e)return!0;let u=0;for(const d of e){if(d[0]<u||d[1]<d[0]||a<d[1])return!1;u=d[1]}return!0}_validateContent(e,a){if(!e)return!0;if(e.length!==4)return!1;const u=a.spriteData,d=u&&u.width||a.data.width,m=u&&u.height||a.data.height;return!(e[0]<0||d<e[0]||e[1]<0||m<e[1]||e[2]<0||d<e[2]||e[3]<0||m<e[3]||e[2]<e[0]||e[3]<e[1])}updateImage(e,a,u=!0){const d=this.getImage(e);if(u&&(d.data.width!==a.data.width||d.data.height!==a.data.height))throw new Error(`size mismatch between old image (${d.data.width}x${d.data.height}) and new image (${a.data.width}x${a.data.height}).`);a.version=d.version+1,this.images[e]=a,this.updatedImages[e]=!0}removeImage(e){const a=this.images[e];delete this.images[e],delete this.patterns[e],a.userImage&&a.userImage.onRemove&&a.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e){return new Promise((a,u)=>{let d=!0;if(!this.isLoaded())for(const m of e)this.images[m]||(d=!1);this.isLoaded()||d?a(this._getImagesForIds(e)):this.requestors.push({ids:e,promiseResolve:a})})}_getImagesForIds(e){const a={};for(const u of e){let d=this.getImage(u);d||(this.fire(new h.k("styleimagemissing",{id:u})),d=this.getImage(u)),d?a[u]={data:d.data.clone(),pixelRatio:d.pixelRatio,sdf:d.sdf,version:d.version,stretchX:d.stretchX,stretchY:d.stretchY,content:d.content,textFitWidth:d.textFitWidth,textFitHeight:d.textFitHeight,hasRenderCallback:!!(d.userImage&&d.userImage.render)}:h.w(`Image "${u}" 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 a}getPixelSize(){const{width:e,height:a}=this.atlasImage;return{width:e,height:a}}getPattern(e){const a=this.patterns[e],u=this.getImage(e);if(!u)return null;if(a&&a.position.version===u.version)return a.position;if(a)a.position.version=u.version;else{const d={w:u.data.width+2,h:u.data.height+2,x:0,y:0},m=new h.I(d,u);this.patterns[e]={bin:d,position:m}}return this._updatePatternAtlas(),this.patterns[e].position}bind(e){const a=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new Ct(e,this.atlasImage,a.RGBA),this.atlasTexture.bind(a.LINEAR,a.CLAMP_TO_EDGE)}_updatePatternAtlas(){const e=[];for(const m in this.patterns)e.push(this.patterns[m].bin);const{w:a,h:u}=h.p(e),d=this.atlasImage;d.resize({width:a||1,height:u||1});for(const m in this.patterns){const{bin:w}=this.patterns[m],E=w.x+1,T=w.y+1,I=this.getImage(m).data,O=I.width,B=I.height;h.R.copy(I,d,{x:0,y:0},{x:E,y:T},{width:O,height:B}),h.R.copy(I,d,{x:0,y:B-1},{x:E,y:T-1},{width:O,height:1}),h.R.copy(I,d,{x:0,y:0},{x:E,y:T+B},{width:O,height:1}),h.R.copy(I,d,{x:O-1,y:0},{x:E-1,y:T},{width:1,height:B}),h.R.copy(I,d,{x:0,y:0},{x:E+O,y:T},{width:1,height:B})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(e){for(const a of e){if(this.callbackDispatchedThisFrame[a])continue;this.callbackDispatchedThisFrame[a]=!0;const u=this.getImage(a);u||h.w(`Image with ID: "${a}" was not found`),Sn(u)&&this.updateImage(a,u)}}}const pi=1e20;function rn(g,e,a,u,d,m,w,E,T){for(let I=e;I<e+u;I++)tr(g,a*m+I,m,d,w,E,T);for(let I=a;I<a+d;I++)tr(g,I*m+e,1,u,w,E,T)}function tr(g,e,a,u,d,m,w){m[0]=0,w[0]=-pi,w[1]=pi,d[0]=g[e];for(let E=1,T=0,I=0;E<u;E++){d[E]=g[e+E*a];const O=E*E;do{const B=m[T];I=(d[E]-d[B]+O-B*B)/(E-B)/2}while(I<=w[T]&&--T>-1);T++,m[T]=E,w[T]=I,w[T+1]=pi}for(let E=0,T=0;E<u;E++){for(;w[T+1]<E;)T++;const I=m[T],O=E-I;g[e+E*a]=d[I]+O*O}}class Ui{constructor(e,a){this.requestManager=e,this.localIdeographFontFamily=a,this.entries={}}setURL(e){this.url=e}getGlyphs(e){return h._(this,void 0,void 0,function*(){const a=[];for(const m in e)for(const w of e[m])a.push(this._getAndCacheGlyphsPromise(m,w));const u=yield Promise.all(a),d={};for(const{stack:m,id:w,glyph:E}of u)d[m]||(d[m]={}),d[m][w]=E&&{id:E.id,bitmap:E.bitmap.clone(),metrics:E.metrics};return d})}_getAndCacheGlyphsPromise(e,a){return h._(this,void 0,void 0,function*(){let u=this.entries[e];u||(u=this.entries[e]={glyphs:{},requests:{},ranges:{}});let d=u.glyphs[a];if(d!==void 0)return{stack:e,id:a,glyph:d};if(d=this._tinySDF(u,e,a),d)return u.glyphs[a]=d,{stack:e,id:a,glyph:d};const m=Math.floor(a/256);if(256*m>65535)throw new Error("glyphs > 65535 not supported");if(u.ranges[m])return{stack:e,id:a,glyph:d};if(!this.url)throw new Error("glyphsUrl is not set");if(!u.requests[m]){const E=Ui.loadGlyphRange(e,m,this.url,this.requestManager);u.requests[m]=E}const w=yield u.requests[m];for(const E in w)this._doesCharSupportLocalGlyph(+E)||(u.glyphs[+E]=w[+E]);return u.ranges[m]=!0,{stack:e,id:a,glyph:w[a]||null}})}_doesCharSupportLocalGlyph(e){return!!this.localIdeographFontFamily&&new RegExp("\\p{Ideo}|\\p{sc=Hang}|\\p{sc=Hira}|\\p{sc=Kana}","u").test(String.fromCodePoint(e))}_tinySDF(e,a,u){const d=this.localIdeographFontFamily;if(!d||!this._doesCharSupportLocalGlyph(u))return;let m=e.tinySDF;if(!m){let E="400";/bold/i.test(a)?E="900":/medium/i.test(a)?E="500":/light/i.test(a)&&(E="200"),m=e.tinySDF=new Ui.TinySDF({fontSize:48,buffer:6,radius:16,cutoff:.25,fontFamily:d,fontWeight:E})}const w=m.draw(String.fromCharCode(u));return{id:u,bitmap:new h.o({width:w.width||60,height:w.height||60},w.data),metrics:{width:w.glyphWidth/2||24,height:w.glyphHeight/2||24,left:w.glyphLeft/2+.5||0,top:w.glyphTop/2-27.5||-8,advance:w.glyphAdvance/2||24,isDoubleResolution:!0}}}}Ui.loadGlyphRange=function(g,e,a,u){return h._(this,void 0,void 0,function*(){const d=256*e,m=d+255,w=u.transformRequest(a.replace("{fontstack}",g).replace("{range}",`${d}-${m}`),"Glyphs"),E=yield h.l(w,new AbortController);if(!E||!E.data)throw new Error(`Could not load glyph range. range: ${e}, ${d}-${m}`);const T={};for(const I of h.n(E.data))T[I.id]=I;return T})},Ui.TinySDF=class{constructor({fontSize:g=24,buffer:e=3,radius:a=8,cutoff:u=.25,fontFamily:d="sans-serif",fontWeight:m="normal",fontStyle:w="normal"}={}){this.buffer=e,this.cutoff=u,this.radius=a;const E=this.size=g+4*e,T=this._createCanvas(E),I=this.ctx=T.getContext("2d",{willReadFrequently:!0});I.font=`${w} ${m} ${g}px ${d}`,I.textBaseline="alphabetic",I.textAlign="left",I.fillStyle="black",this.gridOuter=new Float64Array(E*E),this.gridInner=new Float64Array(E*E),this.f=new Float64Array(E),this.z=new Float64Array(E+1),this.v=new Uint16Array(E)}_createCanvas(g){const e=document.createElement("canvas");return e.width=e.height=g,e}draw(g){const{width:e,actualBoundingBoxAscent:a,actualBoundingBoxDescent:u,actualBoundingBoxLeft:d,actualBoundingBoxRight:m}=this.ctx.measureText(g),w=Math.ceil(a),E=Math.max(0,Math.min(this.size-this.buffer,Math.ceil(m-d))),T=Math.min(this.size-this.buffer,w+Math.ceil(u)),I=E+2*this.buffer,O=T+2*this.buffer,B=Math.max(I*O,0),U=new Uint8ClampedArray(B),Z={data:U,width:I,height:O,glyphWidth:E,glyphHeight:T,glyphTop:w,glyphLeft:0,glyphAdvance:e};if(E===0||T===0)return Z;const{ctx:G,buffer:Q,gridInner:ne,gridOuter:re}=this;G.clearRect(Q,Q,E,T),G.fillText(g,Q,Q+w);const ae=G.getImageData(Q,Q,E,T);re.fill(pi,0,B),ne.fill(0,0,B);for(let X=0;X<T;X++)for(let he=0;he<E;he++){const pe=ae.data[4*(X*E+he)+3]/255;if(pe===0)continue;const ye=(X+Q)*I+he+Q;if(pe===1)re[ye]=0,ne[ye]=pi;else{const Me=.5-pe;re[ye]=Me>0?Me*Me:0,ne[ye]=Me<0?Me*Me:0}}rn(re,0,0,I,O,I,this.f,this.v,this.z),rn(ne,Q,Q,E,T,I,this.f,this.v,this.z);for(let X=0;X<B;X++){const he=Math.sqrt(re[X])-Math.sqrt(ne[X]);U[X]=Math.round(255-255*(he/this.radius+this.cutoff))}return Z}};class Sr{constructor(){this.specification=h.v.light.position}possiblyEvaluate(e,a){return h.x(e.expression.evaluate(a))}interpolate(e,a,u){return{x:h.y.number(e.x,a.x,u),y:h.y.number(e.y,a.y,u),z:h.y.number(e.z,a.z,u)}}}let jn;class kn extends h.E{constructor(e){super(),jn=jn||new h.q({anchor:new h.D(h.v.light.anchor),position:new Sr,color:new h.D(h.v.light.color),intensity:new h.D(h.v.light.intensity)}),this._transitionable=new h.T(jn),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(e,a={}){if(!this._validate(h.r,e,a))for(const u in e){const d=e[u];u.endsWith("-transition")?this._transitionable.setTransition(u.slice(0,-11),d):this._transitionable.setValue(u,d)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,a,u){return(!u||u.validate!==!1)&&h.t(this,e.call(h.u,{value:a,style:{glyphs:!0,sprite:!0},styleSpec:h.v}))}}const Hi=new h.q({"sky-color":new h.D(h.v.sky["sky-color"]),"horizon-color":new h.D(h.v.sky["horizon-color"]),"fog-color":new h.D(h.v.sky["fog-color"]),"fog-ground-blend":new h.D(h.v.sky["fog-ground-blend"]),"horizon-fog-blend":new h.D(h.v.sky["horizon-fog-blend"]),"sky-horizon-blend":new h.D(h.v.sky["sky-horizon-blend"]),"atmosphere-blend":new h.D(h.v.sky["atmosphere-blend"])});class sn extends h.E{constructor(e){super(),this._transitionable=new h.T(Hi),this.setSky(e),this._transitioning=this._transitionable.untransitioned(),this.recalculate(new h.z(0))}setSky(e,a={}){if(!this._validate(h.B,e,a)){e||(e={"sky-color":"transparent","horizon-color":"transparent","fog-color":"transparent","fog-ground-blend":1,"atmosphere-blend":0});for(const u in e){const d=e[u];u.endsWith("-transition")?this._transitionable.setTransition(u.slice(0,-11),d):this._transitionable.setValue(u,d)}}}getSky(){return this._transitionable.serialize()}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(e,a,u={}){return(u==null?void 0:u.validate)!==!1&&h.t(this,e.call(h.u,h.e({value:a,style:{glyphs:!0,sprite:!0},styleSpec:h.v})))}calculateFogBlendOpacity(e){return e<60?0:e<70?(e-60)/10:1}}class kr{constructor(e,a){this.width=e,this.height=a,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,a){const u=e.join(",")+String(a);return this.dashEntry[u]||(this.dashEntry[u]=this.addDash(e,a)),this.dashEntry[u]}getDashRanges(e,a,u){const d=[];let m=e.length%2==1?-e[e.length-1]*u:0,w=e[0]*u,E=!0;d.push({left:m,right:w,isDash:E,zeroLength:e[0]===0});let T=e[0];for(let I=1;I<e.length;I++){E=!E;const O=e[I];m=T*u,T+=O,w=T*u,d.push({left:m,right:w,isDash:E,zeroLength:O===0})}return d}addRoundDash(e,a,u){const d=a/2;for(let m=-u;m<=u;m++){const w=this.width*(this.nextRow+u+m);let E=0,T=e[E];for(let I=0;I<this.width;I++){I/T.right>1&&(T=e[++E]);const O=Math.abs(I-T.left),B=Math.abs(I-T.right),U=Math.min(O,B);let Z;const G=m/u*(d+1);if(T.isDash){const Q=d-Math.abs(G);Z=Math.sqrt(U*U+Q*Q)}else Z=d-Math.sqrt(U*U+G*G);this.data[w+I]=Math.max(0,Math.min(255,Z+128))}}}addRegularDash(e){for(let E=e.length-1;E>=0;--E){const T=e[E],I=e[E+1];T.zeroLength?e.splice(E,1):I&&I.isDash===T.isDash&&(I.left=T.left,e.splice(E,1))}const a=e[0],u=e[e.length-1];a.isDash===u.isDash&&(a.left=u.left-this.width,u.right=a.right+this.width);const d=this.width*this.nextRow;let m=0,w=e[m];for(let E=0;E<this.width;E++){E/w.right>1&&(w=e[++m]);const T=Math.abs(E-w.left),I=Math.abs(E-w.right),O=Math.min(T,I);this.data[d+E]=Math.max(0,Math.min(255,(w.isDash?O:-O)+128))}}addDash(e,a){const u=a?7:0,d=2*u+1;if(this.nextRow+d>this.height)return h.w("LineAtlas out of space"),null;let m=0;for(let E=0;E<e.length;E++)m+=e[E];if(m!==0){const E=this.width/m,T=this.getDashRanges(e,this.width,E);a?this.addRoundDash(T,E,u):this.addRegularDash(T)}const w={y:(this.nextRow+u+.5)/this.height,height:2*u/this.height,width:m};return this.nextRow+=d,this.dirty=!0,w}bind(e){const a=e.gl;this.texture?(a.bindTexture(a.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,a.texSubImage2D(a.TEXTURE_2D,0,0,0,this.width,this.height,a.ALPHA,a.UNSIGNED_BYTE,this.data))):(this.texture=a.createTexture(),a.bindTexture(a.TEXTURE_2D,this.texture),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,a.REPEAT),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,a.LINEAR),a.texImage2D(a.TEXTURE_2D,0,a.ALPHA,this.width,this.height,0,a.ALPHA,a.UNSIGNED_BYTE,this.data))}}const En="maplibre_preloaded_worker_pool";class Tn{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<Tn.workerCount;)this.workers.push(new Worker(h.a.WORKER_URL));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],this.numActive()===0&&(this.workers.forEach(a=>{a.terminate()}),this.workers=null)}isPreloaded(){return!!this.active[En]}numActive(){return Object.keys(this.active).length}}const Cn=Math.floor(R.hardwareConcurrency/2);let ke,He;function Ze(){return ke||(ke=new Tn),ke}Tn.workerCount=h.C(globalThis)?Math.max(Math.min(Cn,3),1):1;class ot{constructor(e,a){this.workerPool=e,this.actors=[],this.currentActor=0,this.id=a;const u=this.workerPool.acquire(a);for(let d=0;d<u.length;d++){const m=new h.F(u[d],a);m.name=`Worker ${d}`,this.actors.push(m)}if(!this.actors.length)throw new Error("No actors found")}broadcast(e,a){const u=[];for(const d of this.actors)u.push(d.sendAsync({type:e,data:a}));return Promise.all(u)}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(e=!0){this.actors.forEach(a=>{a.remove()}),this.actors=[],e&&this.workerPool.release(this.id)}registerMessageHandler(e,a){for(const u of this.actors)u.registerMessageHandler(e,a)}}function Vt(){return He||(He=new ot(Ze(),h.G),He.registerMessageHandler("GR",(g,e,a)=>h.m(e,a))),He}function Qt(g,e){const a=h.H();return h.J(a,a,[1,1,0]),h.K(a,a,[.5*g.width,.5*g.height,1]),h.L(a,a,g.calculatePosMatrix(e.toUnwrapped()))}function kt(g,e,a,u,d,m){const w=function(B,U,Z){if(B)for(const G of B){const Q=U[G];if(Q&&Q.source===Z&&Q.type==="fill-extrusion")return!0}else for(const G in U){const Q=U[G];if(Q.source===Z&&Q.type==="fill-extrusion")return!0}return!1}(d&&d.layers,e,g.id),E=m.maxPitchScaleFactor(),T=g.tilesIn(u,E,w);T.sort(bt);const I=[];for(const B of T)I.push({wrappedTileID:B.tileID.wrapped().key,queryResults:B.tile.queryRenderedFeatures(e,a,g._state,B.queryGeometry,B.cameraQueryGeometry,B.scale,d,m,E,Qt(g.transform,B.tileID))});const O=function(B){const U={},Z={};for(const G of B){const Q=G.queryResults,ne=G.wrappedTileID,re=Z[ne]=Z[ne]||{};for(const ae in Q){const X=Q[ae],he=re[ae]=re[ae]||{},pe=U[ae]=U[ae]||[];for(const ye of X)he[ye.featureIndex]||(he[ye.featureIndex]=!0,pe.push(ye))}}return U}(I);for(const B in O)O[B].forEach(U=>{const Z=U.feature,G=g.getFeatureState(Z.layer["source-layer"],Z.id);Z.source=Z.layer.source,Z.layer["source-layer"]&&(Z.sourceLayer=Z.layer["source-layer"]),Z.state=G});return O}function bt(g,e){const a=g.tileID,u=e.tileID;return a.overscaledZ-u.overscaledZ||a.canonical.y-u.canonical.y||a.wrap-u.wrap||a.canonical.x-u.canonical.x}function ri(g,e,a){return h._(this,void 0,void 0,function*(){let u=g;if(g.url?u=(yield h.h(e.transformRequest(g.url,"Source"),a)).data:yield R.frameAsync(a),!u)return null;const d=h.M(h.e(u,g),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);return"vector_layers"in u&&u.vector_layers&&(d.vectorLayerIds=u.vector_layers.map(m=>m.id)),d})}class xe{constructor(e,a){e&&(a?this.setSouthWest(e).setNorthEast(a):Array.isArray(e)&&(e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1])))}setNorthEast(e){return this._ne=e instanceof h.N?new h.N(e.lng,e.lat):h.N.convert(e),this}setSouthWest(e){return this._sw=e instanceof h.N?new h.N(e.lng,e.lat):h.N.convert(e),this}extend(e){const a=this._sw,u=this._ne;let d,m;if(e instanceof h.N)d=e,m=e;else{if(!(e instanceof xe))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(xe.convert(e)):this.extend(h.N.convert(e)):e&&("lng"in e||"lon"in e)&&"lat"in e?this.extend(h.N.convert(e)):this;if(d=e._sw,m=e._ne,!d||!m)return this}return a||u?(a.lng=Math.min(d.lng,a.lng),a.lat=Math.min(d.lat,a.lat),u.lng=Math.max(m.lng,u.lng),u.lat=Math.max(m.lat,u.lat)):(this._sw=new h.N(d.lng,d.lat),this._ne=new h.N(m.lng,m.lat)),this}getCenter(){return new h.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 h.N(this.getWest(),this.getNorth())}getSouthEast(){return new h.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(e){const{lng:a,lat:u}=h.N.convert(e);let d=this._sw.lng<=a&&a<=this._ne.lng;return this._sw.lng>this._ne.lng&&(d=this._sw.lng>=a&&a>=this._ne.lng),this._sw.lat<=u&&u<=this._ne.lat&&d}static convert(e){return e instanceof xe?e:e&&new xe(e)}static fromLngLat(e,a=0){const u=360*a/40075017,d=u/Math.cos(Math.PI/180*e.lat);return new xe(new h.N(e.lng-d,e.lat-u),new h.N(e.lng+d,e.lat+u))}adjustAntiMeridian(){const e=new h.N(this._sw.lng,this._sw.lat),a=new h.N(this._ne.lng,this._ne.lat);return new xe(e,e.lng>a.lng?new h.N(a.lng+360,a.lat):a)}}class wi{constructor(e,a,u){this.bounds=xe.convert(this.validateBounds(e)),this.minzoom=a||0,this.maxzoom=u||24}validateBounds(e){return Array.isArray(e)&&e.length===4?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(e){const a=Math.pow(2,e.z),u=Math.floor(h.O(this.bounds.getWest())*a),d=Math.floor(h.Q(this.bounds.getNorth())*a),m=Math.ceil(h.O(this.bounds.getEast())*a),w=Math.ceil(h.Q(this.bounds.getSouth())*a);return e.x>=u&&e.x<m&&e.y>=d&&e.y<w}}class Go extends h.E{constructor(e,a,u,d){if(super(),this.id=e,this.dispatcher=u,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,h.e(this,h.M(a,["url","scheme","tileSize","promoteId"])),this._options=h.e({type:"vector"},a),this._collectResourceTiming=a.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(d)}load(){return h._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new h.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield ri(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),e&&(h.e(this,e),e.bounds&&(this.tileBounds=new wi(e.bounds,this.minzoom,this.maxzoom)),this.fire(new h.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new h.j(e))}})}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.abort(),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}serialize(){return h.e({},this._options)}loadTile(e){return h._(this,void 0,void 0,function*(){const a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),u={request:this.map._requestManager.transformRequest(a,"Tile"),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};u.request.collectResourceTiming=this._collectResourceTiming;let d="RT";if(e.actor&&e.state!=="expired"){if(e.state==="loading")return new Promise((m,w)=>{e.reloadPromise={resolve:m,reject:w}})}else e.actor=this.dispatcher.getActor(),d="LT";e.abortController=new AbortController;try{const m=yield e.actor.sendAsync({type:d,data:u},e.abortController);if(delete e.abortController,e.aborted)return;this._afterTileLoadWorkerResponse(e,m)}catch(m){if(delete e.abortController,e.aborted)return;if(m&&m.status!==404)throw m;this._afterTileLoadWorkerResponse(e,null)}})}_afterTileLoadWorkerResponse(e,a){if(a&&a.resourceTiming&&(e.resourceTiming=a.resourceTiming),a&&this.map._refreshExpiredTiles&&e.setExpiryData(a),e.loadVectorData(a,this.map.painter),e.reloadPromise){const u=e.reloadPromise;e.reloadPromise=null,this.loadTile(e).then(u.resolve).catch(u.reject)}}abortTile(e){return h._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.actor&&(yield e.actor.sendAsync({type:"AT",data:{uid:e.uid,type:this.type,source:this.id}}))})}unloadTile(e){return h._(this,void 0,void 0,function*(){e.unloadVectorData(),e.actor&&(yield e.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}}))})}hasTransition(){return!1}}class Wt extends h.E{constructor(e,a,u,d){super(),this.id=e,this.dispatcher=u,this.setEventedParent(d),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=h.e({type:"raster"},a),h.e(this,h.M(a,["url","scheme","tileSize"]))}load(){return h._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new h.k("dataloading",{dataType:"source"})),this._tileJSONRequest=new AbortController;try{const e=yield ri(this._options,this.map._requestManager,this._tileJSONRequest);this._tileJSONRequest=null,this._loaded=!0,e&&(h.e(this,e),e.bounds&&(this.tileBounds=new wi(e.bounds,this.minzoom,this.maxzoom)),this.fire(new h.k("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new h.k("data",{dataType:"source",sourceDataType:"content"})))}catch(e){this._tileJSONRequest=null,this.fire(new h.j(e))}})}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null)}setSourceProperty(e){this._tileJSONRequest&&(this._tileJSONRequest.abort(),this._tileJSONRequest=null),e(),this.load()}setTiles(e){return this.setSourceProperty(()=>{this._options.tiles=e}),this}setUrl(e){return this.setSourceProperty(()=>{this.url=e,this._options.url=e}),this}serialize(){return h.e({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(e){return h._(this,void 0,void 0,function*(){const a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);e.abortController=new AbortController;try{const u=yield _e.getImage(this.map._requestManager.transformRequest(a,"Tile"),e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(u&&u.data){this.map._refreshExpiredTiles&&u.cacheControl&&u.expires&&e.setExpiryData({cacheControl:u.cacheControl,expires:u.expires});const d=this.map.painter.context,m=d.gl,w=u.data;e.texture=this.map.painter.getTileTexture(w.width),e.texture?e.texture.update(w,{useMipmap:!0}):(e.texture=new Ct(d,w,m.RGBA,{useMipmap:!0}),e.texture.bind(m.LINEAR,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST)),e.state="loaded"}}catch(u){if(delete e.abortController,e.aborted)e.state="unloaded";else if(u)throw e.state="errored",u}})}abortTile(e){return h._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController)})}unloadTile(e){return h._(this,void 0,void 0,function*(){e.texture&&this.map.painter.saveTileTexture(e.texture)})}hasTransition(){return!1}}class Si extends Wt{constructor(e,a,u,d){super(e,a,u,d),this.type="raster-dem",this.maxzoom=22,this._options=h.e({type:"raster-dem"},a),this.encoding=a.encoding||"mapbox",this.redFactor=a.redFactor,this.greenFactor=a.greenFactor,this.blueFactor=a.blueFactor,this.baseShift=a.baseShift}loadTile(e){return h._(this,void 0,void 0,function*(){const a=e.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),u=this.map._requestManager.transformRequest(a,"Tile");e.neighboringTiles=this._getNeighboringTiles(e.tileID),e.abortController=new AbortController;try{const d=yield _e.getImage(u,e.abortController,this.map._refreshExpiredTiles);if(delete e.abortController,e.aborted)return void(e.state="unloaded");if(d&&d.data){const m=d.data;this.map._refreshExpiredTiles&&d.cacheControl&&d.expires&&e.setExpiryData({cacheControl:d.cacheControl,expires:d.expires});const w=h.b(m)&&h.U()?m:yield this.readImageNow(m),E={type:this.type,uid:e.uid,source:this.id,rawImageData:w,encoding:this.encoding,redFactor:this.redFactor,greenFactor:this.greenFactor,blueFactor:this.blueFactor,baseShift:this.baseShift};if(!e.actor||e.state==="expired"){e.actor=this.dispatcher.getActor();const T=yield e.actor.sendAsync({type:"LDT",data:E});e.dem=T,e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0,e.state="loaded"}}}catch(d){if(delete e.abortController,e.aborted)e.state="unloaded";else if(d)throw e.state="errored",d}})}readImageNow(e){return h._(this,void 0,void 0,function*(){if(typeof VideoFrame<"u"&&h.V()){const a=e.width+2,u=e.height+2;try{return new h.R({width:a,height:u},yield h.W(e,-1,-1,a,u))}catch{}}return R.getImageData(e,1)})}_getNeighboringTiles(e){const a=e.canonical,u=Math.pow(2,a.z),d=(a.x-1+u)%u,m=a.x===0?e.wrap-1:e.wrap,w=(a.x+1+u)%u,E=a.x+1===u?e.wrap+1:e.wrap,T={};return T[new h.S(e.overscaledZ,m,a.z,d,a.y).key]={backfilled:!1},T[new h.S(e.overscaledZ,E,a.z,w,a.y).key]={backfilled:!1},a.y>0&&(T[new h.S(e.overscaledZ,m,a.z,d,a.y-1).key]={backfilled:!1},T[new h.S(e.overscaledZ,e.wrap,a.z,a.x,a.y-1).key]={backfilled:!1},T[new h.S(e.overscaledZ,E,a.z,w,a.y-1).key]={backfilled:!1}),a.y+1<u&&(T[new h.S(e.overscaledZ,m,a.z,d,a.y+1).key]={backfilled:!1},T[new h.S(e.overscaledZ,e.wrap,a.z,a.x,a.y+1).key]={backfilled:!1},T[new h.S(e.overscaledZ,E,a.z,w,a.y+1).key]={backfilled:!1}),T}unloadTile(e){return h._(this,void 0,void 0,function*(){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&(yield e.actor.sendAsync({type:"RDT",data:{type:this.type,uid:e.uid,source:this.id}}))})}}class Yo extends h.E{constructor(e,a,u,d){super(),this.id=e,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=u.getActor(),this.setEventedParent(d),this._data=a.data,this._options=h.e({},a),this._collectResourceTiming=a.collectResourceTiming,a.maxzoom!==void 0&&(this.maxzoom=a.maxzoom),a.type&&(this.type=a.type),a.attribution&&(this.attribution=a.attribution),this.promoteId=a.promoteId;const m=h.X/this.tileSize;a.clusterMaxZoom!==void 0&&this.maxzoom<=a.clusterMaxZoom&&h.w(`The maxzoom value "${this.maxzoom}" is expected to be greater than the clusterMaxZoom value "${a.clusterMaxZoom}".`),this.workerOptions=h.e({source:this.id,cluster:a.cluster||!1,geojsonVtOptions:{buffer:(a.buffer!==void 0?a.buffer:128)*m,tolerance:(a.tolerance!==void 0?a.tolerance:.375)*m,extent:h.X,maxZoom:this.maxzoom,lineMetrics:a.lineMetrics||!1,generateId:a.generateId||!1},superclusterOptions:{maxZoom:a.clusterMaxZoom!==void 0?a.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,a.clusterMinPoints||2),extent:h.X,radius:(a.clusterRadius||50)*m,log:!1,generateId:a.generateId||!1},clusterProperties:a.clusterProperties,filter:a.filter},a.workerOptions),typeof this.promoteId=="string"&&(this.workerOptions.promoteId=this.promoteId)}load(){return h._(this,void 0,void 0,function*(){yield this._updateWorkerData()})}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData(),this}updateData(e){return this._updateWorkerData(e),this}getData(){return h._(this,void 0,void 0,function*(){const e=h.e({type:this.type},this.workerOptions);return this.actor.sendAsync({type:"GD",data:e})})}setClusterOptions(e){return this.workerOptions.cluster=e.cluster,e&&(e.clusterRadius!==void 0&&(this.workerOptions.superclusterOptions.radius=e.clusterRadius),e.clusterMaxZoom!==void 0&&(this.workerOptions.superclusterOptions.maxZoom=e.clusterMaxZoom)),this._updateWorkerData(),this}getClusterExpansionZoom(e){return this.actor.sendAsync({type:"GCEZ",data:{type:this.type,clusterId:e,source:this.id}})}getClusterChildren(e){return this.actor.sendAsync({type:"GCC",data:{type:this.type,clusterId:e,source:this.id}})}getClusterLeaves(e,a,u){return this.actor.sendAsync({type:"GCL",data:{type:this.type,source:this.id,clusterId:e,limit:a,offset:u}})}_updateWorkerData(e){return h._(this,void 0,void 0,function*(){const a=h.e({type:this.type},this.workerOptions);e?a.dataDiff=e:typeof this._data=="string"?(a.request=this.map._requestManager.transformRequest(R.resolveURL(this._data),"Source"),a.request.collectResourceTiming=this._collectResourceTiming):a.data=JSON.stringify(this._data),this._pendingLoads++,this.fire(new h.k("dataloading",{dataType:"source"}));try{const u=yield this.actor.sendAsync({type:"LD",data:a});if(this._pendingLoads--,this._removed||u.abandoned)return void this.fire(new h.k("dataabort",{dataType:"source"}));let d=null;u.resourceTiming&&u.resourceTiming[this.id]&&(d=u.resourceTiming[this.id].slice(0));const m={dataType:"source"};this._collectResourceTiming&&d&&d.length>0&&h.e(m,{resourceTiming:d}),this.fire(new h.k("data",Object.assign(Object.assign({},m),{sourceDataType:"metadata"}))),this.fire(new h.k("data",Object.assign(Object.assign({},m),{sourceDataType:"content"})))}catch(u){if(this._pendingLoads--,this._removed)return void this.fire(new h.k("dataabort",{dataType:"source"}));this.fire(new h.j(u))}})}loaded(){return this._pendingLoads===0}loadTile(e){return h._(this,void 0,void 0,function*(){const a=e.actor?"RT":"LT";e.actor=this.actor;const u={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.abortController=new AbortController;const d=yield this.actor.sendAsync({type:a,data:u},e.abortController);delete e.abortController,e.unloadVectorData(),e.aborted||e.loadVectorData(d,this.map.painter,a==="RT")})}abortTile(e){return h._(this,void 0,void 0,function*(){e.abortController&&(e.abortController.abort(),delete e.abortController),e.aborted=!0})}unloadTile(e){return h._(this,void 0,void 0,function*(){e.unloadVectorData(),yield this.actor.sendAsync({type:"RMT",data:{uid:e.uid,type:this.type,source:this.id}})})}onRemove(){this._removed=!0,this.actor.sendAsync({type:"RS",data:{type:this.type,source:this.id}})}serialize(){return h.e({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var is=h.Y([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class $r extends h.E{constructor(e,a,u,d){super(),this.id=e,this.dispatcher=u,this.coordinates=a.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(d),this.options=a}load(e){return h._(this,void 0,void 0,function*(){this._loaded=!1,this.fire(new h.k("dataloading",{dataType:"source"})),this.url=this.options.url,this._request=new AbortController;try{const a=yield _e.getImage(this.map._requestManager.transformRequest(this.url,"Image"),this._request);this._request=null,this._loaded=!0,a&&a.data&&(this.image=a.data,e&&(this.coordinates=e),this._finishLoading())}catch(a){this._request=null,this._loaded=!0,this.fire(new h.j(a))}})}loaded(){return this._loaded}updateImage(e){return e.url?(this._request&&(this._request.abort(),this._request=null),this.options.url=e.url,this.load(e.coordinates).finally(()=>{this.texture=null}),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new h.k("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}onRemove(){this._request&&(this._request.abort(),this._request=null)}setCoordinates(e){this.coordinates=e;const a=e.map(h.Z.fromLngLat);this.tileID=function(d){let m=1/0,w=1/0,E=-1/0,T=-1/0;for(const U of d)m=Math.min(m,U.x),w=Math.min(w,U.y),E=Math.max(E,U.x),T=Math.max(T,U.y);const I=Math.max(E-m,T-w),O=Math.max(0,Math.floor(-Math.log(I)/Math.LN2)),B=Math.pow(2,O);return new h.a1(O,Math.floor((m+E)/2*B),Math.floor((w+T)/2*B))}(a),this.minzoom=this.maxzoom=this.tileID.z;const u=a.map(d=>this.tileID.getTilePoint(d)._round());return this._boundsArray=new h.$,this._boundsArray.emplaceBack(u[0].x,u[0].y,0,0),this._boundsArray.emplaceBack(u[1].x,u[1].y,h.X,0),this._boundsArray.emplaceBack(u[3].x,u[3].y,0,h.X),this._boundsArray.emplaceBack(u[2].x,u[2].y,h.X,h.X),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new h.k("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(Object.keys(this.tiles).length===0||!this.image)return;const e=this.map.painter.context,a=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,is.members)),this.boundsSegments||(this.boundsSegments=h.a0.simpleSegment(0,0,4,2)),this.texture||(this.texture=new Ct(e,this.image,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let u=!1;for(const d in this.tiles){const m=this.tiles[d];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,u=!0)}u&&this.fire(new h.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}loadTile(e){return h._(this,void 0,void 0,function*(){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={}):e.state="errored"})}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class Js extends $r{constructor(e,a,u,d){super(e,a,u,d),this.roundZoom=!0,this.type="video",this.options=a}load(){return h._(this,void 0,void 0,function*(){this._loaded=!1;const e=this.options;this.urls=[];for(const a of e.urls)this.urls.push(this.map._requestManager.transformRequest(a,"Source").url);try{const a=yield h.a3(this.urls);if(this._loaded=!0,!a)return;this.video=a,this.video.loop=!0,this.video.addEventListener("playing",()=>{this.map.triggerRepaint()}),this.map&&this.video.play(),this._finishLoading()}catch(a){this.fire(new h.j(a))}})}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(e){if(this.video){const a=this.video.seekable;e<a.start(0)||e>a.end(0)?this.fire(new h.j(new h.a2(`sources.${this.id}`,null,`Playback for this video can be set only between the ${a.start(0)} and ${a.end(0)}-second mark.`))):this.video.currentTime=e}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(Object.keys(this.tiles).length===0||this.video.readyState<2)return;const e=this.map.painter.context,a=e.gl;this.boundsBuffer||(this.boundsBuffer=e.createVertexBuffer(this._boundsArray,is.members)),this.boundsSegments||(this.boundsSegments=h.a0.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE),a.texSubImage2D(a.TEXTURE_2D,0,0,0,a.RGBA,a.UNSIGNED_BYTE,this.video)):(this.texture=new Ct(e,this.video,a.RGBA),this.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE));let u=!1;for(const d in this.tiles){const m=this.tiles[d];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture,u=!0)}u&&this.fire(new h.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 Un extends $r{constructor(e,a,u,d){super(e,a,u,d),a.coordinates?Array.isArray(a.coordinates)&&a.coordinates.length===4&&!a.coordinates.some(m=>!Array.isArray(m)||m.length!==2||m.some(w=>typeof w!="number"))||this.fire(new h.j(new h.a2(`sources.${e}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new h.j(new h.a2(`sources.${e}`,null,'missing required property "coordinates"'))),a.animate&&typeof a.animate!="boolean"&&this.fire(new h.j(new h.a2(`sources.${e}`,null,'optional "animate" property must be a boolean value'))),a.canvas?typeof a.canvas=="string"||a.canvas instanceof HTMLCanvasElement||this.fire(new h.j(new h.a2(`sources.${e}`,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new h.j(new h.a2(`sources.${e}`,null,'missing required property "canvas"'))),this.options=a,this.animate=a.animate===void 0||a.animate}load(){return h._(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 h.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(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),this._hasInvalidDimensions()||Object.keys(this.tiles).length===0)return;const a=this.map.painter.context,u=a.gl;this.boundsBuffer||(this.boundsBuffer=a.createVertexBuffer(this._boundsArray,is.members)),this.boundsSegments||(this.boundsSegments=h.a0.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new Ct(a,this.canvas,u.RGBA,{premultiply:!0});let d=!1;for(const m in this.tiles){const w=this.tiles[m];w.state!=="loaded"&&(w.state="loaded",w.texture=this.texture,d=!0)}d&&this.fire(new h.k("data",{dataType:"source",sourceDataType:"idle",sourceId:this.id}))}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const Xo={},Ko=g=>{switch(g){case"geojson":return Yo;case"image":return $r;case"raster":return Wt;case"raster-dem":return Si;case"vector":return Go;case"video":return Js;case"canvas":return Un}return Xo[g]},ze="RTLPluginLoaded";class Er extends h.E{constructor(){super(...arguments),this.status="unavailable",this.url=null,this.dispatcher=Vt()}_syncState(e){return this.status=e,this.dispatcher.broadcast("SRPS",{pluginStatus:e,pluginURL:this.url}).catch(a=>{throw this.status="error",a})}getRTLTextPluginStatus(){return this.status}clearRTLTextPlugin(){this.status="unavailable",this.url=null}setRTLTextPlugin(e){return h._(this,arguments,void 0,function*(a,u=!1){if(this.url)throw new Error("setRTLTextPlugin cannot be called multiple times.");if(this.url=R.resolveURL(a),!this.url)throw new Error(`requested url ${a} is invalid`);if(this.status==="unavailable"){if(!u)return this._requestImport();this.status="deferred",this._syncState(this.status)}else if(this.status==="requested")return this._requestImport()})}_requestImport(){return h._(this,void 0,void 0,function*(){yield this._syncState("loading"),this.status="loaded",this.fire(new h.k(ze))})}lazyLoad(){this.status==="unavailable"?this.status="requested":this.status==="deferred"&&this._requestImport()}}let on=null;function Tr(){return on||(on=new Er),on}class ns{constructor(e,a){this.timeAdded=0,this.fadeEndTime=0,this.tileID=e,this.uid=h.a4(),this.uses=0,this.tileSize=a,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.rtt=[],this.rttCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(e){const a=e+this.timeAdded;a<this.fadeEndTime||(this.fadeEndTime=a)}wasRequested(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.demTexture=null}loadVectorData(e,a,u){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(d,m){const w={};if(!m)return w;for(const E of d){const T=E.layerIds.map(I=>m.getLayer(I)).filter(Boolean);if(T.length!==0){E.layers=T,E.stateDependentLayerIds&&(E.stateDependentLayers=E.stateDependentLayerIds.map(I=>T.filter(O=>O.id===I)[0]));for(const I of T)w[I.id]=E}}return w}(e.buckets,a.style),this.hasSymbolBuckets=!1;for(const d in this.buckets){const m=this.buckets[d];if(m instanceof h.a6){if(this.hasSymbolBuckets=!0,!u)break;m.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const d in this.buckets){const m=this.buckets[d];if(m instanceof h.a6&&m.hasRTLText){this.hasRTLText=!0,Tr().lazyLoad();break}}this.queryPadding=0;for(const d in this.buckets){const m=this.buckets[d];this.queryPadding=Math.max(this.queryPadding,a.style.getLayer(d).queryRadius(m))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new h.a5}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const u in this.buckets){const d=this.buckets[u];d.uploadPending()&&d.upload(e)}const a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new Ct(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new Ct(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,a,u,d,m,w,E,T,I,O){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:d,cameraQueryGeometry:m,scale:w,tileSize:this.tileSize,pixelPosMatrix:O,transform:T,params:E,queryPadding:this.queryPadding*I},e,a,u):{}}querySourceFeatures(e,a){const u=this.latestFeatureIndex;if(!u||!u.rawTileData)return;const d=u.loadVTLayers(),m=a&&a.sourceLayer?a.sourceLayer:"",w=d._geojsonTileLayer||d[m];if(!w)return;const E=h.a7(a&&a.filter),{z:T,x:I,y:O}=this.tileID.canonical,B={z:T,x:I,y:O};for(let U=0;U<w.length;U++){const Z=w.feature(U);if(E.needGeometry){const ne=h.a8(Z,!0);if(!E.filter(new h.z(this.tileID.overscaledZ),ne,this.tileID.canonical))continue}else if(!E.filter(new h.z(this.tileID.overscaledZ),Z))continue;const G=u.getId(Z,m),Q=new h.a9(Z,T,I,O,G);Q.tile=B,e.push(Q)}}hasData(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(e){const a=this.expirationTime;if(e.cacheControl){const u=h.aa(e.cacheControl);u["max-age"]&&(this.expirationTime=Date.now()+1e3*u["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){const u=Date.now();let d=!1;if(this.expirationTime>u)d=!1;else if(a)if(this.expirationTime<a)d=!0;else{const m=this.expirationTime-a;m?this.expirationTime=u+Math.max(m,3e4):d=!0}else d=!0;d?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)}setFeatureState(e,a){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||Object.keys(e).length===0)return;const u=this.latestFeatureIndex.loadVTLayers();for(const d in this.buckets){if(!a.style.hasLayer(d))continue;const m=this.buckets[d],w=m.layers[0].sourceLayer||"_geojsonTileLayer",E=u[w],T=e[w];if(!E||!T||Object.keys(T).length===0)continue;m.update(T,E,this.imageAtlas&&this.imageAtlas.patternPositions||{});const I=a&&a.style&&a.style.getLayer(d);I&&(this.queryPadding=Math.max(this.queryPadding,I.queryRadius(m)))}}holdingForFade(){return this.symbolFadeHoldUntil!==void 0}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(e){this.symbolFadeHoldUntil=R.now()+e}setDependencies(e,a){const u={};for(const d of a)u[d]=!0;this.dependencies[e]=u}hasDependency(e,a){for(const u of e){const d=this.dependencies[u];if(d){for(const m of a)if(d[m])return!0}}return!1}}class Fe{constructor(e,a){this.max=e,this.onRemove=a,this.reset()}reset(){for(const e in this.data)for(const a of this.data[e])a.timeout&&clearTimeout(a.timeout),this.onRemove(a.value);return this.data={},this.order=[],this}add(e,a,u){const d=e.wrapped().key;this.data[d]===void 0&&(this.data[d]=[]);const m={value:a,timeout:void 0};if(u!==void 0&&(m.timeout=setTimeout(()=>{this.remove(e,m)},u)),this.data[d].push(m),this.order.push(d),this.order.length>this.max){const w=this._getAndRemoveByKey(this.order[0]);w&&this.onRemove(w)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const a=this.data[e].shift();return a.timeout&&clearTimeout(a.timeout),this.data[e].length===0&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),a.value}getByKey(e){const a=this.data[e];return a?a[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,a){if(!this.has(e))return this;const u=e.wrapped().key,d=a===void 0?0:this.data[u].indexOf(a),m=this.data[u][d];return this.data[u].splice(d,1),m.timeout&&clearTimeout(m.timeout),this.data[u].length===0&&delete this.data[u],this.onRemove(m.value),this.order.splice(this.order.indexOf(u),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const a=this._getAndRemoveByKey(this.order[0]);a&&this.onRemove(a)}return this}filter(e){const a=[];for(const u in this.data)for(const d of this.data[u])e(d.value)||a.push(d);for(const u of a)this.remove(u.value.tileID,u)}}class Tt{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(e,a,u){const d=String(a);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][d]=this.stateChanges[e][d]||{},h.e(this.stateChanges[e][d],u),this.deletedStates[e]===null){this.deletedStates[e]={};for(const m in this.state[e])m!==d&&(this.deletedStates[e][m]=null)}else if(this.deletedStates[e]&&this.deletedStates[e][d]===null){this.deletedStates[e][d]={};for(const m in this.state[e][d])u[m]||(this.deletedStates[e][d][m]=null)}else for(const m in u)this.deletedStates[e]&&this.deletedStates[e][d]&&this.deletedStates[e][d][m]===null&&delete this.deletedStates[e][d][m]}removeFeatureState(e,a,u){if(this.deletedStates[e]===null)return;const d=String(a);if(this.deletedStates[e]=this.deletedStates[e]||{},u&&a!==void 0)this.deletedStates[e][d]!==null&&(this.deletedStates[e][d]=this.deletedStates[e][d]||{},this.deletedStates[e][d][u]=null);else if(a!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][d])for(u in this.deletedStates[e][d]={},this.stateChanges[e][d])this.deletedStates[e][d][u]=null;else this.deletedStates[e][d]=null;else this.deletedStates[e]=null}getState(e,a){const u=String(a),d=h.e({},(this.state[e]||{})[u],(this.stateChanges[e]||{})[u]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){const m=this.deletedStates[e][a];if(m===null)return{};for(const w in m)delete d[w]}return d}initializeTileState(e,a){e.setFeatureState(this.state,a)}coalesceChanges(e,a){const u={};for(const d in this.stateChanges){this.state[d]=this.state[d]||{};const m={};for(const w in this.stateChanges[d])this.state[d][w]||(this.state[d][w]={}),h.e(this.state[d][w],this.stateChanges[d][w]),m[w]=this.state[d][w];u[d]=m}for(const d in this.deletedStates){this.state[d]=this.state[d]||{};const m={};if(this.deletedStates[d]===null)for(const w in this.state[d])m[w]={},this.state[d][w]={};else for(const w in this.deletedStates[d]){if(this.deletedStates[d][w]===null)this.state[d][w]={};else for(const E of Object.keys(this.deletedStates[d][w]))delete this.state[d][w][E];m[w]=this.state[d][w]}u[d]=u[d]||{},h.e(u[d],m)}if(this.stateChanges={},this.deletedStates={},Object.keys(u).length!==0)for(const d in e)e[d].setFeatureState(u,a)}}class pt extends h.E{constructor(e,a,u){super(),this.id=e,this.dispatcher=u,this.on("data",d=>this._dataHandler(d)),this.on("dataloading",()=>{this._sourceErrored=!1}),this.on("error",()=>{this._sourceErrored=this._source.loaded()}),this._source=((d,m,w,E)=>{const T=new(Ko(m.type))(d,m,w,E);if(T.id!==d)throw new Error(`Expected Source id to be ${d} instead of ${T.id}`);return T})(e,a,u,this),this._tiles={},this._cache=new Fe(0,d=>this._unloadTile(d)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._maxTileCacheZoomLevels=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new Tt,this._didEmitContent=!1,this._updated=!1}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._maxTileCacheZoomLevels=e?e._maxTileCacheZoomLevels:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;if(!(this.used===void 0&&this.usedForTerrain===void 0||this.used||this.usedForTerrain))return!0;if(!this._updated)return!1;for(const e in this._tiles){const a=this._tiles[e];if(a.state!=="loaded"&&a.state!=="errored")return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,a,u){return h._(this,void 0,void 0,function*(){try{yield this._source.loadTile(e),this._tileLoaded(e,a,u)}catch(d){e.state="errored",d.status!==404?this._source.fire(new h.j(d,{tile:e})):this.update(this.transform,this.terrain)}})}_unloadTile(e){this._source.unloadTile&&this._source.unloadTile(e)}_abortTile(e){this._source.abortTile&&this._source.abortTile(e),this._source.fire(new h.k("dataabort",{tile:e,coord:e.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const a in this._tiles){const u=this._tiles[a];u.upload(e),u.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map(e=>e.tileID).sort(fn).map(e=>e.key)}getRenderableIds(e){const a=[];for(const u in this._tiles)this._isIdRenderable(u,e)&&a.push(this._tiles[u]);return e?a.sort((u,d)=>{const m=u.tileID,w=d.tileID,E=new h.P(m.canonical.x,m.canonical.y)._rotate(this.transform.angle),T=new h.P(w.canonical.x,w.canonical.y)._rotate(this.transform.angle);return m.overscaledZ-w.overscaledZ||T.y-E.y||T.x-E.x}).map(u=>u.tileID.key):a.map(u=>u.tileID).sort(fn).map(u=>u.key)}hasRenderableParent(e){const a=this.findLoadedParent(e,0);return!!a&&this._isIdRenderable(a.tileID.key)}_isIdRenderable(e,a){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(a||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)this._tiles[e].state!=="errored"&&this._reloadTile(e,"reloading")}}_reloadTile(e,a){return h._(this,void 0,void 0,function*(){const u=this._tiles[e];u&&(u.state!=="loading"&&(u.state=a),yield this._loadTile(u,e,a))})}_tileLoaded(e,a,u){e.timeAdded=R.now(),u==="expired"&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(a,e),this.getSource().type==="raster-dem"&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),e.aborted||this._source.fire(new h.k("data",{dataType:"source",tile:e,coord:e.tileID}))}_backfillDEM(e){const a=this.getRenderableIds();for(let d=0;d<a.length;d++){const m=a[d];if(e.neighboringTiles&&e.neighboringTiles[m]){const w=this.getTileByID(m);u(e,w),u(w,e)}}function u(d,m){d.needsHillshadePrepare=!0,d.needsTerrainPrepare=!0;let w=m.tileID.canonical.x-d.tileID.canonical.x;const E=m.tileID.canonical.y-d.tileID.canonical.y,T=Math.pow(2,d.tileID.canonical.z),I=m.tileID.key;w===0&&E===0||Math.abs(E)>1||(Math.abs(w)>1&&(Math.abs(w+T)===1?w+=T:Math.abs(w-T)===1&&(w-=T)),m.dem&&d.dem&&(d.dem.backfillBorder(m.dem,w,E),d.neighboringTiles&&d.neighboringTiles[I]&&(d.neighboringTiles[I].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,a,u,d){for(const m in this._tiles){let w=this._tiles[m];if(d[m]||!w.hasData()||w.tileID.overscaledZ<=a||w.tileID.overscaledZ>u)continue;let E=w.tileID;for(;w&&w.tileID.overscaledZ>a+1;){const I=w.tileID.scaledTo(w.tileID.overscaledZ-1);w=this._tiles[I.key],w&&w.hasData()&&(E=I)}let T=E;for(;T.overscaledZ>a;)if(T=T.scaledTo(T.overscaledZ-1),e[T.key]){d[E.key]=E;break}}}findLoadedParent(e,a){if(e.key in this._loadedParentTiles){const u=this._loadedParentTiles[e.key];return u&&u.tileID.overscaledZ>=a?u:null}for(let u=e.overscaledZ-1;u>=a;u--){const d=e.scaledTo(u),m=this._getLoadedTile(d);if(m)return m}}findLoadedSibling(e){return this._getLoadedTile(e)}_getLoadedTile(e){const a=this._tiles[e.key];return a&&a.hasData()?a:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const a=Math.ceil(e.width/this._source.tileSize)+1,u=Math.ceil(e.height/this._source.tileSize)+1,d=Math.floor(a*u*(this._maxTileCacheZoomLevels===null?h.a.MAX_TILE_CACHE_ZOOM_LEVELS:this._maxTileCacheZoomLevels)),m=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,d):d;this._cache.setMaxSize(m)}handleWrapJump(e){const a=Math.round((e-(this._prevLng===void 0?e:this._prevLng))/360);if(this._prevLng=e,a){const u={};for(const d in this._tiles){const m=this._tiles[d];m.tileID=m.tileID.unwrapTo(m.tileID.wrap+a),u[m.tileID.key]=m}this._tiles=u;for(const d in this._timers)clearTimeout(this._timers[d]),delete this._timers[d];for(const d in this._tiles)this._setTileReloadTimer(d,this._tiles[d])}}_updateCoveredAndRetainedTiles(e,a,u,d,m,w){const E={},T={},I=Object.keys(e),O=R.now();for(const B of I){const U=e[B],Z=this._tiles[B];if(!Z||Z.fadeEndTime!==0&&Z.fadeEndTime<=O)continue;const G=this.findLoadedParent(U,a),Q=this.findLoadedSibling(U),ne=G||Q||null;ne&&(this._addTile(ne.tileID),E[ne.tileID.key]=ne.tileID),T[B]=U}this._retainLoadedChildren(T,d,u,e);for(const B in E)e[B]||(this._coveredTiles[B]=!0,e[B]=E[B]);if(w){const B={},U={};for(const Z of m)this._tiles[Z.key].hasData()?B[Z.key]=Z:U[Z.key]=Z;for(const Z in U){const G=U[Z].children(this._source.maxzoom);this._tiles[G[0].key]&&this._tiles[G[1].key]&&this._tiles[G[2].key]&&this._tiles[G[3].key]&&(B[G[0].key]=e[G[0].key]=G[0],B[G[1].key]=e[G[1].key]=G[1],B[G[2].key]=e[G[2].key]=G[2],B[G[3].key]=e[G[3].key]=G[3],delete U[Z])}for(const Z in U){const G=U[Z],Q=this.findLoadedParent(G,this._source.minzoom),ne=this.findLoadedSibling(G),re=Q||ne||null;if(re){B[re.tileID.key]=e[re.tileID.key]=re.tileID;for(const ae in B)B[ae].isChildOf(re.tileID)&&delete B[ae]}}for(const Z in this._tiles)B[Z]||(this._coveredTiles[Z]=!0)}}update(e,a){if(!this._sourceLoaded||this._paused)return;let u;this.transform=e,this.terrain=a,this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?u=e.getVisibleUnwrappedCoordinates(this._source.tileID).map(O=>new h.S(O.canonical.z,O.wrap,O.canonical.z,O.canonical.x,O.canonical.y)):(u=e.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:a}),this._source.hasTile&&(u=u.filter(O=>this._source.hasTile(O)))):u=[];const d=e.coveringZoomLevel(this._source),m=Math.max(d-pt.maxOverzooming,this._source.minzoom),w=Math.max(d+pt.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const O={};for(const B of u)if(B.canonical.z>this._source.minzoom){const U=B.scaledTo(B.canonical.z-1);O[U.key]=U;const Z=B.scaledTo(Math.max(this._source.minzoom,Math.min(B.canonical.z,5)));O[Z.key]=Z}u=u.concat(Object.values(O))}const E=u.length===0&&!this._updated&&this._didEmitContent;this._updated=!0,E&&this.fire(new h.k("data",{sourceDataType:"idle",dataType:"source",sourceId:this.id}));const T=this._updateRetainedTiles(u,d);ir(this._source.type)&&this._updateCoveredAndRetainedTiles(T,m,w,d,u,a);for(const O in T)this._tiles[O].clearFadeHold();const I=h.ab(this._tiles,T);for(const O of I){const B=this._tiles[O];B.hasSymbolBuckets&&!B.holdingForFade()?B.setHoldDuration(this.map._fadeDuration):B.hasSymbolBuckets&&!B.symbolFadeFinished()||this._removeTile(O)}this._updateLoadedParentTileCache(),this._updateLoadedSiblingTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,a){var u;const d={},m={},w=Math.max(a-pt.maxOverzooming,this._source.minzoom),E=Math.max(a+pt.maxUnderzooming,this._source.minzoom),T={};for(const I of e){const O=this._addTile(I);d[I.key]=I,O.hasData()||a<this._source.maxzoom&&(T[I.key]=I)}this._retainLoadedChildren(T,a,E,d);for(const I of e){let O=this._tiles[I.key];if(O.hasData())continue;if(a+1>this._source.maxzoom){const U=I.children(this._source.maxzoom)[0],Z=this.getTile(U);if(Z&&Z.hasData()){d[U.key]=U;continue}}else{const U=I.children(this._source.maxzoom);if(d[U[0].key]&&d[U[1].key]&&d[U[2].key]&&d[U[3].key])continue}let B=O.wasRequested();for(let U=I.overscaledZ-1;U>=w;--U){const Z=I.scaledTo(U);if(m[Z.key])break;if(m[Z.key]=!0,O=this.getTile(Z),!O&&B&&(O=this._addTile(Z)),O){const G=O.hasData();if((G||!(!((u=this.map)===null||u===void 0)&&u.cancelPendingTileRequestsWhileZooming)||B)&&(d[Z.key]=Z),B=O.wasRequested(),G)break}}}return d}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const a=[];let u,d=this._tiles[e].tileID;for(;d.overscaledZ>0;){if(d.key in this._loadedParentTiles){u=this._loadedParentTiles[d.key];break}a.push(d.key);const m=d.scaledTo(d.overscaledZ-1);if(u=this._getLoadedTile(m),u)break;d=m}for(const m of a)this._loadedParentTiles[m]=u}}_updateLoadedSiblingTileCache(){this._loadedSiblingTiles={};for(const e in this._tiles){const a=this._tiles[e].tileID,u=this._getLoadedTile(a);this._loadedSiblingTiles[a.key]=u}}_addTile(e){let a=this._tiles[e.key];if(a)return a;a=this._cache.getAndRemove(e),a&&(this._setTileReloadTimer(e.key,a),a.tileID=e,this._state.initializeTileState(a,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,a)));const u=a;return a||(a=new ns(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(a,e.key,a.state)),a.uses++,this._tiles[e.key]=a,u||this._source.fire(new h.k("dataloading",{tile:a,coord:a.tileID,dataType:"source"})),a}_setTileReloadTimer(e,a){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const u=a.getExpiryTimeout();u&&(this._timers[e]=setTimeout(()=>{this._reloadTile(e,"expired"),delete this._timers[e]},u))}_removeTile(e){const a=this._tiles[e];a&&(a.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),a.uses>0||(a.hasData()&&a.state!=="reloading"?this._cache.add(a.tileID,a,a.getExpiryTimeout()):(a.aborted=!0,this._abortTile(a),this._unloadTile(a))))}_dataHandler(e){const a=e.sourceDataType;e.dataType==="source"&&a==="metadata"&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&e.dataType==="source"&&a==="content"&&(this.reload(),this.transform&&this.update(this.transform,this.terrain),this._didEmitContent=!0)}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(e,a,u){const d=[],m=this.transform;if(!m)return d;const w=u?m.getCameraQueryGeometry(e):e,E=e.map(G=>m.pointCoordinate(G,this.terrain)),T=w.map(G=>m.pointCoordinate(G,this.terrain)),I=this.getIds();let O=1/0,B=1/0,U=-1/0,Z=-1/0;for(const G of T)O=Math.min(O,G.x),B=Math.min(B,G.y),U=Math.max(U,G.x),Z=Math.max(Z,G.y);for(let G=0;G<I.length;G++){const Q=this._tiles[I[G]];if(Q.holdingForFade())continue;const ne=Q.tileID,re=Math.pow(2,m.zoom-Q.tileID.overscaledZ),ae=a*Q.queryPadding*h.X/Q.tileSize/re,X=[ne.getTilePoint(new h.Z(O,B)),ne.getTilePoint(new h.Z(U,Z))];if(X[0].x-ae<h.X&&X[0].y-ae<h.X&&X[1].x+ae>=0&&X[1].y+ae>=0){const he=E.map(ye=>ne.getTilePoint(ye)),pe=T.map(ye=>ne.getTilePoint(ye));d.push({tile:Q,tileID:ne,queryGeometry:he,cameraQueryGeometry:pe,scale:re})}}return d}getVisibleCoordinates(e){const a=this.getRenderableIds(e).map(u=>this._tiles[u].tileID);for(const u of a)u.posMatrix=this.transform.calculatePosMatrix(u.toUnwrapped());return a}hasTransition(){if(this._source.hasTransition())return!0;if(ir(this._source.type)){const e=R.now();for(const a in this._tiles)if(this._tiles[a].fadeEndTime>=e)return!0}return!1}setFeatureState(e,a,u){this._state.updateState(e=e||"_geojsonTileLayer",a,u)}removeFeatureState(e,a,u){this._state.removeFeatureState(e=e||"_geojsonTileLayer",a,u)}getFeatureState(e,a){return this._state.getState(e=e||"_geojsonTileLayer",a)}setDependencies(e,a,u){const d=this._tiles[e];d&&d.setDependencies(a,u)}reloadTilesForDependencies(e,a){for(const u in this._tiles)this._tiles[u].hasDependency(e,a)&&this._reloadTile(u,"reloading");this._cache.filter(u=>!u.hasDependency(e,a))}}function fn(g,e){const a=Math.abs(2*g.wrap)-+(g.wrap<0),u=Math.abs(2*e.wrap)-+(e.wrap<0);return g.overscaledZ-e.overscaledZ||u-a||e.canonical.y-g.canonical.y||e.canonical.x-g.canonical.x}function ir(g){return g==="raster"||g==="image"||g==="video"}pt.maxOverzooming=10,pt.maxUnderzooming=3;class xt{constructor(e,a){this.reset(e,a)}reset(e,a){this.points=e||[],this._distances=[0];for(let u=1;u<this.points.length;u++)this._distances[u]=this._distances[u-1]+this.points[u].dist(this.points[u-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(a||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(e){if(this.points.length===1)return this.points[0];e=h.ac(e,0,1);let a=1,u=this._distances[a];const d=e*this.paddedLength+this.padding;for(;u<d&&a<this._distances.length;)u=this._distances[++a];const m=a-1,w=this._distances[m],E=u-w,T=E>0?(d-w)/E:0;return this.points[m].mult(1-T).add(this.points[a].mult(T))}}function Cr(g,e){let a=!0;return g==="always"||g!=="never"&&e!=="never"||(a=!1),a}class jr{constructor(e,a,u){const d=this.boxCells=[],m=this.circleCells=[];this.xCellCount=Math.ceil(e/u),this.yCellCount=Math.ceil(a/u);for(let w=0;w<this.xCellCount*this.yCellCount;w++)d.push([]),m.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=a,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/a,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,a,u,d,m){this._forEachCell(a,u,d,m,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(a),this.bboxes.push(u),this.bboxes.push(d),this.bboxes.push(m)}insertCircle(e,a,u,d){this._forEachCell(a-d,u-d,a+d,u+d,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(a),this.circles.push(u),this.circles.push(d)}_insertBoxCell(e,a,u,d,m,w){this.boxCells[m].push(w)}_insertCircleCell(e,a,u,d,m,w){this.circleCells[m].push(w)}_query(e,a,u,d,m,w,E){if(u<0||e>this.width||d<0||a>this.height)return[];const T=[];if(e<=0&&a<=0&&this.width<=u&&this.height<=d){if(m)return[{key:null,x1:e,y1:a,x2:u,y2:d}];for(let I=0;I<this.boxKeys.length;I++)T.push({key:this.boxKeys[I],x1:this.bboxes[4*I],y1:this.bboxes[4*I+1],x2:this.bboxes[4*I+2],y2:this.bboxes[4*I+3]});for(let I=0;I<this.circleKeys.length;I++){const O=this.circles[3*I],B=this.circles[3*I+1],U=this.circles[3*I+2];T.push({key:this.circleKeys[I],x1:O-U,y1:B-U,x2:O+U,y2:B+U})}}else this._forEachCell(e,a,u,d,this._queryCell,T,{hitTest:m,overlapMode:w,seenUids:{box:{},circle:{}}},E);return T}query(e,a,u,d){return this._query(e,a,u,d,!1,null)}hitTest(e,a,u,d,m,w){return this._query(e,a,u,d,!0,m,w).length>0}hitTestCircle(e,a,u,d,m){const w=e-u,E=e+u,T=a-u,I=a+u;if(E<0||w>this.width||I<0||T>this.height)return!1;const O=[];return this._forEachCell(w,T,E,I,this._queryCellCircle,O,{hitTest:!0,overlapMode:d,circle:{x:e,y:a,radius:u},seenUids:{box:{},circle:{}}},m),O.length>0}_queryCell(e,a,u,d,m,w,E,T){const{seenUids:I,hitTest:O,overlapMode:B}=E,U=this.boxCells[m];if(U!==null){const G=this.bboxes;for(const Q of U)if(!I.box[Q]){I.box[Q]=!0;const ne=4*Q,re=this.boxKeys[Q];if(e<=G[ne+2]&&a<=G[ne+3]&&u>=G[ne+0]&&d>=G[ne+1]&&(!T||T(re))&&(!O||!Cr(B,re.overlapMode))&&(w.push({key:re,x1:G[ne],y1:G[ne+1],x2:G[ne+2],y2:G[ne+3]}),O))return!0}}const Z=this.circleCells[m];if(Z!==null){const G=this.circles;for(const Q of Z)if(!I.circle[Q]){I.circle[Q]=!0;const ne=3*Q,re=this.circleKeys[Q];if(this._circleAndRectCollide(G[ne],G[ne+1],G[ne+2],e,a,u,d)&&(!T||T(re))&&(!O||!Cr(B,re.overlapMode))){const ae=G[ne],X=G[ne+1],he=G[ne+2];if(w.push({key:re,x1:ae-he,y1:X-he,x2:ae+he,y2:X+he}),O)return!0}}}return!1}_queryCellCircle(e,a,u,d,m,w,E,T){const{circle:I,seenUids:O,overlapMode:B}=E,U=this.boxCells[m];if(U!==null){const G=this.bboxes;for(const Q of U)if(!O.box[Q]){O.box[Q]=!0;const ne=4*Q,re=this.boxKeys[Q];if(this._circleAndRectCollide(I.x,I.y,I.radius,G[ne+0],G[ne+1],G[ne+2],G[ne+3])&&(!T||T(re))&&!Cr(B,re.overlapMode))return w.push(!0),!0}}const Z=this.circleCells[m];if(Z!==null){const G=this.circles;for(const Q of Z)if(!O.circle[Q]){O.circle[Q]=!0;const ne=3*Q,re=this.circleKeys[Q];if(this._circlesCollide(G[ne],G[ne+1],G[ne+2],I.x,I.y,I.radius)&&(!T||T(re))&&!Cr(B,re.overlapMode))return w.push(!0),!0}}}_forEachCell(e,a,u,d,m,w,E,T){const I=this._convertToXCellCoord(e),O=this._convertToYCellCoord(a),B=this._convertToXCellCoord(u),U=this._convertToYCellCoord(d);for(let Z=I;Z<=B;Z++)for(let G=O;G<=U;G++)if(m.call(this,e,a,u,d,this.xCellCount*G+Z,w,E,T))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,a,u,d,m,w){const E=d-e,T=m-a,I=u+w;return I*I>E*E+T*T}_circleAndRectCollide(e,a,u,d,m,w,E){const T=(w-d)/2,I=Math.abs(e-(d+T));if(I>T+u)return!1;const O=(E-m)/2,B=Math.abs(a-(m+O));if(B>O+u)return!1;if(I<=T||B<=O)return!0;const U=I-T,Z=B-O;return U*U+Z*Z<=u*u}}function rs(g,e,a,u,d){const m=h.H();return e?(h.K(m,m,[1/d,1/d,1]),a||h.ad(m,m,u.angle)):h.L(m,u.labelPlaneMatrix,g),m}function Mr(g,e,a,u,d){if(e){const m=h.ae(g);return h.K(m,m,[d,d,1]),a||h.ad(m,m,-u.angle),m}return u.glCoordMatrix}function te(g,e,a,u){let d;u?(d=[g,e,u(g,e),1],h.af(d,d,a)):(d=[g,e,0,1],jt(d,d,a));const m=d[3];return{point:new h.P(d[0]/m,d[1]/m),signedDistanceFromCamera:m,isOccluded:!1}}function V(g,e){return .5+g/e*.5}function N(g,e){return g.x>=-e[0]&&g.x<=e[0]&&g.y>=-e[1]&&g.y<=e[1]}function W(g,e,a,u,d,m,w,E,T,I,O,B,U,Z,G){const Q=u?g.textSizeData:g.iconSizeData,ne=h.ag(Q,a.transform.zoom),re=[256/a.width*2+1,256/a.height*2+1],ae=u?g.text.dynamicLayoutVertexArray:g.icon.dynamicLayoutVertexArray;ae.clear();const X=g.lineVertexArray,he=u?g.text.placedSymbolArray:g.icon.placedSymbolArray,pe=a.transform.width/a.transform.height;let ye=!1;for(let Me=0;Me<he.length;Me++){const De=he.get(Me);if(De.hidden||De.writingMode===h.ah.vertical&&!ye){lt(De.numGlyphs,ae);continue}ye=!1;const $e=te(De.anchorX,De.anchorY,e,G);if(!N($e.point,re)){lt(De.numGlyphs,ae);continue}const We=V(a.transform.cameraToCenterDistance,$e.signedDistanceFromCamera),Be=h.ai(Q,ne,De),Oe=w?Be/We:Be*We,tt={getElevation:G,labelPlaneMatrix:d,lineVertexArray:X,pitchWithMap:w,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:I,tileAnchorPoint:new h.P(De.anchorX,De.anchorY),unwrappedTileID:O,width:B,height:U,translation:Z},_t=de(tt,De,Oe,!1,E,e,m,g.glyphOffsetArray,ae,pe,T);ye=_t.useVertical,(_t.notEnoughRoom||ye||_t.needsFlipping&&de(tt,De,Oe,!0,E,e,m,g.glyphOffsetArray,ae,pe,T).notEnoughRoom)&&lt(De.numGlyphs,ae)}u?g.text.dynamicLayoutVertexBuffer.updateData(ae):g.icon.dynamicLayoutVertexBuffer.updateData(ae)}function J(g,e,a,u,d,m,w,E){const T=m.glyphStartIndex+m.numGlyphs,I=m.lineStartIndex,O=m.lineStartIndex+m.lineLength,B=e.getoffsetX(m.glyphStartIndex),U=e.getoffsetX(T-1),Z=Le(g*B,a,u,d,m.segment,I,O,E,w);if(!Z)return null;const G=Le(g*U,a,u,d,m.segment,I,O,E,w);return G?E.projectionCache.anyProjectionOccluded?null:{first:Z,last:G}:null}function ce(g,e,a,u){return g===h.ah.horizontal&&Math.abs(a.y-e.y)>Math.abs(a.x-e.x)*u?{useVertical:!0}:(g===h.ah.vertical?e.y<a.y:e.x>a.x)?{needsFlipping:!0}:null}function de(g,e,a,u,d,m,w,E,T,I,O){const B=a/24,U=e.lineOffsetX*B,Z=e.lineOffsetY*B;let G;if(e.numGlyphs>1){const Q=e.glyphStartIndex+e.numGlyphs,ne=e.lineStartIndex,re=e.lineStartIndex+e.lineLength,ae=J(B,E,U,Z,u,e,O,g);if(!ae)return{notEnoughRoom:!0};const X=te(ae.first.point.x,ae.first.point.y,w,g.getElevation).point,he=te(ae.last.point.x,ae.last.point.y,w,g.getElevation).point;if(d&&!u){const pe=ce(e.writingMode,X,he,I);if(pe)return pe}G=[ae.first];for(let pe=e.glyphStartIndex+1;pe<Q-1;pe++)G.push(Le(B*E.getoffsetX(pe),U,Z,u,e.segment,ne,re,g,O));G.push(ae.last)}else{if(d&&!u){const ne=te(g.tileAnchorPoint.x,g.tileAnchorPoint.y,m,g.getElevation).point,re=e.lineStartIndex+e.segment+1,ae=new h.P(g.lineVertexArray.getx(re),g.lineVertexArray.gety(re)),X=te(ae.x,ae.y,m,g.getElevation),he=X.signedDistanceFromCamera>0?X.point:function(ye,Me,De,$e,We,Be){return me(ye,Me,De,1,We,Be)}(g.tileAnchorPoint,ae,ne,0,m,g),pe=ce(e.writingMode,ne,he,I);if(pe)return pe}const Q=Le(B*E.getoffsetX(e.glyphStartIndex),U,Z,u,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,g,O);if(!Q||g.projectionCache.anyProjectionOccluded)return{notEnoughRoom:!0};G=[Q]}for(const Q of G)h.aj(T,Q.point,Q.angle);return{}}function me(g,e,a,u,d,m){const w=g.add(g.sub(e)._unit()),E=d!==void 0?te(w.x,w.y,d,m.getElevation).point:Se(w.x,w.y,m).point,T=a.sub(E);return a.add(T._mult(u/T.mag()))}function se(g,e,a){const u=e.projectionCache;if(u.projections[g])return u.projections[g];const d=new h.P(e.lineVertexArray.getx(g),e.lineVertexArray.gety(g)),m=Se(d.x,d.y,e);if(m.signedDistanceFromCamera>0)return u.projections[g]=m.point,u.anyProjectionOccluded=u.anyProjectionOccluded||m.isOccluded,m.point;const w=g-a.direction;return function(E,T,I,O,B){return me(E,T,I,O,void 0,B)}(a.distanceFromAnchor===0?e.tileAnchorPoint:new h.P(e.lineVertexArray.getx(w),e.lineVertexArray.gety(w)),d,a.previousVertex,a.absOffsetX-a.distanceFromAnchor+1,e)}function Se(g,e,a){const u=g+a.translation[0],d=e+a.translation[1];let m;return!a.pitchWithMap&&a.projection.useSpecialProjectionForSymbols?(m=a.projection.projectTileCoordinates(u,d,a.unwrappedTileID,a.getElevation),m.point.x=(.5*m.point.x+.5)*a.width,m.point.y=(.5*-m.point.y+.5)*a.height):(m=te(u,d,a.labelPlaneMatrix,a.getElevation),m.isOccluded=!1),m}function Pe(g,e,a){return g._unit()._perp()._mult(e*a)}function ve(g,e,a,u,d,m,w,E,T){if(E.projectionCache.offsets[g])return E.projectionCache.offsets[g];const I=a.add(e);if(g+T.direction<u||g+T.direction>=d)return E.projectionCache.offsets[g]=I,I;const O=se(g+T.direction,E,T),B=Pe(O.sub(a),w,T.direction),U=a.add(B),Z=O.add(B);return E.projectionCache.offsets[g]=h.ak(m,I,U,Z)||I,E.projectionCache.offsets[g]}function Le(g,e,a,u,d,m,w,E,T){const I=u?g-e:g+e;let O=I>0?1:-1,B=0;u&&(O*=-1,B=Math.PI),O<0&&(B+=Math.PI);let U,Z=O>0?m+d:m+d+1;E.projectionCache.cachedAnchorPoint?U=E.projectionCache.cachedAnchorPoint:(U=Se(E.tileAnchorPoint.x,E.tileAnchorPoint.y,E).point,E.projectionCache.cachedAnchorPoint=U);let G,Q,ne=U,re=U,ae=0,X=0;const he=Math.abs(I),pe=[];let ye;for(;ae+X<=he;){if(Z+=O,Z<m||Z>=w)return null;ae+=X,re=ne,Q=G;const $e={absOffsetX:he,direction:O,distanceFromAnchor:ae,previousVertex:re};if(ne=se(Z,E,$e),a===0)pe.push(re),ye=ne.sub(re);else{let We;const Be=ne.sub(re);We=Be.mag()===0?Pe(se(Z+O,E,$e).sub(ne),a,O):Pe(Be,a,O),Q||(Q=re.add(We)),G=ve(Z,We,ne,m,w,Q,a,E,$e),pe.push(Q),ye=G.sub(Q)}X=ye.mag()}const Me=ye._mult((he-ae)/X)._add(Q||re),De=B+Math.atan2(ne.y-re.y,ne.x-re.x);return pe.push(Me),{point:Me,angle:T?De:0,path:pe}}const at=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function lt(g,e){for(let a=0;a<g;a++){const u=e.length;e.resize(u+4),e.float32.set(at,3*u)}}function jt(g,e,a){const u=e[0],d=e[1];return g[0]=a[0]*u+a[4]*d+a[12],g[1]=a[1]*u+a[5]*d+a[13],g[3]=a[3]*u+a[7]*d+a[15],g}const vt=100;class Ut{constructor(e,a,u=new jr(e.width+200,e.height+200,25),d=new jr(e.width+200,e.height+200,25)){this.transform=e,this.mapProjection=a,this.grid=u,this.ignoredGrid=d,this.pitchFactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+vt,this.screenBottomBoundary=e.height+vt,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,a,u,d,m,w,E,T,I,O,B){const U=e.anchorPointX+T[0],Z=e.anchorPointY+T[1],G=this.projectAndGetPerspectiveRatio(d,U,Z,m,O),Q=u*G.perspectiveRatio;let ne;if(w||E)ne=this._projectCollisionBox(e,Q,d,m,w,E,T,G,O,B);else{const pe=G.point.x+(B?B.x*Q:0),ye=G.point.y+(B?B.y*Q:0);ne={allPointsOccluded:!1,box:[pe+e.x1*Q,ye+e.y1*Q,pe+e.x2*Q,ye+e.y2*Q]}}const[re,ae,X,he]=ne.box;return this.mapProjection.useSpecialProjectionForSymbols&&(w?ne.allPointsOccluded:this.mapProjection.isOccluded(U,Z,m))||G.perspectiveRatio<this.perspectiveRatioCutoff||!this.isInsideGrid(re,ae,X,he)||a!=="always"&&this.grid.hitTest(re,ae,X,he,a,I)?{box:[re,ae,X,he],placeable:!1,offscreen:!1}:{box:[re,ae,X,he],placeable:!0,offscreen:this.isOffscreen(re,ae,X,he)}}placeCollisionCircles(e,a,u,d,m,w,E,T,I,O,B,U,Z,G,Q,ne){const re=[],ae=new h.P(a.anchorX,a.anchorY),X=this.getPerspectiveRatio(w,ae.x,ae.y,E,ne),he=(B?m/X:m*X)/h.ap,pe={getElevation:ne,labelPlaneMatrix:T,lineVertexArray:u,pitchWithMap:B,projectionCache:{projections:{},offsets:{},cachedAnchorPoint:void 0,anyProjectionOccluded:!1},projection:this.mapProjection,tileAnchorPoint:ae,unwrappedTileID:E,width:this.transform.width,height:this.transform.height,translation:Q},ye=J(he,d,a.lineOffsetX*he,a.lineOffsetY*he,!1,a,!1,pe);let Me=!1,De=!1,$e=!0;if(ye){const We=.5*Z*X+G,Be=new h.P(-100,-100),Oe=new h.P(this.screenRightBoundary,this.screenBottomBoundary),tt=new xt,_t=ye.first,Ne=ye.last;let Ue=[];for(let Et=_t.path.length-1;Et>=1;Et--)Ue.push(_t.path[Et]);for(let Et=1;Et<Ne.path.length;Et++)Ue.push(Ne.path[Et]);const gt=2.5*We;if(I){const Et=this.projectPathToScreenSpace(Ue,pe,I);Ue=Et.some(Lt=>Lt.signedDistanceFromCamera<=0)?[]:Et.map(Lt=>Lt.point)}let mi=[];if(Ue.length>0){const Et=Ue[0].clone(),Lt=Ue[0].clone();for(let gi=1;gi<Ue.length;gi++)Et.x=Math.min(Et.x,Ue[gi].x),Et.y=Math.min(Et.y,Ue[gi].y),Lt.x=Math.max(Lt.x,Ue[gi].x),Lt.y=Math.max(Lt.y,Ue[gi].y);mi=Et.x>=Be.x&&Lt.x<=Oe.x&&Et.y>=Be.y&&Lt.y<=Oe.y?[Ue]:Lt.x<Be.x||Et.x>Oe.x||Lt.y<Be.y||Et.y>Oe.y?[]:h.al([Ue],Be.x,Be.y,Oe.x,Oe.y)}for(const Et of mi){tt.reset(Et,.25*We);let Lt=0;Lt=tt.length<=.5*We?1:Math.ceil(tt.paddedLength/gt)+1;for(let gi=0;gi<Lt;gi++){const Xi=gi/Math.max(Lt-1,1),lr=tt.lerp(Xi),yi=lr.x+vt,yn=lr.y+vt;re.push(yi,yn,We,0);const ln=yi-We,Ki=yn-We,cn=yi+We,Dr=yn+We;if($e=$e&&this.isOffscreen(ln,Ki,cn,Dr),De=De||this.isInsideGrid(ln,Ki,cn,Dr),e!=="always"&&this.grid.hitTestCircle(yi,yn,We,e,U)&&(Me=!0,!O))return{circles:[],offscreen:!1,collisionDetected:Me}}}}return{circles:!O&&Me||!De||X<this.perspectiveRatioCutoff?[]:re,offscreen:$e,collisionDetected:Me}}projectPathToScreenSpace(e,a,u){return e.map(d=>te(d.x,d.y,u,a.getElevation))}queryRenderedSymbols(e){if(e.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};const a=[];let u=1/0,d=1/0,m=-1/0,w=-1/0;for(const O of e){const B=new h.P(O.x+vt,O.y+vt);u=Math.min(u,B.x),d=Math.min(d,B.y),m=Math.max(m,B.x),w=Math.max(w,B.y),a.push(B)}const E=this.grid.query(u,d,m,w).concat(this.ignoredGrid.query(u,d,m,w)),T={},I={};for(const O of E){const B=O.key;if(T[B.bucketInstanceId]===void 0&&(T[B.bucketInstanceId]={}),T[B.bucketInstanceId][B.featureIndex])continue;const U=[new h.P(O.x1,O.y1),new h.P(O.x2,O.y1),new h.P(O.x2,O.y2),new h.P(O.x1,O.y2)];h.am(a,U)&&(T[B.bucketInstanceId][B.featureIndex]=!0,I[B.bucketInstanceId]===void 0&&(I[B.bucketInstanceId]=[]),I[B.bucketInstanceId].push(B.featureIndex))}return I}insertCollisionBox(e,a,u,d,m,w){(u?this.ignoredGrid:this.grid).insert({bucketInstanceId:d,featureIndex:m,collisionGroupID:w,overlapMode:a},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,a,u,d,m,w){const E=u?this.ignoredGrid:this.grid,T={bucketInstanceId:d,featureIndex:m,collisionGroupID:w,overlapMode:a};for(let I=0;I<e.length;I+=4)E.insertCircle(T,e[I],e[I+1],e[I+2])}projectAndGetPerspectiveRatio(e,a,u,d,m){let w;m?(w=[a,u,m(a,u),1],h.af(w,w,e)):(w=[a,u,0,1],jt(w,w,e));const E=w[3];return{point:new h.P((w[0]/E+1)/2*this.transform.width+vt,(-w[1]/E+1)/2*this.transform.height+vt),perspectiveRatio:.5+this.transform.cameraToCenterDistance/E*.5,isOccluded:!1,signedDistanceFromCamera:E}}getPerspectiveRatio(e,a,u,d,m){const w=this.mapProjection.useSpecialProjectionForSymbols?this.mapProjection.projectTileCoordinates(a,u,d,m):te(a,u,e,m);return .5+this.transform.cameraToCenterDistance/w.signedDistanceFromCamera*.5}isOffscreen(e,a,u,d){return u<vt||e>=this.screenRightBoundary||d<vt||a>this.screenBottomBoundary}isInsideGrid(e,a,u,d){return u>=0&&e<this.gridRightBoundary&&d>=0&&a<this.gridBottomBoundary}getViewportMatrix(){const e=h.an([]);return h.J(e,e,[-100,-100,0]),e}_projectCollisionBox(e,a,u,d,m,w,E,T,I,O){let B=new h.P(1,0),U=new h.P(0,1);const Z=new h.P(e.anchorPointX+E[0],e.anchorPointY+E[1]);if(w&&!m){const $e=this.projectAndGetPerspectiveRatio(u,Z.x+1,Z.y,d,I).point.sub(T.point).unit(),We=Math.atan($e.y/$e.x)+($e.x<0?Math.PI:0),Be=Math.sin(We),Oe=Math.cos(We);B=new h.P(Oe,Be),U=new h.P(-Be,Oe)}else if(!w&&m){const $e=-this.transform.angle,We=Math.sin($e),Be=Math.cos($e);B=new h.P(Be,We),U=new h.P(-We,Be)}let G=T.point,Q=a;if(m){G=Z;const $e=this.transform.zoom-Math.floor(this.transform.zoom);Q=Math.pow(2,-$e),Q*=this.mapProjection.getPitchedTextCorrection(this.transform,Z,d),O||(Q*=h.ac(.5+T.signedDistanceFromCamera/this.transform.cameraToCenterDistance*.5,0,4))}O&&(G=G.add(B.mult(O.x*Q)).add(U.mult(O.y*Q)));const ne=e.x1*Q,re=e.x2*Q,ae=(ne+re)/2,X=e.y1*Q,he=e.y2*Q,pe=(X+he)/2,ye=[{offsetX:ne,offsetY:X},{offsetX:ae,offsetY:X},{offsetX:re,offsetY:X},{offsetX:re,offsetY:pe},{offsetX:re,offsetY:he},{offsetX:ae,offsetY:he},{offsetX:ne,offsetY:he},{offsetX:ne,offsetY:pe}];let Me=[];for(const{offsetX:$e,offsetY:We}of ye)Me.push(new h.P(G.x+B.x*$e+U.x*We,G.y+B.y*$e+U.y*We));let De=!1;if(m){const $e=Me.map(We=>this.projectAndGetPerspectiveRatio(u,We.x,We.y,d,I));De=$e.some(We=>!We.isOccluded),Me=$e.map(We=>We.point)}else De=!0;return{box:h.ao(Me),allPointsOccluded:!De}}}function Rt(g,e,a){return e*(h.X/(g.tileSize*Math.pow(2,a-g.tileID.overscaledZ)))}class Di{constructor(e,a,u,d){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?a:-a))):d&&u?1:0,this.placed=u}isHidden(){return this.opacity===0&&!this.placed}}class ki{constructor(e,a,u,d,m){this.text=new Di(e?e.text:null,a,u,m),this.icon=new Di(e?e.icon:null,a,d,m)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Mt{constructor(e,a,u){this.text=e,this.icon=a,this.skipFade=u}}class ei{constructor(){this.invProjMatrix=h.H(),this.viewportMatrix=h.H(),this.circles=[]}}class xi{constructor(e,a,u,d,m){this.bucketInstanceId=e,this.featureIndex=a,this.sourceLayerIndex=u,this.bucketIndex=d,this.tileID=m}}class Fi{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const a=++this.maxGroupID;this.collisionGroups[e]={ID:a,predicate:u=>u.collisionGroupID===a}}return this.collisionGroups[e]}}function qi(g,e,a,u,d){const{horizontalAlign:m,verticalAlign:w}=h.au(g);return new h.P(-(m-.5)*e+u[0]*d,-(w-.5)*a+u[1]*d)}class an{constructor(e,a,u,d,m,w){this.transform=e.clone(),this.terrain=u,this.collisionIndex=new Ut(this.transform,a),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=d,this.retainedQueryData={},this.collisionGroups=new Fi(m),this.collisionCircleArrays={},this.collisionBoxArrays=new Map,this.prevPlacement=w,w&&(w.prevPlacement=void 0),this.placedOrientations={}}_getTerrainElevationFunc(e){const a=this.terrain;return a?(u,d)=>a.getElevation(e,u,d):null}getBucketParts(e,a,u,d){const m=u.getBucket(a),w=u.latestFeatureIndex;if(!m||!w||a.id!==m.layerIds[0])return;const E=u.collisionBoxArray,T=m.layers[0].layout,I=m.layers[0].paint,O=Math.pow(2,this.transform.zoom-u.tileID.overscaledZ),B=u.tileSize/h.X,U=u.tileID.toUnwrapped(),Z=this.transform.calculatePosMatrix(U),G=T.get("text-pitch-alignment")==="map",Q=T.get("text-rotation-alignment")==="map",ne=Rt(u,1,this.transform.zoom),re=this.collisionIndex.mapProjection.translatePosition(this.transform,u,I.get("text-translate"),I.get("text-translate-anchor")),ae=this.collisionIndex.mapProjection.translatePosition(this.transform,u,I.get("icon-translate"),I.get("icon-translate-anchor")),X=rs(Z,G,Q,this.transform,ne);let he=null;if(G){const ye=Mr(Z,G,Q,this.transform,ne);he=h.L([],this.transform.labelPlaneMatrix,ye)}this.retainedQueryData[m.bucketInstanceId]=new xi(m.bucketInstanceId,w,m.sourceLayerIndex,m.index,u.tileID);const pe={bucket:m,layout:T,translationText:re,translationIcon:ae,posMatrix:Z,unwrappedTileID:U,textLabelPlaneMatrix:X,labelToScreenMatrix:he,scale:O,textPixelRatio:B,holdingForFade:u.holdingForFade(),collisionBoxArray:E,partiallyEvaluatedTextSize:h.ag(m.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(m.sourceID)};if(d)for(const ye of m.sortKeyRanges){const{sortKey:Me,symbolInstanceStart:De,symbolInstanceEnd:$e}=ye;e.push({sortKey:Me,symbolInstanceStart:De,symbolInstanceEnd:$e,parameters:pe})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:m.symbolInstances.length,parameters:pe})}attemptAnchorPlacement(e,a,u,d,m,w,E,T,I,O,B,U,Z,G,Q,ne,re,ae,X){const he=h.aq[e.textAnchor],pe=[e.textOffset0,e.textOffset1],ye=qi(he,u,d,pe,m),Me=this.collisionIndex.placeCollisionBox(a,U,T,I,O,E,w,ne,B.predicate,X,ye);if((!ae||this.collisionIndex.placeCollisionBox(ae,U,T,I,O,E,w,re,B.predicate,X,ye).placeable)&&Me.placeable){let De;if(this.prevPlacement&&this.prevPlacement.variableOffsets[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID]&&this.prevPlacement.placements[Z.crossTileID].text&&(De=this.prevPlacement.variableOffsets[Z.crossTileID].anchor),Z.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[Z.crossTileID]={textOffset:pe,width:u,height:d,anchor:he,textBoxScale:m,prevAnchor:De},this.markUsedJustification(G,he,Z,Q),G.allowVerticalPlacement&&(this.markUsedOrientation(G,Q,Z),this.placedOrientations[Z.crossTileID]=Q),{shift:ye,placedGlyphBoxes:Me}}}placeLayerBucketPart(e,a,u){const{bucket:d,layout:m,translationText:w,translationIcon:E,posMatrix:T,unwrappedTileID:I,textLabelPlaneMatrix:O,labelToScreenMatrix:B,textPixelRatio:U,holdingForFade:Z,collisionBoxArray:G,partiallyEvaluatedTextSize:Q,collisionGroup:ne}=e.parameters,re=m.get("text-optional"),ae=m.get("icon-optional"),X=h.ar(m,"text-overlap","text-allow-overlap"),he=X==="always",pe=h.ar(m,"icon-overlap","icon-allow-overlap"),ye=pe==="always",Me=m.get("text-rotation-alignment")==="map",De=m.get("text-pitch-alignment")==="map",$e=m.get("icon-text-fit")!=="none",We=m.get("symbol-z-order")==="viewport-y",Be=he&&(ye||!d.hasIconData()||ae),Oe=ye&&(he||!d.hasTextData()||re);!d.collisionArrays&&G&&d.deserializeCollisionBoxes(G);const tt=this._getTerrainElevationFunc(this.retainedQueryData[d.bucketInstanceId].tileID),_t=(Ne,Ue,gt)=>{var mi,Et;if(a[Ne.crossTileID])return;if(Z)return void(this.placements[Ne.crossTileID]=new Mt(!1,!1,!1));let Lt=!1,gi=!1,Xi=!0,lr=null,yi={box:null,placeable:!1,offscreen:null},yn={box:null,placeable:!1,offscreen:null},ln=null,Ki=null,cn=null,Dr=0,wo=0,wl=0;Ue.textFeatureIndex?Dr=Ue.textFeatureIndex:Ne.useRuntimeCollisionCircles&&(Dr=Ne.featureIndex),Ue.verticalTextFeatureIndex&&(wo=Ue.verticalTextFeatureIndex);const So=Ue.textBox;if(So){const Yn=Zi=>{let Ji=h.ah.horizontal;if(d.allowVerticalPlacement&&!Zi&&this.prevPlacement){const zn=this.prevPlacement.placedOrientations[Ne.crossTileID];zn&&(this.placedOrientations[Ne.crossTileID]=zn,Ji=zn,this.markUsedOrientation(d,Ji,Ne))}return Ji},Xn=(Zi,Ji)=>{if(d.allowVerticalPlacement&&Ne.numVerticalGlyphVertices>0&&Ue.verticalTextBox){for(const zn of d.writingModes)if(zn===h.ah.vertical?(yi=Ji(),yn=yi):yi=Zi(),yi&&yi.placeable)break}else yi=Zi()},as=Ne.textAnchorOffsetStartIndex,cr=Ne.textAnchorOffsetEndIndex;if(cr===as){const Zi=(Ji,zn)=>{const Bt=this.collisionIndex.placeCollisionBox(Ji,X,U,T,I,De,Me,w,ne.predicate,tt);return Bt&&Bt.placeable&&(this.markUsedOrientation(d,zn,Ne),this.placedOrientations[Ne.crossTileID]=zn),Bt};Xn(()=>Zi(So,h.ah.horizontal),()=>{const Ji=Ue.verticalTextBox;return d.allowVerticalPlacement&&Ne.numVerticalGlyphVertices>0&&Ji?Zi(Ji,h.ah.vertical):{box:null,offscreen:null}}),Yn(yi&&yi.placeable)}else{let Zi=h.aq[(Et=(mi=this.prevPlacement)===null||mi===void 0?void 0:mi.variableOffsets[Ne.crossTileID])===null||Et===void 0?void 0:Et.anchor];const Ji=(Bt,Ns,ko)=>{const Eo=Bt.x2-Bt.x1,Zu=Bt.y2-Bt.y1,_f=Ne.textBoxScale,Wu=$e&&pe==="never"?Ns:null;let ls=null,Gu=X==="never"?1:2,kl="never";Zi&&Gu++;for(let ga=0;ga<Gu;ga++){for(let El=as;El<cr;El++){const Tl=d.textAnchorOffsets.get(El);if(Zi&&Tl.textAnchor!==Zi)continue;const To=this.attemptAnchorPlacement(Tl,Bt,Eo,Zu,_f,Me,De,U,T,I,ne,kl,Ne,d,ko,w,E,Wu,tt);if(To&&(ls=To.placedGlyphBoxes,ls&&ls.placeable))return Lt=!0,lr=To.shift,ls}Zi?Zi=null:kl=X}return u&&!ls&&(ls={box:this.collisionIndex.placeCollisionBox(So,"always",U,T,I,De,Me,w,ne.predicate,tt,new h.P(0,0)).box,offscreen:!1,placeable:!1}),ls};Xn(()=>Ji(So,Ue.iconBox,h.ah.horizontal),()=>{const Bt=Ue.verticalTextBox;return d.allowVerticalPlacement&&(!yi||!yi.placeable)&&Ne.numVerticalGlyphVertices>0&&Bt?Ji(Bt,Ue.verticalIconBox,h.ah.vertical):{box:null,occluded:!0,offscreen:null}}),yi&&(Lt=yi.placeable,Xi=yi.offscreen);const zn=Yn(yi&&yi.placeable);if(!Lt&&this.prevPlacement){const Bt=this.prevPlacement.variableOffsets[Ne.crossTileID];Bt&&(this.variableOffsets[Ne.crossTileID]=Bt,this.markUsedJustification(d,Bt.anchor,Ne,zn))}}}if(ln=yi,Lt=ln&&ln.placeable,Xi=ln&&ln.offscreen,Ne.useRuntimeCollisionCircles){const Yn=d.text.placedSymbolArray.get(Ne.centerJustifiedTextSymbolIndex),Xn=h.ai(d.textSizeData,Q,Yn),as=m.get("text-padding");Ki=this.collisionIndex.placeCollisionCircles(X,Yn,d.lineVertexArray,d.glyphOffsetArray,Xn,T,I,O,B,u,De,ne.predicate,Ne.collisionCircleDiameter,as,w,tt),Ki.circles.length&&Ki.collisionDetected&&!u&&h.w("Collisions detected, but collision boxes are not shown"),Lt=he||Ki.circles.length>0&&!Ki.collisionDetected,Xi=Xi&&Ki.offscreen}if(Ue.iconFeatureIndex&&(wl=Ue.iconFeatureIndex),Ue.iconBox){const Yn=Xn=>this.collisionIndex.placeCollisionBox(Xn,pe,U,T,I,De,Me,E,ne.predicate,tt,$e&&lr?lr:void 0);yn&&yn.placeable&&Ue.verticalIconBox?(cn=Yn(Ue.verticalIconBox),gi=cn.placeable):(cn=Yn(Ue.iconBox),gi=cn.placeable),Xi=Xi&&cn.offscreen}const Gn=re||Ne.numHorizontalGlyphVertices===0&&Ne.numVerticalGlyphVertices===0,Sl=ae||Ne.numIconVertices===0;Gn||Sl?Sl?Gn||(gi=gi&&Lt):Lt=gi&&Lt:gi=Lt=gi&&Lt;const Jc=gi&&cn.placeable;if(Lt&&ln.placeable&&this.collisionIndex.insertCollisionBox(ln.box,X,m.get("text-ignore-placement"),d.bucketInstanceId,yn&&yn.placeable&&wo?wo:Dr,ne.ID),Jc&&this.collisionIndex.insertCollisionBox(cn.box,pe,m.get("icon-ignore-placement"),d.bucketInstanceId,wl,ne.ID),Ki&&Lt&&this.collisionIndex.insertCollisionCircles(Ki.circles,X,m.get("text-ignore-placement"),d.bucketInstanceId,Dr,ne.ID),u&&this.storeCollisionData(d.bucketInstanceId,gt,Ue,ln,cn,Ki),Ne.crossTileID===0)throw new Error("symbolInstance.crossTileID can't be 0");if(d.bucketInstanceId===0)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[Ne.crossTileID]=new Mt(Lt||Be,gi||Oe,Xi||d.justReloaded),a[Ne.crossTileID]=!0};if(We){if(e.symbolInstanceStart!==0)throw new Error("bucket.bucketInstanceId should be 0");const Ne=d.getSortedSymbolIndexes(this.transform.angle);for(let Ue=Ne.length-1;Ue>=0;--Ue){const gt=Ne[Ue];_t(d.symbolInstances.get(gt),d.collisionArrays[gt],gt)}}else for(let Ne=e.symbolInstanceStart;Ne<e.symbolInstanceEnd;Ne++)_t(d.symbolInstances.get(Ne),d.collisionArrays[Ne],Ne);if(u&&d.bucketInstanceId in this.collisionCircleArrays){const Ne=this.collisionCircleArrays[d.bucketInstanceId];h.as(Ne.invProjMatrix,T),Ne.viewportMatrix=this.collisionIndex.getViewportMatrix()}d.justReloaded=!1}storeCollisionData(e,a,u,d,m,w){if(u.textBox||u.iconBox){let E,T;this.collisionBoxArrays.has(e)?E=this.collisionBoxArrays.get(e):(E=new Map,this.collisionBoxArrays.set(e,E)),E.has(a)?T=E.get(a):(T={text:null,icon:null},E.set(a,T)),u.textBox&&(T.text=d.box),u.iconBox&&(T.icon=m.box)}if(w){let E=this.collisionCircleArrays[e];E===void 0&&(E=this.collisionCircleArrays[e]=new ei);for(let T=0;T<w.circles.length;T+=4)E.circles.push(w.circles[T+0]),E.circles.push(w.circles[T+1]),E.circles.push(w.circles[T+2]),E.circles.push(w.collisionDetected?1:0)}}markUsedJustification(e,a,u,d){let m;m=d===h.ah.vertical?u.verticalPlacedTextSymbolIndex:{left:u.leftJustifiedTextSymbolIndex,center:u.centerJustifiedTextSymbolIndex,right:u.rightJustifiedTextSymbolIndex}[h.at(a)];const w=[u.leftJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.rightJustifiedTextSymbolIndex,u.verticalPlacedTextSymbolIndex];for(const E of w)E>=0&&(e.text.placedSymbolArray.get(E).crossTileID=m>=0&&E!==m?0:u.crossTileID)}markUsedOrientation(e,a,u){const d=a===h.ah.horizontal||a===h.ah.horizontalOnly?a:0,m=a===h.ah.vertical?a:0,w=[u.leftJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.rightJustifiedTextSymbolIndex];for(const E of w)e.text.placedSymbolArray.get(E).placedOrientation=d;u.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(u.verticalPlacedTextSymbolIndex).placedOrientation=m)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const a=this.prevPlacement;let u=!1;this.prevZoomAdjustment=a?a.zoomAdjustment(this.transform.zoom):0;const d=a?a.symbolFadeChange(e):1,m=a?a.opacities:{},w=a?a.variableOffsets:{},E=a?a.placedOrientations:{};for(const T in this.placements){const I=this.placements[T],O=m[T];O?(this.opacities[T]=new ki(O,d,I.text,I.icon),u=u||I.text!==O.text.placed||I.icon!==O.icon.placed):(this.opacities[T]=new ki(null,d,I.text,I.icon,I.skipFade),u=u||I.text||I.icon)}for(const T in m){const I=m[T];if(!this.opacities[T]){const O=new ki(I,d,!1,!1);O.isHidden()||(this.opacities[T]=O,u=u||I.text.placed||I.icon.placed)}}for(const T in w)this.variableOffsets[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.variableOffsets[T]=w[T]);for(const T in E)this.placedOrientations[T]||!this.opacities[T]||this.opacities[T].isHidden()||(this.placedOrientations[T]=E[T]);if(a&&a.lastPlacementChangeTime===void 0)throw new Error("Last placement time for previous placement is not defined");u?this.lastPlacementChangeTime=e:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=a?a.lastPlacementChangeTime:e)}updateLayerOpacities(e,a){const u={};for(const d of a){const m=d.getBucket(e);m&&d.latestFeatureIndex&&e.id===m.layerIds[0]&&this.updateBucketOpacities(m,d.tileID,u,d.collisionBoxArray)}}updateBucketOpacities(e,a,u,d){e.hasTextData()&&(e.text.opacityVertexArray.clear(),e.text.hasVisibleVertices=!1),e.hasIconData()&&(e.icon.opacityVertexArray.clear(),e.icon.hasVisibleVertices=!1),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();const m=e.layers[0],w=m.layout,E=new ki(null,0,!1,!1,!0),T=w.get("text-allow-overlap"),I=w.get("icon-allow-overlap"),O=m._unevaluatedLayout.hasValue("text-variable-anchor")||m._unevaluatedLayout.hasValue("text-variable-anchor-offset"),B=w.get("text-rotation-alignment")==="map",U=w.get("text-pitch-alignment")==="map",Z=w.get("icon-text-fit")!=="none",G=new ki(null,0,T&&(I||!e.hasIconData()||w.get("icon-optional")),I&&(T||!e.hasTextData()||w.get("text-optional")),!0);!e.collisionArrays&&d&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(d);const Q=(re,ae,X)=>{for(let he=0;he<ae/4;he++)re.opacityVertexArray.emplaceBack(X);re.hasVisibleVertices=re.hasVisibleVertices||X!==eo},ne=this.collisionBoxArrays.get(e.bucketInstanceId);for(let re=0;re<e.symbolInstances.length;re++){const ae=e.symbolInstances.get(re),{numHorizontalGlyphVertices:X,numVerticalGlyphVertices:he,crossTileID:pe}=ae;let ye=this.opacities[pe];u[pe]?ye=E:ye||(ye=G,this.opacities[pe]=ye),u[pe]=!0;const Me=ae.numIconVertices>0,De=this.placedOrientations[ae.crossTileID],$e=De===h.ah.vertical,We=De===h.ah.horizontal||De===h.ah.horizontalOnly;if(X>0||he>0){const Oe=In(ye.text);Q(e.text,X,$e?eo:Oe),Q(e.text,he,We?eo:Oe);const tt=ye.text.isHidden();[ae.rightJustifiedTextSymbolIndex,ae.centerJustifiedTextSymbolIndex,ae.leftJustifiedTextSymbolIndex].forEach(Ue=>{Ue>=0&&(e.text.placedSymbolArray.get(Ue).hidden=tt||$e?1:0)}),ae.verticalPlacedTextSymbolIndex>=0&&(e.text.placedSymbolArray.get(ae.verticalPlacedTextSymbolIndex).hidden=tt||We?1:0);const _t=this.variableOffsets[ae.crossTileID];_t&&this.markUsedJustification(e,_t.anchor,ae,De);const Ne=this.placedOrientations[ae.crossTileID];Ne&&(this.markUsedJustification(e,"left",ae,Ne),this.markUsedOrientation(e,Ne,ae))}if(Me){const Oe=In(ye.icon),tt=!(Z&&ae.verticalPlacedIconSymbolIndex&&$e);ae.placedIconSymbolIndex>=0&&(Q(e.icon,ae.numIconVertices,tt?Oe:eo),e.icon.placedSymbolArray.get(ae.placedIconSymbolIndex).hidden=ye.icon.isHidden()),ae.verticalPlacedIconSymbolIndex>=0&&(Q(e.icon,ae.numVerticalIconVertices,tt?eo:Oe),e.icon.placedSymbolArray.get(ae.verticalPlacedIconSymbolIndex).hidden=ye.icon.isHidden())}const Be=ne&&ne.has(re)?ne.get(re):{text:null,icon:null};if(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData()){const Oe=e.collisionArrays[re];if(Oe){let tt=new h.P(0,0);if(Oe.textBox||Oe.verticalTextBox){let _t=!0;if(O){const Ne=this.variableOffsets[pe];Ne?(tt=qi(Ne.anchor,Ne.width,Ne.height,Ne.textOffset,Ne.textBoxScale),B&&tt._rotate(U?this.transform.angle:-this.transform.angle)):_t=!1}if(Oe.textBox||Oe.verticalTextBox){let Ne;Oe.textBox&&(Ne=$e),Oe.verticalTextBox&&(Ne=We),Qs(e.textCollisionBox.collisionVertexArray,ye.text.placed,!_t||Ne,Be.text,tt.x,tt.y)}}if(Oe.iconBox||Oe.verticalIconBox){const _t=!!(!We&&Oe.verticalIconBox);let Ne;Oe.iconBox&&(Ne=_t),Oe.verticalIconBox&&(Ne=!_t),Qs(e.iconCollisionBox.collisionVertexArray,ye.icon.placed,Ne,Be.icon,Z?tt.x:0,Z?tt.y:0)}}}}if(e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.text.opacityVertexArray.length!==e.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${e.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${e.text.layoutVertexArray.length}) / 4`);if(e.icon.opacityVertexArray.length!==e.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${e.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${e.icon.layoutVertexArray.length}) / 4`);if(e.bucketInstanceId in this.collisionCircleArrays){const re=this.collisionCircleArrays[e.bucketInstanceId];e.placementInvProjMatrix=re.invProjMatrix,e.placementViewportMatrix=re.viewportMatrix,e.collisionCircleArray=re.circles,delete this.collisionCircleArrays[e.bucketInstanceId]}}symbolFadeChange(e){return this.fadeDuration===0?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,a){const u=this.zoomAtLastRecencyCheck===a?1-this.zoomAdjustment(a):1;return this.zoomAtLastRecencyCheck=a,this.commitTime+this.fadeDuration*u>e}setStale(){this.stale=!0}}function Qs(g,e,a,u,d,m){u&&u.length!==0||(u=[0,0,0,0]);const w=u[0]-vt,E=u[1]-vt,T=u[2]-vt,I=u[3]-vt;g.emplaceBack(e?1:0,a?1:0,d||0,m||0,w,E),g.emplaceBack(e?1:0,a?1:0,d||0,m||0,T,E),g.emplaceBack(e?1:0,a?1:0,d||0,m||0,T,I),g.emplaceBack(e?1:0,a?1:0,d||0,m||0,w,I)}const ti=Math.pow(2,25),cc=Math.pow(2,24),hc=Math.pow(2,17),Mn=Math.pow(2,16),Pn=Math.pow(2,9),qp=Math.pow(2,8),Hn=Math.pow(2,1);function In(g){if(g.opacity===0&&!g.placed)return 0;if(g.opacity===1&&g.placed)return 4294967295;const e=g.placed?1:0,a=Math.floor(127*g.opacity);return a*ti+e*cc+a*hc+e*Mn+a*Pn+e*qp+a*Hn+e}const eo=0;function Cs(){return{isOccluded:(g,e,a)=>!1,getPitchedTextCorrection:(g,e,a)=>1,get useSpecialProjectionForSymbols(){return!1},projectTileCoordinates(g,e,a,u){throw new Error("Not implemented.")},translatePosition:(g,e,a,u)=>function(d,m,w,E,T=!1){if(!w[0]&&!w[1])return[0,0];const I=T?E==="map"?d.angle:0:E==="viewport"?-d.angle:0;if(I){const O=Math.sin(I),B=Math.cos(I);w=[w[0]*B-w[1]*O,w[0]*O+w[1]*B]}return[T?w[0]:Rt(m,w[0],d.zoom),T?w[1]:Rt(m,w[1],d.zoom)]}(g,e,a,u),getCircleRadiusCorrection:g=>1}}class zi{constructor(e){this._sortAcrossTiles=e.layout.get("symbol-z-order")!=="viewport-y"&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,a,u,d,m){const w=this._bucketParts;for(;this._currentTileIndex<e.length;)if(a.getBucketParts(w,d,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,m())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,w.sort((E,T)=>E.sortKey-T.sortKey));this._currentPartIndex<w.length;)if(a.placeLayerBucketPart(w[this._currentPartIndex],this._seenCrossTileIDs,u),this._currentPartIndex++,m())return!0;return!1}}class Jo{constructor(e,a,u,d,m,w,E,T){this.placement=new an(e,Cs(),a,w,E,T),this._currentPlacementIndex=u.length-1,this._forceFullPlacement=d,this._showCollisionBoxes=m,this._done=!1}isDone(){return this._done}continuePlacement(e,a,u){const d=R.now(),m=()=>!this._forceFullPlacement&&R.now()-d>2;for(;this._currentPlacementIndex>=0;){const w=a[e[this._currentPlacementIndex]],E=this.placement.collisionIndex.transform.zoom;if(w.type==="symbol"&&(!w.minzoom||w.minzoom<=E)&&(!w.maxzoom||w.maxzoom>E)){if(this._inProgressLayer||(this._inProgressLayer=new zi(w)),this._inProgressLayer.continuePlacement(u[w.source],this.placement,this._showCollisionBoxes,w,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const nr=512/h.X/2;class Ii{constructor(e,a,u){this.tileID=e,this.bucketInstanceId=u,this._symbolsByKey={};const d=new Map;for(let m=0;m<a.length;m++){const w=a.get(m),E=w.key,T=d.get(E);T?T.push(w):d.set(E,[w])}for(const[m,w]of d){const E={positions:w.map(T=>({x:Math.floor(T.anchorX*nr),y:Math.floor(T.anchorY*nr)})),crossTileIDs:w.map(T=>T.crossTileID)};if(E.positions.length>128){const T=new h.av(E.positions.length,16,Uint16Array);for(const{x:I,y:O}of E.positions)T.add(I,O);T.finish(),delete E.positions,E.index=T}this._symbolsByKey[m]=E}}getScaledCoordinates(e,a){const{x:u,y:d,z:m}=this.tileID.canonical,{x:w,y:E,z:T}=a.canonical,I=nr/Math.pow(2,T-m),O=(E*h.X+e.anchorY)*I,B=d*h.X*nr;return{x:Math.floor((w*h.X+e.anchorX)*I-u*h.X*nr),y:Math.floor(O-B)}}findMatches(e,a,u){const d=this.tileID.canonical.z<a.canonical.z?1:Math.pow(2,this.tileID.canonical.z-a.canonical.z);for(let m=0;m<e.length;m++){const w=e.get(m);if(w.crossTileID)continue;const E=this._symbolsByKey[w.key];if(!E)continue;const T=this.getScaledCoordinates(w,a);if(E.index){const I=E.index.range(T.x-d,T.y-d,T.x+d,T.y+d).sort();for(const O of I){const B=E.crossTileIDs[O];if(!u[B]){u[B]=!0,w.crossTileID=B;break}}}else if(E.positions)for(let I=0;I<E.positions.length;I++){const O=E.positions[I],B=E.crossTileIDs[I];if(Math.abs(O.x-T.x)<=d&&Math.abs(O.y-T.y)<=d&&!u[B]){u[B]=!0,w.crossTileID=B;break}}}}getCrossTileIDsLists(){return Object.values(this._symbolsByKey).map(({crossTileIDs:e})=>e)}}class qa{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class rr{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const a=Math.round((e-this.lng)/360);if(a!==0)for(const u in this.indexes){const d=this.indexes[u],m={};for(const w in d){const E=d[w];E.tileID=E.tileID.unwrapTo(E.tileID.wrap+a),m[E.tileID.key]=E}this.indexes[u]=m}this.lng=e}addBucket(e,a,u){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===a.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let m=0;m<a.symbolInstances.length;m++)a.symbolInstances.get(m).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const d=this.usedCrossTileIDs[e.overscaledZ];for(const m in this.indexes){const w=this.indexes[m];if(Number(m)>e.overscaledZ)for(const E in w){const T=w[E];T.tileID.isChildOf(e)&&T.findMatches(a.symbolInstances,e,d)}else{const E=w[e.scaledTo(Number(m)).key];E&&E.findMatches(a.symbolInstances,e,d)}}for(let m=0;m<a.symbolInstances.length;m++){const w=a.symbolInstances.get(m);w.crossTileID||(w.crossTileID=u.generate(),d[w.crossTileID]=!0)}return this.indexes[e.overscaledZ]===void 0&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new Ii(e,a.symbolInstances,a.bucketInstanceId),!0}removeBucketCrossTileIDs(e,a){for(const u of a.getCrossTileIDsLists())for(const d of u)delete this.usedCrossTileIDs[e][d]}removeStaleBuckets(e){let a=!1;for(const u in this.indexes){const d=this.indexes[u];for(const m in d)e[d[m].bucketInstanceId]||(this.removeBucketCrossTileIDs(u,d[m]),delete d[m],a=!0)}return a}}class uc{constructor(){this.layerIndexes={},this.crossTileIDs=new qa,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,a,u){let d=this.layerIndexes[e.id];d===void 0&&(d=this.layerIndexes[e.id]=new rr);let m=!1;const w={};d.handleWrapJump(u);for(const E of a){const T=E.getBucket(e);T&&e.id===T.layerIds[0]&&(T.bucketInstanceId||(T.bucketInstanceId=++this.maxBucketInstanceId),d.addBucket(E.tileID,T,this.crossTileIDs)&&(m=!0),w[T.bucketInstanceId]=!0)}return d.removeStaleBuckets(w)&&(m=!0),m}pruneUnusedLayers(e){const a={};e.forEach(u=>{a[u]=!0});for(const u in this.layerIndexes)a[u]||delete this.layerIndexes[u]}}const sr=(g,e)=>h.t(g,e&&e.filter(a=>a.identifier!=="source.canvas")),Zp=h.aw();class Za extends h.E{constructor(e,a={}){super(),this._rtlPluginLoaded=()=>{for(const u in this.sourceCaches){const d=this.sourceCaches[u].getSource().type;d!=="vector"&&d!=="geojson"||this.sourceCaches[u].reload()}},this.map=e,this.dispatcher=new ot(Ze(),e._getMapId()),this.dispatcher.registerMessageHandler("GG",(u,d)=>this.getGlyphs(u,d)),this.dispatcher.registerMessageHandler("GI",(u,d)=>this.getImages(u,d)),this.imageManager=new zt,this.imageManager.setEventedParent(this),this.glyphManager=new Ui(e._requestManager,a.localIdeographFontFamily),this.lineAtlas=new kr(256,512),this.crossTileSymbolIndex=new uc,this._spritesImagesIds={},this._layers={},this._order=[],this.sourceCaches={},this.zoomHistory=new h.ax,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("SR",h.ay()),Tr().on(ze,this._rtlPluginLoaded),this.on("data",u=>{if(u.dataType!=="source"||u.sourceDataType!=="metadata")return;const d=this.sourceCaches[u.sourceId];if(!d)return;const m=d.getSource();if(m&&m.vectorLayerIds)for(const w in this._layers){const E=this._layers[w];E.source===m.id&&this._validateLayer(E)}})}loadURL(e,a={},u){this.fire(new h.k("dataloading",{dataType:"style"})),a.validate=typeof a.validate!="boolean"||a.validate;const d=this.map._requestManager.transformRequest(e,"Style");this._loadStyleRequest=new AbortController;const m=this._loadStyleRequest;h.h(d,this._loadStyleRequest).then(w=>{this._loadStyleRequest=null,this._load(w.data,a,u)}).catch(w=>{this._loadStyleRequest=null,w&&!m.signal.aborted&&this.fire(new h.j(w))})}loadJSON(e,a={},u){this.fire(new h.k("dataloading",{dataType:"style"})),this._frameRequest=new AbortController,R.frameAsync(this._frameRequest).then(()=>{this._frameRequest=null,a.validate=a.validate!==!1,this._load(e,a,u)}).catch(()=>{})}loadEmpty(){this.fire(new h.k("dataloading",{dataType:"style"})),this._load(Zp,{validate:!1})}_load(e,a,u){var d;const m=a.transformStyle?a.transformStyle(u,e):e;if(!a.validate||!sr(this,h.u(m))){this._loaded=!0,this.stylesheet=m;for(const w in m.sources)this.addSource(w,m.sources[w],{validate:!1});m.sprite?this._loadSprite(m.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(m.glyphs),this._createLayers(),this.light=new kn(this.stylesheet.light),this.sky=new sn(this.stylesheet.sky),this.map.setTerrain((d=this.stylesheet.terrain)!==null&&d!==void 0?d:null),this.fire(new h.k("data",{dataType:"style"})),this.fire(new h.k("style.load"))}}_createLayers(){const e=h.az(this.stylesheet.layers);this.dispatcher.broadcast("SL",e),this._order=e.map(a=>a.id),this._layers={},this._serializedLayers=null;for(const a of e){const u=h.aA(a);u.setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=u}}_loadSprite(e,a=!1,u=void 0){let d;this.imageManager.setLoaded(!1),this._spriteRequest=new AbortController,function(m,w,E,T){return h._(this,void 0,void 0,function*(){const I=wt(m),O=E>1?"@2x":"",B={},U={};for(const{id:Z,url:G}of I){const Q=w.transformRequest(Nt(G,O,".json"),"SpriteJSON");B[Z]=h.h(Q,T);const ne=w.transformRequest(Nt(G,O,".png"),"SpriteImage");U[Z]=_e.getImage(ne,T)}return yield Promise.all([...Object.values(B),...Object.values(U)]),function(Z,G){return h._(this,void 0,void 0,function*(){const Q={};for(const ne in Z){Q[ne]={};const re=R.getImageCanvasContext((yield G[ne]).data),ae=(yield Z[ne]).data;for(const X in ae){const{width:he,height:pe,x:ye,y:Me,sdf:De,pixelRatio:$e,stretchX:We,stretchY:Be,content:Oe,textFitWidth:tt,textFitHeight:_t}=ae[X];Q[ne][X]={data:null,pixelRatio:$e,sdf:De,stretchX:We,stretchY:Be,content:Oe,textFitWidth:tt,textFitHeight:_t,spriteData:{width:he,height:pe,x:ye,y:Me,context:re}}}}return Q})}(B,U)})}(e,this.map._requestManager,this.map.getPixelRatio(),this._spriteRequest).then(m=>{if(this._spriteRequest=null,m)for(const w in m){this._spritesImagesIds[w]=[];const E=this._spritesImagesIds[w]?this._spritesImagesIds[w].filter(T=>!(T in m)):[];for(const T of E)this.imageManager.removeImage(T),this._changedImages[T]=!0;for(const T in m[w]){const I=w==="default"?T:`${w}:${T}`;this._spritesImagesIds[w].push(I),I in this.imageManager.images?this.imageManager.updateImage(I,m[w][T],!1):this.imageManager.addImage(I,m[w][T]),a&&(this._changedImages[I]=!0)}}}).catch(m=>{this._spriteRequest=null,d=m,this.fire(new h.j(d))}).finally(()=>{this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),a&&(this._changed=!0),this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.k("data",{dataType:"style"})),u&&u(d)})}_unloadSprite(){for(const e of Object.values(this._spritesImagesIds).flat())this.imageManager.removeImage(e),this._changedImages[e]=!0;this._spritesImagesIds={},this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.k("data",{dataType:"style"}))}_validateLayer(e){const a=this.sourceCaches[e.source];if(!a)return;const u=e.sourceLayer;if(!u)return;const d=a.getSource();(d.type==="geojson"||d.vectorLayerIds&&d.vectorLayerIds.indexOf(u)===-1)&&this.fire(new h.j(new Error(`Source layer "${u}" does not exist on source "${d.id}" as specified by style layer "${e.id}".`)))}loaded(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeByIds(e,a=!1){const u=this._serializedAllLayers();if(!e||e.length===0)return Object.values(a?h.aB(u):u);const d=[];for(const m of e)if(u[m]){const w=a?h.aB(u[m]):u[m];d.push(w)}return d}_serializedAllLayers(){let e=this._serializedLayers;if(e)return e;e=this._serializedLayers={};const a=Object.keys(this._layers);for(const u of a){const d=this._layers[u];d.type!=="custom"&&(e[u]=d.serialize())}return e}hasTransitions(){if(this.light&&this.light.hasTransition()||this.sky&&this.sky.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(e){if(!this._loaded)return;const a=this._changed;if(a){const d=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);(d.length||m.length)&&this._updateWorkerLayers(d,m);for(const w in this._updatedSources){const E=this._updatedSources[w];if(E==="reload")this._reloadSource(w);else{if(E!=="clear")throw new Error(`Invalid action ${E}`);this._clearSource(w)}}this._updateTilesForChangedImages(),this._updateTilesForChangedGlyphs();for(const w in this._updatedPaintProps)this._layers[w].updateTransitions(e);this.light.updateTransitions(e),this.sky.updateTransitions(e),this._resetUpdates()}const u={};for(const d in this.sourceCaches){const m=this.sourceCaches[d];u[d]=m.used,m.used=!1}for(const d of this._order){const m=this._layers[d];m.recalculate(e,this._availableImages),!m.isHidden(e.zoom)&&m.source&&(this.sourceCaches[m.source].used=!0)}for(const d in u){const m=this.sourceCaches[d];!!u[d]!=!!m.used&&m.fire(new h.k("data",{sourceDataType:"visibility",dataType:"source",sourceId:d}))}this.light.recalculate(e),this.sky.recalculate(e),this.z=e.zoom,a&&this.fire(new h.k("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const a in this.sourceCaches)this.sourceCaches[a].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateTilesForChangedGlyphs(){if(this._glyphsDidChange){for(const e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["glyphs"],[""]);this._glyphsDidChange=!1}}_updateWorkerLayers(e,a){this.dispatcher.broadcast("UL",{layers:this._serializeByIds(e,!1),removedIds:a})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={},this._glyphsDidChange=!1}setState(e,a={}){var u;this._checkLoaded();const d=this.serialize();if(e=a.transformStyle?a.transformStyle(d,e):e,((u=a.validate)===null||u===void 0||u)&&sr(this,h.u(e)))return!1;(e=h.aB(e)).layers=h.az(e.layers);const m=h.aC(d,e),w=this._getOperationsToPerform(m);if(w.unimplemented.length>0)throw new Error(`Unimplemented: ${w.unimplemented.join(", ")}.`);if(w.operations.length===0)return!1;for(const E of w.operations)E();return this.stylesheet=e,this._serializedLayers=null,!0}_getOperationsToPerform(e){const a=[],u=[];for(const d of e)switch(d.command){case"setCenter":case"setZoom":case"setBearing":case"setPitch":continue;case"addLayer":a.push(()=>this.addLayer.apply(this,d.args));break;case"removeLayer":a.push(()=>this.removeLayer.apply(this,d.args));break;case"setPaintProperty":a.push(()=>this.setPaintProperty.apply(this,d.args));break;case"setLayoutProperty":a.push(()=>this.setLayoutProperty.apply(this,d.args));break;case"setFilter":a.push(()=>this.setFilter.apply(this,d.args));break;case"addSource":a.push(()=>this.addSource.apply(this,d.args));break;case"removeSource":a.push(()=>this.removeSource.apply(this,d.args));break;case"setLayerZoomRange":a.push(()=>this.setLayerZoomRange.apply(this,d.args));break;case"setLight":a.push(()=>this.setLight.apply(this,d.args));break;case"setGeoJSONSourceData":a.push(()=>this.setGeoJSONSourceData.apply(this,d.args));break;case"setGlyphs":a.push(()=>this.setGlyphs.apply(this,d.args));break;case"setSprite":a.push(()=>this.setSprite.apply(this,d.args));break;case"setSky":a.push(()=>this.setSky.apply(this,d.args));break;case"setTerrain":a.push(()=>this.map.setTerrain.apply(this,d.args));break;case"setTransition":a.push(()=>{});break;default:u.push(d.command)}return{operations:a,unimplemented:u}}addImage(e,a){if(this.getImage(e))return this.fire(new h.j(new Error(`An image named "${e}" already exists.`)));this.imageManager.addImage(e,a),this._afterImageUpdated(e)}updateImage(e,a){this.imageManager.updateImage(e,a)}getImage(e){return this.imageManager.getImage(e)}removeImage(e){if(!this.getImage(e))return this.fire(new h.j(new Error(`An image named "${e}" does not exist.`)));this.imageManager.removeImage(e),this._afterImageUpdated(e)}_afterImageUpdated(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.k("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(e,a,u={}){if(this._checkLoaded(),this.sourceCaches[e]!==void 0)throw new Error(`Source "${e}" already exists.`);if(!a.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(a).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(a.type)>=0&&this._validate(h.u.source,`sources.${e}`,a,null,u))return;this.map&&this.map._collectResourceTiming&&(a.collectResourceTiming=!0);const d=this.sourceCaches[e]=new pt(e,a,this.dispatcher);d.style=this,d.setEventedParent(this,()=>({isSourceLoaded:d.loaded(),source:d.serialize(),sourceId:e})),d.onAdd(this.map),this._changed=!0}removeSource(e){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error("There is no source with this ID");for(const u in this._layers)if(this._layers[u].source===e)return this.fire(new h.j(new Error(`Source "${e}" cannot be removed while layer "${u}" is using it.`)));const a=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],a.fire(new h.k("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),a.setEventedParent(null),a.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,a){if(this._checkLoaded(),this.sourceCaches[e]===void 0)throw new Error(`There is no source with this ID=${e}`);const u=this.sourceCaches[e].getSource();if(u.type!=="geojson")throw new Error(`geojsonSource.type is ${u.type}, which is !== 'geojson`);u.setData(a),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(e,a,u={}){this._checkLoaded();const d=e.id;if(this.getLayer(d))return void this.fire(new h.j(new Error(`Layer "${d}" already exists on this map.`)));let m;if(e.type==="custom"){if(sr(this,h.aD(e)))return;m=h.aA(e)}else{if("source"in e&&typeof e.source=="object"&&(this.addSource(d,e.source),e=h.aB(e),e=h.e(e,{source:d})),this._validate(h.u.layer,`layers.${d}`,e,{arrayIndex:-1},u))return;m=h.aA(e),this._validateLayer(m),m.setEventedParent(this,{layer:{id:d}})}const w=a?this._order.indexOf(a):this._order.length;if(a&&w===-1)this.fire(new h.j(new Error(`Cannot add layer "${d}" before non-existing layer "${a}".`)));else{if(this._order.splice(w,0,d),this._layerOrderChanged=!0,this._layers[d]=m,this._removedLayers[d]&&m.source&&m.type!=="custom"){const E=this._removedLayers[d];delete this._removedLayers[d],E.type!==m.type?this._updatedSources[m.source]="clear":(this._updatedSources[m.source]="reload",this.sourceCaches[m.source].pause())}this._updateLayer(m),m.onAdd&&m.onAdd(this.map)}}moveLayer(e,a){if(this._checkLoaded(),this._changed=!0,!this._layers[e])return void this.fire(new h.j(new Error(`The layer '${e}' does not exist in the map's style and cannot be moved.`)));if(e===a)return;const u=this._order.indexOf(e);this._order.splice(u,1);const d=a?this._order.indexOf(a):this._order.length;a&&d===-1?this.fire(new h.j(new Error(`Cannot move layer "${e}" before non-existing layer "${a}".`))):(this._order.splice(d,0,e),this._layerOrderChanged=!0)}removeLayer(e){this._checkLoaded();const a=this._layers[e];if(!a)return void this.fire(new h.j(new Error(`Cannot remove non-existing layer "${e}".`)));a.setEventedParent(null);const u=this._order.indexOf(e);this._order.splice(u,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=a,delete this._layers[e],this._serializedLayers&&delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],a.onRemove&&a.onRemove(this.map)}getLayer(e){return this._layers[e]}getLayersOrder(){return[...this._order]}hasLayer(e){return e in this._layers}setLayerZoomRange(e,a,u){this._checkLoaded();const d=this.getLayer(e);d?d.minzoom===a&&d.maxzoom===u||(a!=null&&(d.minzoom=a),u!=null&&(d.maxzoom=u),this._updateLayer(d)):this.fire(new h.j(new Error(`Cannot set the zoom range of non-existing layer "${e}".`)))}setFilter(e,a,u={}){this._checkLoaded();const d=this.getLayer(e);if(d){if(!h.aE(d.filter,a))return a==null?(d.filter=void 0,void this._updateLayer(d)):void(this._validate(h.u.filter,`layers.${d.id}.filter`,a,null,u)||(d.filter=h.aB(a),this._updateLayer(d)))}else this.fire(new h.j(new Error(`Cannot filter non-existing layer "${e}".`)))}getFilter(e){return h.aB(this.getLayer(e).filter)}setLayoutProperty(e,a,u,d={}){this._checkLoaded();const m=this.getLayer(e);m?h.aE(m.getLayoutProperty(a),u)||(m.setLayoutProperty(a,u,d),this._updateLayer(m)):this.fire(new h.j(new Error(`Cannot style non-existing layer "${e}".`)))}getLayoutProperty(e,a){const u=this.getLayer(e);if(u)return u.getLayoutProperty(a);this.fire(new h.j(new Error(`Cannot get style of non-existing layer "${e}".`)))}setPaintProperty(e,a,u,d={}){this._checkLoaded();const m=this.getLayer(e);m?h.aE(m.getPaintProperty(a),u)||(m.setPaintProperty(a,u,d)&&this._updateLayer(m),this._changed=!0,this._updatedPaintProps[e]=!0,this._serializedLayers=null):this.fire(new h.j(new Error(`Cannot style non-existing layer "${e}".`)))}getPaintProperty(e,a){return this.getLayer(e).getPaintProperty(a)}setFeatureState(e,a){this._checkLoaded();const u=e.source,d=e.sourceLayer,m=this.sourceCaches[u];if(m===void 0)return void this.fire(new h.j(new Error(`The source '${u}' does not exist in the map's style.`)));const w=m.getSource().type;w==="geojson"&&d?this.fire(new h.j(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):w!=="vector"||d?(e.id===void 0&&this.fire(new h.j(new Error("The feature id parameter must be provided."))),m.setFeatureState(d,e.id,a)):this.fire(new h.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(e,a){this._checkLoaded();const u=e.source,d=this.sourceCaches[u];if(d===void 0)return void this.fire(new h.j(new Error(`The source '${u}' does not exist in the map's style.`)));const m=d.getSource().type,w=m==="vector"?e.sourceLayer:void 0;m!=="vector"||w?a&&typeof e.id!="string"&&typeof e.id!="number"?this.fire(new h.j(new Error("A feature id is required to remove its specific state property."))):d.removeFeatureState(w,e.id,a):this.fire(new h.j(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(e){this._checkLoaded();const a=e.source,u=e.sourceLayer,d=this.sourceCaches[a];if(d!==void 0)return d.getSource().type!=="vector"||u?(e.id===void 0&&this.fire(new h.j(new Error("The feature id parameter must be provided."))),d.getFeatureState(u,e.id)):void this.fire(new h.j(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new h.j(new Error(`The source '${a}' does not exist in the map's style.`)))}getTransition(){return h.e({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){if(!this._loaded)return;const e=h.aF(this.sourceCaches,m=>m.serialize()),a=this._serializeByIds(this._order,!0),u=this.map.getTerrain()||void 0,d=this.stylesheet;return h.aG({version:d.version,name:d.name,metadata:d.metadata,light:d.light,sky:d.sky,center:d.center,zoom:d.zoom,bearing:d.bearing,pitch:d.pitch,sprite:d.sprite,glyphs:d.glyphs,transition:d.transition,sources:e,layers:a,terrain:u},m=>m!==void 0)}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&this.sourceCaches[e.source].getSource().type!=="raster"&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._serializedLayers=null,this._changed=!0}_flattenAndSortRenderedFeatures(e){const a=w=>this._layers[w].type==="fill-extrusion",u={},d=[];for(let w=this._order.length-1;w>=0;w--){const E=this._order[w];if(a(E)){u[E]=w;for(const T of e){const I=T[E];if(I)for(const O of I)d.push(O)}}}d.sort((w,E)=>E.intersectionZ-w.intersectionZ);const m=[];for(let w=this._order.length-1;w>=0;w--){const E=this._order[w];if(a(E))for(let T=d.length-1;T>=0;T--){const I=d[T].feature;if(u[I.layer.id]<w)break;m.push(I),d.pop()}else for(const T of e){const I=T[E];if(I)for(const O of I)m.push(O.feature)}}return m}queryRenderedFeatures(e,a,u){a&&a.filter&&this._validate(h.u.filter,"queryRenderedFeatures.filter",a.filter,null,a);const d={};if(a&&a.layers){if(!Array.isArray(a.layers))return this.fire(new h.j(new Error("parameters.layers must be an Array."))),[];for(const E of a.layers){const T=this._layers[E];if(!T)return this.fire(new h.j(new Error(`The layer '${E}' does not exist in the map's style and cannot be queried for features.`))),[];d[T.source]=!0}}const m=[];a.availableImages=this._availableImages;const w=this._serializedAllLayers();for(const E in this.sourceCaches)a.layers&&!d[E]||m.push(kt(this.sourceCaches[E],this._layers,w,e,a,u));return this.placement&&m.push(function(E,T,I,O,B,U,Z){const G={},Q=U.queryRenderedSymbols(O),ne=[];for(const re of Object.keys(Q).map(Number))ne.push(Z[re]);ne.sort(bt);for(const re of ne){const ae=re.featureIndex.lookupSymbolFeatures(Q[re.bucketInstanceId],T,re.bucketIndex,re.sourceLayerIndex,B.filter,B.layers,B.availableImages,E);for(const X in ae){const he=G[X]=G[X]||[],pe=ae[X];pe.sort((ye,Me)=>{const De=re.featureSortOrder;if(De){const $e=De.indexOf(ye.featureIndex);return De.indexOf(Me.featureIndex)-$e}return Me.featureIndex-ye.featureIndex});for(const ye of pe)he.push(ye)}}for(const re in G)G[re].forEach(ae=>{const X=ae.feature,he=I[E[re].source].getFeatureState(X.layer["source-layer"],X.id);X.source=X.layer.source,X.layer["source-layer"]&&(X.sourceLayer=X.layer["source-layer"]),X.state=he});return G}(this._layers,w,this.sourceCaches,e,a,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(m)}querySourceFeatures(e,a){a&&a.filter&&this._validate(h.u.filter,"querySourceFeatures.filter",a.filter,null,a);const u=this.sourceCaches[e];return u?function(d,m){const w=d.getRenderableIds().map(I=>d.getTileByID(I)),E=[],T={};for(let I=0;I<w.length;I++){const O=w[I],B=O.tileID.canonical.key;T[B]||(T[B]=!0,O.querySourceFeatures(E,m))}return E}(u,a):[]}getLight(){return this.light.getLight()}setLight(e,a={}){this._checkLoaded();const u=this.light.getLight();let d=!1;for(const w in e)if(!h.aE(e[w],u[w])){d=!0;break}if(!d)return;const m={now:R.now(),transition:h.e({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(e,a),this.light.updateTransitions(m)}getSky(){var e;return(e=this.stylesheet)===null||e===void 0?void 0:e.sky}setSky(e,a={}){const u=this.getSky();let d=!1;if(!e&&!u)return;if(e&&!u)d=!0;else if(!e&&u)d=!0;else for(const w in e)if(!h.aE(e[w],u[w])){d=!0;break}if(!d)return;const m={now:R.now(),transition:h.e({duration:300,delay:0},this.stylesheet.transition)};this.stylesheet.sky=e,this.sky.setSky(e,a),this.sky.updateTransitions(m)}_validate(e,a,u,d,m={}){return(!m||m.validate!==!1)&&sr(this,e.call(h.u,h.e({key:a,style:this.serialize(),value:u,styleSpec:h.v},d)))}_remove(e=!0){this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._loadStyleRequest&&(this._loadStyleRequest.abort(),this._loadStyleRequest=null),this._spriteRequest&&(this._spriteRequest.abort(),this._spriteRequest=null),Tr().off(ze,this._rtlPluginLoaded);for(const a in this._layers)this._layers[a].setEventedParent(null);for(const a in this.sourceCaches){const u=this.sourceCaches[a];u.setEventedParent(null),u.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),e&&this.dispatcher.broadcast("RM",void 0),this.dispatcher.remove(e)}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const a in this.sourceCaches)this.sourceCaches[a].update(e,this.map.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(e,a,u,d,m=!1){let w=!1,E=!1;const T={};for(const I of this._order){const O=this._layers[I];if(O.type!=="symbol")continue;if(!T[O.source]){const U=this.sourceCaches[O.source];T[O.source]=U.getRenderableIds(!0).map(Z=>U.getTileByID(Z)).sort((Z,G)=>G.tileID.overscaledZ-Z.tileID.overscaledZ||(Z.tileID.isLessThan(G.tileID)?-1:1))}const B=this.crossTileSymbolIndex.addLayer(O,T[O.source],e.center.lng);w=w||B}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((m=m||this._layerOrderChanged||u===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(R.now(),e.zoom))&&(this.pauseablePlacement=new Jo(e,this.map.terrain,this._order,m,a,u,d,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,T),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(R.now()),E=!0),w&&this.pauseablePlacement.placement.setStale()),E||w)for(const I of this._order){const O=this._layers[I];O.type==="symbol"&&this.placement.updateLayerOpacities(O,T[O.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(R.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,a){return h._(this,void 0,void 0,function*(){const u=yield this.imageManager.getImages(a.icons);this._updateTilesForChangedImages();const d=this.sourceCaches[a.source];return d&&d.setDependencies(a.tileID.key,a.type,a.icons),u})}getGlyphs(e,a){return h._(this,void 0,void 0,function*(){const u=yield this.glyphManager.getGlyphs(a.stacks),d=this.sourceCaches[a.source];return d&&d.setDependencies(a.tileID.key,a.type,[""]),u})}getGlyphsUrl(){return this.stylesheet.glyphs||null}setGlyphs(e,a={}){this._checkLoaded(),e&&this._validate(h.u.glyphs,"glyphs",e,null,a)||(this._glyphsDidChange=!0,this.stylesheet.glyphs=e,this.glyphManager.entries={},this.glyphManager.setURL(e))}addSprite(e,a,u={},d){this._checkLoaded();const m=[{id:e,url:a}],w=[...wt(this.stylesheet.sprite),...m];this._validate(h.u.sprite,"sprite",w,null,u)||(this.stylesheet.sprite=w,this._loadSprite(m,!0,d))}removeSprite(e){this._checkLoaded();const a=wt(this.stylesheet.sprite);if(a.find(u=>u.id===e)){if(this._spritesImagesIds[e])for(const u of this._spritesImagesIds[e])this.imageManager.removeImage(u),this._changedImages[u]=!0;a.splice(a.findIndex(u=>u.id===e),1),this.stylesheet.sprite=a.length>0?a:void 0,delete this._spritesImagesIds[e],this._availableImages=this.imageManager.listImages(),this._changed=!0,this.dispatcher.broadcast("SI",this._availableImages),this.fire(new h.k("data",{dataType:"style"}))}else this.fire(new h.j(new Error(`Sprite "${e}" doesn't exists on this map.`)))}getSprite(){return wt(this.stylesheet.sprite)}setSprite(e,a={},u){this._checkLoaded(),e&&this._validate(h.u.sprite,"sprite",e,null,a)||(this.stylesheet.sprite=e,e?this._loadSprite(e,!0,u):(this._unloadSprite(),u&&u(null)))}}var Ms=h.Y([{name:"a_pos",type:"Int16",components:2}]);const ss={prelude:Gt(`#ifdef GL_ES
41
+ precision mediump float;
42
+ #else
43
+ #if !defined(lowp)
44
+ #define lowp
45
+ #endif
46
+ #if !defined(mediump)
47
+ #define mediump
48
+ #endif
49
+ #if !defined(highp)
50
+ #define highp
51
+ #endif
52
+ #endif
53
+ `,`#ifdef GL_ES
54
+ precision highp float;
55
+ #else
56
+ #if !defined(lowp)
57
+ #define lowp
58
+ #endif
59
+ #if !defined(mediump)
60
+ #define mediump
61
+ #endif
62
+ #if !defined(highp)
63
+ #define highp
64
+ #endif
65
+ #endif
66
+ 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
67
+ );}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;}
68
+ #ifdef TERRAIN3D
69
+ 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;
70
+ #endif
71
+ 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) {
72
+ #ifdef TERRAIN3D
73
+ 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));
74
+ #else
75
+ return 1.0;
76
+ #endif
77
+ }float calculate_visibility(vec4 pos) {
78
+ #ifdef TERRAIN3D
79
+ 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;
80
+ #else
81
+ return 1.0;
82
+ #endif
83
+ }float ele(vec2 pos) {
84
+ #ifdef TERRAIN3D
85
+ vec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;
86
+ #else
87
+ return 0.0;
88
+ #endif
89
+ }float get_elevation(vec2 pos) {
90
+ #ifdef TERRAIN3D
91
+ 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;
92
+ #else
93
+ return 0.0;
94
+ #endif
95
+ }`),background:Gt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
96
+ #ifdef OVERDRAW_INSPECTOR
97
+ gl_FragColor=vec4(1.0);
98
+ #endif
99
+ }`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),backgroundPattern:Gt(`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;
100
+ #ifdef OVERDRAW_INSPECTOR
101
+ gl_FragColor=vec4(1.0);
102
+ #endif
103
+ }`,"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:Gt(`varying vec3 v_data;varying float v_visibility;
104
+ #pragma mapbox: define highp vec4 color
105
+ #pragma mapbox: define mediump float radius
106
+ #pragma mapbox: define lowp float blur
107
+ #pragma mapbox: define lowp float opacity
108
+ #pragma mapbox: define highp vec4 stroke_color
109
+ #pragma mapbox: define mediump float stroke_width
110
+ #pragma mapbox: define lowp float stroke_opacity
111
+ void main() {
112
+ #pragma mapbox: initialize highp vec4 color
113
+ #pragma mapbox: initialize mediump float radius
114
+ #pragma mapbox: initialize lowp float blur
115
+ #pragma mapbox: initialize lowp float opacity
116
+ #pragma mapbox: initialize highp vec4 stroke_color
117
+ #pragma mapbox: initialize mediump float stroke_width
118
+ #pragma mapbox: initialize lowp float stroke_opacity
119
+ vec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);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);
120
+ #ifdef OVERDRAW_INSPECTOR
121
+ gl_FragColor=vec4(1.0);
122
+ #endif
123
+ }`,`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;
124
+ #pragma mapbox: define highp vec4 color
125
+ #pragma mapbox: define mediump float radius
126
+ #pragma mapbox: define lowp float blur
127
+ #pragma mapbox: define lowp float opacity
128
+ #pragma mapbox: define highp vec4 stroke_color
129
+ #pragma mapbox: define mediump float stroke_width
130
+ #pragma mapbox: define lowp float stroke_opacity
131
+ void main(void) {
132
+ #pragma mapbox: initialize highp vec4 color
133
+ #pragma mapbox: initialize mediump float radius
134
+ #pragma mapbox: initialize lowp float blur
135
+ #pragma mapbox: initialize lowp float opacity
136
+ #pragma mapbox: initialize highp vec4 stroke_color
137
+ #pragma mapbox: initialize mediump float stroke_width
138
+ #pragma mapbox: initialize lowp float stroke_opacity
139
+ 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;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),clippingMask:Gt("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:Gt(`uniform highp float u_intensity;varying vec2 v_extrude;
140
+ #pragma mapbox: define highp float weight
141
+ #define GAUSS_COEF 0.3989422804014327
142
+ void main() {
143
+ #pragma mapbox: initialize highp float weight
144
+ 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);
145
+ #ifdef OVERDRAW_INSPECTOR
146
+ gl_FragColor=vec4(1.0);
147
+ #endif
148
+ }`,`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;
149
+ #pragma mapbox: define highp float weight
150
+ #pragma mapbox: define mediump float radius
151
+ const highp float ZERO=1.0/255.0/16.0;
152
+ #define GAUSS_COEF 0.3989422804014327
153
+ void main(void) {
154
+ #pragma mapbox: initialize highp float weight
155
+ #pragma mapbox: initialize mediump float radius
156
+ 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:Gt(`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;
157
+ #ifdef OVERDRAW_INSPECTOR
158
+ gl_FragColor=vec4(0.0);
159
+ #endif
160
+ }`,"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:Gt("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:Gt("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:Gt("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:Gt(`#pragma mapbox: define highp vec4 color
161
+ #pragma mapbox: define lowp float opacity
162
+ void main() {
163
+ #pragma mapbox: initialize highp vec4 color
164
+ #pragma mapbox: initialize lowp float opacity
165
+ gl_FragColor=color*opacity;
166
+ #ifdef OVERDRAW_INSPECTOR
167
+ gl_FragColor=vec4(1.0);
168
+ #endif
169
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;
170
+ #pragma mapbox: define highp vec4 color
171
+ #pragma mapbox: define lowp float opacity
172
+ void main() {
173
+ #pragma mapbox: initialize highp vec4 color
174
+ #pragma mapbox: initialize lowp float opacity
175
+ gl_Position=u_matrix*vec4(a_pos,0,1);}`),fillOutline:Gt(`varying vec2 v_pos;
176
+ #pragma mapbox: define highp vec4 outline_color
177
+ #pragma mapbox: define lowp float opacity
178
+ void main() {
179
+ #pragma mapbox: initialize highp vec4 outline_color
180
+ #pragma mapbox: initialize lowp float opacity
181
+ float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);
182
+ #ifdef OVERDRAW_INSPECTOR
183
+ gl_FragColor=vec4(1.0);
184
+ #endif
185
+ }`,`attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;
186
+ #pragma mapbox: define highp vec4 outline_color
187
+ #pragma mapbox: define lowp float opacity
188
+ void main() {
189
+ #pragma mapbox: initialize highp vec4 outline_color
190
+ #pragma mapbox: initialize lowp float opacity
191
+ gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),fillOutlinePattern:Gt(`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;
192
+ #pragma mapbox: define lowp float opacity
193
+ #pragma mapbox: define lowp vec4 pattern_from
194
+ #pragma mapbox: define lowp vec4 pattern_to
195
+ void main() {
196
+ #pragma mapbox: initialize lowp float opacity
197
+ #pragma mapbox: initialize mediump vec4 pattern_from
198
+ #pragma mapbox: initialize mediump vec4 pattern_to
199
+ 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;
200
+ #ifdef OVERDRAW_INSPECTOR
201
+ gl_FragColor=vec4(1.0);
202
+ #endif
203
+ }`,`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;
204
+ #pragma mapbox: define lowp float opacity
205
+ #pragma mapbox: define lowp vec4 pattern_from
206
+ #pragma mapbox: define lowp vec4 pattern_to
207
+ #pragma mapbox: define lowp float pixel_ratio_from
208
+ #pragma mapbox: define lowp float pixel_ratio_to
209
+ void main() {
210
+ #pragma mapbox: initialize lowp float opacity
211
+ #pragma mapbox: initialize mediump vec4 pattern_from
212
+ #pragma mapbox: initialize mediump vec4 pattern_to
213
+ #pragma mapbox: initialize lowp float pixel_ratio_from
214
+ #pragma mapbox: initialize lowp float pixel_ratio_to
215
+ 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:Gt(`#ifdef GL_ES
216
+ precision highp float;
217
+ #endif
218
+ uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
219
+ #pragma mapbox: define lowp float opacity
220
+ #pragma mapbox: define lowp vec4 pattern_from
221
+ #pragma mapbox: define lowp vec4 pattern_to
222
+ void main() {
223
+ #pragma mapbox: initialize lowp float opacity
224
+ #pragma mapbox: initialize mediump vec4 pattern_from
225
+ #pragma mapbox: initialize mediump vec4 pattern_to
226
+ 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;
227
+ #ifdef OVERDRAW_INSPECTOR
228
+ gl_FragColor=vec4(1.0);
229
+ #endif
230
+ }`,`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;
231
+ #pragma mapbox: define lowp float opacity
232
+ #pragma mapbox: define lowp vec4 pattern_from
233
+ #pragma mapbox: define lowp vec4 pattern_to
234
+ #pragma mapbox: define lowp float pixel_ratio_from
235
+ #pragma mapbox: define lowp float pixel_ratio_to
236
+ void main() {
237
+ #pragma mapbox: initialize lowp float opacity
238
+ #pragma mapbox: initialize mediump vec4 pattern_from
239
+ #pragma mapbox: initialize mediump vec4 pattern_to
240
+ #pragma mapbox: initialize lowp float pixel_ratio_from
241
+ #pragma mapbox: initialize lowp float pixel_ratio_to
242
+ 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:Gt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
243
+ #ifdef OVERDRAW_INSPECTOR
244
+ gl_FragColor=vec4(1.0);
245
+ #endif
246
+ }`,`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;
247
+ #ifdef TERRAIN3D
248
+ attribute vec2 a_centroid;
249
+ #endif
250
+ varying vec4 v_color;
251
+ #pragma mapbox: define highp float base
252
+ #pragma mapbox: define highp float height
253
+ #pragma mapbox: define highp vec4 color
254
+ void main() {
255
+ #pragma mapbox: initialize highp float base
256
+ #pragma mapbox: initialize highp float height
257
+ #pragma mapbox: initialize highp vec4 color
258
+ vec3 normal=a_normal_ed.xyz;
259
+ #ifdef TERRAIN3D
260
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
261
+ #else
262
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
263
+ #endif
264
+ 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:Gt(`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;
265
+ #pragma mapbox: define lowp float base
266
+ #pragma mapbox: define lowp float height
267
+ #pragma mapbox: define lowp vec4 pattern_from
268
+ #pragma mapbox: define lowp vec4 pattern_to
269
+ #pragma mapbox: define lowp float pixel_ratio_from
270
+ #pragma mapbox: define lowp float pixel_ratio_to
271
+ void main() {
272
+ #pragma mapbox: initialize lowp float base
273
+ #pragma mapbox: initialize lowp float height
274
+ #pragma mapbox: initialize mediump vec4 pattern_from
275
+ #pragma mapbox: initialize mediump vec4 pattern_to
276
+ #pragma mapbox: initialize lowp float pixel_ratio_from
277
+ #pragma mapbox: initialize lowp float pixel_ratio_to
278
+ 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;
279
+ #ifdef OVERDRAW_INSPECTOR
280
+ gl_FragColor=vec4(1.0);
281
+ #endif
282
+ }`,`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;
283
+ #ifdef TERRAIN3D
284
+ attribute vec2 a_centroid;
285
+ #endif
286
+ varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
287
+ #pragma mapbox: define lowp float base
288
+ #pragma mapbox: define lowp float height
289
+ #pragma mapbox: define lowp vec4 pattern_from
290
+ #pragma mapbox: define lowp vec4 pattern_to
291
+ #pragma mapbox: define lowp float pixel_ratio_from
292
+ #pragma mapbox: define lowp float pixel_ratio_to
293
+ void main() {
294
+ #pragma mapbox: initialize lowp float base
295
+ #pragma mapbox: initialize lowp float height
296
+ #pragma mapbox: initialize mediump vec4 pattern_from
297
+ #pragma mapbox: initialize mediump vec4 pattern_to
298
+ #pragma mapbox: initialize lowp float pixel_ratio_from
299
+ #pragma mapbox: initialize lowp float pixel_ratio_to
300
+ 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;
301
+ #ifdef TERRAIN3D
302
+ float height_terrain3d_offset=get_elevation(a_centroid);float base_terrain3d_offset=height_terrain3d_offset-(base > 0.0 ? 0.0 : 10.0);
303
+ #else
304
+ float height_terrain3d_offset=0.0;float base_terrain3d_offset=0.0;
305
+ #endif
306
+ 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
307
+ ? a_pos
308
+ : 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:Gt(`#ifdef GL_ES
309
+ precision highp float;
310
+ #endif
311
+ 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);
312
+ #ifdef OVERDRAW_INSPECTOR
313
+ gl_FragColor=vec4(1.0);
314
+ #endif
315
+ }`,"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:Gt(`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;
316
+ #define PI 3.141592653589793
317
+ 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;
318
+ #ifdef OVERDRAW_INSPECTOR
319
+ gl_FragColor=vec4(1.0);
320
+ #endif
321
+ }`,"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:Gt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
322
+ #pragma mapbox: define highp vec4 color
323
+ #pragma mapbox: define lowp float blur
324
+ #pragma mapbox: define lowp float opacity
325
+ void main() {
326
+ #pragma mapbox: initialize highp vec4 color
327
+ #pragma mapbox: initialize lowp float blur
328
+ #pragma mapbox: initialize lowp float opacity
329
+ 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);
330
+ #ifdef OVERDRAW_INSPECTOR
331
+ gl_FragColor=vec4(1.0);
332
+ #endif
333
+ }`,`
334
+ #define scale 0.015873016
335
+ 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;
336
+ #pragma mapbox: define highp vec4 color
337
+ #pragma mapbox: define lowp float blur
338
+ #pragma mapbox: define lowp float opacity
339
+ #pragma mapbox: define mediump float gapwidth
340
+ #pragma mapbox: define lowp float offset
341
+ #pragma mapbox: define mediump float width
342
+ void main() {
343
+ #pragma mapbox: initialize highp vec4 color
344
+ #pragma mapbox: initialize lowp float blur
345
+ #pragma mapbox: initialize lowp float opacity
346
+ #pragma mapbox: initialize mediump float gapwidth
347
+ #pragma mapbox: initialize lowp float offset
348
+ #pragma mapbox: initialize mediump float width
349
+ 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;
350
+ #ifdef TERRAIN3D
351
+ v_gamma_scale=1.0;
352
+ #else
353
+ 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;
354
+ #endif
355
+ v_width2=vec2(outset,inset);}`),lineGradient:Gt(`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;
356
+ #pragma mapbox: define lowp float blur
357
+ #pragma mapbox: define lowp float opacity
358
+ void main() {
359
+ #pragma mapbox: initialize lowp float blur
360
+ #pragma mapbox: initialize lowp float opacity
361
+ 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);
362
+ #ifdef OVERDRAW_INSPECTOR
363
+ gl_FragColor=vec4(1.0);
364
+ #endif
365
+ }`,`
366
+ #define scale 0.015873016
367
+ 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;
368
+ #pragma mapbox: define lowp float blur
369
+ #pragma mapbox: define lowp float opacity
370
+ #pragma mapbox: define mediump float gapwidth
371
+ #pragma mapbox: define lowp float offset
372
+ #pragma mapbox: define mediump float width
373
+ void main() {
374
+ #pragma mapbox: initialize lowp float blur
375
+ #pragma mapbox: initialize lowp float opacity
376
+ #pragma mapbox: initialize mediump float gapwidth
377
+ #pragma mapbox: initialize lowp float offset
378
+ #pragma mapbox: initialize mediump float width
379
+ 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;
380
+ #ifdef TERRAIN3D
381
+ v_gamma_scale=1.0;
382
+ #else
383
+ 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;
384
+ #endif
385
+ v_width2=vec2(outset,inset);}`),linePattern:Gt(`#ifdef GL_ES
386
+ precision highp float;
387
+ #endif
388
+ 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;
389
+ #pragma mapbox: define lowp vec4 pattern_from
390
+ #pragma mapbox: define lowp vec4 pattern_to
391
+ #pragma mapbox: define lowp float pixel_ratio_from
392
+ #pragma mapbox: define lowp float pixel_ratio_to
393
+ #pragma mapbox: define lowp float blur
394
+ #pragma mapbox: define lowp float opacity
395
+ void main() {
396
+ #pragma mapbox: initialize mediump vec4 pattern_from
397
+ #pragma mapbox: initialize mediump vec4 pattern_to
398
+ #pragma mapbox: initialize lowp float pixel_ratio_from
399
+ #pragma mapbox: initialize lowp float pixel_ratio_to
400
+ #pragma mapbox: initialize lowp float blur
401
+ #pragma mapbox: initialize lowp float opacity
402
+ 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;
403
+ #ifdef OVERDRAW_INSPECTOR
404
+ gl_FragColor=vec4(1.0);
405
+ #endif
406
+ }`,`
407
+ #define scale 0.015873016
408
+ #define LINE_DISTANCE_SCALE 2.0
409
+ 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;
410
+ #pragma mapbox: define lowp float blur
411
+ #pragma mapbox: define lowp float opacity
412
+ #pragma mapbox: define lowp float offset
413
+ #pragma mapbox: define mediump float gapwidth
414
+ #pragma mapbox: define mediump float width
415
+ #pragma mapbox: define lowp float floorwidth
416
+ #pragma mapbox: define lowp vec4 pattern_from
417
+ #pragma mapbox: define lowp vec4 pattern_to
418
+ #pragma mapbox: define lowp float pixel_ratio_from
419
+ #pragma mapbox: define lowp float pixel_ratio_to
420
+ void main() {
421
+ #pragma mapbox: initialize lowp float blur
422
+ #pragma mapbox: initialize lowp float opacity
423
+ #pragma mapbox: initialize lowp float offset
424
+ #pragma mapbox: initialize mediump float gapwidth
425
+ #pragma mapbox: initialize mediump float width
426
+ #pragma mapbox: initialize lowp float floorwidth
427
+ #pragma mapbox: initialize mediump vec4 pattern_from
428
+ #pragma mapbox: initialize mediump vec4 pattern_to
429
+ #pragma mapbox: initialize lowp float pixel_ratio_from
430
+ #pragma mapbox: initialize lowp float pixel_ratio_to
431
+ 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;
432
+ #ifdef TERRAIN3D
433
+ v_gamma_scale=1.0;
434
+ #else
435
+ 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;
436
+ #endif
437
+ v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),lineSDF:Gt(`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;
438
+ #pragma mapbox: define highp vec4 color
439
+ #pragma mapbox: define lowp float blur
440
+ #pragma mapbox: define lowp float opacity
441
+ #pragma mapbox: define mediump float width
442
+ #pragma mapbox: define lowp float floorwidth
443
+ void main() {
444
+ #pragma mapbox: initialize highp vec4 color
445
+ #pragma mapbox: initialize lowp float blur
446
+ #pragma mapbox: initialize lowp float opacity
447
+ #pragma mapbox: initialize mediump float width
448
+ #pragma mapbox: initialize lowp float floorwidth
449
+ 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);
450
+ #ifdef OVERDRAW_INSPECTOR
451
+ gl_FragColor=vec4(1.0);
452
+ #endif
453
+ }`,`
454
+ #define scale 0.015873016
455
+ #define LINE_DISTANCE_SCALE 2.0
456
+ 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;
457
+ #pragma mapbox: define highp vec4 color
458
+ #pragma mapbox: define lowp float blur
459
+ #pragma mapbox: define lowp float opacity
460
+ #pragma mapbox: define mediump float gapwidth
461
+ #pragma mapbox: define lowp float offset
462
+ #pragma mapbox: define mediump float width
463
+ #pragma mapbox: define lowp float floorwidth
464
+ void main() {
465
+ #pragma mapbox: initialize highp vec4 color
466
+ #pragma mapbox: initialize lowp float blur
467
+ #pragma mapbox: initialize lowp float opacity
468
+ #pragma mapbox: initialize mediump float gapwidth
469
+ #pragma mapbox: initialize lowp float offset
470
+ #pragma mapbox: initialize mediump float width
471
+ #pragma mapbox: initialize lowp float floorwidth
472
+ 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;
473
+ #ifdef TERRAIN3D
474
+ v_gamma_scale=1.0;
475
+ #else
476
+ 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;
477
+ #endif
478
+ 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:Gt(`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);
479
+ #ifdef OVERDRAW_INSPECTOR
480
+ gl_FragColor=vec4(1.0);
481
+ #endif
482
+ }`,"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:Gt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
483
+ #pragma mapbox: define lowp float opacity
484
+ void main() {
485
+ #pragma mapbox: initialize lowp float opacity
486
+ lowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;
487
+ #ifdef OVERDRAW_INSPECTOR
488
+ gl_FragColor=vec4(1.0);
489
+ #endif
490
+ }`,`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);}
491
+ #pragma mapbox: define lowp float opacity
492
+ void main() {
493
+ #pragma mapbox: initialize lowp float opacity
494
+ 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 ?
495
+ camera_to_anchor_distance/u_camera_to_center_distance :
496
+ 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:Gt(`#define SDF_PX 8.0
497
+ 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;
498
+ #pragma mapbox: define highp vec4 fill_color
499
+ #pragma mapbox: define highp vec4 halo_color
500
+ #pragma mapbox: define lowp float opacity
501
+ #pragma mapbox: define lowp float halo_width
502
+ #pragma mapbox: define lowp float halo_blur
503
+ void main() {
504
+ #pragma mapbox: initialize highp vec4 fill_color
505
+ #pragma mapbox: initialize highp vec4 halo_color
506
+ #pragma mapbox: initialize lowp float opacity
507
+ #pragma mapbox: initialize lowp float halo_width
508
+ #pragma mapbox: initialize lowp float halo_blur
509
+ 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);
510
+ #ifdef OVERDRAW_INSPECTOR
511
+ gl_FragColor=vec4(1.0);
512
+ #endif
513
+ }`,`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);}
514
+ #pragma mapbox: define highp vec4 fill_color
515
+ #pragma mapbox: define highp vec4 halo_color
516
+ #pragma mapbox: define lowp float opacity
517
+ #pragma mapbox: define lowp float halo_width
518
+ #pragma mapbox: define lowp float halo_blur
519
+ void main() {
520
+ #pragma mapbox: initialize highp vec4 fill_color
521
+ #pragma mapbox: initialize highp vec4 halo_color
522
+ #pragma mapbox: initialize lowp float opacity
523
+ #pragma mapbox: initialize lowp float halo_width
524
+ #pragma mapbox: initialize lowp float halo_blur
525
+ 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 ?
526
+ camera_to_anchor_distance/u_camera_to_center_distance :
527
+ 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:Gt(`#define SDF_PX 8.0
528
+ #define SDF 1.0
529
+ #define ICON 0.0
530
+ 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;
531
+ #pragma mapbox: define highp vec4 fill_color
532
+ #pragma mapbox: define highp vec4 halo_color
533
+ #pragma mapbox: define lowp float opacity
534
+ #pragma mapbox: define lowp float halo_width
535
+ #pragma mapbox: define lowp float halo_blur
536
+ void main() {
537
+ #pragma mapbox: initialize highp vec4 fill_color
538
+ #pragma mapbox: initialize highp vec4 halo_color
539
+ #pragma mapbox: initialize lowp float opacity
540
+ #pragma mapbox: initialize lowp float halo_width
541
+ #pragma mapbox: initialize lowp float halo_blur
542
+ 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;
543
+ #ifdef OVERDRAW_INSPECTOR
544
+ gl_FragColor=vec4(1.0);
545
+ #endif
546
+ 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);
547
+ #ifdef OVERDRAW_INSPECTOR
548
+ gl_FragColor=vec4(1.0);
549
+ #endif
550
+ }`,`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);}
551
+ #pragma mapbox: define highp vec4 fill_color
552
+ #pragma mapbox: define highp vec4 halo_color
553
+ #pragma mapbox: define lowp float opacity
554
+ #pragma mapbox: define lowp float halo_width
555
+ #pragma mapbox: define lowp float halo_blur
556
+ void main() {
557
+ #pragma mapbox: initialize highp vec4 fill_color
558
+ #pragma mapbox: initialize highp vec4 halo_color
559
+ #pragma mapbox: initialize lowp float opacity
560
+ #pragma mapbox: initialize lowp float halo_width
561
+ #pragma mapbox: initialize lowp float halo_blur
562
+ 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 ?
563
+ camera_to_anchor_distance/u_camera_to_center_distance :
564
+ 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:Gt("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:Gt("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:Gt("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:Gt("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 Gt(g,e){const a=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,u=e.match(/attribute ([\w]+) ([\w]+)/g),d=g.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),w=m?m.concat(d):d,E={};return{fragmentSource:g=g.replace(a,(T,I,O,B,U)=>(E[U]=!0,I==="define"?`
565
+ #ifndef HAS_UNIFORM_u_${U}
566
+ varying ${O} ${B} ${U};
567
+ #else
568
+ uniform ${O} ${B} u_${U};
569
+ #endif
570
+ `:`
571
+ #ifdef HAS_UNIFORM_u_${U}
572
+ ${O} ${B} ${U} = u_${U};
573
+ #endif
574
+ `)),vertexSource:e=e.replace(a,(T,I,O,B,U)=>{const Z=B==="float"?"vec2":"vec4",G=U.match(/color/)?"color":Z;return E[U]?I==="define"?`
575
+ #ifndef HAS_UNIFORM_u_${U}
576
+ uniform lowp float u_${U}_t;
577
+ attribute ${O} ${Z} a_${U};
578
+ varying ${O} ${B} ${U};
579
+ #else
580
+ uniform ${O} ${B} u_${U};
581
+ #endif
582
+ `:G==="vec4"?`
583
+ #ifndef HAS_UNIFORM_u_${U}
584
+ ${U} = a_${U};
585
+ #else
586
+ ${O} ${B} ${U} = u_${U};
587
+ #endif
588
+ `:`
589
+ #ifndef HAS_UNIFORM_u_${U}
590
+ ${U} = unpack_mix_${G}(a_${U}, u_${U}_t);
591
+ #else
592
+ ${O} ${B} ${U} = u_${U};
593
+ #endif
594
+ `:I==="define"?`
595
+ #ifndef HAS_UNIFORM_u_${U}
596
+ uniform lowp float u_${U}_t;
597
+ attribute ${O} ${Z} a_${U};
598
+ #else
599
+ uniform ${O} ${B} u_${U};
600
+ #endif
601
+ `:G==="vec4"?`
602
+ #ifndef HAS_UNIFORM_u_${U}
603
+ ${O} ${B} ${U} = a_${U};
604
+ #else
605
+ ${O} ${B} ${U} = u_${U};
606
+ #endif
607
+ `:`
608
+ #ifndef HAS_UNIFORM_u_${U}
609
+ ${O} ${B} ${U} = unpack_mix_${G}(a_${U}, u_${U}_t);
610
+ #else
611
+ ${O} ${B} ${U} = u_${U};
612
+ #endif
613
+ `}),staticAttributes:u,staticUniforms:w}}class dc{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,a,u,d,m,w,E,T,I){this.context=e;let O=this.boundPaintVertexBuffers.length!==d.length;for(let B=0;!O&&B<d.length;B++)this.boundPaintVertexBuffers[B]!==d[B]&&(O=!0);!this.vao||this.boundProgram!==a||this.boundLayoutVertexBuffer!==u||O||this.boundIndexBuffer!==m||this.boundVertexOffset!==w||this.boundDynamicVertexBuffer!==E||this.boundDynamicVertexBuffer2!==T||this.boundDynamicVertexBuffer3!==I?this.freshBind(a,u,d,m,w,E,T,I):(e.bindVertexArray.set(this.vao),E&&E.bind(),m&&m.dynamicDraw&&m.bind(),T&&T.bind(),I&&I.bind())}freshBind(e,a,u,d,m,w,E,T){const I=e.numAttributes,O=this.context,B=O.gl;this.vao&&this.destroy(),this.vao=O.createVertexArray(),O.bindVertexArray.set(this.vao),this.boundProgram=e,this.boundLayoutVertexBuffer=a,this.boundPaintVertexBuffers=u,this.boundIndexBuffer=d,this.boundVertexOffset=m,this.boundDynamicVertexBuffer=w,this.boundDynamicVertexBuffer2=E,this.boundDynamicVertexBuffer3=T,a.enableAttributes(B,e);for(const U of u)U.enableAttributes(B,e);w&&w.enableAttributes(B,e),E&&E.enableAttributes(B,e),T&&T.enableAttributes(B,e),a.bind(),a.setVertexAttribPointers(B,e,m);for(const U of u)U.bind(),U.setVertexAttribPointers(B,e,m);w&&(w.bind(),w.setVertexAttribPointers(B,e,m)),d&&d.bind(),E&&(E.bind(),E.setVertexAttribPointers(B,e,m)),T&&(T.bind(),T.setVertexAttribPointers(B,e,m)),O.currentNumAttributes=I}destroy(){this.vao&&(this.context.deleteVertexArray(this.vao),this.vao=null)}}const pc=(g,e,a,u,d)=>({u_matrix:g,u_texture:0,u_ele_delta:e,u_fog_matrix:a,u_fog_color:u?u.properties.get("fog-color"):h.aM.white,u_fog_ground_blend:u?u.properties.get("fog-ground-blend"):1,u_fog_ground_blend_opacity:u?u.calculateFogBlendOpacity(d):0,u_horizon_color:u?u.properties.get("horizon-color"):h.aM.white,u_horizon_fog_blend:u?u.properties.get("horizon-fog-blend"):1});function to(g){const e=[];for(let a=0;a<g.length;a++){if(g[a]===null)continue;const u=g[a].split(" ");e.push(u.pop())}return e}class fc{constructor(e,a,u,d,m,w){const E=e.gl;this.program=E.createProgram();const T=to(a.staticAttributes),I=u?u.getBinderAttributes():[],O=T.concat(I),B=ss.prelude.staticUniforms?to(ss.prelude.staticUniforms):[],U=a.staticUniforms?to(a.staticUniforms):[],Z=u?u.getBinderUniforms():[],G=B.concat(U).concat(Z),Q=[];for(const ye of G)Q.indexOf(ye)<0&&Q.push(ye);const ne=u?u.defines():[];m&&ne.push("#define OVERDRAW_INSPECTOR;"),w&&ne.push("#define TERRAIN3D;");const re=ne.concat(ss.prelude.fragmentSource,a.fragmentSource).join(`
614
+ `),ae=ne.concat(ss.prelude.vertexSource,a.vertexSource).join(`
615
+ `),X=E.createShader(E.FRAGMENT_SHADER);if(E.isContextLost())return void(this.failedToCreate=!0);if(E.shaderSource(X,re),E.compileShader(X),!E.getShaderParameter(X,E.COMPILE_STATUS))throw new Error(`Could not compile fragment shader: ${E.getShaderInfoLog(X)}`);E.attachShader(this.program,X);const he=E.createShader(E.VERTEX_SHADER);if(E.isContextLost())return void(this.failedToCreate=!0);if(E.shaderSource(he,ae),E.compileShader(he),!E.getShaderParameter(he,E.COMPILE_STATUS))throw new Error(`Could not compile vertex shader: ${E.getShaderInfoLog(he)}`);E.attachShader(this.program,he),this.attributes={};const pe={};this.numAttributes=O.length;for(let ye=0;ye<this.numAttributes;ye++)O[ye]&&(E.bindAttribLocation(this.program,ye,O[ye]),this.attributes[O[ye]]=ye);if(E.linkProgram(this.program),!E.getProgramParameter(this.program,E.LINK_STATUS))throw new Error(`Program failed to link: ${E.getProgramInfoLog(this.program)}`);E.deleteShader(he),E.deleteShader(X);for(let ye=0;ye<Q.length;ye++){const Me=Q[ye];if(Me&&!pe[Me]){const De=E.getUniformLocation(this.program,Me);De&&(pe[Me]=De)}}this.fixedUniforms=d(e,pe),this.terrainUniforms=((ye,Me)=>({u_depth:new h.aH(ye,Me.u_depth),u_terrain:new h.aH(ye,Me.u_terrain),u_terrain_dim:new h.aI(ye,Me.u_terrain_dim),u_terrain_matrix:new h.aJ(ye,Me.u_terrain_matrix),u_terrain_unpack:new h.aK(ye,Me.u_terrain_unpack),u_terrain_exaggeration:new h.aI(ye,Me.u_terrain_exaggeration)}))(e,pe),this.binderUniforms=u?u.getUniforms(e,pe):[]}draw(e,a,u,d,m,w,E,T,I,O,B,U,Z,G,Q,ne,re,ae){const X=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(u),e.setStencilMode(d),e.setColorMode(m),e.setCullFace(w),T){e.activeTexture.set(X.TEXTURE2),X.bindTexture(X.TEXTURE_2D,T.depthTexture),e.activeTexture.set(X.TEXTURE3),X.bindTexture(X.TEXTURE_2D,T.texture);for(const pe in this.terrainUniforms)this.terrainUniforms[pe].set(T[pe])}for(const pe in this.fixedUniforms)this.fixedUniforms[pe].set(E[pe]);Q&&Q.setUniforms(e,this.binderUniforms,Z,{zoom:G});let he=0;switch(a){case X.LINES:he=2;break;case X.TRIANGLES:he=3;break;case X.LINE_STRIP:he=1}for(const pe of U.get()){const ye=pe.vaos||(pe.vaos={});(ye[I]||(ye[I]=new dc)).bind(e,this,O,Q?Q.getPaintVertexBuffers():[],B,pe.vertexOffset,ne,re,ae),X.drawElements(a,pe.primitiveLength*he,X.UNSIGNED_SHORT,pe.primitiveOffset*he*2)}}}function Wa(g,e,a){const u=1/Rt(a,1,e.transform.tileZoom),d=Math.pow(2,a.tileID.overscaledZ),m=a.tileSize*Math.pow(2,e.transform.tileZoom)/d,w=m*(a.tileID.canonical.x+a.tileID.wrap*d),E=m*a.tileID.canonical.y;return{u_image:0,u_texsize:a.imageAtlasTexture.size,u_scale:[u,g.fromScale,g.toScale],u_fade:g.t,u_pixel_coord_upper:[w>>16,E>>16],u_pixel_coord_lower:[65535&w,65535&E]}}const Qo=(g,e,a,u)=>{const d=e.style.light,m=d.properties.get("position"),w=[m.x,m.y,m.z],E=function(){var I=new h.A(9);return h.A!=Float32Array&&(I[1]=0,I[2]=0,I[3]=0,I[5]=0,I[6]=0,I[7]=0),I[0]=1,I[4]=1,I[8]=1,I}();d.properties.get("anchor")==="viewport"&&function(I,O){var B=Math.sin(O),U=Math.cos(O);I[0]=U,I[1]=B,I[2]=0,I[3]=-B,I[4]=U,I[5]=0,I[6]=0,I[7]=0,I[8]=1}(E,-e.transform.angle),function(I,O,B){var U=O[0],Z=O[1],G=O[2];I[0]=U*B[0]+Z*B[3]+G*B[6],I[1]=U*B[1]+Z*B[4]+G*B[7],I[2]=U*B[2]+Z*B[5]+G*B[8]}(w,w,E);const T=d.properties.get("color");return{u_matrix:g,u_lightpos:w,u_lightintensity:d.properties.get("intensity"),u_lightcolor:[T.r,T.g,T.b],u_vertical_gradient:+a,u_opacity:u}},Ga=(g,e,a,u,d,m,w)=>h.e(Qo(g,e,a,u),Wa(m,e,w),{u_height_factor:-Math.pow(2,d.overscaledZ)/w.tileSize/8}),io=g=>({u_matrix:g}),pu=(g,e,a,u)=>h.e(io(g),Wa(a,e,u)),Wp=(g,e)=>({u_matrix:g,u_world:e}),fu=(g,e,a,u,d)=>h.e(pu(g,e,a,u),{u_world:d}),Gp=(g,e,a,u)=>{const d=g.transform;let m,w;if(u.paint.get("circle-pitch-alignment")==="map"){const E=Rt(a,1,d.zoom);m=!0,w=[E,E]}else m=!1,w=d.pixelsToGLUnits;return{u_camera_to_center_distance:d.cameraToCenterDistance,u_scale_with_map:+(u.paint.get("circle-pitch-scale")==="map"),u_matrix:g.translatePosMatrix(e.posMatrix,a,u.paint.get("circle-translate"),u.paint.get("circle-translate-anchor")),u_pitch_with_map:+m,u_device_pixel_ratio:g.pixelRatio,u_extrude_scale:w}},Ps=(g,e,a)=>({u_matrix:g,u_inv_matrix:e,u_camera_to_center_distance:a.cameraToCenterDistance,u_viewport_size:[a.width,a.height]}),ea=(g,e,a=1)=>({u_matrix:g,u_color:e,u_overlay:0,u_overlay_scale:a}),mn=g=>({u_matrix:g}),gn=(g,e,a,u)=>({u_matrix:g,u_extrude_scale:Rt(e,1,a),u_intensity:u}),Ya=(g,e,a,u)=>{const d=h.H();h.aP(d,0,g.width,g.height,0,0,1);const m=g.context.gl;return{u_matrix:d,u_world:[m.drawingBufferWidth,m.drawingBufferHeight],u_image:a,u_color_ramp:u,u_opacity:e.paint.get("heatmap-opacity")}};function Xa(g,e){const a=Math.pow(2,e.canonical.z),u=e.canonical.y;return[new h.Z(0,u/a).toLngLat().lat,new h.Z(0,(u+1)/a).toLngLat().lat]}const Ka=(g,e,a,u)=>{const d=g.transform;return{u_matrix:yu(g,e,a,u),u_ratio:1/Rt(e,1,d.zoom),u_device_pixel_ratio:g.pixelRatio,u_units_to_pixels:[1/d.pixelsToGLUnits[0],1/d.pixelsToGLUnits[1]]}},mu=(g,e,a,u,d)=>h.e(Ka(g,e,a,d),{u_image:0,u_image_height:u}),no=(g,e,a,u,d)=>{const m=g.transform,w=gu(e,m);return{u_matrix:yu(g,e,a,d),u_texsize:e.imageAtlasTexture.size,u_ratio:1/Rt(e,1,m.zoom),u_device_pixel_ratio:g.pixelRatio,u_image:0,u_scale:[w,u.fromScale,u.toScale],u_fade:u.t,u_units_to_pixels:[1/m.pixelsToGLUnits[0],1/m.pixelsToGLUnits[1]]}},Yp=(g,e,a,u,d,m)=>{const w=g.lineAtlas,E=gu(e,g.transform),T=a.layout.get("line-cap")==="round",I=w.getDash(u.from,T),O=w.getDash(u.to,T),B=I.width*d.fromScale,U=O.width*d.toScale;return h.e(Ka(g,e,a,m),{u_patternscale_a:[E/B,-I.height/2],u_patternscale_b:[E/U,-O.height/2],u_sdfgamma:w.width/(256*Math.min(B,U)*g.pixelRatio)/2,u_image:0,u_tex_y_a:I.y,u_tex_y_b:O.y,u_mix:d.t})};function gu(g,e){return 1/Rt(g,1,e.tileZoom)}function yu(g,e,a,u){return g.translatePosMatrix(u?u.posMatrix:e.tileID.posMatrix,e,a.paint.get("line-translate"),a.paint.get("line-translate-anchor"))}const Xp=(g,e,a,u,d)=>{return{u_matrix:g,u_tl_parent:e,u_scale_parent:a,u_buffer_scale:1,u_fade_t:u.mix,u_opacity:u.opacity*d.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:d.paint.get("raster-brightness-min"),u_brightness_high:d.paint.get("raster-brightness-max"),u_saturation_factor:(w=d.paint.get("raster-saturation"),w>0?1-1/(1.001-w):-w),u_contrast_factor:(m=d.paint.get("raster-contrast"),m>0?1/(1-m):1+m),u_spin_weights:Kp(d.paint.get("raster-hue-rotate"))};var m,w};function Kp(g){g*=Math.PI/180;const e=Math.sin(g),a=Math.cos(g);return[(2*a+1)/3,(-Math.sqrt(3)*e-a+1)/3,(Math.sqrt(3)*e-a+1)/3]}const _u=(g,e,a,u,d,m,w,E,T,I,O,B,U,Z)=>{const G=w.transform;return{u_is_size_zoom_constant:+(g==="constant"||g==="source"),u_is_size_feature_constant:+(g==="constant"||g==="camera"),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:G.cameraToCenterDistance,u_pitch:G.pitch/360*2*Math.PI,u_rotate_symbol:+a,u_aspect_ratio:G.width/G.height,u_fade_change:w.options.fadeDuration?w.symbolFadeChange:1,u_matrix:E,u_label_plane_matrix:T,u_coord_matrix:I,u_is_text:+B,u_pitch_with_map:+u,u_is_along_line:d,u_is_variable_anchor:m,u_texsize:U,u_texture:0,u_translation:O,u_pitched_scale:Z}},ta=(g,e,a,u,d,m,w,E,T,I,O,B,U,Z,G)=>{const Q=w.transform;return h.e(_u(g,e,a,u,d,m,w,E,T,I,O,B,U,G),{u_gamma_scale:u?Math.cos(Q._pitch)*Q.cameraToCenterDistance:1,u_device_pixel_ratio:w.pixelRatio,u_is_halo:+Z})},mc=(g,e,a,u,d,m,w,E,T,I,O,B,U,Z)=>h.e(ta(g,e,a,u,d,m,w,E,T,I,O,!0,B,!0,Z),{u_texsize_icon:U,u_texture_icon:1}),Ja=(g,e,a)=>({u_matrix:g,u_opacity:e,u_color:a}),gc=(g,e,a,u,d,m)=>h.e(function(w,E,T,I){const O=T.imageManager.getPattern(w.from.toString()),B=T.imageManager.getPattern(w.to.toString()),{width:U,height:Z}=T.imageManager.getPixelSize(),G=Math.pow(2,I.tileID.overscaledZ),Q=I.tileSize*Math.pow(2,T.transform.tileZoom)/G,ne=Q*(I.tileID.canonical.x+I.tileID.wrap*G),re=Q*I.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:O.tl,u_pattern_br_a:O.br,u_pattern_tl_b:B.tl,u_pattern_br_b:B.br,u_texsize:[U,Z],u_mix:E.t,u_pattern_size_a:O.displaySize,u_pattern_size_b:B.displaySize,u_scale_a:E.fromScale,u_scale_b:E.toScale,u_tile_units_to_pixels:1/Rt(I,1,T.transform.tileZoom),u_pixel_coord_upper:[ne>>16,re>>16],u_pixel_coord_lower:[65535&ne,65535&re]}}(u,m,a,d),{u_matrix:g,u_opacity:e}),yc={fillExtrusion:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_lightpos:new h.aN(g,e.u_lightpos),u_lightintensity:new h.aI(g,e.u_lightintensity),u_lightcolor:new h.aN(g,e.u_lightcolor),u_vertical_gradient:new h.aI(g,e.u_vertical_gradient),u_opacity:new h.aI(g,e.u_opacity)}),fillExtrusionPattern:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_lightpos:new h.aN(g,e.u_lightpos),u_lightintensity:new h.aI(g,e.u_lightintensity),u_lightcolor:new h.aN(g,e.u_lightcolor),u_vertical_gradient:new h.aI(g,e.u_vertical_gradient),u_height_factor:new h.aI(g,e.u_height_factor),u_image:new h.aH(g,e.u_image),u_texsize:new h.aO(g,e.u_texsize),u_pixel_coord_upper:new h.aO(g,e.u_pixel_coord_upper),u_pixel_coord_lower:new h.aO(g,e.u_pixel_coord_lower),u_scale:new h.aN(g,e.u_scale),u_fade:new h.aI(g,e.u_fade),u_opacity:new h.aI(g,e.u_opacity)}),fill:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix)}),fillPattern:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_image:new h.aH(g,e.u_image),u_texsize:new h.aO(g,e.u_texsize),u_pixel_coord_upper:new h.aO(g,e.u_pixel_coord_upper),u_pixel_coord_lower:new h.aO(g,e.u_pixel_coord_lower),u_scale:new h.aN(g,e.u_scale),u_fade:new h.aI(g,e.u_fade)}),fillOutline:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_world:new h.aO(g,e.u_world)}),fillOutlinePattern:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_world:new h.aO(g,e.u_world),u_image:new h.aH(g,e.u_image),u_texsize:new h.aO(g,e.u_texsize),u_pixel_coord_upper:new h.aO(g,e.u_pixel_coord_upper),u_pixel_coord_lower:new h.aO(g,e.u_pixel_coord_lower),u_scale:new h.aN(g,e.u_scale),u_fade:new h.aI(g,e.u_fade)}),circle:(g,e)=>({u_camera_to_center_distance:new h.aI(g,e.u_camera_to_center_distance),u_scale_with_map:new h.aH(g,e.u_scale_with_map),u_pitch_with_map:new h.aH(g,e.u_pitch_with_map),u_extrude_scale:new h.aO(g,e.u_extrude_scale),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_matrix:new h.aJ(g,e.u_matrix)}),collisionBox:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_pixel_extrude_scale:new h.aO(g,e.u_pixel_extrude_scale)}),collisionCircle:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_inv_matrix:new h.aJ(g,e.u_inv_matrix),u_camera_to_center_distance:new h.aI(g,e.u_camera_to_center_distance),u_viewport_size:new h.aO(g,e.u_viewport_size)}),debug:(g,e)=>({u_color:new h.aL(g,e.u_color),u_matrix:new h.aJ(g,e.u_matrix),u_overlay:new h.aH(g,e.u_overlay),u_overlay_scale:new h.aI(g,e.u_overlay_scale)}),clippingMask:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix)}),heatmap:(g,e)=>({u_extrude_scale:new h.aI(g,e.u_extrude_scale),u_intensity:new h.aI(g,e.u_intensity),u_matrix:new h.aJ(g,e.u_matrix)}),heatmapTexture:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_world:new h.aO(g,e.u_world),u_image:new h.aH(g,e.u_image),u_color_ramp:new h.aH(g,e.u_color_ramp),u_opacity:new h.aI(g,e.u_opacity)}),hillshade:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_image:new h.aH(g,e.u_image),u_latrange:new h.aO(g,e.u_latrange),u_light:new h.aO(g,e.u_light),u_shadow:new h.aL(g,e.u_shadow),u_highlight:new h.aL(g,e.u_highlight),u_accent:new h.aL(g,e.u_accent)}),hillshadePrepare:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_image:new h.aH(g,e.u_image),u_dimension:new h.aO(g,e.u_dimension),u_zoom:new h.aI(g,e.u_zoom),u_unpack:new h.aK(g,e.u_unpack)}),line:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_ratio:new h.aI(g,e.u_ratio),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_units_to_pixels:new h.aO(g,e.u_units_to_pixels)}),lineGradient:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_ratio:new h.aI(g,e.u_ratio),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_units_to_pixels:new h.aO(g,e.u_units_to_pixels),u_image:new h.aH(g,e.u_image),u_image_height:new h.aI(g,e.u_image_height)}),linePattern:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_texsize:new h.aO(g,e.u_texsize),u_ratio:new h.aI(g,e.u_ratio),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_image:new h.aH(g,e.u_image),u_units_to_pixels:new h.aO(g,e.u_units_to_pixels),u_scale:new h.aN(g,e.u_scale),u_fade:new h.aI(g,e.u_fade)}),lineSDF:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_ratio:new h.aI(g,e.u_ratio),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_units_to_pixels:new h.aO(g,e.u_units_to_pixels),u_patternscale_a:new h.aO(g,e.u_patternscale_a),u_patternscale_b:new h.aO(g,e.u_patternscale_b),u_sdfgamma:new h.aI(g,e.u_sdfgamma),u_image:new h.aH(g,e.u_image),u_tex_y_a:new h.aI(g,e.u_tex_y_a),u_tex_y_b:new h.aI(g,e.u_tex_y_b),u_mix:new h.aI(g,e.u_mix)}),raster:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_tl_parent:new h.aO(g,e.u_tl_parent),u_scale_parent:new h.aI(g,e.u_scale_parent),u_buffer_scale:new h.aI(g,e.u_buffer_scale),u_fade_t:new h.aI(g,e.u_fade_t),u_opacity:new h.aI(g,e.u_opacity),u_image0:new h.aH(g,e.u_image0),u_image1:new h.aH(g,e.u_image1),u_brightness_low:new h.aI(g,e.u_brightness_low),u_brightness_high:new h.aI(g,e.u_brightness_high),u_saturation_factor:new h.aI(g,e.u_saturation_factor),u_contrast_factor:new h.aI(g,e.u_contrast_factor),u_spin_weights:new h.aN(g,e.u_spin_weights)}),symbolIcon:(g,e)=>({u_is_size_zoom_constant:new h.aH(g,e.u_is_size_zoom_constant),u_is_size_feature_constant:new h.aH(g,e.u_is_size_feature_constant),u_size_t:new h.aI(g,e.u_size_t),u_size:new h.aI(g,e.u_size),u_camera_to_center_distance:new h.aI(g,e.u_camera_to_center_distance),u_pitch:new h.aI(g,e.u_pitch),u_rotate_symbol:new h.aH(g,e.u_rotate_symbol),u_aspect_ratio:new h.aI(g,e.u_aspect_ratio),u_fade_change:new h.aI(g,e.u_fade_change),u_matrix:new h.aJ(g,e.u_matrix),u_label_plane_matrix:new h.aJ(g,e.u_label_plane_matrix),u_coord_matrix:new h.aJ(g,e.u_coord_matrix),u_is_text:new h.aH(g,e.u_is_text),u_pitch_with_map:new h.aH(g,e.u_pitch_with_map),u_is_along_line:new h.aH(g,e.u_is_along_line),u_is_variable_anchor:new h.aH(g,e.u_is_variable_anchor),u_texsize:new h.aO(g,e.u_texsize),u_texture:new h.aH(g,e.u_texture),u_translation:new h.aO(g,e.u_translation),u_pitched_scale:new h.aI(g,e.u_pitched_scale)}),symbolSDF:(g,e)=>({u_is_size_zoom_constant:new h.aH(g,e.u_is_size_zoom_constant),u_is_size_feature_constant:new h.aH(g,e.u_is_size_feature_constant),u_size_t:new h.aI(g,e.u_size_t),u_size:new h.aI(g,e.u_size),u_camera_to_center_distance:new h.aI(g,e.u_camera_to_center_distance),u_pitch:new h.aI(g,e.u_pitch),u_rotate_symbol:new h.aH(g,e.u_rotate_symbol),u_aspect_ratio:new h.aI(g,e.u_aspect_ratio),u_fade_change:new h.aI(g,e.u_fade_change),u_matrix:new h.aJ(g,e.u_matrix),u_label_plane_matrix:new h.aJ(g,e.u_label_plane_matrix),u_coord_matrix:new h.aJ(g,e.u_coord_matrix),u_is_text:new h.aH(g,e.u_is_text),u_pitch_with_map:new h.aH(g,e.u_pitch_with_map),u_is_along_line:new h.aH(g,e.u_is_along_line),u_is_variable_anchor:new h.aH(g,e.u_is_variable_anchor),u_texsize:new h.aO(g,e.u_texsize),u_texture:new h.aH(g,e.u_texture),u_gamma_scale:new h.aI(g,e.u_gamma_scale),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_is_halo:new h.aH(g,e.u_is_halo),u_translation:new h.aO(g,e.u_translation),u_pitched_scale:new h.aI(g,e.u_pitched_scale)}),symbolTextAndIcon:(g,e)=>({u_is_size_zoom_constant:new h.aH(g,e.u_is_size_zoom_constant),u_is_size_feature_constant:new h.aH(g,e.u_is_size_feature_constant),u_size_t:new h.aI(g,e.u_size_t),u_size:new h.aI(g,e.u_size),u_camera_to_center_distance:new h.aI(g,e.u_camera_to_center_distance),u_pitch:new h.aI(g,e.u_pitch),u_rotate_symbol:new h.aH(g,e.u_rotate_symbol),u_aspect_ratio:new h.aI(g,e.u_aspect_ratio),u_fade_change:new h.aI(g,e.u_fade_change),u_matrix:new h.aJ(g,e.u_matrix),u_label_plane_matrix:new h.aJ(g,e.u_label_plane_matrix),u_coord_matrix:new h.aJ(g,e.u_coord_matrix),u_is_text:new h.aH(g,e.u_is_text),u_pitch_with_map:new h.aH(g,e.u_pitch_with_map),u_is_along_line:new h.aH(g,e.u_is_along_line),u_is_variable_anchor:new h.aH(g,e.u_is_variable_anchor),u_texsize:new h.aO(g,e.u_texsize),u_texsize_icon:new h.aO(g,e.u_texsize_icon),u_texture:new h.aH(g,e.u_texture),u_texture_icon:new h.aH(g,e.u_texture_icon),u_gamma_scale:new h.aI(g,e.u_gamma_scale),u_device_pixel_ratio:new h.aI(g,e.u_device_pixel_ratio),u_is_halo:new h.aH(g,e.u_is_halo),u_translation:new h.aO(g,e.u_translation),u_pitched_scale:new h.aI(g,e.u_pitched_scale)}),background:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_opacity:new h.aI(g,e.u_opacity),u_color:new h.aL(g,e.u_color)}),backgroundPattern:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_opacity:new h.aI(g,e.u_opacity),u_image:new h.aH(g,e.u_image),u_pattern_tl_a:new h.aO(g,e.u_pattern_tl_a),u_pattern_br_a:new h.aO(g,e.u_pattern_br_a),u_pattern_tl_b:new h.aO(g,e.u_pattern_tl_b),u_pattern_br_b:new h.aO(g,e.u_pattern_br_b),u_texsize:new h.aO(g,e.u_texsize),u_mix:new h.aI(g,e.u_mix),u_pattern_size_a:new h.aO(g,e.u_pattern_size_a),u_pattern_size_b:new h.aO(g,e.u_pattern_size_b),u_scale_a:new h.aI(g,e.u_scale_a),u_scale_b:new h.aI(g,e.u_scale_b),u_pixel_coord_upper:new h.aO(g,e.u_pixel_coord_upper),u_pixel_coord_lower:new h.aO(g,e.u_pixel_coord_lower),u_tile_units_to_pixels:new h.aI(g,e.u_tile_units_to_pixels)}),terrain:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_texture:new h.aH(g,e.u_texture),u_ele_delta:new h.aI(g,e.u_ele_delta),u_fog_matrix:new h.aJ(g,e.u_fog_matrix),u_fog_color:new h.aL(g,e.u_fog_color),u_fog_ground_blend:new h.aI(g,e.u_fog_ground_blend),u_fog_ground_blend_opacity:new h.aI(g,e.u_fog_ground_blend_opacity),u_horizon_color:new h.aL(g,e.u_horizon_color),u_horizon_fog_blend:new h.aI(g,e.u_horizon_fog_blend)}),terrainDepth:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_ele_delta:new h.aI(g,e.u_ele_delta)}),terrainCoords:(g,e)=>({u_matrix:new h.aJ(g,e.u_matrix),u_texture:new h.aH(g,e.u_texture),u_terrain_coords_id:new h.aI(g,e.u_terrain_coords_id),u_ele_delta:new h.aI(g,e.u_ele_delta)}),sky:(g,e)=>({u_sky_color:new h.aL(g,e.u_sky_color),u_horizon_color:new h.aL(g,e.u_horizon_color),u_horizon:new h.aI(g,e.u_horizon),u_sky_horizon_blend:new h.aI(g,e.u_sky_horizon_blend)})};class Pr{constructor(e,a,u){this.context=e;const d=e.gl;this.buffer=d.createBuffer(),this.dynamicDraw=!!u,this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),d.bufferData(d.ELEMENT_ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?d.DYNAMIC_DRAW:d.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const a=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),a.bufferSubData(a.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Jp={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class _c{constructor(e,a,u,d){this.length=a.length,this.attributes=u,this.itemSize=a.bytesPerElement,this.dynamicDraw=d,this.context=e;const m=e.gl;this.buffer=m.createBuffer(),e.bindVertexBuffer.set(this.buffer),m.bufferData(m.ARRAY_BUFFER,a.arrayBuffer,this.dynamicDraw?m.DYNAMIC_DRAW:m.STATIC_DRAW),this.dynamicDraw||delete a.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const a=this.context.gl;this.bind(),a.bufferSubData(a.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,a){for(let u=0;u<this.attributes.length;u++){const d=a.attributes[this.attributes[u].name];d!==void 0&&e.enableVertexAttribArray(d)}}setVertexAttribPointers(e,a,u){for(let d=0;d<this.attributes.length;d++){const m=this.attributes[d],w=a.attributes[m.name];w!==void 0&&e.vertexAttribPointer(w,m.components,e[Jp[m.type]],!1,this.itemSize,m.offset+this.itemSize*(u||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const Is=new WeakMap;function os(g){var e;if(Is.has(g))return Is.get(g);{const a=(e=g.getParameter(g.VERSION))===null||e===void 0?void 0:e.startsWith("WebGL 2.0");return Is.set(g,a),a}}class Xt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Qa extends Xt{getDefault(){return h.aM.transparent}set(e){const a=this.current;(e.r!==a.r||e.g!==a.g||e.b!==a.b||e.a!==a.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Qp extends Xt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class ro extends Xt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class ef extends Xt{getDefault(){return[!0,!0,!0,!0]}set(e){const a=this.current;(e[0]!==a[0]||e[1]!==a[1]||e[2]!==a[2]||e[3]!==a[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class xu extends Xt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class tf extends Xt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class bu extends Xt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const a=this.current;(e.func!==a.func||e.ref!==a.ref||e.mask!==a.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class xc extends Xt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const a=this.current;(e[0]!==a[0]||e[1]!==a[1]||e[2]!==a[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class vu extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;e?a.enable(a.STENCIL_TEST):a.disable(a.STENCIL_TEST),this.current=e,this.dirty=!1}}class wu extends Xt{getDefault(){return[0,1]}set(e){const a=this.current;(e[0]!==a[0]||e[1]!==a[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Su extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;e?a.enable(a.DEPTH_TEST):a.disable(a.DEPTH_TEST),this.current=e,this.dirty=!1}}class ku extends Xt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class As extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;e?a.enable(a.BLEND):a.disable(a.BLEND),this.current=e,this.dirty=!1}}class Eu extends Xt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const a=this.current;(e[0]!==a[0]||e[1]!==a[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class nf extends Xt{getDefault(){return h.aM.transparent}set(e){const a=this.current;(e.r!==a.r||e.g!==a.g||e.b!==a.b||e.a!==a.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Tu extends Xt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class ia extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;e?a.enable(a.CULL_FACE):a.disable(a.CULL_FACE),this.current=e,this.dirty=!1}}class rf extends Xt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class el extends Xt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class sf extends Xt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class of extends Xt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class Cu extends Xt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const a=this.current;(e[0]!==a[0]||e[1]!==a[1]||e[2]!==a[2]||e[3]!==a[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class Mu extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.bindFramebuffer(a.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class Pu extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.bindRenderbuffer(a.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class bc extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.bindTexture(a.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class Iu extends Xt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.bindBuffer(a.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class tl extends Xt{getDefault(){return null}set(e){const a=this.gl;a.bindBuffer(a.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class Ur extends Xt{getDefault(){return null}set(e){var a;if(e===this.current&&!this.dirty)return;const u=this.gl;os(u)?u.bindVertexArray(e):(a=u.getExtension("OES_vertex_array_object"))===null||a===void 0||a.bindVertexArrayOES(e),this.current=e,this.dirty=!1}}class vc extends Xt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class wc extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class Sc extends Xt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const a=this.gl;a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class il extends Xt{constructor(e,a){super(e),this.context=e,this.parent=a}getDefault(){return null}}class kc extends il{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferTexture2D(a.FRAMEBUFFER,a.COLOR_ATTACHMENT0,a.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class Ds extends il{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_ATTACHMENT,a.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class Ec extends il{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const a=this.gl;a.framebufferRenderbuffer(a.FRAMEBUFFER,a.DEPTH_STENCIL_ATTACHMENT,a.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class af{constructor(e,a,u,d,m){this.context=e,this.width=a,this.height=u;const w=e.gl,E=this.framebuffer=w.createFramebuffer();if(this.colorAttachment=new kc(e,E),d)this.depthAttachment=m?new Ec(e,E):new Ds(e,E);else if(m)throw new Error("Stencil cannot be set without depth");if(w.checkFramebufferStatus(w.FRAMEBUFFER)!==w.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,a=this.colorAttachment.get();if(a&&e.deleteTexture(a),this.depthAttachment){const u=this.depthAttachment.get();u&&e.deleteRenderbuffer(u)}e.deleteFramebuffer(this.framebuffer)}}class Ci{constructor(e,a,u){this.blendFunction=e,this.blendColor=a,this.mask=u}}Ci.Replace=[1,0],Ci.disabled=new Ci(Ci.Replace,h.aM.transparent,[!1,!1,!1,!1]),Ci.unblended=new Ci(Ci.Replace,h.aM.transparent,[!0,!0,!0,!0]),Ci.alphaBlended=new Ci([1,771],h.aM.transparent,[!0,!0,!0,!0]);class lf{constructor(e){var a,u;if(this.gl=e,this.clearColor=new Qa(this),this.clearDepth=new Qp(this),this.clearStencil=new ro(this),this.colorMask=new ef(this),this.depthMask=new xu(this),this.stencilMask=new tf(this),this.stencilFunc=new bu(this),this.stencilOp=new xc(this),this.stencilTest=new vu(this),this.depthRange=new wu(this),this.depthTest=new Su(this),this.depthFunc=new ku(this),this.blend=new As(this),this.blendFunc=new Eu(this),this.blendColor=new nf(this),this.blendEquation=new Tu(this),this.cullFace=new ia(this),this.cullFaceSide=new rf(this),this.frontFace=new el(this),this.program=new sf(this),this.activeTexture=new of(this),this.viewport=new Cu(this),this.bindFramebuffer=new Mu(this),this.bindRenderbuffer=new Pu(this),this.bindTexture=new bc(this),this.bindVertexBuffer=new Iu(this),this.bindElementBuffer=new tl(this),this.bindVertexArray=new Ur(this),this.pixelStoreUnpack=new vc(this),this.pixelStoreUnpackPremultiplyAlpha=new wc(this),this.pixelStoreUnpackFlipY=new Sc(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE),os(e)){this.HALF_FLOAT=e.HALF_FLOAT;const d=e.getExtension("EXT_color_buffer_half_float");this.RGBA16F=(a=e.RGBA16F)!==null&&a!==void 0?a:d==null?void 0:d.RGBA16F_EXT,this.RGB16F=(u=e.RGB16F)!==null&&u!==void 0?u:d==null?void 0:d.RGB16F_EXT,e.getExtension("EXT_color_buffer_float")}else{e.getExtension("EXT_color_buffer_half_float"),e.getExtension("OES_texture_half_float_linear");const d=e.getExtension("OES_texture_half_float");this.HALF_FLOAT=d==null?void 0:d.HALF_FLOAT_OES}}setDefault(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()}setDirty(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.bindVertexArray.dirty=!0,this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0}createIndexBuffer(e,a){return new Pr(this,e,a)}createVertexBuffer(e,a,u){return new _c(this,e,a,u)}createRenderbuffer(e,a,u){const d=this.gl,m=d.createRenderbuffer();return this.bindRenderbuffer.set(m),d.renderbufferStorage(d.RENDERBUFFER,e,a,u),this.bindRenderbuffer.set(null),m}createFramebuffer(e,a,u,d){return new af(this,e,a,u,d)}clear({color:e,depth:a,stencil:u}){const d=this.gl;let m=0;e&&(m|=d.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),a!==void 0&&(m|=d.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(a),this.depthMask.set(!0)),u!==void 0&&(m|=d.STENCIL_BUFFER_BIT,this.clearStencil.set(u),this.stencilMask.set(255)),d.clear(m)}setCullFace(e){e.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){h.aE(e.blendFunction,Ci.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}createVertexArray(){var e;return os(this.gl)?this.gl.createVertexArray():(e=this.gl.getExtension("OES_vertex_array_object"))===null||e===void 0?void 0:e.createVertexArrayOES()}deleteVertexArray(e){var a;return os(this.gl)?this.gl.deleteVertexArray(e):(a=this.gl.getExtension("OES_vertex_array_object"))===null||a===void 0?void 0:a.deleteVertexArrayOES(e)}unbindVAO(){this.bindVertexArray.set(null)}}class It{constructor(e,a,u){this.func=e,this.mask=a,this.range=u}}It.ReadOnly=!1,It.ReadWrite=!0,It.disabled=new It(519,It.ReadOnly,[0,1]);const nl=7680;class hi{constructor(e,a,u,d,m,w){this.test=e,this.ref=a,this.mask=u,this.fail=d,this.depthFail=m,this.pass=w}}hi.disabled=new hi({func:519,mask:0},0,0,nl,nl,nl);class si{constructor(e,a,u){this.enable=e,this.mode=a,this.frontFace=u}}let zs;function na(g,e,a,u,d){const m=g.context,w=m.gl,E=g.useProgram("collisionBox"),T=[];let I=0,O=0;for(let re=0;re<u.length;re++){const ae=u[re],X=e.getTile(ae).getBucket(a);if(!X)continue;const he=d?X.textCollisionBox:X.iconCollisionBox,pe=X.collisionCircleArray;if(pe.length>0){const ye=h.H();h.aQ(ye,X.placementInvProjMatrix,g.transform.glCoordMatrix),h.aQ(ye,ye,X.placementViewportMatrix),T.push({circleArray:pe,circleOffset:O,transform:ae.posMatrix,invTransform:ye,coord:ae}),I+=pe.length/4,O=I}he&&E.draw(m,w.LINES,It.disabled,hi.disabled,g.colorModeForRenderPass(),si.disabled,{u_matrix:ae.posMatrix,u_pixel_extrude_scale:[1/(B=g.transform).width,1/B.height]},g.style.map.terrain&&g.style.map.terrain.getTerrainData(ae),a.id,he.layoutVertexBuffer,he.indexBuffer,he.segments,null,g.transform.zoom,null,null,he.collisionVertexBuffer)}var B;if(!d||!T.length)return;const U=g.useProgram("collisionCircle"),Z=new h.aR;Z.resize(4*I),Z._trim();let G=0;for(const re of T)for(let ae=0;ae<re.circleArray.length/4;ae++){const X=4*ae,he=re.circleArray[X+0],pe=re.circleArray[X+1],ye=re.circleArray[X+2],Me=re.circleArray[X+3];Z.emplace(G++,he,pe,ye,Me,0),Z.emplace(G++,he,pe,ye,Me,1),Z.emplace(G++,he,pe,ye,Me,2),Z.emplace(G++,he,pe,ye,Me,3)}(!zs||zs.length<2*I)&&(zs=function(re){const ae=2*re,X=new h.aT;X.resize(ae),X._trim();for(let he=0;he<ae;he++){const pe=6*he;X.uint16[pe+0]=4*he+0,X.uint16[pe+1]=4*he+1,X.uint16[pe+2]=4*he+2,X.uint16[pe+3]=4*he+2,X.uint16[pe+4]=4*he+3,X.uint16[pe+5]=4*he+0}return X}(I));const Q=m.createIndexBuffer(zs,!0),ne=m.createVertexBuffer(Z,h.aS.members,!0);for(const re of T){const ae=Ps(re.transform,re.invTransform,g.transform);U.draw(m,w.TRIANGLES,It.disabled,hi.disabled,g.colorModeForRenderPass(),si.disabled,ae,g.style.map.terrain&&g.style.map.terrain.getTerrainData(re.coord),a.id,ne,Q,h.a0.simpleSegment(0,2*re.circleOffset,re.circleArray.length,re.circleArray.length/2),null,g.transform.zoom,null,null,null)}ne.destroy(),Q.destroy()}si.disabled=new si(!1,1029,2305),si.backCCW=new si(!0,1029,2305);const ra=h.an(new Float32Array(16));function Tc(g,e,a,u,d,m){const{horizontalAlign:w,verticalAlign:E}=h.au(g);return new h.P((-(w-.5)*e/d+u[0])*m,(-(E-.5)*a/d+u[1])*m)}function Rs(g,e,a,u,d,m){const w=e.tileAnchorPoint.add(new h.P(e.translation[0],e.translation[1]));if(e.pitchWithMap){let E=u.mult(m);a||(E=E.rotate(-d));const T=w.add(E);return te(T.x,T.y,e.labelPlaneMatrix,e.getElevation).point}if(a){const E=Se(e.tileAnchorPoint.x+1,e.tileAnchorPoint.y,e).point.sub(g),T=Math.atan(E.y/E.x)+(E.x<0?Math.PI:0);return g.add(u.rotate(T))}return g.add(u)}function so(g,e,a,u,d,m,w,E,T,I,O,B,U,Z){const G=g.text.placedSymbolArray,Q=g.text.dynamicLayoutVertexArray,ne=g.icon.dynamicLayoutVertexArray,re={};Q.clear();for(let ae=0;ae<G.length;ae++){const X=G.get(ae),he=X.hidden||!X.crossTileID||g.allowVerticalPlacement&&!X.placedOrientation?null:u[X.crossTileID];if(he){const pe=new h.P(X.anchorX,X.anchorY),ye={getElevation:Z,width:d.width,height:d.height,labelPlaneMatrix:m,lineVertexArray:null,pitchWithMap:a,projection:O,projectionCache:null,tileAnchorPoint:pe,translation:B,unwrappedTileID:U},Me=a?te(pe.x,pe.y,w,Z):Se(pe.x,pe.y,ye),De=V(d.cameraToCenterDistance,Me.signedDistanceFromCamera);let $e=h.ai(g.textSizeData,T,X)*De/h.ap;a&&($e*=g.tilePixelRatio/E);const{width:We,height:Be,anchor:Oe,textOffset:tt,textBoxScale:_t}=he,Ne=Tc(Oe,We,Be,tt,_t,$e),Ue=O.getPitchedTextCorrection(d,pe.add(new h.P(B[0],B[1])),U),gt=Rs(Me.point,ye,e,Ne,d.angle,Ue),mi=g.allowVerticalPlacement&&X.placedOrientation===h.ah.vertical?Math.PI/2:0;for(let Et=0;Et<X.numGlyphs;Et++)h.aj(Q,gt,mi);I&&X.associatedIconIndex>=0&&(re[X.associatedIconIndex]={shiftedAnchor:gt,angle:mi})}else lt(X.numGlyphs,Q)}if(I){ne.clear();const ae=g.icon.placedSymbolArray;for(let X=0;X<ae.length;X++){const he=ae.get(X);if(he.hidden)lt(he.numGlyphs,ne);else{const pe=re[X];if(pe)for(let ye=0;ye<he.numGlyphs;ye++)h.aj(ne,pe.shiftedAnchor,pe.angle);else lt(he.numGlyphs,ne)}}g.icon.dynamicLayoutVertexBuffer.updateData(ne)}g.text.dynamicLayoutVertexBuffer.updateData(Q)}function qn(g,e,a){return a.iconsInText&&e?"symbolTextAndIcon":g?"symbolSDF":"symbolIcon"}function Cc(g,e,a,u,d,m,w,E,T,I,O,B){const U=g.context,Z=U.gl,G=g.transform,Q=Cs(),ne=E==="map",re=T==="map",ae=E!=="viewport"&&a.layout.get("symbol-placement")!=="point",X=ne&&!re&&!ae,he=!re&&ae,pe=!a.layout.get("symbol-sort-key").isConstant();let ye=!1;const Me=g.depthModeForSublayer(0,It.ReadOnly),De=a._unevaluatedLayout.hasValue("text-variable-anchor")||a._unevaluatedLayout.hasValue("text-variable-anchor-offset"),$e=[],We=Q.getCircleRadiusCorrection(G);for(const Be of u){const Oe=e.getTile(Be),tt=Oe.getBucket(a);if(!tt)continue;const _t=d?tt.text:tt.icon;if(!_t||!_t.segments.get().length||!_t.hasVisibleVertices)continue;const Ne=_t.programConfigurations.get(a.id),Ue=d||tt.sdfIcons,gt=d?tt.textSizeData:tt.iconSizeData,mi=re||G.pitch!==0,Et=g.useProgram(qn(Ue,d,tt),Ne),Lt=h.ag(gt,G.zoom),gi=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Be);let Xi,lr,yi,yn,ln=[0,0],Ki=null;if(d)lr=Oe.glyphAtlasTexture,yi=Z.LINEAR,Xi=Oe.glyphAtlasTexture.size,tt.iconsInText&&(ln=Oe.imageAtlasTexture.size,Ki=Oe.imageAtlasTexture,yn=mi||g.options.rotating||g.options.zooming||gt.kind==="composite"||gt.kind==="camera"?Z.LINEAR:Z.NEAREST);else{const Bt=a.layout.get("icon-size").constantOr(0)!==1||tt.iconsNeedLinear;lr=Oe.imageAtlasTexture,yi=Ue||g.options.rotating||g.options.zooming||Bt||mi?Z.LINEAR:Z.NEAREST,Xi=Oe.imageAtlasTexture.size}const cn=Rt(Oe,1,g.transform.zoom),Dr=he?Be.posMatrix:ra,wo=rs(Dr,re,ne,g.transform,cn),wl=Mr(Dr,re,ne,g.transform,cn),So=Mr(Be.posMatrix,re,ne,g.transform,cn),Gn=Q.translatePosition(g.transform,Oe,m,w),Sl=De&&tt.hasTextData(),Jc=a.layout.get("icon-text-fit")!=="none"&&Sl&&tt.hasIconData();if(ae){const Bt=g.style.map.terrain?(ko,Eo)=>g.style.map.terrain.getElevation(Be,ko,Eo):null,Ns=a.layout.get("text-rotation-alignment")==="map";W(tt,Be.posMatrix,g,d,wo,So,re,I,Ns,Q,Be.toUnwrapped(),G.width,G.height,Gn,Bt)}const Yn=Be.posMatrix,Xn=d&&De||Jc,as=ae||Xn?ra:wo,cr=wl,Zi=Ue&&a.paint.get(d?"text-halo-width":"icon-halo-width").constantOr(1)!==0;let Ji;Ji=Ue?tt.iconsInText?mc(gt.kind,Lt,X,re,ae,Xn,g,Yn,as,cr,Gn,Xi,ln,We):ta(gt.kind,Lt,X,re,ae,Xn,g,Yn,as,cr,Gn,d,Xi,!0,We):_u(gt.kind,Lt,X,re,ae,Xn,g,Yn,as,cr,Gn,d,Xi,We);const zn={program:Et,buffers:_t,uniformValues:Ji,atlasTexture:lr,atlasTextureIcon:Ki,atlasInterpolation:yi,atlasInterpolationIcon:yn,isSDF:Ue,hasHalo:Zi};if(pe&&tt.canOverlap){ye=!0;const Bt=_t.segments.get();for(const Ns of Bt)$e.push({segments:new h.a0([Ns]),sortKey:Ns.sortKey,state:zn,terrainData:gi})}else $e.push({segments:_t.segments,sortKey:0,state:zn,terrainData:gi})}ye&&$e.sort((Be,Oe)=>Be.sortKey-Oe.sortKey);for(const Be of $e){const Oe=Be.state;if(U.activeTexture.set(Z.TEXTURE0),Oe.atlasTexture.bind(Oe.atlasInterpolation,Z.CLAMP_TO_EDGE),Oe.atlasTextureIcon&&(U.activeTexture.set(Z.TEXTURE1),Oe.atlasTextureIcon&&Oe.atlasTextureIcon.bind(Oe.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),Oe.isSDF){const tt=Oe.uniformValues;Oe.hasHalo&&(tt.u_is_halo=1,Mc(Oe.buffers,Be.segments,a,g,Oe.program,Me,O,B,tt,Be.terrainData)),tt.u_is_halo=0}Mc(Oe.buffers,Be.segments,a,g,Oe.program,Me,O,B,Oe.uniformValues,Be.terrainData)}}function Mc(g,e,a,u,d,m,w,E,T,I){const O=u.context;d.draw(O,O.gl.TRIANGLES,m,w,E,si.disabled,T,I,a.id,g.layoutVertexBuffer,g.indexBuffer,e,a.paint,u.transform.zoom,g.programConfigurations.get(a.id),g.dynamicLayoutVertexBuffer,g.opacityVertexBuffer)}function Pc(g,e,a,u){const d=g.context,m=d.gl,w=hi.disabled,E=new Ci([m.ONE,m.ONE],h.aM.transparent,[!0,!0,!0,!0]),T=e.getBucket(a);if(!T)return;const I=u.key;let O=a.heatmapFbos.get(I);O||(O=sa(d,e.tileSize,e.tileSize),a.heatmapFbos.set(I,O)),d.bindFramebuffer.set(O.framebuffer),d.viewport.set([0,0,e.tileSize,e.tileSize]),d.clear({color:h.aM.transparent});const B=T.programConfigurations.get(a.id),U=g.useProgram("heatmap",B),Z=g.style.map.terrain.getTerrainData(u);U.draw(d,m.TRIANGLES,It.disabled,w,E,si.disabled,gn(u.posMatrix,e,g.transform.zoom,a.paint.get("heatmap-intensity")),Z,a.id,T.layoutVertexBuffer,T.indexBuffer,T.segments,a.paint,g.transform.zoom,B)}function Ls(g,e,a){const u=g.context,d=u.gl;u.setColorMode(g.colorModeForRenderPass());const m=oa(u,e),w=a.key,E=e.heatmapFbos.get(w);E&&(u.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,E.colorAttachment.get()),u.activeTexture.set(d.TEXTURE1),m.bind(d.LINEAR,d.CLAMP_TO_EDGE),g.useProgram("heatmapTexture").draw(u,d.TRIANGLES,It.disabled,hi.disabled,g.colorModeForRenderPass(),si.disabled,Ya(g,e,0,1),null,e.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments,e.paint,g.transform.zoom),E.destroy(),e.heatmapFbos.delete(w))}function sa(g,e,a){var u,d;const m=g.gl,w=m.createTexture();m.bindTexture(m.TEXTURE_2D,w),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MIN_FILTER,m.LINEAR),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_MAG_FILTER,m.LINEAR);const E=(u=g.HALF_FLOAT)!==null&&u!==void 0?u:m.UNSIGNED_BYTE,T=(d=g.RGBA16F)!==null&&d!==void 0?d:m.RGBA;m.texImage2D(m.TEXTURE_2D,0,T,e,a,0,m.RGBA,E,null);const I=g.createFramebuffer(e,a,!1,!1);return I.colorAttachment.set(w),I}function oa(g,e){return e.colorRampTexture||(e.colorRampTexture=new Ct(g,e.colorRamp,g.gl.RGBA)),e.colorRampTexture}function oo(g,e,a,u,d){if(!a||!u||!u.imageAtlas)return;const m=u.imageAtlas.patternPositions;let w=m[a.to.toString()],E=m[a.from.toString()];if(!w&&E&&(w=E),!E&&w&&(E=w),!w||!E){const T=d.getPaintProperty(e);w=m[T],E=m[T]}w&&E&&g.setConstantPatternPositions(w,E)}function aa(g,e,a,u,d,m,w){const E=g.context.gl,T="fill-pattern",I=a.paint.get(T),O=I&&I.constantOr(1),B=a.getCrossfadeParameters();let U,Z,G,Q,ne;w?(Z=O&&!a.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",U=E.LINES):(Z=O?"fillPattern":"fill",U=E.TRIANGLES);const re=I.constantOr(null);for(const ae of u){const X=e.getTile(ae);if(O&&!X.patternsLoaded())continue;const he=X.getBucket(a);if(!he)continue;const pe=he.programConfigurations.get(a.id),ye=g.useProgram(Z,pe),Me=g.style.map.terrain&&g.style.map.terrain.getTerrainData(ae);O&&(g.context.activeTexture.set(E.TEXTURE0),X.imageAtlasTexture.bind(E.LINEAR,E.CLAMP_TO_EDGE),pe.updatePaintBuffers(B)),oo(pe,T,re,X,a);const De=Me?ae:null,$e=g.translatePosMatrix(De?De.posMatrix:ae.posMatrix,X,a.paint.get("fill-translate"),a.paint.get("fill-translate-anchor"));if(w){Q=he.indexBuffer2,ne=he.segments2;const We=[E.drawingBufferWidth,E.drawingBufferHeight];G=Z==="fillOutlinePattern"&&O?fu($e,g,B,X,We):Wp($e,We)}else Q=he.indexBuffer,ne=he.segments,G=O?pu($e,g,B,X):io($e);ye.draw(g.context,U,d,g.stencilModeForClipping(ae),m,si.disabled,G,Me,a.id,he.layoutVertexBuffer,Q,ne,a.paint,g.transform.zoom,pe)}}function rl(g,e,a,u,d,m,w){const E=g.context,T=E.gl,I="fill-extrusion-pattern",O=a.paint.get(I),B=O.constantOr(1),U=a.getCrossfadeParameters(),Z=a.paint.get("fill-extrusion-opacity"),G=O.constantOr(null);for(const Q of u){const ne=e.getTile(Q),re=ne.getBucket(a);if(!re)continue;const ae=g.style.map.terrain&&g.style.map.terrain.getTerrainData(Q),X=re.programConfigurations.get(a.id),he=g.useProgram(B?"fillExtrusionPattern":"fillExtrusion",X);B&&(g.context.activeTexture.set(T.TEXTURE0),ne.imageAtlasTexture.bind(T.LINEAR,T.CLAMP_TO_EDGE),X.updatePaintBuffers(U)),oo(X,I,G,ne,a);const pe=g.translatePosMatrix(Q.posMatrix,ne,a.paint.get("fill-extrusion-translate"),a.paint.get("fill-extrusion-translate-anchor")),ye=a.paint.get("fill-extrusion-vertical-gradient"),Me=B?Ga(pe,g,ye,Z,Q,U,ne):Qo(pe,g,ye,Z);he.draw(E,E.gl.TRIANGLES,d,m,w,si.backCCW,Me,ae,a.id,re.layoutVertexBuffer,re.indexBuffer,re.segments,a.paint,g.transform.zoom,X,g.style.map.terrain&&re.centroidVertexBuffer)}}function ao(g,e,a,u,d,m,w){const E=g.context,T=E.gl,I=a.fbo;if(!I)return;const O=g.useProgram("hillshade"),B=g.style.map.terrain&&g.style.map.terrain.getTerrainData(e);E.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,I.colorAttachment.get()),O.draw(E,T.TRIANGLES,d,m,w,si.disabled,((U,Z,G,Q)=>{const ne=G.paint.get("hillshade-shadow-color"),re=G.paint.get("hillshade-highlight-color"),ae=G.paint.get("hillshade-accent-color");let X=G.paint.get("hillshade-illumination-direction")*(Math.PI/180);G.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=U.transform.angle);const he=!U.options.moving;return{u_matrix:Q?Q.posMatrix:U.transform.calculatePosMatrix(Z.tileID.toUnwrapped(),he),u_image:0,u_latrange:Xa(0,Z.tileID),u_light:[G.paint.get("hillshade-exaggeration"),X],u_shadow:ne,u_highlight:re,u_accent:ae}})(g,a,u,B?e:null),B,u.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments)}function lo(g,e,a,u,d,m){const w=g.context,E=w.gl,T=e.dem;if(T&&T.data){const I=T.dim,O=T.stride,B=T.getPixels();if(w.activeTexture.set(E.TEXTURE1),w.pixelStoreUnpackPremultiplyAlpha.set(!1),e.demTexture=e.demTexture||g.getTileTexture(O),e.demTexture){const Z=e.demTexture;Z.update(B,{premultiply:!1}),Z.bind(E.NEAREST,E.CLAMP_TO_EDGE)}else e.demTexture=new Ct(w,B,E.RGBA,{premultiply:!1}),e.demTexture.bind(E.NEAREST,E.CLAMP_TO_EDGE);w.activeTexture.set(E.TEXTURE0);let U=e.fbo;if(!U){const Z=new Ct(w,{width:I,height:I,data:null},E.RGBA);Z.bind(E.LINEAR,E.CLAMP_TO_EDGE),U=e.fbo=w.createFramebuffer(I,I,!0,!1),U.colorAttachment.set(Z.texture)}w.bindFramebuffer.set(U.framebuffer),w.viewport.set([0,0,I,I]),g.useProgram("hillshadePrepare").draw(w,E.TRIANGLES,u,d,m,si.disabled,((Z,G)=>{const Q=G.stride,ne=h.H();return h.aP(ne,0,h.X,-h.X,0,0,1),h.J(ne,ne,[0,-h.X,0]),{u_matrix:ne,u_image:1,u_dimension:[Q,Q],u_zoom:Z.overscaledZ,u_unpack:G.getUnpackVector()}})(e.tileID,T),null,a.id,g.rasterBoundsBuffer,g.quadTriangleIndexBuffer,g.rasterBoundsSegments),e.needsHillshadePrepare=!1}}function Au(g,e,a,u,d,m){const w=u.paint.get("raster-fade-duration");if(!m&&w>0){const E=R.now(),T=(E-g.timeAdded)/w,I=e?(E-e.timeAdded)/w:-1,O=a.getSource(),B=d.coveringZoomLevel({tileSize:O.tileSize,roundZoom:O.roundZoom}),U=!e||Math.abs(e.tileID.overscaledZ-B)>Math.abs(g.tileID.overscaledZ-B),Z=U&&g.refreshedUponExpiration?1:h.ac(U?T:1-I,0,1);return g.refreshedUponExpiration&&T>=1&&(g.refreshedUponExpiration=!1),e?{opacity:1,mix:1-Z}:{opacity:Z,mix:0}}return{opacity:1,mix:0}}const Ic=new h.aM(1,0,0,1),qt=new h.aM(0,1,0,1),sl=new h.aM(0,0,1,1),cf=new h.aM(1,0,1,1),Du=new h.aM(0,1,1,1);function co(g,e,a,u){ol(g,0,e+a/2,g.transform.width,a,u)}function zu(g,e,a,u){ol(g,e-a/2,0,a,g.transform.height,u)}function ol(g,e,a,u,d,m){const w=g.context,E=w.gl;E.enable(E.SCISSOR_TEST),E.scissor(e*g.pixelRatio,a*g.pixelRatio,u*g.pixelRatio,d*g.pixelRatio),w.clear({color:m}),E.disable(E.SCISSOR_TEST)}function Ru(g,e,a){const u=g.context,d=u.gl,m=a.posMatrix,w=g.useProgram("debug"),E=It.disabled,T=hi.disabled,I=g.colorModeForRenderPass(),O="$debug",B=g.style.map.terrain&&g.style.map.terrain.getTerrainData(a);u.activeTexture.set(d.TEXTURE0);const U=e.getTileByID(a.key).latestRawTileData,Z=Math.floor((U&&U.byteLength||0)/1024),G=e.getTile(a).tileSize,Q=512/Math.min(G,512)*(a.overscaledZ/g.transform.zoom)*.5;let ne=a.canonical.toString();a.overscaledZ!==a.canonical.z&&(ne+=` => ${a.overscaledZ}`),function(re,ae){re.initDebugOverlayCanvas();const X=re.debugOverlayCanvas,he=re.context.gl,pe=re.debugOverlayCanvas.getContext("2d");pe.clearRect(0,0,X.width,X.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(ae,5,5),pe.strokeText(ae,5,5),re.debugOverlayTexture.update(X),re.debugOverlayTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE)}(g,`${ne} ${Z}kB`),w.draw(u,d.TRIANGLES,E,T,Ci.alphaBlended,si.disabled,ea(m,h.aM.transparent,Q),null,O,g.debugBuffer,g.quadTriangleIndexBuffer,g.debugSegments),w.draw(u,d.LINE_STRIP,E,T,I,si.disabled,ea(m,h.aM.red),B,O,g.debugBuffer,g.tileBorderIndexBuffer,g.debugSegments)}function Lu(g,e,a){const u=g.context,d=u.gl,m=g.colorModeForRenderPass(),w=new It(d.LEQUAL,It.ReadWrite,g.depthRangeFor3D),E=g.useProgram("terrain"),T=e.getTerrainMesh();u.bindFramebuffer.set(null),u.viewport.set([0,0,g.width,g.height]);for(const I of a){const O=g.renderToTexture.getTexture(I),B=e.getTerrainData(I.tileID);u.activeTexture.set(d.TEXTURE0),d.bindTexture(d.TEXTURE_2D,O.texture);const U=g.transform.calculatePosMatrix(I.tileID.toUnwrapped()),Z=e.getMeshFrameDelta(g.transform.zoom),G=g.transform.calculateFogMatrix(I.tileID.toUnwrapped()),Q=pc(U,Z,G,g.style.sky,g.transform.pitch);E.draw(u,d.TRIANGLES,w,hi.disabled,m,si.backCCW,Q,B,"terrain",T.vertexBuffer,T.indexBuffer,T.segments)}}class al{constructor(e,a,u){this.vertexBuffer=e,this.indexBuffer=a,this.segments=u}destroy(){this.vertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.vertexBuffer=null,this.indexBuffer=null,this.segments=null}}class ll{constructor(e,a){this.context=new lf(e),this.transform=a,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:h.an(new Float64Array(16)),renderTime:0},this.setup(),this.numSublayers=pt.maxUnderzooming+pt.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new uc}resize(e,a,u){if(this.width=Math.floor(e*u),this.height=Math.floor(a*u),this.pixelRatio=u,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const d of this.style._order)this.style._layers[d].resize()}setup(){const e=this.context,a=new h.aX;a.emplaceBack(0,0),a.emplaceBack(h.X,0),a.emplaceBack(0,h.X),a.emplaceBack(h.X,h.X),this.tileExtentBuffer=e.createVertexBuffer(a,Ms.members),this.tileExtentSegments=h.a0.simpleSegment(0,0,4,2);const u=new h.aX;u.emplaceBack(0,0),u.emplaceBack(h.X,0),u.emplaceBack(0,h.X),u.emplaceBack(h.X,h.X),this.debugBuffer=e.createVertexBuffer(u,Ms.members),this.debugSegments=h.a0.simpleSegment(0,0,4,5);const d=new h.$;d.emplaceBack(0,0,0,0),d.emplaceBack(h.X,0,h.X,0),d.emplaceBack(0,h.X,0,h.X),d.emplaceBack(h.X,h.X,h.X,h.X),this.rasterBoundsBuffer=e.createVertexBuffer(d,is.members),this.rasterBoundsSegments=h.a0.simpleSegment(0,0,4,2);const m=new h.aX;m.emplaceBack(0,0),m.emplaceBack(1,0),m.emplaceBack(0,1),m.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(m,Ms.members),this.viewportSegments=h.a0.simpleSegment(0,0,4,2);const w=new h.aZ;w.emplaceBack(0),w.emplaceBack(1),w.emplaceBack(3),w.emplaceBack(2),w.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(w);const E=new h.aY;E.emplaceBack(0,1,2),E.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(E);const T=this.context.gl;this.stencilClearMode=new hi({func:T.ALWAYS,mask:0},0,255,T.ZERO,T.ZERO,T.ZERO)}clearStencil(){const e=this.context,a=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const u=h.H();h.aP(u,0,this.width,this.height,0,0,1),h.K(u,u,[a.drawingBufferWidth,a.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,a.TRIANGLES,It.disabled,this.stencilClearMode,Ci.disabled,si.disabled,mn(u),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,a){if(this.currentStencilSource===e.source||!e.isTileClipped()||!a||!a.length)return;this.currentStencilSource=e.source;const u=this.context,d=u.gl;this.nextStencilID+a.length>256&&this.clearStencil(),u.setColorMode(Ci.disabled),u.setDepthMode(It.disabled);const m=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const w of a){const E=this._tileClippingMaskIDs[w.key]=this.nextStencilID++,T=this.style.map.terrain&&this.style.map.terrain.getTerrainData(w);m.draw(u,d.TRIANGLES,It.disabled,new hi({func:d.ALWAYS,mask:0},E,255,d.KEEP,d.KEEP,d.REPLACE),Ci.disabled,si.disabled,mn(w.posMatrix),T,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,a=this.context.gl;return new hi({func:a.NOTEQUAL,mask:255},e,255,a.KEEP,a.KEEP,a.REPLACE)}stencilModeForClipping(e){const a=this.context.gl;return new hi({func:a.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,a.KEEP,a.KEEP,a.REPLACE)}stencilConfigForOverlap(e){const a=this.context.gl,u=e.sort((w,E)=>E.overscaledZ-w.overscaledZ),d=u[u.length-1].overscaledZ,m=u[0].overscaledZ-d+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();const w={};for(let E=0;E<m;E++)w[E+d]=new hi({func:a.GEQUAL,mask:255},E+this.nextStencilID,255,a.KEEP,a.KEEP,a.REPLACE);return this.nextStencilID+=m,[w,u]}return[{[d]:hi.disabled},u]}colorModeForRenderPass(){const e=this.context.gl;return this._showOverdrawInspector?new Ci([e.CONSTANT_COLOR,e.ONE],new h.aM(.125,.125,.125,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Ci.unblended:Ci.alphaBlended}depthModeForSublayer(e,a,u){if(!this.opaquePassEnabledForLayer())return It.disabled;const d=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new It(u||this.context.gl.LEQUAL,a,[d,d])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(e,a){this.style=e,this.options=a,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(R.now()),this.imageManager.beginFrame();const u=this.style._order,d=this.style.sourceCaches,m={},w={},E={};for(const T in d){const I=d[T];I.used&&I.prepare(this.context),m[T]=I.getVisibleCoordinates(),w[T]=m[T].slice().reverse(),E[T]=I.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let T=0;T<u.length;T++)if(this.style._layers[u[T]].is3D()){this.opaquePassCutoff=T;break}this.maybeDrawDepthAndCoords(!1),this.renderToTexture&&(this.renderToTexture.prepareForRender(this.style,this.transform.zoom),this.opaquePassCutoff=0),this.renderPass="offscreen";for(const T of u){const I=this.style._layers[T];if(!I.hasOffscreenPass()||I.isHidden(this.transform.zoom))continue;const O=w[I.source];(I.type==="custom"||O.length)&&this.renderLayer(this,d[I.source],I,O)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:a.showOverdrawInspector?h.aM.black:h.aM.transparent,depth:1}),this.clearStencil(),this.style.sky&&function(T,I){const O=T.context,B=O.gl,U=((re,ae,X)=>({u_sky_color:re.properties.get("sky-color"),u_horizon_color:re.properties.get("horizon-color"),u_horizon:(ae.height/2+ae.getHorizon())*X,u_sky_horizon_blend:re.properties.get("sky-horizon-blend")*ae.height/2*X}))(I,T.style.map.transform,T.pixelRatio),Z=new It(B.LEQUAL,It.ReadWrite,[0,1]),G=hi.disabled,Q=T.colorModeForRenderPass(),ne=T.useProgram("sky");if(!I.mesh){const re=new h.aX;re.emplaceBack(-1,-1),re.emplaceBack(1,-1),re.emplaceBack(1,1),re.emplaceBack(-1,1);const ae=new h.aY;ae.emplaceBack(0,1,2),ae.emplaceBack(0,2,3),I.mesh=new al(O.createVertexBuffer(re,Ms.members),O.createIndexBuffer(ae),h.a0.simpleSegment(0,0,re.length,ae.length))}ne.draw(O,B.TRIANGLES,Z,G,Q,si.disabled,U,void 0,"sky",I.mesh.vertexBuffer,I.mesh.indexBuffer,I.mesh.segments)}(this,this.style.sky),this._showOverdrawInspector=a.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],!this.renderToTexture)for(this.renderPass="opaque",this.currentLayer=u.length-1;this.currentLayer>=0;this.currentLayer--){const T=this.style._layers[u[this.currentLayer]],I=d[T.source],O=m[T.source];this._renderTileClippingMasks(T,O),this.renderLayer(this,I,T,O)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<u.length;this.currentLayer++){const T=this.style._layers[u[this.currentLayer]],I=d[T.source];if(this.renderToTexture&&this.renderToTexture.renderLayer(T))continue;const O=(T.type==="symbol"?E:w)[T.source];this._renderTileClippingMasks(T,m[T.source]),this.renderLayer(this,I,T,O)}if(this.options.showTileBoundaries){const T=function(I,O){let B=null;const U=Object.values(I._layers).flatMap(ne=>ne.source&&!ne.isHidden(O)?[I.sourceCaches[ne.source]]:[]),Z=U.filter(ne=>ne.getSource().type==="vector"),G=U.filter(ne=>ne.getSource().type!=="vector"),Q=ne=>{(!B||B.getSource().maxzoom<ne.getSource().maxzoom)&&(B=ne)};return Z.forEach(ne=>Q(ne)),B||G.forEach(ne=>Q(ne)),B}(this.style,this.transform.zoom);T&&function(I,O,B){for(let U=0;U<B.length;U++)Ru(I,O,B[U])}(this,T,T.getVisibleCoordinates())}this.options.showPadding&&function(T){const I=T.transform.padding;co(T,T.transform.height-(I.top||0),3,Ic),co(T,I.bottom||0,3,qt),zu(T,I.left||0,3,sl),zu(T,T.transform.width-(I.right||0),3,cf);const O=T.transform.centerPoint;(function(B,U,Z,G){ol(B,U-1,Z-10,2,20,G),ol(B,U-10,Z-1,20,2,G)})(T,O.x,T.transform.height-O.y,Du)}(this),this.context.setDefault()}maybeDrawDepthAndCoords(e){if(!this.style||!this.style.map||!this.style.map.terrain)return;const a=this.terrainFacilitator.matrix,u=this.transform.modelViewProjectionMatrix;let d=this.terrainFacilitator.dirty;d||(d=e?!h.a_(a,u):!h.a$(a,u)),d||(d=this.style.map.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime).length>0),d&&(h.b0(a,u),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(m,w){const E=m.context,T=E.gl,I=Ci.unblended,O=new It(T.LEQUAL,It.ReadWrite,[0,1]),B=w.getTerrainMesh(),U=w.sourceCache.getRenderableTiles(),Z=m.useProgram("terrainDepth");E.bindFramebuffer.set(w.getFramebuffer("depth").framebuffer),E.viewport.set([0,0,m.width/devicePixelRatio,m.height/devicePixelRatio]),E.clear({color:h.aM.transparent,depth:1});for(const G of U){const Q=w.getTerrainData(G.tileID),ne={u_matrix:m.transform.calculatePosMatrix(G.tileID.toUnwrapped()),u_ele_delta:w.getMeshFrameDelta(m.transform.zoom)};Z.draw(E,T.TRIANGLES,O,hi.disabled,I,si.backCCW,ne,Q,"terrain",B.vertexBuffer,B.indexBuffer,B.segments)}E.bindFramebuffer.set(null),E.viewport.set([0,0,m.width,m.height])}(this,this.style.map.terrain),function(m,w){const E=m.context,T=E.gl,I=Ci.unblended,O=new It(T.LEQUAL,It.ReadWrite,[0,1]),B=w.getTerrainMesh(),U=w.getCoordsTexture(),Z=w.sourceCache.getRenderableTiles(),G=m.useProgram("terrainCoords");E.bindFramebuffer.set(w.getFramebuffer("coords").framebuffer),E.viewport.set([0,0,m.width/devicePixelRatio,m.height/devicePixelRatio]),E.clear({color:h.aM.transparent,depth:1}),w.coordsIndex=[];for(const Q of Z){const ne=w.getTerrainData(Q.tileID);E.activeTexture.set(T.TEXTURE0),T.bindTexture(T.TEXTURE_2D,U.texture);const re={u_matrix:m.transform.calculatePosMatrix(Q.tileID.toUnwrapped()),u_terrain_coords_id:(255-w.coordsIndex.length)/255,u_texture:0,u_ele_delta:w.getMeshFrameDelta(m.transform.zoom)};G.draw(E,T.TRIANGLES,O,hi.disabled,I,si.backCCW,re,ne,"terrain",B.vertexBuffer,B.indexBuffer,B.segments),w.coordsIndex.push(Q.tileID.key)}E.bindFramebuffer.set(null),E.viewport.set([0,0,m.width,m.height])}(this,this.style.map.terrain))}renderLayer(e,a,u,d){if(!u.isHidden(this.transform.zoom)&&(u.type==="background"||u.type==="custom"||(d||[]).length))switch(this.id=u.id,u.type){case"symbol":(function(m,w,E,T,I){if(m.renderPass!=="translucent")return;const O=hi.disabled,B=m.colorModeForRenderPass();(E._unevaluatedLayout.hasValue("text-variable-anchor")||E._unevaluatedLayout.hasValue("text-variable-anchor-offset"))&&function(U,Z,G,Q,ne,re,ae,X,he){const pe=Z.transform,ye=Cs(),Me=ne==="map",De=re==="map";for(const $e of U){const We=Q.getTile($e),Be=We.getBucket(G);if(!Be||!Be.text||!Be.text.segments.get().length)continue;const Oe=h.ag(Be.textSizeData,pe.zoom),tt=Rt(We,1,Z.transform.zoom),_t=rs($e.posMatrix,De,Me,Z.transform,tt),Ne=G.layout.get("icon-text-fit")!=="none"&&Be.hasIconData();if(Oe){const Ue=Math.pow(2,pe.zoom-We.tileID.overscaledZ),gt=Z.style.map.terrain?(Et,Lt)=>Z.style.map.terrain.getElevation($e,Et,Lt):null,mi=ye.translatePosition(pe,We,ae,X);so(Be,Me,De,he,pe,_t,$e.posMatrix,Ue,Oe,Ne,ye,mi,$e.toUnwrapped(),gt)}}}(T,m,E,w,E.layout.get("text-rotation-alignment"),E.layout.get("text-pitch-alignment"),E.paint.get("text-translate"),E.paint.get("text-translate-anchor"),I),E.paint.get("icon-opacity").constantOr(1)!==0&&Cc(m,w,E,T,!1,E.paint.get("icon-translate"),E.paint.get("icon-translate-anchor"),E.layout.get("icon-rotation-alignment"),E.layout.get("icon-pitch-alignment"),E.layout.get("icon-keep-upright"),O,B),E.paint.get("text-opacity").constantOr(1)!==0&&Cc(m,w,E,T,!0,E.paint.get("text-translate"),E.paint.get("text-translate-anchor"),E.layout.get("text-rotation-alignment"),E.layout.get("text-pitch-alignment"),E.layout.get("text-keep-upright"),O,B),w.map.showCollisionBoxes&&(na(m,w,E,T,!0),na(m,w,E,T,!1))})(e,a,u,d,this.style.placement.variableOffsets);break;case"circle":(function(m,w,E,T){if(m.renderPass!=="translucent")return;const I=E.paint.get("circle-opacity"),O=E.paint.get("circle-stroke-width"),B=E.paint.get("circle-stroke-opacity"),U=!E.layout.get("circle-sort-key").isConstant();if(I.constantOr(1)===0&&(O.constantOr(1)===0||B.constantOr(1)===0))return;const Z=m.context,G=Z.gl,Q=m.depthModeForSublayer(0,It.ReadOnly),ne=hi.disabled,re=m.colorModeForRenderPass(),ae=[];for(let X=0;X<T.length;X++){const he=T[X],pe=w.getTile(he),ye=pe.getBucket(E);if(!ye)continue;const Me=ye.programConfigurations.get(E.id),De=m.useProgram("circle",Me),$e=ye.layoutVertexBuffer,We=ye.indexBuffer,Be=m.style.map.terrain&&m.style.map.terrain.getTerrainData(he),Oe={programConfiguration:Me,program:De,layoutVertexBuffer:$e,indexBuffer:We,uniformValues:Gp(m,he,pe,E),terrainData:Be};if(U){const tt=ye.segments.get();for(const _t of tt)ae.push({segments:new h.a0([_t]),sortKey:_t.sortKey,state:Oe})}else ae.push({segments:ye.segments,sortKey:0,state:Oe})}U&&ae.sort((X,he)=>X.sortKey-he.sortKey);for(const X of ae){const{programConfiguration:he,program:pe,layoutVertexBuffer:ye,indexBuffer:Me,uniformValues:De,terrainData:$e}=X.state;pe.draw(Z,G.TRIANGLES,Q,ne,re,si.disabled,De,$e,E.id,ye,Me,X.segments,E.paint,m.transform.zoom,he)}})(e,a,u,d);break;case"heatmap":(function(m,w,E,T){if(E.paint.get("heatmap-opacity")===0)return;const I=m.context;if(m.style.map.terrain){for(const O of T){const B=w.getTile(O);w.hasRenderableParent(O)||(m.renderPass==="offscreen"?Pc(m,B,E,O):m.renderPass==="translucent"&&Ls(m,E,O))}I.viewport.set([0,0,m.width,m.height])}else m.renderPass==="offscreen"?function(O,B,U,Z){const G=O.context,Q=G.gl,ne=hi.disabled,re=new Ci([Q.ONE,Q.ONE],h.aM.transparent,[!0,!0,!0,!0]);(function(ae,X,he){const pe=ae.gl;ae.activeTexture.set(pe.TEXTURE1),ae.viewport.set([0,0,X.width/4,X.height/4]);let ye=he.heatmapFbos.get(h.aU);ye?(pe.bindTexture(pe.TEXTURE_2D,ye.colorAttachment.get()),ae.bindFramebuffer.set(ye.framebuffer)):(ye=sa(ae,X.width/4,X.height/4),he.heatmapFbos.set(h.aU,ye))})(G,O,U),G.clear({color:h.aM.transparent});for(let ae=0;ae<Z.length;ae++){const X=Z[ae];if(B.hasRenderableParent(X))continue;const he=B.getTile(X),pe=he.getBucket(U);if(!pe)continue;const ye=pe.programConfigurations.get(U.id),Me=O.useProgram("heatmap",ye),{zoom:De}=O.transform;Me.draw(G,Q.TRIANGLES,It.disabled,ne,re,si.disabled,gn(X.posMatrix,he,De,U.paint.get("heatmap-intensity")),null,U.id,pe.layoutVertexBuffer,pe.indexBuffer,pe.segments,U.paint,O.transform.zoom,ye)}G.viewport.set([0,0,O.width,O.height])}(m,w,E,T):m.renderPass==="translucent"&&function(O,B){const U=O.context,Z=U.gl;U.setColorMode(O.colorModeForRenderPass());const G=B.heatmapFbos.get(h.aU);G&&(U.activeTexture.set(Z.TEXTURE0),Z.bindTexture(Z.TEXTURE_2D,G.colorAttachment.get()),U.activeTexture.set(Z.TEXTURE1),oa(U,B).bind(Z.LINEAR,Z.CLAMP_TO_EDGE),O.useProgram("heatmapTexture").draw(U,Z.TRIANGLES,It.disabled,hi.disabled,O.colorModeForRenderPass(),si.disabled,Ya(O,B,0,1),null,B.id,O.viewportBuffer,O.quadTriangleIndexBuffer,O.viewportSegments,B.paint,O.transform.zoom))}(m,E)})(e,a,u,d);break;case"line":(function(m,w,E,T){if(m.renderPass!=="translucent")return;const I=E.paint.get("line-opacity"),O=E.paint.get("line-width");if(I.constantOr(1)===0||O.constantOr(1)===0)return;const B=m.depthModeForSublayer(0,It.ReadOnly),U=m.colorModeForRenderPass(),Z=E.paint.get("line-dasharray"),G=E.paint.get("line-pattern"),Q=G.constantOr(1),ne=E.paint.get("line-gradient"),re=E.getCrossfadeParameters(),ae=Q?"linePattern":Z?"lineSDF":ne?"lineGradient":"line",X=m.context,he=X.gl;let pe=!0;for(const ye of T){const Me=w.getTile(ye);if(Q&&!Me.patternsLoaded())continue;const De=Me.getBucket(E);if(!De)continue;const $e=De.programConfigurations.get(E.id),We=m.context.program.get(),Be=m.useProgram(ae,$e),Oe=pe||Be.program!==We,tt=m.style.map.terrain&&m.style.map.terrain.getTerrainData(ye),_t=G.constantOr(null);if(_t&&Me.imageAtlas){const gt=Me.imageAtlas,mi=gt.patternPositions[_t.to.toString()],Et=gt.patternPositions[_t.from.toString()];mi&&Et&&$e.setConstantPatternPositions(mi,Et)}const Ne=tt?ye:null,Ue=Q?no(m,Me,E,re,Ne):Z?Yp(m,Me,E,Z,re,Ne):ne?mu(m,Me,E,De.lineClipsArray.length,Ne):Ka(m,Me,E,Ne);if(Q)X.activeTexture.set(he.TEXTURE0),Me.imageAtlasTexture.bind(he.LINEAR,he.CLAMP_TO_EDGE),$e.updatePaintBuffers(re);else if(Z&&(Oe||m.lineAtlas.dirty))X.activeTexture.set(he.TEXTURE0),m.lineAtlas.bind(X);else if(ne){const gt=De.gradients[E.id];let mi=gt.texture;if(E.gradientVersion!==gt.version){let Et=256;if(E.stepInterpolant){const Lt=w.getSource().maxzoom,gi=ye.canonical.z===Lt?Math.ceil(1<<m.transform.maxZoom-ye.canonical.z):1;Et=h.ac(h.aV(De.maxLineLength/h.X*1024*gi),256,X.maxTextureSize)}gt.gradient=h.aW({expression:E.gradientExpression(),evaluationKey:"lineProgress",resolution:Et,image:gt.gradient||void 0,clips:De.lineClipsArray}),gt.texture?gt.texture.update(gt.gradient):gt.texture=new Ct(X,gt.gradient,he.RGBA),gt.version=E.gradientVersion,mi=gt.texture}X.activeTexture.set(he.TEXTURE0),mi.bind(E.stepInterpolant?he.NEAREST:he.LINEAR,he.CLAMP_TO_EDGE)}Be.draw(X,he.TRIANGLES,B,m.stencilModeForClipping(ye),U,si.disabled,Ue,tt,E.id,De.layoutVertexBuffer,De.indexBuffer,De.segments,E.paint,m.transform.zoom,$e,De.layoutVertexBuffer2),pe=!1}})(e,a,u,d);break;case"fill":(function(m,w,E,T){const I=E.paint.get("fill-color"),O=E.paint.get("fill-opacity");if(O.constantOr(1)===0)return;const B=m.colorModeForRenderPass(),U=E.paint.get("fill-pattern"),Z=m.opaquePassEnabledForLayer()&&!U.constantOr(1)&&I.constantOr(h.aM.transparent).a===1&&O.constantOr(0)===1?"opaque":"translucent";if(m.renderPass===Z){const G=m.depthModeForSublayer(1,m.renderPass==="opaque"?It.ReadWrite:It.ReadOnly);aa(m,w,E,T,G,B,!1)}if(m.renderPass==="translucent"&&E.paint.get("fill-antialias")){const G=m.depthModeForSublayer(E.getPaintProperty("fill-outline-color")?2:0,It.ReadOnly);aa(m,w,E,T,G,B,!0)}})(e,a,u,d);break;case"fill-extrusion":(function(m,w,E,T){const I=E.paint.get("fill-extrusion-opacity");if(I!==0&&m.renderPass==="translucent"){const O=new It(m.context.gl.LEQUAL,It.ReadWrite,m.depthRangeFor3D);if(I!==1||E.paint.get("fill-extrusion-pattern").constantOr(1))rl(m,w,E,T,O,hi.disabled,Ci.disabled),rl(m,w,E,T,O,m.stencilModeFor3D(),m.colorModeForRenderPass());else{const B=m.colorModeForRenderPass();rl(m,w,E,T,O,hi.disabled,B)}}})(e,a,u,d);break;case"hillshade":(function(m,w,E,T){if(m.renderPass!=="offscreen"&&m.renderPass!=="translucent")return;const I=m.context,O=m.depthModeForSublayer(0,It.ReadOnly),B=m.colorModeForRenderPass(),[U,Z]=m.renderPass==="translucent"?m.stencilConfigForOverlap(T):[{},T];for(const G of Z){const Q=w.getTile(G);Q.needsHillshadePrepare!==void 0&&Q.needsHillshadePrepare&&m.renderPass==="offscreen"?lo(m,Q,E,O,hi.disabled,B):m.renderPass==="translucent"&&ao(m,G,Q,E,O,U[G.overscaledZ],B)}I.viewport.set([0,0,m.width,m.height])})(e,a,u,d);break;case"raster":(function(m,w,E,T){if(m.renderPass!=="translucent"||E.paint.get("raster-opacity")===0||!T.length)return;const I=m.context,O=I.gl,B=w.getSource(),U=m.useProgram("raster"),Z=m.colorModeForRenderPass(),[G,Q]=B instanceof $r?[{},T]:m.stencilConfigForOverlap(T),ne=Q[Q.length-1].overscaledZ,re=!m.options.moving;for(const ae of Q){const X=m.depthModeForSublayer(ae.overscaledZ-ne,E.paint.get("raster-opacity")===1?It.ReadWrite:It.ReadOnly,O.LESS),he=w.getTile(ae);he.registerFadeDuration(E.paint.get("raster-fade-duration"));const pe=w.findLoadedParent(ae,0),ye=w.findLoadedSibling(ae),Me=Au(he,pe||ye||null,w,E,m.transform,m.style.map.terrain);let De,$e;const We=E.paint.get("raster-resampling")==="nearest"?O.NEAREST:O.LINEAR;I.activeTexture.set(O.TEXTURE0),he.texture.bind(We,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),I.activeTexture.set(O.TEXTURE1),pe?(pe.texture.bind(We,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),De=Math.pow(2,pe.tileID.overscaledZ-he.tileID.overscaledZ),$e=[he.tileID.canonical.x*De%1,he.tileID.canonical.y*De%1]):he.texture.bind(We,O.CLAMP_TO_EDGE,O.LINEAR_MIPMAP_NEAREST),he.texture.useMipmap&&I.extTextureFilterAnisotropic&&m.transform.pitch>20&&O.texParameterf(O.TEXTURE_2D,I.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,I.extTextureFilterAnisotropicMax);const Be=m.style.map.terrain&&m.style.map.terrain.getTerrainData(ae),Oe=Be?ae:null,tt=Oe?Oe.posMatrix:m.transform.calculatePosMatrix(ae.toUnwrapped(),re),_t=Xp(tt,$e||[0,0],De||1,Me,E);B instanceof $r?U.draw(I,O.TRIANGLES,X,hi.disabled,Z,si.disabled,_t,Be,E.id,B.boundsBuffer,m.quadTriangleIndexBuffer,B.boundsSegments):U.draw(I,O.TRIANGLES,X,G[ae.overscaledZ],Z,si.disabled,_t,Be,E.id,m.rasterBoundsBuffer,m.quadTriangleIndexBuffer,m.rasterBoundsSegments)}})(e,a,u,d);break;case"background":(function(m,w,E,T){const I=E.paint.get("background-color"),O=E.paint.get("background-opacity");if(O===0)return;const B=m.context,U=B.gl,Z=m.transform,G=Z.tileSize,Q=E.paint.get("background-pattern");if(m.isPatternMissing(Q))return;const ne=!Q&&I.a===1&&O===1&&m.opaquePassEnabledForLayer()?"opaque":"translucent";if(m.renderPass!==ne)return;const re=hi.disabled,ae=m.depthModeForSublayer(0,ne==="opaque"?It.ReadWrite:It.ReadOnly),X=m.colorModeForRenderPass(),he=m.useProgram(Q?"backgroundPattern":"background"),pe=T||Z.coveringTiles({tileSize:G,terrain:m.style.map.terrain});Q&&(B.activeTexture.set(U.TEXTURE0),m.imageManager.bind(m.context));const ye=E.getCrossfadeParameters();for(const Me of pe){const De=T?Me.posMatrix:m.transform.calculatePosMatrix(Me.toUnwrapped()),$e=Q?gc(De,O,m,Q,{tileID:Me,tileSize:G},ye):Ja(De,O,I),We=m.style.map.terrain&&m.style.map.terrain.getTerrainData(Me);he.draw(B,U.TRIANGLES,ae,re,X,si.disabled,$e,We,E.id,m.tileExtentBuffer,m.quadTriangleIndexBuffer,m.tileExtentSegments)}})(e,0,u,d);break;case"custom":(function(m,w,E){const T=m.context,I=E.implementation;if(m.renderPass==="offscreen"){const O=I.prerender;O&&(m.setCustomLayerDefaults(),T.setColorMode(m.colorModeForRenderPass()),O.call(I,T.gl,m.transform.customLayerMatrix()),T.setDirty(),m.setBaseState())}else if(m.renderPass==="translucent"){m.setCustomLayerDefaults(),T.setColorMode(m.colorModeForRenderPass()),T.setStencilMode(hi.disabled);const O=I.renderingMode==="3d"?new It(m.context.gl.LEQUAL,It.ReadWrite,m.depthRangeFor3D):m.depthModeForSublayer(0,It.ReadOnly);T.setDepthMode(O),I.render(T.gl,m.transform.customLayerMatrix(),{farZ:m.transform.farZ,nearZ:m.transform.nearZ,fov:m.transform._fov,modelViewProjectionMatrix:m.transform.modelViewProjectionMatrix,projectionMatrix:m.transform.projectionMatrix}),T.setDirty(),m.setBaseState(),T.bindFramebuffer.set(null)}})(e,0,u)}}translatePosMatrix(e,a,u,d,m){if(!u[0]&&!u[1])return e;const w=m?d==="map"?this.transform.angle:0:d==="viewport"?-this.transform.angle:0;if(w){const I=Math.sin(w),O=Math.cos(w);u=[u[0]*O-u[1]*I,u[0]*I+u[1]*O]}const E=[m?u[0]:Rt(a,u[0],this.transform.zoom),m?u[1]:Rt(a,u[1],this.transform.zoom),0],T=new Float32Array(16);return h.J(T,e,E),T}saveTileTexture(e){const a=this._tileTextures[e.size[0]];a?a.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const a=this._tileTextures[e];return a&&a.length>0?a.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const a=this.imageManager.getPattern(e.from.toString()),u=this.imageManager.getPattern(e.to.toString());return!a||!u}useProgram(e,a){this.cache=this.cache||{};const u=e+(a?a.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.map.terrain?"/terrain":"");return this.cache[u]||(this.cache[u]=new fc(this.context,ss[e],a,yc[e],this._showOverdrawInspector,this.style.map.terrain)),this.cache[u]}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 e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new Ct(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}overLimit(){const{drawingBufferWidth:e,drawingBufferHeight:a}=this.context.gl;return this.width!==e||this.height!==a}}class ho{constructor(e,a){this.points=e,this.planes=a}static fromInvProjectionMatrix(e,a,u){const d=Math.pow(2,u),m=[[-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(E=>{const T=1/(E=h.af([],E,e))[3]/a*d;return h.b1(E,E,[T,T,1/E[3],T])}),w=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(E=>{const T=function(U,Z){var G=Z[0],Q=Z[1],ne=Z[2],re=G*G+Q*Q+ne*ne;return re>0&&(re=1/Math.sqrt(re)),U[0]=Z[0]*re,U[1]=Z[1]*re,U[2]=Z[2]*re,U}([],function(U,Z,G){var Q=Z[0],ne=Z[1],re=Z[2],ae=G[0],X=G[1],he=G[2];return U[0]=ne*he-re*X,U[1]=re*ae-Q*he,U[2]=Q*X-ne*ae,U}([],Ae([],m[E[0]],m[E[1]]),Ae([],m[E[2]],m[E[1]]))),I=-((O=T)[0]*(B=m[E[1]])[0]+O[1]*B[1]+O[2]*B[2]);var O,B;return T.concat(I)});return new ho(m,w)}}class uo{constructor(e,a){this.min=e,this.max=a,this.center=function(u,d,m){return u[0]=.5*d[0],u[1]=.5*d[1],u[2]=.5*d[2],u}([],function(u,d,m){return u[0]=d[0]+m[0],u[1]=d[1]+m[1],u[2]=d[2]+m[2],u}([],this.min,this.max))}quadrant(e){const a=[e%2==0,e<2],u=Qe(this.min),d=Qe(this.max);for(let m=0;m<a.length;m++)u[m]=a[m]?this.min[m]:this.center[m],d[m]=a[m]?this.center[m]:this.max[m];return d[2]=this.max[2],new uo(u,d)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(e){const a=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let u=!0;for(let d=0;d<e.planes.length;d++){const m=e.planes[d];let w=0;for(let E=0;E<a.length;E++)h.b2(m,a[E])>=0&&w++;if(w===0)return 0;w!==a.length&&(u=!1)}if(u)return 2;for(let d=0;d<3;d++){let m=Number.MAX_VALUE,w=-Number.MAX_VALUE;for(let E=0;E<e.points.length;E++){const T=e.points[E][d]-this.min[d];m=Math.min(m,T),w=Math.max(w,T)}if(w<0||m>this.max[d]-this.min[d])return 0}return 1}}class po{constructor(e=0,a=0,u=0,d=0){if(isNaN(e)||e<0||isNaN(a)||a<0||isNaN(u)||u<0||isNaN(d)||d<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=e,this.bottom=a,this.left=u,this.right=d}interpolate(e,a,u){return a.top!=null&&e.top!=null&&(this.top=h.y.number(e.top,a.top,u)),a.bottom!=null&&e.bottom!=null&&(this.bottom=h.y.number(e.bottom,a.bottom,u)),a.left!=null&&e.left!=null&&(this.left=h.y.number(e.left,a.left,u)),a.right!=null&&e.right!=null&&(this.right=h.y.number(e.right,a.right,u)),this}getCenter(e,a){const u=h.ac((this.left+e-this.right)/2,0,e),d=h.ac((this.top+a-this.bottom)/2,0,a);return new h.P(u,d)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new po(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}const Ac=85.051129;class fo{constructor(e,a,u,d,m){this.tileSize=512,this._renderWorldCopies=m===void 0||!!m,this._minZoom=e||0,this._maxZoom=a||22,this._minPitch=u??0,this._maxPitch=d??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new h.N(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new po,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={},this.minElevationForCurrentTile=0}clone(){const e=new fo(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.apply(this),e}apply(e){this.tileSize=e.tileSize,this.latRange=e.latRange,this.lngRange=e.lngRange,this.width=e.width,this.height=e.height,this._center=e._center,this._elevation=e._elevation,this.minElevationForCurrentTile=e.minElevationForCurrentTile,this.zoom=e.zoom,this.angle=e.angle,this._fov=e._fov,this._pitch=e._pitch,this._unmodified=e._unmodified,this._edgeInsets=e._edgeInsets.clone(),this._calcMatrices()}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){e===void 0?e=!0:e===null&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new h.P(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(e){const a=-h.b3(e,-180,180)*Math.PI/180;this.angle!==a&&(this._unmodified=!1,this.angle=a,this._calcMatrices(),this.rotationMatrix=function(){var u=new h.A(4);return h.A!=Float32Array&&(u[1]=0,u[2]=0),u[0]=1,u[3]=1,u}(),function(u,d,m){var w=d[0],E=d[1],T=d[2],I=d[3],O=Math.sin(m),B=Math.cos(m);u[0]=w*B+T*O,u[1]=E*B+I*O,u[2]=w*-O+T*B,u[3]=E*-O+I*B}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(e){const a=h.ac(e,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==a&&(this._unmodified=!1,this._pitch=a,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const a=Math.min(Math.max(e,this.minZoom),this.maxZoom);this._zoom!==a&&(this._unmodified=!1,this._zoom=a,this.tileZoom=Math.max(0,Math.floor(a)),this.scale=this.zoomScale(a),this._constrain(),this._calcMatrices())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,a,u){this._unmodified=!1,this._edgeInsets.interpolate(e,a,u),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const a=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,a)}getVisibleUnwrappedCoordinates(e){const a=[new h.b4(0,e)];if(this._renderWorldCopies){const u=this.pointCoordinate(new h.P(0,0)),d=this.pointCoordinate(new h.P(this.width,0)),m=this.pointCoordinate(new h.P(this.width,this.height)),w=this.pointCoordinate(new h.P(0,this.height)),E=Math.floor(Math.min(u.x,d.x,m.x,w.x)),T=Math.floor(Math.max(u.x,d.x,m.x,w.x)),I=1;for(let O=E-I;O<=T+I;O++)O!==0&&a.push(new h.b4(O,e))}return a}coveringTiles(e){var a,u;let d=this.coveringZoomLevel(e);const m=d;if(e.minzoom!==void 0&&d<e.minzoom)return[];e.maxzoom!==void 0&&d>e.maxzoom&&(d=e.maxzoom);const w=this.pointCoordinate(this.getCameraPoint()),E=h.Z.fromLngLat(this.center),T=Math.pow(2,d),I=[T*w.x,T*w.y,0],O=[T*E.x,T*E.y,0],B=ho.fromInvProjectionMatrix(this.invModelViewProjectionMatrix,this.worldSize,d);let U=e.minzoom||0;!e.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(U=d);const Z=e.terrain?2/Math.min(this.tileSize,e.tileSize)*this.tileSize:3,G=X=>({aabb:new uo([X*T,0,0],[(X+1)*T,T,0]),zoom:0,x:0,y:0,wrap:X,fullyVisible:!1}),Q=[],ne=[],re=d,ae=e.reparseOverscaled?m:d;if(this._renderWorldCopies)for(let X=1;X<=3;X++)Q.push(G(-X)),Q.push(G(X));for(Q.push(G(0));Q.length>0;){const X=Q.pop(),he=X.x,pe=X.y;let ye=X.fullyVisible;if(!ye){const Be=X.aabb.intersects(B);if(Be===0)continue;ye=Be===2}const Me=e.terrain?I:O,De=X.aabb.distanceX(Me),$e=X.aabb.distanceY(Me),We=Math.max(Math.abs(De),Math.abs($e));if(X.zoom===re||We>Z+(1<<re-X.zoom)-2&&X.zoom>=U){const Be=re-X.zoom,Oe=I[0]-.5-(he<<Be),tt=I[1]-.5-(pe<<Be);ne.push({tileID:new h.S(X.zoom===re?ae:X.zoom,X.wrap,X.zoom,he,pe),distanceSq:St([O[0]-.5-he,O[1]-.5-pe]),tileDistanceToCamera:Math.sqrt(Oe*Oe+tt*tt)})}else for(let Be=0;Be<4;Be++){const Oe=(he<<1)+Be%2,tt=(pe<<1)+(Be>>1),_t=X.zoom+1;let Ne=X.aabb.quadrant(Be);if(e.terrain){const Ue=new h.S(_t,X.wrap,_t,Oe,tt),gt=e.terrain.getMinMaxElevation(Ue),mi=(a=gt.minElevation)!==null&&a!==void 0?a:this.elevation,Et=(u=gt.maxElevation)!==null&&u!==void 0?u:this.elevation;Ne=new uo([Ne.min[0],Ne.min[1],mi],[Ne.max[0],Ne.max[1],Et])}Q.push({aabb:Ne,zoom:_t,x:Oe,y:tt,wrap:X.wrap,fullyVisible:ye})}}return ne.sort((X,he)=>X.distanceSq-he.distanceSq).map(X=>X.tileID)}resize(e,a){this.width=e,this.height=a,this.pixelsToGLUnits=[2/e,-2/a],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(e){const a=h.ac(e.lat,-85.051129,Ac);return new h.P(h.O(e.lng)*this.worldSize,h.Q(a)*this.worldSize)}unproject(e){return new h.Z(e.x/this.worldSize,e.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(e){const a=this.elevation,u=Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter,d=this.pointLocation(this.centerPoint,e),m=e.getElevationForLngLatZoom(d,this.tileZoom);if(!(this.elevation-m))return;const w=u+a-m,E=Math.cos(this._pitch)*this.cameraToCenterDistance/w/h.b5(1,d.lat),T=this.scaleZoom(E/this.tileSize);this._elevation=m,this._center=d,this.zoom=T}setLocationAtPoint(e,a){const u=this.pointCoordinate(a),d=this.pointCoordinate(this.centerPoint),m=this.locationCoordinate(e),w=new h.Z(m.x-(u.x-d.x),m.y-(u.y-d.y));this.center=this.coordinateLocation(w),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,a){return a?this.coordinatePoint(this.locationCoordinate(e),a.getElevationForLngLatZoom(e,this.tileZoom),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,a){return this.coordinateLocation(this.pointCoordinate(e,a))}locationCoordinate(e){return h.Z.fromLngLat(e)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(e,a){if(a){const U=a.pointCoordinate(e);if(U!=null)return U}const u=[e.x,e.y,0,1],d=[e.x,e.y,1,1];h.af(u,u,this.pixelMatrixInverse),h.af(d,d,this.pixelMatrixInverse);const m=u[3],w=d[3],E=u[1]/m,T=d[1]/w,I=u[2]/m,O=d[2]/w,B=I===O?0:(0-I)/(O-I);return new h.Z(h.y.number(u[0]/m,d[0]/w,B)/this.worldSize,h.y.number(E,T,B)/this.worldSize)}coordinatePoint(e,a=0,u=this.pixelMatrix){const d=[e.x*this.worldSize,e.y*this.worldSize,a,1];return h.af(d,d,u),new h.P(d[0]/d[3],d[1]/d[3])}getBounds(){const e=Math.max(0,this.height/2-this.getHorizon());return new xe().extend(this.pointLocation(new h.P(0,e))).extend(this.pointLocation(new h.P(this.width,e))).extend(this.pointLocation(new h.P(this.width,this.height))).extend(this.pointLocation(new h.P(0,this.height)))}getMaxBounds(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new xe([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(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-85.051129,Ac])}calculateTileMatrix(e){const a=e.canonical,u=this.worldSize/this.zoomScale(a.z),d=a.x+Math.pow(2,a.z)*e.wrap,m=h.an(new Float64Array(16));return h.J(m,m,[d*u,a.y*u,0]),h.K(m,m,[u/h.X,u/h.X,1]),m}calculatePosMatrix(e,a=!1){const u=e.key,d=a?this._alignedPosMatrixCache:this._posMatrixCache;if(d[u])return d[u];const m=this.calculateTileMatrix(e);return h.L(m,a?this.alignedModelViewProjectionMatrix:this.modelViewProjectionMatrix,m),d[u]=new Float32Array(m),d[u]}calculateFogMatrix(e){const a=e.key,u=this._fogMatrixCache;if(u[a])return u[a];const d=this.calculateTileMatrix(e);return h.L(d,this.fogMatrix,d),u[a]=new Float32Array(d),u[a]}customLayerMatrix(){return this.mercatorMatrix.slice()}getConstrained(e,a){a=h.ac(+a,this.minZoom,this.maxZoom);const u={center:new h.N(e.lng,e.lat),zoom:a};let d=this.lngRange;if(!this._renderWorldCopies&&d===null){const X=179.9999999999;d=[-X,X]}const m=this.tileSize*this.zoomScale(u.zoom);let w=0,E=m,T=0,I=m,O=0,B=0;const{x:U,y:Z}=this.size;if(this.latRange){const X=this.latRange;w=h.Q(X[1])*m,E=h.Q(X[0])*m,E-w<Z&&(O=Z/(E-w))}d&&(T=h.b3(h.O(d[0])*m,0,m),I=h.b3(h.O(d[1])*m,0,m),I<T&&(I+=m),I-T<U&&(B=U/(I-T)));const{x:G,y:Q}=this.project.call({worldSize:m},e);let ne,re;const ae=Math.max(B||0,O||0);if(ae){const X=new h.P(B?(I+T)/2:G,O?(E+w)/2:Q);return u.center=this.unproject.call({worldSize:m},X).wrap(),u.zoom+=this.scaleZoom(ae),u}if(this.latRange){const X=Z/2;Q-X<w&&(re=w+X),Q+X>E&&(re=E-X)}if(d){const X=(T+I)/2;let he=G;this._renderWorldCopies&&(he=h.b3(G,X-m/2,X+m/2));const pe=U/2;he-pe<T&&(ne=T+pe),he+pe>I&&(ne=I-pe)}if(ne!==void 0||re!==void 0){const X=new h.P(ne??G,re??Q);u.center=this.unproject.call({worldSize:m},X).wrap()}return u}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;const e=this._unmodified,{center:a,zoom:u}=this.getConstrained(this.center,this.zoom);this.center=a,this.zoom=u,this._unmodified=e,this._constraining=!1}_calcMatrices(){if(!this.height)return;const e=this.centerOffset,a=this.point.x,u=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=h.b5(1,this.center.lat)*this.worldSize;let d=h.an(new Float64Array(16));h.K(d,d,[this.width/2,-this.height/2,1]),h.J(d,d,[1,-1,0]),this.labelPlaneMatrix=d,d=h.an(new Float64Array(16)),h.K(d,d,[1,-1,1]),h.J(d,d,[-1,-1,0]),h.K(d,d,[2/this.width,2/this.height,1]),this.glCoordMatrix=d;const m=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch),w=Math.min(this.elevation,this.minElevationForCurrentTile),E=m-w*this._pixelPerMeter/Math.cos(this._pitch),T=w<0?E:m,I=Math.PI/2+this._pitch,O=this._fov*(.5+e.y/this.height),B=Math.sin(O)*T/Math.sin(h.ac(Math.PI-I-O,.01,Math.PI-.01)),U=this.getHorizon(),Z=2*Math.atan(U/this.cameraToCenterDistance)*(.5+e.y/(2*U)),G=Math.sin(Z)*T/Math.sin(h.ac(Math.PI-I-Z,.01,Math.PI-.01)),Q=Math.min(B,G);this.farZ=1.01*(Math.cos(Math.PI/2-this._pitch)*Q+T),this.nearZ=this.height/50,d=new Float64Array(16),h.b6(d,this._fov,this.width/this.height,this.nearZ,this.farZ),d[8]=2*-e.x/this.width,d[9]=2*e.y/this.height,this.projectionMatrix=h.ae(d),h.K(d,d,[1,-1,1]),h.J(d,d,[0,0,-this.cameraToCenterDistance]),h.b7(d,d,this._pitch),h.ad(d,d,this.angle),h.J(d,d,[-a,-u,0]),this.mercatorMatrix=h.K([],d,[this.worldSize,this.worldSize,this.worldSize]),h.K(d,d,[1,1,this._pixelPerMeter]),this.pixelMatrix=h.L(new Float64Array(16),this.labelPlaneMatrix,d),h.J(d,d,[0,0,-this.elevation]),this.modelViewProjectionMatrix=d,this.invModelViewProjectionMatrix=h.as([],d),this.fogMatrix=new Float64Array(16),h.b6(this.fogMatrix,this._fov,this.width/this.height,m,this.farZ),this.fogMatrix[8]=2*-e.x/this.width,this.fogMatrix[9]=2*e.y/this.height,h.K(this.fogMatrix,this.fogMatrix,[1,-1,1]),h.J(this.fogMatrix,this.fogMatrix,[0,0,-this.cameraToCenterDistance]),h.b7(this.fogMatrix,this.fogMatrix,this._pitch),h.ad(this.fogMatrix,this.fogMatrix,this.angle),h.J(this.fogMatrix,this.fogMatrix,[-a,-u,0]),h.K(this.fogMatrix,this.fogMatrix,[1,1,this._pixelPerMeter]),h.J(this.fogMatrix,this.fogMatrix,[0,0,-this.elevation]),this.pixelMatrix3D=h.L(new Float64Array(16),this.labelPlaneMatrix,d);const ne=this.width%2/2,re=this.height%2/2,ae=Math.cos(this.angle),X=Math.sin(this.angle),he=a-Math.round(a)+ae*ne+X*re,pe=u-Math.round(u)+ae*re+X*ne,ye=new Float64Array(d);if(h.J(ye,ye,[he>.5?he-1:he,pe>.5?pe-1:pe,0]),this.alignedModelViewProjectionMatrix=ye,d=h.as(new Float64Array(16),this.pixelMatrix),!d)throw new Error("failed to invert matrix");this.pixelMatrixInverse=d,this._posMatrixCache={},this._alignedPosMatrixCache={},this._fogMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const e=this.pointCoordinate(new h.P(0,0)),a=[e.x*this.worldSize,e.y*this.worldSize,0,1];return h.af(a,a,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new h.P(0,e))}getCameraQueryGeometry(e){const a=this.getCameraPoint();if(e.length===1)return[e[0],a];{let u=a.x,d=a.y,m=a.x,w=a.y;for(const E of e)u=Math.min(u,E.x),d=Math.min(d,E.y),m=Math.max(m,E.x),w=Math.max(w,E.y);return[new h.P(u,d),new h.P(m,d),new h.P(m,w),new h.P(u,w),new h.P(u,d)]}}lngLatToCameraDepth(e,a){const u=this.locationCoordinate(e),d=[u.x*this.worldSize,u.y*this.worldSize,a,1];return h.af(d,d,this.modelViewProjectionMatrix),d[2]/d[3]}}function la(g,e){let a,u=!1,d=null,m=null;const w=()=>{d=null,u&&(g.apply(m,a),d=setTimeout(w,e),u=!1)};return(...E)=>(u=!0,m=this,a=E,d||w(),d)}class cl{constructor(e){this._getCurrentHash=()=>{const a=window.location.hash.replace("#","");if(this._hashName){let u;return a.split("&").map(d=>d.split("=")).forEach(d=>{d[0]===this._hashName&&(u=d)}),(u&&u[1]||"").split("/")}return a.split("/")},this._onHashChange=()=>{const a=this._getCurrentHash();if(a.length>=3&&!a.some(u=>isNaN(u))){const u=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(a[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+a[2],+a[1]],zoom:+a[0],bearing:u,pitch:+(a[4]||0)}),!0}return!1},this._updateHashUnthrottled=()=>{const a=window.location.href.replace(/(#.+)?$/,this.getHashString());window.history.replaceState(window.history.state,null,a)},this._removeHash=()=>{const a=this._getCurrentHash();if(a.length===0)return;const u=a.join("/");let d=u;d.split("&").length>0&&(d=d.split("&")[0]),this._hashName&&(d=`${this._hashName}=${u}`);let m=window.location.hash.replace(d,"");m.startsWith("#&")?m=m.slice(0,1)+m.slice(2):m==="#"&&(m="");let w=window.location.href.replace(/(#.+)?$/,m);w=w.replace("&&","&"),window.history.replaceState(window.history.state,null,w)},this._updateHash=la(this._updateHashUnthrottled,300),this._hashName=e&&encodeURIComponent(e)}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),this._removeHash(),delete this._map,this}getHashString(e){const a=this._map.getCenter(),u=Math.round(100*this._map.getZoom())/100,d=Math.ceil((u*Math.LN2+Math.log(512/360/.5))/Math.LN10),m=Math.pow(10,d),w=Math.round(a.lng*m)/m,E=Math.round(a.lat*m)/m,T=this._map.getBearing(),I=this._map.getPitch();let O="";if(O+=e?`/${w}/${E}/${u}`:`${u}/${E}/${w}`,(T||I)&&(O+="/"+Math.round(10*T)/10),I&&(O+=`/${Math.round(I)}`),this._hashName){const B=this._hashName;let U=!1;const Z=window.location.hash.slice(1).split("&").map(G=>{const Q=G.split("=")[0];return Q===B?(U=!0,`${Q}=${O}`):G}).filter(G=>G);return U||Z.push(`${B}=${O}`),`#${Z.join("&")}`}return`#${O}`}}const hl={linearity:.3,easing:h.b8(0,0,.3,1)},Dc=h.e({deceleration:2500,maxSpeed:1400},hl),hf=h.e({deceleration:20,maxSpeed:1400},hl),Ou=h.e({deceleration:1e3,maxSpeed:360},hl),ul=h.e({deceleration:1e3,maxSpeed:90},hl);class zc{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:R.now(),settings:e})}_drainInertiaBuffer(){const e=this._inertiaBuffer,a=R.now();for(;e.length>0&&a-e[0].time>160;)e.shift()}_onMoveEnd(e){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const a={zoom:0,bearing:0,pitch:0,pan:new h.P(0,0),pinchAround:void 0,around:void 0};for(const{settings:m}of this._inertiaBuffer)a.zoom+=m.zoomDelta||0,a.bearing+=m.bearingDelta||0,a.pitch+=m.pitchDelta||0,m.panDelta&&a.pan._add(m.panDelta),m.around&&(a.around=m.around),m.pinchAround&&(a.pinchAround=m.pinchAround);const u=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,d={};if(a.pan.mag()){const m=ha(a.pan.mag(),u,h.e({},Dc,e||{}));d.offset=a.pan.mult(m.amount/a.pan.mag()),d.center=this._map.transform.center,ca(d,m)}if(a.zoom){const m=ha(a.zoom,u,hf);d.zoom=this._map.transform.zoom+m.amount,ca(d,m)}if(a.bearing){const m=ha(a.bearing,u,Ou);d.bearing=this._map.transform.bearing+h.ac(m.amount,-179,179),ca(d,m)}if(a.pitch){const m=ha(a.pitch,u,ul);d.pitch=this._map.transform.pitch+m.amount,ca(d,m)}if(d.zoom||d.bearing){const m=a.pinchAround===void 0?a.around:a.pinchAround;d.around=m?this._map.unproject(m):this._map.getCenter()}return this.clear(),h.e(d,{noMoveStart:!0})}}function ca(g,e){(!g.duration||g.duration<e.duration)&&(g.duration=e.duration,g.easing=e.easing)}function ha(g,e,a){const{maxSpeed:u,linearity:d,deceleration:m}=a,w=h.ac(g*d/(e/1e3),-u,u),E=Math.abs(w)/(m*d);return{easing:a.easing,duration:1e3*E,amount:w*(E/2)}}class Yi extends h.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,a,u,d={}){const m=z.mousePos(a.getCanvas(),u),w=a.unproject(m);super(e,h.e({point:m,lngLat:w,originalEvent:u},d)),this._defaultPrevented=!1,this.target=a}}class Os extends h.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,a,u){const d=e==="touchend"?u.changedTouches:u.touches,m=z.touchPos(a.getCanvasContainer(),d),w=m.map(T=>a.unproject(T)),E=m.reduce((T,I,O,B)=>T.add(I.div(B.length)),new h.P(0,0));super(e,{points:m,point:E,lngLats:w,lngLat:a.unproject(E),originalEvent:u}),this._defaultPrevented=!1}}class Bu extends h.k{preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}constructor(e,a,u){super(e,{originalEvent:u}),this._defaultPrevented=!1}}class Fu{constructor(e,a){this._map=e,this._clickTolerance=a.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new Bu(e.type,this._map,e))}mousedown(e,a){return this._mousedownPos=a,this._firePreventable(new Yi(e.type,this._map,e))}mouseup(e){this._map.fire(new Yi(e.type,this._map,e))}click(e,a){this._mousedownPos&&this._mousedownPos.dist(a)>=this._clickTolerance||this._map.fire(new Yi(e.type,this._map,e))}dblclick(e){return this._firePreventable(new Yi(e.type,this._map,e))}mouseover(e){this._map.fire(new Yi(e.type,this._map,e))}mouseout(e){this._map.fire(new Yi(e.type,this._map,e))}touchstart(e){return this._firePreventable(new Os(e.type,this._map,e))}touchmove(e){this._map.fire(new Os(e.type,this._map,e))}touchend(e){this._map.fire(new Os(e.type,this._map,e))}touchcancel(e){this._map.fire(new Os(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class Mi{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new Yi(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new Yi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new Yi(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class or{constructor(e){this._map=e}get transform(){return this._map._requestedCameraState||this._map.transform}get center(){return{lng:this.transform.center.lng,lat:this.transform.center.lat}}get zoom(){return this.transform.zoom}get pitch(){return this.transform.pitch}get bearing(){return this.transform.bearing}unproject(e){return this.transform.pointLocation(h.P.convert(e),this._map.terrain)}}class An{constructor(e,a){this._map=e,this._tr=new or(e),this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=a.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,a){this.isEnabled()&&e.shiftKey&&e.button===0&&(z.disableDrag(),this._startPos=this._lastPos=a,this._active=!0)}mousemoveWindow(e,a){if(!this._active)return;const u=a;if(this._lastPos.equals(u)||!this._box&&u.dist(this._startPos)<this._clickTolerance)return;const d=this._startPos;this._lastPos=u,this._box||(this._box=z.create("div","maplibregl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair"),this._fireEvent("boxzoomstart",e));const m=Math.min(d.x,u.x),w=Math.max(d.x,u.x),E=Math.min(d.y,u.y),T=Math.max(d.y,u.y);z.setTransform(this._box,`translate(${m}px,${E}px)`),this._box.style.width=w-m+"px",this._box.style.height=T-E+"px"}mouseupWindow(e,a){if(!this._active||e.button!==0)return;const u=this._startPos,d=a;if(this.reset(),z.suppressClick(),u.x!==d.x||u.y!==d.y)return this._map.fire(new h.k("boxzoomend",{originalEvent:e})),{cameraAnimation:m=>m.fitScreenCoordinates(u,d,this._tr.bearing,{linear:!0})};this._fireEvent("boxzoomcancel",e)}keydown(e){this._active&&e.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair"),this._box&&(z.remove(this._box),this._box=null),z.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(e,a){return this._map.fire(new h.k(e,{originalEvent:a}))}}function ua(g,e){if(g.length!==e.length)throw new Error(`The number of touches and points are not equal - touches ${g.length}, points ${e.length}`);const a={};for(let u=0;u<g.length;u++)a[g[u].identifier]=e[u];return a}class Rc{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(e,a,u){(this.centroid||u.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=e.timeStamp),u.length===this.numTouches&&(this.centroid=function(d){const m=new h.P(0,0);for(const w of d)m._add(w);return m.div(d.length)}(a),this.touches=ua(u,a)))}touchmove(e,a,u){if(this.aborted||!this.centroid)return;const d=ua(u,a);for(const m in this.touches){const w=d[m];(!w||w.dist(this.touches[m])>30)&&(this.aborted=!0)}}touchend(e,a,u){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),u.length===0){const d=!this.aborted&&this.centroid;if(this.reset(),d)return d}}}class dl{constructor(e){this.singleTap=new Rc(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,a,u){this.singleTap.touchstart(e,a,u)}touchmove(e,a,u){this.singleTap.touchmove(e,a,u)}touchend(e,a,u){const d=this.singleTap.touchend(e,a,u);if(d){const m=e.timeStamp-this.lastTime<500,w=!this.lastTap||this.lastTap.dist(d)<30;if(m&&w||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=d,this.count===this.numTaps)return this.reset(),d}}}class mo{constructor(e){this._tr=new or(e),this._zoomIn=new dl({numTouches:1,numTaps:2}),this._zoomOut=new dl({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,a,u){this._zoomIn.touchstart(e,a,u),this._zoomOut.touchstart(e,a,u)}touchmove(e,a,u){this._zoomIn.touchmove(e,a,u),this._zoomOut.touchmove(e,a,u)}touchend(e,a,u){const d=this._zoomIn.touchend(e,a,u),m=this._zoomOut.touchend(e,a,u),w=this._tr;return d?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:E=>E.easeTo({duration:300,zoom:w.zoom+1,around:w.unproject(d)},{originalEvent:e})}):m?(this._active=!0,e.preventDefault(),setTimeout(()=>this.reset(),0),{cameraAnimation:E=>E.easeTo({duration:300,zoom:w.zoom-1,around:w.unproject(m)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Hr{constructor(e){this._enabled=!!e.enable,this._moveStateManager=e.moveStateManager,this._clickTolerance=e.clickTolerance||1,this._moveFunction=e.move,this._activateOnStart=!!e.activateOnStart,e.assignEvents(this),this.reset()}reset(e){this._active=!1,this._moved=!1,delete this._lastPoint,this._moveStateManager.endMove(e)}_move(...e){const a=this._moveFunction(...e);if(a.bearingDelta||a.pitchDelta||a.around||a.panDelta)return this._active=!0,a}dragStart(e,a){this.isEnabled()&&!this._lastPoint&&this._moveStateManager.isValidStartEvent(e)&&(this._moveStateManager.startMove(e),this._lastPoint=a.length?a[0]:a,this._activateOnStart&&this._lastPoint&&(this._active=!0))}dragMove(e,a){if(!this.isEnabled())return;const u=this._lastPoint;if(!u)return;if(e.preventDefault(),!this._moveStateManager.isValidMoveEvent(e))return void this.reset(e);const d=a.length?a[0]:a;return!this._moved&&d.dist(u)<this._clickTolerance?void 0:(this._moved=!0,this._lastPoint=d,this._move(u,d))}dragEnd(e){this.isEnabled()&&this._lastPoint&&this._moveStateManager.isValidEndEvent(e)&&(this._moved&&z.suppressClick(),this.reset(e))}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}getClickTolerance(){return this._clickTolerance}}const Lc={0:1,2:2};class pl{constructor(e){this._correctEvent=e.checkCorrectEvent}startMove(e){const a=z.mouseButton(e);this._eventButton=a}endMove(e){delete this._eventButton}isValidStartEvent(e){return this._correctEvent(e)}isValidMoveEvent(e){return!function(a,u){const d=Lc[u];return a.buttons===void 0||(a.buttons&d)!==d}(e,this._eventButton)}isValidEndEvent(e){return z.mouseButton(e)===this._eventButton}}class Oc{constructor(){this._firstTouch=void 0}_isOneFingerTouch(e){return e.targetTouches.length===1}_isSameTouchEvent(e){return e.targetTouches[0].identifier===this._firstTouch}startMove(e){this._firstTouch=e.targetTouches[0].identifier}endMove(e){delete this._firstTouch}isValidStartEvent(e){return this._isOneFingerTouch(e)}isValidMoveEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}isValidEndEvent(e){return this._isOneFingerTouch(e)&&this._isSameTouchEvent(e)}}const fl=g=>{g.mousedown=g.dragStart,g.mousemoveWindow=g.dragMove,g.mouseup=g.dragEnd,g.contextmenu=e=>{e.preventDefault()}},Bc=({enable:g,clickTolerance:e,bearingDegreesPerPixelMoved:a=.8})=>{const u=new pl({checkCorrectEvent:d=>z.mouseButton(d)===0&&d.ctrlKey||z.mouseButton(d)===2});return new Hr({clickTolerance:e,move:(d,m)=>({bearingDelta:(m.x-d.x)*a}),moveStateManager:u,enable:g,assignEvents:fl})},Fc=({enable:g,clickTolerance:e,pitchDegreesPerPixelMoved:a=-.5})=>{const u=new pl({checkCorrectEvent:d=>z.mouseButton(d)===0&&d.ctrlKey||z.mouseButton(d)===2});return new Hr({clickTolerance:e,move:(d,m)=>({pitchDelta:(m.y-d.y)*a}),moveStateManager:u,enable:g,assignEvents:fl})};class Bs{constructor(e,a){this._clickTolerance=e.clickTolerance||1,this._map=a,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new h.P(0,0)}_shouldBePrevented(e){return e<(this._map.cooperativeGestures.isEnabled()?2:1)}touchstart(e,a,u){return this._calculateTransform(e,a,u)}touchmove(e,a,u){if(this._active){if(!this._shouldBePrevented(u.length))return e.preventDefault(),this._calculateTransform(e,a,u);this._map.cooperativeGestures.notifyGestureBlocked("touch_pan",e)}}touchend(e,a,u){this._calculateTransform(e,a,u),this._active&&this._shouldBePrevented(u.length)&&this.reset()}touchcancel(){this.reset()}_calculateTransform(e,a,u){u.length>0&&(this._active=!0);const d=ua(u,a),m=new h.P(0,0),w=new h.P(0,0);let E=0;for(const I in d){const O=d[I],B=this._touches[I];B&&(m._add(O),w._add(O.sub(B)),E++,d[I]=O)}if(this._touches=d,this._shouldBePrevented(E)||!w.mag())return;const T=w.div(E);return this._sum._add(T),this._sum.mag()<this._clickTolerance?void 0:{around:m.div(E),panDelta:T}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class ml{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}touchstart(e,a,u){this._firstTwoTouches||u.length<2||(this._firstTwoTouches=[u[0].identifier,u[1].identifier],this._start([a[0],a[1]]))}touchmove(e,a,u){if(!this._firstTwoTouches)return;e.preventDefault();const[d,m]=this._firstTwoTouches,w=da(u,a,d),E=da(u,a,m);if(!w||!E)return;const T=this._aroundCenter?null:w.add(E).div(2);return this._move([w,E],T,e)}touchend(e,a,u){if(!this._firstTwoTouches)return;const[d,m]=this._firstTwoTouches,w=da(u,a,d),E=da(u,a,m);w&&E||(this._active&&z.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&e.around==="center"}disable(){this._enabled=!1,this.reset()}isEnabled(){return!!this._enabled}isActive(){return!!this._active}}function da(g,e,a){for(let u=0;u<g.length;u++)if(g[u].identifier===a)return e[u]}function Nc(g,e){return Math.log(g/e)/Math.LN2}class Vc extends ml{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,a){const u=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Nc(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Nc(this._distance,u),pinchAround:a}}}function $c(g,e){return 180*g.angleWith(e)/Math.PI}class jc extends ml{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,a,u){const d=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:$c(this._vector,d),pinchAround:a}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const a=25/(Math.PI*this._minDiameter)*360,u=$c(e,this._startVector);return Math.abs(u)<a}}function gl(g){return Math.abs(g.y)>Math.abs(g.x)}class go extends ml{constructor(e){super(),this._currentTouchCount=0,this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,a,u){super.touchstart(e,a,u),this._currentTouchCount=u.length}_start(e){this._lastPoints=e,gl(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,a,u){if(this._map.cooperativeGestures.isEnabled()&&this._currentTouchCount<3)return;const d=e[0].sub(this._lastPoints[0]),m=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(d,m,u.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(d.y+m.y)/2*-.5}):void 0}gestureBeginsVertically(e,a,u){if(this._valid!==void 0)return this._valid;const d=e.mag()>=2,m=a.mag()>=2;if(!d&&!m)return;if(!d||!m)return this._firstMove===void 0&&(this._firstMove=u),u-this._firstMove<100&&void 0;const w=e.y>0==a.y>0;return gl(e)&&gl(a)&&w}}const Nu={panStep:100,bearingStep:15,pitchStep:10};class Zn{constructor(e){this._tr=new or(e);const a=Nu;this._panStep=a.panStep,this._bearingStep=a.bearingStep,this._pitchStep=a.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let a=0,u=0,d=0,m=0,w=0;switch(e.keyCode){case 61:case 107:case 171:case 187:a=1;break;case 189:case 109:case 173:a=-1;break;case 37:e.shiftKey?u=-1:(e.preventDefault(),m=-1);break;case 39:e.shiftKey?u=1:(e.preventDefault(),m=1);break;case 38:e.shiftKey?d=1:(e.preventDefault(),w=-1);break;case 40:e.shiftKey?d=-1:(e.preventDefault(),w=1);break;default:return}return this._rotationDisabled&&(u=0,d=0),{cameraAnimation:E=>{const T=this._tr;E.easeTo({duration:300,easeId:"keyboardHandler",easing:Ir,zoom:a?Math.round(T.zoom)+a*(e.shiftKey?2:1):T.zoom,bearing:T.bearing+u*this._bearingStep,pitch:T.pitch+d*this._pitchStep,offset:[-m*this._panStep,-w*this._panStep],center:T.center},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Ir(g){return g*(2-g)}const Uc=4.000244140625;class ar{constructor(e,a){this._onTimeout=u=>{this._type="wheel",this._delta-=this._lastValue,this._active||this._start(u)},this._map=e,this._tr=new or(e),this._triggerRenderFrame=a,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||this._finishTimeout!==void 0}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=!!e&&e.around==="center")}disable(){this.isEnabled()&&(this._enabled=!1)}_shouldBePrevented(e){return!!this._map.cooperativeGestures.isEnabled()&&!(e.ctrlKey||this._map.cooperativeGestures.isBypassed(e))}wheel(e){if(!this.isEnabled())return;if(this._shouldBePrevented(e))return void this._map.cooperativeGestures.notifyGestureBlocked("wheel_zoom",e);let a=e.deltaMode===WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY;const u=R.now(),d=u-(this._lastWheelEventTime||0);this._lastWheelEventTime=u,a!==0&&a%Uc==0?this._type="wheel":a!==0&&Math.abs(a)<4?this._type="trackpad":d>400?(this._type=null,this._lastValue=a,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(d*a)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,a+=this._lastValue)),e.shiftKey&&a&&(a/=4),this._type&&(this._lastWheelEvent=e,this._delta-=a,this._active||this._start(e)),e.preventDefault()}_start(e){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const a=z.mousePos(this._map.getCanvas(),e),u=this._tr;this._around=a.y>u.transform.height/2-u.transform.getHorizon()?h.N.convert(this._aroundCenter?u.center:u.unproject(a)):h.N.convert(u.center),this._aroundPoint=u.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._triggerRenderFrame())}renderFrame(){if(!this._frameId||(this._frameId=null,!this.isActive()))return;const e=this._tr.transform;if(this._delta!==0){const T=this._type==="wheel"&&Math.abs(this._delta)>Uc?this._wheelZoomRate:this._defaultZoomRate;let I=2/(1+Math.exp(-Math.abs(this._delta*T)));this._delta<0&&I!==0&&(I=1/I);const O=typeof this._targetZoom=="number"?e.zoomScale(this._targetZoom):e.scale;this._targetZoom=Math.min(e.maxZoom,Math.max(e.minZoom,e.scaleZoom(O*I))),this._type==="wheel"&&(this._startZoom=e.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const a=typeof this._targetZoom=="number"?this._targetZoom:e.zoom,u=this._startZoom,d=this._easing;let m,w=!1;const E=R.now()-this._lastWheelEventTime;if(this._type==="wheel"&&u&&d&&E){const T=Math.min(E/200,1),I=d(T);m=h.y.number(u,a,I),T<1?this._frameId||(this._frameId=!0):w=!0}else m=a,w=!0;return this._active=!0,w&&(this._active=!1,this._finishTimeout=setTimeout(()=>{this._zooming=!1,this._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!w,zoomDelta:m-e.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(e){let a=h.b9;if(this._prevEase){const u=this._prevEase,d=(R.now()-u.start)/u.duration,m=u.easing(d+.01)-u.easing(d),w=.27/Math.sqrt(m*m+1e-4)*.01,E=Math.sqrt(.0729-w*w);a=h.b8(w,E,.25,1)}return this._prevEase={start:R.now(),duration:e,easing:a},a}reset(){this._active=!1,this._zooming=!1,delete this._targetZoom,this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout)}}class Fs{constructor(e,a){this._clickZoom=e,this._tapZoom=a}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 uf{constructor(e){this._tr=new or(e),this.reset()}reset(){this._active=!1}dblclick(e,a){return e.preventDefault(),{cameraAnimation:u=>{u.easeTo({duration:300,zoom:this._tr.zoom+(e.shiftKey?-1:1),around:this._tr.unproject(a)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class df{constructor(){this._tap=new dl({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,delete this._tapPoint,this._tap.reset()}touchstart(e,a,u){if(!this._swipePoint)if(this._tapTime){const d=a[0],m=e.timeStamp-this._tapTime<500,w=this._tapPoint.dist(d)<30;m&&w?u.length>0&&(this._swipePoint=d,this._swipeTouch=u[0].identifier):this.reset()}else this._tap.touchstart(e,a,u)}touchmove(e,a,u){if(this._tapTime){if(this._swipePoint){if(u[0].identifier!==this._swipeTouch)return;const d=a[0],m=d.y-this._swipePoint.y;return this._swipePoint=d,e.preventDefault(),this._active=!0,{zoomDelta:m/128}}}else this._tap.touchmove(e,a,u)}touchend(e,a,u){if(this._tapTime)this._swipePoint&&u.length===0&&this.reset();else{const d=this._tap.touchend(e,a,u);d&&(this._tapTime=e.timeStamp,this._tapPoint=d)}}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Vu{constructor(e,a,u){this._el=e,this._mousePan=a,this._touchPan=u}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class $u{constructor(e,a,u){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=a,this._mousePitch=u}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 Hc{constructor(e,a,u,d){this._el=e,this._touchZoom=a,this._touchRotate=u,this._tapDragZoom=d,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}class yo{constructor(e,a){this._bypassKey=navigator.userAgent.indexOf("Mac")!==-1?"metaKey":"ctrlKey",this._map=e,this._options=a,this._enabled=!1}isActive(){return!1}reset(){}_setupUI(){if(this._container)return;const e=this._map.getCanvasContainer();e.classList.add("maplibregl-cooperative-gestures"),this._container=z.create("div","maplibregl-cooperative-gesture-screen",e);let a=this._map._getUIString("CooperativeGesturesHandler.WindowsHelpText");this._bypassKey==="metaKey"&&(a=this._map._getUIString("CooperativeGesturesHandler.MacHelpText"));const u=this._map._getUIString("CooperativeGesturesHandler.MobileHelpText"),d=document.createElement("div");d.className="maplibregl-desktop-message",d.textContent=a,this._container.appendChild(d);const m=document.createElement("div");m.className="maplibregl-mobile-message",m.textContent=u,this._container.appendChild(m),this._container.setAttribute("aria-hidden","true")}_destroyUI(){this._container&&(z.remove(this._container),this._map.getCanvasContainer().classList.remove("maplibregl-cooperative-gestures")),delete this._container}enable(){this._setupUI(),this._enabled=!0}disable(){this._enabled=!1,this._destroyUI()}isEnabled(){return this._enabled}isBypassed(e){return e[this._bypassKey]}notifyGestureBlocked(e,a){this._enabled&&(this._map.fire(new h.k("cooperativegestureprevented",{gestureType:e,originalEvent:a})),this._container.classList.add("maplibregl-show"),setTimeout(()=>{this._container.classList.remove("maplibregl-show")},100))}}const Wn=g=>g.zoom||g.drag||g.pitch||g.rotate;class Xe extends h.k{}function yl(g){return g.panDelta&&g.panDelta.mag()||g.zoomDelta||g.bearingDelta||g.pitchDelta}class qc{constructor(e,a){this.handleWindowEvent=d=>{this.handleEvent(d,`${d.type}Window`)},this.handleEvent=(d,m)=>{if(d.type==="blur")return void this.stop(!0);this._updatingCamera=!0;const w=d.type==="renderFrame"?void 0:d,E={needsRenderFrame:!1},T={},I={},O=d.touches,B=O?this._getMapTouches(O):void 0,U=B?z.touchPos(this._map.getCanvas(),B):z.mousePos(this._map.getCanvas(),d);for(const{handlerName:Q,handler:ne,allowed:re}of this._handlers){if(!ne.isEnabled())continue;let ae;this._blockedByActive(I,re,Q)?ne.reset():ne[m||d.type]&&(ae=ne[m||d.type](d,U,B),this.mergeHandlerResult(E,T,ae,Q,w),ae&&ae.needsRenderFrame&&this._triggerRenderFrame()),(ae||ne.isActive())&&(I[Q]=ne)}const Z={};for(const Q in this._previousActiveHandlers)I[Q]||(Z[Q]=w);this._previousActiveHandlers=I,(Object.keys(Z).length||yl(E))&&(this._changes.push([E,T,Z]),this._triggerRenderFrame()),(Object.keys(I).length||yl(E))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:G}=E;G&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],G(this._map))},this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new zc(e),this._bearingSnap=a.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(a);const u=this._el;this._listeners=[[u,"touchstart",{passive:!0}],[u,"touchmove",{passive:!1}],[u,"touchend",void 0],[u,"touchcancel",void 0],[u,"mousedown",void 0],[u,"mousemove",void 0],[u,"mouseup",void 0],[document,"mousemove",{capture:!0}],[document,"mouseup",void 0],[u,"mouseover",void 0],[u,"mouseout",void 0],[u,"dblclick",void 0],[u,"click",void 0],[u,"keydown",{capture:!1}],[u,"keyup",void 0],[u,"wheel",{passive:!1}],[u,"contextmenu",void 0],[window,"blur",void 0]];for(const[d,m,w]of this._listeners)z.addEventListener(d,m,d===document?this.handleWindowEvent:this.handleEvent,w)}destroy(){for(const[e,a,u]of this._listeners)z.removeEventListener(e,a,e===document?this.handleWindowEvent:this.handleEvent,u)}_addDefaultHandlers(e){const a=this._map,u=a.getCanvasContainer();this._add("mapEvent",new Fu(a,e));const d=a.boxZoom=new An(a,e);this._add("boxZoom",d),e.interactive&&e.boxZoom&&d.enable();const m=a.cooperativeGestures=new yo(a,e.cooperativeGestures);this._add("cooperativeGestures",m),e.cooperativeGestures&&m.enable();const w=new mo(a),E=new uf(a);a.doubleClickZoom=new Fs(E,w),this._add("tapZoom",w),this._add("clickZoom",E),e.interactive&&e.doubleClickZoom&&a.doubleClickZoom.enable();const T=new df;this._add("tapDragZoom",T);const I=a.touchPitch=new go(a);this._add("touchPitch",I),e.interactive&&e.touchPitch&&a.touchPitch.enable(e.touchPitch);const O=Bc(e),B=Fc(e);a.dragRotate=new $u(e,O,B),this._add("mouseRotate",O,["mousePitch"]),this._add("mousePitch",B,["mouseRotate"]),e.interactive&&e.dragRotate&&a.dragRotate.enable();const U=(({enable:ae,clickTolerance:X})=>{const he=new pl({checkCorrectEvent:pe=>z.mouseButton(pe)===0&&!pe.ctrlKey});return new Hr({clickTolerance:X,move:(pe,ye)=>({around:ye,panDelta:ye.sub(pe)}),activateOnStart:!0,moveStateManager:he,enable:ae,assignEvents:fl})})(e),Z=new Bs(e,a);a.dragPan=new Vu(u,U,Z),this._add("mousePan",U),this._add("touchPan",Z,["touchZoom","touchRotate"]),e.interactive&&e.dragPan&&a.dragPan.enable(e.dragPan);const G=new jc,Q=new Vc;a.touchZoomRotate=new Hc(u,Q,G,T),this._add("touchRotate",G,["touchPan","touchZoom"]),this._add("touchZoom",Q,["touchPan","touchRotate"]),e.interactive&&e.touchZoomRotate&&a.touchZoomRotate.enable(e.touchZoomRotate);const ne=a.scrollZoom=new ar(a,()=>this._triggerRenderFrame());this._add("scrollZoom",ne,["mousePan"]),e.interactive&&e.scrollZoom&&a.scrollZoom.enable(e.scrollZoom);const re=a.keyboard=new Zn(a);this._add("keyboard",re),e.interactive&&e.keyboard&&a.keyboard.enable(),this._add("blockableMapEvent",new Mi(a))}_add(e,a,u){this._handlers.push({handlerName:e,handler:a,allowed:u}),this._handlersById[e]=a}stop(e){if(!this._updatingCamera){for(const{handler:a}of this._handlers)a.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return!!Wn(this._eventsInProgress)||this.isZooming()}_blockedByActive(e,a,u){for(const d in e)if(d!==u&&(!a||a.indexOf(d)<0))return!0;return!1}_getMapTouches(e){const a=[];for(const u of e)this._el.contains(u.target)&&a.push(u);return a}mergeHandlerResult(e,a,u,d,m){if(!u)return;h.e(e,u);const w={handlerName:d,originalEvent:u.originalEvent||m};u.zoomDelta!==void 0&&(a.zoom=w),u.panDelta!==void 0&&(a.drag=w),u.pitchDelta!==void 0&&(a.pitch=w),u.bearingDelta!==void 0&&(a.rotate=w)}_applyChanges(){const e={},a={},u={};for(const[d,m,w]of this._changes)d.panDelta&&(e.panDelta=(e.panDelta||new h.P(0,0))._add(d.panDelta)),d.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+d.zoomDelta),d.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+d.bearingDelta),d.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+d.pitchDelta),d.around!==void 0&&(e.around=d.around),d.pinchAround!==void 0&&(e.pinchAround=d.pinchAround),d.noInertia&&(e.noInertia=d.noInertia),h.e(a,m),h.e(u,w);this._updateMapTransform(e,a,u),this._changes=[]}_updateMapTransform(e,a,u){const d=this._map,m=d._getTransformForUpdate(),w=d.terrain;if(!(yl(e)||w&&this._terrainMovement))return this._fireEvents(a,u,!0);let{panDelta:E,zoomDelta:T,bearingDelta:I,pitchDelta:O,around:B,pinchAround:U}=e;U!==void 0&&(B=U),d._stop(!0),B=B||d.transform.centerPoint;const Z=m.pointLocation(E?B.sub(E):B);I&&(m.bearing+=I),O&&(m.pitch+=O),T&&(m.zoom+=T),w?this._terrainMovement||!a.drag&&!a.zoom?a.drag&&this._terrainMovement?m.center=m.pointLocation(m.centerPoint.sub(E)):m.setLocationAtPoint(Z,B):(this._terrainMovement=!0,this._map._elevationFreeze=!0,m.setLocationAtPoint(Z,B)):m.setLocationAtPoint(Z,B),d._applyUpdatedTransform(m),this._map._update(),e.noInertia||this._inertia.record(e),this._fireEvents(a,u,!0)}_fireEvents(e,a,u){const d=Wn(this._eventsInProgress),m=Wn(e),w={};for(const B in e){const{originalEvent:U}=e[B];this._eventsInProgress[B]||(w[`${B}start`]=U),this._eventsInProgress[B]=e[B]}!d&&m&&this._fireEvent("movestart",m.originalEvent);for(const B in w)this._fireEvent(B,w[B]);m&&this._fireEvent("move",m.originalEvent);for(const B in e){const{originalEvent:U}=e[B];this._fireEvent(B,U)}const E={};let T;for(const B in this._eventsInProgress){const{handlerName:U,originalEvent:Z}=this._eventsInProgress[B];this._handlersById[U].isActive()||(delete this._eventsInProgress[B],T=a[U]||Z,E[`${B}end`]=T)}for(const B in E)this._fireEvent(B,E[B]);const I=Wn(this._eventsInProgress),O=(d||m)&&!I;if(O&&this._terrainMovement){this._map._elevationFreeze=!1,this._terrainMovement=!1;const B=this._map._getTransformForUpdate();B.recalculateZoom(this._map.terrain),this._map._applyUpdatedTransform(B)}if(u&&O){this._updatingCamera=!0;const B=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),U=Z=>Z!==0&&-this._bearingSnap<Z&&Z<this._bearingSnap;!B||!B.essential&&R.prefersReducedMotion?(this._map.fire(new h.k("moveend",{originalEvent:T})),U(this._map.getBearing())&&this._map.resetNorth()):(U(B.bearing||this._map.getBearing())&&(B.bearing=0),B.freezeElevation=!0,this._map.easeTo(B,{originalEvent:T})),this._updatingCamera=!1}}_fireEvent(e,a){this._map.fire(new h.k(e,a?{originalEvent:a}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add(e=>{delete this._frameId,this.handleEvent(new Xe("renderFrame",{timeStamp:e})),this._applyChanges()})}_triggerRenderFrame(){this._frameId===void 0&&(this._frameId=this._requestFrame())}}class ju extends h.E{constructor(e,a){super(),this._renderFrameCallback=()=>{const u=Math.min((R.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(u)),u<1&&this._easeFrameId?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=a.bearingSnap,this.on("moveend",()=>{delete this._requestedCameraState})}getCenter(){return new h.N(this.transform.center.lng,this.transform.center.lat)}setCenter(e,a){return this.jumpTo({center:e},a)}panBy(e,a,u){return e=h.P.convert(e).mult(-1),this.panTo(this.transform.center,h.e({offset:e},a),u)}panTo(e,a,u){return this.easeTo(h.e({center:e},a),u)}getZoom(){return this.transform.zoom}setZoom(e,a){return this.jumpTo({zoom:e},a),this}zoomTo(e,a,u){return this.easeTo(h.e({zoom:e},a),u)}zoomIn(e,a){return this.zoomTo(this.getZoom()+1,e,a),this}zoomOut(e,a){return this.zoomTo(this.getZoom()-1,e,a),this}getBearing(){return this.transform.bearing}setBearing(e,a){return this.jumpTo({bearing:e},a),this}getPadding(){return this.transform.padding}setPadding(e,a){return this.jumpTo({padding:e},a),this}rotateTo(e,a,u){return this.easeTo(h.e({bearing:e},a),u)}resetNorth(e,a){return this.rotateTo(0,h.e({duration:1e3},e),a),this}resetNorthPitch(e,a){return this.easeTo(h.e({bearing:0,pitch:0,duration:1e3},e),a),this}snapToNorth(e,a){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,a):this}getPitch(){return this.transform.pitch}setPitch(e,a){return this.jumpTo({pitch:e},a),this}cameraForBounds(e,a){e=xe.convert(e).adjustAntiMeridian();const u=a&&a.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),u,a)}_cameraForBoxAndBearing(e,a,u,d){const m={top:0,bottom:0,right:0,left:0};if(typeof(d=h.e({padding:m,offset:[0,0],maxZoom:this.transform.maxZoom},d)).padding=="number"){const Be=d.padding;d.padding={top:Be,bottom:Be,right:Be,left:Be}}d.padding=h.e(m,d.padding);const w=this.transform,E=w.padding,T=new xe(e,a),I=w.project(T.getNorthWest()),O=w.project(T.getNorthEast()),B=w.project(T.getSouthEast()),U=w.project(T.getSouthWest()),Z=h.ba(-u),G=I.rotate(Z),Q=O.rotate(Z),ne=B.rotate(Z),re=U.rotate(Z),ae=new h.P(Math.max(G.x,Q.x,re.x,ne.x),Math.max(G.y,Q.y,re.y,ne.y)),X=new h.P(Math.min(G.x,Q.x,re.x,ne.x),Math.min(G.y,Q.y,re.y,ne.y)),he=ae.sub(X),pe=(w.width-(E.left+E.right+d.padding.left+d.padding.right))/he.x,ye=(w.height-(E.top+E.bottom+d.padding.top+d.padding.bottom))/he.y;if(ye<0||pe<0)return void h.w("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const Me=Math.min(w.scaleZoom(w.scale*Math.min(pe,ye)),d.maxZoom),De=h.P.convert(d.offset),$e=new h.P((d.padding.left-d.padding.right)/2,(d.padding.top-d.padding.bottom)/2).rotate(h.ba(u)),We=De.add($e).mult(w.scale/w.zoomScale(Me));return{center:w.unproject(I.add(B).div(2).sub(We)),zoom:Me,bearing:u}}fitBounds(e,a,u){return this._fitInternal(this.cameraForBounds(e,a),a,u)}fitScreenCoordinates(e,a,u,d,m){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(h.P.convert(e)),this.transform.pointLocation(h.P.convert(a)),u,d),d,m)}_fitInternal(e,a,u){return e?(delete(a=h.e(e,a)).padding,a.linear?this.easeTo(a,u):this.flyTo(a,u)):this}jumpTo(e,a){this.stop();const u=this._getTransformForUpdate();let d=!1,m=!1,w=!1;return"zoom"in e&&u.zoom!==+e.zoom&&(d=!0,u.zoom=+e.zoom),e.center!==void 0&&(u.center=h.N.convert(e.center)),"bearing"in e&&u.bearing!==+e.bearing&&(m=!0,u.bearing=+e.bearing),"pitch"in e&&u.pitch!==+e.pitch&&(w=!0,u.pitch=+e.pitch),e.padding==null||u.isPaddingEqual(e.padding)||(u.padding=e.padding),this._applyUpdatedTransform(u),this.fire(new h.k("movestart",a)).fire(new h.k("move",a)),d&&this.fire(new h.k("zoomstart",a)).fire(new h.k("zoom",a)).fire(new h.k("zoomend",a)),m&&this.fire(new h.k("rotatestart",a)).fire(new h.k("rotate",a)).fire(new h.k("rotateend",a)),w&&this.fire(new h.k("pitchstart",a)).fire(new h.k("pitch",a)).fire(new h.k("pitchend",a)),this.fire(new h.k("moveend",a))}calculateCameraOptionsFromTo(e,a,u,d=0){const m=h.Z.fromLngLat(e,a),w=h.Z.fromLngLat(u,d),E=w.x-m.x,T=w.y-m.y,I=w.z-m.z,O=Math.hypot(E,T,I);if(O===0)throw new Error("Can't calculate camera options with same From and To");const B=Math.hypot(E,T),U=this.transform.scaleZoom(this.transform.cameraToCenterDistance/O/this.transform.tileSize),Z=180*Math.atan2(E,-T)/Math.PI;let G=180*Math.acos(B/O)/Math.PI;return G=I<0?90-G:90+G,{center:w.toLngLat(),zoom:U,pitch:G,bearing:Z}}easeTo(e,a){var u;this._stop(!1,e.easeId),((e=h.e({offset:[0,0],duration:500,easing:h.b9},e)).animate===!1||!e.essential&&R.prefersReducedMotion)&&(e.duration=0);const d=this._getTransformForUpdate(),m=d.zoom,w=d.bearing,E=d.pitch,T=d.padding,I="bearing"in e?this._normalizeBearing(e.bearing,w):w,O="pitch"in e?+e.pitch:E,B="padding"in e?e.padding:d.padding,U=h.P.convert(e.offset);let Z=d.centerPoint.add(U);const G=d.pointLocation(Z),{center:Q,zoom:ne}=d.getConstrained(h.N.convert(e.center||G),(u=e.zoom)!==null&&u!==void 0?u:m);this._normalizeCenter(Q,d);const re=d.project(G),ae=d.project(Q).sub(re),X=d.zoomScale(ne-m);let he,pe;e.around&&(he=h.N.convert(e.around),pe=d.locationPoint(he));const ye={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||ne!==m,this._rotating=this._rotating||w!==I,this._pitching=this._pitching||O!==E,this._padding=!d.isPaddingEqual(B),this._easeId=e.easeId,this._prepareEase(a,e.noMoveStart,ye),this.terrain&&this._prepareElevation(Q),this._ease(Me=>{if(this._zooming&&(d.zoom=h.y.number(m,ne,Me)),this._rotating&&(d.bearing=h.y.number(w,I,Me)),this._pitching&&(d.pitch=h.y.number(E,O,Me)),this._padding&&(d.interpolatePadding(T,B,Me),Z=d.centerPoint.add(U)),this.terrain&&!e.freezeElevation&&this._updateElevation(Me),he)d.setLocationAtPoint(he,pe);else{const De=d.zoomScale(d.zoom-m),$e=ne>m?Math.min(2,X):Math.max(.5,X),We=Math.pow($e,1-Me),Be=d.unproject(re.add(ae.mult(Me*We)).mult(De));d.setLocationAtPoint(d.renderWorldCopies?Be.wrap():Be,Z)}this._applyUpdatedTransform(d),this._fireMoveEvents(a)},Me=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(a,Me)},e),this}_prepareEase(e,a,u={}){this._moving=!0,a||u.moving||this.fire(new h.k("movestart",e)),this._zooming&&!u.zooming&&this.fire(new h.k("zoomstart",e)),this._rotating&&!u.rotating&&this.fire(new h.k("rotatestart",e)),this._pitching&&!u.pitching&&this.fire(new h.k("pitchstart",e))}_prepareElevation(e){this._elevationCenter=e,this._elevationStart=this.transform.elevation,this._elevationTarget=this.terrain.getElevationForLngLatZoom(e,this.transform.tileZoom),this._elevationFreeze=!0}_updateElevation(e){this.transform.minElevationForCurrentTile=this.terrain.getMinTileElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);const a=this.terrain.getElevationForLngLatZoom(this._elevationCenter,this.transform.tileZoom);if(e<1&&a!==this._elevationTarget){const u=this._elevationTarget-this._elevationStart;this._elevationStart+=e*(u-(a-(u*e+this._elevationStart))/(1-e)),this._elevationTarget=a}this.transform.elevation=h.y.number(this._elevationStart,this._elevationTarget,e)}_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(e){const a=e.getCameraPosition(),u=this.terrain.getElevationForLngLatZoom(a.lngLat,e.zoom);if(a.altitude<u){const d=this.calculateCameraOptionsFromTo(a.lngLat,u,e.center,e.elevation);return{pitch:d.pitch,zoom:d.zoom}}return{}}_applyUpdatedTransform(e){const a=[];if(this.terrain&&a.push(d=>this._elevateCameraIfInsideTerrain(d)),this.transformCameraUpdate&&a.push(d=>this.transformCameraUpdate(d)),!a.length)return;const u=e.clone();for(const d of a){const m=u.clone(),{center:w,zoom:E,pitch:T,bearing:I,elevation:O}=d(m);w&&(m.center=w),E!==void 0&&(m.zoom=E),T!==void 0&&(m.pitch=T),I!==void 0&&(m.bearing=I),O!==void 0&&(m.elevation=O),u.apply(m)}this.transform.apply(u)}_fireMoveEvents(e){this.fire(new h.k("move",e)),this._zooming&&this.fire(new h.k("zoom",e)),this._rotating&&this.fire(new h.k("rotate",e)),this._pitching&&this.fire(new h.k("pitch",e))}_afterEase(e,a){if(this._easeId&&a&&this._easeId===a)return;delete this._easeId;const u=this._zooming,d=this._rotating,m=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,u&&this.fire(new h.k("zoomend",e)),d&&this.fire(new h.k("rotateend",e)),m&&this.fire(new h.k("pitchend",e)),this.fire(new h.k("moveend",e))}flyTo(e,a){var u;if(!e.essential&&R.prefersReducedMotion){const Ue=h.M(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(Ue,a)}this.stop(),e=h.e({offset:[0,0],speed:1.2,curve:1.42,easing:h.b9},e);const d=this._getTransformForUpdate(),m=d.zoom,w=d.bearing,E=d.pitch,T=d.padding,I="bearing"in e?this._normalizeBearing(e.bearing,w):w,O="pitch"in e?+e.pitch:E,B="padding"in e?e.padding:d.padding,U=h.P.convert(e.offset);let Z=d.centerPoint.add(U);const G=d.pointLocation(Z),{center:Q,zoom:ne}=d.getConstrained(h.N.convert(e.center||G),(u=e.zoom)!==null&&u!==void 0?u:m);this._normalizeCenter(Q,d);const re=d.zoomScale(ne-m),ae=d.project(G),X=d.project(Q).sub(ae);let he=e.curve;const pe=Math.max(d.width,d.height),ye=pe/re,Me=X.mag();if("minZoom"in e){const Ue=h.ac(Math.min(e.minZoom,m,ne),d.minZoom,d.maxZoom),gt=pe/d.zoomScale(Ue-m);he=Math.sqrt(gt/Me*2)}const De=he*he;function $e(Ue){const gt=(ye*ye-pe*pe+(Ue?-1:1)*De*De*Me*Me)/(2*(Ue?ye:pe)*De*Me);return Math.log(Math.sqrt(gt*gt+1)-gt)}function We(Ue){return(Math.exp(Ue)-Math.exp(-Ue))/2}function Be(Ue){return(Math.exp(Ue)+Math.exp(-Ue))/2}const Oe=$e(!1);let tt=function(Ue){return Be(Oe)/Be(Oe+he*Ue)},_t=function(Ue){return pe*((Be(Oe)*(We(gt=Oe+he*Ue)/Be(gt))-We(Oe))/De)/Me;var gt},Ne=($e(!0)-Oe)/he;if(Math.abs(Me)<1e-6||!isFinite(Ne)){if(Math.abs(pe-ye)<1e-6)return this.easeTo(e,a);const Ue=ye<pe?-1:1;Ne=Math.abs(Math.log(ye/pe))/he,_t=()=>0,tt=gt=>Math.exp(Ue*he*gt)}return e.duration="duration"in e?+e.duration:1e3*Ne/("screenSpeed"in e?+e.screenSpeed/he:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=w!==I,this._pitching=O!==E,this._padding=!d.isPaddingEqual(B),this._prepareEase(a,!1),this.terrain&&this._prepareElevation(Q),this._ease(Ue=>{const gt=Ue*Ne,mi=1/tt(gt);d.zoom=Ue===1?ne:m+d.scaleZoom(mi),this._rotating&&(d.bearing=h.y.number(w,I,Ue)),this._pitching&&(d.pitch=h.y.number(E,O,Ue)),this._padding&&(d.interpolatePadding(T,B,Ue),Z=d.centerPoint.add(U)),this.terrain&&!e.freezeElevation&&this._updateElevation(Ue);const Et=Ue===1?Q:d.unproject(ae.add(X.mult(_t(gt))).mult(mi));d.setLocationAtPoint(d.renderWorldCopies?Et.wrap():Et,Z),this._applyUpdatedTransform(d),this._fireMoveEvents(a)},()=>{this.terrain&&e.freezeElevation&&this._finalizeElevation(),this._afterEase(a)},e),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,a){var u;if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const d=this._onEaseEnd;delete this._onEaseEnd,d.call(this,a)}return e||(u=this.handlers)===null||u===void 0||u.stop(!1),this}_ease(e,a,u){u.animate===!1||u.duration===0?(e(1),a()):(this._easeStart=R.now(),this._easeOptions=u,this._onEaseFrame=e,this._onEaseEnd=a,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_normalizeBearing(e,a){e=h.b3(e,-180,180);const u=Math.abs(e-a);return Math.abs(e-360-a)<u&&(e-=360),Math.abs(e+360-a)<u&&(e+=360),e}_normalizeCenter(e,a){if(!a.renderWorldCopies||a.lngRange)return;const u=e.lng-a.center.lng;e.lng+=u>180?-360:u<-180?360:0}queryTerrainElevation(e){return this.terrain?this.terrain.getElevationForLngLatZoom(h.N.convert(e),this.transform.tileZoom)-this.transform.elevation:null}}const _o={compact:!0,customAttribution:'<a href="https://maplibre.org/" target="_blank">MapLibre</a>'};class xo{constructor(e=_o){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=a=>{!a||a.sourceDataType!=="metadata"&&a.sourceDataType!=="visibility"&&a.dataType!=="style"&&a.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=e}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options.compact,this._container=z.create("details","maplibregl-ctrl maplibregl-ctrl-attrib"),this._compactButton=z.create("summary","maplibregl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=z.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(){z.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,a){const u=this._map._getUIString(`AttributionControl.${a}`);e.title=u,e.setAttribute("aria-label",u)}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map(d=>typeof d!="string"?"":d)):typeof this.options.customAttribution=="string"&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const d=this._map.style.stylesheet;this.styleOwner=d.owner,this.styleId=d.id}const a=this._map.style.sourceCaches;for(const d in a){const m=a[d];if(m.used||m.usedForTerrain){const w=m.getSource();w.attribution&&e.indexOf(w.attribution)<0&&e.push(w.attribution)}}e=e.filter(d=>String(d).trim()),e.sort((d,m)=>d.length-m.length),e=e.filter((d,m)=>{for(let w=m+1;w<e.length;w++)if(e[w].indexOf(d)>=0)return!1;return!0});const u=e.join(" | ");u!==this._attribHTML&&(this._attribHTML=u,e.length?(this._innerContainer.innerHTML=u,this._container.classList.remove("maplibregl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty"),this._updateCompact(),this._editLink=null)}}class Zc{constructor(e={}){this._updateCompact=()=>{const a=this._container.children;if(a.length){const u=a[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?this._compact!==!1&&u.classList.add("maplibregl-compact"):u.classList.remove("maplibregl-compact")}},this.options=e}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=z.create("div","maplibregl-ctrl");const a=z.create("a","maplibregl-ctrl-logo");return a.target="_blank",a.rel="noopener nofollow",a.href="https://maplibre.org/",a.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),a.setAttribute("rel","noopener nofollow"),this._container.appendChild(a),this._container.style.display="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){z.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}}class Ot{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const a=++this._id;return this._queue.push({callback:e,id:a,cancelled:!1}),a}remove(e){const a=this._currentlyRunning,u=a?this._queue.concat(a):this._queue;for(const d of u)if(d.id===e)return void(d.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const a=this._currentlyRunning=this._queue;this._queue=[];for(const u of a)if(!u.cancelled&&(u.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}var Wc=h.Y([{name:"a_pos3d",type:"Int16",components:3}]);class pf extends h.E{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null}update(e,a){this.sourceCache.update(e,a),this._renderableTilesKeys=[];const u={};for(const d of e.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:a}))u[d.key]=!0,this._renderableTilesKeys.push(d.key),this._tiles[d.key]||(d.posMatrix=new Float64Array(16),h.aP(d.posMatrix,0,h.X,0,h.X,0,1),this._tiles[d.key]=new ns(d,this.tileSize));for(const d in this._tiles)u[d]||delete this._tiles[d]}freeRtt(e){for(const a in this._tiles){const u=this._tiles[a];(!e||u.tileID.equals(e)||u.tileID.isChildOf(e)||e.isChildOf(u.tileID))&&(u.rtt=[])}}getRenderableTiles(){return this._renderableTilesKeys.map(e=>this.getTileByID(e))}getTileByID(e){return this._tiles[e]}getTerrainCoords(e){const a={};for(const u of this._renderableTilesKeys){const d=this._tiles[u].tileID;if(d.canonical.equals(e.canonical)){const m=e.clone();m.posMatrix=new Float64Array(16),h.aP(m.posMatrix,0,h.X,0,h.X,0,1),a[u]=m}else if(d.canonical.isChildOf(e.canonical)){const m=e.clone();m.posMatrix=new Float64Array(16);const w=d.canonical.z-e.canonical.z,E=d.canonical.x-(d.canonical.x>>w<<w),T=d.canonical.y-(d.canonical.y>>w<<w),I=h.X>>w;h.aP(m.posMatrix,0,I,0,I,0,1),h.J(m.posMatrix,m.posMatrix,[-E*I,-T*I,0]),a[u]=m}else if(e.canonical.isChildOf(d.canonical)){const m=e.clone();m.posMatrix=new Float64Array(16);const w=e.canonical.z-d.canonical.z,E=e.canonical.x-(e.canonical.x>>w<<w),T=e.canonical.y-(e.canonical.y>>w<<w),I=h.X>>w;h.aP(m.posMatrix,0,h.X,0,h.X,0,1),h.J(m.posMatrix,m.posMatrix,[E*I,T*I,0]),h.K(m.posMatrix,m.posMatrix,[1/2**w,1/2**w,0]),a[u]=m}}return a}getSourceTile(e,a){const u=this.sourceCache._source;let d=e.overscaledZ-this.deltaZoom;if(d>u.maxzoom&&(d=u.maxzoom),d<u.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(d).key);let m=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!m||!m.dem)&&a)for(;d>=u.minzoom&&(!m||!m.dem);)m=this.sourceCache.getTileByID(e.scaledTo(d--).key);return m}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter(a=>a.timeAdded>=e)}}class Gc{constructor(e,a,u){this.painter=e,this.sourceCache=new pf(a),this.options=u,this.exaggeration=typeof u.exaggeration=="number"?u.exaggeration:1,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024}getDEMElevation(e,a,u,d=h.X){var m;if(!(a>=0&&a<d&&u>=0&&u<d))return 0;const w=this.getTerrainData(e),E=(m=w.tile)===null||m===void 0?void 0:m.dem;if(!E)return 0;const T=function(G,Q,ne){var re=Q[0],ae=Q[1];return G[0]=ne[0]*re+ne[4]*ae+ne[12],G[1]=ne[1]*re+ne[5]*ae+ne[13],G}([],[a/d*h.X,u/d*h.X],w.u_terrain_matrix),I=[T[0]*E.dim,T[1]*E.dim],O=Math.floor(I[0]),B=Math.floor(I[1]),U=I[0]-O,Z=I[1]-B;return E.get(O,B)*(1-U)*(1-Z)+E.get(O+1,B)*U*(1-Z)+E.get(O,B+1)*(1-U)*Z+E.get(O+1,B+1)*U*Z}getElevationForLngLatZoom(e,a){if(!h.bb(a,e.wrap()))return 0;const{tileID:u,mercatorX:d,mercatorY:m}=this._getOverscaledTileIDFromLngLatZoom(e,a);return this.getElevation(u,d%h.X,m%h.X,h.X)}getElevation(e,a,u,d=h.X){return this.getDEMElevation(e,a,u,d)*this.exaggeration}getTerrainData(e){if(!this._emptyDemTexture){const d=this.painter.context,m=new h.R({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new Ct(d,m,d.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new Ct(d,new h.R({width:1,height:1}),d.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(d.gl.NEAREST,d.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=h.an([])}const a=this.sourceCache.getSourceTile(e,!0);if(a&&a.dem&&(!a.demTexture||a.needsTerrainPrepare)){const d=this.painter.context;a.demTexture=this.painter.getTileTexture(a.dem.stride),a.demTexture?a.demTexture.update(a.dem.getPixels(),{premultiply:!1}):a.demTexture=new Ct(d,a.dem.getPixels(),d.gl.RGBA,{premultiply:!1}),a.demTexture.bind(d.gl.NEAREST,d.gl.CLAMP_TO_EDGE),a.needsTerrainPrepare=!1}const u=a&&a+a.tileID.key+e.key;if(u&&!this._demMatrixCache[u]){const d=this.sourceCache.sourceCache._source.maxzoom;let m=e.canonical.z-a.tileID.canonical.z;e.overscaledZ>e.canonical.z&&(e.canonical.z>=d?m=e.canonical.z-d:h.w("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const w=e.canonical.x-(e.canonical.x>>m<<m),E=e.canonical.y-(e.canonical.y>>m<<m),T=h.bc(new Float64Array(16),[1/(h.X<<m),1/(h.X<<m),0]);h.J(T,T,[w*h.X,E*h.X,0]),this._demMatrixCache[e.key]={matrix:T,coord:e}}return{u_depth:2,u_terrain:3,u_terrain_dim:a&&a.dem&&a.dem.dim||1,u_terrain_matrix:u?this._demMatrixCache[e.key].matrix:this._emptyDemMatrix,u_terrain_unpack:a&&a.dem&&a.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_exaggeration:this.exaggeration,texture:(a&&a.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:a}}getFramebuffer(e){const a=this.painter,u=a.width/devicePixelRatio,d=a.height/devicePixelRatio;return!this._fbo||this._fbo.width===u&&this._fbo.height===d||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new Ct(a.context,{width:u,height:d,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new Ct(a.context,{width:u,height:d,data:null},a.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(a.context.gl.NEAREST,a.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=a.context.createFramebuffer(u,d,!0,!1),this._fbo.depthAttachment.set(a.context.createRenderbuffer(a.context.gl.DEPTH_COMPONENT16,u,d))),this._fbo.colorAttachment.set(e==="coords"?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const e=this.painter.context;if(this._coordsTexture)return this._coordsTexture;const a=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let m=0,w=0;m<this._coordsTextureSize;m++)for(let E=0;E<this._coordsTextureSize;E++,w+=4)a[w+0]=255&E,a[w+1]=255&m,a[w+2]=E>>8<<4|m>>8,a[w+3]=0;const u=new h.R({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(a.buffer)),d=new Ct(e,u,e.gl.RGBA,{premultiply:!1});return d.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),this._coordsTexture=d,d}pointCoordinate(e){this.painter.maybeDrawDepthAndCoords(!0);const a=new Uint8Array(4),u=this.painter.context,d=u.gl,m=Math.round(e.x*this.painter.pixelRatio/devicePixelRatio),w=Math.round(e.y*this.painter.pixelRatio/devicePixelRatio),E=Math.round(this.painter.height/devicePixelRatio);u.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),d.readPixels(m,E-w-1,1,1,d.RGBA,d.UNSIGNED_BYTE,a),u.bindFramebuffer.set(null);const T=a[0]+(a[2]>>4<<8),I=a[1]+((15&a[2])<<8),O=this.coordsIndex[255-a[3]],B=O&&this.sourceCache.getTileByID(O);if(!B)return null;const U=this._coordsTextureSize,Z=(1<<B.tileID.canonical.z)*U;return new h.Z((B.tileID.canonical.x*U+T)/Z+B.tileID.wrap,(B.tileID.canonical.y*U+I)/Z,this.getElevation(B.tileID,T,I,U))}depthAtPoint(e){const a=new Uint8Array(4),u=this.painter.context,d=u.gl;return u.bindFramebuffer.set(this.getFramebuffer("depth").framebuffer),d.readPixels(e.x,this.painter.height/devicePixelRatio-e.y-1,1,1,d.RGBA,d.UNSIGNED_BYTE,a),u.bindFramebuffer.set(null),(a[0]/16777216+a[1]/65536+a[2]/256+a[3])/256}getTerrainMesh(){if(this._mesh)return this._mesh;const e=this.painter.context,a=new h.bd,u=new h.aY,d=this.meshSize,m=h.X/d,w=d*d;for(let B=0;B<=d;B++)for(let U=0;U<=d;U++)a.emplaceBack(U*m,B*m,0);for(let B=0;B<w;B+=d+1)for(let U=0;U<d;U++)u.emplaceBack(U+B,d+U+B+1,d+U+B+2),u.emplaceBack(U+B,d+U+B+2,U+B+1);const E=a.length,T=E+2*(d+1);for(const B of[0,1])for(let U=0;U<=d;U++)for(const Z of[0,1])a.emplaceBack(U*m,B*h.X,Z);for(let B=0;B<2*d;B+=2)u.emplaceBack(T+B,T+B+1,T+B+3),u.emplaceBack(T+B,T+B+3,T+B+2),u.emplaceBack(E+B,E+B+3,E+B+1),u.emplaceBack(E+B,E+B+2,E+B+3);const I=a.length,O=I+2*(d+1);for(const B of[0,1])for(let U=0;U<=d;U++)for(const Z of[0,1])a.emplaceBack(B*h.X,U*m,Z);for(let B=0;B<2*d;B+=2)u.emplaceBack(I+B,I+B+1,I+B+3),u.emplaceBack(I+B,I+B+3,I+B+2),u.emplaceBack(O+B,O+B+3,O+B+1),u.emplaceBack(O+B,O+B+2,O+B+3);return this._mesh=new al(e.createVertexBuffer(a,Wc.members),e.createIndexBuffer(u),h.a0.simpleSegment(0,0,a.length,u.length)),this._mesh}getMeshFrameDelta(e){return 2*Math.PI*h.be/Math.pow(2,e)/5}getMinTileElevationForLngLatZoom(e,a){var u;const{tileID:d}=this._getOverscaledTileIDFromLngLatZoom(e,a);return(u=this.getMinMaxElevation(d).minElevation)!==null&&u!==void 0?u:0}getMinMaxElevation(e){const a=this.getTerrainData(e).tile,u={minElevation:null,maxElevation:null};return a&&a.dem&&(u.minElevation=a.dem.min*this.exaggeration,u.maxElevation=a.dem.max*this.exaggeration),u}_getOverscaledTileIDFromLngLatZoom(e,a){const u=h.Z.fromLngLat(e.wrap()),d=(1<<a)*h.X,m=u.x*d,w=u.y*d,E=Math.floor(m/h.X),T=Math.floor(w/h.X);return{tileID:new h.S(a,0,a,E,T),mercatorX:m,mercatorY:w}}}class ff{constructor(e,a,u){this._context=e,this._size=a,this._tileSize=u,this._objects=[],this._recentlyUsed=[],this._stamp=0}destruct(){for(const e of this._objects)e.texture.destroy(),e.fbo.destroy()}_createObject(e){const a=this._context.createFramebuffer(this._tileSize,this._tileSize,!0,!0),u=new Ct(this._context,{width:this._tileSize,height:this._tileSize,data:null},this._context.gl.RGBA);return u.bind(this._context.gl.LINEAR,this._context.gl.CLAMP_TO_EDGE),a.depthAttachment.set(this._context.createRenderbuffer(this._context.gl.DEPTH_STENCIL,this._tileSize,this._tileSize)),a.colorAttachment.set(u.texture),{id:e,fbo:a,texture:u,stamp:-1,inUse:!1}}getObjectForId(e){return this._objects[e]}useObject(e){e.inUse=!0,this._recentlyUsed=this._recentlyUsed.filter(a=>e.id!==a),this._recentlyUsed.push(e.id)}stampObject(e){e.stamp=++this._stamp}getOrCreateFreeObject(){for(const a of this._recentlyUsed)if(!this._objects[a].inUse)return this._objects[a];if(this._objects.length>=this._size)throw new Error("No free RenderPool available, call freeAllObjects() required!");const e=this._createObject(this._objects.length);return this._objects.push(e),e}freeObject(e){e.inUse=!1}freeAllObjects(){for(const e of this._objects)this.freeObject(e)}isFull(){return!(this._objects.length<this._size)&&this._objects.some(e=>!e.inUse)===!1}}const bo={background:!0,fill:!0,line:!0,raster:!0,hillshade:!0};class Uu{constructor(e,a){this.painter=e,this.terrain=a,this.pool=new ff(e.context,30,a.sourceCache.tileSize*a.qualityFactor)}destruct(){this.pool.destruct()}getTexture(e){return this.pool.getObjectForId(e.rtt[this._stacks.length-1].id).texture}prepareForRender(e,a){this._stacks=[],this._prevType=null,this._rttTiles=[],this._renderableTiles=this.terrain.sourceCache.getRenderableTiles(),this._renderableLayerIds=e._order.filter(u=>!e._layers[u].isHidden(a)),this._coordsDescendingInv={};for(const u in e.sourceCaches){this._coordsDescendingInv[u]={};const d=e.sourceCaches[u].getVisibleCoordinates();for(const m of d){const w=this.terrain.sourceCache.getTerrainCoords(m);for(const E in w)this._coordsDescendingInv[u][E]||(this._coordsDescendingInv[u][E]=[]),this._coordsDescendingInv[u][E].push(w[E])}}this._coordsDescendingInvStr={};for(const u of e._order){const d=e._layers[u],m=d.source;if(bo[d.type]&&!this._coordsDescendingInvStr[m]){this._coordsDescendingInvStr[m]={};for(const w in this._coordsDescendingInv[m])this._coordsDescendingInvStr[m][w]=this._coordsDescendingInv[m][w].map(E=>E.key).sort().join()}}for(const u of this._renderableTiles)for(const d in this._coordsDescendingInvStr){const m=this._coordsDescendingInvStr[d][u.tileID.key];m&&m!==u.rttCoords[d]&&(u.rtt=[])}}renderLayer(e){if(e.isHidden(this.painter.transform.zoom))return!1;const a=e.type,u=this.painter,d=this._renderableLayerIds[this._renderableLayerIds.length-1]===e.id;if(bo[a]&&(this._prevType&&bo[this._prevType]||this._stacks.push([]),this._prevType=a,this._stacks[this._stacks.length-1].push(e.id),!d))return!0;if(bo[this._prevType]||bo[a]&&d){this._prevType=a;const m=this._stacks.length-1,w=this._stacks[m]||[];for(const E of this._renderableTiles){if(this.pool.isFull()&&(Lu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects()),this._rttTiles.push(E),E.rtt[m]){const I=this.pool.getObjectForId(E.rtt[m].id);if(I.stamp===E.rtt[m].stamp){this.pool.useObject(I);continue}}const T=this.pool.getOrCreateFreeObject();this.pool.useObject(T),this.pool.stampObject(T),E.rtt[m]={id:T.id,stamp:T.stamp},u.context.bindFramebuffer.set(T.fbo.framebuffer),u.context.clear({color:h.aM.transparent,stencil:0}),u.currentStencilSource=void 0;for(let I=0;I<w.length;I++){const O=u.style._layers[w[I]],B=O.source?this._coordsDescendingInv[O.source][E.tileID.key]:[E.tileID];u.context.viewport.set([0,0,T.fbo.width,T.fbo.height]),u._renderTileClippingMasks(O,B),u.renderLayer(u,u.style.sourceCaches[O.source],O,B),O.source&&(E.rttCoords[O.source]=this._coordsDescendingInvStr[O.source][E.tileID.key])}}return Lu(this.painter,this.terrain,this._rttTiles),this._rttTiles=[],this.pool.freeAllObjects(),bo[a]}return!1}}const Yc={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"MapLibre logo","Map.Title":"Map","Marker.Title":"Map marker","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","Popup.Close":"Close popup","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm","TerrainControl.Enable":"Enable terrain","TerrainControl.Disable":"Disable terrain","CooperativeGesturesHandler.WindowsHelpText":"Use Ctrl + scroll to zoom the map","CooperativeGesturesHandler.MacHelpText":"Use ⌘ + scroll to zoom the map","CooperativeGesturesHandler.MobileHelpText":"Use two fingers to move the map"},Hu=M,mf={hash:!1,interactive:!0,bearingSnap:7,attributionControl:_o,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,refreshExpiredTiles:!0,scrollZoom:!0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,cooperativeGestures:!1,trackResize:!0,center:[0,0],zoom:0,bearing:0,pitch:0,renderWorldCopies:!0,maxTileCacheSize:null,maxTileCacheZoomLevels:h.a.MAX_TILE_CACHE_ZOOM_LEVELS,transformRequest:null,transformCameraUpdate:null,fadeDuration:300,crossSourceCollisions:!0,clickTolerance:3,localIdeographFontFamily:"sans-serif",pitchWithRotate:!0,validateStyle:!0,maxCanvasSize:[4096,4096],cancelPendingTileRequestsWhileZooming:!0},Xc=g=>{g.touchstart=g.dragStart,g.touchmoveWindow=g.dragMove,g.touchend=g.dragEnd},gf={showCompass:!0,showZoom:!0,visualizePitch:!1};class yf{constructor(e,a,u=!1){this.mousedown=w=>{this.startMouse(h.e({},w,{ctrlKey:!0,preventDefault:()=>w.preventDefault()}),z.mousePos(this.element,w)),z.addEventListener(window,"mousemove",this.mousemove),z.addEventListener(window,"mouseup",this.mouseup)},this.mousemove=w=>{this.moveMouse(w,z.mousePos(this.element,w))},this.mouseup=w=>{this.mouseRotate.dragEnd(w),this.mousePitch&&this.mousePitch.dragEnd(w),this.offTemp()},this.touchstart=w=>{w.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=z.touchPos(this.element,w.targetTouches)[0],this.startTouch(w,this._startPos),z.addEventListener(window,"touchmove",this.touchmove,{passive:!1}),z.addEventListener(window,"touchend",this.touchend))},this.touchmove=w=>{w.targetTouches.length!==1?this.reset():(this._lastPos=z.touchPos(this.element,w.targetTouches)[0],this.moveTouch(w,this._lastPos))},this.touchend=w=>{w.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),delete this._startPos,delete this._lastPos,this.offTemp()},this.reset=()=>{this.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 d=e.dragRotate._mouseRotate.getClickTolerance(),m=e.dragRotate._mousePitch.getClickTolerance();this.element=a,this.mouseRotate=Bc({clickTolerance:d,enable:!0}),this.touchRotate=(({enable:w,clickTolerance:E,bearingDegreesPerPixelMoved:T=.8})=>{const I=new Oc;return new Hr({clickTolerance:E,move:(O,B)=>({bearingDelta:(B.x-O.x)*T}),moveStateManager:I,enable:w,assignEvents:Xc})})({clickTolerance:d,enable:!0}),this.map=e,u&&(this.mousePitch=Fc({clickTolerance:m,enable:!0}),this.touchPitch=(({enable:w,clickTolerance:E,pitchDegreesPerPixelMoved:T=-.5})=>{const I=new Oc;return new Hr({clickTolerance:E,move:(O,B)=>({pitchDelta:(B.y-O.y)*T}),moveStateManager:I,enable:w,assignEvents:Xc})})({clickTolerance:m,enable:!0})),z.addEventListener(a,"mousedown",this.mousedown),z.addEventListener(a,"touchstart",this.touchstart,{passive:!1}),z.addEventListener(a,"touchcancel",this.reset)}startMouse(e,a){this.mouseRotate.dragStart(e,a),this.mousePitch&&this.mousePitch.dragStart(e,a),z.disableDrag()}startTouch(e,a){this.touchRotate.dragStart(e,a),this.touchPitch&&this.touchPitch.dragStart(e,a),z.disableDrag()}moveMouse(e,a){const u=this.map,{bearingDelta:d}=this.mouseRotate.dragMove(e,a)||{};if(d&&u.setBearing(u.getBearing()+d),this.mousePitch){const{pitchDelta:m}=this.mousePitch.dragMove(e,a)||{};m&&u.setPitch(u.getPitch()+m)}}moveTouch(e,a){const u=this.map,{bearingDelta:d}=this.touchRotate.dragMove(e,a)||{};if(d&&u.setBearing(u.getBearing()+d),this.touchPitch){const{pitchDelta:m}=this.touchPitch.dragMove(e,a)||{};m&&u.setPitch(u.getPitch()+m)}}off(){const e=this.element;z.removeEventListener(e,"mousedown",this.mousedown),z.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),z.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),z.removeEventListener(window,"touchend",this.touchend),z.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){z.enableDrag(),z.removeEventListener(window,"mousemove",this.mousemove),z.removeEventListener(window,"mouseup",this.mouseup),z.removeEventListener(window,"touchmove",this.touchmove,{passive:!1}),z.removeEventListener(window,"touchend",this.touchend)}}let Dn;function fi(g,e,a){const u=new h.N(g.lng,g.lat);if(g=new h.N(g.lng,g.lat),e){const d=new h.N(g.lng-360,g.lat),m=new h.N(g.lng+360,g.lat),w=a.locationPoint(g).distSqr(e);a.locationPoint(d).distSqr(e)<w?g=d:a.locationPoint(m).distSqr(e)<w&&(g=m)}for(;Math.abs(g.lng-a.center.lng)>180;){const d=a.locationPoint(g);if(d.x>=0&&d.y>=0&&d.x<=a.width&&d.y<=a.height)break;g.lng>a.center.lng?g.lng-=360:g.lng+=360}return g.lng!==u.lng&&a.locationPoint(g).y>a.height/2-a.getHorizon()?g:u}const vo={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 _l(g,e,a){const u=g.classList;for(const d in vo)u.remove(`maplibregl-${a}-anchor-${d}`);u.add(`maplibregl-${a}-anchor-${e}`)}class xl extends h.E{constructor(e){if(super(),this._onKeyPress=a=>{const u=a.code,d=a.charCode||a.keyCode;u!=="Space"&&u!=="Enter"&&d!==32&&d!==13||this.togglePopup()},this._onMapClick=a=>{const u=a.originalEvent.target,d=this._element;this._popup&&(u===d||d.contains(u))&&this.togglePopup()},this._update=a=>{var u;if(!this._map)return;const d=this._map.loaded()&&!this._map.isMoving();((a==null?void 0:a.type)==="terrain"||(a==null?void 0:a.type)==="render"&&!d)&&this._map.once("render",this._update),this._lngLat=this._map.transform.renderWorldCopies?fi(this._lngLat,this._flatPos,this._map.transform):(u=this._lngLat)===null||u===void 0?void 0:u.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 m="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?m=`rotateZ(${this._rotation}deg)`:this._rotationAlignment==="map"&&(m=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let w="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?w="rotateX(0deg)":this._pitchAlignment==="map"&&(w=`rotateX(${this._map.getPitch()}deg)`),this._subpixelPositioning||a&&a.type!=="moveend"||(this._pos=this._pos.round()),z.setTransform(this._element,`${vo[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${w} ${m}`),R.frameAsync(new AbortController).then(()=>{this._updateOpacity(a&&a.type==="moveend")}).catch(()=>{})},this._onMove=a=>{if(!this._isDragging){const u=this._clickTolerance||this._map._clickTolerance;this._isDragging=a.point.dist(this._pointerdownPos)>=u}this._isDragging&&(this._pos=a.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 h.k("dragstart"))),this.fire(new h.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 h.k("dragend")),this._state="inactive"},this._addDragHandler=a=>{this._element.contains(a.originalEvent.target)&&(a.preventDefault(),this._positionDelta=a.point.sub(this._pos).add(this._offset),this._pointerdownPos=a.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._subpixelPositioning=e&&e.subpixelPositioning||!1,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&e.pitchAlignment!=="auto"?e.pitchAlignment:this._rotationAlignment,this.setOpacity(),this.setOpacity(e==null?void 0:e.opacity,e==null?void 0:e.opacityWhenCovered),e&&e.element)this._element=e.element,this._offset=h.P.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=z.create("div");const a=z.createNS("http://www.w3.org/2000/svg","svg"),u=41,d=27;a.setAttributeNS(null,"display","block"),a.setAttributeNS(null,"height",`${u}px`),a.setAttributeNS(null,"width",`${d}px`),a.setAttributeNS(null,"viewBox",`0 0 ${d} ${u}`);const m=z.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");const w=z.createNS("http://www.w3.org/2000/svg","g");w.setAttributeNS(null,"fill-rule","nonzero");const E=z.createNS("http://www.w3.org/2000/svg","g");E.setAttributeNS(null,"transform","translate(3.0, 29.0)"),E.setAttributeNS(null,"fill","#000000");const T=[{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 re of T){const ae=z.createNS("http://www.w3.org/2000/svg","ellipse");ae.setAttributeNS(null,"opacity","0.04"),ae.setAttributeNS(null,"cx","10.5"),ae.setAttributeNS(null,"cy","5.80029008"),ae.setAttributeNS(null,"rx",re.rx),ae.setAttributeNS(null,"ry",re.ry),E.appendChild(ae)}const I=z.createNS("http://www.w3.org/2000/svg","g");I.setAttributeNS(null,"fill",this._color);const O=z.createNS("http://www.w3.org/2000/svg","path");O.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"),I.appendChild(O);const B=z.createNS("http://www.w3.org/2000/svg","g");B.setAttributeNS(null,"opacity","0.25"),B.setAttributeNS(null,"fill","#000000");const U=z.createNS("http://www.w3.org/2000/svg","path");U.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"),B.appendChild(U);const Z=z.createNS("http://www.w3.org/2000/svg","g");Z.setAttributeNS(null,"transform","translate(6.0, 7.0)"),Z.setAttributeNS(null,"fill","#FFFFFF");const G=z.createNS("http://www.w3.org/2000/svg","g");G.setAttributeNS(null,"transform","translate(8.0, 8.0)");const Q=z.createNS("http://www.w3.org/2000/svg","circle");Q.setAttributeNS(null,"fill","#000000"),Q.setAttributeNS(null,"opacity","0.25"),Q.setAttributeNS(null,"cx","5.5"),Q.setAttributeNS(null,"cy","5.5"),Q.setAttributeNS(null,"r","5.4999962");const ne=z.createNS("http://www.w3.org/2000/svg","circle");ne.setAttributeNS(null,"fill","#FFFFFF"),ne.setAttributeNS(null,"cx","5.5"),ne.setAttributeNS(null,"cy","5.5"),ne.setAttributeNS(null,"r","5.4999962"),G.appendChild(Q),G.appendChild(ne),w.appendChild(E),w.appendChild(I),w.appendChild(B),w.appendChild(Z),w.appendChild(G),a.appendChild(w),a.setAttributeNS(null,"height",u*this._scale+"px"),a.setAttributeNS(null,"width",d*this._scale+"px"),this._element.appendChild(a),this._offset=h.P.convert(e&&e.offset||[0,-14])}if(this._element.classList.add("maplibregl-marker"),this._element.addEventListener("dragstart",a=>{a.preventDefault()}),this._element.addEventListener("mousedown",a=>{a.preventDefault()}),_l(this._element,this._anchor,"marker"),e&&e.className)for(const a of e.className.split(" "))this._element.classList.add(a);this._popup=null}addTo(e){return this.remove(),this._map=e,this._element.setAttribute("aria-label",e._getUIString("Marker.Title")),e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),e.on("terrain",this._update),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),z.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(e){return this._lngLat=h.N.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const d=Math.abs(13.5)/Math.SQRT2;e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[d,-1*(38.1-13.5+d)],"bottom-right":[-d,-1*(38.1-13.5+d)],left:[13.5,-1*(38.1-13.5)],right:[-13.5,-1*(38.1-13.5)]}:this._offset}this._popup=e,this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}setSubpixelPositioning(e){return this._subpixelPositioning=e,this}getPopup(){return this._popup}togglePopup(){const e=this._popup;return this._element.style.opacity===this._opacityWhenCovered?this:e?(e.isOpen()?e.remove():(e.setLngLat(this._lngLat),e.addTo(this._map)),this):this}_updateOpacity(e=!1){var a,u;if(!(!((a=this._map)===null||a===void 0)&&a.terrain))return void(this._element.style.opacity!==this._opacity&&(this._element.style.opacity=this._opacity));if(e)this._opacityTimeout=null;else{if(this._opacityTimeout)return;this._opacityTimeout=setTimeout(()=>{this._opacityTimeout=null},100)}const d=this._map,m=d.terrain.depthAtPoint(this._pos),w=d.terrain.getElevationForLngLatZoom(this._lngLat,d.transform.tileZoom);if(d.transform.lngLatToCameraDepth(this._lngLat,w)-m<.006)return void(this._element.style.opacity=this._opacity);const E=-this._offset.y/d.transform._pixelPerMeter,T=Math.sin(d.getPitch()*Math.PI/180)*E,I=d.terrain.depthAtPoint(new h.P(this._pos.x,this._pos.y-this._offset.y)),O=d.transform.lngLatToCameraDepth(this._lngLat,w+T)-I>.006;!((u=this._popup)===null||u===void 0)&&u.isOpen()&&O&&this._popup.remove(),this._element.style.opacity=O?this._opacityWhenCovered:this._opacity}getOffset(){return this._offset}setOffset(e){return this._offset=h.P.convert(e),this._update(),this}addClassName(e){this._element.classList.add(e)}removeClassName(e){this._element.classList.remove(e)}toggleClassName(e){return this._element.classList.toggle(e)}setDraggable(e){return this._draggable=!!e,this._map&&(e?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&e!=="auto"?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}setOpacity(e,a){return e===void 0&&a===void 0&&(this._opacity="1",this._opacityWhenCovered="0.2"),e!==void 0&&(this._opacity=e),a!==void 0&&(this._opacityWhenCovered=a),this._map&&this._updateOpacity(!0),this}}const qu={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let pa=0,fa=!1;const Ar={maxWidth:100,unit:"metric"};function ma(g,e,a){const u=a&&a.maxWidth||100,d=g._container.clientHeight/2,m=g.unproject([0,d]),w=g.unproject([u,d]),E=m.distanceTo(w);if(a&&a.unit==="imperial"){const T=3.2808*E;T>5280?et(e,u,T/5280,g._getUIString("ScaleControl.Miles")):et(e,u,T,g._getUIString("ScaleControl.Feet"))}else a&&a.unit==="nautical"?et(e,u,E/1852,g._getUIString("ScaleControl.NauticalMiles")):E>=1e3?et(e,u,E/1e3,g._getUIString("ScaleControl.Kilometers")):et(e,u,E,g._getUIString("ScaleControl.Meters"))}function et(g,e,a,u){const d=function(m){const w=Math.pow(10,`${Math.floor(m)}`.length-1);let E=m/w;return E=E>=10?10:E>=5?5:E>=3?3:E>=2?2:E>=1?1:function(T){const I=Math.pow(10,Math.ceil(-Math.log(T)/Math.LN10));return Math.round(T*I)/I}(E),w*E}(a);g.style.width=e*(d/a)+"px",g.innerHTML=`${d}&nbsp;${u}`}const ht={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px",subpixelPositioning:!1},bl=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function vl(g){if(g){if(typeof g=="number"){const e=Math.round(Math.abs(g)/Math.SQRT2);return{center:new h.P(0,0),top:new h.P(0,g),"top-left":new h.P(e,e),"top-right":new h.P(-e,e),bottom:new h.P(0,-g),"bottom-left":new h.P(e,-e),"bottom-right":new h.P(-e,-e),left:new h.P(g,0),right:new h.P(-g,0)}}if(g instanceof h.P||Array.isArray(g)){const e=h.P.convert(g);return{center:e,top:e,"top-left":e,"top-right":e,bottom:e,"bottom-left":e,"bottom-right":e,left:e,right:e}}return{center:h.P.convert(g.center||[0,0]),top:h.P.convert(g.top||[0,0]),"top-left":h.P.convert(g["top-left"]||[0,0]),"top-right":h.P.convert(g["top-right"]||[0,0]),bottom:h.P.convert(g.bottom||[0,0]),"bottom-left":h.P.convert(g["bottom-left"]||[0,0]),"bottom-right":h.P.convert(g["bottom-right"]||[0,0]),left:h.P.convert(g.left||[0,0]),right:h.P.convert(g.right||[0,0])}}return vl(new h.P(0,0))}const Kc=M;_.AJAXError=h.bh,_.Evented=h.E,_.LngLat=h.N,_.MercatorCoordinate=h.Z,_.Point=h.P,_.addProtocol=h.bi,_.config=h.a,_.removeProtocol=h.bj,_.AttributionControl=xo,_.BoxZoomHandler=An,_.CanvasSource=Un,_.CooperativeGesturesHandler=yo,_.DoubleClickZoomHandler=Fs,_.DragPanHandler=Vu,_.DragRotateHandler=$u,_.EdgeInsets=po,_.FullscreenControl=class extends h.E{constructor(g={}){super(),this._onFullscreenChange=()=>{var e;let a=window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||window.document.msFullscreenElement;for(;!((e=a==null?void 0:a.shadowRoot)===null||e===void 0)&&e.fullscreenElement;)a=a.shadowRoot.fullscreenElement;a===this._container!==this._fullscreen&&this._handleFullscreenChange()},this._onClickFullscreen=()=>{this._isFullscreen()?this._exitFullscreen():this._requestFullscreen()},this._fullscreen=!1,g&&g.container&&(g.container instanceof HTMLElement?this._container=g.container:h.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(g){return this._map=g,this._container||(this._container=this._map.getContainer()),this._controlContainer=z.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),this._controlContainer}onRemove(){z.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._onFullscreenChange)}_setupUI(){const g=this._fullscreenButton=z.create("button","maplibregl-ctrl-fullscreen",this._controlContainer);z.create("span","maplibregl-ctrl-icon",g).setAttribute("aria-hidden","true"),g.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._onFullscreenChange)}_updateTitle(){const g=this._getTitle();this._fullscreenButton.setAttribute("aria-label",g),this._fullscreenButton.title=g}_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 h.k("fullscreenstart")),this._prevCooperativeGesturesEnabled=this._map.cooperativeGestures.isEnabled(),this._map.cooperativeGestures.disable()):(this.fire(new h.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()}},_.GeoJSONSource=Yo,_.GeolocateControl=class extends h.E{constructor(g){super(),this._onSuccess=e=>{if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new h.k("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(e),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale"),this.fire(new h.k("geolocate",e)),this._finish()}},this._updateCamera=e=>{const a=new h.N(e.coords.longitude,e.coords.latitude),u=e.coords.accuracy,d=this._map.getBearing(),m=h.e({bearing:d},this.options.fitBoundsOptions),w=xe.fromLngLat(a,u);this._map.fitBounds(w,m,{geolocateSource:!0})},this._updateMarker=e=>{if(e){const a=new h.N(e.coords.longitude,e.coords.latitude);this._accuracyCircleMarker.setLngLat(a).addTo(this._map),this._userLocationDotMarker.setLngLat(a).addTo(this._map),this._accuracy=e.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=e=>{if(this._map){if(this.options.trackUserLocation)if(e.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 a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(e.code===3&&fa)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale"),this.fire(new h.k("error",e)),this._finish()}},this._finish=()=>{this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},this._setupUI=()=>{this._map&&(this._container.addEventListener("contextmenu",e=>e.preventDefault()),this._geolocateButton=z.create("button","maplibregl-ctrl-geolocate",this._container),z.create("span","maplibregl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",this._geolocateButton.disabled=!0)},this._finishSetupUI=e=>{if(this._map){if(e===!1){h.w("Geolocation support is not available so the GeolocateControl will be disabled.");const a=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}else{const a=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.disabled=!1,this._geolocateButton.title=a,this._geolocateButton.setAttribute("aria-label",a)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=z.create("div","maplibregl-user-location-dot"),this._userLocationDotMarker=new xl({element:this._dotElement}),this._circleElement=z.create("div","maplibregl-user-location-accuracy-circle"),this._accuracyCircleMarker=new xl({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",a=>{a.geolocateSource||this._watchState!=="ACTIVE_LOCK"||a.originalEvent&&a.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 h.k("trackuserlocationend")),this.fire(new h.k("userlocationlostfocus")))})}},this.options=h.e({},qu,g)}onAdd(g){return this._map=g,this._container=z.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._setupUI(),function(){return h._(this,arguments,void 0,function*(e=!1){if(Dn!==void 0&&!e)return Dn;if(window.navigator.permissions===void 0)return Dn=!!window.navigator.geolocation,Dn;try{Dn=(yield window.navigator.permissions.query({name:"geolocation"})).state!=="denied"}catch{Dn=!!window.navigator.geolocation}return Dn})}().then(e=>this._finishSetupUI(e)),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(),z.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,pa=0,fa=!1}_isOutOfMapMaxBounds(g){const e=this._map.getMaxBounds(),a=g.coords;return e&&(a.longitude<e.getWest()||a.longitude>e.getEast()||a.latitude<e.getSouth()||a.latitude>e.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 g=this._map.getBounds(),e=g.getSouthEast(),a=g.getNorthEast(),u=e.distanceTo(a),d=Math.ceil(this._accuracy/(u/this._map._container.clientHeight)*2);this._circleElement.style.width=`${d}px`,this._circleElement.style.height=`${d}px`}trigger(){if(!this._setup)return h.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 h.k("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":pa--,fa=!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 h.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 h.k("trackuserlocationstart")),this.fire(new h.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 g;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),pa++,pa>1?(g={maximumAge:6e5,timeout:0},fa=!0):(g=this.options.positionOptions,fa=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,g)}}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)}},_.Hash=cl,_.ImageSource=$r,_.KeyboardHandler=Zn,_.LngLatBounds=xe,_.LogoControl=Zc,_.Map=class extends ju{constructor(g){h.bf.mark(h.bg.create);const e=Object.assign(Object.assign({},mf),g);if(e.minZoom!=null&&e.maxZoom!=null&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(e.minPitch!=null&&e.maxPitch!=null&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(e.minPitch!=null&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(e.maxPitch!=null&&e.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new fo(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies),{bearingSnap:e.bearingSnap}),this._idleTriggered=!1,this._crossFadingFactor=1,this._renderTaskQueue=new Ot,this._controls=[],this._mapId=h.a4(),this._contextLost=a=>{a.preventDefault(),this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this.fire(new h.k("webglcontextlost",{originalEvent:a}))},this._contextRestored=a=>{this._setupPainter(),this.resize(),this._update(),this.fire(new h.k("webglcontextrestored",{originalEvent:a}))},this._onMapScroll=a=>{if(a.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},this._onWindowOnline=()=>{this._update()},this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._maxTileCacheZoomLevels=e.maxTileCacheZoomLevels,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat===!0,this._preserveDrawingBuffer=e.preserveDrawingBuffer===!0,this._antialias=e.antialias===!0,this._trackResize=e.trackResize===!0,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles===!0,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions===!0,this._collectResourceTiming=e.collectResourceTiming===!0,this._locale=Object.assign(Object.assign({},Yc),e.locale),this._clickTolerance=e.clickTolerance,this._overridePixelRatio=e.pixelRatio,this._maxCanvasSize=e.maxCanvasSize,this.transformCameraUpdate=e.transformCameraUpdate,this.cancelPendingTileRequestsWhileZooming=e.cancelPendingTileRequestsWhileZooming===!0,this._imageQueueHandle=_e.addThrottleControl(()=>this.isMoving()),this._requestManager=new Ce(e.transformRequest),typeof e.container=="string"){if(this._container=document.getElementById(e.container),!this._container)throw new Error(`Container '${e.container}' not found.`)}else{if(!(e.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.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 a=!1;const u=la(d=>{this._trackResize&&!this._removed&&(this.resize(d),this.redraw())},50);this._resizeObserver=new ResizeObserver(d=>{a?u(d):a=!0}),this._resizeObserver.observe(this._container)}this.handlers=new qc(this,e),this._hash=e.hash&&new cl(typeof e.hash=="string"&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,h.e({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,this._validateStyle=e.validateStyle,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new xo(typeof e.attributionControl=="boolean"?void 0:e.attributionControl)),e.maplibreLogo&&this.addControl(new Zc,e.logoPosition),this.on("style.load",()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)}),this.on("data",a=>{this._update(a.dataType==="style"),this.fire(new h.k(`${a.dataType}data`,a))}),this.on("dataloading",a=>{this.fire(new h.k(`${a.dataType}dataloading`,a))}),this.on("dataabort",a=>{this.fire(new h.k("sourcedataabort",a))})}_getMapId(){return this._mapId}addControl(g,e){if(e===void 0&&(e=g.getDefaultPosition?g.getDefaultPosition():"top-right"),!g||!g.onAdd)return this.fire(new h.j(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const a=g.onAdd(this);this._controls.push(g);const u=this._controlPositions[e];return e.indexOf("bottom")!==-1?u.insertBefore(a,u.firstChild):u.appendChild(a),this}removeControl(g){if(!g||!g.onRemove)return this.fire(new h.j(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const e=this._controls.indexOf(g);return e>-1&&this._controls.splice(e,1),g.onRemove(this),this}hasControl(g){return this._controls.indexOf(g)>-1}calculateCameraOptionsFromTo(g,e,a,u){return u==null&&this.terrain&&(u=this.terrain.getElevationForLngLatZoom(a,this.transform.tileZoom)),super.calculateCameraOptionsFromTo(g,e,a,u)}resize(g){var e;const a=this._containerDimensions(),u=a[0],d=a[1],m=this._getClampedPixelRatio(u,d);if(this._resizeCanvas(u,d,m),this.painter.resize(u,d,m),this.painter.overLimit()){const E=this.painter.context.gl;this._maxCanvasSize=[E.drawingBufferWidth,E.drawingBufferHeight];const T=this._getClampedPixelRatio(u,d);this._resizeCanvas(u,d,T),this.painter.resize(u,d,T)}this.transform.resize(u,d),(e=this._requestedCameraState)===null||e===void 0||e.resize(u,d);const w=!this._moving;return w&&(this.stop(),this.fire(new h.k("movestart",g)).fire(new h.k("move",g))),this.fire(new h.k("resize",g)),w&&this.fire(new h.k("moveend",g)),this}_getClampedPixelRatio(g,e){const{0:a,1:u}=this._maxCanvasSize,d=this.getPixelRatio(),m=g*d,w=e*d;return Math.min(m>a?a/m:1,w>u?u/w:1)*d}getPixelRatio(){var g;return(g=this._overridePixelRatio)!==null&&g!==void 0?g:devicePixelRatio}setPixelRatio(g){this._overridePixelRatio=g,this.resize()}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(g){return this.transform.setMaxBounds(xe.convert(g)),this._update()}setMinZoom(g){if((g=g??-2)>=-2&&g<=this.transform.maxZoom)return this.transform.minZoom=g,this._update(),this.getZoom()<g&&this.setZoom(g),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(g){if((g=g??22)>=this.transform.minZoom)return this.transform.maxZoom=g,this._update(),this.getZoom()>g&&this.setZoom(g),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(g){if((g=g??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(g>=0&&g<=this.transform.maxPitch)return this.transform.minPitch=g,this._update(),this.getPitch()<g&&this.setPitch(g),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(g){if((g=g??60)>85)throw new Error("maxPitch must be less than or equal to 85");if(g>=this.transform.minPitch)return this.transform.maxPitch=g,this._update(),this.getPitch()>g&&this.setPitch(g),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(g){return this.transform.renderWorldCopies=g,this._update()}project(g){return this.transform.locationPoint(h.N.convert(g),this.style&&this.terrain)}unproject(g){return this.transform.pointLocation(h.P.convert(g),this.terrain)}isMoving(){var g;return this._moving||((g=this.handlers)===null||g===void 0?void 0:g.isMoving())}isZooming(){var g;return this._zooming||((g=this.handlers)===null||g===void 0?void 0:g.isZooming())}isRotating(){var g;return this._rotating||((g=this.handlers)===null||g===void 0?void 0:g.isRotating())}_createDelegatedListener(g,e,a){if(g==="mouseenter"||g==="mouseover"){let u=!1;return{layers:e,listener:a,delegates:{mousemove:m=>{const w=e.filter(T=>this.getLayer(T)),E=w.length!==0?this.queryRenderedFeatures(m.point,{layers:w}):[];E.length?u||(u=!0,a.call(this,new Yi(g,this,m.originalEvent,{features:E}))):u=!1},mouseout:()=>{u=!1}}}}if(g==="mouseleave"||g==="mouseout"){let u=!1;return{layers:e,listener:a,delegates:{mousemove:w=>{const E=e.filter(T=>this.getLayer(T));(E.length!==0?this.queryRenderedFeatures(w.point,{layers:E}):[]).length?u=!0:u&&(u=!1,a.call(this,new Yi(g,this,w.originalEvent)))},mouseout:w=>{u&&(u=!1,a.call(this,new Yi(g,this,w.originalEvent)))}}}}{const u=d=>{const m=e.filter(E=>this.getLayer(E)),w=m.length!==0?this.queryRenderedFeatures(d.point,{layers:m}):[];w.length&&(d.features=w,a.call(this,d),delete d.features)};return{layers:e,listener:a,delegates:{[g]:u}}}}_saveDelegatedListener(g,e){this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[g]=this._delegatedListeners[g]||[],this._delegatedListeners[g].push(e)}_removeDelegatedListener(g,e,a){if(!this._delegatedListeners||!this._delegatedListeners[g])return;const u=this._delegatedListeners[g];for(let d=0;d<u.length;d++){const m=u[d];if(m.listener===a&&m.layers.length===e.length&&m.layers.every(w=>e.includes(w))){for(const w in m.delegates)this.off(w,m.delegates[w]);return void u.splice(d,1)}}}on(g,e,a){if(a===void 0)return super.on(g,e);const u=this._createDelegatedListener(g,typeof e=="string"?[e]:e,a);this._saveDelegatedListener(g,u);for(const d in u.delegates)this.on(d,u.delegates[d]);return this}once(g,e,a){if(a===void 0)return super.once(g,e);const u=typeof e=="string"?[e]:e,d=this._createDelegatedListener(g,u,a);for(const m in d.delegates){const w=d.delegates[m];d.delegates[m]=(...E)=>{this._removeDelegatedListener(g,u,a),w(...E)}}this._saveDelegatedListener(g,d);for(const m in d.delegates)this.once(m,d.delegates[m]);return this}off(g,e,a){return a===void 0?super.off(g,e):(this._removeDelegatedListener(g,typeof e=="string"?[e]:e,a),this)}queryRenderedFeatures(g,e){if(!this.style)return[];let a;const u=g instanceof h.P||Array.isArray(g),d=u?g:[[0,0],[this.transform.width,this.transform.height]];if(e=e||(u?{}:g)||{},d instanceof h.P||typeof d[0]=="number")a=[h.P.convert(d)];else{const m=h.P.convert(d[0]),w=h.P.convert(d[1]);a=[m,new h.P(w.x,m.y),w,new h.P(m.x,w.y),m]}return this.style.queryRenderedFeatures(a,e,this.transform)}querySourceFeatures(g,e){return this.style.querySourceFeatures(g,e)}setStyle(g,e){return(e=h.e({},{localIdeographFontFamily:this._localIdeographFontFamily,validate:this._validateStyle},e)).diff!==!1&&e.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&g?(this._diffStyle(g,e),this):(this._localIdeographFontFamily=e.localIdeographFontFamily,this._updateStyle(g,e))}setTransformRequest(g){return this._requestManager.setTransformRequest(g),this}_getUIString(g){const e=this._locale[g];if(e==null)throw new Error(`Missing UI string '${g}'`);return e}_updateStyle(g,e){if(e.transformStyle&&this.style&&!this.style._loaded)return void this.style.once("style.load",()=>this._updateStyle(g,e));const a=this.style&&e.transformStyle?this.style.serialize():void 0;return this.style&&(this.style.setEventedParent(null),this.style._remove(!g)),g?(this.style=new Za(this,e||{}),this.style.setEventedParent(this,{style:this.style}),typeof g=="string"?this.style.loadURL(g,e,a):this.style.loadJSON(g,e,a),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new Za(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(g,e){if(typeof g=="string"){const a=this._requestManager.transformRequest(g,"Style");h.h(a,new AbortController).then(u=>{this._updateDiff(u.data,e)}).catch(u=>{u&&this.fire(new h.j(u))})}else typeof g=="object"&&this._updateDiff(g,e)}_updateDiff(g,e){try{this.style.setState(g,e)&&this._update(!0)}catch(a){h.w(`Unable to perform style diff: ${a.message||a.error||a}. Rebuilding the style from scratch.`),this._updateStyle(g,e)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():h.w("There is no style added to the map.")}addSource(g,e){return this._lazyInitEmptyStyle(),this.style.addSource(g,e),this._update(!0)}isSourceLoaded(g){const e=this.style&&this.style.sourceCaches[g];if(e!==void 0)return e.loaded();this.fire(new h.j(new Error(`There is no source with ID '${g}'`)))}setTerrain(g){if(this.style._checkLoaded(),this._terrainDataCallback&&this.style.off("data",this._terrainDataCallback),g){const e=this.style.sourceCaches[g.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${g.source}`);this.terrain===null&&e.reload();for(const a in this.style._layers){const u=this.style._layers[a];u.type==="hillshade"&&u.source===g.source&&h.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 Gc(this.painter,e,g),this.painter.renderToTexture=new Uu(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=a=>{a.dataType==="style"?this.terrain.sourceCache.freeRtt():a.dataType==="source"&&a.tile&&(a.sourceId!==g.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(a.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 h.k("terrain",{terrain:g})),this}getTerrain(){var g,e;return(e=(g=this.terrain)===null||g===void 0?void 0:g.options)!==null&&e!==void 0?e:null}areTilesLoaded(){const g=this.style&&this.style.sourceCaches;for(const e in g){const a=g[e]._tiles;for(const u in a){const d=a[u];if(d.state!=="loaded"&&d.state!=="errored")return!1}}return!0}removeSource(g){return this.style.removeSource(g),this._update(!0)}getSource(g){return this.style.getSource(g)}addImage(g,e,a={}){const{pixelRatio:u=1,sdf:d=!1,stretchX:m,stretchY:w,content:E,textFitWidth:T,textFitHeight:I}=a;if(this._lazyInitEmptyStyle(),!(e instanceof HTMLImageElement||h.b(e))){if(e.width===void 0||e.height===void 0)return this.fire(new h.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:O,height:B,data:U}=e,Z=e;return this.style.addImage(g,{data:new h.R({width:O,height:B},new Uint8Array(U)),pixelRatio:u,stretchX:m,stretchY:w,content:E,textFitWidth:T,textFitHeight:I,sdf:d,version:0,userImage:Z}),Z.onAdd&&Z.onAdd(this,g),this}}{const{width:O,height:B,data:U}=R.getImageData(e);this.style.addImage(g,{data:new h.R({width:O,height:B},U),pixelRatio:u,stretchX:m,stretchY:w,content:E,textFitWidth:T,textFitHeight:I,sdf:d,version:0})}}updateImage(g,e){const a=this.style.getImage(g);if(!a)return this.fire(new h.j(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const u=e instanceof HTMLImageElement||h.b(e)?R.getImageData(e):e,{width:d,height:m,data:w}=u;if(d===void 0||m===void 0)return this.fire(new h.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(d!==a.data.width||m!==a.data.height)return this.fire(new h.j(new Error("The width and height of the updated image must be that same as the previous version of the image")));const E=!(e instanceof HTMLImageElement||h.b(e));return a.data.replace(w,E),this.style.updateImage(g,a),this}getImage(g){return this.style.getImage(g)}hasImage(g){return g?!!this.style.getImage(g):(this.fire(new h.j(new Error("Missing required image id"))),!1)}removeImage(g){this.style.removeImage(g)}loadImage(g){return _e.getImage(this._requestManager.transformRequest(g,"Image"),new AbortController)}listImages(){return this.style.listImages()}addLayer(g,e){return this._lazyInitEmptyStyle(),this.style.addLayer(g,e),this._update(!0)}moveLayer(g,e){return this.style.moveLayer(g,e),this._update(!0)}removeLayer(g){return this.style.removeLayer(g),this._update(!0)}getLayer(g){return this.style.getLayer(g)}getLayersOrder(){return this.style.getLayersOrder()}setLayerZoomRange(g,e,a){return this.style.setLayerZoomRange(g,e,a),this._update(!0)}setFilter(g,e,a={}){return this.style.setFilter(g,e,a),this._update(!0)}getFilter(g){return this.style.getFilter(g)}setPaintProperty(g,e,a,u={}){return this.style.setPaintProperty(g,e,a,u),this._update(!0)}getPaintProperty(g,e){return this.style.getPaintProperty(g,e)}setLayoutProperty(g,e,a,u={}){return this.style.setLayoutProperty(g,e,a,u),this._update(!0)}getLayoutProperty(g,e){return this.style.getLayoutProperty(g,e)}setGlyphs(g,e={}){return this._lazyInitEmptyStyle(),this.style.setGlyphs(g,e),this._update(!0)}getGlyphs(){return this.style.getGlyphsUrl()}addSprite(g,e,a={}){return this._lazyInitEmptyStyle(),this.style.addSprite(g,e,a,u=>{u||this._update(!0)}),this}removeSprite(g){return this._lazyInitEmptyStyle(),this.style.removeSprite(g),this._update(!0)}getSprite(){return this.style.getSprite()}setSprite(g,e={}){return this._lazyInitEmptyStyle(),this.style.setSprite(g,e,a=>{a||this._update(!0)}),this}setLight(g,e={}){return this._lazyInitEmptyStyle(),this.style.setLight(g,e),this._update(!0)}getLight(){return this.style.getLight()}setSky(g){return this._lazyInitEmptyStyle(),this.style.setSky(g),this._update(!0)}getSky(){return this.style.getSky()}setFeatureState(g,e){return this.style.setFeatureState(g,e),this._update()}removeFeatureState(g,e){return this.style.removeFeatureState(g,e),this._update()}getFeatureState(g){return this.style.getFeatureState(g)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let g=0,e=0;return this._container&&(g=this._container.clientWidth||400,e=this._container.clientHeight||300),[g,e]}_setupContainer(){const g=this._container;g.classList.add("maplibregl-map");const e=this._canvasContainer=z.create("div","maplibregl-canvas-container",g);this._interactive&&e.classList.add("maplibregl-interactive"),this._canvas=z.create("canvas","maplibregl-canvas",e),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 a=this._containerDimensions(),u=this._getClampedPixelRatio(a[0],a[1]);this._resizeCanvas(a[0],a[1],u);const d=this._controlContainer=z.create("div","maplibregl-control-container",g),m=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(w=>{m[w]=z.create("div",`maplibregl-ctrl-${w} `,d)}),this._container.addEventListener("scroll",this._onMapScroll,!1)}_resizeCanvas(g,e,a){this._canvas.width=Math.floor(a*g),this._canvas.height=Math.floor(a*e),this._canvas.style.width=`${g}px`,this._canvas.style.height=`${e}px`}_setupPainter(){const g={alpha:!0,stencil:!0,depth:!0,failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1};let e=null;this._canvas.addEventListener("webglcontextcreationerror",u=>{e={requestedAttributes:g},u&&(e.statusMessage=u.statusMessage,e.type=u.type)},{once:!0});const a=this._canvas.getContext("webgl2",g)||this._canvas.getContext("webgl",g);if(!a){const u="Failed to initialize WebGL";throw e?(e.message=u,new Error(JSON.stringify(e))):new Error(u)}this.painter=new ll(a,this.transform),j.testSupport(a)}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(g){return this.style&&this.style._loaded?(this._styleDirty=this._styleDirty||g,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(g){return this._update(),this._renderTaskQueue.add(g)}_cancelRenderFrame(g){this._renderTaskQueue.remove(g)}_render(g){const e=this._idleTriggered?this._fadeDuration:0;if(this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(g),this._removed)return;let a=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const d=this.transform.zoom,m=R.now();this.style.zoomHistory.update(d,m);const w=new h.z(d,{now:m,fadeDuration:e,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),E=w.crossFadingFactor();E===1&&E===this._crossFadingFactor||(a=!0,this._crossFadingFactor=E),this.style.update(w)}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,e,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:e,showPadding:this.showPadding}),this.fire(new h.k("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,h.bf.mark(h.bg.load),this.fire(new h.k("load"))),this.style&&(this.style.hasTransitions()||a)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles();const u=this._sourcesDirty||this._styleDirty||this._placementDirty;return u||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new h.k("idle")),!this._loaded||this._fullyLoaded||u||(this._fullyLoaded=!0,h.bf.mark(h.bg.fullLoad)),this}redraw(){return this.style&&(this._frameRequest&&(this._frameRequest.abort(),this._frameRequest=null),this._render(0)),this}remove(){var g;this._hash&&this._hash.remove();for(const a of this._controls)a.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),_e.removeThrottleControl(this._imageQueueHandle),(g=this._resizeObserver)===null||g===void 0||g.disconnect();const e=this.painter.context.gl.getExtension("WEBGL_lose_context");e!=null&&e.loseContext&&e.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),z.remove(this._canvasContainer),z.remove(this._controlContainer),this._container.classList.remove("maplibregl-map"),h.bf.clearMetrics(),this._removed=!0,this.fire(new h.k("remove"))}triggerRepaint(){this.style&&!this._frameRequest&&(this._frameRequest=new AbortController,R.frameAsync(this._frameRequest).then(g=>{h.bf.frame(g),this._frameRequest=null,this._render(g)}).catch(()=>{}))}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(g){this._showTileBoundaries!==g&&(this._showTileBoundaries=g,this._update())}get showPadding(){return!!this._showPadding}set showPadding(g){this._showPadding!==g&&(this._showPadding=g,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(g){this._showCollisionBoxes!==g&&(this._showCollisionBoxes=g,g?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(g){this._showOverdrawInspector!==g&&(this._showOverdrawInspector=g,this._update())}get repaint(){return!!this._repaint}set repaint(g){this._repaint!==g&&(this._repaint=g,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(g){this._vertices=g,this._update()}get version(){return Hu}getCameraTargetElevation(){return this.transform.elevation}},_.MapMouseEvent=Yi,_.MapTouchEvent=Os,_.MapWheelEvent=Bu,_.Marker=xl,_.NavigationControl=class{constructor(g){this._updateZoomButtons=()=>{const e=this._map.getZoom(),a=e===this._map.getMaxZoom(),u=e===this._map.getMinZoom();this._zoomInButton.disabled=a,this._zoomOutButton.disabled=u,this._zoomInButton.setAttribute("aria-disabled",a.toString()),this._zoomOutButton.setAttribute("aria-disabled",u.toString())},this._rotateCompassArrow=()=>{const e=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=e},this._setButtonTitle=(e,a)=>{const u=this._map._getUIString(`NavigationControl.${a}`);e.title=u,e.setAttribute("aria-label",u)},this.options=h.e({},gf,g),this._container=z.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._container.addEventListener("contextmenu",e=>e.preventDefault()),this.options.showZoom&&(this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in",e=>this._map.zoomIn({},{originalEvent:e})),z.create("span","maplibregl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out",e=>this._map.zoomOut({},{originalEvent:e})),z.create("span","maplibregl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(this._compass=this._createButton("maplibregl-ctrl-compass",e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})}),this._compassIcon=z.create("span","maplibregl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}onAdd(g){return this._map=g,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 yf(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){z.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(g,e){const a=z.create("button",g,this._container);return a.type="button",a.addEventListener("click",e),a}},_.Popup=class extends h.E{constructor(g){super(),this.remove=()=>(this._content&&z.remove(this._content),this._container&&(z.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 h.k("close"))),this),this._onMouseUp=e=>{this._update(e.point)},this._onMouseMove=e=>{this._update(e.point)},this._onDrag=e=>{this._update(e.point)},this._update=e=>{var a;if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(!this._container){if(this._container=z.create("div","maplibregl-popup",this._map.getContainer()),this._tip=z.create("div","maplibregl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className)for(const E of this.options.className.split(" "))this._container.classList.add(E);this._closeButton&&this._closeButton.setAttribute("aria-label",this._map._getUIString("Popup.Close")),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer")}if(this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._lngLat=this._map.transform.renderWorldCopies&&!this._trackPointer?fi(this._lngLat,this._flatPos,this._map.transform):(a=this._lngLat)===null||a===void 0?void 0:a.wrap(),this._trackPointer&&!e)return;const u=this._flatPos=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);this._map.terrain&&(this._flatPos=this._trackPointer&&e?e:this._map.transform.locationPoint(this._lngLat));let d=this.options.anchor;const m=vl(this.options.offset);if(!d){const E=this._container.offsetWidth,T=this._container.offsetHeight;let I;I=u.y+m.bottom.y<T?["top"]:u.y>this._map.transform.height-T?["bottom"]:[],u.x<E/2?I.push("left"):u.x>this._map.transform.width-E/2&&I.push("right"),d=I.length===0?"bottom":I.join("-")}let w=u.add(m[d]);this.options.subpixelPositioning||(w=w.round()),z.setTransform(this._container,`${vo[d]} translate(${w.x}px,${w.y}px)`),_l(this._container,d,"popup")},this._onClose=()=>{this.remove()},this.options=h.e(Object.create(ht),g)}addTo(g){return this._map&&this.remove(),this._map=g,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 h.k("open")),this}isOpen(){return!!this._map}getLngLat(){return this._lngLat}setLngLat(g){return this._lngLat=h.N.convert(g),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(g){return this.setDOMContent(document.createTextNode(g))}setHTML(g){const e=document.createDocumentFragment(),a=document.createElement("body");let u;for(a.innerHTML=g;u=a.firstChild,u;)e.appendChild(u);return this.setDOMContent(e)}getMaxWidth(){var g;return(g=this._container)===null||g===void 0?void 0:g.style.maxWidth}setMaxWidth(g){return this.options.maxWidth=g,this._update(),this}setDOMContent(g){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=z.create("div","maplibregl-popup-content",this._container);return this._content.appendChild(g),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(g){return this._container&&this._container.classList.add(g),this}removeClassName(g){return this._container&&this._container.classList.remove(g),this}setOffset(g){return this.options.offset=g,this._update(),this}toggleClassName(g){if(this._container)return this._container.classList.toggle(g)}setSubpixelPositioning(g){this.options.subpixelPositioning=g}_createCloseButton(){this.options.closeButton&&(this._closeButton=z.create("button","maplibregl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const g=this._container.querySelector(bl);g&&g.focus()}},_.RasterDEMTileSource=Si,_.RasterTileSource=Wt,_.ScaleControl=class{constructor(g){this._onMove=()=>{ma(this._map,this._container,this.options)},this.setUnit=e=>{this.options.unit=e,ma(this._map,this._container,this.options)},this.options=Object.assign(Object.assign({},Ar),g)}getDefaultPosition(){return"bottom-left"}onAdd(g){return this._map=g,this._container=z.create("div","maplibregl-ctrl maplibregl-ctrl-scale",g.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){z.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}},_.ScrollZoomHandler=ar,_.Style=Za,_.TerrainControl=class{constructor(g){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=g}onAdd(g){return this._map=g,this._container=z.create("div","maplibregl-ctrl maplibregl-ctrl-group"),this._terrainButton=z.create("button","maplibregl-ctrl-terrain",this._container),z.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(){z.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}},_.TwoFingersTouchPitchHandler=go,_.TwoFingersTouchRotateHandler=jc,_.TwoFingersTouchZoomHandler=Vc,_.TwoFingersTouchZoomRotateHandler=Hc,_.VectorTileSource=Go,_.VideoSource=Js,_.addSourceType=(g,e)=>h._(void 0,void 0,void 0,function*(){if(Ko(g))throw new Error(`A source type called "${g}" already exists.`);((a,u)=>{Xo[a]=u})(g,e)}),_.clearPrewarmedResources=function(){const g=ke;g&&(g.isPreloaded()&&g.numActive()===1?(g.release(En),ke=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()"))},_.getMaxParallelImageRequests=function(){return h.a.MAX_PARALLEL_IMAGE_REQUESTS},_.getRTLTextPluginStatus=function(){return Tr().getRTLTextPluginStatus()},_.getVersion=function(){return Kc},_.getWorkerCount=function(){return Tn.workerCount},_.getWorkerUrl=function(){return h.a.WORKER_URL},_.importScriptInWorkers=function(g){return Vt().broadcast("IS",g)},_.prewarm=function(){Ze().acquire(En)},_.setMaxParallelImageRequests=function(g){h.a.MAX_PARALLEL_IMAGE_REQUESTS=g},_.setRTLTextPlugin=function(g,e){return Tr().setRTLTextPlugin(g,e)},_.setWorkerCount=function(g){Tn.workerCount=g},_.setWorkerUrl=function(g){h.a.WORKER_URL=g}});var b=o;return b})})(Rg);var Ud=Rg.exports;const Ph=["#FF6633","#FFB399","#FF33FF","#00B3E6","#E6B333","#3366E6","#999966","#99FF99","#B34D4D","#80B300","#809900","#E6B3B3","#6680B3","#66991A","#FF99E6","#CCFF1A","#FF1A66","#E6331A","#33FFCC","#66994D","#B366CC","#4D8000","#B33300","#CC80CC","#66664D","#991AFF","#E666FF","#4DB3FF","#1AB399","#E666B3","#33991A","#CC9999","#B3B31A","#00E680","#4D8066","#809980","#E6FF80","#1AFF33","#999933","#FF3380","#CCCC00","#66E64D","#4D80CC","#9900B3","#E64D66","#4DB380","#FF4D4D","#99E6E6","#6666FF","#FFFF99"],Fn={};async function Ih(n="pin4-sm-mi-plumber+f45942.png",i=null){try{const c=n!=null&&n.includes("/")?n:`/api-user/marker_icon/${n}`,p=await i.loadImage(c);if(i.hasImage(n))return;i==null||i.addImage(n,p.data,{sdf:n==null?void 0:n.includes("+sdf")})}catch(o){console.error(o)}}function V1(n){if(!(n!=null&&n.startsWith("rgba")))return n;const i=n.replace(/^rgba?\(|\s+|\)$/g,"").split(",");return`${((1<<24)+(parseInt(i[0],10)<<16)+(parseInt(i[1],10)<<8)+parseInt(i[2],10)).toString(16).slice(1)}`}Fn.point=async(n={},i={},o=null)=>{var R,z,j,Y,ee,oe,ue,be,_e,Ce,Qe,mt;i||(i={}),((R=i==null?void 0:i.width)==null?void 0:R[0])==="["&&(i.width={stops:JSON.parse(i.width)}),typeof(i==null?void 0:i.width)=="string"&&(i.width-=0),typeof(i==null?void 0:i.opacity)=="string"&&(i.opacity=(i.opacity-0)*100);const c=((z=n.style)==null?void 0:z.colorAttr)||((j=n.style)==null?void 0:j.iconCls);let p={circle:"none-xl-{{marker}}+222.png",circle2:"circle-xl-{{marker}}+222.png",pin2:"pin2-xl-{{marker}}+sdf.png",pin:"pin-xl-{{marker}}+sdf.png"}[i.iconType]||(i==null?void 0:i.icon);const[b,_]=(p==null?void 0:p.split("-"))||[],h=((Y=n.style)==null?void 0:Y.color)||"blue";!((ee=n.style)!=null&&ee.iconAttr)&&(p!=null&&p.includes("{{marker}}"))&&(p=p.replace("{{marker}}","fa-star"));const M="gray",A=(Ae,St)=>`${Ae==null?void 0:Ae.split("+")[0]}+${St.replace("#","")}.png`;if(n.legendAuto={icon:[],color:[]},(oe=n.style)!=null&&oe.iconAttr&&p){const Ae=(be=(ue=n.meta)==null?void 0:ue.columns)==null?void 0:be.find(wt=>{var Nt;return wt.name===((Nt=n==null?void 0:n.style)==null?void 0:Nt.iconAttr)}),St=(Ae==null?void 0:Ae.values)||await ft.get(`/api-user/gis-ir/${n.id}/${(_e=n.style)==null?void 0:_e.iconAttr}`).then(wt=>wt.data.rows);if(St!=null&&St.length){const wt=p.replace("{{color}}",h.length?h:V1(h)||[0]).split("+")[1].split(/[.-]/)[0];St.forEach((Nt,Ct)=>{var Sn;return Nt.icon=(Sn=Nt.icon)!=null&&Sn.includes("png")?Nt.icon:`${b}-${_}-${Nt.data||Nt.icon||`ub-${Ct}`}+${p!=null&&p.includes("circle")?"ddd-222":wt}.png`}),p=p!=null&&p.includes("{{")?`${b}-${_}-fa-question+0c53ad.png`:p,n.legendAuto.iconText=(Ae==null?void 0:Ae.title)||n.style.iconAttr,St.forEach(Nt=>n.legendAuto.icon.push(Nt)),n.legendAuto.icon.push({icon:p,text:"Не визначено"}),n.style.iconArr=["match",["get",n.style.iconAttr]].concat(St.filter(Nt=>Nt.id).reduce((Nt,Ct)=>Nt.concat([Ct.id,Ct.icon]),[])).concat([p]),await Promise.all(St.map(Nt=>Nt.icon).map(Nt=>Ih(Nt,o))),await Ih(p,o)}else p=c?"pin6-m-fa-star+{{color}}.png":`pin6-m-fa-star+${h==null?void 0:h.replace("#","")}.png`}if(p!=null&&p.includes("{{color}}")?p=p.replace("{{color}}","222"):i!=null&&i.icon&&i.iconAttr,c){const Ae=(Qe=(Ce=n.meta)==null?void 0:Ce.columns)==null?void 0:Qe.find(wt=>wt.name===c),St=(Ae==null?void 0:Ae.values)||await ft.get(`/api-user/gis-ir/${n.id}/${c}`).then(wt=>wt.data.rows);n.style.color=St!=null&&St.length?["match",["get",c]].concat(St.filter(wt=>wt.id).reduce((wt,Nt,Ct)=>wt.concat([Nt.id,Nt.color||Ph[Ct]]),[])).concat(["#aaa"]):h,n.style.colorArr=n.style.color,n.legendAuto.colorText=(Ae==null?void 0:Ae.title)||c,St.forEach(wt=>n.legendAuto.color.push(wt)),n.legendAuto.color.push({color:"#aaa",text:"Не визначено"}),!((mt=n.style)!=null&&mt.iconAttr)&&!(p!=null&&p.includes("+sdf"))&&p&&(St.forEach((wt,Nt)=>wt.icon=A(p,wt.color||Ph[Nt])),n.style.iconArr=["match",["get",c]].concat(St.filter(wt=>wt.id).reduce((wt,Nt)=>wt.concat([Nt.id,Nt.icon]),[])).concat([A(p,M)]),await Promise.all(St.map(wt=>wt.icon).map(wt=>Ih(wt,o))))}if(p&&!(p!=null&&p.includes("{"))){const Ae=i!=null&&i.colorAttr?A(p,M):p;await Ih(Ae,o)}const D=p!=null&&p.includes("sdf")?["interpolate",["linear"],["zoom"],14,.1,18,.2]:["interpolate",["linear"],["zoom"],14,.7,16,1];return i.iconOffset=p!=null&&p.includes("pin")?[0,p!=null&&p.includes("+sdf")?-96:-20]:null,[{id:`${n.id}`,source:n.id,type:"circle",cluster:!0,lsource:i==null?void 0:i.lsource,minzoom:(i==null?void 0:i.minzoom)!==void 0?+(i==null?void 0:i.minzoom):4,maxzoom:(p!=null&&p.includes("+sdf")||!(p!=null&&p.includes("circle"))&&!(p!=null&&p.includes("none"))?+i.iconZoom:null)||+(i==null?void 0:i.maxzoom)||24,filter:["all",["==",["geometry-type"],"Point"],["!",["has","point_count"]]],paint:{"circle-stroke-width":["case",["boolean",["feature-state","select"],!1],(i==null?void 0:i.strokeWidth)||1,["boolean",["feature-state","hover"],!1],2,(i==null?void 0:i.strokeWidth)||1],"circle-stroke-color":["case",["boolean",["feature-state","select"],!1],(i==null?void 0:i.stroke)||(i==null?void 0:i.color)||"#fff",["boolean",["feature-state","hover"],!1],"maroon",(i==null?void 0:i.stroke)||(i==null?void 0:i.color)||"#fff"],"circle-opacity":(i.iconZoom?["interpolate",["exponential",.5],["zoom"],+i.iconZoom-1,1,+i.iconZoom,p!=null&&p.includes("none")?.3:0]:null)||i.opacity||1,"circle-color":i.color||["case",["boolean",["feature-state","hover"],!1],"red","blue"],"circle-radius":(Array.isArray(i.width)?{stops:i.width}:null)||i.width||{stops:i.iconZoom?[[+i.iconZoom,4],[+i.iconZoom,8],[18,16]]:[[13,4],[15,8],[18,12]]}}}].concat(i.iconArr||i.icon?[{id:`${n.id}-5`,source:n.id,lsource:i==null?void 0:i.lsource,type:"symbol",minzoom:+i.iconZoom||16,filter:["all",["!",["has","point_count"]]],layout:{"icon-image":i!=null&&i.colorAttr&&i.iconArr||p,"icon-allow-overlap":!0,...i.iconOffset?{"icon-offset":i.iconOffset||!1}:{},...D?{"icon-size":D||!1}:{}},paint:{"icon-opacity":["case",["boolean",["feature-state","hover"],!1],.5,["boolean",["feature-state","select"],!1],.5,(p!=null&&p.includes("+sdf")?1:null)||(p!=null&&p.includes("circle")?.6:1)],...p!=null&&p.includes("+sdf")?{"icon-color":["case",["boolean",["feature-state","hover"],!1],"#cd0bbf",["boolean",["feature-state","select"],!1],"#8517cf",i.color||"#aa0000"]}:{}}}]:[]).concat(i.label?[{id:`${n.id}-4`,source:n.id,lsource:i==null?void 0:i.lsource,type:"symbol",minzoom:14,filter:["!",["has","point_count"]],layout:{"text-field":i.label,"text-font":["Open Sans Regular"],"text-size":i["text-size"]||8},paint:{"text-color":i["text-color"]||"#ffffff","text-halo-color":i["text-halo-color"]||"black"}}]:[]).concat(n.cluster||i.clusterMaxZoom?[{id:`${n.id}-1`,source:n.id,lsource:i==null?void 0:i.lsource,type:"circle",filter:["has","point_count"],paint:{"circle-color":["step",["get","point_count"],"#51bbd6",100,"#f1f075",750,"#f28cb1"],"circle-radius":["step",["get","point_count"],20,100,30,750,40]}},{id:`${n.id}-2`,source:n.id,lsource:i==null?void 0:i.lsource,type:"symbol",filter:["has","point_count"],layout:{"text-field":"{point_count_abbreviated}","text-font":["Open Sans Regular"],"text-size":12}}]:[])},Fn.label=(n={})=>[{id:n.id,source:n.id,type:"line",layout:{"text-field":"{str_name}","text-font":["DIN Offc Pro Italic","Arial Unicode MS Regular"],"symbol-placement":"line","text-pitch-alignment":"viewport","text-max-angle":30,"text-size":{base:1,stops:[[13,12],[18,16]]}},paint:{"text-halo-width":0,"text-halo-blur":0,"text-color":"#78888a"}}],Fn.polygon=async(n={},i={},o=null)=>{var b,_,h,M;const{colorAttr:c}=i,p=((b=n.style)==null?void 0:b.color)||"blue";if(i.colorAttr){o.getSource(n.id)&&o.getSource(o.getSource(n.id).setData(`${o.getSource(n.id)._data.split("&props")[0]}&props=${c}`));const A=((h=(_=n.meta)==null?void 0:_.columns.find(D=>D.name===c))==null?void 0:h.values)||await ft.get(`/api-user/gis-ir/${n.id}/${c}`).then(D=>D.data.rows);n.legendAuto={color:[]},A.forEach(D=>n.legendAuto.color.push(D)),n.legendAuto.color.push({color:"#aaa",text:"Не визначено"}),n.style.color=A?["match",["get",c]].concat(A.filter(D=>D.id).reduce((D,R,z)=>D.concat([R.id,R.color||Ph[z]]),[])).concat(["#aaa"]):p}return[{id:`${n.id}`,source:`${n.id}`,lsource:i==null?void 0:i.lsource,minzoom:(+(i==null?void 0:i.minzoom)||+(i==null?void 0:i.pointZoom)||0)-0,maxzoom:+(i==null?void 0:i.maxzoom)||24,type:"fill",filter:["all",["match",["geometry-type"],["Polygon","MultiPolygon"],!0,!1]],paint:{"fill-color":["case",["boolean",["feature-state","hover"],!1],"red",["boolean",["feature-state","select"],!1],"#c356c1",(i==null?void 0:i.color)||"#0080ff"],"fill-opacity":.5}}].concat(i!=null&&i.pointZoom?[{id:`${n.id}-5`,source:(M=n.url)!=null&&M.includes(".vmt")?`${n.id}`:`${n.id}-point`,type:"circle",minzoom:0,maxzoom:((i==null?void 0:i.pointZoom)||1)-0,paint:{"circle-color":["case",["boolean",["feature-state","hover"],!1],"red",(i==null?void 0:i.color)||"blue"],"circle-stroke-width":1,"circle-stroke-color":"#fff"}}]:[]).concat(i!=null&&i.label?[{id:`${n.id}-1`,source:n.id,type:"symbol",lsource:i==null?void 0:i.lsource,minzoom:15,layout:{"text-field":i==null?void 0:i.label,"text-font":["Open Sans Regular"],"text-size":i["text-size"]||{stops:[[14,4],[18,16]]}},paint:{"text-color":i["text-color"]||"#ffffff","text-halo-color":i["text-halo-color"]||"#fff","text-halo-width":i["text-halo-width"]||0}}]:[]).concat(i!=null&&i.stroke?[{id:`${n.id}-2`,source:n.id,lsource:i==null?void 0:i.lsource,minzoom:(+(i==null?void 0:i.minzoom)||+(i==null?void 0:i.pointZoom)||0)-0,maxzoom:+(i==null?void 0:i.maxzoom)||24,type:"line",paint:{"line-color":["case",["boolean",["feature-state","select"],!1],"#c356c1",i.stroke],"line-width":["case",["boolean",["feature-state","select"],!1],3,(i.width||i["line-width"]||1)-0]}}]:[])},Fn.line=(n={},i={})=>[{id:n.id,source:n.id,lsource:i.lsource,type:"line",filter1:["all",["match",["geometry-type"],["LineString","MultiLineString","MultiPolygon","Polygon"],!0,!1]],minzoom:(i==null?void 0:i.minzoom)||n.minzoom||5,layout:{"line-join":"round","line-cap":"round"},paint:{"line-width":["case",["boolean",["feature-state","select"],!1],4,i.width||i["line-width"]||1],"line-color":["case",["boolean",["feature-state","select"],!1],"#c356c1",i.color||i["line-color"]||"#c71ccb"],"line-gap-width":i["line-gap-width"]||0}}].concat(i.label?[{id:`${n.id}-4`,source:n.id,lsource:i.lsource,type:"symbol",minzoom:14,paint:{"text-color":"#111","text-halo-color":"#fff","text-halo-width":2},layout:{"symbol-placement":"line","text-letter-spacing":.2,"text-field":i.label,"text-font":["Open Sans Regular"],"text-size":i["text-size"]||15}}]:[]),Fn.linestring=Fn.line,Fn.circle=Fn.point;async function $1(n,i,o){var h,M,A,D,R,z,j,Y,ee,oe,ue,be;typeof i.style=="string"&&(i.style=i.style[0]==="{"?JSON.parse(i.style):(h=window.YAML.parse(i.style))==null?void 0:h.style),(A=(M=i.style)==null?void 0:M.filter)==null||A.call(M,_e=>_e.source).forEach(_e=>{_e.lsource=`${i.id}-${_e.source}`});const c=((D=i==null?void 0:i.style)==null?void 0:D.type)||((ue=((j=(z=(R=i==null?void 0:i.meta)==null?void 0:R.geom)==null?void 0:z.geometry)==null?void 0:j.length)>2?["point"]:[((oe=(ee=(Y=i==null?void 0:i.meta)==null?void 0:Y.geom)==null?void 0:ee.geometry)==null?void 0:oe[0].toLowerCase())||"point"])==null?void 0:ue.map(_e=>{var Ce;return(Ce=_e==null?void 0:_e.replace)==null?void 0:Ce.call(_e,"multi","")})),p=Array.isArray(c)?c:[c],b=(await Promise.all(Array.isArray(i==null?void 0:i.style)?i.style.map(async _e=>{var Ce;return(Ce=Fn[_e.type])==null?void 0:Ce.call(Fn,i,_e,o)}):p.map(async _e=>{var Ce;return(Ce=Fn[_e])==null?void 0:Ce.call(Fn,i,i.style,o)}))).reduce((_e,Ce)=>Ce?_e.concat(Ce):_e,[]);b.forEach((_e,Ce)=>{_e.id=`${_e.id}-${Ce}`});const _=b;return(i.service==="vtile"||(be=i.url)!=null&&be.includes(".vmt"))&&_.forEach(_e=>{_e.layout||(_e.layout={}),_e.layout.visibility="visible",_e["source-layer"]=_e.lsource||i.data||n}),_}const j1={data(){return{layerList:[],layerObj:{},colors:Ph,activeLayer:"",addedLayersSettings:[],hoveredFeatureId:null}},computed:{interactiveSources(){return this.layerList.filter(n=>n==null?void 0:n.interactive).map(n=>n.id)}},methods:{moveLayers(n,i=this.map){i.getStyle().layers.forEach(o=>{o.id.match(n)&&i.moveLayer(o.id)})},getLayersBySourceId(n,i){return i.getStyle().layers.filter(c=>c.id.match(n))},async setVisible(n,i=!0,o={}){const c=typeof n=="object";try{const{style:p,map:b=this.map}=o,_=(n==null?void 0:n.id)||n,h=c?n:await this.getLayerById(_);if(!(h!=null&&h.id))throw new Error("MixinError: Layer has no id");const M=b.getStyle().layers.filter(A=>A.id.match(_));!M.length||p?await this.addToLayers({...h,...(o==null?void 0:o.data)||{},interactive:(h==null?void 0:h.interactive)!==void 0?h==null?void 0:h.interactive:!0,visible:i},{map:b,cb:o==null?void 0:o.onAddLayer}):(this.layerList=this.layerList.map(A=>A.id===h.id?{...A,visible:i}:A),M.forEach(A=>{b.setLayoutProperty(A.id,"visibility",i?"visible":"none")})),o!=null&&o.cb&&await(o==null?void 0:o.cb(h))}catch(p){console.error(p),!o.onAddLayer||o.onAddLayer({data:c?n:{id:n},message:p.message,type:"error"})}},async addToLayers(n,i={}){try{const{map:o=this==null?void 0:this.map}=i;this.layerList.find(p=>p.id===n.id)||(this.layerList=this.layerList.concat(n)),this.layerObj={...this.layerObj,[n.id]:n},n.visible?n!=null&&n.layer?await this.addVectorLayer(n,o):n.service==="vtile"?await this.addVtileLayer(n,o):n.service==="geojson"?await this.addGeojsonLayers(n,o):this.addRasterLayer(n,o):o.getStyle().layers.forEach(async p=>{p.source===n.id&&await o.setLayoutProperty(p.id,"visibility","none")}),!(i!=null&&i.cb&&(n!=null&&n.visible))||await i.cb({data:n,type:"success"}),this.moveLayers("gl-draw")}catch(o){!i.cb||i.cb({data:n,message:o.message,type:"error"}),console.error(o)}},addRasterLayer(n,i){i.addSource(n.id,{type:"raster",tiles:[(n==null?void 0:n.url)||(n==null?void 0:n.url1)],tileSize:256,...n!=null&&n.scheme?{scheme:n==null?void 0:n.scheme}:{}}),i.addLayer({id:n.id,type:"raster",source:n.id,minzoom:0,maxzoom:(n==null?void 0:n.maxzoom)||22})},async addVtileLayer(n){await this.createGeometryLayer({data:n},"vector")},async addVectorLayer(n,i){const{data:o}=await ft.get(n.layer),c={...n,source:n.id,layers:[]};Object.keys(o.sources).forEach(async p=>{await i.addSource(n.id,{type:o.sources[p].type,maxzoom:o.sources[p].maxzoom,url:o.sources[p].url})}),await o.layers.forEach(async p=>{await i.addLayer({...p,source:n.id,id:`${p.id}-${n.id}`}),c.layers=await c.layers.concat(`${p.id}-${n.id}`)})},async addGeojsonLayers(n){const i=o=>{throw this.$notify({type:"error",title:"Відсутня геометрія у обраному шарі",message:o,position:"bottom-right"}),this.layerList=this.layerList.filter(c=>c.id!==n.id),new Error(o)};if(typeof(n==null?void 0:n.geojson)=="object"){this.createGeometryLayer({data:n,geojson:n.geojson},"geojson");return}try{const o=await ft.get((n==null?void 0:n.geojson)||(n==null?void 0:n.url)),c=await o.data;if(o.statusText==="OK")this.createGeometryLayer({data:n,geojson:c},"geojson");else throw new Error((c==null?void 0:c.message)||(o==null?void 0:o.statusText)||"Error addGeojson layer")}catch(o){i(o.message),console.error(o)}},async createGeometryLayer({data:n,geojson:i},o){var h,M,A,D,R;const{map:c}=this,p=await $1(n.id,this.layerList.find(z=>z.id==n.id),c),b={type:o,cluster:((h=n==null?void 0:n.style)==null?void 0:h.cluster)||!1,clusterMaxZoom:((M=n==null?void 0:n.style)==null?void 0:M.clusterMaxZoom)||14};o==="vector"&&(b.tiles=[`${window.location.origin}${(n==null?void 0:n.geojson)||(n==null?void 0:n.url)}${n!=null&&n.version?`?ver=${n.version}`:""}${n.props?`&props=${n.props}`:""}${(A=n==null?void 0:n.style)!=null&&A.pointZoom?`&pointZoom=${n.style.pointZoom}`:""}`]),o==="geojson"&&(b.data=i||`${window.location.origin}${(n==null?void 0:n.geojson)||(n==null?void 0:n.url)}`),c.addSource(n.id,b),p.forEach(z=>{var Y;const j={...z,source:n.id,maxzoom:+(z==null?void 0:z.maxzoom)||24,minzoom:+(z==null?void 0:z.minzoom)||0,cluster:!1,clusterMaxZoom:2};c.addLayer(j),c.moveLayer(z.id),(Y=z==null?void 0:z.layout)!=null&&Y["text-field"]||this.apiLayersHover(z.id,n.id,c),this.addedLayersSettings=this.addedLayersSettings.concat(j)});const _=p.map(z=>z.type).filter(z=>z&&z!=="symbol");(R=(D=n==null?void 0:n.meta)==null?void 0:D.geom)!=null&&R.geometry&&n.meta.geom.geometry.filter(j=>!_.includes(this.geometryByType(j,!0))).forEach(j=>{this.createStyleObj({type:j,style:n.style},n.id)})},async setStyle(n,i,o=this.map){const c=(n==null?void 0:n.id)||n;o.getStyle().layers.forEach(b=>{b.source===c&&o.removeLayer(b.id)}),o.getSource(c)&&(o==null||o.removeSource(c)),this.layerList=this.layerList.map(b=>(b.id===c&&(b.style=i),b));const p=this.layerList.find(b=>b.id===c);this.addToLayers(p)},setLayerData({source:n,data:i}){const o=(n==null?void 0:n.id)||n;this.layerList=this.layerList.map(c=>c.id===o?{...c,...i}:c),this.layerObj={...this.layerObj,[n]:{...this.layerObj[n],...i}}},geometryByType(n,i=!1){if(n==="fill"||n==="Polygon"||n==="MultiPolygon")return i?"fill":"Polygon";if(n==="circle"||n==="Point"||n==="MultiPoint")return i?"circle":"Point";if(n==="line"||n==="LineString"||n==="MultiLineString")return i?"line":"LineString"},async removeLayer(n,i=this.map){const o=(n==null?void 0:n.id)||n;this.layerList=this.layerList.filter(c=>c.id!==o),await i.getStyle().layers.forEach(async c=>{c.source===o&&await i.removeLayer(c.id)}),await i.removeSource(o)},async reloadUrl(n,i=this.map){const o=(n==null?void 0:n.id)||n;await i.getStyle().layers.forEach(c=>{c.id===o&&i.removeLayer(c.id)}),await i.removeSource(o),await this.setVisible(n,!0)},async setFilter(n,i){const o=this.layerObj[n],c=await this.map.getSource(n);if(o.service==="vtile")await c.setTiles([`${window.location.origin}${o.geojson||o.url}${o.url.includes("?")?"&":"?"}filter=${i}${o.props?`&props=${o.props}`:""}`]);else if(o.service==="geojson"){const{data:p}=await ft.get((o==null?void 0:o.geojson)||`${o==null?void 0:o.url}?filter=${i}`);await this.map.getSource(n).setData(p)}},async getLayerById(n,i=null){var c;const o=(n==null?void 0:n.id)||n;try{const p=(c=this.layerList)==null?void 0:c.find(_=>_.id===o);if(p)return p;const b=await ft.get(`/api-user/gis-ir/${o}${n!=null&&n.service?`?service=${n==null?void 0:n.service}`:""}`);if(b.statusText==="OK"){const _=await b.data;return!i||await i(_),_}return this.$notify({type:"warning",message:`Шар ${o} не було знайдено!`}),null}catch(p){this.$notify({type:"warning",message:`Шар ${o} не було знайдено!`}),console.error(p)}},createStyleObj({type:n,style:i},o){const c=this.geometryByType(n,!0);if(!c)throw Error("Geomery type ERROR: Error adding missing layers");const p=`${o}-${c}`;if(this.map.getStyle().layers.find(_=>_.id===p))return;const b={id:p,type:c,source:o,"source-layer":o,layout:{},paint:{[`${c}-color`]:["case",["boolean",["feature-state","hover"],!1],"red",(i==null?void 0:i.color)||"#444e3d"],[`${c}-opacity`]:i!=null&&i.opacity||c==="fill"?.5:1},filter:["all",["==",["geometry-type"],this.geometryByType(n)]]};this.map.addLayer(b),this.addedLayersSettings=this.addedLayersSettings.concat(b),this.apiLayersHover(p,o,this.map)},apiLayersHover(n,i,o){const c=o.getSource(i),p=()=>{const b={source:i,id:this.hoveredFeatureId};return c.type==="vector"&&(b.sourceLayer=i),b};o.on("mousemove",n,b=>{b.features.length>0&&(this.hoveredFeatureId!==null&&o.setFeatureState(p(),{hover:!1}),this.hoveredFeatureId=b.features[0].id,o.setFeatureState(p(),{hover:!0}))}),o.on("mouseleave",n,()=>{this.hoveredFeatureId!==null&&o.setFeatureState(p(),{hover:!1}),this.hoveredFeatureId=null})},async changeBaseLayer(n,i=!0,o=!0){await this.setVisible(n,i);const c=(n==null?void 0:n.id)||n;c!==this.activeLayer&&(o&&this.activeLayer&&await this.setVisible(this.activeLayer,!1),this.map.getStyle().layers.forEach(p=>{p.source!==c&&p.type!=="background"&&this.map.moveLayer(p.id)}),this.activeLayer=c)},async refreshLayer(n,i=this.map){const o=(n==null?void 0:n.id)||n;await i.getStyle().layers.forEach(c=>{c.source===o&&i.removeLayer(c.id)}),await i.removeSource(o),this.layers=await this.layers.filter(c=>c.id!==o),await this.setVisible(typeof n=="object"?n:o)}}},U1={props:{objectData:{type:Array,default:()=>[]},object:{type:Object,default:()=>null},mapRef:{type:Object,default:()=>null}},computed:{currentLayer(){var o;const n=(o=this.object)==null?void 0:o.source;return this.mapRef.layerObj[n]},popupPosition(){var i,o,c;return((c=(o=(i=this.currentLayer)==null?void 0:i.setting)==null?void 0:o.popup)==null?void 0:c.position)||"horizontal"},popupWidth(){var i,o,c;return`${((c=(o=(i=this.currentLayer)==null?void 0:i.setting)==null?void 0:o.popup)==null?void 0:c.width)||240}px`},popupRows(){return this.objectData.filter(n=>n.column!=="image")},positionIsVertical(){return this.popupPosition==="vertical"}},methods:{rowValue(n){return n.value},rowTitle(n){return n.title}}},H1={key:0,class:"vsTailwind map-popup__vertical"},q1={class:"mb-1"},Z1={class:"text-sm"},W1={key:1,class:"map__popup-body"},G1=["innerHTML"],Y1={key:1};function X1(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",{class:"map-popup",style:k.normalizeStyle({"max-width":b.popupWidth,width:b.popupWidth})},[b.positionIsVertical?(k.openBlock(),k.createElementBlock("div",H1,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(b.popupRows,_=>(k.openBlock(),k.createElementBlock("div",{class:"border-b py-1 last:border-none last:pt-1 last:pb-0",key:b.rowTitle(_)},[k.createElementVNode("strong",q1,k.toDisplayString(b.rowTitle(_)),1),k.createElementVNode("div",Z1,k.toDisplayString(b.rowValue(_)),1)]))),128))])):(k.openBlock(),k.createElementBlock("table",W1,[k.createElementVNode("tbody",null,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(b.popupRows,_=>k.withDirectives((k.openBlock(),k.createElementBlock("tr",{key:b.rowTitle(_),class:"map__popup-body-item"},[k.createElementVNode("td",null,k.toDisplayString(b.rowTitle(_)),1),b.rowValue(_)?(k.openBlock(),k.createElementBlock("td",{key:0,innerHTML:b.rowValue(_)},null,8,G1)):(k.openBlock(),k.createElementBlock("td",Y1,i[0]||(i[0]=[k.createElementVNode("div",{class:"text-red-500"}," Не визначено ",-1)])))])),[[k.vShow,!b.rowValue(_).includes("id")]])),128))])]))],4)}const K1=Pt(U1,[["render",X1],["__scopeId","data-v-3f5a9aff"]]),Lg={width:200,show:!0,position:"horizontal"},J1={components:{VsPopupBody:K1},props:{aviableFields:{type:Array,default:()=>[]},mapRef:{type:[Object,Array],default:()=>{}},object:{type:[Object,Array],default:()=>{}}},data(){return{objectData:[],popupSettings:Lg}},computed:{getImage(){return this.objectData.find(n=>n.column==="image")||null},currentLayer(){var n;return(n=this.$parent.layerList)==null?void 0:n.find(i=>{var o;return(i==null?void 0:i.id)===((o=this.object)==null?void 0:o.source)})}},watch:{async object(n,i){n!==null&&(n==null?void 0:n.id)!==(i==null?void 0:i.id)||!(n!=null&&n.id)?await this.getFormatObject(n):n===null&&(this.objectData=[])}},methods:{async getFormatObject(n){var M,A,D,R,z,j;if(!n)return;const i=Object.keys(n.properties).filter(Y=>!Y.match("__text")&&!["id"].includes(Y)),{currentLayer:o}=this;if((M=o==null?void 0:o.setting)!=null&&M.popup&&(this.popupSettings=(o==null?void 0:o.setting.popup)||Lg),!(o!=null&&o.meta)){const Y=i.map(ee=>({title:ee,value:n.properties[ee]}));this.objectData=[...Y,{value:((A=n.properties)==null?void 0:A.image)||"",title:"Фото",column:"image"}];return}const c=o.meta.columns,p=i.map(Y=>{var _e,Ce,Qe,mt;const ee={},ue=Object.assign({values:[]},c.find(Ae=>Ae.name===Y));typeof ue.values!="object"&&console.warn(`Warning: Layer ${n.source} has key "values" which is not an object in meta!`);const be=ue!=null&&ue.values&&((_e=ue==null?void 0:ue.values)==null?void 0:_e.find(Ae=>(Ae==null?void 0:Ae.id)==n.properties[Y]))||null;return ee.value=(ue==null?void 0:ue.format)==="select"?this.formatBadge({text:(be==null?void 0:be.text)||((Ce=n.properties)==null?void 0:Ce[`${Y}__text`])||((Qe=n.properties)==null?void 0:Qe[Y])||"-",color:(be==null?void 0:be.color)||"#1989FA"}):(be==null?void 0:be.text)||((mt=n.properties)==null?void 0:mt[`${Y}__text`])||n.properties[Y],ee.column=Y,ee.title=(ue==null?void 0:ue[window==null?void 0:window.lang])||(ue==null?void 0:ue.ua)||(ue==null?void 0:ue.title)||Y,ee});this.objectData=[...p,{value:((D=n.properties)==null?void 0:D.image)||"",title:"Фото",column:"image"}];const b=(z=(R=o==null?void 0:o.setting)==null?void 0:R.popup)==null?void 0:z.popup,_=typeof b=="string"?b==null?void 0:b.split(","):b,h=[...this.aviableFields,...((j=o==null?void 0:o.popup)==null?void 0:j.split(","))||[],..._||[]];this.objectData=h.length?this.objectData.filter(Y=>h.includes(Y.column)||h.includes(Y.title)):[]},noInfoObject(){var c,p,b,_,h;if(!this.object)return"Інформація відсутня";const{currentLayer:n}=this,i=((p=(c=n==null?void 0:n.meta)==null?void 0:c.columns)==null?void 0:p.find(M=>(M==null?void 0:M.meta)==="title"))||((b=n==null?void 0:n.meta)==null?void 0:b.columns[0])||null;return{title:(n==null?void 0:n.name)||(n==null?void 0:n.id)||((_=this.object)==null?void 0:_.sourceLayer)||((h=this.object)==null?void 0:h.source)||"Дані по шару не знайдено",column:i}},formatBadge(n){const i=(n==null?void 0:n.text)||"-";return n!=null&&n.color?`<span >${i}</span>`:i}}},Q1={key:0},ew={key:0},tw=["src","alt"],iw={key:1},nw={class:"text-left text-sm m-b-sm"},rw={key:1,class:"text-center"};function sw(n,i,o,c,p,b){var h,M,A,D,R,z,j,Y,ee,oe,ue;const _=k.resolveComponent("VsPopupBody");return k.openBlock(),k.createElementBlock("div",{class:k.normalizeClass((((h=p.popupSettings)==null?void 0:h.position)||"horizontal")+"-position")},[p.objectData.filter(be=>be.column!=="image").length?(k.openBlock(),k.createElementBlock("div",Q1,[b.getImage&&((M=b.getImage)!=null&&M.value)?(k.openBlock(),k.createElementBlock("div",ew,[k.createElementVNode("img",{class:"popup-image",src:"files/"+b.getImage.value,alt:b.getImage.column},null,8,tw)])):k.createCommentVNode("",!0),k.createVNode(_,{"object-data":p.objectData,object:o.object,mapRef:o.mapRef},null,8,["object-data","object","mapRef"])])):(k.openBlock(),k.createElementBlock("div",iw,[(A=b.noInfoObject())!=null&&A.column?(k.openBlock(),k.createElementBlock(k.Fragment,{key:0},[k.createElementVNode("b",nw,k.toDisplayString(b.noInfoObject().title),1),k.createElementVNode("div",null,[k.createElementVNode("b",null,k.toDisplayString(((R=(D=b.noInfoObject())==null?void 0:D.column)==null?void 0:R.ua)||((j=(z=b.noInfoObject())==null?void 0:z.column)==null?void 0:j.title))+":",1),k.createTextVNode(" "+k.toDisplayString(((ue=(Y=o.object)==null?void 0:Y.properties)==null?void 0:ue[(oe=(ee=b.noInfoObject())==null?void 0:ee.column)==null?void 0:oe.name])||"-"),1)])],64)):(k.openBlock(),k.createElementBlock("div",rw,k.toDisplayString(b.noInfoObject().title),1))]))],2)}const ow={mixins:[j1],components:{VsMapPopup:Pt(J1,[["render",sw],["__scopeId","data-v-deb51e0a"]])},props:{popupVisible:{type:Boolean,default:()=>!0},map:{type:Object,default:()=>null},height:{type:String,default:()=>"400px"}},data(){var n,i,o,c;return{mapId:`gis-map-${Math.floor(Math.random()*1e3)}`,features:[],katottg:((i=(n=window.setting)==null?void 0:n.map)==null?void 0:i.katottg)||((c=(o=window.setting)==null?void 0:o.map)==null?void 0:c.city_katottg),popup:{geometry:null,map:null},cityBbox:null}},async mounted(){this.initMap()},computed:{mapRef(){return this}},methods:{initMap(){const n={version:8,glyphs:"https://fonts.openmaptiles.org/{fontstack}/{range}.pbf",sources:{},layers:[]},i=new Ud.Map({container:this.mapId,style:n,center:[0,0],zoom:1,interactive:!0});i.addControl(new Ud.NavigationControl({visualizePitch:!0})),window.addEventListener("resize",()=>{i.resize()}),i.on("load",this.onMapLoad)},async onMapLoad(n){const i=n.target;i.resize();const o={id:"graymap",name:"Сіра карта",url:"https://basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png",service:"TMS",category:"Базові карти",attribution:"&copy; <a href='http://www.openstreetmap.org/copyright'>OpenStreetMap</a>, &copy; <a href='https://carto.com/attributions'>CARTO</a>",bounds1:"ua",image:"https://basemaps.cartocdn.com/light_all/10/601/348.png",position:0,owner:"OSM",basemap:!0};await this.$emit("update:map",i),await this.setVisible(o,!0),this.$emit("load",i),this.createPopup(),this.createBoundsLayers(),this.createAtuLayer()},createPopup(){var o,c,p,b,_,h;const{map:n}=this,i=["measure","katottg","geometry","mapbox-gl-draw-hot","mapbox-gl-draw-cold"];this.popup.map=new Ud.Popup({closeOnClick:!1}).setDOMContent((c=(o=this==null?void 0:this.$refs)==null?void 0:o.popup)==null?void 0:c.$el),n&&(n.on("mousemove",M=>{var D,R;const A=n.queryRenderedFeatures(M.point).filter(z=>{var ee,oe,ue;const j=this.layerList.find(be=>be.id===z.source),Y=((oe=(ee=j==null?void 0:j.setting)==null?void 0:ee.popup)==null?void 0:oe.show)===void 0?!0:j.setting.popup.show;if((this.interactiveSources.includes(z.source)&&!((ue=z.properties)!=null&&ue.cluster)&&Y||!j&&Object.keys(z.properties).length)&&!i.includes(z.source))return z}).filter(z=>{var j,Y;return!((Y=(j=z.layer)==null?void 0:j.layout)!=null&&Y["text-field"])});A.length&&this.popupVisible?(this.features=(A==null?void 0:A[0])||null,(D=this.popup.map)==null||D.setLngLat(Object.values(M.lngLat)).addTo(n),n.getCanvas().style.cursor=A.length?"pointer":"grab"):(this.features=null,(R=this.popup.map)==null||R.remove()),this.$emit("mouseMove",{event:M,features:A})}),n.on("touchend",this.handleMapClick),n.on("click",this.handleMapClick),n.on("dblclick",M=>{const A=n.queryRenderedFeatures(M.point);this.$emit("dbclick",{features:A,event:M})}),(h=(_=(b=(p=this==null?void 0:this.$refs)==null?void 0:p.popup)==null?void 0:b.$el)==null?void 0:_.parentElement)==null||h.addEventListener("mouseenter",()=>{var M;(M=this.popup.map)==null||M.remove()}))},createBoundsLayers(){const{map:n}=this;n&&(n.addSource("bounds-dataset",{type:"geojson",data:{type:"FeatureCollection",features:[]}}),n.addLayer({id:"bounds-dataset-line",type:"line",source:"bounds-dataset",layout:{},paint:{"line-color":"#a91a9e","line-width":2}}))},handleMapClick(n){if(!this.map)return;const i=this.map.queryRenderedFeatures(n.point);if(!i.length)return;const o=i.filter(c=>this.interactiveSources.includes(c==null?void 0:c.source));this.$emit("mapClick",o)},homeZoom(){const{map:n}=this,i=this.cityBbox?this.cityBbox:[22.1352,44.3909,40.2276,52.3791];n==null||n.fitBounds(i,{duration:0,padding:10})},async createAtuLayer(){try{const n=this.katottg,{map:i}=this;if(!i){console.warn("Map error: Map hasn't loaded");return}const{data:o}=await ft.get(`https://data.gki.com.ua/api-user/atu/${n}`),c=Dg(o);this.cityBbox=c,i.addSource("atu",{type:"geojson",data:o}),i.addLayer({id:"atu",type:"line",source:"atu",paint:{"line-color":"#3b82f6","line-width":2}})}catch(n){console.error(n)}}}},aw={class:"relative"},lw=["id"];function cw(n,i,o,c,p,b){const _=k.resolveComponent("VsMapPopup");return k.openBlock(),k.createElementBlock("div",aw,[k.createElementVNode("div",{id:n.mapId,style:k.normalizeStyle({height:o.height})},null,12,lw),k.createVNode(_,{ref:"popup",object:n.features,"map-ref":b.mapRef},null,8,["object","map-ref"])])}const hw=Pt(ow,[["render",cw]]),Gr="widget-map-source",uw={components:{VsMap:hw},props:{geometry:{type:Object,default:()=>null},zoom:{type:String,default:()=>"50"}},data(){return{map:null}},mounted(){this.geometry&&this.initGeometryLayer()},watch:{geometry(){console.log(this.zoom),this.initGeometryLayer()}},methods:{initMap(){this.geometry&&this.map&&this.initGeometryLayer()},handleMapLoad(){this.initMap()},initGeometryLayer(){const{map:n}=this;if(!n)return;const i=this.formatGeojson(this.geometry),o=n.getSource(Gr);if(this.zoomToGeometry(i),o){o.setData(i);return}n.addSource(Gr,{type:"geojson",data:i}),n.addLayer({id:`${Gr}-point`,type:"circle",source:Gr,paint:{"circle-radius":10,"circle-color":"#F84C4C"},filter:["==","$type","Point"]}),n.addLayer({id:`${Gr}-polygon`,type:"fill",source:Gr,layout:{},paint:{"fill-color":"#0080ff","fill-opacity":.5},filter:["==","$type","Polygon"]}),n.addLayer({id:`${Gr}-polygon-line`,type:"line",source:Gr,layout:{},paint:{"line-color":"#0080ff","line-width":2},filter:["==","$type","Polygon"]}),n.addLayer({id:`${Gr}-line`,type:"line",source:Gr,layout:{},paint:{"line-color":"#0080ff","line-width":3},filter:["==","$type","LineString"]})},formatGeojson(n){let i=n;const o=n==null?void 0:n.type;if(Array.isArray(n))return zg(n);if(!o)throw new Error("Unknown geometry type!");return o==="FeatureCollection"?n:(o==="Feature"&&(i=[n]),!["FeatureCollection","Feature"].includes(o)&&(i=[N1(n)]),zg(i))},zoomToGeometry(n){const{map:i}=this,o=Dg(n);i.fitBounds(o,{zoom:this.zoom,padding:30,duration:0})}}};function dw(n,i,o,c,p,b){const _=k.resolveComponent("VsMap");return k.openBlock(),k.createElementBlock("div",null,[k.createVNode(_,{map:p.map,"onUpdate:map":i[0]||(i[0]=h=>p.map=h),onLoad:b.handleMapLoad},null,8,["map","onLoad"])])}const pw=Pt(uw,[["render",dw]]),Ye=(n,i=1e4)=>(n=parseFloat(n+"")||0,Math.round((n+Number.EPSILON)*i)/i),Hd=function(n){if(!(n&&n instanceof Element&&n.offsetParent))return!1;const i=n.scrollHeight>n.clientHeight,o=window.getComputedStyle(n).overflowY,c=o.indexOf("hidden")!==-1,p=o.indexOf("visible")!==-1;return i&&!c&&!p},Ah=function(n,i=void 0){return!(!n||n===document.body||i&&n===i)&&(Hd(n)?n:Ah(n.parentElement,i))},Yr=function(n){var i=new DOMParser().parseFromString(n,"text/html").body;if(i.childElementCount>1){for(var o=document.createElement("div");i.firstChild;)o.appendChild(i.firstChild);return o}return i.firstChild},qd=n=>`${n||""}`.split(" ").filter(i=>!!i),Xr=(n,i,o)=>{n&&qd(i).forEach(c=>{n.classList.toggle(c,o||!1)})};class Ia{constructor(i){Object.defineProperty(this,"pageX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pageY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientX",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"clientY",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"nativePointer",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.nativePointer=i,this.pageX=i.pageX,this.pageY=i.pageY,this.clientX=i.clientX,this.clientY=i.clientY,this.id=self.Touch&&i instanceof Touch?i.identifier:-1,this.time=Date.now()}}const Aa={passive:!1};class fw{constructor(i,{start:o=()=>!0,move:c=()=>{},end:p=()=>{}}){Object.defineProperty(this,"element",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"startCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"moveCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"endCallback",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"currentPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"startPointers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.element=i,this.startCallback=o,this.moveCallback=c,this.endCallback=p;for(const b of["onPointerStart","onTouchStart","onMove","onTouchEnd","onPointerEnd","onWindowBlur"])this[b]=this[b].bind(this);this.element.addEventListener("mousedown",this.onPointerStart,Aa),this.element.addEventListener("touchstart",this.onTouchStart,Aa),this.element.addEventListener("touchmove",this.onMove,Aa),this.element.addEventListener("touchend",this.onTouchEnd),this.element.addEventListener("touchcancel",this.onTouchEnd)}onPointerStart(i){if(!i.buttons||i.button!==0)return;const o=new Ia(i);this.currentPointers.some(c=>c.id===o.id)||this.triggerPointerStart(o,i)&&(window.addEventListener("mousemove",this.onMove),window.addEventListener("mouseup",this.onPointerEnd),window.addEventListener("blur",this.onWindowBlur))}onTouchStart(i){for(const o of Array.from(i.changedTouches||[]))this.triggerPointerStart(new Ia(o),i);window.addEventListener("blur",this.onWindowBlur)}onMove(i){const o=this.currentPointers.slice(),c="changedTouches"in i?Array.from(i.changedTouches||[]).map(b=>new Ia(b)):[new Ia(i)],p=[];for(const b of c){const _=this.currentPointers.findIndex(h=>h.id===b.id);_<0||(p.push(b),this.currentPointers[_]=b)}p.length&&this.moveCallback(i,this.currentPointers.slice(),o)}onPointerEnd(i){i.buttons>0&&i.button!==0||(this.triggerPointerEnd(i,new Ia(i)),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur))}onTouchEnd(i){for(const o of Array.from(i.changedTouches||[]))this.triggerPointerEnd(i,new Ia(o))}triggerPointerStart(i,o){return!!this.startCallback(o,i,this.currentPointers.slice())&&(this.currentPointers.push(i),this.startPointers.push(i),!0)}triggerPointerEnd(i,o){const c=this.currentPointers.findIndex(p=>p.id===o.id);c<0||(this.currentPointers.splice(c,1),this.startPointers.splice(c,1),this.endCallback(i,o,this.currentPointers.slice()))}onWindowBlur(){this.clear()}clear(){for(;this.currentPointers.length;){const i=this.currentPointers[this.currentPointers.length-1];this.currentPointers.splice(this.currentPointers.length-1,1),this.startPointers.splice(this.currentPointers.length-1,1),this.endCallback(new Event("touchend",{bubbles:!0,cancelable:!0,clientX:i.clientX,clientY:i.clientY}),i,this.currentPointers.slice())}}stop(){this.element.removeEventListener("mousedown",this.onPointerStart,Aa),this.element.removeEventListener("touchstart",this.onTouchStart,Aa),this.element.removeEventListener("touchmove",this.onMove,Aa),this.element.removeEventListener("touchend",this.onTouchEnd),this.element.removeEventListener("touchcancel",this.onTouchEnd),window.removeEventListener("mousemove",this.onMove),window.removeEventListener("mouseup",this.onPointerEnd),window.removeEventListener("blur",this.onWindowBlur)}}function Og(n,i){return i?Math.sqrt(Math.pow(i.clientX-n.clientX,2)+Math.pow(i.clientY-n.clientY,2)):0}function Bg(n,i){return i?{clientX:(n.clientX+i.clientX)/2,clientY:(n.clientY+i.clientY)/2}:n}const Zd=n=>typeof n=="object"&&n!==null&&n.constructor===Object&&Object.prototype.toString.call(n)==="[object Object]",Nn=(n,...i)=>{const o=i.length;for(let c=0;c<o;c++){const p=i[c]||{};Object.entries(p).forEach(([b,_])=>{const h=Array.isArray(_)?[]:{};n[b]||Object.assign(n,{[b]:h}),Zd(_)?Object.assign(n[b],Nn(h,_)):Array.isArray(_)?Object.assign(n,{[b]:[..._]}):Object.assign(n,{[b]:_})})}return n},Wd=function(n,i){return n.split(".").reduce((o,c)=>typeof o=="object"?o[c]:void 0,i)};class Dh{constructor(i={}){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:i}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),this.setOptions(i);for(const o of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))o.startsWith("on")&&typeof this[o]=="function"&&(this[o]=this[o].bind(this))}setOptions(i){this.options=i?Nn({},this.constructor.defaults,i):{};for(const[o,c]of Object.entries(this.option("on")||{}))this.on(o,c)}option(i,...o){let c=Wd(i,this.options);return c&&typeof c=="function"&&(c=c.call(this,this,...o)),c}optionFor(i,o,c,...p){let b=Wd(o,i);var _;typeof(_=b)!="string"||isNaN(_)||isNaN(parseFloat(_))||(b=parseFloat(b)),b==="true"&&(b=!0),b==="false"&&(b=!1),b&&typeof b=="function"&&(b=b.call(this,this,i,...p));let h=Wd(o,this.options);return h&&typeof h=="function"?b=h.call(this,this,i,...p,b):b===void 0&&(b=h),b===void 0?c:b}cn(i){const o=this.options.classes;return o&&o[i]||""}localize(i,o=[]){i=String(i).replace(/\{\{(\w+).?(\w+)?\}\}/g,(c,p,b)=>{let _="";return b?_=this.option(`${p[0]+p.toLowerCase().substring(1)}.l10n.${b}`):p&&(_=this.option(`l10n.${p}`)),_||(_=c),_});for(let c=0;c<o.length;c++)i=i.split(o[c][0]).join(o[c][1]);return i=i.replace(/\{\{(.*?)\}\}/g,(c,p)=>p)}on(i,o){let c=[];typeof i=="string"?c=i.split(" "):Array.isArray(i)&&(c=i),this.events||(this.events=new Map),c.forEach(p=>{let b=this.events.get(p);b||(this.events.set(p,[]),b=[]),b.includes(o)||b.push(o),this.events.set(p,b)})}off(i,o){let c=[];typeof i=="string"?c=i.split(" "):Array.isArray(i)&&(c=i),c.forEach(p=>{const b=this.events.get(p);if(Array.isArray(b)){const _=b.indexOf(o);_>-1&&b.splice(_,1)}})}emit(i,...o){[...this.events.get(i)||[]].forEach(c=>c(this,...o)),i!=="*"&&this.emit("*",i,...o)}}Object.defineProperty(Dh,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty(Dh,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{}});class Gd extends Dh{constructor(i={}){super(i),Object.defineProperty(this,"plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}})}attachPlugins(i={}){const o=new Map;for(const[c,p]of Object.entries(i)){const b=this.option(c),_=this.plugins[c];_||b===!1?_&&b===!1&&(_.detach(),delete this.plugins[c]):o.set(c,new p(this,b||{}))}for(const[c,p]of o)this.plugins[c]=p,p.attach()}detachPlugins(i){i=i||Object.keys(this.plugins);for(const o of i){const c=this.plugins[o];c&&c.detach(),delete this.plugins[o]}return this.emit("detachPlugins"),this}}var li;(function(n){n[n.Init=0]="Init",n[n.Error=1]="Error",n[n.Ready=2]="Ready",n[n.Panning=3]="Panning",n[n.Mousemove=4]="Mousemove",n[n.Destroy=5]="Destroy"})(li||(li={}));const ms=["a","b","c","d","e","f"],Fg={PANUP:"Move up",PANDOWN:"Move down",PANLEFT:"Move left",PANRIGHT:"Move right",ZOOMIN:"Zoom in",ZOOMOUT:"Zoom out",TOGGLEZOOM:"Toggle zoom level",TOGGLE1TO1:"Toggle zoom level",ITERATEZOOM:"Toggle zoom level",ROTATECCW:"Rotate counterclockwise",ROTATECW:"Rotate clockwise",FLIPX:"Flip horizontally",FLIPY:"Flip vertically",FITX:"Fit horizontally",FITY:"Fit vertically",RESET:"Reset",TOGGLEFS:"Toggle fullscreen"},mw={content:null,width:"auto",height:"auto",panMode:"drag",touch:!0,dragMinThreshold:3,lockAxis:!1,mouseMoveFactor:1,mouseMoveFriction:.12,zoom:!0,pinchToZoom:!0,panOnlyZoomed:"auto",minScale:1,maxScale:2,friction:.25,dragFriction:.35,decelFriction:.05,click:"toggleZoom",dblClick:!1,wheel:"zoom",wheelLimit:7,spinner:!0,bounds:"auto",infinite:!1,rubberband:!0,bounce:!0,maxVelocity:75,transformParent:!1,classes:{content:"f-panzoom__content",isLoading:"is-loading",canZoomIn:"can-zoom_in",canZoomOut:"can-zoom_out",isDraggable:"is-draggable",isDragging:"is-dragging",inFullscreen:"in-fullscreen",htmlHasFullscreen:"with-panzoom-in-fullscreen"},l10n:Fg},Ng='<circle cx="25" cy="25" r="20"></circle>',Yd='<div class="f-spinner"><svg viewBox="0 0 50 50">'+Ng+Ng+"</svg></div>",Vn=n=>n&&n!==null&&n instanceof Element&&"nodeType"in n,ni=(n,i)=>{n&&qd(i).forEach(o=>{n.classList.remove(o)})},ut=(n,i)=>{n&&qd(i).forEach(o=>{n.classList.add(o)})},zh={a:1,b:0,c:0,d:1,e:0,f:0},gw=1e5,Rh=1e4,mr="mousemove",Vg="drag",$g="content",gr="auto";let Xd=null,Kd=null;class Bo extends Gd{get fits(){return this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1}get isTouchDevice(){return Kd===null&&(Kd=window.matchMedia("(hover: none)").matches),Kd}get isMobile(){return Xd===null&&(Xd=/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)),Xd}get panMode(){return this.options.panMode!==mr||this.isTouchDevice?Vg:mr}get panOnlyZoomed(){const i=this.options.panOnlyZoomed;return i===gr?this.isTouchDevice:i}get isInfinite(){return this.option("infinite")}get angle(){return 180*Math.atan2(this.current.b,this.current.a)/Math.PI||0}get targetAngle(){return 180*Math.atan2(this.target.b,this.target.a)/Math.PI||0}get scale(){const{a:i,b:o}=this.current;return Math.sqrt(i*i+o*o)||1}get targetScale(){const{a:i,b:o}=this.target;return Math.sqrt(i*i+o*o)||1}get minScale(){return this.option("minScale")||1}get fullScale(){const{contentRect:i}=this;return i.fullWidth/i.fitWidth||1}get maxScale(){return this.fullScale*(this.option("maxScale")||1)||1}get coverScale(){const{containerRect:i,contentRect:o}=this,c=Math.max(i.height/o.fitHeight,i.width/o.fitWidth)||1;return Math.min(this.fullScale,c)}get isScaling(){return Math.abs(this.targetScale-this.scale)>1e-5&&!this.isResting}get isContentLoading(){const i=this.content;return!!(i&&i instanceof HTMLImageElement)&&!i.complete}get isResting(){if(this.isBouncingX||this.isBouncingY)return!1;for(const i of ms){const o=i=="e"||i==="f"?1e-4:1e-5;if(Math.abs(this.target[i]-this.current[i])>o)return!1}return!(!this.ignoreBounds&&!this.checkBounds().inBounds)}constructor(i,o={},c={}){var p;if(super(o),Object.defineProperty(this,"pointerTracker",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"resizeObserver",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"updateTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"rAF",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isTicking",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"ignoreBounds",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingX",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isBouncingY",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"clicks",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"trackingPoints",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"cwd",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"pmme",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"friction",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:li.Init}),Object.defineProperty(this,"isDragging",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"content",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"spinner",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"containerRect",{enumerable:!0,configurable:!0,writable:!0,value:{width:0,height:0,innerWidth:0,innerHeight:0}}),Object.defineProperty(this,"contentRect",{enumerable:!0,configurable:!0,writable:!0,value:{top:0,right:0,bottom:0,left:0,fullWidth:0,fullHeight:0,fitWidth:0,fitHeight:0,width:0,height:0}}),Object.defineProperty(this,"dragStart",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,top:0,left:0,time:0}}),Object.defineProperty(this,"dragOffset",{enumerable:!0,configurable:!0,writable:!0,value:{x:0,y:0,time:0}}),Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},zh)}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:Object.assign({},zh)}),Object.defineProperty(this,"velocity",{enumerable:!0,configurable:!0,writable:!0,value:{a:0,b:0,c:0,d:0,e:0,f:0}}),Object.defineProperty(this,"lockedAxis",{enumerable:!0,configurable:!0,writable:!0,value:!1}),!i)throw new Error("Container Element Not Found");this.container=i,this.initContent(),this.attachPlugins(Object.assign(Object.assign({},Bo.Plugins),c)),this.emit("attachPlugins"),this.emit("init");const b=this.content;if(b.addEventListener("load",this.onLoad),b.addEventListener("error",this.onError),this.isContentLoading){if(this.option("spinner")){i.classList.add(this.cn("isLoading"));const _=Yr(Yd);!i.contains(b)||b.parentElement instanceof HTMLPictureElement?this.spinner=i.appendChild(_):this.spinner=((p=b.parentElement)===null||p===void 0?void 0:p.insertBefore(_,b))||null}this.emit("beforeLoad")}else queueMicrotask(()=>{this.enable()})}initContent(){const{container:i}=this,o=this.cn($g);let c=this.option($g)||i.querySelector(`.${o}`);if(c||(c=i.querySelector("img,picture")||i.firstElementChild,c&&ut(c,o)),c instanceof HTMLPictureElement&&(c=c.querySelector("img")),!c)throw new Error("No content found");this.content=c}onLoad(){const{spinner:i,container:o,state:c}=this;i&&(i.remove(),this.spinner=null),this.option("spinner")&&o.classList.remove(this.cn("isLoading")),this.emit("afterLoad"),c===li.Init?this.enable():this.updateMetrics()}onError(){this.state!==li.Destroy&&(this.spinner&&(this.spinner.remove(),this.spinner=null),this.stop(),this.detachEvents(),this.state=li.Error,this.emit("error"))}getNextScale(i){const{fullScale:o,targetScale:c,coverScale:p,maxScale:b,minScale:_}=this;let h=_;switch(i){case"toggleMax":h=c-_<.5*(b-_)?b:_;break;case"toggleCover":h=c-_<.5*(p-_)?p:_;break;case"toggleZoom":h=c-_<.5*(o-_)?o:_;break;case"iterateZoom":let M=[1,o,b].sort((D,R)=>D-R),A=M.findIndex(D=>D>c+1e-5);h=M[A]||1}return h}attachObserver(){var i;const o=()=>{const{container:c,containerRect:p}=this;return Math.abs(p.width-c.getBoundingClientRect().width)>.1||Math.abs(p.height-c.getBoundingClientRect().height)>.1};this.resizeObserver||window.ResizeObserver===void 0||(this.resizeObserver=new ResizeObserver(()=>{this.updateTimer||(o()?(this.onResize(),this.isMobile&&(this.updateTimer=setTimeout(()=>{o()&&this.onResize(),this.updateTimer=null},500))):this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null))})),(i=this.resizeObserver)===null||i===void 0||i.observe(this.container)}detachObserver(){var i;(i=this.resizeObserver)===null||i===void 0||i.disconnect()}attachEvents(){const{container:i}=this;i.addEventListener("click",this.onClick,{passive:!1,capture:!1}),i.addEventListener("wheel",this.onWheel,{passive:!1}),this.pointerTracker=new fw(i,{start:this.onPointerDown,move:this.onPointerMove,end:this.onPointerUp}),document.addEventListener(mr,this.onMouseMove)}detachEvents(){var i;const{container:o}=this;o.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),o.removeEventListener("wheel",this.onWheel,{passive:!1}),(i=this.pointerTracker)===null||i===void 0||i.stop(),this.pointerTracker=null,document.removeEventListener(mr,this.onMouseMove),document.removeEventListener("keydown",this.onKeydown,!0),this.clickTimer&&(clearTimeout(this.clickTimer),this.clickTimer=null),this.updateTimer&&(clearTimeout(this.updateTimer),this.updateTimer=null)}animate(){this.setTargetForce();const i=this.friction,o=this.option("maxVelocity");for(const c of ms)i?(this.velocity[c]*=1-i,o&&!this.isScaling&&(this.velocity[c]=Math.max(Math.min(this.velocity[c],o),-1*o)),this.current[c]+=this.velocity[c]):this.current[c]=this.target[c];this.setTransform(),this.setEdgeForce(),!this.isResting||this.isDragging?this.rAF=requestAnimationFrame(()=>this.animate()):this.stop("current")}setTargetForce(){for(const i of ms)i==="e"&&this.isBouncingX||i==="f"&&this.isBouncingY||(this.velocity[i]=(1/(1-this.friction)-1)*(this.target[i]-this.current[i]))}checkBounds(i=0,o=0){const{current:c}=this,p=c.e+i,b=c.f+o,_=this.getBounds(),{x:h,y:M}=_,A=h.min,D=h.max,R=M.min,z=M.max;let j=0,Y=0;return A!==1/0&&p<A?j=A-p:D!==1/0&&p>D&&(j=D-p),R!==1/0&&b<R?Y=R-b:z!==1/0&&b>z&&(Y=z-b),Math.abs(j)<1e-4&&(j=0),Math.abs(Y)<1e-4&&(Y=0),Object.assign(Object.assign({},_),{xDiff:j,yDiff:Y,inBounds:!j&&!Y})}clampTargetBounds(){const{target:i}=this,{x:o,y:c}=this.getBounds();o.min!==1/0&&(i.e=Math.max(i.e,o.min)),o.max!==1/0&&(i.e=Math.min(i.e,o.max)),c.min!==1/0&&(i.f=Math.max(i.f,c.min)),c.max!==1/0&&(i.f=Math.min(i.f,c.max))}calculateContentDim(i=this.current){const{content:o,contentRect:c}=this,{fitWidth:p,fitHeight:b,fullWidth:_,fullHeight:h}=c;let M=_,A=h;if(this.option("zoom")||this.angle!==0){const D=!(o instanceof HTMLImageElement)&&(window.getComputedStyle(o).maxWidth==="none"||window.getComputedStyle(o).maxHeight==="none"),R=D?_:p,z=D?h:b,j=this.getMatrix(i),Y=new DOMPoint(0,0).matrixTransform(j),ee=new DOMPoint(0+R,0).matrixTransform(j),oe=new DOMPoint(0+R,0+z).matrixTransform(j),ue=new DOMPoint(0,0+z).matrixTransform(j),be=Math.abs(oe.x-Y.x),_e=Math.abs(oe.y-Y.y),Ce=Math.abs(ue.x-ee.x),Qe=Math.abs(ue.y-ee.y);M=Math.max(be,Ce),A=Math.max(_e,Qe)}return{contentWidth:M,contentHeight:A}}setEdgeForce(){if(this.ignoreBounds||this.isDragging||this.panMode===mr||this.targetScale<this.scale)return this.isBouncingX=!1,void(this.isBouncingY=!1);const{target:i}=this,{x:o,y:c,xDiff:p,yDiff:b}=this.checkBounds(),_=this.option("maxVelocity");let h=this.velocity.e,M=this.velocity.f;p!==0?(this.isBouncingX=!0,p*h<=0?h+=.14*p:(h=.14*p,o.min!==1/0&&(this.target.e=Math.max(i.e,o.min)),o.max!==1/0&&(this.target.e=Math.min(i.e,o.max))),_&&(h=Math.max(Math.min(h,_),-1*_))):this.isBouncingX=!1,b!==0?(this.isBouncingY=!0,b*M<=0?M+=.14*b:(M=.14*b,c.min!==1/0&&(this.target.f=Math.max(i.f,c.min)),c.max!==1/0&&(this.target.f=Math.min(i.f,c.max))),_&&(M=Math.max(Math.min(M,_),-1*_))):this.isBouncingY=!1,this.isBouncingX&&(this.velocity.e=h),this.isBouncingY&&(this.velocity.f=M)}enable(){const{content:i}=this,o=new DOMMatrixReadOnly(window.getComputedStyle(i).transform);for(const c of ms)this.current[c]=this.target[c]=o[c];this.updateMetrics(),this.attachObserver(),this.attachEvents(),this.state=li.Ready,this.emit("ready")}onClick(i){var o;i.type==="click"&&i.detail===0&&(this.dragOffset.x=0,this.dragOffset.y=0),this.isDragging&&((o=this.pointerTracker)===null||o===void 0||o.clear(),this.trackingPoints=[],this.startDecelAnim());const c=i.target;if(!c||i.defaultPrevented)return;if(c.hasAttribute("disabled"))return i.preventDefault(),void i.stopPropagation();if((()=>{const j=window.getSelection();return j&&j.type==="Range"})()&&!c.closest("button"))return;const p=c.closest("[data-panzoom-action]"),b=c.closest("[data-panzoom-change]"),_=p||b,h=_&&Vn(_)?_.dataset:null;if(h){const j=h.panzoomChange,Y=h.panzoomAction;if((j||Y)&&i.preventDefault(),j){let ee={};try{ee=JSON.parse(j)}catch{console&&console.warn("The given data was not valid JSON")}return void this.applyChange(ee)}if(Y)return void(this[Y]&&this[Y]())}if(Math.abs(this.dragOffset.x)>3||Math.abs(this.dragOffset.y)>3)return i.preventDefault(),void i.stopPropagation();if(c.closest("[data-fancybox]"))return;const M=this.content.getBoundingClientRect(),A=this.dragStart;if(A.time&&!this.canZoomOut()&&(Math.abs(M.x-A.x)>2||Math.abs(M.y-A.y)>2))return;this.dragStart.time=0;const D=j=>{this.option("zoom",i)&&j&&typeof j=="string"&&/(iterateZoom)|(toggle(Zoom|Full|Cover|Max)|(zoomTo(Fit|Cover|Max)))/.test(j)&&typeof this[j]=="function"&&(i.preventDefault(),this[j]({event:i}))},R=this.option("click",i),z=this.option("dblClick",i);z?(this.clicks++,this.clicks==1&&(this.clickTimer=setTimeout(()=>{this.clicks===1?(this.emit("click",i),!i.defaultPrevented&&R&&D(R)):(this.emit("dblClick",i),i.defaultPrevented||D(z)),this.clicks=0,this.clickTimer=null},350))):(this.emit("click",i),!i.defaultPrevented&&R&&D(R))}addTrackingPoint(i){const o=this.trackingPoints.filter(c=>c.time>Date.now()-100);o.push(i),this.trackingPoints=o}onPointerDown(i,o,c){var p;if(this.option("touch",i)===!1)return!1;this.pwt=0,this.dragOffset={x:0,y:0,time:0},this.trackingPoints=[];const b=this.content.getBoundingClientRect();if(this.dragStart={x:b.x,y:b.y,top:b.top,left:b.left,time:Date.now()},this.clickTimer)return!1;if(this.panMode===mr&&this.targetScale>1)return i.preventDefault(),i.stopPropagation(),!1;const _=i.composedPath()[0];if(!c.length){if(["TEXTAREA","OPTION","INPUT","SELECT","VIDEO","IFRAME"].includes(_.nodeName)||_.closest("[contenteditable],[data-selectable],[data-draggable],[data-clickable],[data-panzoom-change],[data-panzoom-action]"))return!1;(p=window.getSelection())===null||p===void 0||p.removeAllRanges()}if(i.type==="mousedown")["A","BUTTON"].includes(_.nodeName)||i.preventDefault();else if(Math.abs(this.velocity.a)>.3)return!1;return this.target.e=this.current.e,this.target.f=this.current.f,this.stop(),this.isDragging||(this.isDragging=!0,this.addTrackingPoint(o),this.emit("touchStart",i)),!0}onPointerMove(i,o,c){if(this.option("touch",i)===!1||!this.isDragging||o.length<2&&this.panOnlyZoomed&&Ye(this.targetScale)<=Ye(this.minScale)||(this.emit("touchMove",i),i.defaultPrevented))return;this.addTrackingPoint(o[0]);const{content:p}=this,b=Bg(c[0],c[1]),_=Bg(o[0],o[1]);let h=0,M=0;if(o.length>1){const _e=p.getBoundingClientRect();h=b.clientX-_e.left-.5*_e.width,M=b.clientY-_e.top-.5*_e.height}const A=Og(c[0],c[1]),D=Og(o[0],o[1]);let R=A?D/A:1,z=_.clientX-b.clientX,j=_.clientY-b.clientY;this.dragOffset.x+=z,this.dragOffset.y+=j,this.dragOffset.time=Date.now()-this.dragStart.time;let Y=Ye(this.targetScale)===Ye(this.minScale)&&this.option("lockAxis");if(Y&&!this.lockedAxis)if(Y==="xy"||Y==="y"||i.type==="touchmove"){if(Math.abs(this.dragOffset.x)<6&&Math.abs(this.dragOffset.y)<6)return void i.preventDefault();const _e=Math.abs(180*Math.atan2(this.dragOffset.y,this.dragOffset.x)/Math.PI);this.lockedAxis=_e>45&&_e<135?"y":"x",this.dragOffset.x=0,this.dragOffset.y=0,z=0,j=0}else this.lockedAxis=Y;if(Ah(i.target,this.content)&&(Y="x",this.dragOffset.y=0),Y&&Y!=="xy"&&this.lockedAxis!==Y&&Ye(this.targetScale)===Ye(this.minScale))return;i.cancelable&&i.preventDefault(),this.container.classList.add(this.cn("isDragging"));const ee=this.checkBounds(z,j);this.option("rubberband")?(this.isInfinite!=="x"&&(ee.xDiff>0&&z<0||ee.xDiff<0&&z>0)&&(z*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitWidth*ee.xDiff))),this.isInfinite!=="y"&&(ee.yDiff>0&&j<0||ee.yDiff<0&&j>0)&&(j*=Math.max(0,.5-Math.abs(.75/this.contentRect.fitHeight*ee.yDiff)))):(ee.xDiff&&(z=0),ee.yDiff&&(j=0));const oe=this.targetScale,ue=this.minScale,be=this.maxScale;oe<.5*ue&&(R=Math.max(R,ue)),oe>1.5*be&&(R=Math.min(R,be)),this.lockedAxis==="y"&&Ye(oe)===Ye(ue)&&(z=0),this.lockedAxis==="x"&&Ye(oe)===Ye(ue)&&(j=0),this.applyChange({originX:h,originY:M,panX:z,panY:j,scale:R,friction:this.option("dragFriction"),ignoreBounds:!0})}onPointerUp(i,o,c){if(c.length)return this.dragOffset.x=0,this.dragOffset.y=0,void(this.trackingPoints=[]);this.container.classList.remove(this.cn("isDragging")),this.isDragging&&(this.addTrackingPoint(o),this.panOnlyZoomed&&this.contentRect.width-this.contentRect.fitWidth<1&&this.contentRect.height-this.contentRect.fitHeight<1&&(this.trackingPoints=[]),Ah(i.target,this.content)&&this.lockedAxis==="y"&&(this.trackingPoints=[]),this.emit("touchEnd",i),this.isDragging=!1,this.lockedAxis=!1,this.state!==li.Destroy&&(i.defaultPrevented||this.startDecelAnim()))}startDecelAnim(){var i;const o=this.isScaling;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const _e of ms)this.velocity[_e]=0;this.target.e=this.current.e,this.target.f=this.current.f,ni(this.container,"is-scaling"),ni(this.container,"is-animating"),this.isTicking=!1;const{trackingPoints:c}=this,p=c[0],b=c[c.length-1];let _=0,h=0,M=0;b&&p&&(_=b.clientX-p.clientX,h=b.clientY-p.clientY,M=b.time-p.time);const A=((i=window.visualViewport)===null||i===void 0?void 0:i.scale)||1;A!==1&&(_*=A,h*=A);let D=0,R=0,z=0,j=0,Y=this.option("decelFriction");const ee=this.targetScale;if(M>0){z=Math.abs(_)>3?_/(M/30):0,j=Math.abs(h)>3?h/(M/30):0;const _e=this.option("maxVelocity");_e&&(z=Math.max(Math.min(z,_e),-1*_e),j=Math.max(Math.min(j,_e),-1*_e))}z&&(D=z/(1/(1-Y)-1)),j&&(R=j/(1/(1-Y)-1)),(this.option("lockAxis")==="y"||this.option("lockAxis")==="xy"&&this.lockedAxis==="y"&&Ye(ee)===this.minScale)&&(D=z=0),(this.option("lockAxis")==="x"||this.option("lockAxis")==="xy"&&this.lockedAxis==="x"&&Ye(ee)===this.minScale)&&(R=j=0);const oe=this.dragOffset.x,ue=this.dragOffset.y,be=this.option("dragMinThreshold")||0;Math.abs(oe)<be&&Math.abs(ue)<be&&(D=R=0,z=j=0),(this.option("zoom")&&(ee<this.minScale-1e-5||ee>this.maxScale+1e-5)||o&&!D&&!R)&&(Y=.35),this.applyChange({panX:D,panY:R,friction:Y}),this.emit("decel",z,j,oe,ue)}onWheel(i){var o=[-i.deltaX||0,-i.deltaY||0,-i.detail||0].reduce(function(b,_){return Math.abs(_)>Math.abs(b)?_:b});const c=Math.max(-1,Math.min(1,o));if(this.emit("wheel",i,c),this.panMode===mr||i.defaultPrevented)return;const p=this.option("wheel");p==="pan"?(i.preventDefault(),this.panOnlyZoomed&&!this.canZoomOut()||this.applyChange({panX:2*-i.deltaX,panY:2*-i.deltaY,bounce:!1})):p==="zoom"&&this.option("zoom")!==!1&&this.zoomWithWheel(i)}onMouseMove(i){this.panWithMouse(i)}onKeydown(i){i.key==="Escape"&&this.toggleFS()}onResize(){this.updateMetrics(),this.checkBounds().inBounds||this.requestTick()}setTransform(){this.emit("beforeTransform");const{current:i,target:o,content:c,contentRect:p}=this,b=Object.assign({},zh);for(const oe of ms){const ue=oe=="e"||oe==="f"?Rh:gw;b[oe]=Ye(i[oe],ue),Math.abs(o[oe]-i[oe])<(oe=="e"||oe==="f"?.51:.001)&&(i[oe]=o[oe])}let{a:_,b:h,c:M,d:A,e:D,f:R}=b,z=`matrix(${_}, ${h}, ${M}, ${A}, ${D}, ${R})`,j=c.parentElement instanceof HTMLPictureElement?c.parentElement:c;if(this.option("transformParent")&&(j=j.parentElement||j),j.style.transform===z)return;j.style.transform=z;const{contentWidth:Y,contentHeight:ee}=this.calculateContentDim();p.width=Y,p.height=ee,this.emit("afterTransform")}updateMetrics(i=!1){var o;if(!this||this.state===li.Destroy||this.isContentLoading)return;const c=Math.max(1,((o=window.visualViewport)===null||o===void 0?void 0:o.scale)||1),{container:p,content:b}=this,_=b instanceof HTMLImageElement,h=p.getBoundingClientRect(),M=getComputedStyle(this.container);let A=h.width*c,D=h.height*c;const R=parseFloat(M.paddingTop)+parseFloat(M.paddingBottom),z=A-(parseFloat(M.paddingLeft)+parseFloat(M.paddingRight)),j=D-R;this.containerRect={width:A,height:D,innerWidth:z,innerHeight:j};const Y=parseFloat(b.dataset.width||"")||(zt=>{let pi=0;return pi=zt instanceof HTMLImageElement?zt.naturalWidth:zt instanceof SVGElement?zt.width.baseVal.value:Math.max(zt.offsetWidth,zt.scrollWidth),pi||0})(b),ee=parseFloat(b.dataset.height||"")||(zt=>{let pi=0;return pi=zt instanceof HTMLImageElement?zt.naturalHeight:zt instanceof SVGElement?zt.height.baseVal.value:Math.max(zt.offsetHeight,zt.scrollHeight),pi||0})(b);let oe=this.option("width",Y)||gr,ue=this.option("height",ee)||gr;const be=oe===gr,_e=ue===gr;typeof oe!="number"&&(oe=Y),typeof ue!="number"&&(ue=ee),be&&(oe=Y*(ue/ee)),_e&&(ue=ee/(Y/oe));let Ce=b.parentElement instanceof HTMLPictureElement?b.parentElement:b;this.option("transformParent")&&(Ce=Ce.parentElement||Ce);const Qe=Ce.getAttribute("style")||"";Ce.style.setProperty("transform","none","important"),_&&(Ce.style.width="",Ce.style.height=""),Ce.offsetHeight;const mt=b.getBoundingClientRect();let Ae=mt.width*c,St=mt.height*c,wt=Ae,Nt=St;Ae=Math.min(Ae,oe),St=Math.min(St,ue),_?{width:Ae,height:St}=((zt,pi,rn,tr)=>{const Ui=rn/zt,Sr=tr/pi,jn=Math.min(Ui,Sr);return{width:zt*=jn,height:pi*=jn}})(oe,ue,Ae,St):(Ae=Math.min(Ae,oe),St=Math.min(St,ue));let Ct=.5*(Nt-St),Sn=.5*(wt-Ae);this.contentRect=Object.assign(Object.assign({},this.contentRect),{top:mt.top-h.top+Ct,bottom:h.bottom-mt.bottom+Ct,left:mt.left-h.left+Sn,right:h.right-mt.right+Sn,fitWidth:Ae,fitHeight:St,width:Ae,height:St,fullWidth:oe,fullHeight:ue}),Ce.style.cssText=Qe,_&&(Ce.style.width=`${Ae}px`,Ce.style.height=`${St}px`),this.setTransform(),i!==!0&&this.emit("refresh"),this.ignoreBounds||(Ye(this.targetScale)<Ye(this.minScale)?this.zoomTo(this.minScale,{friction:0}):this.targetScale>this.maxScale?this.zoomTo(this.maxScale,{friction:0}):this.state===li.Init||this.checkBounds().inBounds||this.requestTick()),this.updateControls()}calculateBounds(){const{contentWidth:i,contentHeight:o}=this.calculateContentDim(this.target),{targetScale:c,lockedAxis:p}=this,{fitWidth:b,fitHeight:_}=this.contentRect;let h=0,M=0,A=0,D=0;const R=this.option("infinite");if(R===!0||p&&R===p)h=-1/0,A=1/0,M=-1/0,D=1/0;else{let{containerRect:z,contentRect:j}=this,Y=Ye(b*c,Rh),ee=Ye(_*c,Rh),{innerWidth:oe,innerHeight:ue}=z;if(z.width===Y&&(oe=z.width),z.width===ee&&(ue=z.height),i>oe){A=.5*(i-oe),h=-1*A;let be=.5*(j.right-j.left);h+=be,A+=be}if(b>oe&&i<oe&&(h-=.5*(b-oe),A-=.5*(b-oe)),o>ue){D=.5*(o-ue),M=-1*D;let be=.5*(j.bottom-j.top);M+=be,D+=be}_>ue&&o<ue&&(h-=.5*(_-ue),A-=.5*(_-ue))}return{x:{min:h,max:A},y:{min:M,max:D}}}getBounds(){const i=this.option("bounds");return i!==gr?i:this.calculateBounds()}updateControls(){const i=this,o=i.container,{panMode:c,contentRect:p,targetScale:b,minScale:_}=i;let h=_,M=i.option("click")||!1;M&&(h=i.getNextScale(M));let A=i.canZoomIn(),D=i.canZoomOut(),R=c===Vg&&!!this.option("touch"),z=D&&R;if(R&&(Ye(b)<Ye(_)&&!this.panOnlyZoomed&&(z=!0),(Ye(p.width,1)>Ye(p.fitWidth,1)||Ye(p.height,1)>Ye(p.fitHeight,1))&&(z=!0)),Ye(p.width*b,1)<Ye(p.fitWidth,1)&&(z=!1),c===mr&&(z=!1),Xr(o,this.cn("isDraggable"),z),!this.option("zoom"))return;let j=A&&Ye(h)>Ye(b),Y=!j&&!z&&D&&Ye(h)<Ye(b);Xr(o,this.cn("canZoomIn"),j),Xr(o,this.cn("canZoomOut"),Y);for(const ee of o.querySelectorAll("[data-panzoom-action]")){let oe=!1,ue=!1;switch(ee.dataset.panzoomAction){case"zoomIn":A?oe=!0:ue=!0;break;case"zoomOut":D?oe=!0:ue=!0;break;case"toggleZoom":case"iterateZoom":A||D?oe=!0:ue=!0;const be=ee.querySelector("g");be&&(be.style.display=A?"":"none")}oe?(ee.removeAttribute("disabled"),ee.removeAttribute("tabindex")):ue&&(ee.setAttribute("disabled",""),ee.setAttribute("tabindex","-1"))}}panTo({x:i=this.target.e,y:o=this.target.f,scale:c=this.targetScale,friction:p=this.option("friction"),angle:b=0,originX:_=0,originY:h=0,flipX:M=!1,flipY:A=!1,ignoreBounds:D=!1}){this.state!==li.Destroy&&this.applyChange({panX:i-this.target.e,panY:o-this.target.f,scale:c/this.targetScale,angle:b,originX:_,originY:h,friction:p,flipX:M,flipY:A,ignoreBounds:D})}applyChange({panX:i=0,panY:o=0,scale:c=1,angle:p=0,originX:b=-this.current.e,originY:_=-this.current.f,friction:h=this.option("friction"),flipX:M=!1,flipY:A=!1,ignoreBounds:D=!1,bounce:R=this.option("bounce")}){const z=this.state;if(z===li.Destroy)return;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.friction=h||0,this.ignoreBounds=D;const{current:j}=this,Y=j.e,ee=j.f,oe=this.getMatrix(this.target);let ue=new DOMMatrix().translate(Y,ee).translate(b,_).translate(i,o);if(this.option("zoom")){if(!D){const be=this.targetScale,_e=this.minScale,Ce=this.maxScale;be*c<_e&&(c=_e/be),be*c>Ce&&(c=Ce/be)}ue=ue.scale(c)}ue=ue.translate(-b,-_).translate(-Y,-ee).multiply(oe),p&&(ue=ue.rotate(p)),M&&(ue=ue.scale(-1,1)),A&&(ue=ue.scale(1,-1));for(const be of ms)be!=="e"&&be!=="f"&&(ue[be]>this.minScale+1e-5||ue[be]<this.minScale-1e-5)?this.target[be]=ue[be]:this.target[be]=Ye(ue[be],Rh);(this.targetScale<this.scale||Math.abs(c-1)>.1||this.panMode===mr||R===!1)&&!D&&this.clampTargetBounds(),z===li.Init?this.animate():this.isResting||(this.state=li.Panning,this.requestTick())}stop(i=!1){if(this.state===li.Init||this.state===li.Destroy)return;const o=this.isTicking;this.rAF&&(cancelAnimationFrame(this.rAF),this.rAF=null),this.isBouncingX=!1,this.isBouncingY=!1;for(const c of ms)this.velocity[c]=0,i==="current"?this.current[c]=this.target[c]:i==="target"&&(this.target[c]=this.current[c]);this.setTransform(),ni(this.container,"is-scaling"),ni(this.container,"is-animating"),this.isTicking=!1,this.state=li.Ready,o&&(this.emit("endAnimation"),this.updateControls())}requestTick(){this.isTicking||(this.emit("startAnimation"),this.updateControls(),ut(this.container,"is-animating"),this.isScaling&&ut(this.container,"is-scaling")),this.isTicking=!0,this.rAF||(this.rAF=requestAnimationFrame(()=>this.animate()))}panWithMouse(i,o=this.option("mouseMoveFriction")){if(this.pmme=i,this.panMode!==mr||!i||Ye(this.targetScale)<=Ye(this.minScale))return;this.emit("mouseMove",i);const{container:c,containerRect:p,contentRect:b}=this,_=p.width,h=p.height,M=c.getBoundingClientRect(),A=(i.clientX||0)-M.left,D=(i.clientY||0)-M.top;let{contentWidth:R,contentHeight:z}=this.calculateContentDim(this.target);const j=this.option("mouseMoveFactor");j>1&&(R!==_&&(R*=j),z!==h&&(z*=j));let Y=.5*(R-_)-A/_*100/100*(R-_);Y+=.5*(b.right-b.left);let ee=.5*(z-h)-D/h*100/100*(z-h);ee+=.5*(b.bottom-b.top),this.applyChange({panX:Y-this.target.e,panY:ee-this.target.f,friction:o})}zoomWithWheel(i){if(this.state===li.Destroy||this.state===li.Init)return;const o=Date.now();if(o-this.pwt<45)return void i.preventDefault();this.pwt=o;var c=[-i.deltaX||0,-i.deltaY||0,-i.detail||0].reduce(function(A,D){return Math.abs(D)>Math.abs(A)?D:A});const p=Math.max(-1,Math.min(1,c)),{targetScale:b,maxScale:_,minScale:h}=this;let M=b*(100+45*p)/100;Ye(M)<Ye(h)&&Ye(b)<=Ye(h)?(this.cwd+=Math.abs(p),M=h):Ye(M)>Ye(_)&&Ye(b)>=Ye(_)?(this.cwd+=Math.abs(p),M=_):(this.cwd=0,M=Math.max(Math.min(M,_),h)),this.cwd>this.option("wheelLimit")||(i.preventDefault(),Ye(M)!==Ye(b)&&this.zoomTo(M,{event:i}))}canZoomIn(){return this.option("zoom")&&(Ye(this.contentRect.width,1)<Ye(this.contentRect.fitWidth,1)||Ye(this.targetScale)<Ye(this.maxScale))}canZoomOut(){return this.option("zoom")&&Ye(this.targetScale)>Ye(this.minScale)}zoomIn(i=1.25,o){this.zoomTo(this.targetScale*i,o)}zoomOut(i=.8,o){this.zoomTo(this.targetScale*i,o)}zoomToFit(i){this.zoomTo("fit",i)}zoomToCover(i){this.zoomTo("cover",i)}zoomToFull(i){this.zoomTo("full",i)}zoomToMax(i){this.zoomTo("max",i)}toggleZoom(i){this.zoomTo(this.getNextScale("toggleZoom"),i)}toggleMax(i){this.zoomTo(this.getNextScale("toggleMax"),i)}toggleCover(i){this.zoomTo(this.getNextScale("toggleCover"),i)}iterateZoom(i){this.zoomTo("next",i)}zoomTo(i=1,{friction:o=gr,originX:c=gr,originY:p=gr,event:b}={}){if(this.isContentLoading||this.state===li.Destroy)return;const{targetScale:_,fullScale:h,maxScale:M,coverScale:A}=this;if(this.stop(),this.panMode===mr&&(b=this.pmme||b),b||c===gr||p===gr){const R=this.content.getBoundingClientRect(),z=this.container.getBoundingClientRect(),j=b?b.clientX:z.left+.5*z.width,Y=b?b.clientY:z.top+.5*z.height;c=j-R.left-.5*R.width,p=Y-R.top-.5*R.height}let D=1;typeof i=="number"?D=i:i==="full"?D=h:i==="cover"?D=A:i==="max"?D=M:i==="fit"?D=1:i==="next"&&(D=this.getNextScale("iterateZoom")),D=D/_||1,o=o===gr?D>1?.15:.25:o,this.applyChange({scale:D,originX:c,originY:p,friction:o}),b&&this.panMode===mr&&this.panWithMouse(b,o)}rotateCCW(){this.applyChange({angle:-90})}rotateCW(){this.applyChange({angle:90})}flipX(){this.applyChange({flipX:!0})}flipY(){this.applyChange({flipY:!0})}fitX(){this.stop("target");const{containerRect:i,contentRect:o,target:c}=this;this.applyChange({panX:.5*i.width-(o.left+.5*o.fitWidth)-c.e,panY:.5*i.height-(o.top+.5*o.fitHeight)-c.f,scale:i.width/o.fitWidth/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}fitY(){this.stop("target");const{containerRect:i,contentRect:o,target:c}=this;this.applyChange({panX:.5*i.width-(o.left+.5*o.fitWidth)-c.e,panY:.5*i.innerHeight-(o.top+.5*o.fitHeight)-c.f,scale:i.height/o.fitHeight/this.targetScale,originX:0,originY:0,ignoreBounds:!0})}toggleFS(){const{container:i}=this,o=this.cn("inFullscreen"),c=this.cn("htmlHasFullscreen");i.classList.toggle(o);const p=i.classList.contains(o);p?(document.documentElement.classList.add(c),document.addEventListener("keydown",this.onKeydown,!0)):(document.documentElement.classList.remove(c),document.removeEventListener("keydown",this.onKeydown,!0)),this.updateMetrics(),this.emit(p?"enterFS":"exitFS")}getMatrix(i=this.current){const{a:o,b:c,c:p,d:b,e:_,f:h}=i;return new DOMMatrix([o,c,p,b,_,h])}reset(i){if(this.state!==li.Init&&this.state!==li.Destroy){this.stop("current");for(const o of ms)this.target[o]=zh[o];this.target.a=this.minScale,this.target.d=this.minScale,this.clampTargetBounds(),this.isResting||(this.friction=i===void 0?this.option("friction"):i,this.state=li.Panning,this.requestTick())}}destroy(){this.stop(),this.state=li.Destroy,this.detachEvents(),this.detachObserver();const{container:i,content:o}=this,c=this.option("classes")||{};for(const p of Object.values(c))i.classList.remove(p+"");o&&(o.removeEventListener("load",this.onLoad),o.removeEventListener("error",this.onError)),this.detachPlugins()}}Object.defineProperty(Bo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:mw}),Object.defineProperty(Bo,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:{}});const jg=function(n,i){let o=!0;return(...c)=>{o&&(o=!1,n(...c),setTimeout(()=>{o=!0},i))}},Ug=(n,i)=>{let o=[];return n.childNodes.forEach(c=>{c.nodeType!==Node.ELEMENT_NODE||i&&!c.matches(i)||o.push(c)}),o},yw={viewport:null,track:null,enabled:!0,slides:[],axis:"x",transition:"fade",preload:1,slidesPerPage:"auto",initialPage:0,friction:.12,Panzoom:{decelFriction:.12},center:!0,infinite:!0,fill:!0,dragFree:!1,adaptiveHeight:!1,direction:"ltr",classes:{container:"f-carousel",viewport:"f-carousel__viewport",track:"f-carousel__track",slide:"f-carousel__slide",isLTR:"is-ltr",isRTL:"is-rtl",isHorizontal:"is-horizontal",isVertical:"is-vertical",inTransition:"in-transition",isSelected:"is-selected"},l10n:{NEXT:"Next slide",PREV:"Previous slide",GOTO:"Go to slide #%d"}};var Bi;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Destroy=2]="Destroy"})(Bi||(Bi={}));const Jd=n=>{if(typeof n=="string"||n instanceof HTMLElement)n={html:n};else{const i=n.thumb;i!==void 0&&(typeof i=="string"&&(n.thumbSrc=i),i instanceof HTMLImageElement&&(n.thumbEl=i,n.thumbElSrc=i.src,n.thumbSrc=i.src),delete n.thumb)}return Object.assign({html:"",el:null,isDom:!1,class:"",customClass:"",index:-1,dim:0,gap:0,pos:0,transition:!1},n)},_w=(n={})=>Object.assign({index:-1,slides:[],dim:0,pos:-1},n);class Or extends Dh{constructor(i,o){super(o),Object.defineProperty(this,"instance",{enumerable:!0,configurable:!0,writable:!0,value:i})}attach(){}detach(){}}const xw={classes:{list:"f-carousel__dots",isDynamic:"is-dynamic",hasDots:"has-dots",dot:"f-carousel__dot",isBeforePrev:"is-before-prev",isPrev:"is-prev",isCurrent:"is-current",isNext:"is-next",isAfterNext:"is-after-next"},dotTpl:'<button type="button" data-carousel-page="%i" aria-label="{{GOTO}}"><span class="f-carousel__dot" aria-hidden="true"></span></button>',dynamicFrom:11,maxCount:1/0,minCount:2};class Hg extends Or{constructor(){super(...arguments),Object.defineProperty(this,"isDynamic",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"list",{enumerable:!0,configurable:!0,writable:!0,value:null})}onRefresh(){this.refresh()}build(){let i=this.list;if(!i){i=document.createElement("ul"),ut(i,this.cn("list")),i.setAttribute("role","tablist");const o=this.instance.container;o.appendChild(i),ut(o,this.cn("hasDots")),this.list=i}return i}refresh(){var i;const o=this.instance.pages.length,c=Math.min(2,this.option("minCount")),p=Math.max(2e3,this.option("maxCount")),b=this.option("dynamicFrom");if(o<c||o>p)return void this.cleanup();const _=typeof b=="number"&&o>5&&o>=b,h=!this.list||this.isDynamic!==_||this.list.children.length!==o;h&&this.cleanup();const M=this.build();if(Xr(M,this.cn("isDynamic"),!!_),h)for(let R=0;R<o;R++)M.append(this.createItem(R));let A,D=0;for(const R of[...M.children]){const z=D===this.instance.page;z&&(A=R),Xr(R,this.cn("isCurrent"),z),(i=R.children[0])===null||i===void 0||i.setAttribute("aria-selected",z?"true":"false");for(const j of["isBeforePrev","isPrev","isNext","isAfterNext"])ni(R,this.cn(j));D++}if(A=A||M.firstChild,_&&A){const R=A.previousElementSibling,z=R&&R.previousElementSibling;ut(R,this.cn("isPrev")),ut(z,this.cn("isBeforePrev"));const j=A.nextElementSibling,Y=j&&j.nextElementSibling;ut(j,this.cn("isNext")),ut(Y,this.cn("isAfterNext"))}this.isDynamic=_}createItem(i=0){var o;const c=document.createElement("li");c.setAttribute("role","presentation");const p=Yr(this.instance.localize(this.option("dotTpl"),[["%d",i+1]]).replace(/\%i/g,i+""));return c.appendChild(p),(o=c.children[0])===null||o===void 0||o.setAttribute("role","tab"),c}cleanup(){this.list&&(this.list.remove(),this.list=null),this.isDynamic=!1,ni(this.instance.container,this.cn("hasDots"))}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Hg,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:xw});const Lh="disabled",Oh="next",qg="prev";class Zg extends Or{constructor(){super(...arguments),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prev",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"next",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"isDom",{enumerable:!0,configurable:!0,writable:!0,value:!1})}onRefresh(){const i=this.instance,o=i.pages.length,c=i.page;if(o<2)return void this.cleanup();this.build();let p=this.prev,b=this.next;p&&b&&(p.removeAttribute(Lh),b.removeAttribute(Lh),i.isInfinite||(c<=0&&p.setAttribute(Lh,""),c>=o-1&&b.setAttribute(Lh,"")))}addBtn(i){var o;const c=this.instance,p=document.createElement("button");p.setAttribute("tabindex","0"),p.setAttribute("title",c.localize(`{{${i.toUpperCase()}}}`)),ut(p,this.cn("button")+" "+this.cn(i===Oh?"isNext":"isPrev"));const b=c.isRTL?i===Oh?qg:Oh:i;var _;return p.innerHTML=c.localize(this.option(`${b}Tpl`)),p.dataset[`carousel${_=i,_?_.match("^[a-z]")?_.charAt(0).toUpperCase()+_.substring(1):_:""}`]="true",(o=this.container)===null||o===void 0||o.appendChild(p),p}build(){const i=this.instance.container,o=this.cn("container");let{container:c,prev:p,next:b}=this;c||(c=i.querySelector("."+o),this.isDom=!!c),c||(c=document.createElement("div"),ut(c,o),i.appendChild(c)),this.container=c,b||(b=c.querySelector("[data-carousel-next]")),b||(b=this.addBtn(Oh)),this.next=b,p||(p=c.querySelector("[data-carousel-prev]")),p||(p=this.addBtn(qg)),this.prev=p}cleanup(){this.isDom||(this.prev&&this.prev.remove(),this.next&&this.next.remove(),this.container&&this.container.remove()),this.prev=null,this.next=null,this.container=null,this.isDom=!1}attach(){this.instance.on(["refresh","change"],this.onRefresh)}detach(){this.instance.off(["refresh","change"],this.onRefresh),this.cleanup()}}Object.defineProperty(Zg,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{classes:{container:"f-carousel__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"},nextTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M9 3l9 9-9 9"/></svg>',prevTpl:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M15 3l-9 9 9 9"/></svg>'}});class Wg extends Or{constructor(){super(...arguments),Object.defineProperty(this,"selectedIndex",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"target",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"nav",{enumerable:!0,configurable:!0,writable:!0,value:null})}addAsTargetFor(i){this.target=this.instance,this.nav=i,this.attachEvents()}addAsNavFor(i){this.nav=this.instance,this.target=i,this.attachEvents()}attachEvents(){const{nav:i,target:o}=this;i&&o&&(i.options.initialSlide=o.options.initialPage,i.state===Bi.Ready?this.onNavReady(i):i.on("ready",this.onNavReady),o.state===Bi.Ready?this.onTargetReady(o):o.on("ready",this.onTargetReady))}onNavReady(i){i.on("createSlide",this.onNavCreateSlide),i.on("Panzoom.click",this.onNavClick),i.on("Panzoom.touchEnd",this.onNavTouch),this.onTargetChange()}onTargetReady(i){i.on("change",this.onTargetChange),i.on("Panzoom.refresh",this.onTargetChange),this.onTargetChange()}onNavClick(i,o,c){this.onNavTouch(i,i.panzoom,c)}onNavTouch(i,o,c){var p,b;if(Math.abs(o.dragOffset.x)>3||Math.abs(o.dragOffset.y)>3)return;const _=c.target,{nav:h,target:M}=this;if(!h||!M||!_)return;const A=_.closest("[data-index]");if(c.stopPropagation(),c.preventDefault(),!A)return;const D=parseInt(A.dataset.index||"",10)||0,R=M.getPageForSlide(D),z=h.getPageForSlide(D);h.slideTo(z),M.slideTo(R,{friction:((b=(p=this.nav)===null||p===void 0?void 0:p.plugins)===null||b===void 0?void 0:b.Sync.option("friction"))||0}),this.markSelectedSlide(D)}onNavCreateSlide(i,o){o.index===this.selectedIndex&&this.markSelectedSlide(o.index)}onTargetChange(){var i,o;const{target:c,nav:p}=this;if(!c||!p||p.state!==Bi.Ready||c.state!==Bi.Ready)return;const b=(o=(i=c.pages[c.page])===null||i===void 0?void 0:i.slides[0])===null||o===void 0?void 0:o.index,_=p.getPageForSlide(b);this.markSelectedSlide(b),p.slideTo(_,p.prevPage===null&&c.prevPage===null?{friction:0}:void 0)}markSelectedSlide(i){const o=this.nav;o&&o.state===Bi.Ready&&(this.selectedIndex=i,[...o.slides].map(c=>{c.el&&c.el.classList[c.index===i?"add":"remove"]("is-nav-selected")}))}attach(){const i=this;let o=i.options.target,c=i.options.nav;o?i.addAsNavFor(o):c&&i.addAsTargetFor(c)}detach(){const i=this,o=i.nav,c=i.target;o&&(o.off("ready",i.onNavReady),o.off("createSlide",i.onNavCreateSlide),o.off("Panzoom.click",i.onNavClick),o.off("Panzoom.touchEnd",i.onNavTouch)),i.nav=null,c&&(c.off("ready",i.onTargetReady),c.off("refresh",i.onTargetChange),c.off("change",i.onTargetChange)),i.target=null}}Object.defineProperty(Wg,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{friction:.35}});const bw={Navigation:Zg,Dots:Hg,Sync:Wg},Bh="animationend",Gg="isSelected",Fh="slide";class Fo extends Gd{get axis(){return this.isHorizontal?"e":"f"}get isEnabled(){return this.state===Bi.Ready}get isInfinite(){let i=!1;const{contentDim:o,viewportDim:c,pages:p,slides:b}=this,_=b[0];return p.length>=2&&_&&o+_.dim>=c&&(i=this.option("infinite")),i}get isRTL(){return this.option("direction")==="rtl"}get isHorizontal(){return this.option("axis")==="x"}constructor(i,o={},c={}){if(super(),Object.defineProperty(this,"bp",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"lp",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"userOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Bi.Init}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"prevPage",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"viewport",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"slides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"pages",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"panzoom",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"inTransition",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"contentDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"viewportDim",{enumerable:!0,configurable:!0,writable:!0,value:0}),typeof i=="string"&&(i=document.querySelector(i)),!i||!Vn(i))throw new Error("No Element found");this.container=i,this.slideNext=jg(this.slideNext.bind(this),150),this.slidePrev=jg(this.slidePrev.bind(this),150),this.userOptions=o,this.userPlugins=c,queueMicrotask(()=>{this.processOptions()})}processOptions(){var i,o;const c=Nn({},Fo.defaults,this.userOptions);let p="";const b=c.breakpoints;if(b&&Zd(b))for(const[_,h]of Object.entries(b))window.matchMedia(_).matches&&Zd(h)&&(p+=_,Nn(c,h));p===this.bp&&this.state!==Bi.Init||(this.bp=p,this.state===Bi.Ready&&(c.initialSlide=((o=(i=this.pages[this.page])===null||i===void 0?void 0:i.slides[0])===null||o===void 0?void 0:o.index)||0),this.state!==Bi.Init&&this.destroy(),super.setOptions(c),this.option("enabled")===!1?this.attachEvents():setTimeout(()=>{this.init()},0))}init(){this.state=Bi.Init,this.emit("init"),this.attachPlugins(Object.assign(Object.assign({},Fo.Plugins),this.userPlugins)),this.emit("attachPlugins"),this.initLayout(),this.initSlides(),this.updateMetrics(),this.setInitialPosition(),this.initPanzoom(),this.attachEvents(),this.state=Bi.Ready,this.emit("ready")}initLayout(){const{container:i}=this,o=this.option("classes");ut(i,this.cn("container")),Xr(i,o.isLTR,!this.isRTL),Xr(i,o.isRTL,this.isRTL),Xr(i,o.isVertical,!this.isHorizontal),Xr(i,o.isHorizontal,this.isHorizontal);let c=this.option("viewport")||i.querySelector(`.${o.viewport}`);c||(c=document.createElement("div"),ut(c,o.viewport),c.append(...Ug(i,`.${o.slide}`)),i.prepend(c)),c.addEventListener("scroll",this.onScroll);let p=this.option("track")||i.querySelector(`.${o.track}`);p||(p=document.createElement("div"),ut(p,o.track),p.append(...Array.from(c.childNodes))),p.setAttribute("aria-live","polite"),c.contains(p)||c.prepend(p),this.viewport=c,this.track=p,this.emit("initLayout")}initSlides(){const{track:i}=this;if(!i)return;const o=[...this.slides],c=[];[...Ug(i,`.${this.cn(Fh)}`)].forEach(p=>{if(Vn(p)){const b=Jd({el:p,isDom:!0,index:this.slides.length});c.push(b)}});for(let p of[...this.option("slides",[])||[],...o])c.push(Jd(p));this.slides=c;for(let p=0;p<this.slides.length;p++)this.slides[p].index=p;for(const p of c)this.emit("beforeInitSlide",p,p.index),this.emit("initSlide",p,p.index);this.emit("initSlides")}setInitialPage(){const i=this.option("initialSlide");this.page=typeof i=="number"?this.getPageForSlide(i):parseInt(this.option("initialPage",0)+"",10)||0}setInitialPosition(){const{track:i,pages:o,isHorizontal:c}=this;if(!i||!o.length)return;let p=this.page;o[p]||(this.page=p=0);const b=(o[p].pos||0)*(this.isRTL&&c?1:-1),_=c?`${b}px`:"0",h=c?"0":`${b}px`;i.style.transform=`translate3d(${_}, ${h}, 0) scale(1)`,this.option("adaptiveHeight")&&this.setViewportHeight()}initPanzoom(){this.panzoom&&(this.panzoom.destroy(),this.panzoom=null);const i=this.option("Panzoom")||{};this.panzoom=new Bo(this.viewport,Nn({},{content:this.track,zoom:!1,panOnlyZoomed:!1,lockAxis:this.isHorizontal?"x":"y",infinite:this.isInfinite,click:!1,dblClick:!1,touch:o=>!(this.pages.length<2&&!o.options.infinite),bounds:()=>this.getBounds(),maxVelocity:o=>Math.abs(o.target[this.axis]-o.current[this.axis])<2*this.viewportDim?100:0},i)),this.panzoom.on("*",(o,c,...p)=>{this.emit(`Panzoom.${c}`,o,...p)}),this.panzoom.on("decel",this.onDecel),this.panzoom.on("refresh",this.onRefresh),this.panzoom.on("beforeTransform",this.onBeforeTransform),this.panzoom.on("endAnimation",this.onEndAnimation)}attachEvents(){const i=this.container;i&&(i.addEventListener("click",this.onClick,{passive:!1,capture:!1}),i.addEventListener("slideTo",this.onSlideTo)),window.addEventListener("resize",this.onResize)}createPages(){let i=[];const{contentDim:o,viewportDim:c}=this;let p=this.option("slidesPerPage");p=(p==="auto"||o<=c)&&this.option("fill")!==!1?1/0:parseFloat(p+"");let b=0,_=0,h=0;for(const M of this.slides)(!i.length||_+M.dim-c>.05||h>=p)&&(i.push(_w()),b=i.length-1,_=0,h=0),i[b].slides.push(M),_+=M.dim+M.gap,h++;return i}processPages(){const i=this.pages,{contentDim:o,viewportDim:c,isInfinite:p}=this,b=this.option("center"),_=this.option("fill"),h=_&&b&&o>c&&!p;if(i.forEach((D,R)=>{var z;D.index=R,D.pos=((z=D.slides[0])===null||z===void 0?void 0:z.pos)||0,D.dim=0;for(const[j,Y]of D.slides.entries())D.dim+=Y.dim,j<D.slides.length-1&&(D.dim+=Y.gap);h&&D.pos+.5*D.dim<.5*c?D.pos=0:h&&D.pos+.5*D.dim>=o-.5*c?D.pos=o-c:b&&(D.pos+=-.5*(c-D.dim))}),i.forEach(D=>{_&&!p&&o>c&&(D.pos=Math.max(D.pos,0),D.pos=Math.min(D.pos,o-c)),D.pos=Ye(D.pos,1e3),D.dim=Ye(D.dim,1e3),Math.abs(D.pos)<=.1&&(D.pos=0)}),p)return i;const M=[];let A;return i.forEach(D=>{const R=Object.assign({},D);A&&R.pos===A.pos?(A.dim+=R.dim,A.slides=[...A.slides,...R.slides]):(R.index=M.length,A=R,M.push(R))}),M}getPageFromIndex(i=0){const o=this.pages.length;let c;return i=parseInt((i||0).toString())||0,c=this.isInfinite?(i%o+o)%o:Math.max(Math.min(i,o-1),0),c}getSlideMetrics(i){var o,c;const p=this.isHorizontal?"width":"height";let b=0,_=0,h=i.el;const M=!(!h||h.parentNode);if(h?b=parseFloat(h.dataset[p]||"")||0:(h=document.createElement("div"),h.style.visibility="hidden",(this.track||document.body).prepend(h)),ut(h,this.cn(Fh)+" "+i.class+" "+i.customClass),b)h.style[p]=`${b}px`,h.style[p==="width"?"height":"width"]="";else{M&&(this.track||document.body).prepend(h),b=h.getBoundingClientRect()[p]*Math.max(1,((o=window.visualViewport)===null||o===void 0?void 0:o.scale)||1);let D=h[this.isHorizontal?"offsetWidth":"offsetHeight"];D-1>b&&(b=D)}const A=getComputedStyle(h);return A.boxSizing==="content-box"&&(this.isHorizontal?(b+=parseFloat(A.paddingLeft)||0,b+=parseFloat(A.paddingRight)||0):(b+=parseFloat(A.paddingTop)||0,b+=parseFloat(A.paddingBottom)||0)),_=parseFloat(A[this.isHorizontal?"marginRight":"marginBottom"])||0,M?(c=h.parentElement)===null||c===void 0||c.removeChild(h):i.el||h.remove(),{dim:Ye(b,1e3),gap:Ye(_,1e3)}}getBounds(){const{isInfinite:i,isRTL:o,isHorizontal:c,pages:p}=this;let b={min:0,max:0};if(i)b={min:-1/0,max:1/0};else if(p.length){const _=p[0].pos,h=p[p.length-1].pos;b=o&&c?{min:_,max:h}:{min:-1*h,max:-1*_}}return{x:c?b:{min:0,max:0},y:c?{min:0,max:0}:b}}repositionSlides(){let i,{isHorizontal:o,isRTL:c,isInfinite:p,viewport:b,viewportDim:_,contentDim:h,page:M,pages:A,slides:D,panzoom:R}=this,z=0,j=0,Y=0,ee=0;R?ee=-1*R.current[this.axis]:A[M]&&(ee=A[M].pos||0),i=o?c?"right":"left":"top",c&&o&&(ee*=-1);for(const _e of D){const Ce=_e.el;Ce?(i==="top"?(Ce.style.right="",Ce.style.left=""):Ce.style.top="",_e.index!==z?Ce.style[i]=j===0?"":`${Ye(j,1e3)}px`:Ce.style[i]="",Y+=_e.dim+_e.gap,z++):j+=_e.dim+_e.gap}if(p&&Y&&b){let _e=getComputedStyle(b),Ce="padding",Qe=o?"Right":"Bottom",mt=parseFloat(_e[Ce+(o?"Left":"Top")]);ee-=mt,_+=mt,_+=parseFloat(_e[Ce+Qe]);for(const Ae of D)Ae.el&&(Ye(Ae.pos)<Ye(_)&&Ye(Ae.pos+Ae.dim+Ae.gap)<Ye(ee)&&Ye(ee)>Ye(h-_)&&(Ae.el.style[i]=`${Ye(j+Y,1e3)}px`),Ye(Ae.pos+Ae.gap)>=Ye(h-_)&&Ye(Ae.pos)>Ye(ee+_)&&Ye(ee)<Ye(_)&&(Ae.el.style[i]=`-${Ye(Y,1e3)}px`))}let oe,ue,be=[...this.inTransition];if(be.length>1&&(oe=A[be[0]],ue=A[be[1]]),oe&&ue){let _e=0;for(const Ce of D)Ce.el?this.inTransition.has(Ce.index)&&oe.slides.indexOf(Ce)<0&&(Ce.el.style[i]=`${Ye(_e+(oe.pos-ue.pos),1e3)}px`):_e+=Ce.dim+Ce.gap}}createSlideEl(i){const{track:o,slides:c}=this;if(!o||!i||i.el&&i.el.parentNode)return;const p=i.el||document.createElement("div");ut(p,this.cn(Fh)),ut(p,i.class),ut(p,i.customClass);const b=i.html;b&&(b instanceof HTMLElement?p.appendChild(b):p.innerHTML=i.html+"");const _=[];c.forEach((D,R)=>{D.el&&_.push(R)});const h=i.index;let M=null;_.length&&(M=c[_.reduce((D,R)=>Math.abs(R-h)<Math.abs(D-h)?R:D)]);const A=M&&M.el&&M.el.parentNode?M.index<i.index?M.el.nextSibling:M.el:null;o.insertBefore(p,o.contains(A)?A:null),i.el=p,this.emit("createSlide",i)}removeSlideEl(i,o=!1){const c=i==null?void 0:i.el;if(!c||!c.parentNode)return;const p=this.cn(Gg);if(c.classList.contains(p)&&(ni(c,p),this.emit("unselectSlide",i)),i.isDom&&!o)return c.removeAttribute("aria-hidden"),c.removeAttribute("data-index"),void(c.style.left="");this.emit("removeSlide",i);const b=new CustomEvent(Bh);c.dispatchEvent(b),i.el&&(i.el.remove(),i.el=null)}transitionTo(i=0,o=this.option("transition")){var c,p,b,_;if(!o)return!1;const h=this.page,{pages:M,panzoom:A}=this;i=parseInt((i||0).toString())||0;const D=this.getPageFromIndex(i);if(!A||!M[D]||M.length<2||Math.abs((((p=(c=M[h])===null||c===void 0?void 0:c.slides[0])===null||p===void 0?void 0:p.dim)||0)-this.viewportDim)>1)return!1;let R=i>h?1:-1;this.isInfinite&&(h===0&&i===M.length-1&&(R=-1),h===M.length-1&&i===0&&(R=1));const z=M[D].pos*(this.isRTL?1:-1);if(h===D&&Math.abs(z-A.target[this.axis])<1)return!1;this.clearTransitions();const j=A.isResting;ut(this.container,this.cn("inTransition"));const Y=((b=M[h])===null||b===void 0?void 0:b.slides[0])||null,ee=((_=M[D])===null||_===void 0?void 0:_.slides[0])||null;this.inTransition.add(ee.index),this.createSlideEl(ee);let oe=Y.el,ue=ee.el;j||o===Fh||(o="fadeFast",oe=null);const be=this.isRTL?"next":"prev",_e=this.isRTL?"prev":"next";return oe&&(this.inTransition.add(Y.index),Y.transition=o,oe.addEventListener(Bh,this.onAnimationEnd),oe.classList.add(`f-${o}Out`,`to-${R>0?_e:be}`)),ue&&(ee.transition=o,ue.addEventListener(Bh,this.onAnimationEnd),ue.classList.add(`f-${o}In`,`from-${R>0?be:_e}`)),A.current[this.axis]=z,A.target[this.axis]=z,A.requestTick(),this.onChange(D),!0}manageSlideVisiblity(){const i=new Set,o=new Set,c=this.getVisibleSlides(parseFloat(this.option("preload",0)+"")||0);for(const p of this.slides)c.has(p)?i.add(p):o.add(p);for(const p of this.inTransition)i.add(this.slides[p]);for(const p of i)this.createSlideEl(p),this.lazyLoadSlide(p);for(const p of o)i.has(p)||this.removeSlideEl(p);this.markSelectedSlides(),this.repositionSlides()}markSelectedSlides(){if(!this.pages[this.page]||!this.pages[this.page].slides)return;const i="aria-hidden";let o=this.cn(Gg);if(o)for(const c of this.slides){const p=c.el;p&&(p.dataset.index=`${c.index}`,p.classList.contains("f-thumbs__slide")?this.getVisibleSlides(0).has(c)?p.removeAttribute(i):p.setAttribute(i,"true"):this.pages[this.page].slides.includes(c)?(p.classList.contains(o)||(ut(p,o),this.emit("selectSlide",c)),p.removeAttribute(i)):(p.classList.contains(o)&&(ni(p,o),this.emit("unselectSlide",c)),p.setAttribute(i,"true")))}}flipInfiniteTrack(){const{axis:i,isHorizontal:o,isInfinite:c,isRTL:p,viewportDim:b,contentDim:_}=this,h=this.panzoom;if(!h||!c)return;let M=h.current[i],A=h.target[i]-M,D=0,R=.5*b;p&&o?(M<-R&&(D=-1,M+=_),M>_-R&&(D=1,M-=_)):(M>R&&(D=1,M-=_),M<-_+R&&(D=-1,M+=_)),D&&(h.current[i]=M,h.target[i]=M+A)}lazyLoadImg(i,o){const c=this,p="f-fadeIn",b="is-preloading";let _=!1,h=null;const M=()=>{_||(_=!0,h&&(h.remove(),h=null),ni(o,b),o.complete&&(ut(o,p),setTimeout(()=>{ni(o,p)},350)),this.option("adaptiveHeight")&&i.el&&this.pages[this.page].slides.indexOf(i)>-1&&(c.updateMetrics(),c.setViewportHeight()),this.emit("load",i))};ut(o,b),o.src=o.dataset.lazySrcset||o.dataset.lazySrc||"",delete o.dataset.lazySrc,delete o.dataset.lazySrcset,o.addEventListener("error",()=>{M()}),o.addEventListener("load",()=>{M()}),setTimeout(()=>{const A=o.parentNode;A&&i.el&&(o.complete?M():_||(h=Yr(Yd),A.insertBefore(h,o)))},300)}lazyLoadSlide(i){const o=i&&i.el;if(!o)return;const c=new Set;let p=Array.from(o.querySelectorAll("[data-lazy-src],[data-lazy-srcset]"));o.dataset.lazySrc&&p.push(o),p.map(b=>{b instanceof HTMLImageElement?c.add(b):b instanceof HTMLElement&&b.dataset.lazySrc&&(b.style.backgroundImage=`url('${b.dataset.lazySrc}')`,delete b.dataset.lazySrc)});for(const b of c)this.lazyLoadImg(i,b)}onAnimationEnd(i){var o;const c=i.target,p=c?parseInt(c.dataset.index||"",10)||0:-1,b=this.slides[p],_=i.animationName;if(!c||!b||!_)return;const h=!!this.inTransition.has(p)&&b.transition;h&&_.substring(0,h.length+2)===`f-${h}`&&this.inTransition.delete(p),this.inTransition.size||this.clearTransitions(),p===this.page&&(!((o=this.panzoom)===null||o===void 0)&&o.isResting)&&this.emit("settle")}onDecel(i,o=0,c=0,p=0,b=0){if(this.option("dragFree"))return void this.setPageFromPosition();const{isRTL:_,isHorizontal:h,axis:M,pages:A}=this,D=A.length,R=Math.abs(Math.atan2(c,o)/(Math.PI/180));let z=0;if(z=R>45&&R<135?h?0:c:h?o:0,!D)return;let j=this.page,Y=_&&h?1:-1;const ee=i.current[M]*Y;let{pageIndex:oe}=this.getPageFromPosition(ee);Math.abs(z)>5?(A[j].dim<document.documentElement["client"+(this.isHorizontal?"Width":"Height")]-1&&(j=oe),j=_&&h?z<0?j-1:j+1:z<0?j+1:j-1):j=p===0&&b===0?j:oe,this.slideTo(j,{transition:!1,friction:i.option("decelFriction")})}onClick(i){const o=i.target,c=o&&Vn(o)?o.dataset:null;let p,b;c&&(c.carouselPage!==void 0?(b="slideTo",p=c.carouselPage):c.carouselNext!==void 0?b="slideNext":c.carouselPrev!==void 0&&(b="slidePrev")),b?(i.preventDefault(),i.stopPropagation(),o&&!o.hasAttribute("disabled")&&this[b](p)):this.emit("click",i)}onSlideTo(i){const o=i.detail||0;this.slideTo(this.getPageForSlide(o),{friction:0})}onChange(i,o=0){const c=this.page;this.prevPage=c,this.page=i,this.option("adaptiveHeight")&&this.setViewportHeight(),i!==c&&(this.markSelectedSlides(),this.emit("change",i,c,o))}onRefresh(){let i=this.contentDim,o=this.viewportDim;this.updateMetrics(),this.contentDim===i&&this.viewportDim===o||this.slideTo(this.page,{friction:0,transition:!1})}onScroll(){var i;(i=this.viewport)===null||i===void 0||i.scroll(0,0)}onResize(){this.option("breakpoints")&&this.processOptions()}onBeforeTransform(i){this.lp!==i.current[this.axis]&&(this.flipInfiniteTrack(),this.manageSlideVisiblity()),this.lp=i.current.e}onEndAnimation(){this.inTransition.size||this.emit("settle")}reInit(i=null,o=null){this.destroy(),this.state=Bi.Init,this.prevPage=null,this.userOptions=i||this.userOptions,this.userPlugins=o||this.userPlugins,this.processOptions()}slideTo(i=0,{friction:o=this.option("friction"),transition:c=this.option("transition")}={}){if(this.state===Bi.Destroy)return;i=parseInt((i||0).toString())||0;const p=this.getPageFromIndex(i),{axis:b,isHorizontal:_,isRTL:h,pages:M,panzoom:A}=this,D=M.length,R=h&&_?1:-1;if(!A||!D)return;if(this.page!==p){const j=new Event("beforeChange",{bubbles:!0,cancelable:!0});if(this.emit("beforeChange",j,i),j.defaultPrevented)return}if(this.transitionTo(i,c))return;let z=M[p].pos;if(this.isInfinite){const j=this.contentDim,Y=A.target[b]*R;D===2?z+=j*Math.floor(parseFloat(i+"")/2):z=[z,z-j,z+j].reduce(function(ee,oe){return Math.abs(oe-Y)<Math.abs(ee-Y)?oe:ee})}z*=R,Math.abs(A.target[b]-z)<1||(A.panTo({x:_?z:0,y:_?0:z,friction:o}),this.onChange(p))}slideToClosest(i){if(this.panzoom){const{pageIndex:o}=this.getPageFromPosition();this.slideTo(o,i)}}slideNext(){this.slideTo(this.page+1)}slidePrev(){this.slideTo(this.page-1)}clearTransitions(){this.inTransition.clear(),ni(this.container,this.cn("inTransition"));const i=["to-prev","to-next","from-prev","from-next"];for(const o of this.slides){const c=o.el;if(c){c.removeEventListener(Bh,this.onAnimationEnd),c.classList.remove(...i);const p=o.transition;p&&c.classList.remove(`f-${p}Out`,`f-${p}In`)}}this.manageSlideVisiblity()}addSlide(i,o){var c,p,b,_;const h=this.panzoom,M=((c=this.pages[this.page])===null||c===void 0?void 0:c.pos)||0,A=((p=this.pages[this.page])===null||p===void 0?void 0:p.dim)||0,D=this.contentDim<this.viewportDim;let R=Array.isArray(o)?o:[o];const z=[];for(const j of R)z.push(Jd(j));this.slides.splice(i,0,...z);for(let j=0;j<this.slides.length;j++)this.slides[j].index=j;for(const j of z)this.emit("beforeInitSlide",j,j.index);if(this.page>=i&&(this.page+=z.length),this.updateMetrics(),h){const j=((b=this.pages[this.page])===null||b===void 0?void 0:b.pos)||0,Y=((_=this.pages[this.page])===null||_===void 0?void 0:_.dim)||0,ee=this.pages.length||1,oe=this.isRTL?A-Y:Y-A,ue=this.isRTL?M-j:j-M;D&&ee===1?(i<=this.page&&(h.current[this.axis]-=oe,h.target[this.axis]-=oe),h.panTo({[this.isHorizontal?"x":"y"]:-1*j})):ue&&i<=this.page&&(h.target[this.axis]-=ue,h.current[this.axis]-=ue,h.requestTick())}for(const j of z)this.emit("initSlide",j,j.index)}prependSlide(i){this.addSlide(0,i)}appendSlide(i){this.addSlide(this.slides.length,i)}removeSlide(i){const o=this.slides.length;i=(i%o+o)%o;const c=this.slides[i];if(c){this.removeSlideEl(c,!0),this.slides.splice(i,1);for(let p=0;p<this.slides.length;p++)this.slides[p].index=p;this.updateMetrics(),this.slideTo(this.page,{friction:0,transition:!1}),this.emit("destroySlide",c)}}updateMetrics(){const{panzoom:i,viewport:o,track:c,slides:p,isHorizontal:b,isInfinite:_}=this;if(!c)return;const h=b?"width":"height",M=b?"offsetWidth":"offsetHeight";if(o){let R=Math.max(o[M],Ye(o.getBoundingClientRect()[h],1e3)),z=getComputedStyle(o),j="padding",Y=b?"Right":"Bottom";R-=parseFloat(z[j+(b?"Left":"Top")])+parseFloat(z[j+Y]),this.viewportDim=R}let A,D=0;for(const[R,z]of p.entries()){let j=0,Y=0;!z.el&&A?(j=A.dim,Y=A.gap):({dim:j,gap:Y}=this.getSlideMetrics(z),A=z),j=Ye(j,1e3),Y=Ye(Y,1e3),z.dim=j,z.gap=Y,z.pos=D,D+=j,(_||R<p.length-1)&&(D+=Y)}D=Ye(D,1e3),this.contentDim=D,i&&(i.contentRect[h]=D,i.contentRect[b?"fullWidth":"fullHeight"]=D),this.pages=this.createPages(),this.pages=this.processPages(),this.state===Bi.Init&&this.setInitialPage(),this.page=Math.max(0,Math.min(this.page,this.pages.length-1)),this.manageSlideVisiblity(),this.emit("refresh")}getProgress(i,o=!1,c=!1){i===void 0&&(i=this.page);const p=this,b=p.panzoom,_=p.contentDim,h=p.pages[i]||0;if(!h||!b)return i>this.page?-1:1;let M=-1*b.current.e,A=Ye((M-h.pos)/(1*h.dim),1e3),D=A,R=A;this.isInfinite&&c!==!0&&(D=Ye((M-h.pos+_)/(1*h.dim),1e3),R=Ye((M-h.pos-_)/(1*h.dim),1e3));let z=[A,D,R].reduce(function(j,Y){return Math.abs(Y)<Math.abs(j)?Y:j});return o?z:z>1?1:z<-1?-1:z}setViewportHeight(){const{page:i,pages:o,viewport:c,isHorizontal:p}=this;if(!c||!o[i])return;let b=0;p&&this.track&&(this.track.style.height="auto",o[i].slides.forEach(_=>{_.el&&(b=Math.max(b,_.el.offsetHeight))})),c.style.height=b?`${b}px`:""}getPageForSlide(i){for(const o of this.pages)for(const c of o.slides)if(c.index===i)return o.index;return-1}getVisibleSlides(i=0){var o;const c=new Set;let{panzoom:p,contentDim:b,viewportDim:_,pages:h,page:M}=this;if(_){b=b+((o=this.slides[this.slides.length-1])===null||o===void 0?void 0:o.gap)||0;let A=0;A=p&&p.state!==li.Init&&p.state!==li.Destroy?-1*p.current[this.axis]:h[M]&&h[M].pos||0,this.isInfinite&&(A-=Math.floor(A/b)*b),this.isRTL&&this.isHorizontal&&(A*=-1);const D=A-_*i,R=A+_*(i+1),z=this.isInfinite?[-1,0,1]:[0];for(const j of this.slides)for(const Y of z){const ee=j.pos+Y*b,oe=ee+j.dim+j.gap;ee<R&&oe>D&&c.add(j)}}return c}getPageFromPosition(i){const{viewportDim:o,contentDim:c,slides:p,pages:b,panzoom:_}=this,h=b.length,M=p.length,A=p[0],D=p[M-1],R=this.option("center");let z=0,j=0,Y=0,ee=i===void 0?-1*((_==null?void 0:_.target[this.axis])||0):i;R&&(ee+=.5*o),this.isInfinite?(ee<A.pos-.5*D.gap&&(ee-=c,Y=-1),ee>D.pos+D.dim+.5*D.gap&&(ee-=c,Y=1)):ee=Math.max(A.pos||0,Math.min(ee,D.pos));let oe=D,ue=p.find(be=>{const _e=be.pos-.5*oe.gap,Ce=be.pos+be.dim+.5*be.gap;return oe=be,ee>=_e&&ee<Ce});return ue||(ue=D),j=this.getPageForSlide(ue.index),z=j+Y*h,{page:z,pageIndex:j}}setPageFromPosition(){const{pageIndex:i}=this.getPageFromPosition();this.onChange(i)}destroy(){if([Bi.Destroy].includes(this.state))return;this.state=Bi.Destroy;const{container:i,viewport:o,track:c,slides:p,panzoom:b}=this,_=this.option("classes");i.removeEventListener("click",this.onClick,{passive:!1,capture:!1}),i.removeEventListener("slideTo",this.onSlideTo),window.removeEventListener("resize",this.onResize),b&&(b.destroy(),this.panzoom=null),p&&p.forEach(M=>{this.removeSlideEl(M)}),this.detachPlugins(),o&&(o.removeEventListener("scroll",this.onScroll),o.offsetParent&&c&&c.offsetParent&&o.replaceWith(...c.childNodes));for(const[M,A]of Object.entries(_))M!=="container"&&A&&i.classList.remove(A);this.track=null,this.viewport=null,this.page=0,this.slides=[];const h=this.events.get("ready");this.events=new Map,h&&this.events.set("ready",h)}}Object.defineProperty(Fo,"Panzoom",{enumerable:!0,configurable:!0,writable:!0,value:Bo}),Object.defineProperty(Fo,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:yw}),Object.defineProperty(Fo,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:bw});const Yg=function(n){if(!Vn(n))return 0;const i=window.scrollY,o=window.innerHeight,c=i+o,p=n.getBoundingClientRect(),b=p.y+i,_=p.height,h=b+_;if(i>h||c<b)return 0;if(i<b&&c>h||b<i&&h>c)return 100;let M=_;b<i&&(M-=i-b),h>c&&(M-=h-c);const A=M/o*100;return Math.round(A)},Gl=!(typeof window>"u"||!window.document||!window.document.createElement);let Qd;const ep=["a[href]","area[href]",'input:not([disabled]):not([type="hidden"]):not([aria-hidden])',"select:not([disabled]):not([aria-hidden])","textarea:not([disabled]):not([aria-hidden])","button:not([disabled]):not([aria-hidden]):not(.fancybox-focus-guard)","iframe","object","embed","video","audio","[contenteditable]",'[tabindex]:not([tabindex^="-"]):not([disabled]):not([aria-hidden])'].join(","),Xg=n=>{if(n&&Gl){Qd===void 0&&document.createElement("div").focus({get preventScroll(){return Qd=!0,!1}});try{if(Qd)n.focus({preventScroll:!0});else{const i=window.scrollY||document.body.scrollTop,o=window.scrollX||document.body.scrollLeft;n.focus(),document.body.scrollTo({top:i,left:o,behavior:"auto"})}}catch{}}},Kg=()=>{const n=document;let i,o="",c="",p="";return n.fullscreenEnabled?(o="requestFullscreen",c="exitFullscreen",p="fullscreenElement"):n.webkitFullscreenEnabled&&(o="webkitRequestFullscreen",c="webkitExitFullscreen",p="webkitFullscreenElement"),o&&(i={request:function(b=n.documentElement){return o==="webkitRequestFullscreen"?b[o](Element.ALLOW_KEYBOARD_INPUT):b[o]()},exit:function(){return n[p]&&n[c]()},isFullscreen:function(){return n[p]}}),i},tp={animated:!0,autoFocus:!0,backdropClick:"close",Carousel:{classes:{container:"fancybox__carousel",viewport:"fancybox__viewport",track:"fancybox__track",slide:"fancybox__slide"}},closeButton:"auto",closeExisting:!1,commonCaption:!1,compact:()=>window.matchMedia("(max-width: 578px), (max-height: 578px)").matches,contentClick:"toggleZoom",contentDblClick:!1,defaultType:"image",defaultDisplay:"flex",dragToClose:!0,Fullscreen:{autoStart:!1},groupAll:!1,groupAttr:"data-fancybox",hideClass:"f-fadeOut",hideScrollbar:!0,idle:3500,keyboard:{Escape:"close",Delete:"close",Backspace:"close",PageUp:"next",PageDown:"prev",ArrowUp:"prev",ArrowDown:"next",ArrowRight:"next",ArrowLeft:"prev"},l10n:Object.assign(Object.assign({},Fg),{CLOSE:"Close",NEXT:"Next",PREV:"Previous",MODAL:"You can close this modal content with the ESC key",ERROR:"Something Went Wrong, Please Try Again Later",IMAGE_ERROR:"Image Not Found",ELEMENT_NOT_FOUND:"HTML Element Not Found",AJAX_NOT_FOUND:"Error Loading AJAX : Not Found",AJAX_FORBIDDEN:"Error Loading AJAX : Forbidden",IFRAME_ERROR:"Error Loading Page",TOGGLE_ZOOM:"Toggle zoom level",TOGGLE_THUMBS:"Toggle thumbnails",TOGGLE_SLIDESHOW:"Toggle slideshow",TOGGLE_FULLSCREEN:"Toggle full-screen mode",DOWNLOAD:"Download"}),parentEl:null,placeFocusBack:!0,showClass:"f-zoomInUp",startIndex:0,tpl:{closeButton:'<button data-fancybox-close class="f-button is-close-btn" title="{{CLOSE}}"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" tabindex="-1"><path d="M20 20L4 4m16 0L4 20"/></svg></button>',main:`<div class="fancybox__container" role="dialog" aria-modal="true" aria-label="{{MODAL}}" tabindex="-1">
616
+ <div class="fancybox__backdrop"></div>
617
+ <div class="fancybox__carousel"></div>
618
+ <div class="fancybox__footer"></div>
619
+ </div>`},trapFocus:!0,wheel:"zoom"};var Gi,dn;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Closing=2]="Closing",n[n.CustomClosing=3]="CustomClosing",n[n.Destroy=4]="Destroy"})(Gi||(Gi={})),function(n){n[n.Loading=0]="Loading",n[n.Opening=1]="Opening",n[n.Ready=2]="Ready",n[n.Closing=3]="Closing"}(dn||(dn={}));let Jg="",Yl=!1,Nh=!1,No=null;const Qg=()=>{let n="",i="";const o=$t.getInstance();if(o){const c=o.carousel,p=o.getSlide();if(c&&p){let b=p.slug||void 0,_=p.triggerEl||void 0;i=b||o.option("slug")||"",!i&&_&&_.dataset&&(i=_.dataset.fancybox||""),i&&i!=="true"&&(n="#"+i+(!b&&c.slides.length>1?"-"+(p.index+1):""))}}return{hash:n,slug:i,index:1}},Vh=()=>{const n=new URL(document.URL).hash,i=n.slice(1).split("-"),o=i[i.length-1],c=o&&/^\+?\d+$/.test(o)&&parseInt(i.pop()||"1",10)||1;return{hash:n,slug:i.join("-"),index:c}},ey=()=>{const{slug:n,index:i}=Vh();if(!n)return;let o=document.querySelector(`[data-slug="${n}"]`);if(o&&o.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),$t.getInstance())return;const c=document.querySelectorAll(`[data-fancybox="${n}"]`);c.length&&(o=c[i-1],o&&o.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},ty=()=>{if($t.defaults.Hash===!1)return;const n=$t.getInstance();if((n==null?void 0:n.options.Hash)===!1)return;const{slug:i,index:o}=Vh(),{slug:c}=Qg();n&&(i===c?n.jumpTo(o-1):(Yl=!0,n.close())),ey()},iy=()=>{No&&clearTimeout(No),queueMicrotask(()=>{ty()})},ny=()=>{window.addEventListener("hashchange",iy,!1),setTimeout(()=>{ty()},500)};Gl&&(/complete|interactive|loaded/.test(document.readyState)?ny():document.addEventListener("DOMContentLoaded",ny));const $h="is-zooming-in";class ry extends Or{onCreateSlide(i,o,c){const p=this.instance.optionFor(c,"src")||"";c.el&&c.type==="image"&&typeof p=="string"&&this.setImage(c,p)}onRemoveSlide(i,o,c){c.panzoom&&c.panzoom.destroy(),c.panzoom=void 0,c.imageEl=void 0}onChange(i,o,c,p){ni(this.instance.container,$h);for(const b of o.slides){const _=b.panzoom;_&&b.index!==c&&_.reset(.35)}}onClose(){var i;const o=this.instance,c=o.container,p=o.getSlide();if(!c||!c.parentElement||!p)return;const{el:b,contentEl:_,panzoom:h,thumbElSrc:M}=p;if(!b||!M||!_||!h||h.isContentLoading||h.state===li.Init||h.state===li.Destroy)return;h.updateMetrics();let A=this.getZoomInfo(p);if(!A)return;this.instance.state=Gi.CustomClosing,c.classList.remove($h),c.classList.add("is-zooming-out"),_.style.backgroundImage=`url('${M}')`;const D=c.getBoundingClientRect();(((i=window.visualViewport)===null||i===void 0?void 0:i.scale)||1)===1&&Object.assign(c.style,{position:"absolute",top:`${c.offsetTop+window.scrollY}px`,left:`${c.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${D.width}px`,height:`${D.height}px`,overflow:"hidden"});const{x:R,y:z,scale:j,opacity:Y}=A;if(Y){const ee=((oe,ue,be,_e)=>{const Ce=ue-oe,Qe=_e-be;return mt=>be+((mt-oe)/Ce*Qe||0)})(h.scale,j,1,0);h.on("afterTransform",()=>{_.style.opacity=ee(h.scale)+""})}h.on("endAnimation",()=>{o.destroy()}),h.target.a=j,h.target.b=0,h.target.c=0,h.target.d=j,h.panTo({x:R,y:z,scale:j,friction:Y?.2:.33,ignoreBounds:!0}),h.isResting&&o.destroy()}setImage(i,o){const c=this.instance;i.src=o,this.process(i,o).then(p=>{const{contentEl:b,imageEl:_,thumbElSrc:h,el:M}=i;if(c.isClosing()||!b||!_)return;b.offsetHeight;const A=!!c.isOpeningSlide(i)&&this.getZoomInfo(i);if(this.option("protected")&&M){M.addEventListener("contextmenu",z=>{z.preventDefault()});const R=document.createElement("div");ut(R,"fancybox-protected"),b.appendChild(R)}if(h&&A){const R=p.contentRect,z=Math.max(R.fullWidth,R.fullHeight);let j=null;!A.opacity&&z>1200&&(j=document.createElement("img"),ut(j,"fancybox-ghost"),j.src=h,b.appendChild(j));const Y=()=>{j&&(ut(j,"f-fadeFastOut"),setTimeout(()=>{j&&(j.remove(),j=null)},200))};(D=h,new Promise((ee,oe)=>{const ue=new Image;ue.onload=ee,ue.onerror=oe,ue.src=D})).then(()=>{c.hideLoading(i),i.state=dn.Opening,this.instance.emit("reveal",i),this.zoomIn(i).then(()=>{Y(),this.instance.done(i)},()=>{}),j&&setTimeout(()=>{Y()},z>2500?800:200)},()=>{c.hideLoading(i),c.revealContent(i)})}else{const R=this.optionFor(i,"initialSize"),z=this.optionFor(i,"zoom"),j={event:c.prevMouseMoveEvent||c.options.event,friction:z?.12:0};let Y=c.optionFor(i,"showClass")||void 0,ee=!0;c.isOpeningSlide(i)&&(R==="full"?p.zoomToFull(j):R==="cover"?p.zoomToCover(j):R==="max"?p.zoomToMax(j):ee=!1,p.stop("current")),ee&&Y&&(Y=p.isDragging?"f-fadeIn":""),c.hideLoading(i),c.revealContent(i,Y)}var D},()=>{c.setError(i,"{{IMAGE_ERROR}}")})}process(i,o){return new Promise((c,p)=>{var b;const _=this.instance,h=i.el;_.clearContent(i),_.showLoading(i);let M=this.optionFor(i,"content");if(typeof M=="string"&&(M=Yr(M)),!M||!Vn(M)){if(M=document.createElement("img"),M instanceof HTMLImageElement){let A="",D=i.caption;A=typeof D=="string"&&D?D.replace(/<[^>]+>/gi,"").substring(0,1e3):`Image ${i.index+1} of ${((b=_.carousel)===null||b===void 0?void 0:b.pages.length)||1}`,M.src=o||"",M.alt=A,M.draggable=!1,i.srcset&&M.setAttribute("srcset",i.srcset),this.instance.isOpeningSlide(i)&&(M.fetchPriority="high")}i.sizes&&M.setAttribute("sizes",i.sizes)}ut(M,"fancybox-image"),i.imageEl=M,_.setContent(i,M,!1),i.panzoom=new Bo(h,Nn({transformParent:!0},this.option("Panzoom")||{},{content:M,width:(A,D)=>_.optionFor(i,"width","auto",D)||"auto",height:(A,D)=>_.optionFor(i,"height","auto",D)||"auto",wheel:()=>{const A=_.option("wheel");return(A==="zoom"||A=="pan")&&A},click:(A,D)=>{var R,z;if(_.isCompact||_.isClosing()||i.index!==((R=_.getSlide())===null||R===void 0?void 0:R.index))return!1;if(D){const Y=D.composedPath()[0];if(["A","BUTTON","TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].includes(Y.nodeName))return!1}let j=!D||D.target&&((z=i.contentEl)===null||z===void 0?void 0:z.contains(D.target));return _.option(j?"contentClick":"backdropClick")||!1},dblClick:()=>_.isCompact?"toggleZoom":_.option("contentDblClick")||!1,spinner:!1,panOnlyZoomed:!0,wheelLimit:1/0,on:{ready:A=>{c(A)},error:()=>{p()},destroy:()=>{p()}}}))})}zoomIn(i){return new Promise((o,c)=>{const p=this.instance,b=p.container,{panzoom:_,contentEl:h,el:M}=i;_&&_.updateMetrics();const A=this.getZoomInfo(i);if(!(A&&M&&h&&_&&b))return void c();const{x:D,y:R,scale:z,opacity:j}=A,Y=()=>{i.state!==dn.Closing&&(j&&(h.style.opacity=Math.max(Math.min(1,1-(1-_.scale)/(1-z)),0)+""),_.scale>=1&&_.scale>_.targetScale-.1&&o(_))},ee=be=>{(be.scale<.99||be.scale>1.01)&&!be.isDragging||(ni(b,$h),h.style.opacity="",be.off("endAnimation",ee),be.off("touchStart",ee),be.off("afterTransform",Y),o(be))};_.on("endAnimation",ee),_.on("touchStart",ee),_.on("afterTransform",Y),_.on(["error","destroy"],()=>{c()}),_.panTo({x:D,y:R,scale:z,friction:0,ignoreBounds:!0}),_.stop("current");const oe={event:_.panMode==="mousemove"?p.prevMouseMoveEvent||p.options.event:void 0},ue=this.optionFor(i,"initialSize");ut(b,$h),p.hideLoading(i),ue==="full"?_.zoomToFull(oe):ue==="cover"?_.zoomToCover(oe):ue==="max"?_.zoomToMax(oe):_.reset(.172)})}getZoomInfo(i){const{el:o,imageEl:c,thumbEl:p,panzoom:b}=i,_=this.instance,h=_.container;if(!o||!c||!p||!b||Yg(p)<3||!this.optionFor(i,"zoom")||!h||_.state===Gi.Destroy||getComputedStyle(h).getPropertyValue("--f-images-zoom")==="0")return!1;const M=window.visualViewport||null;if((M?M.scale:1)!==1)return!1;let{top:A,left:D,width:R,height:z}=p.getBoundingClientRect(),{top:j,left:Y,fitWidth:ee,fitHeight:oe}=b.contentRect;if(!(R&&z&&ee&&oe))return!1;const ue=b.container.getBoundingClientRect();Y+=ue.left,j+=ue.top;const be=-1*(Y+.5*ee-(D+.5*R)),_e=-1*(j+.5*oe-(A+.5*z)),Ce=R/ee;let Qe=this.option("zoomOpacity")||!1;return Qe==="auto"&&(Qe=Math.abs(R/z-ee/oe)>.1),{x:be,y:_e,scale:Ce,opacity:Qe}}attach(){const i=this,o=i.instance;o.on("Carousel.change",i.onChange),o.on("Carousel.createSlide",i.onCreateSlide),o.on("Carousel.removeSlide",i.onRemoveSlide),o.on("close",i.onClose)}detach(){const i=this,o=i.instance;o.off("Carousel.change",i.onChange),o.off("Carousel.createSlide",i.onCreateSlide),o.off("Carousel.removeSlide",i.onRemoveSlide),o.off("close",i.onClose)}}Object.defineProperty(ry,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{initialSize:"fit",Panzoom:{maxScale:1},protected:!1,zoom:!0,zoomOpacity:"auto"}}),typeof SuppressedError=="function"&&SuppressedError;const ip="html",sy="image",np="map",gs="youtube",Vo="vimeo",Xl="html5video",oy=(n,i={})=>{const o=new URL(n),c=new URLSearchParams(o.search),p=new URLSearchParams;for(const[h,M]of[...c,...Object.entries(i)]){let A=M+"";if(h==="t"){let D=A.match(/((\d*)m)?(\d*)s?/);D&&p.set("start",60*parseInt(D[2]||"0")+parseInt(D[3]||"0")+"")}else p.set(h,A)}let b=p+"",_=n.match(/#t=((.*)?\d+s)/);return _&&(b+=`#t=${_[1]}`),b},vw={ajax:null,autoSize:!0,iframeAttr:{allow:"autoplay; fullscreen",scrolling:"auto"},preload:!0,videoAutoplay:!0,videoRatio:16/9,videoTpl:`<video class="fancybox__html5video" playsinline controls controlsList="nodownload" poster="{{poster}}">
620
+ <source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},ww=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class ay extends Or{onBeforeInitSlide(i,o,c){this.processType(c)}onCreateSlide(i,o,c){this.setContent(c)}onClearContent(i,o){o.xhr&&(o.xhr.abort(),o.xhr=null);const c=o.iframeEl;c&&(c.onload=c.onerror=null,c.src="//about:blank",o.iframeEl=null);const p=o.contentEl,b=o.placeholderEl;if(o.type==="inline"&&p&&b)p.classList.remove("fancybox__content"),getComputedStyle(p).getPropertyValue("display")!=="none"&&(p.style.display="none"),setTimeout(()=>{b&&(p&&b.parentNode&&b.parentNode.insertBefore(p,b),b.remove())},0),o.contentEl=void 0,o.placeholderEl=void 0;else for(;o.el&&o.el.firstChild;)o.el.removeChild(o.el.firstChild)}onSelectSlide(i,o,c){c.state===dn.Ready&&this.playVideo()}onUnselectSlide(i,o,c){var p,b;if(c.type===Xl){try{(b=(p=c.el)===null||p===void 0?void 0:p.querySelector("video"))===null||b===void 0||b.pause()}catch{}return}let _;c.type===Vo?_={method:"pause",value:"true"}:c.type===gs&&(_={event:"command",func:"pauseVideo"}),_&&c.iframeEl&&c.iframeEl.contentWindow&&c.iframeEl.contentWindow.postMessage(JSON.stringify(_),"*"),c.poller&&clearTimeout(c.poller)}onDone(i,o){i.isCurrentSlide(o)&&!i.isClosing()&&this.playVideo()}onRefresh(i,o){o.slides.forEach(c=>{c.el&&(this.resizeIframe(c),this.setAspectRatio(c))})}onMessage(i){try{let o=JSON.parse(i.data);if(i.origin==="https://player.vimeo.com"){if(o.event==="ready")for(let c of Array.from(document.getElementsByClassName("fancybox__iframe")))c instanceof HTMLIFrameElement&&c.contentWindow===i.source&&(c.dataset.ready="true")}else if(i.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&o.event==="onReady"){const c=document.getElementById(o.id);c&&(c.dataset.ready="true")}}catch{}}loadAjaxContent(i){const o=this.instance.optionFor(i,"src")||"";this.instance.showLoading(i);const c=this.instance,p=new XMLHttpRequest;c.showLoading(i),p.onreadystatechange=function(){p.readyState===XMLHttpRequest.DONE&&c.state===Gi.Ready&&(c.hideLoading(i),p.status===200?c.setContent(i,p.responseText):c.setError(i,p.status===404?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const b=i.ajax||null;p.open(b?"POST":"GET",o+""),p.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),p.setRequestHeader("X-Requested-With","XMLHttpRequest"),p.send(b),i.xhr=p}setInlineContent(i){let o=null;if(Vn(i.src))o=i.src;else if(typeof i.src=="string"){const c=i.src.split("#",2).pop();o=c?document.getElementById(c):null}if(o){if(i.type==="clone"||o.closest(".fancybox__slide")){o=o.cloneNode(!0);const c=o.dataset.animationName;c&&(o.classList.remove(c),delete o.dataset.animationName);let p=o.getAttribute("id");p=p?`${p}--clone`:`clone-${this.instance.id}-${i.index}`,o.setAttribute("id",p)}else if(o.parentNode){const c=document.createElement("div");c.classList.add("fancybox-placeholder"),o.parentNode.insertBefore(c,o),i.placeholderEl=c}this.instance.setContent(i,o)}else this.instance.setError(i,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(i){const{src:o,el:c}=i;if(!o||typeof o!="string"||!c)return;c.classList.add("is-loading");const p=this.instance,b=document.createElement("iframe");b.className="fancybox__iframe",b.setAttribute("id",`fancybox__iframe_${p.id}_${i.index}`);for(const[h,M]of Object.entries(this.optionFor(i,"iframeAttr")||{}))b.setAttribute(h,M);b.onerror=()=>{p.setError(i,"{{IFRAME_ERROR}}")},i.iframeEl=b;const _=this.optionFor(i,"preload");if(i.type!=="iframe"||_===!1)return b.setAttribute("src",i.src+""),p.setContent(i,b,!1),this.resizeIframe(i),void p.revealContent(i);p.showLoading(i),b.onload=()=>{if(!b.src.length)return;const h=b.dataset.ready!=="true";b.dataset.ready="true",this.resizeIframe(i),h?p.revealContent(i):p.hideLoading(i)},b.setAttribute("src",o),p.setContent(i,b,!1)}resizeIframe(i){const{type:o,iframeEl:c}=i;if(o===gs||o===Vo)return;const p=c==null?void 0:c.parentElement;if(!c||!p)return;let b=i.autoSize;b===void 0&&(b=this.optionFor(i,"autoSize"));let _=i.width||0,h=i.height||0;_&&h&&(b=!1);const M=p&&p.style;if(i.preload!==!1&&b!==!1&&M)try{const A=window.getComputedStyle(p),D=parseFloat(A.paddingLeft)+parseFloat(A.paddingRight),R=parseFloat(A.paddingTop)+parseFloat(A.paddingBottom),z=c.contentWindow;if(z){const j=z.document,Y=j.getElementsByTagName(ip)[0],ee=j.body;M.width="",ee.style.overflow="hidden",_=_||Y.scrollWidth+D,M.width=`${_}px`,ee.style.overflow="",M.flex="0 0 auto",M.height=`${ee.scrollHeight}px`,h=Y.scrollHeight+R}}catch{}if(_||h){const A={flex:"0 1 auto",width:"",height:""};_&&_!=="auto"&&(A.width=`${_}px`),h&&h!=="auto"&&(A.height=`${h}px`),Object.assign(M,A)}}playVideo(){const i=this.instance.getSlide();if(!i)return;const{el:o}=i;if(!o||!o.offsetParent||!this.optionFor(i,"videoAutoplay"))return;if(i.type===Xl)try{const p=o.querySelector("video");if(p){const b=p.play();b!==void 0&&b.then(()=>{}).catch(_=>{p.muted=!0,p.play()})}}catch{}if(i.type!==gs&&i.type!==Vo)return;const c=()=>{if(i.iframeEl&&i.iframeEl.contentWindow){let p;if(i.iframeEl.dataset.ready==="true")return p=i.type===gs?{event:"command",func:"playVideo"}:{method:"play",value:"true"},p&&i.iframeEl.contentWindow.postMessage(JSON.stringify(p),"*"),void(i.poller=void 0);i.type===gs&&(p={event:"listening",id:i.iframeEl.getAttribute("id")},i.iframeEl.contentWindow.postMessage(JSON.stringify(p),"*"))}i.poller=setTimeout(c,250)};c()}processType(i){if(i.html)return i.type=ip,i.src=i.html,void(i.html="");const o=this.instance.optionFor(i,"src","");if(!o||typeof o!="string")return;let c=i.type,p=null;if(p=o.match(/(youtube\.com|youtu\.be|youtube\-nocookie\.com)\/(?:watch\?(?:.*&)?v=|v\/|u\/|shorts\/|embed\/?)?(videoseries\?list=(?:.*)|[\w-]{11}|\?listType=(?:.*)&list=(?:.*))(?:.*)/i)){const b=this.optionFor(i,gs),{nocookie:_}=b,h=function(R,z){var j={};for(var Y in R)Object.prototype.hasOwnProperty.call(R,Y)&&z.indexOf(Y)<0&&(j[Y]=R[Y]);if(R!=null&&typeof Object.getOwnPropertySymbols=="function"){var ee=0;for(Y=Object.getOwnPropertySymbols(R);ee<Y.length;ee++)z.indexOf(Y[ee])<0&&Object.prototype.propertyIsEnumerable.call(R,Y[ee])&&(j[Y[ee]]=R[Y[ee]])}return j}(b,["nocookie"]),M=`www.youtube${_?"-nocookie":""}.com`,A=oy(o,h),D=encodeURIComponent(p[2]);i.videoId=D,i.src=`https://${M}/embed/${D}?${A}`,i.thumbSrc=i.thumbSrc||`https://i.ytimg.com/vi/${D}/mqdefault.jpg`,c=gs}else if(p=o.match(/^.+vimeo.com\/(?:\/)?([\d]+)((\/|\?h=)([a-z0-9]+))?(.*)?/)){const b=oy(o,this.optionFor(i,Vo)),_=encodeURIComponent(p[1]),h=p[4]||"";i.videoId=_,i.src=`https://player.vimeo.com/video/${_}?${h?`h=${h}${b?"&":""}`:""}${b}`,c=Vo}if(!c&&i.triggerEl){const b=i.triggerEl.dataset.type;ww.includes(b)&&(c=b)}c||typeof o=="string"&&(o.charAt(0)==="#"?c="inline":(p=o.match(/\.(mp4|mov|ogv|webm)((\?|#).*)?$/i))?(c=Xl,i.videoFormat=i.videoFormat||"video/"+(p[1]==="ogv"?"ogg":p[1])):o.match(/(^data:image\/[a-z0-9+\/=]*,)|(\.(jp(e|g|eg)|gif|png|bmp|webp|svg|ico)((\?|#).*)?$)/i)?c=sy:o.match(/\.(pdf)((\?|#).*)?$/i)&&(c="pdf")),(p=o.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:(?:(?:maps\/(?:place\/(?:.*)\/)?\@(.*),(\d+.?\d+?)z))|(?:\?ll=))(.*)?/i))?(i.src=`https://maps.google.${p[1]}/?ll=${(p[2]?p[2]+"&z="+Math.floor(parseFloat(p[3]))+(p[4]?p[4].replace(/^\//,"&"):""):p[4]+"").replace(/\?/,"&")}&output=${p[4]&&p[4].indexOf("layer=c")>0?"svembed":"embed"}`,c=np):(p=o.match(/(?:maps\.)?google\.([a-z]{2,3}(?:\.[a-z]{2})?)\/(?:maps\/search\/)(.*)/i))&&(i.src=`https://maps.google.${p[1]}/maps?q=${p[2].replace("query=","q=").replace("api=1","")}&output=embed`,c=np),c=c||this.instance.option("defaultType"),i.type=c,c===sy&&(i.thumbSrc=i.thumbSrc||i.src)}setContent(i){const o=this.instance.optionFor(i,"src")||"";if(i&&i.type&&o){switch(i.type){case ip:this.instance.setContent(i,o);break;case Xl:const c=this.option("videoTpl");c&&this.instance.setContent(i,c.replace(/\{\{src\}\}/gi,o+"").replace(/\{\{format\}\}/gi,this.optionFor(i,"videoFormat")||"").replace(/\{\{poster\}\}/gi,i.poster||i.thumbSrc||""));break;case"inline":case"clone":this.setInlineContent(i);break;case"ajax":this.loadAjaxContent(i);break;case"pdf":case np:case gs:case Vo:i.preload=!1;case"iframe":this.setIframeContent(i)}this.setAspectRatio(i)}}setAspectRatio(i){const o=i.contentEl;if(!(i.el&&o&&i.type&&[gs,Vo,Xl].includes(i.type)))return;let c,p=i.width||"auto",b=i.height||"auto";if(p==="auto"||b==="auto"){c=this.optionFor(i,"videoRatio");const A=(c+"").match(/(\d+)\s*\/\s?(\d+)/);c=A&&A.length>2?parseFloat(A[1])/parseFloat(A[2]):parseFloat(c+"")}else p&&b&&(c=p/b);if(!c)return;o.style.aspectRatio="",o.style.width="",o.style.height="",o.offsetHeight;const _=o.getBoundingClientRect(),h=_.width||1,M=_.height||1;o.style.aspectRatio=c+"",c<h/M?(b=b==="auto"?M:Math.min(M,b),o.style.width="auto",o.style.height=`${b}px`):(p=p==="auto"?h:Math.min(h,p),o.style.width=`${p}px`,o.style.height="auto")}attach(){const i=this,o=i.instance;o.on("Carousel.beforeInitSlide",i.onBeforeInitSlide),o.on("Carousel.createSlide",i.onCreateSlide),o.on("Carousel.selectSlide",i.onSelectSlide),o.on("Carousel.unselectSlide",i.onUnselectSlide),o.on("Carousel.Panzoom.refresh",i.onRefresh),o.on("done",i.onDone),o.on("clearContent",i.onClearContent),window.addEventListener("message",i.onMessage)}detach(){const i=this,o=i.instance;o.off("Carousel.beforeInitSlide",i.onBeforeInitSlide),o.off("Carousel.createSlide",i.onCreateSlide),o.off("Carousel.selectSlide",i.onSelectSlide),o.off("Carousel.unselectSlide",i.onUnselectSlide),o.off("Carousel.Panzoom.refresh",i.onRefresh),o.off("done",i.onDone),o.off("clearContent",i.onClearContent),window.removeEventListener("message",i.onMessage)}}Object.defineProperty(ay,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:vw});const jh="play",Uh="pause",Kl="ready";class ly extends Or{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Kl}),Object.defineProperty(this,"inHover",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"timer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"progressBar",{enumerable:!0,configurable:!0,writable:!0,value:null})}get isActive(){return this.state!==Kl}onReady(i){this.option("autoStart")&&(i.isInfinite||i.page<i.pages.length-1)&&this.start()}onChange(){this.removeProgressBar(),this.pause()}onSettle(){this.resume()}onVisibilityChange(){document.visibilityState==="visible"?this.resume():this.pause()}onMouseEnter(){this.inHover=!0,this.pause()}onMouseLeave(){var i;this.inHover=!1,!((i=this.instance.panzoom)===null||i===void 0)&&i.isResting&&this.resume()}onTimerEnd(){const i=this.instance;this.state==="play"&&(i.isInfinite||i.page!==i.pages.length-1?i.slideNext():i.slideTo(0))}removeProgressBar(){this.progressBar&&(this.progressBar.remove(),this.progressBar=null)}createProgressBar(){var i;if(!this.option("showProgress"))return null;this.removeProgressBar();const o=this.instance,c=((i=o.pages[o.page])===null||i===void 0?void 0:i.slides)||[];let p=this.option("progressParentEl");if(p||(p=(c.length===1?c[0].el:null)||o.viewport),!p)return null;const b=document.createElement("div");return ut(b,"f-progress"),p.prepend(b),this.progressBar=b,b.offsetHeight,b}set(){const i=this,o=i.instance;if(o.pages.length<2||i.timer)return;const c=i.option("timeout");i.state=jh,ut(o.container,"has-autoplay");let p=i.createProgressBar();p&&(p.style.transitionDuration=`${c}ms`,p.style.transform="scaleX(1)"),i.timer=setTimeout(()=>{i.timer=null,i.inHover||i.onTimerEnd()},c),i.emit("set")}clear(){const i=this;i.timer&&(clearTimeout(i.timer),i.timer=null),i.removeProgressBar()}start(){const i=this;if(i.set(),i.state!==Kl){if(i.option("pauseOnHover")){const o=i.instance.container;o.addEventListener("mouseenter",i.onMouseEnter,!1),o.addEventListener("mouseleave",i.onMouseLeave,!1)}document.addEventListener("visibilitychange",i.onVisibilityChange,!1),i.emit("start")}}stop(){const i=this,o=i.state,c=i.instance.container;i.clear(),i.state=Kl,c.removeEventListener("mouseenter",i.onMouseEnter,!1),c.removeEventListener("mouseleave",i.onMouseLeave,!1),document.removeEventListener("visibilitychange",i.onVisibilityChange,!1),ni(c,"has-autoplay"),o!==Kl&&i.emit("stop")}pause(){const i=this;i.state===jh&&(i.state=Uh,i.clear(),i.emit(Uh))}resume(){const i=this,o=i.instance;if(o.isInfinite||o.page!==o.pages.length-1)if(i.state!==jh){if(i.state===Uh&&!i.inHover){const c=new Event("resume",{bubbles:!0,cancelable:!0});i.emit("resume",c),c.defaultPrevented||i.set()}}else i.set();else i.stop()}toggle(){this.state===jh||this.state===Uh?this.stop():this.start()}attach(){const i=this,o=i.instance;o.on("ready",i.onReady),o.on("Panzoom.startAnimation",i.onChange),o.on("Panzoom.endAnimation",i.onSettle),o.on("Panzoom.touchMove",i.onChange)}detach(){const i=this,o=i.instance;o.off("ready",i.onReady),o.off("Panzoom.startAnimation",i.onChange),o.off("Panzoom.endAnimation",i.onSettle),o.off("Panzoom.touchMove",i.onChange),i.stop()}}Object.defineProperty(ly,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{autoStart:!0,pauseOnHover:!0,progressParentEl:null,showProgress:!0,timeout:3e3}});class cy extends Or{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null})}onPrepare(i){const o=i.carousel;if(!o)return;const c=i.container;c&&(o.options.Autoplay=Nn({autoStart:!1},this.option("Autoplay")||{},{pauseOnHover:!1,timeout:this.option("timeout"),progressParentEl:()=>this.option("progressParentEl")||null,on:{start:()=>{i.emit("startSlideshow")},set:p=>{var b;c.classList.add("has-slideshow"),((b=i.getSlide())===null||b===void 0?void 0:b.state)!==dn.Ready&&p.pause()},stop:()=>{c.classList.remove("has-slideshow"),i.isCompact||i.endIdle(),i.emit("endSlideshow")},resume:(p,b)=>{var _,h,M;!b||!b.cancelable||((_=i.getSlide())===null||_===void 0?void 0:_.state)===dn.Ready&&(!((M=(h=i.carousel)===null||h===void 0?void 0:h.panzoom)===null||M===void 0)&&M.isResting)||b.preventDefault()}}}),o.attachPlugins({Autoplay:ly}),this.ref=o.plugins.Autoplay)}onReady(i){const o=i.carousel,c=this.ref;c&&o&&this.option("playOnStart")&&(o.isInfinite||o.page<o.pages.length-1)&&c.start()}onDone(i,o){const c=this.ref,p=i.carousel;if(!c||!p)return;const b=o.panzoom;b&&b.on("startAnimation",()=>{i.isCurrentSlide(o)&&c.stop()}),i.isCurrentSlide(o)&&c.resume()}onKeydown(i,o){var c;const p=this.ref;p&&o===this.option("key")&&((c=document.activeElement)===null||c===void 0?void 0:c.nodeName)!=="BUTTON"&&p.toggle()}attach(){const i=this,o=i.instance;o.on("Carousel.init",i.onPrepare),o.on("Carousel.ready",i.onReady),o.on("done",i.onDone),o.on("keydown",i.onKeydown)}detach(){const i=this,o=i.instance;o.off("Carousel.init",i.onPrepare),o.off("Carousel.ready",i.onReady),o.off("done",i.onDone),o.off("keydown",i.onKeydown)}}Object.defineProperty(cy,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:{key:" ",playOnStart:!1,progressParentEl:n=>{var i;return((i=n.instance.container)===null||i===void 0?void 0:i.querySelector(".fancybox__toolbar [data-fancybox-toggle-slideshow]"))||n.instance.container},timeout:3e3}});const hy={classes:{container:"f-thumbs f-carousel__thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide",isResting:"is-resting",isSelected:"is-selected",isLoading:"is-loading",hasThumbs:"has-thumbs"},minCount:2,parentEl:null,thumbTpl:'<button class="f-thumbs__slide__button" tabindex="0" type="button" aria-label="{{GOTO}}" data-carousel-index="%i"><img class="f-thumbs__slide__img" data-lazy-src="{{%s}}" alt="" /></button>',type:"modern"};var ys;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Hidden=2]="Hidden"})(ys||(ys={}));const uy="isResting",Hh="thumbWidth",Da="thumbHeight",Kr="thumbClipWidth";let dy=class extends Or{constructor(){super(...arguments),Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:"modern"}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"track",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"thumbWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbClipWidth",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbHeight",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"thumbExtraGap",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:ys.Init})}get isModern(){return this.type==="modern"}onInitSlide(n,i){const o=i.el?i.el.dataset:void 0;o&&(i.thumbSrc=o.thumbSrc||i.thumbSrc||"",i[Kr]=parseFloat(o[Kr]||"")||i[Kr]||0,i[Da]=parseFloat(o.thumbHeight||"")||i[Da]||0),this.addSlide(i)}onInitSlides(){this.build()}onChange(){var n;if(!this.isModern)return;const i=this.container,o=this.instance,c=o.panzoom,p=this.carousel,b=p?p.panzoom:null,_=o.page;if(c&&p&&b){if(c.isDragging){ni(i,this.cn(uy));let h=((n=p.pages[_])===null||n===void 0?void 0:n.pos)||0;h+=o.getProgress(_)*(this[Kr]+this.thumbGap);let M=b.getBounds();-1*h>M.x.min&&-1*h<M.x.max&&b.panTo({x:-1*h,friction:.12})}else Xr(i,this.cn(uy),c.isResting);this.shiftModern()}}onRefresh(){this.updateProps();for(const n of this.instance.slides||[])this.resizeModernSlide(n);this.shiftModern()}isDisabled(){const n=this.option("minCount")||0;if(n){const o=this.instance;let c=0;for(const p of o.slides||[])p.thumbSrc&&c++;if(c<n)return!0}const i=this.option("type");return["modern","classic"].indexOf(i)<0}getThumb(n){const i=this.option("thumbTpl")||"";return{html:this.instance.localize(i,[["%i",n.index],["%d",n.index+1],["%s",n.thumbSrc||"data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"]])}}addSlide(n){const i=this.carousel;i&&i.addSlide(n.index,this.getThumb(n))}getSlides(){const n=[];for(const i of this.instance.slides||[])n.push(this.getThumb(i));return n}resizeModernSlide(n){this.isModern&&(n[Hh]=n[Kr]&&n[Da]?Math.round(this[Da]*(n[Kr]/n[Da])):this[Hh])}updateProps(){const n=this.container;if(!n)return;const i=o=>parseFloat(getComputedStyle(n).getPropertyValue("--f-thumb-"+o))||0;this.thumbGap=i("gap"),this.thumbExtraGap=i("extra-gap"),this[Hh]=i("width")||40,this[Kr]=i("clip-width")||40,this[Da]=i("height")||40}build(){const n=this;if(n.state!==ys.Init)return;if(n.isDisabled())return void n.emit("disabled");const i=n.instance,o=i.container,c=n.getSlides(),p=n.option("type");n.type=p;const b=n.option("parentEl"),_=n.cn("container"),h=n.cn("track");let M=b==null?void 0:b.querySelector("."+_);M||(M=document.createElement("div"),ut(M,_),b?b.appendChild(M):o.after(M)),ut(M,`is-${p}`),ut(o,n.cn("hasThumbs")),n.container=M,n.updateProps();let A=M.querySelector("."+h);A||(A=document.createElement("div"),ut(A,n.cn("track")),M.appendChild(A)),n.track=A;const D=Nn({},{track:A,infinite:!1,center:!0,fill:p==="classic",dragFree:!0,slidesPerPage:1,transition:!1,preload:.25,friction:.12,Panzoom:{maxVelocity:0},Dots:!1,Navigation:!1,classes:{container:"f-thumbs",viewport:"f-thumbs__viewport",track:"f-thumbs__track",slide:"f-thumbs__slide"}},n.option("Carousel")||{},{Sync:{target:i},slides:c}),R=new i.constructor(M,D);R.on("createSlide",(z,j)=>{n.setProps(j.index),n.emit("createSlide",j,j.el)}),R.on("ready",()=>{n.shiftModern(),n.emit("ready")}),R.on("refresh",()=>{n.shiftModern()}),R.on("Panzoom.click",(z,j,Y)=>{n.onClick(Y)}),n.carousel=R,n.state=ys.Ready}onClick(n){n.preventDefault(),n.stopPropagation();const i=this.instance,{pages:o,page:c}=i,p=ee=>{if(ee){const oe=ee.closest("[data-carousel-index]");if(oe)return[parseInt(oe.dataset.carouselIndex||"",10)||0,oe]}return[-1,void 0]},b=(ee,oe)=>{const ue=document.elementFromPoint(ee,oe);return ue?p(ue):[-1,void 0]};let[_,h]=p(n.target);if(_>-1)return;const M=this[Kr],A=n.clientX,D=n.clientY;let[R,z]=b(A-M,D),[j,Y]=b(A+M,D);z&&Y?(_=Math.abs(A-z.getBoundingClientRect().right)<Math.abs(A-Y.getBoundingClientRect().left)?R:j,_===c&&(_=_===R?j:R)):z?_=R:Y&&(_=j),_>-1&&o[_]&&i.slideTo(_)}getShift(n){var i;const o=this,{instance:c}=o,p=o.carousel;if(!c||!p)return 0;const b=o[Hh],_=o[Kr],h=o.thumbGap,M=o.thumbExtraGap;if(!(!((i=p.slides[n])===null||i===void 0)&&i.el))return 0;const A=.5*(b-_),D=c.pages.length-1;let R=c.getProgress(0),z=c.getProgress(D),j=c.getProgress(n,!1,!0),Y=0,ee=A+M+h;const oe=R<0&&R>-1,ue=z>0&&z<1;return n===0?(Y=ee*Math.abs(R),ue&&R===1&&(Y-=ee*Math.abs(z))):n===D?(Y=ee*Math.abs(z)*-1,oe&&z===-1&&(Y+=ee*Math.abs(R))):oe||ue?(Y=-1*ee,Y+=ee*Math.abs(R),Y+=ee*(1-Math.abs(z))):Y=ee*j,Y}setProps(n){var i;const o=this;if(!o.isModern)return;const{instance:c}=o,p=o.carousel;if(c&&p){const b=(i=p.slides[n])===null||i===void 0?void 0:i.el;if(b&&b.childNodes.length){let _=Ye(1-Math.abs(c.getProgress(n))),h=Ye(o.getShift(n));b.style.setProperty("--progress",_?_+"":""),b.style.setProperty("--shift",h+"")}}}shiftModern(){const n=this;if(!n.isModern)return;const{instance:i,track:o}=n,c=i.panzoom,p=n.carousel;if(!(i&&o&&c&&p)||c.state===li.Init||c.state===li.Destroy)return;for(const _ of i.slides)n.setProps(_.index);let b=(n[Kr]+n.thumbGap)*(p.slides.length||0);o.style.setProperty("--width",b+"")}cleanup(){const n=this;n.carousel&&n.carousel.destroy(),n.carousel=null,n.container&&n.container.remove(),n.container=null,n.track&&n.track.remove(),n.track=null,n.state=ys.Init,ni(n.instance.container,n.cn("hasThumbs"))}attach(){const n=this,i=n.instance;i.on("initSlide",n.onInitSlide),i.state===Bi.Init?i.on("initSlides",n.onInitSlides):n.onInitSlides(),i.on(["change","Panzoom.afterTransform"],n.onChange),i.on("Panzoom.refresh",n.onRefresh)}detach(){const n=this,i=n.instance;i.off("initSlide",n.onInitSlide),i.off("initSlides",n.onInitSlides),i.off(["change","Panzoom.afterTransform"],n.onChange),i.off("Panzoom.refresh",n.onRefresh),n.cleanup()}};Object.defineProperty(dy,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:hy});const Sw=Object.assign(Object.assign({},hy),{key:"t",showOnStart:!0,parentEl:null}),py="is-masked",fy="aria-hidden";class my extends Or{constructor(){super(...arguments),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hidden",{enumerable:!0,configurable:!0,writable:!0,value:!1})}get isEnabled(){const i=this.ref;return i&&!i.isDisabled()}get isHidden(){return this.hidden}onClick(i,o){o.stopPropagation()}onCreateSlide(i,o){var c,p,b;const _=((b=(p=(c=this.instance)===null||c===void 0?void 0:c.carousel)===null||p===void 0?void 0:p.slides[o.index])===null||b===void 0?void 0:b.type)||"",h=o.el;if(h&&_){let M=`for-${_}`;["video","youtube","vimeo","html5video"].includes(_)&&(M+=" for-video"),ut(h,M)}}onInit(){var i;const o=this,c=o.instance,p=c.carousel;if(o.ref||!p)return;const b=o.option("parentEl")||c.footer||c.container;if(!b)return;const _=Nn({},o.options,{parentEl:b,classes:{container:"f-thumbs fancybox__thumbs"},Carousel:{Sync:{friction:c.option("Carousel.friction")||0}},on:{ready:h=>{const M=h.container;M&&this.hidden&&(o.refresh(),M.style.transition="none",o.hide(),M.offsetHeight,queueMicrotask(()=>{M.style.transition="",o.show()}))}}});_.Carousel=_.Carousel||{},_.Carousel.on=Nn(((i=o.options.Carousel)===null||i===void 0?void 0:i.on)||{},{click:this.onClick,createSlide:this.onCreateSlide}),p.options.Thumbs=_,p.attachPlugins({Thumbs:dy}),o.ref=p.plugins.Thumbs,o.option("showOnStart")||(o.ref.state=ys.Hidden,o.hidden=!0)}onResize(){var i;const o=(i=this.ref)===null||i===void 0?void 0:i.container;o&&(o.style.maxHeight="")}onKeydown(i,o){const c=this.option("key");c&&c===o&&this.toggle()}toggle(){const i=this.ref;if(i&&!i.isDisabled())return i.state===ys.Hidden?(i.state=ys.Init,void i.build()):void(this.hidden?this.show():this.hide())}show(){const i=this.ref;if(!i||i.isDisabled())return;const o=i.container;o&&(this.refresh(),o.offsetHeight,o.removeAttribute(fy),o.classList.remove(py),this.hidden=!1)}hide(){const i=this.ref,o=i&&i.container;o&&(this.refresh(),o.offsetHeight,o.classList.add(py),o.setAttribute(fy,"true")),this.hidden=!0}refresh(){const i=this.ref;if(!i||!i.state)return;const o=i.container,c=(o==null?void 0:o.firstChild)||null;o&&c&&c.childNodes.length&&(o.style.maxHeight=`${c.getBoundingClientRect().height}px`)}attach(){const i=this,o=i.instance;o.state===Gi.Init?o.on("Carousel.init",i.onInit):i.onInit(),o.on("resize",i.onResize),o.on("keydown",i.onKeydown)}detach(){var i;const o=this,c=o.instance;c.off("Carousel.init",o.onInit),c.off("resize",o.onResize),c.off("keydown",o.onKeydown),(i=c.carousel)===null||i===void 0||i.detachPlugins(["Thumbs"]),o.ref=null}}Object.defineProperty(my,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:Sw});const rp={panLeft:{icon:'<svg><path d="M5 12h14M5 12l6 6M5 12l6-6"/></svg>',change:{panX:-100}},panRight:{icon:'<svg><path d="M5 12h14M13 18l6-6M13 6l6 6"/></svg>',change:{panX:100}},panUp:{icon:'<svg><path d="M12 5v14M18 11l-6-6M6 11l6-6"/></svg>',change:{panY:-100}},panDown:{icon:'<svg><path d="M12 5v14M18 13l-6 6M6 13l6 6"/></svg>',change:{panY:100}},zoomIn:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M11 8v6M8 11h6"/></svg>',action:"zoomIn"},zoomOut:{icon:'<svg><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"zoomOut"},toggle1to1:{icon:'<svg><path d="M3.51 3.07c5.74.02 11.48-.02 17.22.02 1.37.1 2.34 1.64 2.18 3.13 0 4.08.02 8.16 0 12.23-.1 1.54-1.47 2.64-2.79 2.46-5.61-.01-11.24.02-16.86-.01-1.36-.12-2.33-1.65-2.17-3.14 0-4.07-.02-8.16 0-12.23.1-1.36 1.22-2.48 2.42-2.46Z"/><path d="M5.65 8.54h1.49v6.92m8.94-6.92h1.49v6.92M11.5 9.4v.02m0 5.18v0"/></svg>',action:"toggleZoom"},toggleZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"toggleZoom"},iterateZoom:{icon:'<svg><g><line x1="11" y1="8" x2="11" y2="14"></line></g><circle cx="11" cy="11" r="7.5"/><path d="m21 21-4.35-4.35M8 11h6"/></svg>',action:"iterateZoom"},rotateCCW:{icon:'<svg><path d="M15 4.55a8 8 0 0 0-6 14.9M9 15v5H4M18.37 7.16v.01M13 19.94v.01M16.84 18.37v.01M19.37 15.1v.01M19.94 11v.01"/></svg>',action:"rotateCCW"},rotateCW:{icon:'<svg><path d="M9 4.55a8 8 0 0 1 6 14.9M15 15v5h5M5.63 7.16v.01M4.06 11v.01M4.63 15.1v.01M7.16 18.37v.01M11 19.94v.01"/></svg>',action:"rotateCW"},flipX:{icon:'<svg style="stroke-width: 1.3"><path d="M12 3v18M16 7v10h5L16 7M8 7v10H3L8 7"/></svg>',action:"flipX"},flipY:{icon:'<svg style="stroke-width: 1.3"><path d="M3 12h18M7 16h10L7 21v-5M7 8h10L7 3v5"/></svg>',action:"flipY"},fitX:{icon:'<svg><path d="M4 12V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v6M10 18H3M21 18h-7M6 15l-3 3 3 3M18 15l3 3-3 3"/></svg>',action:"fitX"},fitY:{icon:'<svg><path d="M12 20H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h6M18 14v7M18 3v7M15 18l3 3 3-3M15 6l3-3 3 3"/></svg>',action:"fitY"},reset:{icon:'<svg><path d="M20 11A8.1 8.1 0 0 0 4.5 9M4 5v4h4M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4"/></svg>',action:"reset"},toggleFS:{icon:'<svg><g><path d="M14.5 9.5 21 3m0 0h-6m6 0v6M3 21l6.5-6.5M3 21v-6m0 6h6"/></g><g><path d="m14 10 7-7m-7 7h6m-6 0V4M3 21l7-7m0 0v6m0-6H4"/></g></svg>',action:"toggleFS"}};var $o;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Disabled=2]="Disabled"})($o||($o={}));const kw={absolute:"auto",display:{left:["infobar"],middle:[],right:["iterateZoom","slideshow","fullscreen","thumbs","close"]},enabled:"auto",items:{infobar:{tpl:'<div class="fancybox__infobar" tabindex="-1"><span data-fancybox-current-index></span>/<span data-fancybox-count></span></div>'},download:{tpl:'<a class="f-button" title="{{DOWNLOAD}}" data-fancybox-download href="javasript:;"><svg><path d="M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-2M7 11l5 5 5-5M12 4v12"/></svg></a>'},prev:{tpl:'<button class="f-button" title="{{PREV}}" data-fancybox-prev><svg><path d="m15 6-6 6 6 6"/></svg></button>'},next:{tpl:'<button class="f-button" title="{{NEXT}}" data-fancybox-next><svg><path d="m9 6 6 6-6 6"/></svg></button>'},slideshow:{tpl:'<button class="f-button" title="{{TOGGLE_SLIDESHOW}}" data-fancybox-toggle-slideshow><svg><g><path d="M8 4v16l13 -8z"></path></g><g><path d="M8 4v15M17 4v15"/></g></svg></button>'},fullscreen:{tpl:'<button class="f-button" title="{{TOGGLE_FULLSCREEN}}" data-fancybox-toggle-fullscreen><svg><g><path d="M4 8V6a2 2 0 0 1 2-2h2M4 16v2a2 2 0 0 0 2 2h2M16 4h2a2 2 0 0 1 2 2v2M16 20h2a2 2 0 0 0 2-2v-2"/></g><g><path d="M15 19v-2a2 2 0 0 1 2-2h2M15 5v2a2 2 0 0 0 2 2h2M5 15h2a2 2 0 0 1 2 2v2M5 9h2a2 2 0 0 0 2-2V5"/></g></svg></button>'},thumbs:{tpl:'<button class="f-button" title="{{TOGGLE_THUMBS}}" data-fancybox-toggle-thumbs><svg><circle cx="5.5" cy="5.5" r="1"/><circle cx="12" cy="5.5" r="1"/><circle cx="18.5" cy="5.5" r="1"/><circle cx="5.5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="18.5" cy="12" r="1"/><circle cx="5.5" cy="18.5" r="1"/><circle cx="12" cy="18.5" r="1"/><circle cx="18.5" cy="18.5" r="1"/></svg></button>'},close:{tpl:'<button class="f-button" title="{{CLOSE}}" data-fancybox-close><svg><path d="m19.5 4.5-15 15M4.5 4.5l15 15"/></svg></button>'}},parentEl:null},Ew={tabindex:"-1",width:"24",height:"24",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},gy="has-toolbar",sp="fancybox__toolbar";class yy extends Or{constructor(){super(...arguments),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:$o.Init}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null})}onReady(i){var o;if(!i.carousel)return;let c=this.option("display"),p=this.option("absolute"),b=this.option("enabled");if(b==="auto"){const A=this.instance.carousel;let D=0;if(A)for(const R of A.slides)(R.panzoom||R.type==="image")&&D++;D||(b=!1)}b||(c=void 0);let _=0;const h={left:[],middle:[],right:[]};if(c)for(const A of["left","middle","right"])for(const D of c[A]){const R=this.createEl(D);R&&((o=h[A])===null||o===void 0||o.push(R),_++)}let M=null;if(_&&(M=this.createContainer()),M){for(const[A,D]of Object.entries(h)){const R=document.createElement("div");ut(R,sp+"__column is-"+A);for(const z of D)R.appendChild(z);p!=="auto"||A!=="middle"||D.length||(p=!0),M.appendChild(R)}p===!0&&ut(M,"is-absolute"),this.state=$o.Ready,this.onRefresh()}else this.state=$o.Disabled}onClick(i){var o,c;const p=this.instance,b=p.getSlide(),_=b==null?void 0:b.panzoom,h=i.target,M=h&&Vn(h)?h.dataset:null;if(!M)return;if(M.fancyboxToggleThumbs!==void 0)return i.preventDefault(),i.stopPropagation(),void((o=p.plugins.Thumbs)===null||o===void 0||o.toggle());if(M.fancyboxToggleFullscreen!==void 0)return i.preventDefault(),i.stopPropagation(),void this.instance.toggleFullscreen();if(M.fancyboxToggleSlideshow!==void 0){i.preventDefault(),i.stopPropagation();const R=(c=p.carousel)===null||c===void 0?void 0:c.plugins.Autoplay;let z=R.isActive;return _&&_.panMode==="mousemove"&&!z&&_.reset(),void(z?R.stop():R.start())}const A=M.panzoomAction,D=M.panzoomChange;if((D||A)&&(i.preventDefault(),i.stopPropagation()),D){let R={};try{R=JSON.parse(D)}catch{}_&&_.applyChange(R)}else A&&_&&_[A]&&_[A]()}onChange(){this.onRefresh()}onRefresh(){if(this.instance.isClosing())return;const i=this.container;if(!i)return;const o=this.instance.getSlide();if(!o||o.state!==dn.Ready)return;const c=o&&!o.error&&o.panzoom;for(const _ of i.querySelectorAll("[data-panzoom-action]"))c?(_.removeAttribute("disabled"),_.removeAttribute("tabindex")):(_.setAttribute("disabled",""),_.setAttribute("tabindex","-1"));let p=c&&c.canZoomIn(),b=c&&c.canZoomOut();for(const _ of i.querySelectorAll('[data-panzoom-action="zoomIn"]'))p?(_.removeAttribute("disabled"),_.removeAttribute("tabindex")):(_.setAttribute("disabled",""),_.setAttribute("tabindex","-1"));for(const _ of i.querySelectorAll('[data-panzoom-action="zoomOut"]'))b?(_.removeAttribute("disabled"),_.removeAttribute("tabindex")):(_.setAttribute("disabled",""),_.setAttribute("tabindex","-1"));for(const _ of i.querySelectorAll('[data-panzoom-action="toggleZoom"],[data-panzoom-action="iterateZoom"]')){b||p?(_.removeAttribute("disabled"),_.removeAttribute("tabindex")):(_.setAttribute("disabled",""),_.setAttribute("tabindex","-1"));const h=_.querySelector("g");h&&(h.style.display=p?"":"none")}}onDone(i,o){var c;(c=o.panzoom)===null||c===void 0||c.on("afterTransform",()=>{this.instance.isCurrentSlide(o)&&this.onRefresh()}),this.instance.isCurrentSlide(o)&&this.onRefresh()}createContainer(){const i=this.instance.container;if(!i)return null;const o=this.option("parentEl")||i;let c=o.querySelector("."+sp);return c||(c=document.createElement("div"),ut(c,sp),o.prepend(c)),c.addEventListener("click",this.onClick,{passive:!1,capture:!0}),i&&ut(i,gy),this.container=c,c}createEl(i){const o=this.instance,c=o.carousel;if(!c||i==="toggleFS"||i==="fullscreen"&&!Kg())return null;let p=null;const b=c.slides.length||0;let _=0,h=0;for(const A of c.slides)(A.panzoom||A.type==="image")&&_++,(A.type==="image"||A.downloadSrc)&&h++;if(b<2&&["infobar","prev","next"].includes(i))return p;if(rp[i]!==void 0&&!_||i==="download"&&!h)return null;if(i==="thumbs"){const A=o.plugins.Thumbs;if(!A||!A.isEnabled)return null}if(i==="slideshow"&&(!c.plugins.Autoplay||b<2))return null;if(rp[i]!==void 0){const A=rp[i];p=document.createElement("button"),p.setAttribute("title",this.instance.localize(`{{${i.toUpperCase()}}}`)),ut(p,"f-button"),A.action&&(p.dataset.panzoomAction=A.action),A.change&&(p.dataset.panzoomChange=JSON.stringify(A.change)),p.appendChild(Yr(this.instance.localize(A.icon)))}else{const A=(this.option("items")||[])[i];A&&(p=Yr(this.instance.localize(A.tpl)),typeof A.click=="function"&&p.addEventListener("click",D=>{D.preventDefault(),D.stopPropagation(),typeof A.click=="function"&&A.click.call(this,this,D)}))}const M=p==null?void 0:p.querySelector("svg");if(M)for(const[A,D]of Object.entries(Ew))M.getAttribute(A)||M.setAttribute(A,String(D));return p}removeContainer(){const i=this.container;i&&i.remove(),this.container=null,this.state=$o.Disabled;const o=this.instance.container;o&&ni(o,gy)}attach(){const i=this,o=i.instance;o.on("Carousel.initSlides",i.onReady),o.on("done",i.onDone),o.on(["reveal","Carousel.change"],i.onChange),i.onReady(i.instance)}detach(){const i=this,o=i.instance;o.off("Carousel.initSlides",i.onReady),o.off("done",i.onDone),o.off(["reveal","Carousel.change"],i.onChange),i.removeContainer()}}Object.defineProperty(yy,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:kw});const Tw={Hash:class extends Or{onReady(){Yl=!1}onChange(n){No&&clearTimeout(No);const{hash:i}=Qg(),{hash:o}=Vh(),c=n.isOpeningSlide(n.getSlide());c&&(Jg=o===i?"":o),i&&i!==o&&(No=setTimeout(()=>{try{if(n.state===Gi.Ready){let p="replaceState";c&&!Nh&&(p="pushState",Nh=!0),window.history[p]({},document.title,window.location.pathname+window.location.search+i)}}catch{}},300))}onClose(n){if(No&&clearTimeout(No),!Yl&&Nh)return Nh=!1,Yl=!1,void window.history.back();if(!Yl)try{window.history.replaceState({},document.title,window.location.pathname+window.location.search+(Jg||""))}catch{}}attach(){const n=this.instance;n.on("ready",this.onReady),n.on(["Carousel.ready","Carousel.change"],this.onChange),n.on("close",this.onClose)}detach(){const n=this.instance;n.off("ready",this.onReady),n.off(["Carousel.ready","Carousel.change"],this.onChange),n.off("close",this.onClose)}static parseURL(){return Vh()}static startFromUrl(){ey()}static destroy(){window.removeEventListener("hashchange",iy,!1)}},Html:ay,Images:ry,Slideshow:cy,Thumbs:my,Toolbar:yy},_y="with-fancybox",op="hide-scrollbar",xy="--fancybox-scrollbar-compensate",by="--fancybox-body-margin",ap="aria-hidden",lp="is-using-tab",cp="is-animated",vy="is-compact",wy="is-loading",hp="is-opening",qh="has-caption",za="disabled",jo="tabindex",Sy="download",up="href",Ra="src",Gs=n=>typeof n=="string",ky=function(){var n=window.getSelection();return!!n&&n.type==="Range"};let yr,_r=null,Uo=null,Ey=0,Ty=0,Cy=0,My=0;const La=new Map;let Cw=0;class $t extends Gd{get isIdle(){return this.idle}get isCompact(){return this.option("compact")}constructor(i=[],o={},c={}){super(o),Object.defineProperty(this,"userSlides",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"userPlugins",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"idle",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"idleTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"clickTimer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"pwt",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"ignoreFocusChange",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"startedFs",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:Gi.Init}),Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"container",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"footer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"carousel",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"lastFocus",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"prevMouseMoveEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),yr||(yr=Kg()),this.id=o.id||++Cw,La.set(this.id,this),this.userSlides=i,this.userPlugins=c,queueMicrotask(()=>{this.init()})}init(){if(this.state===Gi.Destroy)return;this.state=Gi.Init,this.attachPlugins(Object.assign(Object.assign({},$t.Plugins),this.userPlugins)),this.emit("init"),this.emit("attachPlugins"),this.option("hideScrollbar")===!0&&(()=>{if(!Gl)return;const o=document,c=o.body,p=o.documentElement;if(c.classList.contains(op))return;let b=window.innerWidth-p.getBoundingClientRect().width;const _=parseFloat(window.getComputedStyle(c).marginRight);b<0&&(b=0),p.style.setProperty(xy,`${b}px`),_&&c.style.setProperty(by,`${_}px`),c.classList.add(op)})(),this.initLayout(),this.scale();const i=()=>{this.initCarousel(this.userSlides),this.state=Gi.Ready,this.attachEvents(),this.emit("ready"),setTimeout(()=>{this.container&&this.container.setAttribute(ap,"false")},16)};this.option("Fullscreen.autoStart")&&yr&&!yr.isFullscreen()?yr.request().then(()=>{this.startedFs=!0,i()}).catch(()=>i()):i()}initLayout(){var i,o;const c=this.option("parentEl")||document.body,p=Yr(this.localize(this.option("tpl.main")||""));if(p){if(p.setAttribute("id",`fancybox-${this.id}`),p.setAttribute("aria-label",this.localize("{{MODAL}}")),p.classList.toggle(vy,this.isCompact),ut(p,this.option("mainClass")||""),ut(p,hp),this.container=p,this.footer=p.querySelector(".fancybox__footer"),c.appendChild(p),ut(document.documentElement,_y),_r&&Uo||(_r=document.createElement("span"),ut(_r,"fancybox-focus-guard"),_r.setAttribute(jo,"0"),_r.setAttribute(ap,"true"),_r.setAttribute("aria-label","Focus guard"),Uo=_r.cloneNode(),(i=p.parentElement)===null||i===void 0||i.insertBefore(_r,p),(o=p.parentElement)===null||o===void 0||o.append(Uo)),p.addEventListener("mousedown",b=>{Ey=b.pageX,Ty=b.pageY,ni(p,lp)}),this.option("closeExisting"))for(const b of La.values())b.id!==this.id&&b.close();else this.option("animated")&&(ut(p,cp),setTimeout(()=>{this.isClosing()||ni(p,cp)},350));this.emit("initLayout")}}initCarousel(i){const o=this.container;if(!o)return;const c=o.querySelector(".fancybox__carousel");if(!c)return;const p=this.carousel=new Fo(c,Nn({},{slides:i,transition:"fade",Panzoom:{lockAxis:this.option("dragToClose")?"xy":"x",infinite:!!this.option("dragToClose")&&"y"},Dots:!1,Navigation:{classes:{container:"fancybox__nav",button:"f-button",isNext:"is-next",isPrev:"is-prev"}},initialPage:this.option("startIndex"),l10n:this.option("l10n")},this.option("Carousel")||{}));p.on("*",(b,_,...h)=>{this.emit(`Carousel.${_}`,b,...h)}),p.on(["ready","change"],()=>{this.manageCaption()}),this.on("Carousel.removeSlide",(b,_,h)=>{this.clearContent(h),h.state=void 0}),p.on("Panzoom.touchStart",()=>{var b,_;this.isCompact||this.endIdle(),!((b=document.activeElement)===null||b===void 0)&&b.closest(".f-thumbs")&&((_=this.container)===null||_===void 0||_.focus())}),p.on("settle",()=>{this.idleTimer||this.isCompact||!this.option("idle")||this.setIdle(),this.option("autoFocus")&&!this.isClosing&&this.checkFocus()}),this.option("dragToClose")&&(p.on("Panzoom.afterTransform",(b,_)=>{const h=this.getSlide();if(h&&Hd(h.el))return;const M=this.container;if(M){const A=Math.abs(_.current.f),D=A<1?"":Math.max(.5,Math.min(1,1-A/_.contentRect.fitHeight*1.5));M.style.setProperty("--fancybox-ts",D?"0s":""),M.style.setProperty("--fancybox-opacity",D+"")}}),p.on("Panzoom.touchEnd",(b,_,h)=>{var M;const A=this.getSlide();if(A&&Hd(A.el)||_.isMobile&&document.activeElement&&["TEXTAREA","INPUT"].indexOf((M=document.activeElement)===null||M===void 0?void 0:M.nodeName)!==-1)return;const D=Math.abs(_.dragOffset.y);_.lockedAxis==="y"&&(D>=200||D>=50&&_.dragOffset.time<300)&&(h&&h.cancelable&&h.preventDefault(),this.close(h,"f-throwOut"+(_.current.f<0?"Up":"Down")))})),p.on("change",b=>{var _;let h=(_=this.getSlide())===null||_===void 0?void 0:_.triggerEl;if(h){const M=new CustomEvent("slideTo",{bubbles:!0,cancelable:!0,detail:b.page});h.dispatchEvent(M)}}),p.on(["refresh","change"],b=>{const _=this.container;if(!_)return;for(const A of _.querySelectorAll("[data-fancybox-current-index]"))A.innerHTML=b.page+1;for(const A of _.querySelectorAll("[data-fancybox-count]"))A.innerHTML=b.pages.length;if(!b.isInfinite){for(const A of _.querySelectorAll("[data-fancybox-next]"))b.page<b.pages.length-1?(A.removeAttribute(za),A.removeAttribute(jo)):(A.setAttribute(za,""),A.setAttribute(jo,"-1"));for(const A of _.querySelectorAll("[data-fancybox-prev]"))b.page>0?(A.removeAttribute(za),A.removeAttribute(jo)):(A.setAttribute(za,""),A.setAttribute(jo,"-1"))}const h=this.getSlide();if(!h)return;let M=h.downloadSrc||"";M||h.type!=="image"||h.error||!Gs(h[Ra])||(M=h[Ra]);for(const A of _.querySelectorAll("[data-fancybox-download]")){const D=h.downloadFilename;M?(A.removeAttribute(za),A.removeAttribute(jo),A.setAttribute(up,M),A.setAttribute(Sy,D||M),A.setAttribute("target","_blank")):(A.setAttribute(za,""),A.setAttribute(jo,"-1"),A.removeAttribute(up),A.removeAttribute(Sy))}}),this.emit("initCarousel")}attachEvents(){const i=this,o=i.container;if(!o)return;o.addEventListener("click",i.onClick,{passive:!1,capture:!1}),o.addEventListener("wheel",i.onWheel,{passive:!1,capture:!1}),document.addEventListener("keydown",i.onKeydown,{passive:!1,capture:!0}),document.addEventListener("visibilitychange",i.onVisibilityChange,!1),document.addEventListener("mousemove",i.onMousemove),i.option("trapFocus")&&document.addEventListener("focus",i.onFocus,!0),window.addEventListener("resize",i.onResize);const c=window.visualViewport;c&&(c.addEventListener("scroll",i.onResize),c.addEventListener("resize",i.onResize))}detachEvents(){const i=this,o=i.container;if(!o)return;document.removeEventListener("keydown",i.onKeydown,{passive:!1,capture:!0}),o.removeEventListener("wheel",i.onWheel,{passive:!1,capture:!1}),o.removeEventListener("click",i.onClick,{passive:!1,capture:!1}),document.removeEventListener("mousemove",i.onMousemove),window.removeEventListener("resize",i.onResize);const c=window.visualViewport;c&&(c.removeEventListener("resize",i.onResize),c.removeEventListener("scroll",i.onResize)),document.removeEventListener("visibilitychange",i.onVisibilityChange,!1),document.removeEventListener("focus",i.onFocus,!0)}scale(){const i=this.container;if(!i)return;const o=window.visualViewport,c=Math.max(1,(o==null?void 0:o.scale)||1);let p="",b="",_="";if(o&&c>1){let h=`${o.offsetLeft}px`,M=`${o.offsetTop}px`;p=o.width*c+"px",b=o.height*c+"px",_=`translate3d(${h}, ${M}, 0) scale(${1/c})`}i.style.transform=_,i.style.width=p,i.style.height=b}onClick(i){var o;const{container:c,isCompact:p}=this;if(!c||this.isClosing())return;!p&&this.option("idle")&&this.resetIdle();const b=i.composedPath()[0];if(b.closest(".fancybox-spinner")||b.closest("[data-fancybox-close]"))return i.preventDefault(),void this.close(i);if(b.closest("[data-fancybox-prev]"))return i.preventDefault(),void this.prev();if(b.closest("[data-fancybox-next]"))return i.preventDefault(),void this.next();if(i.type==="click"&&i.detail===0||Math.abs(i.pageX-Ey)>30||Math.abs(i.pageY-Ty)>30)return;const _=document.activeElement;if(ky()&&_&&c.contains(_))return;if(p&&((o=this.getSlide())===null||o===void 0?void 0:o.type)==="image")return void(this.clickTimer?(clearTimeout(this.clickTimer),this.clickTimer=null):this.clickTimer=setTimeout(()=>{this.toggleIdle(),this.clickTimer=null},350));if(this.emit("click",i),i.defaultPrevented)return;let h=!1;if(b.closest(".fancybox__content")){if(_){if(_.closest("[contenteditable]"))return;b.matches(ep)||_.blur()}if(ky())return;h=this.option("contentClick")}else b.closest(".fancybox__carousel")&&!b.matches(ep)&&(h=this.option("backdropClick"));h==="close"?(i.preventDefault(),this.close(i)):h==="next"?(i.preventDefault(),this.next()):h==="prev"&&(i.preventDefault(),this.prev())}onWheel(i){const o=i.target;let c=this.option("wheel",i);o.closest(".fancybox__thumbs")&&(c="slide");const p=c==="slide",b=[-i.deltaX||0,-i.deltaY||0,-i.detail||0].reduce(function(M,A){return Math.abs(A)>Math.abs(M)?A:M}),_=Math.max(-1,Math.min(1,b)),h=Date.now();this.pwt&&h-this.pwt<300?p&&i.preventDefault():(this.pwt=h,this.emit("wheel",i,_),i.defaultPrevented||(c==="close"?(i.preventDefault(),this.close(i)):c==="slide"&&(Ah(o)||(i.preventDefault(),this[_>0?"prev":"next"]()))))}onScroll(){window.scrollTo(Cy,My)}onKeydown(i){if(!this.isTopmost())return;this.isCompact||!this.option("idle")||this.isClosing()||this.resetIdle();const o=i.key,c=this.option("keyboard");if(!c)return;const p=i.composedPath()[0],b=document.activeElement&&document.activeElement.classList,_=b&&b.contains("f-button")||p.dataset.carouselPage||p.dataset.carouselIndex;if(o!=="Escape"&&!_&&Vn(p)&&(p.isContentEditable||["TEXTAREA","OPTION","INPUT","SELECT","VIDEO"].indexOf(p.nodeName)!==-1)||(i.key==="Tab"?ut(this.container,lp):ni(this.container,lp),i.ctrlKey||i.altKey||i.shiftKey))return;this.emit("keydown",o,i);const h=c[o];h&&typeof this[h]=="function"&&(i.preventDefault(),this[h]())}onResize(){const i=this.container;if(!i)return;const o=this.isCompact;i.classList.toggle(vy,o),this.manageCaption(this.getSlide()),this.isCompact?this.clearIdle():this.endIdle(),this.scale(),this.emit("resize")}onFocus(i){this.isTopmost()&&this.checkFocus(i)}onMousemove(i){this.prevMouseMoveEvent=i,!this.isCompact&&this.option("idle")&&this.resetIdle()}onVisibilityChange(){document.visibilityState==="visible"?this.checkFocus():this.endIdle()}manageCloseBtn(i){const o=this.optionFor(i,"closeButton")||!1;if(o==="auto"){const p=this.plugins.Toolbar;if(p&&p.state===$o.Ready)return}if(!o||!i.contentEl||i.closeBtnEl)return;const c=this.option("tpl.closeButton");if(c){const p=Yr(this.localize(c));i.closeBtnEl=i.contentEl.appendChild(p),i.el&&ut(i.el,"has-close-btn")}}manageCaption(i=void 0){var o,c;const p="fancybox__caption",b=this.container;if(!b)return;ni(b,qh);const _=this.isCompact||this.option("commonCaption"),h=!_;if(this.caption&&this.stop(this.caption),h&&this.caption&&(this.caption.remove(),this.caption=null),_&&!this.caption)for(const R of((o=this.carousel)===null||o===void 0?void 0:o.slides)||[])R.captionEl&&(R.captionEl.remove(),R.captionEl=void 0,ni(R.el,qh),(c=R.el)===null||c===void 0||c.removeAttribute("aria-labelledby"));if(i||(i=this.getSlide()),!i||_&&!this.isCurrentSlide(i))return;const M=i.el;let A=this.optionFor(i,"caption","");if(!A)return void(_&&this.caption&&this.animate(this.caption,"f-fadeOut",()=>{this.caption&&(this.caption.innerHTML="")}));let D=null;if(h){if(D=i.captionEl||null,M&&!D){const R=p+`_${this.id}_${i.index}`;D=document.createElement("div"),ut(D,p),D.setAttribute("id",R),i.captionEl=M.appendChild(D),ut(M,qh),M.setAttribute("aria-labelledby",R)}}else D=this.caption,D||(D=b.querySelector("."+p)),!D&&(D=document.createElement("div"),D.dataset.fancyboxCaption="",ut(D,p),(this.footer||b).prepend(D)),ut(b,qh),this.caption=D;D&&(D.innerHTML="",Gs(A)||typeof A=="number"?D.innerHTML=A+"":A instanceof HTMLElement&&D.appendChild(A))}checkFocus(i){this.focus(i)}focus(i){var o;if(this.ignoreFocusChange)return;const c=document.activeElement||null,p=(i==null?void 0:i.target)||null,b=this.container,_=(o=this.carousel)===null||o===void 0?void 0:o.viewport;if(!b||!_||!i&&c&&b.contains(c))return;const h=this.getSlide(),M=h&&h.state===dn.Ready?h.el:null;if(!M||M.contains(c)||b===c)return;i&&i.cancelable&&i.preventDefault(),this.ignoreFocusChange=!0;const A=Array.from(b.querySelectorAll(ep));let D=[],R=null;for(let j of A){const Y=!j.offsetParent||!!j.closest('[aria-hidden="true"]'),ee=M&&M.contains(j),oe=!_.contains(j);if(j===b||(ee||oe)&&!Y){D.push(j);const ue=j.dataset.origTabindex;ue!==void 0&&ue&&(j.tabIndex=parseFloat(ue)),j.removeAttribute("data-orig-tabindex"),!j.hasAttribute("autoFocus")&&R||(R=j)}else{const ue=j.dataset.origTabindex===void 0?j.getAttribute("tabindex")||"":j.dataset.origTabindex;ue&&(j.dataset.origTabindex=ue),j.tabIndex=-1}}let z=null;i?(!p||D.indexOf(p)<0)&&(z=R||b,D.length&&(c===Uo?z=D[0]:this.lastFocus!==b&&c!==_r||(z=D[D.length-1]))):z=h&&h.type==="image"?b:R||b,z&&Xg(z),this.lastFocus=document.activeElement,this.ignoreFocusChange=!1}next(){const i=this.carousel;i&&i.pages.length>1&&i.slideNext()}prev(){const i=this.carousel;i&&i.pages.length>1&&i.slidePrev()}jumpTo(...i){this.carousel&&this.carousel.slideTo(...i)}isTopmost(){var i;return((i=$t.getInstance())===null||i===void 0?void 0:i.id)==this.id}animate(i=null,o="",c){if(!i||!o)return void(c&&c());this.stop(i);const p=b=>{b.target===i&&i.dataset.animationName&&(i.removeEventListener("animationend",p),delete i.dataset.animationName,c&&c(),ni(i,o))};i.dataset.animationName=o,i.addEventListener("animationend",p),ut(i,o)}stop(i){i&&i.dispatchEvent(new CustomEvent("animationend",{bubbles:!1,cancelable:!0,currentTarget:i}))}setContent(i,o="",c=!0){if(this.isClosing())return;const p=i.el;if(!p)return;let b=null;if(Vn(o)?b=o:(b=Yr(o+""),Vn(b)||(b=document.createElement("div"),b.innerHTML=o+"")),["img","picture","iframe","video","audio"].includes(b.nodeName.toLowerCase())){const _=document.createElement("div");_.appendChild(b),b=_}Vn(b)&&i.filter&&!i.error&&(b=b.querySelector(i.filter)),b&&Vn(b)?(ut(b,"fancybox__content"),i.id&&b.setAttribute("id",i.id),p.classList.add(`has-${i.error?"error":i.type||"unknown"}`),p.prepend(b),b.style.display==="none"&&(b.style.display=""),getComputedStyle(b).getPropertyValue("display")==="none"&&(b.style.display=i.display||this.option("defaultDisplay")||"flex"),i.contentEl=b,c&&this.revealContent(i),this.manageCloseBtn(i),this.manageCaption(i)):this.setError(i,"{{ELEMENT_NOT_FOUND}}")}revealContent(i,o){const c=i.el,p=i.contentEl;c&&p&&(this.emit("reveal",i),this.hideLoading(i),i.state=dn.Opening,(o=this.isOpeningSlide(i)?o===void 0?this.optionFor(i,"showClass"):o:"f-fadeIn")?this.animate(p,o,()=>{this.done(i)}):this.done(i))}done(i){this.isClosing()||(i.state=dn.Ready,this.emit("done",i),ut(i.el,"is-done"),this.isCurrentSlide(i)&&this.option("autoFocus")&&queueMicrotask(()=>{var o;(o=i.panzoom)===null||o===void 0||o.updateControls(),this.option("autoFocus")&&this.focus()}),this.isOpeningSlide(i)&&(ni(this.container,hp),!this.isCompact&&this.option("idle")&&this.setIdle()))}isCurrentSlide(i){const o=this.getSlide();return!(!i||!o)&&o.index===i.index}isOpeningSlide(i){var o,c;return((o=this.carousel)===null||o===void 0?void 0:o.prevPage)===null&&i&&i.index===((c=this.getSlide())===null||c===void 0?void 0:c.index)}showLoading(i){i.state=dn.Loading;const o=i.el;o&&(ut(o,wy),this.emit("loading",i),i.spinnerEl||setTimeout(()=>{if(!this.isClosing()&&!i.spinnerEl&&i.state===dn.Loading){let c=Yr(Yd);ut(c,"fancybox-spinner"),i.spinnerEl=c,o.prepend(c),this.animate(c,"f-fadeIn")}},250))}hideLoading(i){const o=i.el;if(!o)return;const c=i.spinnerEl;this.isClosing()?c==null||c.remove():(ni(o,wy),c&&this.animate(c,"f-fadeOut",()=>{c.remove()}),i.state===dn.Loading&&(this.emit("loaded",i),i.state=dn.Ready))}setError(i,o){if(this.isClosing())return;const c=new Event("error",{bubbles:!0,cancelable:!0});if(this.emit("error",c,i),c.defaultPrevented)return;i.error=o,this.hideLoading(i),this.clearContent(i);const p=document.createElement("div");p.classList.add("fancybox-error"),p.innerHTML=this.localize(o||"<p>{{ERROR}}</p>"),this.setContent(i,p)}clearContent(i){if(i.state===void 0)return;this.emit("clearContent",i),i.contentEl&&(i.contentEl.remove(),i.contentEl=void 0);const o=i.el;o&&(ni(o,"has-error"),ni(o,"has-unknown"),ni(o,`has-${i.type||"unknown"}`)),i.closeBtnEl&&i.closeBtnEl.remove(),i.closeBtnEl=void 0,i.captionEl&&i.captionEl.remove(),i.captionEl=void 0,i.spinnerEl&&i.spinnerEl.remove(),i.spinnerEl=void 0}getSlide(){var i;const o=this.carousel;return((i=o==null?void 0:o.pages[o==null?void 0:o.page])===null||i===void 0?void 0:i.slides[0])||void 0}close(i,o){if(this.isClosing())return;const c=new Event("shouldClose",{bubbles:!0,cancelable:!0});if(this.emit("shouldClose",c,i),c.defaultPrevented)return;i&&i.cancelable&&(i.preventDefault(),i.stopPropagation());const p=()=>{this.proceedClose(i,o)};this.startedFs&&yr&&yr.isFullscreen()?Promise.resolve(yr.exit()).then(()=>p()):p()}clearIdle(){this.idleTimer&&clearTimeout(this.idleTimer),this.idleTimer=null}setIdle(i=!1){const o=()=>{this.clearIdle(),this.idle=!0,ut(this.container,"is-idle"),this.emit("setIdle")};if(this.clearIdle(),!this.isClosing())if(i)o();else{const c=this.option("idle");c&&(this.idleTimer=setTimeout(o,c))}}endIdle(){this.clearIdle(),this.idle&&!this.isClosing()&&(this.idle=!1,ni(this.container,"is-idle"),this.emit("endIdle"))}resetIdle(){this.endIdle(),this.setIdle()}toggleIdle(){this.idle?this.endIdle():this.setIdle(!0)}toggleFullscreen(){yr&&(yr.isFullscreen()?yr.exit():yr.request().then(()=>{this.startedFs=!0}))}isClosing(){return[Gi.Closing,Gi.CustomClosing,Gi.Destroy].includes(this.state)}proceedClose(i,o){var c,p;this.state=Gi.Closing,this.clearIdle(),this.detachEvents();const b=this.container,_=this.carousel,h=this.getSlide(),M=h&&this.option("placeFocusBack")?h.triggerEl||this.option("triggerEl"):null;if(M&&(Yg(M)?Xg(M):M.focus()),b&&(ni(b,hp),ut(b,"is-closing"),b.setAttribute(ap,"true"),this.option("animated")&&ut(b,cp),b.style.pointerEvents="none"),_){_.clearTransitions(),(c=_.panzoom)===null||c===void 0||c.destroy(),(p=_.plugins.Navigation)===null||p===void 0||p.detach();for(const A of _.slides){A.state=dn.Closing,this.hideLoading(A);const D=A.contentEl;D&&this.stop(D);const R=A==null?void 0:A.panzoom;R&&(R.stop(),R.detachEvents(),R.detachObserver()),this.isCurrentSlide(A)||_.emit("removeSlide",A)}}Cy=window.scrollX,My=window.scrollY,window.addEventListener("scroll",this.onScroll),this.emit("close",i),this.state!==Gi.CustomClosing?(o===void 0&&h&&(o=this.optionFor(h,"hideClass")),o&&h?(this.animate(h.contentEl,o,()=>{_&&_.emit("removeSlide",h)}),setTimeout(()=>{this.destroy()},500)):this.destroy()):setTimeout(()=>{this.destroy()},500)}destroy(){var i;if(this.state===Gi.Destroy)return;window.removeEventListener("scroll",this.onScroll),this.state=Gi.Destroy,(i=this.carousel)===null||i===void 0||i.destroy();const o=this.container;o&&o.remove(),La.delete(this.id);const c=$t.getInstance();c?c.focus():(_r&&(_r.remove(),_r=null),Uo&&(Uo.remove(),Uo=null),ni(document.documentElement,_y),(()=>{if(!Gl)return;const p=document,b=p.body;b.classList.remove(op),b.style.setProperty(by,""),p.documentElement.style.setProperty(xy,"")})(),this.emit("destroy"))}static bind(i,o,c){if(!Gl)return;let p,b="",_={};if(i===void 0?p=document.body:Gs(i)?(p=document.body,b=i,typeof o=="object"&&(_=o||{})):(p=i,Gs(o)&&(b=o),typeof c=="object"&&(_=c||{})),!p||!Vn(p))return;b=b||"[data-fancybox]";const h=$t.openers.get(p)||new Map;h.set(b,_),$t.openers.set(p,h),h.size===1&&p.addEventListener("click",$t.fromEvent)}static unbind(i,o){let c,p="";if(Gs(i)?(c=document.body,p=i):(c=i,Gs(o)&&(p=o)),!c)return;const b=$t.openers.get(c);b&&p&&b.delete(p),p&&b||($t.openers.delete(c),c.removeEventListener("click",$t.fromEvent))}static destroy(){let i;for(;i=$t.getInstance();)i.destroy();for(const o of $t.openers.keys())o.removeEventListener("click",$t.fromEvent);$t.openers=new Map}static fromEvent(i){if(i.defaultPrevented||i.button&&i.button!==0||i.ctrlKey||i.metaKey||i.shiftKey)return;let o=i.composedPath()[0];const c=o.closest("[data-fancybox-trigger]");if(c){const Y=c.dataset.fancyboxTrigger||"",ee=document.querySelectorAll(`[data-fancybox="${Y}"]`),oe=parseInt(c.dataset.fancyboxIndex||"",10)||0;o=ee[oe]||o}if(!(o&&o instanceof Element))return;let p,b,_,h;if([...$t.openers].reverse().find(([Y,ee])=>!(!Y.contains(o)||![...ee].reverse().find(([oe,ue])=>{let be=o.closest(oe);return!!be&&(p=Y,b=oe,_=be,h=ue,!0)}))),!p||!b||!_)return;h=h||{},i.preventDefault(),o=_;let M=[],A=Nn({},tp,h);A.event=i,A.triggerEl=o,A.delegate=c;const D=A.groupAll,R=A.groupAttr,z=R&&o?o.getAttribute(`${R}`):"";if((!o||z||D)&&(M=[].slice.call(p.querySelectorAll(b))),o&&!D&&(M=z?M.filter(Y=>Y.getAttribute(`${R}`)===z):[o]),!M.length)return;const j=$t.getInstance();return j&&j.options.triggerEl&&M.indexOf(j.options.triggerEl)>-1?void 0:(o&&(A.startIndex=M.indexOf(o)),$t.fromNodes(M,A))}static fromSelector(i,o,c){let p=null,b="",_={};if(Gs(i)?(p=document.body,b=i,typeof o=="object"&&(_=o||{})):i instanceof HTMLElement&&Gs(o)&&(p=i,b=o,typeof c=="object"&&(_=c||{})),!p||!b)return!1;const h=$t.openers.get(p);return!!h&&(_=Nn({},h.get(b)||{},_),!!_&&$t.fromNodes(Array.from(p.querySelectorAll(b)),_))}static fromNodes(i,o){o=Nn({},tp,o||{});const c=[];for(const p of i){const b=p.dataset||{},_=b[Ra]||p.getAttribute(up)||p.getAttribute("currentSrc")||p.getAttribute(Ra)||void 0;let h;const M=o.delegate;let A;M&&c.length===o.startIndex&&(h=M instanceof HTMLImageElement?M:M.querySelector("img:not([aria-hidden])")),h||(h=p instanceof HTMLImageElement?p:p.querySelector("img:not([aria-hidden])")),h&&(A=h.currentSrc||h[Ra]||void 0,!A&&h.dataset&&(A=h.dataset.lazySrc||h.dataset[Ra]||void 0));const D={src:_,triggerEl:p,thumbEl:h,thumbElSrc:A,thumbSrc:A};for(const R in b){let z=b[R]+"";z=z!=="false"&&(z==="true"||z),D[R]=z}c.push(D)}return new $t(c,o)}static getInstance(i){return i?La.get(i):Array.from(La.values()).reverse().find(o=>!o.isClosing()&&o)||null}static getSlide(){var i;return((i=$t.getInstance())===null||i===void 0?void 0:i.getSlide())||null}static show(i=[],o={}){return new $t(i,o)}static next(){const i=$t.getInstance();i&&i.next()}static prev(){const i=$t.getInstance();i&&i.prev()}static close(i=!0,...o){if(i)for(const c of La.values())c.close(...o);else{const c=$t.getInstance();c&&c.close(...o)}}}Object.defineProperty($t,"version",{enumerable:!0,configurable:!0,writable:!0,value:"5.0.36"}),Object.defineProperty($t,"defaults",{enumerable:!0,configurable:!0,writable:!0,value:tp}),Object.defineProperty($t,"Plugins",{enumerable:!0,configurable:!0,writable:!0,value:Tw}),Object.defineProperty($t,"openers",{enumerable:!0,configurable:!0,writable:!0,value:new Map});const Mw={props:{options:Object},mounted(){$t.bind(this.$refs.container,"[data-fancybox]",{...this.options||{}})},updated(){$t.unbind(this.$refs.container),$t.close(),$t.bind(this.$refs.container,"[data-fancybox]",{...this.options||{}})},unmounted(){$t.destroy()}},Pw={ref:"container"};function Iw(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",Pw,[k.renderSlot(n.$slots,"default")],512)}const Aw=Pt(Mw,[["render",Iw]]),Dw={props:["text"]},zw={class:"pl-3 text-sm font-medium text-gray-600"};function Rw(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",null,[k.createElementVNode("p",zw,k.toDisplayString(o.text),1)])}const Lw={components:{Fancybox:Aw,VsEmptyWidget:Pt(Dw,[["render",Rw]])},props:{id:{type:String,default:""},readonly:{type:Boolean,default:!1},prefilledData:{type:Array,default:()=>null}},data(){return{carouselOptions:{Carousel:{infinite:!1}},isModalVisible:!1,modal:{},images:[],editAction:!1,selectedFile:null,imageExtensions:["png","jpg","jpeg","gif"]}},watch:{id(){this.getFiles()}},mounted(){this.getFiles()},methods:{async downloadFile(n){const i=document.createElement("a");i.setAttribute("download",n.uploaded_name),i.href=n.file_path,i.click()},handleOpenModal(n){this.selectedFile=n,this.modal=this.prepareModal({title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити це зображення?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteFile,updateListOnConfirm:!0}),this.isModalVisible=!0},prepareModal(n){const i={...n};return n.cancel||(i.cancel=()=>{this.isModalVisible=!1}),n.updateListOnConfirm&&(i.confirm=async()=>{await n.confirm(),this.isModalVisible=!1,this.getFiles()}),i},async deleteFile(){try{await ft.delete(`/api/widget/gallery/${this.selectedFile.entity_id}/${this.selectedFile.file_id}`),this.isModalVisible=!1,this.selectedFile="",this.$emit("update","images"),this.getFiles()}catch(n){console.log(n)}},async addFile(n){console.log(n),await Promise.all(Array.from(n.target.files).map(async i=>{const o=new FormData;o.append("file",i);try{const c=`/api/widget/file/${this.id}`;return await ft.post(c,o),this.$emit("update","file-list"),i}catch(c){return console.error(c),null}})),await this.getFiles()},async getFiles(){if(this.prefilledData){this.images=this.prefilledData;return}try{const{data:n}=await ft.get(`/api/widget/gallery/${this.id}`);this.images=n.rows}catch(n){console.error(n)}},size(n,i=2){if(n===0)return"0 Bytes";const o=1024,c=i<0?0:i,p=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],b=Math.floor(Math.log(n)/Math.log(o));return`${parseFloat((n/o**b).toFixed(c))} ${p[b]}`},dateFormat(n){const i={day:"numeric",month:"long",year:"numeric",hour:"numeric",minute:"numeric"};return new Date(n).toLocaleDateString("uk-UK",i)}}},Ow={class:"vs-widget-images flex flex-col xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700"},Bw={class:"flex justify-between items-center gap-x-2 mb-4"},Fw={class:"flex justify-end items-center gap-x-2"},Nw=["href"],Vw=["src","alt"],$w={class:"item__text-content bg-white opacity-0 rounded-b-lg absolute w-full bottom-0 p-3 flex gap-2.5 items-center justify-between"},jw={class:"text-xs"},Uw={class:"widget-images__item-desc flex items-center text-xs text-gray-600 flex-wrap"},Hw={class:"flex items-center"},qw={class:"text-xs"},Zw=["onClick"],Ww=["onClick"],Gw={class:"p-4"},Yw={class:"mt-1 text-gray-500 dark:text-neutral-500"},Xw={class:"mt-4 flex justify-end gap-x-3"};function Kw(n,i,o,c,p,b){var A;const _=k.resolveComponent("Fancybox"),h=k.resolveComponent("VsEmptyWidget"),M=k.resolveComponent("VsDialog");return k.openBlock(),k.createElementBlock("div",Ow,[k.createElementVNode("div",Bw,[i[5]||(i[5]=k.createElementVNode("h2",{class:"inline-block font-semibold text-gray-800 dark:text-neutral-200"}," Зображення ",-1)),k.createElementVNode("div",Fw,[k.createElementVNode("div",null,[k.createElementVNode("label",null,[k.createElementVNode("input",{type:"file",class:"hidden",onChange:i[0]||(i[0]=D=>b.addFile(D))},null,32),i[4]||(i[4]=k.createElementVNode("div",{class:"py-2 px-2.5 inline-flex relative items-center gap-x-1.5 text-xs rounded-lg border border-blue-200 bg-blue-500 text-white shadow-sm hover:bg-blue-700 cursor-pointer"},[k.createElementVNode("i",{class:"ti ti-upload"}),k.createTextVNode(" Завантажити файл ")],-1))])])])]),(A=p.images)!=null&&A.length?(k.openBlock(),k.createBlock(_,{key:0,options:p.carouselOptions,class:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-4"},{default:k.withCtx(()=>[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(p.images,D=>(k.openBlock(),k.createElementBlock("div",{key:D.file_path,class:"relative cursor-pointer rounded-b-lg item hover:shadow-lg h-[200px]"},[k.createElementVNode("a",{"data-fancybox":"gallery",href:D.file_path},[k.createElementVNode("img",{class:"h-full w-full rounded-lg",src:D.file_path||"/icons/no-image.jpg",alt:D.uploaded_name,width:"100%",height:"100%"},null,8,Vw),k.createElementVNode("div",$w,[k.createElementVNode("div",null,[k.createElementVNode("span",jw,k.toDisplayString(D.uploaded_name),1),k.createElementVNode("div",Uw,[k.createElementVNode("span",Hw,k.toDisplayString(b.size(D.size)),1),k.createElementVNode("span",null,k.toDisplayString(b.dateFormat(D.cdate)),1)]),k.createElementVNode("span",qw,k.toDisplayString(D.username),1)]),k.createElementVNode("div",null,[k.createElementVNode("div",{class:k.normalizeClass(["flex items-center justify-center gap-2 hover:bg-gray-200 p-1 rounded",{disabled:o.readonly,"hover:cursor-pointer":!o.readonly}]),onClick:k.withModifiers(R=>b.downloadFile(D),["prevent"])},i[6]||(i[6]=[k.createElementVNode("i",{class:"ti ti-edit"},null,-1)]),10,Zw),k.createElementVNode("div",{class:"flex items-center gap-2 hover:bg-gray-200 p-1 rounded hover:cursor-pointer",onClick:k.withModifiers(R=>b.handleOpenModal(D),["prevent"])},i[7]||(i[7]=[k.createElementVNode("i",{class:"ti ti-trash"},null,-1)]),8,Ww)])])],8,Nw)]))),128))]),_:1},8,["options"])):(k.openBlock(),k.createBlock(h,{key:1,text:"Зображення відсутні"})),k.createVNode(M,{title:p.modal.title,size:"small",visible:p.isModalVisible,"onUpdate:visible":i[3]||(i[3]=D=>p.isModalVisible=D)},{default:k.withCtx(()=>[k.createElementVNode("div",Gw,[k.createElementVNode("p",Yw,k.toDisplayString(p.modal.message),1),k.createElementVNode("div",Xw,[k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm 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:i[1]||(i[1]=(...D)=>p.modal.cancel&&p.modal.cancel(...D))},k.toDisplayString(p.modal.cancelButtonText),1),k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:i[2]||(i[2]=(...D)=>p.modal.confirm&&p.modal.confirm(...D))},k.toDisplayString(p.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const Jw=Pt(Lw,[["render",Kw]]);//! moment.js
621
+ //! version : 2.30.1
622
+ //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
623
+ //! license : MIT
624
+ //! momentjs.com
625
+ var Py;function Je(){return Py.apply(null,arguments)}function Qw(n){Py=n}function Br(n){return n instanceof Array||Object.prototype.toString.call(n)==="[object Array]"}function Ho(n){return n!=null&&Object.prototype.toString.call(n)==="[object Object]"}function Kt(n,i){return Object.prototype.hasOwnProperty.call(n,i)}function dp(n){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(n).length===0;var i;for(i in n)if(Kt(n,i))return!1;return!0}function $n(n){return n===void 0}function _s(n){return typeof n=="number"||Object.prototype.toString.call(n)==="[object Number]"}function Jl(n){return n instanceof Date||Object.prototype.toString.call(n)==="[object Date]"}function Iy(n,i){var o=[],c,p=n.length;for(c=0;c<p;++c)o.push(i(n[c],c));return o}function Ys(n,i){for(var o in i)Kt(i,o)&&(n[o]=i[o]);return Kt(i,"toString")&&(n.toString=i.toString),Kt(i,"valueOf")&&(n.valueOf=i.valueOf),n}function Jr(n,i,o,c){return n_(n,i,o,c,!0).utc()}function e2(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function Dt(n){return n._pf==null&&(n._pf=e2()),n._pf}var pp;Array.prototype.some?pp=Array.prototype.some:pp=function(n){var i=Object(this),o=i.length>>>0,c;for(c=0;c<o;c++)if(c in i&&n.call(this,i[c],c,i))return!0;return!1};function fp(n){var i=null,o=!1,c=n._d&&!isNaN(n._d.getTime());if(c&&(i=Dt(n),o=pp.call(i.parsedDateParts,function(p){return p!=null}),c=i.overflow<0&&!i.empty&&!i.invalidEra&&!i.invalidMonth&&!i.invalidWeekday&&!i.weekdayMismatch&&!i.nullInput&&!i.invalidFormat&&!i.userInvalidated&&(!i.meridiem||i.meridiem&&o),n._strict&&(c=c&&i.charsLeftOver===0&&i.unusedTokens.length===0&&i.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(n))n._isValid=c;else return c;return n._isValid}function Zh(n){var i=Jr(NaN);return n!=null?Ys(Dt(i),n):Dt(i).userInvalidated=!0,i}var Ay=Je.momentProperties=[],mp=!1;function gp(n,i){var o,c,p,b=Ay.length;if($n(i._isAMomentObject)||(n._isAMomentObject=i._isAMomentObject),$n(i._i)||(n._i=i._i),$n(i._f)||(n._f=i._f),$n(i._l)||(n._l=i._l),$n(i._strict)||(n._strict=i._strict),$n(i._tzm)||(n._tzm=i._tzm),$n(i._isUTC)||(n._isUTC=i._isUTC),$n(i._offset)||(n._offset=i._offset),$n(i._pf)||(n._pf=Dt(i)),$n(i._locale)||(n._locale=i._locale),b>0)for(o=0;o<b;o++)c=Ay[o],p=i[c],$n(p)||(n[c]=p);return n}function Ql(n){gp(this,n),this._d=new Date(n._d!=null?n._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),mp===!1&&(mp=!0,Je.updateOffset(this),mp=!1)}function Fr(n){return n instanceof Ql||n!=null&&n._isAMomentObject!=null}function Dy(n){Je.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+n)}function xr(n,i){var o=!0;return Ys(function(){if(Je.deprecationHandler!=null&&Je.deprecationHandler(null,n),o){var c=[],p,b,_,h=arguments.length;for(b=0;b<h;b++){if(p="",typeof arguments[b]=="object"){p+=`
626
+ [`+b+"] ";for(_ in arguments[0])Kt(arguments[0],_)&&(p+=_+": "+arguments[0][_]+", ");p=p.slice(0,-2)}else p=arguments[b];c.push(p)}Dy(n+`
627
+ Arguments: `+Array.prototype.slice.call(c).join("")+`
628
+ `+new Error().stack),o=!1}return i.apply(this,arguments)},i)}var zy={};function Ry(n,i){Je.deprecationHandler!=null&&Je.deprecationHandler(n,i),zy[n]||(Dy(i),zy[n]=!0)}Je.suppressDeprecationWarnings=!1,Je.deprecationHandler=null;function Qr(n){return typeof Function<"u"&&n instanceof Function||Object.prototype.toString.call(n)==="[object Function]"}function t2(n){var i,o;for(o in n)Kt(n,o)&&(i=n[o],Qr(i)?this[o]=i:this["_"+o]=i);this._config=n,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function yp(n,i){var o=Ys({},n),c;for(c in i)Kt(i,c)&&(Ho(n[c])&&Ho(i[c])?(o[c]={},Ys(o[c],n[c]),Ys(o[c],i[c])):i[c]!=null?o[c]=i[c]:delete o[c]);for(c in n)Kt(n,c)&&!Kt(i,c)&&Ho(n[c])&&(o[c]=Ys({},o[c]));return o}function _p(n){n!=null&&this.set(n)}var xp;Object.keys?xp=Object.keys:xp=function(n){var i,o=[];for(i in n)Kt(n,i)&&o.push(i);return o};var i2={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function n2(n,i,o){var c=this._calendar[n]||this._calendar.sameElse;return Qr(c)?c.call(i,o):c}function es(n,i,o){var c=""+Math.abs(n),p=i-c.length,b=n>=0;return(b?o?"+":"":"-")+Math.pow(10,Math.max(0,p)).toString().substr(1)+c}var bp=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Wh=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,vp={},Oa={};function dt(n,i,o,c){var p=c;typeof c=="string"&&(p=function(){return this[c]()}),n&&(Oa[n]=p),i&&(Oa[i[0]]=function(){return es(p.apply(this,arguments),i[1],i[2])}),o&&(Oa[o]=function(){return this.localeData().ordinal(p.apply(this,arguments),n)})}function r2(n){return n.match(/\[[\s\S]/)?n.replace(/^\[|\]$/g,""):n.replace(/\\/g,"")}function s2(n){var i=n.match(bp),o,c;for(o=0,c=i.length;o<c;o++)Oa[i[o]]?i[o]=Oa[i[o]]:i[o]=r2(i[o]);return function(p){var b="",_;for(_=0;_<c;_++)b+=Qr(i[_])?i[_].call(p,n):i[_];return b}}function Gh(n,i){return n.isValid()?(i=Ly(i,n.localeData()),vp[i]=vp[i]||s2(i),vp[i](n)):n.localeData().invalidDate()}function Ly(n,i){var o=5;function c(p){return i.longDateFormat(p)||p}for(Wh.lastIndex=0;o>=0&&Wh.test(n);)n=n.replace(Wh,c),Wh.lastIndex=0,o-=1;return n}var o2={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function a2(n){var i=this._longDateFormat[n],o=this._longDateFormat[n.toUpperCase()];return i||!o?i:(this._longDateFormat[n]=o.match(bp).map(function(c){return c==="MMMM"||c==="MM"||c==="DD"||c==="dddd"?c.slice(1):c}).join(""),this._longDateFormat[n])}var l2="Invalid date";function c2(){return this._invalidDate}var h2="%d",u2=/\d{1,2}/;function d2(n){return this._ordinal.replace("%d",n)}var p2={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function f2(n,i,o,c){var p=this._relativeTime[o];return Qr(p)?p(n,i,o,c):p.replace(/%d/i,n)}function m2(n,i){var o=this._relativeTime[n>0?"future":"past"];return Qr(o)?o(i):o.replace(/%s/i,i)}var Oy={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function br(n){return typeof n=="string"?Oy[n]||Oy[n.toLowerCase()]:void 0}function wp(n){var i={},o,c;for(c in n)Kt(n,c)&&(o=br(c),o&&(i[o]=n[c]));return i}var g2={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function y2(n){var i=[],o;for(o in n)Kt(n,o)&&i.push({unit:o,priority:g2[o]});return i.sort(function(c,p){return c.priority-p.priority}),i}var By=/\d/,er=/\d\d/,Fy=/\d{3}/,Sp=/\d{4}/,Yh=/[+-]?\d{6}/,bi=/\d\d?/,Ny=/\d\d\d\d?/,Vy=/\d\d\d\d\d\d?/,Xh=/\d{1,3}/,kp=/\d{1,4}/,Kh=/[+-]?\d{1,6}/,Ba=/\d+/,Jh=/[+-]?\d+/,_2=/Z|[+-]\d\d:?\d\d/gi,Qh=/Z|[+-]\d\d(?::?\d\d)?/gi,x2=/[+-]?\d+(\.\d{1,3})?/,ec=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Fa=/^[1-9]\d?/,Ep=/^([1-9]\d|\d)/,eu;eu={};function rt(n,i,o){eu[n]=Qr(i)?i:function(c,p){return c&&o?o:i}}function b2(n,i){return Kt(eu,n)?eu[n](i._strict,i._locale):new RegExp(v2(n))}function v2(n){return xs(n.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(i,o,c,p,b){return o||c||p||b}))}function xs(n){return n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function vr(n){return n<0?Math.ceil(n)||0:Math.floor(n)}function Ht(n){var i=+n,o=0;return i!==0&&isFinite(i)&&(o=vr(i)),o}var Tp={};function di(n,i){var o,c=i,p;for(typeof n=="string"&&(n=[n]),_s(i)&&(c=function(b,_){_[i]=Ht(b)}),p=n.length,o=0;o<p;o++)Tp[n[o]]=c}function tc(n,i){di(n,function(o,c,p,b){p._w=p._w||{},i(o,p._w,p,b)})}function w2(n,i,o){i!=null&&Kt(Tp,n)&&Tp[n](i,o._a,o,n)}function tu(n){return n%4===0&&n%100!==0||n%400===0}var pn=0,bs=1,ts=2,ji=3,Nr=4,vs=5,qo=6,S2=7,k2=8;dt("Y",0,0,function(){var n=this.year();return n<=9999?es(n,4):"+"+n}),dt(0,["YY",2],0,function(){return this.year()%100}),dt(0,["YYYY",4],0,"year"),dt(0,["YYYYY",5],0,"year"),dt(0,["YYYYYY",6,!0],0,"year"),rt("Y",Jh),rt("YY",bi,er),rt("YYYY",kp,Sp),rt("YYYYY",Kh,Yh),rt("YYYYYY",Kh,Yh),di(["YYYYY","YYYYYY"],pn),di("YYYY",function(n,i){i[pn]=n.length===2?Je.parseTwoDigitYear(n):Ht(n)}),di("YY",function(n,i){i[pn]=Je.parseTwoDigitYear(n)}),di("Y",function(n,i){i[pn]=parseInt(n,10)});function ic(n){return tu(n)?366:365}Je.parseTwoDigitYear=function(n){return Ht(n)+(Ht(n)>68?1900:2e3)};var $y=Na("FullYear",!0);function E2(){return tu(this.year())}function Na(n,i){return function(o){return o!=null?(jy(this,n,o),Je.updateOffset(this,i),this):nc(this,n)}}function nc(n,i){if(!n.isValid())return NaN;var o=n._d,c=n._isUTC;switch(i){case"Milliseconds":return c?o.getUTCMilliseconds():o.getMilliseconds();case"Seconds":return c?o.getUTCSeconds():o.getSeconds();case"Minutes":return c?o.getUTCMinutes():o.getMinutes();case"Hours":return c?o.getUTCHours():o.getHours();case"Date":return c?o.getUTCDate():o.getDate();case"Day":return c?o.getUTCDay():o.getDay();case"Month":return c?o.getUTCMonth():o.getMonth();case"FullYear":return c?o.getUTCFullYear():o.getFullYear();default:return NaN}}function jy(n,i,o){var c,p,b,_,h;if(!(!n.isValid()||isNaN(o))){switch(c=n._d,p=n._isUTC,i){case"Milliseconds":return void(p?c.setUTCMilliseconds(o):c.setMilliseconds(o));case"Seconds":return void(p?c.setUTCSeconds(o):c.setSeconds(o));case"Minutes":return void(p?c.setUTCMinutes(o):c.setMinutes(o));case"Hours":return void(p?c.setUTCHours(o):c.setHours(o));case"Date":return void(p?c.setUTCDate(o):c.setDate(o));case"FullYear":break;default:return}b=o,_=n.month(),h=n.date(),h=h===29&&_===1&&!tu(b)?28:h,p?c.setUTCFullYear(b,_,h):c.setFullYear(b,_,h)}}function T2(n){return n=br(n),Qr(this[n])?this[n]():this}function C2(n,i){if(typeof n=="object"){n=wp(n);var o=y2(n),c,p=o.length;for(c=0;c<p;c++)this[o[c].unit](n[o[c].unit])}else if(n=br(n),Qr(this[n]))return this[n](i);return this}function M2(n,i){return(n%i+i)%i}var Li;Array.prototype.indexOf?Li=Array.prototype.indexOf:Li=function(n){var i;for(i=0;i<this.length;++i)if(this[i]===n)return i;return-1};function Cp(n,i){if(isNaN(n)||isNaN(i))return NaN;var o=M2(i,12);return n+=(i-o)/12,o===1?tu(n)?29:28:31-o%7%2}dt("M",["MM",2],"Mo",function(){return this.month()+1}),dt("MMM",0,0,function(n){return this.localeData().monthsShort(this,n)}),dt("MMMM",0,0,function(n){return this.localeData().months(this,n)}),rt("M",bi,Fa),rt("MM",bi,er),rt("MMM",function(n,i){return i.monthsShortRegex(n)}),rt("MMMM",function(n,i){return i.monthsRegex(n)}),di(["M","MM"],function(n,i){i[bs]=Ht(n)-1}),di(["MMM","MMMM"],function(n,i,o,c){var p=o._locale.monthsParse(n,c,o._strict);p!=null?i[bs]=p:Dt(o).invalidMonth=n});var P2="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),Uy="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Hy=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,I2=ec,A2=ec;function D2(n,i){return n?Br(this._months)?this._months[n.month()]:this._months[(this._months.isFormat||Hy).test(i)?"format":"standalone"][n.month()]:Br(this._months)?this._months:this._months.standalone}function z2(n,i){return n?Br(this._monthsShort)?this._monthsShort[n.month()]:this._monthsShort[Hy.test(i)?"format":"standalone"][n.month()]:Br(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function R2(n,i,o){var c,p,b,_=n.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],c=0;c<12;++c)b=Jr([2e3,c]),this._shortMonthsParse[c]=this.monthsShort(b,"").toLocaleLowerCase(),this._longMonthsParse[c]=this.months(b,"").toLocaleLowerCase();return o?i==="MMM"?(p=Li.call(this._shortMonthsParse,_),p!==-1?p:null):(p=Li.call(this._longMonthsParse,_),p!==-1?p:null):i==="MMM"?(p=Li.call(this._shortMonthsParse,_),p!==-1?p:(p=Li.call(this._longMonthsParse,_),p!==-1?p:null)):(p=Li.call(this._longMonthsParse,_),p!==-1?p:(p=Li.call(this._shortMonthsParse,_),p!==-1?p:null))}function L2(n,i,o){var c,p,b;if(this._monthsParseExact)return R2.call(this,n,i,o);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),c=0;c<12;c++){if(p=Jr([2e3,c]),o&&!this._longMonthsParse[c]&&(this._longMonthsParse[c]=new RegExp("^"+this.months(p,"").replace(".","")+"$","i"),this._shortMonthsParse[c]=new RegExp("^"+this.monthsShort(p,"").replace(".","")+"$","i")),!o&&!this._monthsParse[c]&&(b="^"+this.months(p,"")+"|^"+this.monthsShort(p,""),this._monthsParse[c]=new RegExp(b.replace(".",""),"i")),o&&i==="MMMM"&&this._longMonthsParse[c].test(n))return c;if(o&&i==="MMM"&&this._shortMonthsParse[c].test(n))return c;if(!o&&this._monthsParse[c].test(n))return c}}function qy(n,i){if(!n.isValid())return n;if(typeof i=="string"){if(/^\d+$/.test(i))i=Ht(i);else if(i=n.localeData().monthsParse(i),!_s(i))return n}var o=i,c=n.date();return c=c<29?c:Math.min(c,Cp(n.year(),o)),n._isUTC?n._d.setUTCMonth(o,c):n._d.setMonth(o,c),n}function Zy(n){return n!=null?(qy(this,n),Je.updateOffset(this,!0),this):nc(this,"Month")}function O2(){return Cp(this.year(),this.month())}function B2(n){return this._monthsParseExact?(Kt(this,"_monthsRegex")||Wy.call(this),n?this._monthsShortStrictRegex:this._monthsShortRegex):(Kt(this,"_monthsShortRegex")||(this._monthsShortRegex=I2),this._monthsShortStrictRegex&&n?this._monthsShortStrictRegex:this._monthsShortRegex)}function F2(n){return this._monthsParseExact?(Kt(this,"_monthsRegex")||Wy.call(this),n?this._monthsStrictRegex:this._monthsRegex):(Kt(this,"_monthsRegex")||(this._monthsRegex=A2),this._monthsStrictRegex&&n?this._monthsStrictRegex:this._monthsRegex)}function Wy(){function n(M,A){return A.length-M.length}var i=[],o=[],c=[],p,b,_,h;for(p=0;p<12;p++)b=Jr([2e3,p]),_=xs(this.monthsShort(b,"")),h=xs(this.months(b,"")),i.push(_),o.push(h),c.push(h),c.push(_);i.sort(n),o.sort(n),c.sort(n),this._monthsRegex=new RegExp("^("+c.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+i.join("|")+")","i")}function N2(n,i,o,c,p,b,_){var h;return n<100&&n>=0?(h=new Date(n+400,i,o,c,p,b,_),isFinite(h.getFullYear())&&h.setFullYear(n)):h=new Date(n,i,o,c,p,b,_),h}function rc(n){var i,o;return n<100&&n>=0?(o=Array.prototype.slice.call(arguments),o[0]=n+400,i=new Date(Date.UTC.apply(null,o)),isFinite(i.getUTCFullYear())&&i.setUTCFullYear(n)):i=new Date(Date.UTC.apply(null,arguments)),i}function iu(n,i,o){var c=7+i-o,p=(7+rc(n,0,c).getUTCDay()-i)%7;return-p+c-1}function Gy(n,i,o,c,p){var b=(7+o-c)%7,_=iu(n,c,p),h=1+7*(i-1)+b+_,M,A;return h<=0?(M=n-1,A=ic(M)+h):h>ic(n)?(M=n+1,A=h-ic(n)):(M=n,A=h),{year:M,dayOfYear:A}}function sc(n,i,o){var c=iu(n.year(),i,o),p=Math.floor((n.dayOfYear()-c-1)/7)+1,b,_;return p<1?(_=n.year()-1,b=p+ws(_,i,o)):p>ws(n.year(),i,o)?(b=p-ws(n.year(),i,o),_=n.year()+1):(_=n.year(),b=p),{week:b,year:_}}function ws(n,i,o){var c=iu(n,i,o),p=iu(n+1,i,o);return(ic(n)-c+p)/7}dt("w",["ww",2],"wo","week"),dt("W",["WW",2],"Wo","isoWeek"),rt("w",bi,Fa),rt("ww",bi,er),rt("W",bi,Fa),rt("WW",bi,er),tc(["w","ww","W","WW"],function(n,i,o,c){i[c.substr(0,1)]=Ht(n)});function V2(n){return sc(n,this._week.dow,this._week.doy).week}var $2={dow:0,doy:6};function j2(){return this._week.dow}function U2(){return this._week.doy}function H2(n){var i=this.localeData().week(this);return n==null?i:this.add((n-i)*7,"d")}function q2(n){var i=sc(this,1,4).week;return n==null?i:this.add((n-i)*7,"d")}dt("d",0,"do","day"),dt("dd",0,0,function(n){return this.localeData().weekdaysMin(this,n)}),dt("ddd",0,0,function(n){return this.localeData().weekdaysShort(this,n)}),dt("dddd",0,0,function(n){return this.localeData().weekdays(this,n)}),dt("e",0,0,"weekday"),dt("E",0,0,"isoWeekday"),rt("d",bi),rt("e",bi),rt("E",bi),rt("dd",function(n,i){return i.weekdaysMinRegex(n)}),rt("ddd",function(n,i){return i.weekdaysShortRegex(n)}),rt("dddd",function(n,i){return i.weekdaysRegex(n)}),tc(["dd","ddd","dddd"],function(n,i,o,c){var p=o._locale.weekdaysParse(n,c,o._strict);p!=null?i.d=p:Dt(o).invalidWeekday=n}),tc(["d","e","E"],function(n,i,o,c){i[c]=Ht(n)});function Z2(n,i){return typeof n!="string"?n:isNaN(n)?(n=i.weekdaysParse(n),typeof n=="number"?n:null):parseInt(n,10)}function W2(n,i){return typeof n=="string"?i.weekdaysParse(n)%7||7:isNaN(n)?null:n}function Mp(n,i){return n.slice(i,7).concat(n.slice(0,i))}var G2="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Yy="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Y2="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),X2=ec,K2=ec,J2=ec;function Q2(n,i){var o=Br(this._weekdays)?this._weekdays:this._weekdays[n&&n!==!0&&this._weekdays.isFormat.test(i)?"format":"standalone"];return n===!0?Mp(o,this._week.dow):n?o[n.day()]:o}function eS(n){return n===!0?Mp(this._weekdaysShort,this._week.dow):n?this._weekdaysShort[n.day()]:this._weekdaysShort}function tS(n){return n===!0?Mp(this._weekdaysMin,this._week.dow):n?this._weekdaysMin[n.day()]:this._weekdaysMin}function iS(n,i,o){var c,p,b,_=n.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],c=0;c<7;++c)b=Jr([2e3,1]).day(c),this._minWeekdaysParse[c]=this.weekdaysMin(b,"").toLocaleLowerCase(),this._shortWeekdaysParse[c]=this.weekdaysShort(b,"").toLocaleLowerCase(),this._weekdaysParse[c]=this.weekdays(b,"").toLocaleLowerCase();return o?i==="dddd"?(p=Li.call(this._weekdaysParse,_),p!==-1?p:null):i==="ddd"?(p=Li.call(this._shortWeekdaysParse,_),p!==-1?p:null):(p=Li.call(this._minWeekdaysParse,_),p!==-1?p:null):i==="dddd"?(p=Li.call(this._weekdaysParse,_),p!==-1||(p=Li.call(this._shortWeekdaysParse,_),p!==-1)?p:(p=Li.call(this._minWeekdaysParse,_),p!==-1?p:null)):i==="ddd"?(p=Li.call(this._shortWeekdaysParse,_),p!==-1||(p=Li.call(this._weekdaysParse,_),p!==-1)?p:(p=Li.call(this._minWeekdaysParse,_),p!==-1?p:null)):(p=Li.call(this._minWeekdaysParse,_),p!==-1||(p=Li.call(this._weekdaysParse,_),p!==-1)?p:(p=Li.call(this._shortWeekdaysParse,_),p!==-1?p:null))}function nS(n,i,o){var c,p,b;if(this._weekdaysParseExact)return iS.call(this,n,i,o);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),c=0;c<7;c++){if(p=Jr([2e3,1]).day(c),o&&!this._fullWeekdaysParse[c]&&(this._fullWeekdaysParse[c]=new RegExp("^"+this.weekdays(p,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[c]=new RegExp("^"+this.weekdaysShort(p,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[c]=new RegExp("^"+this.weekdaysMin(p,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[c]||(b="^"+this.weekdays(p,"")+"|^"+this.weekdaysShort(p,"")+"|^"+this.weekdaysMin(p,""),this._weekdaysParse[c]=new RegExp(b.replace(".",""),"i")),o&&i==="dddd"&&this._fullWeekdaysParse[c].test(n))return c;if(o&&i==="ddd"&&this._shortWeekdaysParse[c].test(n))return c;if(o&&i==="dd"&&this._minWeekdaysParse[c].test(n))return c;if(!o&&this._weekdaysParse[c].test(n))return c}}function rS(n){if(!this.isValid())return n!=null?this:NaN;var i=nc(this,"Day");return n!=null?(n=Z2(n,this.localeData()),this.add(n-i,"d")):i}function sS(n){if(!this.isValid())return n!=null?this:NaN;var i=(this.day()+7-this.localeData()._week.dow)%7;return n==null?i:this.add(n-i,"d")}function oS(n){if(!this.isValid())return n!=null?this:NaN;if(n!=null){var i=W2(n,this.localeData());return this.day(this.day()%7?i:i-7)}else return this.day()||7}function aS(n){return this._weekdaysParseExact?(Kt(this,"_weekdaysRegex")||Pp.call(this),n?this._weekdaysStrictRegex:this._weekdaysRegex):(Kt(this,"_weekdaysRegex")||(this._weekdaysRegex=X2),this._weekdaysStrictRegex&&n?this._weekdaysStrictRegex:this._weekdaysRegex)}function lS(n){return this._weekdaysParseExact?(Kt(this,"_weekdaysRegex")||Pp.call(this),n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(Kt(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=K2),this._weekdaysShortStrictRegex&&n?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function cS(n){return this._weekdaysParseExact?(Kt(this,"_weekdaysRegex")||Pp.call(this),n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(Kt(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=J2),this._weekdaysMinStrictRegex&&n?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Pp(){function n(D,R){return R.length-D.length}var i=[],o=[],c=[],p=[],b,_,h,M,A;for(b=0;b<7;b++)_=Jr([2e3,1]).day(b),h=xs(this.weekdaysMin(_,"")),M=xs(this.weekdaysShort(_,"")),A=xs(this.weekdays(_,"")),i.push(h),o.push(M),c.push(A),p.push(h),p.push(M),p.push(A);i.sort(n),o.sort(n),c.sort(n),p.sort(n),this._weekdaysRegex=new RegExp("^("+p.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function Ip(){return this.hours()%12||12}function hS(){return this.hours()||24}dt("H",["HH",2],0,"hour"),dt("h",["hh",2],0,Ip),dt("k",["kk",2],0,hS),dt("hmm",0,0,function(){return""+Ip.apply(this)+es(this.minutes(),2)}),dt("hmmss",0,0,function(){return""+Ip.apply(this)+es(this.minutes(),2)+es(this.seconds(),2)}),dt("Hmm",0,0,function(){return""+this.hours()+es(this.minutes(),2)}),dt("Hmmss",0,0,function(){return""+this.hours()+es(this.minutes(),2)+es(this.seconds(),2)});function Xy(n,i){dt(n,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),i)})}Xy("a",!0),Xy("A",!1);function Ky(n,i){return i._meridiemParse}rt("a",Ky),rt("A",Ky),rt("H",bi,Ep),rt("h",bi,Fa),rt("k",bi,Fa),rt("HH",bi,er),rt("hh",bi,er),rt("kk",bi,er),rt("hmm",Ny),rt("hmmss",Vy),rt("Hmm",Ny),rt("Hmmss",Vy),di(["H","HH"],ji),di(["k","kk"],function(n,i,o){var c=Ht(n);i[ji]=c===24?0:c}),di(["a","A"],function(n,i,o){o._isPm=o._locale.isPM(n),o._meridiem=n}),di(["h","hh"],function(n,i,o){i[ji]=Ht(n),Dt(o).bigHour=!0}),di("hmm",function(n,i,o){var c=n.length-2;i[ji]=Ht(n.substr(0,c)),i[Nr]=Ht(n.substr(c)),Dt(o).bigHour=!0}),di("hmmss",function(n,i,o){var c=n.length-4,p=n.length-2;i[ji]=Ht(n.substr(0,c)),i[Nr]=Ht(n.substr(c,2)),i[vs]=Ht(n.substr(p)),Dt(o).bigHour=!0}),di("Hmm",function(n,i,o){var c=n.length-2;i[ji]=Ht(n.substr(0,c)),i[Nr]=Ht(n.substr(c))}),di("Hmmss",function(n,i,o){var c=n.length-4,p=n.length-2;i[ji]=Ht(n.substr(0,c)),i[Nr]=Ht(n.substr(c,2)),i[vs]=Ht(n.substr(p))});function uS(n){return(n+"").toLowerCase().charAt(0)==="p"}var dS=/[ap]\.?m?\.?/i,pS=Na("Hours",!0);function fS(n,i,o){return n>11?o?"pm":"PM":o?"am":"AM"}var Jy={calendar:i2,longDateFormat:o2,invalidDate:l2,ordinal:h2,dayOfMonthOrdinalParse:u2,relativeTime:p2,months:P2,monthsShort:Uy,week:$2,weekdays:G2,weekdaysMin:Y2,weekdaysShort:Yy,meridiemParse:dS},Ti={},oc={},ac;function mS(n,i){var o,c=Math.min(n.length,i.length);for(o=0;o<c;o+=1)if(n[o]!==i[o])return o;return c}function Qy(n){return n&&n.toLowerCase().replace("_","-")}function gS(n){for(var i=0,o,c,p,b;i<n.length;){for(b=Qy(n[i]).split("-"),o=b.length,c=Qy(n[i+1]),c=c?c.split("-"):null;o>0;){if(p=nu(b.slice(0,o).join("-")),p)return p;if(c&&c.length>=o&&mS(b,c)>=o-1)break;o--}i++}return ac}function yS(n){return!!(n&&n.match("^[^/\\\\]*$"))}function nu(n){var i=null,o;if(Ti[n]===void 0&&typeof module<"u"&&module&&module.exports&&yS(n))try{i=ac._abbr,o=require,o("./locale/"+n),Xs(i)}catch{Ti[n]=null}return Ti[n]}function Xs(n,i){var o;return n&&($n(i)?o=Ss(n):o=Ap(n,i),o?ac=o:typeof console<"u"&&console.warn&&console.warn("Locale "+n+" not found. Did you forget to load it?")),ac._abbr}function Ap(n,i){if(i!==null){var o,c=Jy;if(i.abbr=n,Ti[n]!=null)Ry("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),c=Ti[n]._config;else if(i.parentLocale!=null)if(Ti[i.parentLocale]!=null)c=Ti[i.parentLocale]._config;else if(o=nu(i.parentLocale),o!=null)c=o._config;else return oc[i.parentLocale]||(oc[i.parentLocale]=[]),oc[i.parentLocale].push({name:n,config:i}),null;return Ti[n]=new _p(yp(c,i)),oc[n]&&oc[n].forEach(function(p){Ap(p.name,p.config)}),Xs(n),Ti[n]}else return delete Ti[n],null}function _S(n,i){if(i!=null){var o,c,p=Jy;Ti[n]!=null&&Ti[n].parentLocale!=null?Ti[n].set(yp(Ti[n]._config,i)):(c=nu(n),c!=null&&(p=c._config),i=yp(p,i),c==null&&(i.abbr=n),o=new _p(i),o.parentLocale=Ti[n],Ti[n]=o),Xs(n)}else Ti[n]!=null&&(Ti[n].parentLocale!=null?(Ti[n]=Ti[n].parentLocale,n===Xs()&&Xs(n)):Ti[n]!=null&&delete Ti[n]);return Ti[n]}function Ss(n){var i;if(n&&n._locale&&n._locale._abbr&&(n=n._locale._abbr),!n)return ac;if(!Br(n)){if(i=nu(n),i)return i;n=[n]}return gS(n)}function xS(){return xp(Ti)}function Dp(n){var i,o=n._a;return o&&Dt(n).overflow===-2&&(i=o[bs]<0||o[bs]>11?bs:o[ts]<1||o[ts]>Cp(o[pn],o[bs])?ts:o[ji]<0||o[ji]>24||o[ji]===24&&(o[Nr]!==0||o[vs]!==0||o[qo]!==0)?ji:o[Nr]<0||o[Nr]>59?Nr:o[vs]<0||o[vs]>59?vs:o[qo]<0||o[qo]>999?qo:-1,Dt(n)._overflowDayOfYear&&(i<pn||i>ts)&&(i=ts),Dt(n)._overflowWeeks&&i===-1&&(i=S2),Dt(n)._overflowWeekday&&i===-1&&(i=k2),Dt(n).overflow=i),n}var bS=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vS=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wS=/Z|[+-]\d\d(?::?\d\d)?/,ru=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],zp=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],SS=/^\/?Date\((-?\d+)/i,kS=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,ES={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function e_(n){var i,o,c=n._i,p=bS.exec(c)||vS.exec(c),b,_,h,M,A=ru.length,D=zp.length;if(p){for(Dt(n).iso=!0,i=0,o=A;i<o;i++)if(ru[i][1].exec(p[1])){_=ru[i][0],b=ru[i][2]!==!1;break}if(_==null){n._isValid=!1;return}if(p[3]){for(i=0,o=D;i<o;i++)if(zp[i][1].exec(p[3])){h=(p[2]||" ")+zp[i][0];break}if(h==null){n._isValid=!1;return}}if(!b&&h!=null){n._isValid=!1;return}if(p[4])if(wS.exec(p[4]))M="Z";else{n._isValid=!1;return}n._f=_+(h||"")+(M||""),Lp(n)}else n._isValid=!1}function TS(n,i,o,c,p,b){var _=[CS(n),Uy.indexOf(i),parseInt(o,10),parseInt(c,10),parseInt(p,10)];return b&&_.push(parseInt(b,10)),_}function CS(n){var i=parseInt(n,10);return i<=49?2e3+i:i<=999?1900+i:i}function MS(n){return n.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function PS(n,i,o){if(n){var c=Yy.indexOf(n),p=new Date(i[0],i[1],i[2]).getDay();if(c!==p)return Dt(o).weekdayMismatch=!0,o._isValid=!1,!1}return!0}function IS(n,i,o){if(n)return ES[n];if(i)return 0;var c=parseInt(o,10),p=c%100,b=(c-p)/100;return b*60+p}function t_(n){var i=kS.exec(MS(n._i)),o;if(i){if(o=TS(i[4],i[3],i[2],i[5],i[6],i[7]),!PS(i[1],o,n))return;n._a=o,n._tzm=IS(i[8],i[9],i[10]),n._d=rc.apply(null,n._a),n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),Dt(n).rfc2822=!0}else n._isValid=!1}function AS(n){var i=SS.exec(n._i);if(i!==null){n._d=new Date(+i[1]);return}if(e_(n),n._isValid===!1)delete n._isValid;else return;if(t_(n),n._isValid===!1)delete n._isValid;else return;n._strict?n._isValid=!1:Je.createFromInputFallback(n)}Je.createFromInputFallback=xr("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(n){n._d=new Date(n._i+(n._useUTC?" UTC":""))});function Va(n,i,o){return n??i??o}function DS(n){var i=new Date(Je.now());return n._useUTC?[i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()]:[i.getFullYear(),i.getMonth(),i.getDate()]}function Rp(n){var i,o,c=[],p,b,_;if(!n._d){for(p=DS(n),n._w&&n._a[ts]==null&&n._a[bs]==null&&zS(n),n._dayOfYear!=null&&(_=Va(n._a[pn],p[pn]),(n._dayOfYear>ic(_)||n._dayOfYear===0)&&(Dt(n)._overflowDayOfYear=!0),o=rc(_,0,n._dayOfYear),n._a[bs]=o.getUTCMonth(),n._a[ts]=o.getUTCDate()),i=0;i<3&&n._a[i]==null;++i)n._a[i]=c[i]=p[i];for(;i<7;i++)n._a[i]=c[i]=n._a[i]==null?i===2?1:0:n._a[i];n._a[ji]===24&&n._a[Nr]===0&&n._a[vs]===0&&n._a[qo]===0&&(n._nextDay=!0,n._a[ji]=0),n._d=(n._useUTC?rc:N2).apply(null,c),b=n._useUTC?n._d.getUTCDay():n._d.getDay(),n._tzm!=null&&n._d.setUTCMinutes(n._d.getUTCMinutes()-n._tzm),n._nextDay&&(n._a[ji]=24),n._w&&typeof n._w.d<"u"&&n._w.d!==b&&(Dt(n).weekdayMismatch=!0)}}function zS(n){var i,o,c,p,b,_,h,M,A;i=n._w,i.GG!=null||i.W!=null||i.E!=null?(b=1,_=4,o=Va(i.GG,n._a[pn],sc(vi(),1,4).year),c=Va(i.W,1),p=Va(i.E,1),(p<1||p>7)&&(M=!0)):(b=n._locale._week.dow,_=n._locale._week.doy,A=sc(vi(),b,_),o=Va(i.gg,n._a[pn],A.year),c=Va(i.w,A.week),i.d!=null?(p=i.d,(p<0||p>6)&&(M=!0)):i.e!=null?(p=i.e+b,(i.e<0||i.e>6)&&(M=!0)):p=b),c<1||c>ws(o,b,_)?Dt(n)._overflowWeeks=!0:M!=null?Dt(n)._overflowWeekday=!0:(h=Gy(o,c,p,b,_),n._a[pn]=h.year,n._dayOfYear=h.dayOfYear)}Je.ISO_8601=function(){},Je.RFC_2822=function(){};function Lp(n){if(n._f===Je.ISO_8601){e_(n);return}if(n._f===Je.RFC_2822){t_(n);return}n._a=[],Dt(n).empty=!0;var i=""+n._i,o,c,p,b,_,h=i.length,M=0,A,D;for(p=Ly(n._f,n._locale).match(bp)||[],D=p.length,o=0;o<D;o++)b=p[o],c=(i.match(b2(b,n))||[])[0],c&&(_=i.substr(0,i.indexOf(c)),_.length>0&&Dt(n).unusedInput.push(_),i=i.slice(i.indexOf(c)+c.length),M+=c.length),Oa[b]?(c?Dt(n).empty=!1:Dt(n).unusedTokens.push(b),w2(b,c,n)):n._strict&&!c&&Dt(n).unusedTokens.push(b);Dt(n).charsLeftOver=h-M,i.length>0&&Dt(n).unusedInput.push(i),n._a[ji]<=12&&Dt(n).bigHour===!0&&n._a[ji]>0&&(Dt(n).bigHour=void 0),Dt(n).parsedDateParts=n._a.slice(0),Dt(n).meridiem=n._meridiem,n._a[ji]=RS(n._locale,n._a[ji],n._meridiem),A=Dt(n).era,A!==null&&(n._a[pn]=n._locale.erasConvertYear(A,n._a[pn])),Rp(n),Dp(n)}function RS(n,i,o){var c;return o==null?i:n.meridiemHour!=null?n.meridiemHour(i,o):(n.isPM!=null&&(c=n.isPM(o),c&&i<12&&(i+=12),!c&&i===12&&(i=0)),i)}function LS(n){var i,o,c,p,b,_,h=!1,M=n._f.length;if(M===0){Dt(n).invalidFormat=!0,n._d=new Date(NaN);return}for(p=0;p<M;p++)b=0,_=!1,i=gp({},n),n._useUTC!=null&&(i._useUTC=n._useUTC),i._f=n._f[p],Lp(i),fp(i)&&(_=!0),b+=Dt(i).charsLeftOver,b+=Dt(i).unusedTokens.length*10,Dt(i).score=b,h?b<c&&(c=b,o=i):(c==null||b<c||_)&&(c=b,o=i,_&&(h=!0));Ys(n,o||i)}function OS(n){if(!n._d){var i=wp(n._i),o=i.day===void 0?i.date:i.day;n._a=Iy([i.year,i.month,o,i.hour,i.minute,i.second,i.millisecond],function(c){return c&&parseInt(c,10)}),Rp(n)}}function BS(n){var i=new Ql(Dp(i_(n)));return i._nextDay&&(i.add(1,"d"),i._nextDay=void 0),i}function i_(n){var i=n._i,o=n._f;return n._locale=n._locale||Ss(n._l),i===null||o===void 0&&i===""?Zh({nullInput:!0}):(typeof i=="string"&&(n._i=i=n._locale.preparse(i)),Fr(i)?new Ql(Dp(i)):(Jl(i)?n._d=i:Br(o)?LS(n):o?Lp(n):FS(n),fp(n)||(n._d=null),n))}function FS(n){var i=n._i;$n(i)?n._d=new Date(Je.now()):Jl(i)?n._d=new Date(i.valueOf()):typeof i=="string"?AS(n):Br(i)?(n._a=Iy(i.slice(0),function(o){return parseInt(o,10)}),Rp(n)):Ho(i)?OS(n):_s(i)?n._d=new Date(i):Je.createFromInputFallback(n)}function n_(n,i,o,c,p){var b={};return(i===!0||i===!1)&&(c=i,i=void 0),(o===!0||o===!1)&&(c=o,o=void 0),(Ho(n)&&dp(n)||Br(n)&&n.length===0)&&(n=void 0),b._isAMomentObject=!0,b._useUTC=b._isUTC=p,b._l=o,b._i=n,b._f=i,b._strict=c,BS(b)}function vi(n,i,o,c){return n_(n,i,o,c,!1)}var NS=xr("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=vi.apply(null,arguments);return this.isValid()&&n.isValid()?n<this?this:n:Zh()}),VS=xr("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var n=vi.apply(null,arguments);return this.isValid()&&n.isValid()?n>this?this:n:Zh()});function r_(n,i){var o,c;if(i.length===1&&Br(i[0])&&(i=i[0]),!i.length)return vi();for(o=i[0],c=1;c<i.length;++c)(!i[c].isValid()||i[c][n](o))&&(o=i[c]);return o}function $S(){var n=[].slice.call(arguments,0);return r_("isBefore",n)}function jS(){var n=[].slice.call(arguments,0);return r_("isAfter",n)}var US=function(){return Date.now?Date.now():+new Date},lc=["year","quarter","month","week","day","hour","minute","second","millisecond"];function HS(n){var i,o=!1,c,p=lc.length;for(i in n)if(Kt(n,i)&&!(Li.call(lc,i)!==-1&&(n[i]==null||!isNaN(n[i]))))return!1;for(c=0;c<p;++c)if(n[lc[c]]){if(o)return!1;parseFloat(n[lc[c]])!==Ht(n[lc[c]])&&(o=!0)}return!0}function qS(){return this._isValid}function ZS(){return Vr(NaN)}function su(n){var i=wp(n),o=i.year||0,c=i.quarter||0,p=i.month||0,b=i.week||i.isoWeek||0,_=i.day||0,h=i.hour||0,M=i.minute||0,A=i.second||0,D=i.millisecond||0;this._isValid=HS(i),this._milliseconds=+D+A*1e3+M*6e4+h*1e3*60*60,this._days=+_+b*7,this._months=+p+c*3+o*12,this._data={},this._locale=Ss(),this._bubble()}function ou(n){return n instanceof su}function Op(n){return n<0?Math.round(-1*n)*-1:Math.round(n)}function WS(n,i,o){var c=Math.min(n.length,i.length),p=Math.abs(n.length-i.length),b=0,_;for(_=0;_<c;_++)Ht(n[_])!==Ht(i[_])&&b++;return b+p}function s_(n,i){dt(n,0,0,function(){var o=this.utcOffset(),c="+";return o<0&&(o=-o,c="-"),c+es(~~(o/60),2)+i+es(~~o%60,2)})}s_("Z",":"),s_("ZZ",""),rt("Z",Qh),rt("ZZ",Qh),di(["Z","ZZ"],function(n,i,o){o._useUTC=!0,o._tzm=Bp(Qh,n)});var GS=/([\+\-]|\d\d)/gi;function Bp(n,i){var o=(i||"").match(n),c,p,b;return o===null?null:(c=o[o.length-1]||[],p=(c+"").match(GS)||["-",0,0],b=+(p[1]*60)+Ht(p[2]),b===0?0:p[0]==="+"?b:-b)}function Fp(n,i){var o,c;return i._isUTC?(o=i.clone(),c=(Fr(n)||Jl(n)?n.valueOf():vi(n).valueOf())-o.valueOf(),o._d.setTime(o._d.valueOf()+c),Je.updateOffset(o,!1),o):vi(n).local()}function Np(n){return-Math.round(n._d.getTimezoneOffset())}Je.updateOffset=function(){};function YS(n,i,o){var c=this._offset||0,p;if(!this.isValid())return n!=null?this:NaN;if(n!=null){if(typeof n=="string"){if(n=Bp(Qh,n),n===null)return this}else Math.abs(n)<16&&!o&&(n=n*60);return!this._isUTC&&i&&(p=Np(this)),this._offset=n,this._isUTC=!0,p!=null&&this.add(p,"m"),c!==n&&(!i||this._changeInProgress?c_(this,Vr(n-c,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,Je.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?c:Np(this)}function XS(n,i){return n!=null?(typeof n!="string"&&(n=-n),this.utcOffset(n,i),this):-this.utcOffset()}function KS(n){return this.utcOffset(0,n)}function JS(n){return this._isUTC&&(this.utcOffset(0,n),this._isUTC=!1,n&&this.subtract(Np(this),"m")),this}function QS(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var n=Bp(_2,this._i);n!=null?this.utcOffset(n):this.utcOffset(0,!0)}return this}function ek(n){return this.isValid()?(n=n?vi(n).utcOffset():0,(this.utcOffset()-n)%60===0):!1}function tk(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function ik(){if(!$n(this._isDSTShifted))return this._isDSTShifted;var n={},i;return gp(n,this),n=i_(n),n._a?(i=n._isUTC?Jr(n._a):vi(n._a),this._isDSTShifted=this.isValid()&&WS(n._a,i.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function nk(){return this.isValid()?!this._isUTC:!1}function rk(){return this.isValid()?this._isUTC:!1}function o_(){return this.isValid()?this._isUTC&&this._offset===0:!1}var sk=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,ok=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Vr(n,i){var o=n,c=null,p,b,_;return ou(n)?o={ms:n._milliseconds,d:n._days,M:n._months}:_s(n)||!isNaN(+n)?(o={},i?o[i]=+n:o.milliseconds=+n):(c=sk.exec(n))?(p=c[1]==="-"?-1:1,o={y:0,d:Ht(c[ts])*p,h:Ht(c[ji])*p,m:Ht(c[Nr])*p,s:Ht(c[vs])*p,ms:Ht(Op(c[qo]*1e3))*p}):(c=ok.exec(n))?(p=c[1]==="-"?-1:1,o={y:Zo(c[2],p),M:Zo(c[3],p),w:Zo(c[4],p),d:Zo(c[5],p),h:Zo(c[6],p),m:Zo(c[7],p),s:Zo(c[8],p)}):o==null?o={}:typeof o=="object"&&("from"in o||"to"in o)&&(_=ak(vi(o.from),vi(o.to)),o={},o.ms=_.milliseconds,o.M=_.months),b=new su(o),ou(n)&&Kt(n,"_locale")&&(b._locale=n._locale),ou(n)&&Kt(n,"_isValid")&&(b._isValid=n._isValid),b}Vr.fn=su.prototype,Vr.invalid=ZS;function Zo(n,i){var o=n&&parseFloat(n.replace(",","."));return(isNaN(o)?0:o)*i}function a_(n,i){var o={};return o.months=i.month()-n.month()+(i.year()-n.year())*12,n.clone().add(o.months,"M").isAfter(i)&&--o.months,o.milliseconds=+i-+n.clone().add(o.months,"M"),o}function ak(n,i){var o;return n.isValid()&&i.isValid()?(i=Fp(i,n),n.isBefore(i)?o=a_(n,i):(o=a_(i,n),o.milliseconds=-o.milliseconds,o.months=-o.months),o):{milliseconds:0,months:0}}function l_(n,i){return function(o,c){var p,b;return c!==null&&!isNaN(+c)&&(Ry(i,"moment()."+i+"(period, number) is deprecated. Please use moment()."+i+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),b=o,o=c,c=b),p=Vr(o,c),c_(this,p,n),this}}function c_(n,i,o,c){var p=i._milliseconds,b=Op(i._days),_=Op(i._months);n.isValid()&&(c=c??!0,_&&qy(n,nc(n,"Month")+_*o),b&&jy(n,"Date",nc(n,"Date")+b*o),p&&n._d.setTime(n._d.valueOf()+p*o),c&&Je.updateOffset(n,b||_))}var lk=l_(1,"add"),ck=l_(-1,"subtract");function h_(n){return typeof n=="string"||n instanceof String}function hk(n){return Fr(n)||Jl(n)||h_(n)||_s(n)||dk(n)||uk(n)||n===null||n===void 0}function uk(n){var i=Ho(n)&&!dp(n),o=!1,c=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],p,b,_=c.length;for(p=0;p<_;p+=1)b=c[p],o=o||Kt(n,b);return i&&o}function dk(n){var i=Br(n),o=!1;return i&&(o=n.filter(function(c){return!_s(c)&&h_(n)}).length===0),i&&o}function pk(n){var i=Ho(n)&&!dp(n),o=!1,c=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],p,b;for(p=0;p<c.length;p+=1)b=c[p],o=o||Kt(n,b);return i&&o}function fk(n,i){var o=n.diff(i,"days",!0);return o<-6?"sameElse":o<-1?"lastWeek":o<0?"lastDay":o<1?"sameDay":o<2?"nextDay":o<7?"nextWeek":"sameElse"}function mk(n,i){arguments.length===1&&(arguments[0]?hk(arguments[0])?(n=arguments[0],i=void 0):pk(arguments[0])&&(i=arguments[0],n=void 0):(n=void 0,i=void 0));var o=n||vi(),c=Fp(o,this).startOf("day"),p=Je.calendarFormat(this,c)||"sameElse",b=i&&(Qr(i[p])?i[p].call(this,o):i[p]);return this.format(b||this.localeData().calendar(p,this,vi(o)))}function gk(){return new Ql(this)}function yk(n,i){var o=Fr(n)?n:vi(n);return this.isValid()&&o.isValid()?(i=br(i)||"millisecond",i==="millisecond"?this.valueOf()>o.valueOf():o.valueOf()<this.clone().startOf(i).valueOf()):!1}function _k(n,i){var o=Fr(n)?n:vi(n);return this.isValid()&&o.isValid()?(i=br(i)||"millisecond",i==="millisecond"?this.valueOf()<o.valueOf():this.clone().endOf(i).valueOf()<o.valueOf()):!1}function xk(n,i,o,c){var p=Fr(n)?n:vi(n),b=Fr(i)?i:vi(i);return this.isValid()&&p.isValid()&&b.isValid()?(c=c||"()",(c[0]==="("?this.isAfter(p,o):!this.isBefore(p,o))&&(c[1]===")"?this.isBefore(b,o):!this.isAfter(b,o))):!1}function bk(n,i){var o=Fr(n)?n:vi(n),c;return this.isValid()&&o.isValid()?(i=br(i)||"millisecond",i==="millisecond"?this.valueOf()===o.valueOf():(c=o.valueOf(),this.clone().startOf(i).valueOf()<=c&&c<=this.clone().endOf(i).valueOf())):!1}function vk(n,i){return this.isSame(n,i)||this.isAfter(n,i)}function wk(n,i){return this.isSame(n,i)||this.isBefore(n,i)}function Sk(n,i,o){var c,p,b;if(!this.isValid())return NaN;if(c=Fp(n,this),!c.isValid())return NaN;switch(p=(c.utcOffset()-this.utcOffset())*6e4,i=br(i),i){case"year":b=au(this,c)/12;break;case"month":b=au(this,c);break;case"quarter":b=au(this,c)/3;break;case"second":b=(this-c)/1e3;break;case"minute":b=(this-c)/6e4;break;case"hour":b=(this-c)/36e5;break;case"day":b=(this-c-p)/864e5;break;case"week":b=(this-c-p)/6048e5;break;default:b=this-c}return o?b:vr(b)}function au(n,i){if(n.date()<i.date())return-au(i,n);var o=(i.year()-n.year())*12+(i.month()-n.month()),c=n.clone().add(o,"months"),p,b;return i-c<0?(p=n.clone().add(o-1,"months"),b=(i-c)/(c-p)):(p=n.clone().add(o+1,"months"),b=(i-c)/(p-c)),-(o+b)||0}Je.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",Je.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function kk(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Ek(n){if(!this.isValid())return null;var i=n!==!0,o=i?this.clone().utc():this;return o.year()<0||o.year()>9999?Gh(o,i?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):Qr(Date.prototype.toISOString)?i?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Gh(o,"Z")):Gh(o,i?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Tk(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var n="moment",i="",o,c,p,b;return this.isLocal()||(n=this.utcOffset()===0?"moment.utc":"moment.parseZone",i="Z"),o="["+n+'("]',c=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",p="-MM-DD[T]HH:mm:ss.SSS",b=i+'[")]',this.format(o+c+p+b)}function Ck(n){n||(n=this.isUtc()?Je.defaultFormatUtc:Je.defaultFormat);var i=Gh(this,n);return this.localeData().postformat(i)}function Mk(n,i){return this.isValid()&&(Fr(n)&&n.isValid()||vi(n).isValid())?Vr({to:this,from:n}).locale(this.locale()).humanize(!i):this.localeData().invalidDate()}function Pk(n){return this.from(vi(),n)}function Ik(n,i){return this.isValid()&&(Fr(n)&&n.isValid()||vi(n).isValid())?Vr({from:this,to:n}).locale(this.locale()).humanize(!i):this.localeData().invalidDate()}function Ak(n){return this.to(vi(),n)}function u_(n){var i;return n===void 0?this._locale._abbr:(i=Ss(n),i!=null&&(this._locale=i),this)}var d_=xr("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(n){return n===void 0?this.localeData():this.locale(n)});function p_(){return this._locale}var lu=1e3,$a=60*lu,cu=60*$a,f_=(365*400+97)*24*cu;function ja(n,i){return(n%i+i)%i}function m_(n,i,o){return n<100&&n>=0?new Date(n+400,i,o)-f_:new Date(n,i,o).valueOf()}function g_(n,i,o){return n<100&&n>=0?Date.UTC(n+400,i,o)-f_:Date.UTC(n,i,o)}function Dk(n){var i,o;if(n=br(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(o=this._isUTC?g_:m_,n){case"year":i=o(this.year(),0,1);break;case"quarter":i=o(this.year(),this.month()-this.month()%3,1);break;case"month":i=o(this.year(),this.month(),1);break;case"week":i=o(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":i=o(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":i=o(this.year(),this.month(),this.date());break;case"hour":i=this._d.valueOf(),i-=ja(i+(this._isUTC?0:this.utcOffset()*$a),cu);break;case"minute":i=this._d.valueOf(),i-=ja(i,$a);break;case"second":i=this._d.valueOf(),i-=ja(i,lu);break}return this._d.setTime(i),Je.updateOffset(this,!0),this}function zk(n){var i,o;if(n=br(n),n===void 0||n==="millisecond"||!this.isValid())return this;switch(o=this._isUTC?g_:m_,n){case"year":i=o(this.year()+1,0,1)-1;break;case"quarter":i=o(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":i=o(this.year(),this.month()+1,1)-1;break;case"week":i=o(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":i=o(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":i=o(this.year(),this.month(),this.date()+1)-1;break;case"hour":i=this._d.valueOf(),i+=cu-ja(i+(this._isUTC?0:this.utcOffset()*$a),cu)-1;break;case"minute":i=this._d.valueOf(),i+=$a-ja(i,$a)-1;break;case"second":i=this._d.valueOf(),i+=lu-ja(i,lu)-1;break}return this._d.setTime(i),Je.updateOffset(this,!0),this}function Rk(){return this._d.valueOf()-(this._offset||0)*6e4}function Lk(){return Math.floor(this.valueOf()/1e3)}function Ok(){return new Date(this.valueOf())}function Bk(){var n=this;return[n.year(),n.month(),n.date(),n.hour(),n.minute(),n.second(),n.millisecond()]}function Fk(){var n=this;return{years:n.year(),months:n.month(),date:n.date(),hours:n.hours(),minutes:n.minutes(),seconds:n.seconds(),milliseconds:n.milliseconds()}}function Nk(){return this.isValid()?this.toISOString():null}function Vk(){return fp(this)}function $k(){return Ys({},Dt(this))}function jk(){return Dt(this).overflow}function Uk(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}dt("N",0,0,"eraAbbr"),dt("NN",0,0,"eraAbbr"),dt("NNN",0,0,"eraAbbr"),dt("NNNN",0,0,"eraName"),dt("NNNNN",0,0,"eraNarrow"),dt("y",["y",1],"yo","eraYear"),dt("y",["yy",2],0,"eraYear"),dt("y",["yyy",3],0,"eraYear"),dt("y",["yyyy",4],0,"eraYear"),rt("N",Vp),rt("NN",Vp),rt("NNN",Vp),rt("NNNN",eE),rt("NNNNN",tE),di(["N","NN","NNN","NNNN","NNNNN"],function(n,i,o,c){var p=o._locale.erasParse(n,c,o._strict);p?Dt(o).era=p:Dt(o).invalidEra=n}),rt("y",Ba),rt("yy",Ba),rt("yyy",Ba),rt("yyyy",Ba),rt("yo",iE),di(["y","yy","yyy","yyyy"],pn),di(["yo"],function(n,i,o,c){var p;o._locale._eraYearOrdinalRegex&&(p=n.match(o._locale._eraYearOrdinalRegex)),o._locale.eraYearOrdinalParse?i[pn]=o._locale.eraYearOrdinalParse(n,p):i[pn]=parseInt(n,10)});function Hk(n,i){var o,c,p,b=this._eras||Ss("en")._eras;for(o=0,c=b.length;o<c;++o){switch(typeof b[o].since){case"string":p=Je(b[o].since).startOf("day"),b[o].since=p.valueOf();break}switch(typeof b[o].until){case"undefined":b[o].until=1/0;break;case"string":p=Je(b[o].until).startOf("day").valueOf(),b[o].until=p.valueOf();break}}return b}function qk(n,i,o){var c,p,b=this.eras(),_,h,M;for(n=n.toUpperCase(),c=0,p=b.length;c<p;++c)if(_=b[c].name.toUpperCase(),h=b[c].abbr.toUpperCase(),M=b[c].narrow.toUpperCase(),o)switch(i){case"N":case"NN":case"NNN":if(h===n)return b[c];break;case"NNNN":if(_===n)return b[c];break;case"NNNNN":if(M===n)return b[c];break}else if([_,h,M].indexOf(n)>=0)return b[c]}function Zk(n,i){var o=n.since<=n.until?1:-1;return i===void 0?Je(n.since).year():Je(n.since).year()+(i-n.offset)*o}function Wk(){var n,i,o,c=this.localeData().eras();for(n=0,i=c.length;n<i;++n)if(o=this.clone().startOf("day").valueOf(),c[n].since<=o&&o<=c[n].until||c[n].until<=o&&o<=c[n].since)return c[n].name;return""}function Gk(){var n,i,o,c=this.localeData().eras();for(n=0,i=c.length;n<i;++n)if(o=this.clone().startOf("day").valueOf(),c[n].since<=o&&o<=c[n].until||c[n].until<=o&&o<=c[n].since)return c[n].narrow;return""}function Yk(){var n,i,o,c=this.localeData().eras();for(n=0,i=c.length;n<i;++n)if(o=this.clone().startOf("day").valueOf(),c[n].since<=o&&o<=c[n].until||c[n].until<=o&&o<=c[n].since)return c[n].abbr;return""}function Xk(){var n,i,o,c,p=this.localeData().eras();for(n=0,i=p.length;n<i;++n)if(o=p[n].since<=p[n].until?1:-1,c=this.clone().startOf("day").valueOf(),p[n].since<=c&&c<=p[n].until||p[n].until<=c&&c<=p[n].since)return(this.year()-Je(p[n].since).year())*o+p[n].offset;return this.year()}function Kk(n){return Kt(this,"_erasNameRegex")||$p.call(this),n?this._erasNameRegex:this._erasRegex}function Jk(n){return Kt(this,"_erasAbbrRegex")||$p.call(this),n?this._erasAbbrRegex:this._erasRegex}function Qk(n){return Kt(this,"_erasNarrowRegex")||$p.call(this),n?this._erasNarrowRegex:this._erasRegex}function Vp(n,i){return i.erasAbbrRegex(n)}function eE(n,i){return i.erasNameRegex(n)}function tE(n,i){return i.erasNarrowRegex(n)}function iE(n,i){return i._eraYearOrdinalRegex||Ba}function $p(){var n=[],i=[],o=[],c=[],p,b,_,h,M,A=this.eras();for(p=0,b=A.length;p<b;++p)_=xs(A[p].name),h=xs(A[p].abbr),M=xs(A[p].narrow),i.push(_),n.push(h),o.push(M),c.push(_),c.push(h),c.push(M);this._erasRegex=new RegExp("^("+c.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+i.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+n.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}dt(0,["gg",2],0,function(){return this.weekYear()%100}),dt(0,["GG",2],0,function(){return this.isoWeekYear()%100});function hu(n,i){dt(0,[n,n.length],0,i)}hu("gggg","weekYear"),hu("ggggg","weekYear"),hu("GGGG","isoWeekYear"),hu("GGGGG","isoWeekYear"),rt("G",Jh),rt("g",Jh),rt("GG",bi,er),rt("gg",bi,er),rt("GGGG",kp,Sp),rt("gggg",kp,Sp),rt("GGGGG",Kh,Yh),rt("ggggg",Kh,Yh),tc(["gggg","ggggg","GGGG","GGGGG"],function(n,i,o,c){i[c.substr(0,2)]=Ht(n)}),tc(["gg","GG"],function(n,i,o,c){i[c]=Je.parseTwoDigitYear(n)});function nE(n){return y_.call(this,n,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function rE(n){return y_.call(this,n,this.isoWeek(),this.isoWeekday(),1,4)}function sE(){return ws(this.year(),1,4)}function oE(){return ws(this.isoWeekYear(),1,4)}function aE(){var n=this.localeData()._week;return ws(this.year(),n.dow,n.doy)}function lE(){var n=this.localeData()._week;return ws(this.weekYear(),n.dow,n.doy)}function y_(n,i,o,c,p){var b;return n==null?sc(this,c,p).year:(b=ws(n,c,p),i>b&&(i=b),cE.call(this,n,i,o,c,p))}function cE(n,i,o,c,p){var b=Gy(n,i,o,c,p),_=rc(b.year,0,b.dayOfYear);return this.year(_.getUTCFullYear()),this.month(_.getUTCMonth()),this.date(_.getUTCDate()),this}dt("Q",0,"Qo","quarter"),rt("Q",By),di("Q",function(n,i){i[bs]=(Ht(n)-1)*3});function hE(n){return n==null?Math.ceil((this.month()+1)/3):this.month((n-1)*3+this.month()%3)}dt("D",["DD",2],"Do","date"),rt("D",bi,Fa),rt("DD",bi,er),rt("Do",function(n,i){return n?i._dayOfMonthOrdinalParse||i._ordinalParse:i._dayOfMonthOrdinalParseLenient}),di(["D","DD"],ts),di("Do",function(n,i){i[ts]=Ht(n.match(bi)[0])});var __=Na("Date",!0);dt("DDD",["DDDD",3],"DDDo","dayOfYear"),rt("DDD",Xh),rt("DDDD",Fy),di(["DDD","DDDD"],function(n,i,o){o._dayOfYear=Ht(n)});function uE(n){var i=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return n==null?i:this.add(n-i,"d")}dt("m",["mm",2],0,"minute"),rt("m",bi,Ep),rt("mm",bi,er),di(["m","mm"],Nr);var dE=Na("Minutes",!1);dt("s",["ss",2],0,"second"),rt("s",bi,Ep),rt("ss",bi,er),di(["s","ss"],vs);var pE=Na("Seconds",!1);dt("S",0,0,function(){return~~(this.millisecond()/100)}),dt(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),dt(0,["SSS",3],0,"millisecond"),dt(0,["SSSS",4],0,function(){return this.millisecond()*10}),dt(0,["SSSSS",5],0,function(){return this.millisecond()*100}),dt(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),dt(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),dt(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),dt(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),rt("S",Xh,By),rt("SS",Xh,er),rt("SSS",Xh,Fy);var Ks,x_;for(Ks="SSSS";Ks.length<=9;Ks+="S")rt(Ks,Ba);function fE(n,i){i[qo]=Ht(("0."+n)*1e3)}for(Ks="S";Ks.length<=9;Ks+="S")di(Ks,fE);x_=Na("Milliseconds",!1),dt("z",0,0,"zoneAbbr"),dt("zz",0,0,"zoneName");function mE(){return this._isUTC?"UTC":""}function gE(){return this._isUTC?"Coordinated Universal Time":""}var Re=Ql.prototype;Re.add=lk,Re.calendar=mk,Re.clone=gk,Re.diff=Sk,Re.endOf=zk,Re.format=Ck,Re.from=Mk,Re.fromNow=Pk,Re.to=Ik,Re.toNow=Ak,Re.get=T2,Re.invalidAt=jk,Re.isAfter=yk,Re.isBefore=_k,Re.isBetween=xk,Re.isSame=bk,Re.isSameOrAfter=vk,Re.isSameOrBefore=wk,Re.isValid=Vk,Re.lang=d_,Re.locale=u_,Re.localeData=p_,Re.max=VS,Re.min=NS,Re.parsingFlags=$k,Re.set=C2,Re.startOf=Dk,Re.subtract=ck,Re.toArray=Bk,Re.toObject=Fk,Re.toDate=Ok,Re.toISOString=Ek,Re.inspect=Tk,typeof Symbol<"u"&&Symbol.for!=null&&(Re[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Re.toJSON=Nk,Re.toString=kk,Re.unix=Lk,Re.valueOf=Rk,Re.creationData=Uk,Re.eraName=Wk,Re.eraNarrow=Gk,Re.eraAbbr=Yk,Re.eraYear=Xk,Re.year=$y,Re.isLeapYear=E2,Re.weekYear=nE,Re.isoWeekYear=rE,Re.quarter=Re.quarters=hE,Re.month=Zy,Re.daysInMonth=O2,Re.week=Re.weeks=H2,Re.isoWeek=Re.isoWeeks=q2,Re.weeksInYear=aE,Re.weeksInWeekYear=lE,Re.isoWeeksInYear=sE,Re.isoWeeksInISOWeekYear=oE,Re.date=__,Re.day=Re.days=rS,Re.weekday=sS,Re.isoWeekday=oS,Re.dayOfYear=uE,Re.hour=Re.hours=pS,Re.minute=Re.minutes=dE,Re.second=Re.seconds=pE,Re.millisecond=Re.milliseconds=x_,Re.utcOffset=YS,Re.utc=KS,Re.local=JS,Re.parseZone=QS,Re.hasAlignedHourOffset=ek,Re.isDST=tk,Re.isLocal=nk,Re.isUtcOffset=rk,Re.isUtc=o_,Re.isUTC=o_,Re.zoneAbbr=mE,Re.zoneName=gE,Re.dates=xr("dates accessor is deprecated. Use date instead.",__),Re.months=xr("months accessor is deprecated. Use month instead",Zy),Re.years=xr("years accessor is deprecated. Use year instead",$y),Re.zone=xr("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",XS),Re.isDSTShifted=xr("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",ik);function yE(n){return vi(n*1e3)}function _E(){return vi.apply(null,arguments).parseZone()}function b_(n){return n}var Jt=_p.prototype;Jt.calendar=n2,Jt.longDateFormat=a2,Jt.invalidDate=c2,Jt.ordinal=d2,Jt.preparse=b_,Jt.postformat=b_,Jt.relativeTime=f2,Jt.pastFuture=m2,Jt.set=t2,Jt.eras=Hk,Jt.erasParse=qk,Jt.erasConvertYear=Zk,Jt.erasAbbrRegex=Jk,Jt.erasNameRegex=Kk,Jt.erasNarrowRegex=Qk,Jt.months=D2,Jt.monthsShort=z2,Jt.monthsParse=L2,Jt.monthsRegex=F2,Jt.monthsShortRegex=B2,Jt.week=V2,Jt.firstDayOfYear=U2,Jt.firstDayOfWeek=j2,Jt.weekdays=Q2,Jt.weekdaysMin=tS,Jt.weekdaysShort=eS,Jt.weekdaysParse=nS,Jt.weekdaysRegex=aS,Jt.weekdaysShortRegex=lS,Jt.weekdaysMinRegex=cS,Jt.isPM=uS,Jt.meridiem=fS;function uu(n,i,o,c){var p=Ss(),b=Jr().set(c,i);return p[o](b,n)}function v_(n,i,o){if(_s(n)&&(i=n,n=void 0),n=n||"",i!=null)return uu(n,i,o,"month");var c,p=[];for(c=0;c<12;c++)p[c]=uu(n,c,o,"month");return p}function jp(n,i,o,c){typeof n=="boolean"?(_s(i)&&(o=i,i=void 0),i=i||""):(i=n,o=i,n=!1,_s(i)&&(o=i,i=void 0),i=i||"");var p=Ss(),b=n?p._week.dow:0,_,h=[];if(o!=null)return uu(i,(o+b)%7,c,"day");for(_=0;_<7;_++)h[_]=uu(i,(_+b)%7,c,"day");return h}function xE(n,i){return v_(n,i,"months")}function bE(n,i){return v_(n,i,"monthsShort")}function vE(n,i,o){return jp(n,i,o,"weekdays")}function wE(n,i,o){return jp(n,i,o,"weekdaysShort")}function SE(n,i,o){return jp(n,i,o,"weekdaysMin")}Xs("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(n){var i=n%10,o=Ht(n%100/10)===1?"th":i===1?"st":i===2?"nd":i===3?"rd":"th";return n+o}}),Je.lang=xr("moment.lang is deprecated. Use moment.locale instead.",Xs),Je.langData=xr("moment.langData is deprecated. Use moment.localeData instead.",Ss);var ks=Math.abs;function kE(){var n=this._data;return this._milliseconds=ks(this._milliseconds),this._days=ks(this._days),this._months=ks(this._months),n.milliseconds=ks(n.milliseconds),n.seconds=ks(n.seconds),n.minutes=ks(n.minutes),n.hours=ks(n.hours),n.months=ks(n.months),n.years=ks(n.years),this}function w_(n,i,o,c){var p=Vr(i,o);return n._milliseconds+=c*p._milliseconds,n._days+=c*p._days,n._months+=c*p._months,n._bubble()}function EE(n,i){return w_(this,n,i,1)}function TE(n,i){return w_(this,n,i,-1)}function S_(n){return n<0?Math.floor(n):Math.ceil(n)}function CE(){var n=this._milliseconds,i=this._days,o=this._months,c=this._data,p,b,_,h,M;return n>=0&&i>=0&&o>=0||n<=0&&i<=0&&o<=0||(n+=S_(Up(o)+i)*864e5,i=0,o=0),c.milliseconds=n%1e3,p=vr(n/1e3),c.seconds=p%60,b=vr(p/60),c.minutes=b%60,_=vr(b/60),c.hours=_%24,i+=vr(_/24),M=vr(k_(i)),o+=M,i-=S_(Up(M)),h=vr(o/12),o%=12,c.days=i,c.months=o,c.years=h,this}function k_(n){return n*4800/146097}function Up(n){return n*146097/4800}function ME(n){if(!this.isValid())return NaN;var i,o,c=this._milliseconds;if(n=br(n),n==="month"||n==="quarter"||n==="year")switch(i=this._days+c/864e5,o=this._months+k_(i),n){case"month":return o;case"quarter":return o/3;case"year":return o/12}else switch(i=this._days+Math.round(Up(this._months)),n){case"week":return i/7+c/6048e5;case"day":return i+c/864e5;case"hour":return i*24+c/36e5;case"minute":return i*1440+c/6e4;case"second":return i*86400+c/1e3;case"millisecond":return Math.floor(i*864e5)+c;default:throw new Error("Unknown unit "+n)}}function Es(n){return function(){return this.as(n)}}var E_=Es("ms"),PE=Es("s"),IE=Es("m"),AE=Es("h"),DE=Es("d"),zE=Es("w"),RE=Es("M"),LE=Es("Q"),OE=Es("y"),BE=E_;function FE(){return Vr(this)}function NE(n){return n=br(n),this.isValid()?this[n+"s"]():NaN}function Wo(n){return function(){return this.isValid()?this._data[n]:NaN}}var VE=Wo("milliseconds"),$E=Wo("seconds"),jE=Wo("minutes"),UE=Wo("hours"),HE=Wo("days"),qE=Wo("months"),ZE=Wo("years");function WE(){return vr(this.days()/7)}var Ts=Math.round,Ua={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function GE(n,i,o,c,p){return p.relativeTime(i||1,!!o,n,c)}function YE(n,i,o,c){var p=Vr(n).abs(),b=Ts(p.as("s")),_=Ts(p.as("m")),h=Ts(p.as("h")),M=Ts(p.as("d")),A=Ts(p.as("M")),D=Ts(p.as("w")),R=Ts(p.as("y")),z=b<=o.ss&&["s",b]||b<o.s&&["ss",b]||_<=1&&["m"]||_<o.m&&["mm",_]||h<=1&&["h"]||h<o.h&&["hh",h]||M<=1&&["d"]||M<o.d&&["dd",M];return o.w!=null&&(z=z||D<=1&&["w"]||D<o.w&&["ww",D]),z=z||A<=1&&["M"]||A<o.M&&["MM",A]||R<=1&&["y"]||["yy",R],z[2]=i,z[3]=+n>0,z[4]=c,GE.apply(null,z)}function XE(n){return n===void 0?Ts:typeof n=="function"?(Ts=n,!0):!1}function KE(n,i){return Ua[n]===void 0?!1:i===void 0?Ua[n]:(Ua[n]=i,n==="s"&&(Ua.ss=i-1),!0)}function JE(n,i){if(!this.isValid())return this.localeData().invalidDate();var o=!1,c=Ua,p,b;return typeof n=="object"&&(i=n,n=!1),typeof n=="boolean"&&(o=n),typeof i=="object"&&(c=Object.assign({},Ua,i),i.s!=null&&i.ss==null&&(c.ss=i.s-1)),p=this.localeData(),b=YE(this,!o,c,p),o&&(b=p.pastFuture(+this,b)),p.postformat(b)}var Hp=Math.abs;function Ha(n){return(n>0)-(n<0)||+n}function du(){if(!this.isValid())return this.localeData().invalidDate();var n=Hp(this._milliseconds)/1e3,i=Hp(this._days),o=Hp(this._months),c,p,b,_,h=this.asSeconds(),M,A,D,R;return h?(c=vr(n/60),p=vr(c/60),n%=60,c%=60,b=vr(o/12),o%=12,_=n?n.toFixed(3).replace(/\.?0+$/,""):"",M=h<0?"-":"",A=Ha(this._months)!==Ha(h)?"-":"",D=Ha(this._days)!==Ha(h)?"-":"",R=Ha(this._milliseconds)!==Ha(h)?"-":"",M+"P"+(b?A+b+"Y":"")+(o?A+o+"M":"")+(i?D+i+"D":"")+(p||c||n?"T":"")+(p?R+p+"H":"")+(c?R+c+"M":"")+(n?R+_+"S":"")):"P0D"}var Yt=su.prototype;Yt.isValid=qS,Yt.abs=kE,Yt.add=EE,Yt.subtract=TE,Yt.as=ME,Yt.asMilliseconds=E_,Yt.asSeconds=PE,Yt.asMinutes=IE,Yt.asHours=AE,Yt.asDays=DE,Yt.asWeeks=zE,Yt.asMonths=RE,Yt.asQuarters=LE,Yt.asYears=OE,Yt.valueOf=BE,Yt._bubble=CE,Yt.clone=FE,Yt.get=NE,Yt.milliseconds=VE,Yt.seconds=$E,Yt.minutes=jE,Yt.hours=UE,Yt.days=HE,Yt.weeks=WE,Yt.months=qE,Yt.years=ZE,Yt.humanize=JE,Yt.toISOString=du,Yt.toString=du,Yt.toJSON=du,Yt.locale=u_,Yt.localeData=p_,Yt.toIsoString=xr("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",du),Yt.lang=d_,dt("X",0,0,"unix"),dt("x",0,0,"valueOf"),rt("x",Jh),rt("X",x2),di("X",function(n,i,o){o._d=new Date(parseFloat(n)*1e3)}),di("x",function(n,i,o){o._d=new Date(Ht(n))});//! moment.js
629
+ Je.version="2.30.1",Qw(vi),Je.fn=Re,Je.min=$S,Je.max=jS,Je.now=US,Je.utc=Jr,Je.unix=yE,Je.months=xE,Je.isDate=Jl,Je.locale=Xs,Je.invalid=Zh,Je.duration=Vr,Je.isMoment=Fr,Je.weekdays=vE,Je.parseZone=_E,Je.localeData=Ss,Je.isDuration=ou,Je.monthsShort=bE,Je.weekdaysMin=SE,Je.defineLocale=Ap,Je.updateLocale=_S,Je.locales=xS,Je.weekdaysShort=wE,Je.normalizeUnits=br,Je.relativeTimeRounding=XE,Je.relativeTimeThreshold=KE,Je.calendarFormat=fk,Je.prototype=Re,Je.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"};const QE=n=>{const i=/(\b\S)?/g,o=n.match(i);return o?o.join("").toUpperCase():""},eT={props:{name:{type:String,default(){return""}},avatar:{type:String,default(){return""}}},computed:{inItials(){return QE(this.name)}}},tT={class:"mr-2"},iT=["src"],nT={key:1,class:"flex flex-shrink-0 items-center justify-center w-6 h-6 bg-gray-500 text-xs text-white rounded-full"},rT={key:0},sT={key:1,class:"text-sm"};function oT(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",tT,[o.avatar?(k.openBlock(),k.createElementBlock("img",{key:0,src:o.avatar,alt:"avatar",class:"flex flex-shrink-0 items-center justify-center w-6 h-6 rounded-full"},null,8,iT)):o.name?(k.openBlock(),k.createElementBlock("div",nT,[b.inItials.length?(k.openBlock(),k.createElementBlock("span",rT,k.toDisplayString(b.inItials),1)):(k.openBlock(),k.createElementBlock("span",sT,i[0]||(i[0]=[k.createElementVNode("i",{class:"ti ti-user"},null,-1)])))])):k.createCommentVNode("",!0)])}const aT={components:{VsWidgetCommentsAvatar:Pt(eT,[["render",oT]])},props:{comment:{type:Object,default:()=>({})},user:{type:Object,default:()=>({})},id:{type:String,default:""}},data(){return{commentContent:this.comment.body,isCommentActionVisible:!1,isOpen:!1,textareaValue:""}},computed:{isUserAutor(){return this.user.uid===this.comment.uid},createDate(){try{const n=Je(this.comment.cdate,"YYYY-MM-DD");return new Date(n).toLocaleDateString("uk-UA",{day:"2-digit",month:"long",year:"numeric"})}catch{return""}}},watch:{isOpen(n){n&&(this.textareaValue=this.comment.body)}},methods:{confirnDeleteComment(){document.body.click(),this.$emit("openModal",{title:"Ви впевнені?",message:"Ви впевнені, що хочете видалити цей коментар?",confirmButtonText:"Так, я впевнена/ий",cancelButtonText:"Скасувати",confirm:this.deleteComment,updateListOnConfirm:!0})},async updateComment(){try{await ft.put(`/api/widget/comment/${this.id}/${this.comment.communication_id}`,{body:this.textareaValue}),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},async deleteComment(){try{await ft.delete(`/api/widget/comment/${this.id}/${this.comment.communication_id}`),this.$emit("list-update"),this.isCommentActionVisible=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}},toggleCommentAction(){this.isCommentActionVisible=!this.isCommentActionVisible}}},lT={class:"p-6 text-base bg-white dark:bg-gray-900"},cT={class:"flex justify-between items-center mb-2"},hT={class:"flex items-center"},uT={class:"inline-flex items-center mr-3 text-sm text-gray-900 dark:text-white font-semibold capitalize"},dT={class:"text-sm text-gray-600 dark:text-gray-400"},pT={class:"text-gray-500 dark:text-gray-400"},fT={class:"flex items-center gap-[4px]"},mT={class:"flex flex-col gap-[8px] text-sm font-medium text-gray-500"},gT={class:"flex justify-end p-[20px] gap-[10px] border-t w-full"};function yT(n,i,o,c,p,b){const _=k.resolveComponent("VsWidgetCommentsAvatar"),h=k.resolveComponent("VsDialog");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createElementVNode("div",lT,[k.createElementVNode("div",cT,[k.createElementVNode("div",hT,[k.createElementVNode("p",uT,[k.createVNode(_,{name:o.comment.username,avatar:o.comment.avatar},null,8,["name","avatar"]),k.createTextVNode(k.toDisplayString(o.comment.username),1)]),k.createElementVNode("div",dT,k.toDisplayString(b.createDate),1)])]),k.createElementVNode("p",pT,k.toDisplayString(o.comment.body),1),k.createElementVNode("div",fT,[k.createElementVNode("button",{type:"button",class:"block py-2 dark:hover:bg-gray-600 hover:underline dark:hover:text-white text-start duration-300",onClick:i[0]||(i[0]=M=>p.isOpen=!0)}," Редагувати "),k.createElementVNode("button",{type:"button",class:"block py-2 dark:hover:bg-gray-600 hover:underline dark:hover:text-white text-start duration-300",onClick:i[1]||(i[1]=M=>b.confirnDeleteComment())}," Видалити ")])]),k.createVNode(h,{visible:p.isOpen,"onUpdate:visible":i[5]||(i[5]=M=>p.isOpen=M),title:"Редагувати"},{footer:k.withCtx(()=>[k.createElementVNode("div",gT,[k.createElementVNode("button",{onClick:i[3]||(i[3]=M=>p.isOpen=!1),class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm whitespace-nowrap text-black border rounded-lg !border-gray-200 hover:bg-gray-100 duration-300"}," Відмінити "),k.createElementVNode("button",{onClick:i[4]||(i[4]=(...M)=>b.updateComment&&b.updateComment(...M)),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:k.withCtx(()=>[k.createElementVNode("label",mT,[i[6]||(i[6]=k.createTextVNode(" Коментар ")),k.withDirectives(k.createElementVNode("textarea",{"onUpdate:modelValue":i[2]||(i[2]=M=>p.textareaValue=M),placeholder:"Напишіть коментар...",class:"w-full h-[200px] border rounded-lg outline-none resize-none p-[20px] focus:border-[2px] focus:border-blue-600 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},null,512),[[k.vModelText,p.textareaValue]])])]),_:1},8,["visible"])],64)}const _T={components:{VsWidgetCommentsItem:Pt(aT,[["render",yT]])},inject:["activeAddFormEditor"],props:{id:{type:String,default:()=>""},prefilledData:{type:Object,default:null}},data(){return{isLoaded:!1,isLoadFailed:!1,comments:[],user:{},modal:{title:"",message:"",cancel:"",confirm:"",cancelButtonText:"",confirmButtonText:""},isModalVisible:!1}},async created(){await this.getComments()},methods:{async getComments(){if(this.prefilledData){this.comments=this.prefilledData.rows,this.isLoaded=!0;return}try{const{data:n}=await ft.get(`/api/widget/comment/${this.id}`);this.comments=n.rows,this.user=n.user}catch(n){this.isLoadFailed=!0,console.error(n)}this.isLoaded=!0,this.$emit("update-comment-count")},prepareModal(n){const i={...n};return n.cancel||(i.cancel=()=>{this.isModalVisible=!1}),n.updateListOnConfirm&&(i.confirm=async()=>{await n.confirm(),this.isModalVisible=!1}),i},handleOpenModal(n){this.modal=this.prepareModal(n),this.isModalVisible=!0}}},xT={class:"flex flex-col divide-y"},bT={key:0,class:"max-h-[300px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},vT={key:1},wT={class:"p-4"},ST={class:"mt-1 text-gray-500 dark:text-neutral-500"},kT={class:"mt-4 flex justify-end gap-x-3"};function ET(n,i,o,c,p,b){const _=k.resolveComponent("VsErrorOnLoading"),h=k.resolveComponent("VsWidgetCommentsItem"),M=k.resolveComponent("VsLoader"),A=k.resolveComponent("VsDialog");return k.openBlock(),k.createElementBlock("div",xT,[p.isLoaded?(k.openBlock(),k.createElementBlock(k.Fragment,{key:0},[p.isLoadFailed?(k.openBlock(),k.createBlock(_,{key:0})):(k.openBlock(),k.createElementBlock(k.Fragment,{key:1},[p.comments.length?(k.openBlock(),k.createElementBlock("div",bT,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(p.comments,(D,R)=>(k.openBlock(),k.createBlock(h,{key:R,comment:D,user:p.user,index:R,id:o.id,onListUpdate:b.getComments,class:"border-top",onOpenModal:i[0]||(i[0]=z=>b.handleOpenModal(z))},null,8,["comment","user","index","id","onListUpdate"]))),128))])):(k.openBlock(),k.createElementBlock("div",vT,i[4]||(i[4]=[k.createElementVNode("p",{class:"pl-3 text-sm font-medium text-gray-600"},"Коментарі відсутні",-1)])))],64))],64)):(k.openBlock(),k.createBlock(M,{key:1,class:"justify-center",text:"Please wait..."})),k.createVNode(A,{title:p.modal.title,size:"small",visible:p.isModalVisible,"onUpdate:visible":i[3]||(i[3]=D=>p.isModalVisible=D)},{default:k.withCtx(()=>[k.createElementVNode("div",wT,[k.createElementVNode("p",ST,k.toDisplayString(p.modal.message),1),k.createElementVNode("div",kT,[k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm 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:i[1]||(i[1]=(...D)=>p.modal.cancel&&p.modal.cancel(...D))},k.toDisplayString(p.modal.cancelButtonText),1),k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:i[2]||(i[2]=(...D)=>p.modal.confirm&&p.modal.confirm(...D))},k.toDisplayString(p.modal.confirmButtonText),1)])])]),_:1},8,["title","visible"])])}const TT=Pt(_T,[["render",ET]]),CT={props:{id:{type:String,default:()=>""},autofocus:{type:Boolean,default:()=>!0}},data(){return{isEditorOpen:!1,commentContent:""}},methods:{async addNewComment(){if(this.commentContent)try{await ft.post(`/api/widget/comment/${this.id}`,{body:this.commentContent}),this.commentContent="",this.$emit("list-update")}catch(n){console.error(n)}},setNewContent(n){this.commentContent=n}}},MT={class:"w-full widget-comment-form"},PT={class:"mb-4 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700"};function IT(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",MT,[k.createElementVNode("div",PT,[k.withDirectives(k.createElementVNode("textarea",{"onUpdate:modelValue":i[0]||(i[0]=_=>p.commentContent=_),rows:"6",class:"w-full h-[200px] border rounded-lg outline-none resize-none p-[20px] focus:border-[2px] focus:border-blue-600 [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500",placeholder:"Напишіть коментар..."},null,512),[[k.vModelText,p.commentContent]])]),k.createElementVNode("button",{ref:"buttonAdd",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",onClick:i[1]||(i[1]=(..._)=>b.addNewComment&&b.addNewComment(..._))}," Відправити коментар ",512)])}const AT={components:{VsWidgetCommentsList:TT,VsWidgetCommentsAddForm:Pt(CT,[["render",IT]])},props:{id:{type:String,default(){return""}},prefilledData:{type:Object,default:null}},data(){return{activeAddFormEditor:"",comments:[],totalComment:"0"}},mounted(){this.comments=this.$refs.commentListRef.comments},watch:{comments(n){this.$emit("count-change",n.length)}},methods:{listUpdate(){this.$refs.commentListRef.getComments()},updateCommentCount(){this.totalComment=this.$refs.commentListRef.comments.length||"0"}}},DT={class:"bg-white-200"},zT={class:"flex justify-between items-center gap-x-2 mb-4"},RT={class:"inline-block font-semibold text-gray-800 dark:text-neutral-200"},LT={key:0,class:"inline-block font-semibold text-gray-800 dark:text-neutral-200"};function OT(n,i,o,c,p,b){const _=k.resolveComponent("VsWidgetCommentsAddForm"),h=k.resolveComponent("VsWidgetCommentsList");return k.openBlock(),k.createElementBlock("div",DT,[k.createElementVNode("div",zT,[k.createElementVNode("h2",RT,[i[2]||(i[2]=k.createTextVNode("Коментарі ")),p.comments?(k.openBlock(),k.createElementBlock("span",LT,"("+k.toDisplayString(p.totalComment)+")",1)):k.createCommentVNode("",!0)])]),k.createVNode(_,{class:"mb-6",id:o.id,onListUpdate:i[0]||(i[0]=M=>b.listUpdate())},null,8,["id"]),k.createVNode(h,{id:o.id,onUpdateCommentCount:i[1]||(i[1]=M=>b.updateCommentCount()),"prefilled-data":o.prefilledData,ref:"commentListRef"},null,8,["id","prefilled-data"])])}const BT={"vs-widget-map":pw,"vs-widget-gallery":Jw,"vs-widget-comments":Pt(AT,[["render",OT]])},FT={},NT={style:{width:"calc(100vw - 300px)",height:"100vh"},class:"bg-gray-50 flex items-center justify-center"};function VT(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("div",NT,i[0]||(i[0]=[k.createElementVNode("div",{class:"p-5 md:p-8 bg-white border border-gray-200 shadow-sm rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[k.createElementVNode("div",{class:"mb-4 xl:mb-8"},[k.createElementVNode("h1",{class:"text-lg font-semibold text-gray-800 dark:text-neutral-200"}," Members "),k.createElementVNode("p",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Manage members and users of your workspace and set their access level. ")]),k.createElementVNode("div",{class:"space-y-5"},[k.createElementVNode("div",{class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5"},[k.createElementVNode("div",{class:"relative w-full"},[k.createElementVNode("div",{class:"absolute inset-y-0 start-0 flex items-center pointer-events-none z-20 ps-3.5"},[k.createElementVNode("svg",{class:"shrink-0 size-4 text-gray-500 dark:text-neutral-400",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"},[k.createElementVNode("circle",{cx:"11",cy:"11",r:"8"}),k.createElementVNode("path",{d:"m21 21-4.3-4.3"})])]),k.createElementVNode("input",{type:"text",class:"py-2 ps-10 pe-8 block w-full bg-gray-100 border-transparent rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",placeholder:"Search by name or email"}),k.createElementVNode("div",{class:"hidden absolute inset-y-0 end-0 flex items-center pointer-events-none z-20 pe-1"},[k.createElementVNode("button",{type:"button",class:"inline-flex shrink-0 justify-center items-center size-6 rounded-full text-gray-500 hover:text-blue-600 focus:outline-none focus:text-blue-600 dark:text-neutral-500 dark:hover:text-blue-500 dark:focus:text-blue-500","aria-label":"Close"},[k.createElementVNode("span",{class:"sr-only"},"Close"),k.createElementVNode("svg",{class:"shrink-0 size-4",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"},[k.createElementVNode("circle",{cx:"12",cy:"12",r:"10"}),k.createElementVNode("path",{d:"m15 9-6 6"}),k.createElementVNode("path",{d:"m9 9 6 6"})])])])]),k.createElementVNode("div",{class:"flex justify-end items-center gap-x-2"},[k.createElementVNode("button",{type:"button",class:"p-2.5 sm:py-2 sm:px-3 inline-flex items-center text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm 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"},[k.createElementVNode("svg",{class:"shrink-0 sm:me-2 size-4",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"},[k.createElementVNode("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),k.createElementVNode("polyline",{points:"7 10 12 15 17 10"}),k.createElementVNode("line",{x1:"12",x2:"12",y1:"15",y2:"3"})]),k.createElementVNode("span",{class:"hidden sm:block"}," Download CSV ")]),k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-1 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500","data-hs-overlay":"#hs-pro-dshm"},[k.createElementVNode("span",{class:"hidden sm:block"},"Send"),k.createTextVNode("Invite ")])])]),k.createElementVNode("div",{class:"grid sm:grid-cols-2 lg:grid-cols-4 gap-2 xl:gap-4"},[k.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[k.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[k.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 1 "),k.createElementVNode("div",{class:"flex items-center -space-x-2"},[k.createElementVNode("img",{class:"shrink-0 size-7 rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"})])]),k.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Admin")]),k.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[k.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[k.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 5 "),k.createElementVNode("div",{class:"flex items-center -space-x-2"},[k.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),k.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("img",{class:"shrink-0 size-7 shadow-md rounded-full",src:"https://images.unsplash.com/photo-1659482634023-2c4fda99ac0c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O ")])]),k.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[k.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Members"),k.createElementVNode("div",{class:"hs-tooltip inline-block"},[k.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[k.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),k.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),k.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(689px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),k.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[k.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[k.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 2 "),k.createElementVNode("div",{class:"flex items-center -space-x-2"},[k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-7 bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," 0 ")])]),k.createElementVNode("div",{class:"inline-flex items-center gap-x-2"},[k.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"}," Limited access members "),k.createElementVNode("div",{class:"hs-tooltip inline-block"},[k.createElementVNode("svg",{class:"hs-tooltip-toggle shrink-0 size-3.5 text-gray-500 dark:text-neutral-500",xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",viewBox:"0 0 16 16"},[k.createElementVNode("path",{d:"M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z"}),k.createElementVNode("path",{d:"m8.93 6.588-2.29.287-.082.38.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246-.275 0-.375-.193-.304-.533L8.93 6.588zM9 4.5a1 1 0 1 1-2 0 1 1 0 0 1 2 0z"})]),k.createElementVNode("div",{class:"hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 inline-block absolute invisible z-20 w-60 py-1.5 px-2.5 bg-gray-900 text-xs text-white rounded dark:bg-neutral-700",role:"tooltip","data-popper-placement":"top",style:{position:"fixed",inset:"auto auto 0px 0px",margin:"0px",transform:"translate(1198px, -708px)"}}," Limited Access Members can only access the projects, tasks, and messages explicitly shared with them. ")])])]),k.createElementVNode("div",{class:"p-4 flex flex-col bg-white border border-gray-200 rounded-xl dark:bg-neutral-800 dark:border-neutral-700"},[k.createElementVNode("div",{class:"flex justify-between items-center mb-1"},[k.createElementVNode("h2",{class:"text-4xl font-semibold text-gray-800 dark:text-neutral-200"}," 0 "),k.createElementVNode("div",{class:"flex items-center -space-x-2"})]),k.createElementVNode("h3",{class:"text-gray-500 dark:text-neutral-500"},"Pending invites")])]),k.createElementVNode("div",{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 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},[k.createElementVNode("div",{class:"min-w-full inline-block align-middle"},[k.createElementVNode("table",{class:"min-w-full divide-y divide-gray-200 dark:divide-neutral-700"},[k.createElementVNode("thead",null,[k.createElementVNode("tr",null,[k.createElementVNode("th",{scope:"col",class:"min-w-[250px]"},[k.createElementVNode("div",{class:"pe-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Member ")]),k.createElementVNode("th",{scope:"col",class:"min-w-48"},[k.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Role ")]),k.createElementVNode("th",{scope:"col"},[k.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Email ")]),k.createElementVNode("th",{scope:"col",class:"min-w-36"},[k.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Last activity ")]),k.createElementVNode("th",{scope:"col"},[k.createElementVNode("div",{class:"px-4 py-3 text-start flex items-center gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"}," Status ")])])]),k.createElementVNode("tbody",{class:"divide-y divide-gray-200 dark:divide-neutral-700"},[k.createElementVNode("tr",null,[k.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[k.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[k.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1659482633369-9fe69af50bfb?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=3&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("div",{class:"grow"},[k.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Admin ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," james@site.com ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[k.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),k.createTextVNode(" Active ")])])]),k.createElementVNode("tr",null,[k.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[k.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," L "),k.createElementVNode("div",{class:"grow"},[k.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," James Collins ")])])]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," liza@site.com ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 2 days ago ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[k.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),k.createTextVNode(" Inactive ")])])]),k.createElementVNode("tr",null,[k.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[k.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[k.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1601935111741-ae98b2b230b0?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("div",{class:"grow"},[k.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Daniel Hobbs ")])])]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," dhobbs@site.com ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Today ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[k.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),k.createTextVNode(" Inactive ")])])]),k.createElementVNode("tr",null,[k.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[k.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[k.createElementVNode("img",{class:"shrink-0 size-[38px] rounded-full",src:"https://images.unsplash.com/photo-1679412330254-90cb240038c5?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=facearea&facepad=2.5&w=320&h=320&q=80",alt:"Avatar"}),k.createElementVNode("div",{class:"grow"},[k.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Brian Warner ")])])]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can edit ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," brian@site.com ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 1 months ago ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"inline-flex items-center gap-x-1.5 py-1.5 px-2.5 text-xs font-medium bg-teal-100 text-teal-800 rounded-full dark:bg-teal-500/10 dark:text-teal-500"},[k.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-200"}),k.createTextVNode(" Active ")])])]),k.createElementVNode("tr",null,[k.createElementVNode("td",{class:"size-px whitespace-nowrap pe-4 py-3"},[k.createElementVNode("div",{class:"w-full flex items-center gap-x-3"},[k.createElementVNode("span",{class:"flex shrink-0 justify-center items-center size-[38px] bg-white border border-gray-200 text-gray-700 text-xs font-medium uppercase rounded-full dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-300"}," O "),k.createElementVNode("div",{class:"grow"},[k.createElementVNode("span",{class:"text-sm font-medium text-gray-800 dark:text-neutral-200"}," Ols Shols ")])])]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," Can view ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," olsshols@site.com ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"text-sm text-gray-600 dark:text-neutral-400"}," 6 days ago ")]),k.createElementVNode("td",{class:"size-px whitespace-nowrap px-4 py-3"},[k.createElementVNode("span",{class:"inline-flex items-center gap-1.5 py-1.5 px-2 text-xs font-medium bg-gray-100 text-gray-800 rounded-full dark:bg-neutral-500/20 dark:text-neutral-400"},[k.createElementVNode("span",{class:"size-1.5 inline-block bg-gray-800 rounded-full dark:bg-neutral-400"}),k.createTextVNode(" Inactive ")])])])])])])])])],-1)]))}const T_={...BT,"vs-dashboard":Pt(FT,[["render",VT]])},$T={admin:{install(n,{componentsApp:i}={componentsApp:[]}){var p;ft.defaults.baseURL&&(ft.defaults.baseURL=ft.defaults.baseURL);const o=(p=Ig(B1))==null?void 0:p.filter(b=>b==null?void 0:b.component).map(b=>({...b,component:{...T_,...i}[b==null?void 0:b.component]})),{router:c}=g1(o);n.component("admin",Bb),Object.entries(T_).forEach(([b,_])=>{n.component(b,_)}),n.config.globalProperties={...n.config.globalProperties,$componentsConfig:O1,$router:c},n.use(c)}}},wr=k.ref(null),jT={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const i=[];return n.forEach(o=>{o.menu?i.push(...this.flattenMenu(o.menu)):i.push(o)}),i},async getFormScheme(){var c,p;const n=this.flattenMenu(wr.value);n!=null&&n.length||this.$router.replace("/404");const i=n==null?void 0:n.find(b=>{var _,h;return(b==null?void 0:b.path)==((h=(_=this.$route)==null?void 0:_.query)==null?void 0:h.table)});i||this.$router.replace("/404");const o=i==null?void 0:i.table;this.table=o;try{const{data:{form:b}}=await ft.get(`/api/template/table/${o}`),{data:{rows:_}}=await ft.get(`/api/table-data/${this.table}/${(p=(c=this.$route)==null?void 0:c.query)==null?void 0:p.id}`);this.formValues=_==null?void 0:_[0];const{data:h}=await ft.get(`/api/template/form/${b}`);this.scheme=(h==null?void 0:h.schema)||h}catch{}},async editObject(){var n,i,o,c;try{await this.$refs.form.doValidation(),await ft.put(`/api/table/${this.table}/${(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.id}`,this.formValues),await this.$router.replace(`/${(c=(o=this.$route)==null?void 0:o.query)==null?void 0:c.table}`),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},UT={style:{width:"calc(100vw - 260px)"}},HT={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},qT={class:"flex items-center gap-[6px]"},ZT={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},WT={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function GT(n,i,o,c,p,b){const _=k.resolveComponent("VsForm");return k.openBlock(),k.createElementBlock("div",UT,[k.createElementVNode("div",HT,[i[3]||(i[3]=k.createElementVNode("h2",{class:"text-xl font-medium"},"Редагувати",-1)),k.createElementVNode("div",qT,[k.createElementVNode("button",{onClick:i[0]||(i[0]=h=>n.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),k.createElementVNode("button",{onClick:i[1]||(i[1]=(...h)=>b.editObject&&b.editObject(...h)),class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),k.createElementVNode("div",ZT,[k.createElementVNode("div",WT,[p.scheme?(k.openBlock(),k.createBlock(_,{key:0,ref:"form",scheme:p.scheme,modelValue:p.formValues,"onUpdate:modelValue":i[2]||(i[2]=h=>p.formValues=h),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):k.createCommentVNode("",!0)])])])}const YT=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(jT,[["render",GT]])},Symbol.toStringTag,{value:"Module"})),XT={data(){return{formValues:{},scheme:null,table:""}},mounted(){this.getFormScheme()},methods:{flattenMenu(n){const i=[];return n.forEach(o=>{o.menu?i.push(...this.flattenMenu(o.menu)):i.push(o)}),i},async getFormScheme(){const n=this.flattenMenu(wr.value);n!=null&&n.length||this.$router.replace("/404");const i=n==null?void 0:n.find(c=>{var p,b;return(c==null?void 0:c.path)==((b=(p=this.$route)==null?void 0:p.query)==null?void 0:b.table)});i||this.$router.replace("/404");const o=i==null?void 0:i.table;this.table=o;try{const{data:{form:c}}=await ft.get(`/api/template/table/${o}`),{data:p}=await ft.get(`/api/template/form/${c}`);this.scheme=(p==null?void 0:p.schema)||p}catch{}},async createObject(){var n,i;try{await this.$refs.form.doValidation(),await ft.post(`/api/table/${this.table}`,this.formValues),await this.$router.replace(`/${(i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.table}`),await this.$notify({title:"Успішно!",message:"Об'єкт успішно створено",type:"success"})}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},KT={style:{width:"calc(100vw - 260px)"}},JT={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},QT={class:"flex items-center gap-[6px]"},eC={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},tC={class:"bg-white w-full rounded-xl border p-[20px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function iC(n,i,o,c,p,b){const _=k.resolveComponent("VsForm");return k.openBlock(),k.createElementBlock("div",KT,[k.createElementVNode("div",JT,[i[3]||(i[3]=k.createElementVNode("h2",{class:"text-xl font-medium"},"Створити",-1)),k.createElementVNode("div",QT,[k.createElementVNode("button",{onClick:i[0]||(i[0]=h=>n.$router.back()),class:"py-2 px-3 flex items-center gap-x-2 text-sm font-medium rounded-lg border bg-white border-gray-100 text-gray-800 shadow focus:outline-none hover:bg-gray-50 hover:border-gray-100 duration-300"}," Скасувати "),k.createElementVNode("button",{onClick:i[1]||(i[1]=(...h)=>b.createObject&&b.createObject(...h)),class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"}," Зберегти ")])]),k.createElementVNode("div",eC,[k.createElementVNode("div",tC,[p.scheme?(k.openBlock(),k.createBlock(_,{key:0,ref:"form",scheme:p.scheme,modelValue:p.formValues,"onUpdate:modelValue":i[2]||(i[2]=h=>p.formValues=h),class:"p-0 mt-[20px]"},null,8,["scheme","modelValue"])):k.createCommentVNode("",!0)])])])}const nC=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(XT,[["render",iC]])},Symbol.toStringTag,{value:"Module"})),rC={};function sC(n,i,o,c,p,b){const _=k.resolveComponent("router-view");return k.openBlock(),k.createBlock(_)}const C_=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(rC,[["render",sC]])},Symbol.toStringTag,{value:"Module"})),oC={data(){return{objectData:null}},computed:{getRoute(){const n=this.flattenMenu(wr.value);n!=null&&n.length||this.$router.replace("/404");const i=n==null?void 0:n.find(o=>{var c,p;return(o==null?void 0:o.table)==((p=(c=this.$route)==null?void 0:c.params)==null?void 0:p.table)});return i||this.$router.replace("/404"),i==null?void 0:i.path}},mounted(){this.getObjectData()},methods:{async getObjectData(){var o;const{table:n,id:i}=(o=this.$route)==null?void 0:o.params;(!n||!i)&&this.$router.replace("/404");try{const{data:c}=await ft.get(`/api/table-data/${n}/${i}`);this.objectData=c}catch(c){console.error(c)}},getColClass(n){return`col-span-${n||12}`},getGridClass(){return"grid-cols-12"},flattenMenu(n){const i=[];return n.forEach(o=>{o.menu?i.push(...this.flattenMenu(o.menu)):i.push(o)}),i}}},aC={style:{width:"calc(100vw - 260px)",height:"100vh"},class:"bg-gray-50 overflow-y-auto"},lC={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},cC={class:"flex items-center gap-[4px]"},hC={class:"text-xl font-medium text-gray-600"},uC={class:"flex items-center gap-[6px]"},dC={key:0,class:"border rounded-xl bg-white"},pC={class:"p-[10px] pl-[20px] text-xl"},fC=["innerHTML"],mC={key:1},gC={class:"p-[10px] pl-[20px] text-xl"},yC={key:0,class:"p-[20px] border-t"},_C={key:1,class:"p-[20px] border-t"},xC=["innerHTML"];function bC(n,i,o,c,p,b){var h,M,A,D,R,z;const _=k.resolveComponent("router-link");return k.openBlock(),k.createElementBlock("div",aC,[k.createElementVNode("div",lC,[k.createElementVNode("div",cC,[k.createElementVNode("button",{onClick:i[0]||(i[0]=j=>n.$router.back()),class:"text-xl font-medium text-gray-600 hover:text-black"}," До таблиці "),i[1]||(i[1]=k.createElementVNode("span",null,"/",-1)),k.createElementVNode("h2",hC,k.toDisplayString(((A=(M=(h=p.objectData)==null?void 0:h.rows)==null?void 0:M[0])==null?void 0:A.name)||"Сторінка об'єкта"),1)]),k.createElementVNode("div",uC,[k.createVNode(_,{to:`/edit?table=${b.getRoute}&id=${(R=(D=n.$route)==null?void 0:D.params)==null?void 0:R.id}`,class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg border-none bg-blue-500 text-gray-800 shadow-sm focus:border-none focus:outline-none hover:bg-blue-700 hover:text-white duration-300"},{default:k.withCtx(()=>i[2]||(i[2]=[k.createTextVNode(" Редагувати ")])),_:1},8,["to"])])]),k.createElementVNode("div",{class:k.normalizeClass(["grid gap-[20px]",b.getGridClass()])},[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList((z=p.objectData)==null?void 0:z.panels,(j,Y)=>{var ee;return k.openBlock(),k.createElementBlock("div",{key:Y,class:k.normalizeClass([b.getColClass(j.col),"p-4"])},[j!=null&&j.name?(k.openBlock(),k.createElementBlock("div",dC,[k.createElementVNode("h2",pC,k.toDisplayString((j==null?void 0:j.title)||"Панель"),1),k.createElementVNode("div",{class:"p-[20px] border-t",innerHTML:(ee=p.objectData)==null?void 0:ee.data[j==null?void 0:j.name]},null,8,fC)])):j.type==="container"?(k.openBlock(),k.createElementBlock("div",mC,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(j.items,(oe,ue)=>{var be,_e,Ce,Qe,mt;return k.openBlock(),k.createElementBlock("div",{key:ue,class:"border rounded-xl bg-white mb-[20px]"},[k.createElementVNode("h2",gC,k.toDisplayString((oe==null?void 0:oe.title)||"Панель"),1),oe!=null&&oe.component?(k.openBlock(),k.createElementBlock("div",yC,[(k.openBlock(),k.createBlock(k.resolveDynamicComponent(oe.component),{geometry:(_e=(be=p.objectData)==null?void 0:be.rows[0])==null?void 0:_e.geom,zoom:16,id:(Qe=(Ce=n.$route)==null?void 0:Ce.params)==null?void 0:Qe.id},null,8,["geometry","id"]))])):k.createCommentVNode("",!0),oe!=null&&oe.name?(k.openBlock(),k.createElementBlock("div",_C,[k.createElementVNode("div",{innerHTML:(mt=p.objectData)==null?void 0:mt.data[oe==null?void 0:oe.name]},null,8,xC)])):k.createCommentVNode("",!0)])}),128))])):k.createCommentVNode("",!0)],2)}),128))],2)])}const vC=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(oC,[["render",bC],["__scopeId","data-v-86a4c28d"]])},Symbol.toStringTag,{value:"Module"})),wC={},SC={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-logout"};function kC(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",SC,i[0]||(i[0]=[k.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),k.createElementVNode("path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2"},null,-1),k.createElementVNode("path",{d:"M9 12h12l-3 -3"},null,-1),k.createElementVNode("path",{d:"M18 15l3 -3"},null,-1)]))}const EC=Pt(wC,[["render",kC]]),TC={},CC={viewBox:"0 0 1823 249",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function MC(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",CC,i[0]||(i[0]=[k.createStaticVNode('<path d="M218.88 96.05C223.55 99.19 228.69 101.56 234.09 103.07V145.42C212.05 151.54 195.83 171.79 195.83 195.75C195.83 200.22 196.41 204.65 197.53 208.94L160.92 230.08C156.82 226.06 152.08 222.73 146.91 220.24V171.62C164.83 163.13 176.59 145.06 176.59 124.48C176.59 123.17 176.54 121.86 176.44 120.56L218.88 96.05ZM220.32 79.09L160.97 113.36C162.04 116.88 162.61 120.61 162.61 124.48C162.61 142.66 149.93 157.87 132.93 161.76V230.05C143.4 232.46 152.23 239.16 157.46 248.21L215 214.99C211.7 209.34 209.81 202.77 209.81 195.75C209.81 174.62 226.94 157.49 248.07 157.49V91.02C237.14 91.02 227.29 86.43 220.32 79.09Z" fill="#CE3936"></path><path d="M161.39 19.13L197.44 39.94C196.39 44.11 195.84 48.42 195.84 52.75C195.84 54.21 195.9 55.65 196.02 57.1L153.9 81.42C145.27 75.5 134.95 72.24 124.36 72.24C113.83 72.24 103.57 75.47 94.96 81.32L52.71 56.93C52.82 55.55 52.88 54.16 52.88 52.76C52.88 48.43 52.34 44.12 51.28 39.95L87.3 19.16C96.98 28.89 110.26 34.58 124.34 34.58C138.42 34.57 151.7 28.87 161.39 19.13ZM157.77 0.919983C151.24 12.66 138.71 20.6 124.33 20.6C109.95 20.6 97.44 12.67 90.9 0.939983L33.9 33.85C37.08 39.43 38.91 45.88 38.91 52.76C38.91 56.71 38.31 60.52 37.2 64.11L96.46 98.32C103.44 90.87 113.36 86.22 124.37 86.22C135.44 86.22 145.41 90.93 152.39 98.44L211.59 64.27C210.45 60.64 209.83 56.78 209.83 52.77C209.83 45.89 211.65 39.44 214.84 33.86L157.77 0.919983Z" fill="#CE3936"></path><path d="M29.97 95.95L72.28 120.38C72.17 121.74 72.12 123.1 72.12 124.47C72.12 145.02 83.86 163.08 101.74 171.58V220.23C96.58 222.71 91.84 226.04 87.75 230.05L51.17 208.93C52.29 204.64 52.87 200.21 52.87 195.74C52.87 171.78 36.65 151.53 14.61 145.41V103.06C20.07 101.55 25.27 99.14 29.97 95.95ZM28.5 78.97C21.52 86.38 11.63 91.02 0.640015 91.02V157.49C21.77 157.49 38.9 174.62 38.9 195.75C38.9 202.77 37 209.33 33.71 214.99L91.2 248.18C96.43 239.14 105.25 232.45 115.71 230.04V161.73C98.74 157.81 86.09 142.62 86.09 124.46C86.09 120.54 86.68 116.75 87.78 113.18L28.5 78.97Z" fill="#CE3936"></path><path d="M498.39 177.5V144.88C498.39 128.55 485.11 115.27 468.78 115.27H343.22C342.69 115.27 342.18 115.32 341.67 115.4H337.19C332.35 115.4 328.42 111.46 328.42 106.63V74C328.42 69.16 332.36 65.23 337.19 65.23H486.33C492.08 65.23 496.75 60.57 496.75 54.81C496.75 49.06 492.08 44.39 486.33 44.39H337.19C320.86 44.39 307.58 57.67 307.58 74V106.62C307.58 122.95 320.86 136.23 337.19 136.23H462.75C463.28 136.23 463.79 136.18 464.3 136.1H468.78C473.62 136.1 477.55 140.04 477.55 144.87V177.49C477.55 182.33 473.61 186.26 468.78 186.26H319.64C313.89 186.26 309.22 190.92 309.22 196.68C309.22 202.43 313.89 207.1 319.64 207.1H468.78C485.11 207.11 498.39 193.83 498.39 177.5Z" fill="#CE3935"></path><path d="M710.7 177.32V75.24C710.7 58.91 697.42 45.63 681.09 45.63H550.05C533.72 45.63 520.44 58.91 520.44 75.24V177.32C520.44 193.65 533.72 206.93 550.05 206.93H681.1C697.42 206.93 710.7 193.65 710.7 177.32ZM541.27 75.24C541.27 70.4 545.21 66.47 550.04 66.47H681.09C685.93 66.47 689.86 70.41 689.86 75.24V177.32C689.86 182.16 685.92 186.09 681.09 186.09H550.05C545.21 186.09 541.28 182.15 541.28 177.32V75.24H541.27Z" fill="#CE3935"></path><path d="M1823 177.32V75.24C1823 58.91 1809.72 45.63 1793.39 45.63H1662.34C1646.01 45.63 1632.73 58.91 1632.73 75.24V177.32C1632.73 193.65 1646.01 206.93 1662.34 206.93H1793.39C1809.72 206.93 1823 193.65 1823 177.32ZM1653.57 75.24C1653.57 70.4 1657.51 66.47 1662.34 66.47H1793.39C1798.23 66.47 1802.16 70.41 1802.16 75.24V177.32C1802.16 182.16 1798.22 186.09 1793.39 186.09H1662.34C1657.5 186.09 1653.57 182.15 1653.57 177.32V75.24Z" fill="#CE3935"></path><path d="M756.76 196.51V152H849.42C855.17 152 859.84 147.34 859.84 141.58C859.84 135.83 855.17 131.16 849.42 131.16H756.76V75.23C756.76 70.39 760.7 66.46 765.53 66.46H893.29C899.04 66.46 903.71 61.8 903.71 56.04C903.71 50.29 899.04 45.62 893.29 45.62H765.53C749.2 45.62 735.92 58.9 735.92 75.23V196.5C735.92 202.25 740.59 206.92 746.34 206.92C752.09 206.93 756.76 202.27 756.76 196.51Z" fill="#CE3935"></path><path d="M933.86 66.47H1006.51V194.32C1006.51 200.07 1011.18 204.74 1016.93 204.74C1022.68 204.74 1027.35 200.07 1027.35 194.32V66.47H1100C1105.75 66.47 1110.42 61.81 1110.42 56.05C1110.42 50.3 1105.76 45.63 1100 45.63H933.86C928.11 45.63 923.44 50.29 923.44 56.05C923.45 61.81 928.11 66.47 933.86 66.47Z" fill="#CE3935"></path><path d="M1218.44 204.19C1224.19 204.19 1228.86 199.53 1228.86 193.77V152H1368.13C1384.46 152 1397.74 138.72 1397.74 122.39V75.24C1397.74 58.91 1384.46 45.63 1368.13 45.63H1237.63C1221.3 45.63 1208.02 58.91 1208.02 75.24V193.77C1208.02 199.53 1212.68 204.19 1218.44 204.19ZM1237.63 66.47H1368.13C1372.97 66.47 1376.9 70.41 1376.9 75.24V122.39C1376.9 127.23 1372.96 131.16 1368.13 131.16H1228.86V75.23C1228.86 70.41 1232.79 66.47 1237.63 66.47Z" fill="#CE3935"></path><path d="M1430.64 204.19C1436.39 204.19 1441.06 199.53 1441.06 193.77V152H1523.95C1524.57 153.18 1525.42 154.26 1526.51 155.17L1581.89 201.23C1583.83 202.85 1586.2 203.64 1588.55 203.64C1591.54 203.64 1594.5 202.36 1596.57 199.88C1600.25 195.46 1599.64 188.89 1595.22 185.21L1555.29 152H1580.33C1596.66 152 1609.94 138.72 1609.94 122.39V75.24C1609.94 58.91 1596.66 45.63 1580.33 45.63H1449.83C1433.5 45.63 1420.22 58.91 1420.22 75.24V193.77C1420.22 199.53 1424.88 204.19 1430.64 204.19ZM1449.83 66.47H1580.33C1585.17 66.47 1589.1 70.41 1589.1 75.24V122.39C1589.1 127.23 1585.17 131.16 1580.33 131.16H1441.06V75.23C1441.05 70.41 1444.99 66.47 1449.83 66.47Z" fill="#CE3935"></path>',10)]))}const PC=Pt(TC,[["render",MC]]),IC={},AC={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-chevron-down"};function DC(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",AC,i[0]||(i[0]=[k.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),k.createElementVNode("path",{d:"M6 9l6 6l6 -6"},null,-1)]))}const zC={components:{IconChevronDown:Pt(IC,[["render",DC]])},props:{route:Object},data(){return{isOpen:!1}}},RC={key:0,class:""},LC={class:"ml-[30px] before:block before:absolute relative w-[196px] inline-block before:w-[2px] before:h-[100%] before:bg-gray-100 before:left-[-14px] cursor-pointer"},OC={key:1};function BC(n,i,o,c,p,b){var M,A,D,R,z,j;const _=k.resolveComponent("IconChevronDown"),h=k.resolveComponent("router-link");return(M=o.route)!=null&&M.menu?(k.openBlock(),k.createElementBlock("div",RC,[k.createElementVNode("button",{onClick:i[0]||(i[0]=Y=>p.isOpen=!p.isOpen),class:"flex cursor-pointer gap-x-3 py-2 px-3 mb-[6px] text-sm text-gray-800 justify-start w-full border-none focus:outline-none text-gray-800 rounded-lg items-center focus:bg-gray-100 hover:bg-gray-100 duration-300"},[k.createTextVNode(k.toDisplayString((A=o.route)==null?void 0:A.ua)+" ",1),k.createVNode(_,{class:k.normalizeClass([[p.isOpen&&"-rotate-180"],"ml-auto duration-300"]),width:"16",height:"16"},null,8,["class"])]),k.createVNode(k.Transition,{name:"fade"},{default:k.withCtx(()=>{var Y;return[k.withDirectives(k.createElementVNode("ul",LC,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList((Y=o.route)==null?void 0:Y.menu,(ee,oe)=>{var ue,be;return k.openBlock(),k.createElementBlock("li",{key:oe,class:"w-full mb-[4px]"},[k.createVNode(h,{to:"/"+(ee==null?void 0:ee.path),class:k.normalizeClass([[((be=(ue=n.$route)==null?void 0:ue.path)==null?void 0:be.includes(ee==null?void 0:ee.path))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:k.withCtx(()=>[k.createTextVNode(k.toDisplayString(ee==null?void 0:ee.ua),1)]),_:2},1032,["to","class"])])}),128))],512),[[k.vShow,p.isOpen]])]}),_:1})])):(k.openBlock(),k.createElementBlock("div",OC,[k.createVNode(h,{to:(D=o.route)==null?void 0:D.path,class:k.normalizeClass([[((j=(R=n.$route)==null?void 0:R.path)==null?void 0:j.includes((z=o.route)==null?void 0:z.path))&&"bg-gray-100"],"flex gap-x-3 py-2 w-full font-[400] px-3 text-sm text-gray-800 rounded-lg items-center hover:bg-gray-100 duration-300 hover:text-gray-800"])},{default:k.withCtx(()=>{var Y;return[k.createTextVNode(k.toDisplayString((Y=o.route)==null?void 0:Y.ua),1)]}),_:1},8,["to","class"])]))}const FC={components:{IconLogout:EC,NavbarItem:Pt(zC,[["render",BC]]),IconLogo:PC},data(){return{activeIndex:null,data:null,searchValue:""}},computed:{data(){var n,i;return(n=this.searchValue)!=null&&n.trim()?(i=this.flattenMenu(wr.value))==null?void 0:i.filter(o=>{var c,p,b;return(b=(c=o==null?void 0:o.ua)==null?void 0:c.toLowerCase())==null?void 0:b.includes((p=this.searchValue)==null?void 0:p.toLowerCase())}):wr.value}},methods:{flattenMenu(n){const i=[];return n.forEach(o=>{o.menu?i.push(...this.flattenMenu(o.menu)):i.push(o)}),i}}},NC={class:"flex flex-col h-[100vh] border-r w-[300px]"},VC={class:"p-[16px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},$C={class:"pb-3 w-full flex flex-col flex-wrap"},jC={key:0,class:"flex flex-col gap-[6px]"},UC={key:1,class:"text-gray-800 text-lg mt-[20px]"};function HC(n,i,o,c,p,b){var M;const _=k.resolveComponent("IconLogo"),h=k.resolveComponent("NavbarItem");return k.openBlock(),k.createElementBlock("div",NC,[k.createVNode(_,{height:"40",width:"200",class:"my-[20px] ml-[20px]"}),k.withDirectives(k.createElementVNode("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=A=>p.searchValue=A),placeholder:"Пошук по меню",class:"h-[40px] block rounded-lg border mx-[10px] pl-[10px] focus:border-blue-600 focus:border-[2px] outline-none"},null,512),[[k.vModelText,p.searchValue]]),k.createElementVNode("div",VC,[k.createElementVNode("nav",$C,[(M=b.data)!=null&&M.length?(k.openBlock(),k.createElementBlock("ul",jC,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(b.data,(A,D)=>(k.openBlock(),k.createElementBlock("li",{key:D},[k.createVNode(h,{route:A},null,8,["route"])]))),128))])):(k.openBlock(),k.createElementBlock("div",UC,"Не знайдено"))])])])}const qC={components:{navbar:Pt(FC,[["render",HC]])},mounted(){this.getMenu()},computed:{isMenu(){return wr.value}},methods:{async getMenu(){try{const{data:n}=await ft.get("/api/user-menu");wr.value=n}catch{}}}},ZC={class:"admin-wrapper"};function WC(n,i,o,c,p,b){const _=k.resolveComponent("navbar"),h=k.resolveComponent("router-view");return k.openBlock(),k.createElementBlock("div",ZC,[k.createVNode(_),b.isMenu?(k.openBlock(),k.createBlock(h,{key:0})):k.createCommentVNode("",!0)])}const GC=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(qC,[["render",WC],["__scopeId","data-v-3a278cfb"]])},Symbol.toStringTag,{value:"Module"})),YC={},XC={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-adjustments-horizontal"};function KC(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",XC,i[0]||(i[0]=[k.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 6l8 0"></path><path d="M16 6l4 0"></path><path d="M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 12l2 0"></path><path d="M10 12l10 0"></path><path d="M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M4 18l11 0"></path><path d="M19 18l1 0"></path>',10)]))}const JC=Pt(YC,[["render",KC]]),QC={},eM={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-dots-vertical"};function tM(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",eM,i[0]||(i[0]=[k.createElementVNode("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"},null,-1),k.createElementVNode("path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),k.createElementVNode("path",{d:"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1),k.createElementVNode("path",{d:"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"},null,-1)]))}const iM=Pt(QC,[["render",tM]]),nM={},rM={class:"flex-shrink-0 size-3.5",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"};function sM(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",rM,i[0]||(i[0]=[k.createStaticVNode('<path d="M3 6h18"></path><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"></path><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"></path><line x1="10" x2="10" y1="11" y2="17"></line><line x1="14" x2="14" y1="11" y2="17"></line>',5)]))}const oM=Pt(nM,[["render",sM]]),aM={props:{height:{type:String,default:"16"},width:{type:String,default:"12"},color:{type:String,default:"black"}}},lM={style:{display:"none"}},cM=["height","width","fill"];function hM(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock(k.Fragment,null,[(k.openBlock(),k.createElementBlock("svg",lM,i[0]||(i[0]=[k.createElementVNode("symbol",{id:"icon-pencil",viewBox:"0 0 32 32"},[k.createElementVNode("path",{d:"M27 0c2.761 0 5 2.239 5 5 0 1.126-0.372 2.164-1 3l-2 2-7-7 2-2c0.836-0.628 1.874-1 3-1zM2 23l-2 9 9-2 18.5-18.5-7-7-18.5 18.5zM22.362 11.362l-14 14-1.724-1.724 14-14 1.724 1.724z"})],-1)]))),(k.openBlock(),k.createElementBlock("svg",{height:o.height,width:o.width,fill:o.color},i[1]||(i[1]=[k.createElementVNode("use",{"xlink:href":"#icon-pencil"},null,-1)]),8,cM))],64)}const uM={components:{IconMore:iM,IconDelete:oM,IconEdit:Pt(aM,[["render",hM]])},emits:["updateTable"],props:{item:Object,table:String},data(){return{formVisible:!1,isDeleteConfirm:!1,formValue:{},top:0,left:0}},methods:{openConfirm(){this.isDeleteConfirm=!0,document.querySelector("body").click()},async getData(){var n;try{const{data:i}=await ft.get(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`);this.formValue=i}catch(i){console.error(i)}},doSomethingOnCancel(){this.formVisible=!1},async deleteElement(){var n;try{ft.delete(`/api/table/${this.table}/${(n=this.item)==null?void 0:n.id}`),this.$notify({title:"Успішно!",message:"Об`єкт успішно видалeно",type:"success"}),await this.$emit("update-table"),this.isDeleteConfirm=!1}catch{this.$notify({title:"Помилка!",message:"Сталася помилка",type:"error"})}}}},dM={class:"hs-dropdown [--placement:bottom-right] inline-flex"},pM={id:"hs-pro-dupc1",type:"button",class:"gap-x-2 p-2 rounded-lg hover:border-transparent focus:outline-none text-black hover:bg-gray-50"},fM={class:"pt-[7px] pb-[7px] flex flex-col items-start"},mM={class:"p-4"},gM={class:"mt-4 flex justify-end gap-x-3"};function yM(n,i,o,c,p,b){const _=k.resolveComponent("IconMore"),h=k.resolveComponent("IconEdit"),M=k.resolveComponent("router-link"),A=k.resolveComponent("IconDelete"),D=k.resolveComponent("VsPopover"),R=k.resolveComponent("VsDialog");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createElementVNode("div",dM,[k.createVNode(D,{trigger:"click",placement:"left"},{reference:k.withCtx(()=>[k.createElementVNode("button",pM,[k.createVNode(_,{height:"16",width:"16"})])]),default:k.withCtx(()=>{var z,j,Y;return[k.createElementVNode("div",fM,[k.createVNode(M,{to:`/edit?table=${(j=(z=n.$route)==null?void 0:z.params)==null?void 0:j.catchAll}&id=${(Y=o.item)==null?void 0:Y.id}`,class:"w-[100px] ml-[2px] flex items-center justify-center gap-x-3 rounded-lg text-[13px] text-gray-800"},{default:k.withCtx(()=>[k.createVNode(h,{color:"#000"}),i[4]||(i[4]=k.createTextVNode(" Редагувати "))]),_:1},8,["to"]),i[6]||(i[6]=k.createElementVNode("div",{class:"h-[1px] w-[80%] bg-gray-200 ml-auto mr-auto mt-[10px] mb-[10px]"},null,-1)),k.createElementVNode("button",{onClick:i[0]||(i[0]=k.withModifiers((...ee)=>b.openConfirm&&b.openConfirm(...ee),["stop"])),type:"button",class:"w-[100px] flex items-center justify-center gap-x-3 rounded-lg text-[14px] text-red-500"},[k.createVNode(A),i[5]||(i[5]=k.createElementVNode("span",{class:"text-gray-800"},"Видалити",-1))])])]}),_:1})]),k.createVNode(R,{visible:p.isDeleteConfirm,"onUpdate:visible":i[3]||(i[3]=z=>p.isDeleteConfirm=z),title:"Ви впевнені?"},{default:k.withCtx(()=>[k.createElementVNode("div",mM,[i[7]||(i[7]=k.createElementVNode("p",{class:"mt-1 text-gray-500 dark:text-neutral-500"}," Ви впевнені, що хочете видалити цей об'єкт? ",-1)),k.createElementVNode("div",gM,[k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm 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:i[1]||(i[1]=z=>p.isDeleteConfirm=!1)}," Скасувати "),k.createElementVNode("button",{type:"button",class:"py-2 px-3 inline-flex items-center gap-x-2 text-sm font-semibold rounded-lg border border-transparent bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 disabled:pointer-events-none",onClick:i[2]||(i[2]=(...z)=>b.deleteElement&&b.deleteElement(...z))}," Так, я впевнена/ий ")])])]),_:1},8,["visible"])],64)}const _M=Pt(uM,[["render",yM]]),xM={},bM={class:"flex-shrink-0 mt-0.5 size-3.5",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"};function vM(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",bM,i[0]||(i[0]=[k.createElementVNode("path",{d:"m3 16 4 4 4-4"},null,-1),k.createElementVNode("path",{d:"M7 20V4"},null,-1),k.createElementVNode("path",{d:"m21 8-4-4-4 4"},null,-1),k.createElementVNode("path",{d:"M17 4v16"},null,-1)]))}const wM=Pt(xM,[["render",vM]]),SM={props:{columns:{type:Object,default:()=>{}},table:{type:String,default:()=>""}},data(){return{tableFormats:["json","csv","xlsx"],format:"",cols:[]}},methods:{async exportTable(){try{const n=await ft.get("/api/export",{params:{table:this.table,format:this.format,cols:this.cols.join(",")},responseType:"blob"}),i=new Blob([n.data],{type:"application/octet-stream"}),o=window.URL.createObjectURL(i),c=document.createElement("a");c.href=o,c.setAttribute("download",`${this.table.split(".")[0]}.${this.format}`),document.body.appendChild(c),c.click(),document.body.removeChild(c),window.URL.revokeObjectURL(o),this.$notify({type:"success",title:"Експорт",message:"Файл успішно експортовано!"})}catch(n){console.error("Ошибка при экспорте файла:",n),this.$notify({type:"error",title:"Помилка",message:"Не вдалося експортувати файл."})}},selectFormat(n){this.format=n}}},kM={class:"p-4"},EM={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},TM={class:"mt-2 flex row flex-wrap gap-y-[5px] gap-x-[10px]"},CM={class:"pb-5 mb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},MM={class:"mt-2 space-y-2"},PM=["id","onChange"],IM=["for"],AM={class:"pb-5 last:pb-0 last:mb-0 border-b last:border-b-0 border-gray-200 dark:border-neutral-700"},DM={class:"text-center"};function zM(n,i,o,c,p,b){const _=k.resolveComponent("VsCheckbox");return k.openBlock(),k.createElementBlock(k.Fragment,null,[i[4]||(i[4]=k.createElementVNode("div",{class:"dark:border-neutral-700"},null,-1)),k.createElementVNode("div",kM,[k.createElementVNode("div",EM,[i[2]||(i[2]=k.createElementVNode("label",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Виберіть стовпці таблиці для експорту: ",-1)),k.createElementVNode("div",TM,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(o.columns,(h,M)=>(k.openBlock(),k.createElementBlock("div",{class:"flex items-center",key:M,style:{width:"calc((100% - 10px) / 2)"}},[k.createVNode(_,{class:"py-0 shrink-0 border-gray-300 rounded text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",modelValue:p.cols,"onUpdate:modelValue":i[0]||(i[0]=A=>p.cols=A),value:h==null?void 0:h.name,label:h==null?void 0:h.ua},null,8,["modelValue","value","label"])]))),128))])]),k.createElementVNode("div",CM,[i[3]||(i[3]=k.createElementVNode("label",{class:"text-sm text-gray-500 dark:text-neutral-500"}," Виберіть формат таблиці: ",-1)),k.createElementVNode("div",MM,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(p.tableFormats,(h,M)=>(k.openBlock(),k.createElementBlock("div",{class:"flex items-center",key:M},[k.createElementVNode("input",{type:"radio",name:"hs-pro-duecmfm",class:"shrink-0 border-gray-300 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-500 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800",id:h,onChange:A=>b.selectFormat(h)},null,40,PM),k.createElementVNode("label",{for:h,class:"text-sm text-gray-800 ms-3 dark:text-neutral-400"}," Формат "+k.toDisplayString(h),9,IM)]))),128))])]),k.createElementVNode("div",AM,[k.createElementVNode("div",DM,[k.createElementVNode("button",{type:"button",class:"p-2 inline-flex items-center gap-x-2 text-xs font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:ring-2 focus:ring-blue-500",onClick:i[1]||(i[1]=(...h)=>b.exportTable&&b.exportTable(...h))}," Завантажити таблицю ")])])])],64)}const RM={components:{IconExport:wM,AdminTableExportForm:Pt(SM,[["render",zM]])},props:{table:String,columns:Array},data(){return{isOpen:!1}}};function LM(n,i,o,c,p,b){const _=k.resolveComponent("IconExport"),h=k.resolveComponent("AdminTableExportForm"),M=k.resolveComponent("VsDialog");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createElementVNode("button",{onClick:i[0]||(i[0]=A=>p.isOpen=!0),class:"py-2 px-3 relative flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},[k.createVNode(_,{height:"16",width:"16"}),i[2]||(i[2]=k.createTextVNode(" Експорт "))]),k.createVNode(M,{visible:p.isOpen,"onUpdate:visible":i[1]||(i[1]=A=>p.isOpen=A),title:"Експорт таблиці"},{default:k.withCtx(()=>[k.createVNode(h,{table:o.table,columns:o.columns},null,8,["table","columns"])]),_:1},8,["visible"])],64)}const OM=Pt(RM,[["render",LM]]),BM={},FM={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-columns"};function NM(n,i,o,c,p,b){return k.openBlock(),k.createElementBlock("svg",FM,i[0]||(i[0]=[k.createStaticVNode('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 6l5.5 0"></path><path d="M4 10l5.5 0"></path><path d="M4 14l5.5 0"></path><path d="M4 18l5.5 0"></path><path d="M14.5 6l5.5 0"></path><path d="M14.5 10l5.5 0"></path><path d="M14.5 14l5.5 0"></path><path d="M14.5 18l5.5 0"></path>',9)]))}const VM=Pt(BM,[["render",NM]]),$M={props:{column:Object},emits:["update-column"],data(){return{value:!1}},watch:{value(n){this.$emit("update-column",{...this.column,hidden:!n})}},mounted(){var n;((n=this.column)==null?void 0:n.hidden)!==!0&&(this.value=!0)}},jM={class:"flex w-full gap-[8px] items-centr"};function UM(n,i,o,c,p,b){var _,h;return k.openBlock(),k.createElementBlock("label",jM,[k.withDirectives(k.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=M=>p.value=M),type:"checkbox"},null,512),[[k.vModelCheckbox,p.value]]),k.createTextVNode(" "+k.toDisplayString(((_=o.column)==null?void 0:_.ua)||((h=o.column)==null?void 0:h.title)),1)])}const HM={components:{IconColumns:VM,AdminTableColumnsHiddenItem:Pt($M,[["render",UM]])},emits:["update-columns"],props:{columns:Array},methods:{updateColumn(n){const i=this.columns.findIndex(c=>(c==null?void 0:c.name)===(n==null?void 0:n.name)),o=this.columns;o[i]=n,this.$emit("update-columns",[...o])}}},qM={class:"py-2 px-3 flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},ZM={class:"flex flex-col gap-[3px] h-[400px] w-[300px] overflow-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function WM(n,i,o,c,p,b){const _=k.resolveComponent("IconColumns"),h=k.resolveComponent("AdminTableColumnsHiddenItem"),M=k.resolveComponent("VsPopover");return k.openBlock(),k.createBlock(M,{trigger:"click",placement:"bottom"},{reference:k.withCtx(()=>[k.createElementVNode("button",qM,[k.createVNode(_,{height:"20",width:"16"})])]),default:k.withCtx(()=>[k.createElementVNode("div",null,[i[0]||(i[0]=k.createElementVNode("h2",{class:"text-sm mb-[8px]"},"Оберіть колонки, щоб приховати",-1)),k.createElementVNode("ul",ZM,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(o.columns,(A,D)=>(k.openBlock(),k.createElementBlock("li",{key:D},[k.createVNode(h,{column:A,onUpdateColumn:b.updateColumn},null,8,["column","onUpdateColumn"])]))),128))])])]),_:1})}const GM={props:{table:String},components:{IconFilter:JC,AdminTableControl:_M,AdminTableExport:OM,AdminTableColumnsHidden:Pt(HM,[["render",WM]])},data(){return{tableData:{},isFilters:!1,filterScheme:[],page:1,searchValue:"",limit:20,filters:null}},mounted(){var n,i;this.page=((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.page)||1,this.getTableData(),this.getFilters()},computed:{defaultPage(){var n,i;return((i=(n=this.$route)==null?void 0:n.query)==null?void 0:i.page)||1},getFilterScheme(){var n;return(n=this.tableData)==null?void 0:n.filters},columns(){var n,i;return(i=(n=this.tableData)==null?void 0:n.columns)==null?void 0:i.filter(o=>(o==null?void 0:o.hidden)!==!0)}},watch:{table(){this.getTableData()},searchValue(){this.getTableData()},$route:{handler(n,i){var o,c;((o=n==null?void 0:n.params)==null?void 0:o.catchAll)!==((c=i==null?void 0:i.params)==null?void 0:c.catchAll)&&(this.filterScheme=null,this.getFilters())},deep:!0}},methods:{async getTableData(){try{const{data:n}=await ft.get(`/api/template/table/${this.table}`),i=await ft.get(`/api/table-data/${this.table}`,{params:{page:this.page,search:this.searchValue||null,limit:this.limit,filter:this.filters||null}});this.tableData={...this.tableData,...n,...(i==null?void 0:i.data)||{}}}catch{}},async getFilters(){var n;try{const{data:i}=await ft.get(`/api/table-filter/${this.table}`);this.filterScheme=(n=i==null?void 0:i.list)==null?void 0:n.map(o=>({...o,label:(o==null?void 0:o.label)||(o==null?void 0:o.ua)}))}catch{}},async handlePageChange(n){const i=this.$route.query;this.page=n,!(!(i!=null&&i.page)&&n===1||i.page===n)&&(await this.$router.replace({query:{...i,page:n}}),await this.getTableData())},async changeLimit(n){this.limit=await n,this.defaultPage=1,await this.getTableData()},closeFilter({target:n}){this.isFilters&&n.classList.contains("filter-container")&&(this.isFilters=!1)},async filterChange({url:n}){this.filters=n,this.page=1,await this.getTableData()}}},YM={class:"w-[calc(100vw - 320px)]"},XM={class:"h-[58px] bg-gray-50 flex items-center justify-between px-[30px]"},KM={class:"text-xl font-medium"},JM={style:{height:"calc(100vh - 60px)",width:"calc(100vw - 260px)"},class:"bg-gray-50 p-[20px] flex"},QM={class:"bg-white w-full rounded-xl border p-[20px]"},eP={class:"flex sm:grid sm:grid-cols-2 gap-x-2 sm:gap-x-5 mb-[10px]"},tP={class:"flex gap-[6px] ml-auto"},iP={class:"space-y-5 flex items-start w-full justify-start"},nP={style:{height:"calc(100vh - 250px)"},class:"overflow-x-auto w-full [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"},rP={class:"inline-block align-middle"},sP={class:"divide-y divide-gray-200 dark:divide-neutral-700 relative"},oP={class:"sticky top-0 bg-white z-[1]"},aP={class:"border-t border-stone-200"},lP={class:"pe-4 py-3 gap-x-1 text-sm font-medium text-gray-800 dark:text-neutral-200"},cP={class:"divide-y divide-gray-200 dark:divide-neutral-700"},hP={class:"size-px min-w-[200px] whitespace-nowrap text-start pe-4 py-3 text-sm text-gray-600"},uP={class:"text-center sticky right-0 bg-white"},dP={class:"p-[20px] flex justify-end w-full"},pP={class:"filter-content h-screen bg-white w-[400px] p-[20px] pt-[10px] overflow-x-auto bg-[rgba(0,0,0,0.5)] [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar:horizontal]:h-[8px] [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"};function fP(n,i,o,c,p,b){var j,Y,ee,oe,ue,be,_e;const _=k.resolveComponent("router-link"),h=k.resolveComponent("AdminTableColumnsHidden"),M=k.resolveComponent("AdminTableExport"),A=k.resolveComponent("IconFilter"),D=k.resolveComponent("AdminTableControl"),R=k.resolveComponent("VsPagination"),z=k.resolveComponent("VsFilter");return k.openBlock(),k.createElementBlock(k.Fragment,null,[k.createElementVNode("div",YM,[k.createElementVNode("div",XM,[k.createElementVNode("h2",KM,k.toDisplayString((j=p.tableData)==null?void 0:j.title),1),k.createVNode(_,{to:`/add?table=${(ee=(Y=n.$route)==null?void 0:Y.params)==null?void 0:ee.catchAll}`,class:"py-2 px-3 flex items-center gap-x-2 text-sm text-white font-medium rounded-lg bg-blue-500 text-gray-800 shadow-sm hover:bg-blue-700 hover:text-white duration-300"},{default:k.withCtx(()=>i[5]||(i[5]=[k.createTextVNode(" Додати ")])),_:1},8,["to"])]),k.createElementVNode("div",JM,[k.createElementVNode("div",QM,[k.createElementVNode("div",eP,[k.withDirectives(k.createElementVNode("input",{"onUpdate:modelValue":i[0]||(i[0]=Ce=>p.searchValue=Ce),class:"py-2 pl-[15px] h-[38px] w-[400px] block w-full border rounded-lg text-sm focus:border-blue-600 focus:border-[2px] outline-none",placeholder:"Пошук..."},null,512),[[k.vModelText,p.searchValue]]),k.createElementVNode("div",tP,[k.createVNode(h,{columns:(oe=p.tableData)==null?void 0:oe.columns,onUpdateColumns:i[1]||(i[1]=Ce=>p.tableData.columns=Ce)},null,8,["columns"]),k.createVNode(M,{table:o.table,columns:(ue=p.tableData)==null?void 0:ue.columns},null,8,["table","columns"]),k.createElementVNode("button",{onClick:i[2]||(i[2]=Ce=>p.isFilters=!p.isFilters),class:"py-2 px-3 flex items-center gap-x-2 text-sm border focus:outline-none border-gray-100 font-medium rounded-lg text-gray-800 hover:border-gray-100 focus:border-gray-100 hover:bg-gray-50 shadow-sm duration-300"},[k.createVNode(A,{height:"16",width:"16"}),i[6]||(i[6]=k.createTextVNode(" Фільтри "))])])]),k.createElementVNode("div",iP,[k.createElementVNode("div",nP,[k.createElementVNode("div",rP,[k.createElementVNode("table",sP,[k.createElementVNode("thead",oP,[k.createElementVNode("tr",aP,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList(b.columns,Ce=>(k.openBlock(),k.createElementBlock("th",{class:"min-w-[200px] text-start",key:Ce.name},[k.createElementVNode("div",lP,k.toDisplayString((Ce==null?void 0:Ce.ua)||Ce.name),1)]))),128)),i[7]||(i[7]=k.createElementVNode("th",{class:"min-w-[150px] sticky right-0 top-0 bg-white z-[10]"},null,-1))])]),k.createElementVNode("tbody",cP,[(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList((be=p.tableData)==null?void 0:be.rows,(Ce,Qe)=>{var mt;return k.openBlock(),k.createElementBlock("tr",{key:Qe},[k.createElementVNode("td",hP,[k.createVNode(_,{to:`/card/${o.table}/${Ce==null?void 0:Ce.id}`,class:"text-sm text-green-600 decoration-2 hover:underline font-medium focus:outline-none focus:underline hover:text-green-600"},{default:k.withCtx(()=>{var Ae;return[k.createTextVNode(k.toDisplayString(Ce==null?void 0:Ce[(Ae=b.columns[0])==null?void 0:Ae.name]),1)]}),_:2},1032,["to"])]),(k.openBlock(!0),k.createElementBlock(k.Fragment,null,k.renderList((mt=b.columns)==null?void 0:mt.filter(Ae=>(Ae==null?void 0:Ae.name)!=="name"),Ae=>{var St;return k.openBlock(),k.createElementBlock("td",{class:"size-px min-w-[200px] whitespace-nowrap text-start pe-4 py-3 text-sm text-gray-600",key:Ae.name},[(k.openBlock(),k.createBlock(k.resolveDynamicComponent(n.$componentsConfig[`table-format-${((St=Ae==null?void 0:Ae.format)==null?void 0:St.toLowerCase())||n.text}`]),{name:Ae==null?void 0:Ae.name,data:Ce,value:Ce==null?void 0:Ce[Ae==null?void 0:Ae.name]},null,8,["name","data","value"]))])}),128)),k.createElementVNode("td",uP,[k.createVNode(D,{item:Ce,table:o.table,onUpdateTable:b.getTableData},null,8,["item","table","onUpdateTable"])])])}),128))])])])])]),k.createElementVNode("div",dP,[k.createVNode(R,{goTo:!1,class:"justify-end",style:{width:"calc(50% + 100px)"},"default-page":b.defaultPage,total:((_e=p.tableData)==null?void 0:_e.total)||0,pageSize:p.limit,onPageChange:b.handlePageChange,pageSizes:[10,16,20],onPageSizeChange:b.changeLimit},null,8,["default-page","total","pageSize","onPageChange","onPageSizeChange"])])])])]),k.createVNode(k.Transition,{name:"fade"},{default:k.withCtx(()=>{var Ce;return[k.withDirectives(k.createElementVNode("div",{onClick:i[4]||(i[4]=(...Qe)=>b.closeFilter&&b.closeFilter(...Qe)),style:{height:"100vh"},class:"fixed filter-container top-0 flex justify-end items-center z-[2] right-0 left-0 bottom-0 bg-[rgba(0,0,0,0.5)]"},[k.createElementVNode("div",pP,[(Ce=p.filterScheme)!=null&&Ce.length?(k.openBlock(),k.createBlock(z,{key:0,ref:"filter",scheme:p.filterScheme,layout:"default","apply-vue-router":"",history:"",name:"filter",onFilterChange:b.filterChange,closeFilterBtn:!0,onFilterClose:i[3]||(i[3]=Qe=>p.isFilters=!1)},null,8,["scheme","onFilterChange"])):k.createCommentVNode("",!0)])],512),[[k.vShow,p.isFilters]])]}),_:1})],64)}const mP={components:{AdminTable:Pt(GM,[["render",fP]])},data(){return{table:!1,interface:""}},watch:{$route:{async handler(){wr!=null&&wr.value||await this.getMenu(),await this.checkPageType()},deep:!0}},async mounted(){await this.checkPageType()},methods:{flattenMenu(n){const i=[];return n.forEach(o=>{o.menu?i.push(...this.flattenMenu(o.menu)):i.push(o)}),i},async getMenu(){try{const{data:n}=await ft.get("/api/user-menu");wr.value=n}catch{}},async checkPageType(){const n=this.flattenMenu(wr.value);n!=null&&n.length||this.$router.replace("/404");const i=n==null?void 0:n.find(c=>{var p,b;return(c==null?void 0:c.path)==((b=(p=this.$route)==null?void 0:p.params)==null?void 0:b.catchAll)});i||this.$router.replace("/404");const o=i==null?void 0:i.table;this.table=o||!1,!o&&this.getInterface()},async getInterface(){var n,i;try{const{data:o}=await ft.get(`/api/template/interface/${((i=(n=this.$route)==null?void 0:n.params)==null?void 0:i.catchAll)||""}`);this.interface=o||""}catch{this.interface=""}}}},gP={key:1,class:"w-full"},yP=["innerHTML"];function _P(n,i,o,c,p,b){const _=k.resolveComponent("AdminTable");return p.table?(k.openBlock(),k.createBlock(_,{key:0,table:p.table},null,8,["table"])):(k.openBlock(),k.createElementBlock("div",gP,[k.createElementVNode("div",{innerHTML:p.interface},null,8,yP)]))}const xP=Object.freeze(Object.defineProperty({__proto__:null,default:Pt(mP,[["render",_P]])},Symbol.toStringTag,{value:"Module"}));return $T});