1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./k2lYeLkD.js","./hePW80VL.js","./CUZWrv2X.js"])))=>i.map(i=>d[i]); 2import{D as e,E as t,O as n,T as r,g as i,l as a,u as o}from"./B36yyN6n.js";import{$ as s,A as c,Bt as l,D as u,Dt as d,E as f,Ft as p,H as m,It as h,K as g,L as _,M as v,O as y,P as b,Pt as x,Rt as S,T as C,Vt as w,Wt as T,X as E,_t as D,a as O,at as k,gt as ee,i as te,it as ne,j as re,kt as ie,n as ae,nt as oe,o as se,pt as ce,r as le,rt as ue,s as de,t as fe,vt as pe,w as me,wt as he,y as ge}from"./B9pVQlp5.js";import{h as _e}from"./fiIlMqlF.js";import{a as ve,i as ye,n as be}from"./BsjK2QnX.js";import{n as xe}from"./BrOz_Qp7.js";import"./Cf7Tl53m.js";import{i as Se}from"./Dgl1JKSl.js";import{Y as Ce}from"./C8B4ThWv.js";import{t as we}from"./D5Lg_lFv.js";import"./3oA-rL_K.js";import{c as Te,d as Ee,l as De,u as Oe}from"./CjM9JanA.js";import{t as A}from"./BDNMzG2s.js";import{t as ke}from"./gHQ5K98G.js";import{t as Ae}from"./CT1LqQuZ.js";import{t as je}from"./BaZiZcn7.js";var Me=e({docsBase:r,reporters:t}),Ne=e({docsBase:r,reporters:t}),Pe=(()=>{let e={};return(t,n)=>{let r=[];return n.charCodeAt(n.length-1)===47&&(n=n.slice(0,-1)),(n===`/.well-known/apple-app-site-association`||n===`/_nuxt`||n.charCodeAt(n.length-1)===47&&(n===`/.well-known/apple-app-site-association/`||n===`/_nuxt/`))&&r.push({data:e}),r.reverse()}})(),Fe=Pe,Ie=e=>Se.sensitive?_e({},...Pe(``,e).map(e=>e.data).reverse()):_e({},...Fe(``,typeof e==`string`?e.toLowerCase():e).map(e=>e.data).reverse()),Le=ye,Re=Ie,ze;function Be(){let e;return e=Le(ve(`builds/meta/${o().app.buildId}.json`),{responseType:`json`}).then(e=>{if(!e||typeof e!=`object`||!Array.isArray(e.prerendered))throw Ne.NUXT_E5004();return e}),ze=e,e.catch(t=>{ze===e&&(ze=void 0),Ne.NUXT_E5002({cause:t})}),e}function Ve(){return ze||Be()}function He(e){let t=typeof e==`string`?e:e.path;try{return Re(t)}catch(e){return Ne.NUXT_E5003({path:t,cause:e}),{}}}var Ue=2**32-1,We=Ue-1,Ge=Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ke(e){let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getPrototypeOf(t)===null||Object.getOwnPropertyNames(t).sort().join(`\0`)===Ge}function qe(e){return Object.prototype.toString.call(e).slice(8,-1)}function Je(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.getOwnPropertyDescriptor(e,t).enumerable)}function Ye(e){return!(!Number.isInteger(e)||e<0||e>We)}function Xe(e){return!(!Number.isInteger(e)||e<0||e>Ue)}function Ze(e){if(e.length===0||e.length>1&&e.charCodeAt(0)===48)return!1;for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<48||n>57)return!1}return Ye(+e)}function Qe(e){for(var t=e.length-1;t>=0&&!Ze(e[t]);t--);return t+1}function $e(e){let t=Object.keys(e);return t.length=Qe(t),t}var et;function tt(e){return Uint8Array.fromBase64(e).buffer}function nt(e){return Uint8Array.from(Buffer.from(e,`base64`)).buffer}function rt(e){let t=atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}var it=typeof Uint8Array.fromBase64==`function`,at=typeof process==`object`&&((et=process.versions)==null?void 0:et.node)!==void 0,ot=it?tt:at?nt:rt;function st(e,t){if(!t)return e;let n={};for(let i of Object.keys(e)){var r;n[i]=(r=t[i])==null?e[i]:r}return n}var ct=Object.freeze({kind:`not-plain`}),lt=Object.freeze({kind:`symbol-keys`});Object.freeze({identify:e=>e,typeOf:e=>e===null?`null`:typeof e,toPrimitive:e=>e,tagOf:e=>qe(e),isThenable:e=>typeof e.then==`function`,toPromise:e=>Promise.resolve(e),unbox:e=>e.valueOf(),toISOString:e=>isNaN(e.getDate())?``:e.toISOString(),toStringValue:e=>e.toString(),regExpInfo:e=>({source:e.source,flags:e.flags}),valuesOf:e=>e,entriesOf:e=>e,viewInfo:e=>({buffer:e.buffer,byteOffset:e.byteOffset,byteLength:e.byteLength,length:e.length,bufferByteLength:e.buffer.byteLength}),toArrayBuffer:e=>e,lengthOf:e=>e.length,hasOwn:(e,t)=>Object.hasOwn(e,t),indicesOf:e=>$e(e),shapeOf:e=>Ke(e)?Je(e).length>0?lt:{kind:Object.getPrototypeOf(e)===null?`null-proto`:`plain`,keys:Object.keys(e)}:ct,get:(e,t)=>e[t]});var ut=Object.freeze({fromPrimitive:e=>e,fromISOString:e=>new Date(e),fromStringValue:(e,t)=>
2e===`URL`?new URL(t):e===`URLSearchParams`?new URLSearchParams(t):Temporal[e.slice(9)].from(t),fromArrayBuffer:e=>e,fromRegExpInfo:(e,t)=>new RegExp(e,t),fromViewInfo:(e,t,n,r)=>{let i=globalThis[e];return n===void 0?new i(t):new i(t,n,r)},box:e=>Object(e),createArray:e=>Array(e),createSparseArray:e=>{let t=[];return t[We]=void 0,delete t[We],t.length=e,t},createObject:()=>({}),createNullPrototypeObject:()=>Object.create(null),createSet:()=>new Set,createMap:()=>new Map,set:(e,t,n)=>{e[t]=n},addValue:(e,t)=>{e.add(t)},addEntry:(e,t,n)=>{e.set(t,n)}});function dt(e,t,n){return ft(JSON.parse(e),t,n)}function ft(e,t,n){let r=st(ut,n==null?void 0:n.operations);if(typeof e==`number`)return s(e,!0);if(!Array.isArray(e)||e.length===0)throw Error(`Invalid input`);let i=e,a=Array(i.length),o=null;function s(e,n=!1){if(e===-1)return r.fromPrimitive(void 0);if(e===-3)return r.fromPrimitive(NaN);if(e===-4)return r.fromPrimitive(1/0);if(e===-5)return r.fromPrimitive(-1/0);if(e===-6)return r.fromPrimitive(-0);if(n||typeof e!=`number`)throw Error(`Invalid input`);if(e in a)return a[e];if(e>=i.length)throw Error(`Invalid input`);let c=i[e];if(!c||typeof c!=`object`)a[e]=r.fromPrimitive(c);else if(Array.isArray(c)){if(typeof c[0]==`string`){let n=c[0],l=t&&Object.hasOwn(t,n)?t[n]:void 0;if(l){let t=c[1];if(typeof t!=`number`&&(t=i.push(c[1])-1),Object.hasOwn(a,t))return a[e]=l(a[t]);if(o!=null||(o=new Set),o.has(t))throw Error(`Invalid circular reference`);return o.add(t),a[e]=l(s(t)),o.delete(t),a[e]}switch(n){case`Date`:a[e]=r.fromISOString(c[1]);break;case`Set`:let t=r.createSet();a[e]=t;for(let e=1;e<c.length;e+=1)r.addValue(t,s(c[e]));break;case`Map`:let o=r.createMap();a[e]=o;for(let e=1;e<c.length;e+=2)r.addEntry(o,s(c[e]),s(c[e+1]));break;case`RegExp`:a[e]=r.fromRegExpInfo(c[1],c[2]);break;case`Object`:{let t=c[1];if(typeof i[t]==`object`&&i[t][0]!==`BigInt`)throw Error(`Invalid input`);a[e]=r.box(s(t));break}case`BigInt`:a[e]=r.fromPrimitive(BigInt(c[1]));break;case`null`:let l=r.createNullPrototypeObject();a[e]=l;for(let e=1;e<c.length;e+=2){if(c[e]===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(l,c[e],s(c[e+1]))}break;case`Int8Array`:case`Uint8Array`:case`Uint8ClampedArray`:case`Int16Array`:case`Uint16Array`:case`Float16Array`:case`Int32Array`:case`Uint32Array`:case`Float32Array`:case`Float64Array`:case`BigInt64Array`:case`BigUint64Array`:case`DataView`:{if(i[c[1]][0]!==`ArrayBuffer`)throw Error(`Invalid data`);let t=s(c[1]);a[e]=r.fromViewInfo(n,t,c[2],c[3]);break}case`ArrayBuffer`:{let t=c[1];if(typeof t!=`string`)throw Error(`Invalid ArrayBuffer encoding`);a[e]=r.fromArrayBuffer(ot(t));break}case`URL`:case`URLSearchParams`:case`Temporal.Duration`:case`Temporal.Instant`:case`Temporal.PlainDate`:case`Temporal.PlainTime`:case`Temporal.PlainDateTime`:case`Temporal.PlainMonthDay`:case`Temporal.PlainYearMonth`:case`Temporal.ZonedDateTime`:a[e]=r.fromStringValue(n,c[1]);break;default:throw Error(`Unknown type ${n}`)}}else if(c[0]===-7){let t=c[1];if(!Xe(t))throw Error(`Invalid input`);let n=r.createSparseArray(t);a[e]=n;for(let e=2;e<c.length;e+=2){let i=c[e];if(!Ye(i)||i>=t)throw Error(`Invalid input`);r.set(n,i,s(c[e+1]))}}else{let t=r.createArray(c.length);a[e]=t;for(let e=0;e<c.length;e+=1){let n=c[e];n!==-2&&r.set(t,e,s(n))}}}else{let t=r.createObject();a[e]=t;for(let e of Object.keys(c)){if(e===`__proto__`)throw Error("Cannot parse an object with a `__proto__` property");r.set(t,e,s(c[e]))}}return a[e]}return s(0)}async function pt(e,t={}){return null}async function mt(e,t){return null}function ht(e){return new URL(e,`http://localhost`).pathname}function gt(e){return!!He({path:ht(e)}).payload}var _t=null;async function vt(){var e;if(_t)return _t;let t=document.getElementById(`__NUXT_DATA__`);if(!t)return{};let n=await yt(t.textContent||``),r=t.dataset.src?await mt(t.dataset.src,n.prerenderedAt?`force-cache`:`no-cache`):void 0;return _t={...n,...r,...window.__NUXT__},(e=_t.config)!=null&&e.public&&(_t.config.public=d(_t.config.public)),_t}async function yt(e){return await dt(e,a()._payloadRevivers)}function bt(e,t){}function xt(e,t){a()._payloadRevivers[e]=t}function St(e){let t=e.length,n=0,r=0,i=8997,a=0,o=33826,s=0,c=40164,l=0,u=52210;for(;n<t;)i^=e.charCodeAt(n++),r=i*435,a=o*435,s=c*435,l=u*435,s+=i<<8,l+=o<<8,a+=r>>>16,i=r&65535,s+=a>>>16,o=a&65535,u=l+(s>>>16)&65535,c=s&65535;return{high:(u<<16|c)>>>0,low:(o<<16|i)>>>0}}function Ct(e){let{high:t,low:n}=St(e);return BigInt(t)<<32n|BigInt(n)}var wt=`0123456789abcdef`;Array.from({length:256},(e,t)=>wt.charAt(t>>4)+wt.charAt(t&15));function Tt(e){return Ct(e).toString(36)}function Et(e,t){if(e===null)return`L`;let n,r=0,i=e,a=typeof e;if(a!==`object`)return a===`number`?e-e===0?`n`+e:`L`:a===`string`?`s`+e:a===`bigint`?`n`+e:a===`boolean`?e?`T`:`F`:void 0;let o=Array.isArray(e);if(!o){if(e instanceof Date)return`d`+ +e;if(e instanceof RegExp)return`r`+e.source+e.flags}
2if(a=t.indexOf(e),~a)return`~`+(a+1);if(typeof e.toJSON==`function`&&!ArrayBuffer.isView(e)){if(e=e.toJSON(),typeof e!=`object`||!e)return Et(e,t);if(a=t.indexOf(e),~a)return`~`+(a+1);o=Array.isArray(e)}if(t.push(i),o)for(n=`a`;r<e.length;n+=(a=Et(e[r++],t))===void 0?`L`:a);else if(e instanceof Set){n=`e`;for(let r of e)n+=(a=Et(r,t))===void 0?`L`:a}else if(e instanceof Map)for(i=[...e.keys()],i.length>1&&i.sort(),n=`o`;r<i.length;r++)(a=Et(e.get(i[r]),t))!==void 0&&(n+=i[r]+a);else if(e[Symbol.toStringTag]===void 0||ArrayBuffer.isView(e))for(i=Object.keys(e),i.length>1&&i.sort(),n=`o`;r<i.length;r++)(a=Et(e[i[r]],t))!==void 0&&(n+=i[r]+a);else throw Error(`Unsupported value`);return t.pop(),n}function Dt(e){var t;return(t=Et(e,[]))==null?`U`:t}function Ot(e){return Tt(Dt(e))}var kt=`$s`;function At(...e){var t;let n=typeof e[e.length-1]==`string`?e.pop():void 0;typeof e[0]!=`string`&&e.unshift(n);let[r,i]=e;if(!r||typeof r!=`string`)throw Me.NUXT_E7009({key:r});if(i!==void 0&&typeof i!=`function`)throw Me.NUXT_E7007({type:typeof i});let o=kt+r,s=a(),c=x(s.payload.state,o);if(i&&((t=s._state)[o]!=null||(t[o]={_default:i})),c.value===void 0&&i){let e=i();if(he(e))return s.payload.state[o]=e,e;c.value=e}return c}var jt=ye,Mt=[`method`,`baseURL`,`query`,`params`,`body`,`headers`];function Nt(e){var t;let n=[((t=h(e.method))==null?void 0:t.toUpperCase())||`GET`,h(e.baseURL)];for(let t of[e.query||e.params]){let e=h(t);if(!e)continue;let r={};for(let[t,n]of Object.entries(e))r[h(t)]=h(n);n.push(r)}if(e.body){let t=h(e.body);if(!t)n.push(Ot(t));else if(t instanceof ArrayBuffer)n.push(Ot(Object.fromEntries([...new Uint8Array(t).entries()].map(([e,t])=>[e,t.toString()]))));else if(t instanceof FormData){let e=[];for(let n of t.entries()){let[t,r]=n;e.push([t,r instanceof File?`${r.name}:${r.size}:${r.lastModified}`:r])}n.push(Ot(e))}else if(l(t))n.push(Ot(d(t)));else try{n.push(Ot(t))}catch{De.NUXT_E3002({cause:t})}}return n}var Pt=Oe({name:`createUseFetch`,factory(e={}){function t(t,n,r){let[a={},o]=typeof n==`string`?[{},n]:[n,r],s=typeof e==`function`?e(a):e,{server:c,lazy:l,default:u,transform:f,pick:p,watch:m,immediate:g,getCachedData:_,deep:v,dedupe:y,timeout:b,enabled:x,...S}={...typeof e==`function`?{}:s,...a,...typeof e==`function`?s:{}},C=me(()=>h(t)),w=me(()=>h(S.key)||`$f`+Ot([o,typeof C.value==`string`?C.value:``,...Nt(S)]));if(!S.baseURL&&typeof C.value==`string`&&C.value[0]===`/`&&C.value[1]===`/`)throw De.NUXT_E3001({url:C.value});let T=d({...i,...S,cache:typeof S.cache==`boolean`?void 0:S.cache}),E={server:c,lazy:l,default:u,transform:f,pick:p,immediate:g,getCachedData:_,deep:v,dedupe:y,timeout:b,enabled:x,watch:m===!1?[]:[...m||[],T]};return m===!1&&(E._keyTriggersExecute=!1),Te(w,(e,{signal:t})=>{let n=S.$fetch||jt,r={signal:t,...T};for(let e of Mt)typeof r[e]==`function`&&(r[e]=h(r[e]));return n(C.value,r)},E)}return t}}),Ft=Pt.__nuxt_factory();Pt.__nuxt_factory({lazy:!0,_functionName:`useLazyFetch`}),globalThis.cookieStore;function It(e){return new URL(globalThis.location.href)}var Lt=Ie;function Rt(e,t){var n,r,i,a;return(n=(r=(i=S(t))==null?e==null?void 0:e.meta.layout:i)==null?Lt((a=e==null?void 0:e.path)==null?`/`:a).appLayout:r)==null?`default`:n}var zt={props:{code:null},mounted(){}},Bt={class:`bg-black p-4 text-green-500 rounded-lg lg:rounded-2xl`,"data-block":`code`},Vt=[`textContent`];function Ht(e,t,n,r,i,a){return s(),y(`div`,Bt,[C(`code`,{textContent:T(n.code)},null,8,Vt)])}var Ut=Object.assign(A(zt,[[`render`,Ht]]),{__name:`ElementCode`}),Wt={props:{text:String},computed:{parsedText:function(){let e=this.text;return e=e.replace(/href="(?!\/)((?!http)(?!mailto)(?!tel)[a-z/A-Z1-9-/?=$-_.+!*'()]*)"/g,`href="/$1"`),e}}},Gt=[`innerHTML`];function Kt(e,t,n,r,i,a){return s(),y(`div`,{"data-block":`text`,innerHTML:a.parsedText},null,8,Gt)}var qt=Object.assign(A(Wt,[[`render`,Kt],[`__scopeId`,`data-v-e0ff116e`]]),{__name:`ElementText`}),Jt={props:{data:null},mounted(){}},Yt={"data-block":`quote`},Xt={class:`w-9 text-primary mb-4`},Zt={class:`text-3.5xl text-text-brand font-bold font-heading pb-4 !mb-4 border-b`},Qt={class:`text-base font-heading !mb-0`};function $t(e,t,n,r,i,a){let o=ke;return s(),y(`div`,Yt,[C(`div`,Xt,[v(o)]),C(`p`,Zt,`â`+T(n.data.body)+`â`,1),C(`p`,Qt,T(n.data.author),1)])}var en=Object.assign(A(Jt,[[`render`,$t]]),{__name:`ElementQuote`}),tn={props:{data:null},mounted(){}},nn={class:`bg-surface-bg-variant shadow-lg p-6 rounded-lg lg:rou
2nded-2xl`,"data-block":`resource`},rn=[`href`],an={class:`font-bold font-heading text-text-primary-`},on={class:`bg-surface-bg w-[36px] h-[36px] rounded-full p-[10px]`};function sn(e,t,n,r,i,a){let o=Ae;return s(),y(`div`,nn,[t[0]||(t[0]=C(`h3`,{class:`mb-4 text-lg text-text-brand font-bold`},`Lees meer`,-1)),C(`a`,{href:n.data.url,class:`flex flex-row justify-between items-center flex-wrap gap-4 bg-surface-tone/10 hover:bg-surface-tone/25 !text-text-primary p-4 rounded-lg lg:rounded-2xl !no-underline`},[C(`div`,an,T(n.data.body),1),C(`div`,on,[v(o)])],8,rn)])}var cn=Object.assign(A(tn,[[`render`,sn]]),{__name:`ElementResource`}),ln={name:`VideoPlayer`,props:{poster:String,source:String,autoplay:Boolean,customOptions:Object,prerolls:{type:Boolean,default:!0},duration:Number},data(){return{player:null,videojs:null,adData:{}}},computed:{isAudio(){var e;return!!((e=this.source)!=null&&e.endsWith(`.mp3`))}},async mounted(){{let e=(await Ce(async()=>{let{default:e}=await import(`./k2lYeLkD.js`);return{default:e}},__vite__mapDeps([0,1]),import.meta.url)).default;await Ce(()=>import(`./CUZWrv2X.js`),__vite__mapDeps([2,1,0]),import.meta.url),this.videojs=e;let t={fluid:!0,bigPlayButton:!0,DurationDisplay:!0,poster:this.poster,autoplay:!1,controls:!0,sources:[{src:this.source}]};if(t={...t,...this.customOptions},this.prerolls&&!this.isAudio){let n=await this.$engine.getRandomPreRollForArticles(void 0,void 0,this.duration);if(n&&(this.adData={id:n.id,title:n.title,url:n.url}),n){this.player=e(this.$refs.videoPlayer,t,()=>{}),this.player.debug(!0),this.player.on(`vast.play`,e=>{var t;(t=window.dataLayer)==null||t.push({event:`preroll_view`,data:this.adData})}),this.player.on(`vast.click`,()=>{var e;(e=window.dataLayer)==null||e.push({event:`preroll_click`,data:this.adData})}),this.player.vast({vastUrl:n.generatedXmlUrl});return}}this.player=e(this.$refs.videoPlayer,t,()=>{})}},beforeDestroy(){this.player&&this.player.dispose()}},un={class:`relative`},dn=[`poster`,`autoplay`],fn=[`autoplay`];function pn(e,t,n,r,i,a){let o=k(`not-lazy`);return s(),y(`div`,un,[a.isAudio?pe((s(),y(`audio`,{key:1,ref:`videoPlayer`,class:`video-js`,playsinline:``,autoplay:n.autoplay},null,8,fn)),[[o]]):pe((s(),y(`video`,{key:0,ref:`videoPlayer`,poster:this.poster,class:`video-js`,playsinline:``,autoplay:n.autoplay},null,8,dn)),[[o]])])}var mn=Object.assign(A(ln,[[`render`,pn]]),{__name:`PlayerVideo`}),hn={name:`AudioPlayer`,props:{url:String,autoplay:Boolean},data(){return{player:void 0,videojs:null}},async mounted(){{let e=(await Ce(async()=>{let{default:e}=await import(`./k2lYeLkD.js`);return{default:e}},__vite__mapDeps([0,1]),import.meta.url)).default;this.videojs=e,this.player=e(this.$refs.audioPlayer)}},beforeUnmount(){this.player&&this.player.dispose()}},gn=[`autoplay`],_n=[`data-src`];function vn(e,t,n,r,i,a){let o=k(`not-lazy`);return s(),y(`div`,null,[pe((s(),y(`audio`,{ref:`audioPlayer`,class:`w-full video-js`,controls:``,playsinline:``,autoplay:n.autoplay},[C(`source`,{"data-src":n.url},null,8,_n)],8,gn)),[[o]])])}var yn=Object.assign(A(hn,[[`render`,vn]]),{__name:`PlayerAudio`}),bn={},xn={class:`errorMsg`};function Sn(e,t){return s(),y(`div`,xn,[ue(e.$slots,`default`,{},void 0,!0)])}var Cn=Object.assign(A(bn,[[`render`,Sn],[`__scopeId`,`data-v-1b07a998`]]),{__name:`ErrorContainer`}),wn={"data-block":`asset`},Tn={key:1,class:`-mx-4 lg:mx-0`},En={key:0,class:`px-4 lg:px-0 flex flex-col justify-end text-right gap-2 md:flex-row md:justify-between md:items-center text-sm border-b border-border-primary py-4 text-text-light font-medium`},Dn={key:0,class:`ml-auto md:ml-0 flex flex-row gap-2 items-center`},On={class:`w-4`},kn={key:1,class:`ml-auto`},An=[`href`],jn=Object.assign(b({__name:`Single`,props:{items:{},blockPrerolls:{type:Boolean}},setup(e){return console.log(e.items[0]),(t,n)=>{let r=mn,i=be,a=je,o=yn,c=Cn;return s(),y(`div`,wn,[(s(!0),y(ge,null,oe(e.items,(t,l)=>{var d,p;return s(),y(ge,{key:l},[t.type.preprName===`Video`&&t.url?(s(),f(r,{key:0,poster:(d=t.cover)==null?``:d,source:t.url,prerolls:!e.blockPrerolls},null,8,[`poster`,`source`,`prerolls`])):t.type.preprName===`Photo`&&t.url?(s(),y(`div`,Tn,[v(i,{class:`mx-auto lg:rounded-2xl`,alt:(p=t.description)==null?t.name:p,src:t.url},null,8,[`alt`,`src`]),t.author||t.description?(s(),y(`div`,En,[t.author?(s(),y(`div`,Dn,[C(`div`,On,[v(a)]),C(`div`,null,T(t.author),1)])):u(``,!0),t.description?(s(),y(`div`,kn,T(t.description),1)):u(``,!0)])):u(``,!0)])):t.type.preprName===`Audio`&&t.url?(s(),f(o,{key:2,url:t.url},null,8,[`url`])):t.type.preprName===`Document`&&t.url?(s(),y(`a`,{key:3,href:t.url,target:`_blank`},`Download `+T(t.name),9,An)):(s(),f(c,{key:4},{default:D(()=>[n[1]||(n[1]=C(`p`,null,`Asset UI not implemented!`,-1)),C(`p`,null,[n[0]||(n[0]=C(`b`,null,`Asset type:`,-1)),re(` `+T(t.type.preprName||`Unknown`),1)])]),_:2},1024))],64)}),128))])}}}),{__name:`ElementAssetSingle`}),Mn={data(){return{modules:[ae,le,O,te,fe]}},setup(){let e=ie(null);return{metaSwiper:e,setMetaSwiper:t=>{e.value=t}}},props:{items:Array,blockPrerolls:Boolean}},Nn={class:`relative article-slider`,"data-block":`asset`},Pn={class:`h-full flex flex-col`},Fn={class:`overflow-hidden my-auto`},In={key:0,class:`px-4 lg:px-0 flex flex-col justify-end text-right mt-auto gap-2 md:flex-row md:justify-between md:items-center text-sm border-b border-border-primary py-4 text-text-light font-medium`},Ln={key:0,class:`ml-auto md:ml-0 flex flex-row gap-2 items-center`},Rn={class:`w-4`},zn={key:1,class:`ml-auto`};function Bn(e,t,n,r,i,a){let o=mn,c=be,l=je,d=Cn,p=de,m=se;return s(),y(`div`,Nn,[v(m,{modules:i.modules,loop:!0,autoplay:!0,"slides-per-view":1,"space-between":16,effect:`fade`,navigation:!0,pagination:{enabled:!0,clickable:!0},controller:{control:r.metaSwiper}},{default:D(()=>[(s(!0),y(ge,null,oe(n.items,(e,r)=>(s(),f(p,{class:`!h-auto`,key:r},{default:D(()=>{var r;return[C(`div`,Pn,[e.type.preprName===`Video`?(s(),f(o,{key:0,poster:e.cover,source:e.url,prerolls:!n.blockPrerolls},null,8,[`poster`,`source`,`prerolls`])):e.type.preprName===`Photo`?(s(),y(ge,{key:1}
2,[C(`div`,Fn,[v(c,{class:`my-auto w-full rounded-lg lg:rounded-2xl`,alt:(r=e.description)==null?e.name:r,src:e.url,"data-not-lazy":``},null,8,[`alt`,`src`])]),e.author||e.description?(s(),y(`div`,In,[e.author?(s(),y(`div`,Ln,[C(`div`,Rn,[v(l)]),C(`div`,null,T(e.author),1)])):u(``,!0),e.description?(s(),y(`div`,zn,T(e.description),1)):u(``,!0)])):u(``,!0)],64)):(s(),f(d,{key:2},{default:D(()=>[t[1]||(t[1]=C(`p`,null,`Asset UI not implemented!`,-1)),C(`p`,null,[t[0]||(t[0]=C(`b`,null,`Asset type:`,-1)),re(` `+T(e.type.preprName||`Unknown`),1)])]),_:2},1024))])]}),_:2},1024))),128))]),_:1},8,[`modules`,`controller`]),t[2]||(t[2]=C(`div`,{class:`swiper-pagination !text-white`},null,-1))])}var Vn=Object.assign(A(Mn,[[`render`,Bn]]),{__name:`ElementAssetSlider`}),Hn={props:{data:null},computed:{layout:function(){var e;if((e=this.data)!=null&&(e=e.layout)!=null&&e.name){var t;return(t=this.data)==null||(t=t.layout)==null?void 0:t.name}return`LIGHT`}},mounted(){}},Un={class:`flex flex-row justify-between`},Wn={class:`flex flex-col gap-2`},Gn={class:`text-3.5xl font-bold`},Kn=[`innerHTML`],qn={key:0,class:`max-w-[232px]`};function Jn(e,t,n,r,i,a){var o;let c=be;return n.data?(s(),y(`div`,{key:0,class:w([`p-8 rounded-lg lg:rounded-2xl`,a.layout]),"data-block":`highlight`},[C(`div`,Un,[C(`div`,Wn,[C(`h3`,Gn,T(n.data.title),1),C(`div`,{innerHTML:n.data.content},null,8,Kn)]),n.data.image?(s(),y(`div`,qn,[v(c,{alt:(o=n.data.image.description)==null?n.data.image.name:o,src:n.data.image.url},null,8,[`alt`,`src`])])):u(``,!0)])],2)):u(``,!0)}var Yn=Object.assign(A(Hn,[[`render`,Jn],[`__scopeId`,`data-v-0e20aff5`]]),{__name:`ElementHighlight`}),Xn={props:{data:null},mounted(){window.instgrm!==void 0&&window.instgrm.Embeds.process()}},Zn={class:`mb-8`},Qn=[`data-instgrm-permalink`],$n={style:{padding:`16px`}},er=[`href`];function tr(e,t,n,r,i,a){return s(),y(`div`,Zn,[C(`blockquote`,{class:`instagram-media`,"data-instgrm-captioned":``,"data-instgrm-permalink":n.data.url,"data-instgrm-version":`14`,style:{background:`#FFF`,border:`0`,"border-radius":`3px`,"box-shadow":`0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15)`,margin:`1px`,"max-width":`540px`,"min-width":`326px`,padding:`0`,width:`calc(100% - 2px)`}},[C(`div`,$n,[C(`a`,{href:n.data.url,style:{background:`#FFFFFF`,"line-height":`0`,padding:`0 0`,"text-align":`center`,"text-decoration":`none`,width:`100%`},target:`_blank`},[...t[0]||(t[0]=[c(`<div style="display:flex;flex-direction:row;align-items:center;"><div style="background-color:#F4F4F4;border-radius:50%;flex-grow:0;height:40px;margin-right:14px;width:40px;"></div><div style="display:flex;flex-direction:column;flex-grow:1;justify-content:center;"><div style="background-color:#F4F4F4;border-radius:4px;flex-grow:0;height:14px;margin-bottom:6px;width:100px;"></div><div style="background-color:#F4F4F4;border-radius:4px;flex-grow:0;height:14px;width:60px;"></div></div></div><div style="padding:19% 0;"></div><div style="display:block;height:50px;margin:0 auto 12px;width:50px;"><svg width="50px" height="50px" viewBox="0 0 60 60" version="1.1" xmlns="https://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink"><g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g transform="translate(-511.000000, -20.000000)" fill="#000000"><g><path d="M556.869,30.41 C554.814,30.41 553.148,32.076 553.148,34.131 C553.148,36.186 554.814,37.852 556.869,37.852 C558.924,37.852 560.59,36.186 560.59,34.131 C560.59,32.076 558.924,30.41 556.869,30.41 M541,60.657 C535.114,60.657 530.342,55.887 530.342,50 C530.342,44.114 535.114,39.342 541,39.342 C546.887,39.342 551.658,44.114 551.658,50 C551.658,55.887 546.887,60.657 541,60.657 M541,33.886 C532.1,33.886 524.886,41.1 524.886,50 C524.886,58.899 532.1,66.113 541,66.113 C549.9,66.113 557.115,58.899 557.115,50 C557.115,41.1 549.9,33.886 541,33.886 M565.378,62.101 C565.244,65.022 564.756,66.606 564.346,67.663 C563.803,69.06 563.154,70.057 562.106,71.106 C561.058,72.155 560.06,72.803 558.662,73.347 C557.607,73.757 556.021,74.244 553.102,74.378 C549.944,74.521 548.997,74.552 541,74.552 C533.003,74.552 532.056,74.521 528.898,74.378 C525.979,74.244 524.393,73.757 523.338,73.347 C521.94,72.803 520.942,72.155 519.894,71.106 C518.846,70.057 518.197,69.06 517.654,67.663 C517.244,66.606 516.755,65.022 516.623,62.101 C516.479,58.943 516.448,57.996 516.448,50 C516.448,42.003 516.479,41.056 516.623,37.899 C516.755,34.978 517.244,33.391 517.654,32.338 C518.197,30.938 518.846,29.942 519.894,28.894 C520.942,27.846 521.94,27.196 523.338,26.654 C524.393,26.244 525.979,25.756 528.898,25.623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 5
250.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.743 570.674,65.562 570.82,62.369 C570.966,59.17 571,58.147 571,50 C571,41.851 570.966,40.831 570.82,37.631"></path></g></g></g></svg></div><div style="padding-top:8px;"><div style="color:#3897f0;font-family:Arial,sans-serif;font-size:14px;font-style:normal;font-weight:550;line-height:18px;"> Dit bericht op Instagram bekijken </div></div><div style="padding:12.5% 0;"></div><div style="display:flex;flex-direction:row;margin-bottom:14px;align-items:center;"><div><div style="background-color:#F4F4F4;border-radius:50%;height:12.5px;width:12.5px;transform:translateX(0px) translateY(7px);"></div><div style="background-color:#F4F4F4;height:12.5px;transform:rotate(-45deg) translateX(3px) translateY(1px);width:12.5px;flex-grow:0;margin-right:14px;margin-left:2px;"></div><div style="background-color:#F4F4F4;border-radius:50%;height:12.5px;width:12.5px;transform:translateX(9px) translateY(-18px);"></div></div><div style="margin-left:8px;"><div style="background-color:#F4F4F4;border-radius:50%;flex-grow:0;height:20px;width:20px;"></div><div style="width:0;height:0;border-top:2px solid transparent;border-left:6px solid #f4f4f4;border-bottom:2px solid transparent;transform:translateX(16px) translateY(-4px) rotate(30deg);"></div></div><div style="margin-left:auto;"><div style="width:0px;border-top:8px solid #F4F4F4;border-right:8px solid transparent;transform:translateY(16px);"></div><div style="background-color:#F4F4F4;flex-grow:0;height:12px;width:16px;transform:translateY(-4px);"></div><div style="width:0;height:0;border-top:8px solid #F4F4F4;border-left:8px solid transparent;transform:translateY(-4px) translateX(8px);"></div></div></div><div style="display:flex;flex-direction:column;flex-grow:1;justify-content:center;margin-bottom:24px;"><div style="background-color:#F4F4F4;border-radius:4px;flex-grow:0;height:14px;margin-bottom:6px;width:224px;"></div><div style="background-color:#F4F4F4;border-radius:4px;flex-grow:0;height:14px;width:144px;"></div></div>`,7)])],8,er)])],8,Qn)])}var nr=Object.assign(A(Xn,[[`render`,tr]]),{__name:`ElementInstagramPost`}),rr={props:{data:null},mixins:[we],computed:{dynamicClasses(){if(this.mode==`dark`)return`dark`}},mounted(){typeof FB<`u`&&FB.XFBML.parse()}},ir=[`data-href`];function ar(e,t,n,r,i,a){return s(),y(`div`,{class:w([`fb-post mb-8`,a.dynamicClasses]),"data-href":n.data.url,"data-width":`500`,"data-show-text":`true`},null,10,ir)}var or=Object.assign(A(rr,[[`render`,ar],[`__scopeId`,`data-v-c3371ffe`]]),{__name:`ElementFacebookPost`});function sr(e){return e?Object.entries(e).reduce((e,[t,n])=>(t=t.charAt(0).toUpperCase()+t.slice(1),t=`on${t}`,{...e,[t]:n}),{}):null}function cr(e,t={},n){let{props:r,domProps:i,on:a,attrs:o,...s}=t,c=sr(a),l={...s,...r,...i,...c,...o};return _(e,l,n)}var lr=cr;function ur(e,t){var n;if(e===null)throw Error(`iframe element not instantiated.`);(n=e.contentWindow)==null||n.postMessage(`{"event":"command","func":"${t}","args":""}`,`*`)}function dr(e){return lr(`link`,{attrs:{rel:`preconnect`,href:e}})}var fr={props:{data:null},components:{LiteYouTubeEmbed:b({props:{announce:{type:String,required:!1,default:`Watch`},id:{type:String,required:!0},title:{type:String,required:!0},activatedClass:{type:String,required:!1,default:`lyt-activated`},adNetwork:{type:Boolean,required:!1,default:!0},iframeClass:{type:String,required:!1,default:``},cookie:{type:Boolean,required:!1,default:!1},params:{type:String,required:!1,default:``},playerClass:{type:String,required:!1,default:`lty-playbtn`},playlist:{type:Boolean,required:!1,default:!1},playlistCoverId:{type:String,required:!1,default:``},poster:{type:String,required:!1,default:`hqdefault`},wrapperClass:{type:String,required:!1,default:`yt-lite`},muted:{type:Boolean,required:!1,default:!1},thumbnail:{type:String,required:!1},webp:{type:Boolean,required:!1,default:!1},rel:{type:String,required:!1,default:`preload`},aspectHeight:{type:Number,required:!1,default:9},aspectWidth:{type:Number,required:!1,default:16}},emits:[`iframeAdded`],setup(e,{emit:t,expose:n}){let r=ie(!1),i=ie(!1),a=ie(null),o=me(()=>encodeURIComponent(e.id)),s=me(()=>`&${e.params}
2`||``),c=me(()=>e.muted?`&mute=1`:``),l=me(()=>e.webp?`webp`:`jpg`),u=me(()=>e.webp?`vi_webp`:`vi`),d=me(()=>typeof e.playlistCoverId==`string`?encodeURIComponent(e.playlistCoverId):null),f=me(()=>e.thumbnail||(e.playlist?`https://i.ytimg.com/${u.value}/${d.value}/${e.poster}.${l.value}`:`https://i.ytimg.com/${u.value}/${o.value}/${e.poster}.${l.value}`)),p=me(()=>e.cookie?`https://www.youtube.com`:`https://www.youtube-nocookie.com`),m=me(()=>e.playlist?`${p.value}/embed/videoseries?autoplay=1&enablejsapi=1&list=${o.value}${c.value}${s.value}`:`${p.value}/embed/${o.value}?autoplay=1&enablejsapi=1&state=1${c.value}${s.value}`);function h(){i.value||(i.value=!0,t(`iframeAdded`))}function g(){r.value||(r.value=!0)}n({getPlayerInstance(){return a.value},stopVideo(){ur(a.value,`stopVideo`)},pauseVideo(){ur(a.value,`pauseVideo`)},playVideo(){ur(a.value,`playVideo`)},warmConnections:g,addIframe:h});let _=()=>[lr(`link`,{attrs:{rel:e.rel,href:f.value,as:`image`}}),r.value?dr(p.value):null,r.value?dr(`https://www.google.com`):null,e.adNetwork?dr(`https://static.doubleclick.net`):null,e.adNetwork?dr(`https://googleads.g.doubleclick.net`):null,lr(`article`,{on:{pointerover:g,click:h},class:`${e.wrapperClass} ${i.value?e.activatedClass:``}`,attrs:{"data-title":e.title},style:{backgroundImage:`url(${f.value})`,"--aspect-ratio":`${e.aspectHeight/e.aspectWidth*100}%`}},[lr(`button`,{class:e.playerClass,attrs:{type:`button`,"aria-label":`${e.announce} ${e.title}`}}),i.value?lr(`iframe`,{ref:a,class:e.iframeClass,attrs:{title:e.title,referrerpolicy:`strict-origin-when-cross-origin`,width:560,height:315,frameborder:0,allow:`accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture`,allowfullscreen:!0,src:m.value}}):null])];return()=>_()}})},computed:{youtubeId:function(){let e=new URL(this.data.url);if(e.href.includes(`youtu.be`))return e.pathname.split(`/`)[1];if(e.href.includes(`/watch`))return e.searchParams.get(`v`)}},mounted(){}},pr={"data-block":`youtube`};function mr(e,t,n,r,i,a){let o=ne(`LiteYouTubeEmbed`);return s(),y(`div`,pr,[v(o,{id:a.youtubeId,title:n.data.url},null,8,[`id`,`title`])])}var hr=Object.assign(A(fr,[[`render`,mr]]),{__name:`ElementYoutubePost`});function gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?gr(Object(n),!0).forEach(function(t){wr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function vr(){vr=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r=Object.defineProperty||function(e,t,n){e[t]=n.value},i=typeof Symbol==`function`?Symbol:{},a=i.iterator||`@@iterator`,o=i.asyncIterator||`@@asyncIterator`,s=i.toStringTag||`@@toStringTag`;function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},``)}catch{c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var a=t&&t.prototype instanceof f?t:f,o=Object.create(a.prototype);return r(o,`_invoke`,{value:x(e,n,new T(i||[]))}),o}function u(e,t,n){try{return{type:`normal`,arg:e.call(t,n)}}catch(e){return{type:`throw`,arg:e}}}e.wrap=l;var d={};function f(){}function p(){}function m(){}var h={};c(h,a,function(){return this});var g=Object.getPrototypeOf,_=g&&g(g(E([])));_&&_!==t&&n.call(_,a)&&(h=_);var v=m.prototype=f.prototype=Object.create(h);function y(e){[`next`,`throw`,`return`].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function b(e,t){function i(r,a,o,s){var c=u(e[r],e,a);if(c.type!==`throw`){var l=c.arg,d=l.value;return d&&typeof d==`object`&&n.call(d,`__await`)?t.resolve(d.__await).then(function(e){i(`next`,e,o,s)},function(e){i(`throw`,e,o,s)}):t.resolve(d).then(function(e){l.value=e,o(l)},function(e){return i(`throw`,e,o,s)})}s(c.arg)}var a;r(this,`_invoke`,{value:function(e,n){function r(){return new t(function(t,r){i(e,n,t,r)})}return a=a?a.then(r,r):r()}})}function x(e,t,n){var r=`suspendedStart`;return function(i,a){if(r===`executing`)throw Error(`Generator is already running`);if(r===`completed`){if(i===`throw`)throw a;return D()}
vendor: 4,483 bytes, line 2
2for(n.method=i,n.arg=a;;){var o=n.delegate;if(o){var s=S(o,n);if(s){if(s===d)continue;return s}}if(n.method===`next`)n.sent=n._sent=n.arg;else if(n.method===`throw`){if(r===`suspendedStart`)throw r=`completed`,n.arg;n.dispatchException(n.arg)}else n.method===`return`&&n.abrupt(`return`,n.arg);r=`executing`;var c=u(e,t,n);if(c.type===`normal`){if(r=n.done?`completed`:`suspendedYield`,c.arg===d)continue;return{value:c.arg,done:n.done}}c.type===`throw`&&(r=`completed`,n.method=`throw`,n.arg=c.arg)}}}function S(e,t){var n=t.method,r=e.iterator[n];if(r===void 0)return t.delegate=null,n===`throw`&&e.iterator.return&&(t.method=`return`,t.arg=void 0,S(e,t),t.method===`throw`)||n!==`return`&&(t.method=`throw`,t.arg=TypeError(`The iterator does not provide a '`+n+`' method`)),d;var i=u(r,e.iterator,t.arg);if(i.type===`throw`)return t.method=`throw`,t.arg=i.arg,t.delegate=null,d;var a=i.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,t.method!==`return`&&(t.method=`next`,t.arg=void 0),t.delegate=null,d):a:(t.method=`throw`,t.arg=TypeError(`iterator result is not an object`),t.delegate=null,d)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function w(e){var t=e.completion||{};t.type=`normal`,delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:`root`}],e.forEach(C,this),this.reset(!0)}function E(e){if(e){var t=e[a];if(t)return t.call(e);if(typeof e.next==`function`)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:D}}function D(){return{value:void 0,done:!0}}return p.prototype=m,r(v,`constructor`,{value:m,configurable:!0}),r(m,`constructor`,{value:p,configurable:!0}),p.displayName=c(m,s,`GeneratorFunction`),e.isGeneratorFunction=function(e){var t=typeof e==`function`&&e.constructor;return!!t&&(t===p||(t.displayName||t.name)===`GeneratorFunction`)},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,c(e,s,`GeneratorFunction`)),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},y(b.prototype),c(b.prototype,o,function(){return this}),e.AsyncIterator=b,e.async=function(t,n,r,i,a){a===void 0&&(a=Promise);var o=new b(l(t,n,r,i),a);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},y(v),c(v,s,`Generator`),c(v,a,function(){return this}),c(v,`toString`,function(){return`[object Generator]`}),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=E,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method=`next`,this.arg=void 0,this.tryEntries.forEach(w),!e)for(var t in this)t.charAt(0)===`t`&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if(e.type===`throw`)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(n,r){return o.type=`throw`,o.arg=e,t.next=n,r&&(t.method=`next`,t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],o=a.completion;if(a.tryLoc===`root`)return r(`end`);if(a.tryLoc<=this.prev){var s=n.call(a,`catchLoc`),c=n.call(a,`finallyLoc`);if(s&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error(`try statement without catch or finally`);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,`finallyLoc`)&&this.prev<i.finallyLoc){var a=i;break}}a&&(e===`break`||e===`continue`)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var o=a?a.completion:{};return o.type=e,o.arg=t,a?(this.method=`next`,this.next=a.finallyLoc,d):this.complete(o)},complete:function(e,t){if(e.type===`throw`)throw e.arg;return e.type===`break`||e.type===`continue`?this.next=e.arg:e.type===`return`?(this.rval=this.arg=e.arg,this.method=`return`,this.next=`end`):e.type===`normal`&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];
2if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),w(n),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if(r.type===`throw`){var i=r.arg;w(n)}return i}}throw Error(`illegal catch attempt`)},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},this.method===`next`&&(this.arg=void 0),d}},e}function yr(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function br(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var a=e.apply(t,n);function o(e){yr(a,r,i,o,s,`next`,e)}function s(e){yr(a,r,i,o,s,`throw`,e)}o(void 0)})}}function xr(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function Sr(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,Ir(r.key),r)}}function Cr(e,t,n){return t&&Sr(e.prototype,t),n&&Sr(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function wr(e,t,n){return t=Ir(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Tr(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Super expression must either be null or a function`);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Dr(e,t)}function Er(e){return Er=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Er(e)}function Dr(e,t){return Dr=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},Dr(e,t)}function Or(){if(typeof Reflect>`u`||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy==`function`)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function kr(e,t,n){return kr=Or()?Reflect.construct.bind():function(e,t,n){var r=[null];r.push.apply(r,t);var i=new(Function.bind.apply(e,r));return n&&Dr(i,n.prototype),i},kr.apply(null,arguments)}function Ar(e){return Function.toString.call(e).indexOf(`[native code]`)!==-1}function jr(e){var t=typeof Map==`function`?new Map:void 0;return jr=function(e){if(e===null||!Ar(e))return e;if(typeof e!=`function`)throw TypeError(`Super expression must either be null or a function`);if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return kr(e,arguments,Er(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),Dr(n,e)},jr(e)}function Mr(e){if(e===void 0)throw ReferenceError(`this hasn't been initialised - super() hasn't been called`);return e}function Nr(e,t){if(t&&(typeof t==`object`||typeof t==`function`))return t;if(t!==void 0)throw TypeError(`Derived constructors may only return object or undefined`);return Mr(e)}function Pr(e){var t=Or();return function(){var n=Er(e),r;if(t){var i=Er(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Nr(this,r)}}function Fr(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Ir(e){var t=Fr(e,`string`);return typeof t==`symbol`?t:String(t)}var Lr=typeof global<`u`&&{}.toString.call(global)===`[object global]`;function Rr(e,t){return e.indexOf(t.toLowerCase())===0?e:`${t.toLowerCase()}${e.substr(0,1).toUpperCase()}${e.substr(1)}`}function zr(e){return!!(e&&e.nodeType===1&&`nodeName`in e&&e.ownerDocument&&e.ownerDocument.defaultView)}function Br(e){return!isNaN(parseFloat(e))&&isFinite(e)&&Math.floor(e)==e}function Vr(e){return/^(https?:)?\/\/((((player|www)\.)?vimeo\.com)|((player\.)?[a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))(?=$|\/)/.test(e)}function Hr(e){return/^https:\/\/player\.((vimeo\.com)|([a-zA-Z0-9-]+\.(videoji\.(hk|cn)|vimeo\.work)))\/video\/\d+/.test(e)}function Ur(e){for(var t=(e||``).match(/^(?:https?:)?(?:\/\/)?([^/?]+)/),n=(t&&t[1]||``).replace(`player.`,``),r=[`.videoji.hk`,`.vimeo.work`,`.videoji.cn`],i=0,a=r;i<a.length;i++){var o=a[i];if(n.endsWith(o))return n}return`vimeo.com`}function Wr(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.id,n=e.url,r=t||n;if(!r)throw Error(`An id or url must be passed, either in an options object or as a data-vimeo-id or data-vimeo-url attribute.`);if(Br(r))return`https://vimeo.com/${r}`;if(Vr(r))return r.replace(`http:`,`https:`);throw TypeError(t?`â${t}â is not a valid video id.`:`â${r}â is not a vimeo.com url.`)}var Gr=function(e,t,n){var r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:`addEventListener`,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:`removeEventListener`,a=typeof t==`string`?[t]:t;return a.forEach(function(t){e[r](t,n)}),{cancel:function(){return a.forEach(function(t){return e[i](t,n)})}}},Kr=Array.prototype.indexOf!==void 0,qr=typeof window<`u`&&window.postMessage!==void 0;if(!Lr&&(!Kr||!qr))throw Error(`Sorry, the Vimeo Player API is not available in this browser.`);var Jr=typeof globalThis<`u`?globalThis:typeof window<`u`?window:typeof global<`u`?global:typeof self<`u`?self:{};function Yr(e,t){return t={exports:{}},e(t,t.exports),t.exports}(function(e){if(e.WeakMap)return;var t=Object.prototype.hasOwnProperty,n=Object.defineProperty&&function(){try{return Object.defineProperty({},"x",{value:1}).x===1}catch{}}(),r=function(e,t,r){n?Object.defineProperty(e,t,{configurable:!0,writable:!0,value:r}):e[t]=r};e.WeakMap=function(){function e(){if(this===void 0)throw TypeError(`Constructor WeakMap requires 'new'`);if(r(this,`_id`,a(`_WeakMap`)),arguments.length>0)throw TypeError(`WeakMap iterable is not supported`)}r(e.prototype,`delete`,function(e){if(n(this,`delete`),!i(e))return!1;var t=e[this._id];return t&&t[0]===e?(delete e[this._id],!0):!1}),r(e.prototype,`get`,function(e){if(n(this,`get`),i(e)){var t=e[this._id];if(t&&t[0]===e)return t[1]}}),r(e.prototype,`has`,function(e){if(n(this,`has`),!i(e))return!1;var t=e[this._id];return!!(t&&t[0]===e)}),r(e.prototype,`set`,function(e,t){if(n(this,`set`),!i(e))throw TypeError(`Invalid value used as weak map key`);var a=e[this._id];return a&&a[0]===e?(a[1]=t,this):(r(e,this._id,[e,t]),this)});function n(e,n){if(!i(e)||!t.call(e,`_id`))throw TypeError(n+` method called on incompatible receiver `+typeof e)}function a(e){return e+`_`+o()+`.`+o()}function o(){return Math.random().toString().substring(2)}return r(e,`_polyfill`,!0),e}();function i(e){return Object(e)===e}})(typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:Jr);var Xr=Yr(function(e){(function(t,n,r){n[t]=n[t]||r(),e.exports&&(e.exports=n[t])})(`Promise`,Jr,function(){var e,t,n,r=Object.prototype.toString,i=typeof setImmediate<`u`?function(e){return setImmediate(e)}:setTimeout;try{Object.defineProperty({},"x",{}),e=function(e,t,n,r){return Object.defineProperty(e,t,{value:n,writable:!0,configurable:r!==!1})}}catch{e=function(e,t,n){return e[t]=n,e}}n=function(){var e,n,r;function i(e,t){this.fn=e,this.self=t,this.next=void 0}return{add:function(t,a){r=new i(t,a),n?n.next=r:e=r,n=r,r=void 0},drain:function(){var r=e;for(e=n=t=void 0;r;)r.fn.call(r.self),r=r.next}}}();function a(e,r){n.add(e,r),t||(t=i(n.drain))}function o(e){var t,n=typeof e;return e!=null&&(n==`object`||n==`function`)&&(t=e.then),typeof t==`function`&&t}function s(){for(var e=0;e<this.chain.length;e++)c(this,this.state===1?this.chain[e].success:this.chain[e].failure,this.chain[e]);this.chain.length=0}
2function c(e,t,n){var r,i;try{t===!1?n.reject(e.msg):(r=t===!0?e.msg:t.call(void 0,e.msg),r===n.promise?n.reject(TypeError(`Promise-chain cycle`)):(i=o(r))?i.call(r,n.resolve,n.reject):n.resolve(r))}catch(e){n.reject(e)}}function l(e){var t,n=this;if(!n.triggered){n.triggered=!0,n.def&&(n=n.def);try{(t=o(e))?a(function(){var r=new f(n);try{t.call(e,function(){l.apply(r,arguments)},function(){u.apply(r,arguments)})}catch(e){u.call(r,e)}}):(n.msg=e,n.state=1,n.chain.length>0&&a(s,n))}catch(e){u.call(new f(n),e)}}}function u(e){var t=this;t.triggered||(t.triggered=!0,t.def&&(t=t.def),t.msg=e,t.state=2,t.chain.length>0&&a(s,t))}function d(e,t,n,r){for(var i=0;i<t.length;i++)(function(i){e.resolve(t[i]).then(function(e){n(i,e)},r)})(i)}function f(e){this.def=e,this.triggered=!1}function p(e){this.promise=e,this.state=0,this.triggered=!1,this.chain=[],this.msg=void 0}function m(e){if(typeof e!=`function`)throw TypeError(`Not a function`);if(this.__NPO__!==0)throw TypeError(`Not a promise`);this.__NPO__=1;var t=new p(this);this.then=function(e,n){var r={success:typeof e!=`function`||e,failure:typeof n==`function`&&n};return r.promise=new this.constructor(function(e,t){if(typeof e!=`function`||typeof t!=`function`)throw TypeError(`Not a function`);r.resolve=e,r.reject=t}),t.chain.push(r),t.state!==0&&a(s,t),r.promise},this.catch=function(e){return this.then(void 0,e)};try{e.call(void 0,function(e){l.call(t,e)},function(e){u.call(t,e)})}catch(e){u.call(t,e)}}var h=e({},`constructor`,m,!1);return m.prototype=h,e(h,`__NPO__`,0,!1),e(m,`resolve`,function(e){var t=this;return e&&typeof e==`object`&&e.__NPO__===1?e:new t(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);t(e)})}),e(m,`reject`,function(e){return new this(function(t,n){if(typeof t!=`function`||typeof n!=`function`)throw TypeError(`Not a function`);n(e)})}),e(m,`all`,function(e){var t=this;return r.call(e)==`[object Array]`?e.length===0?t.resolve([]):new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);var i=e.length,a=Array(i),o=0;d(t,e,function(e,t){a[e]=t,++o===i&&n(a)},r)}):t.reject(TypeError(`Not an array`))}),e(m,`race`,function(e){var t=this;return r.call(e)==`[object Array]`?new t(function(n,r){if(typeof n!=`function`||typeof r!=`function`)throw TypeError(`Not a function`);d(t,e,function(e,t){n(t)},r)}):t.reject(TypeError(`Not an array`))}),m})}),Zr=new WeakMap;function Qr(e,t,n){var r=Zr.get(e.element)||{};t in r||(r[t]=[]),r[t].push(n),Zr.set(e.element,r)}function $r(e,t){return(Zr.get(e.element)||{})[t]||[]}function ei(e,t,n){var r=Zr.get(e.element)||{};if(!r[t])return!0;if(!n)return r[t]=[],Zr.set(e.element,r),!0;var i=r[t].indexOf(n);return i!==-1&&r[t].splice(i,1),Zr.set(e.element,r),r[t]&&r[t].length===0}function ti(e,t){var n=$r(e,t);if(n.length<1)return!1;var r=n.shift();return ei(e,t,r),r}function ni(e,t){var n=Zr.get(e);Zr.set(t,n),Zr.delete(e)}function ri(e){if(typeof e==`string`)try{e=JSON.parse(e)}catch(e){return console.warn(e),{}}return e}function ii(e,t,n){if(!(!e.element.contentWindow||!e.element.contentWindow.postMessage)){var r={method:t};n!==void 0&&(r.value=n);var i=parseFloat(navigator.userAgent.toLowerCase().replace(/^.*msie (\d+).*$/,`$1`));i>=8&&i<10&&(r=JSON.stringify(r)),e.element.contentWindow.postMessage(r,e.origin)}}function ai(e,t){t=ri(t);var n=[],r;if(t.event)t.event===`error`&&$r(e,t.data.method).forEach(function(n){var r=Error(t.data.message);r.name=t.data.name,n.reject(r),ei(e,t.data.method,n)}),n=$r(e,`event:${t.event}`),r=t.data;else if(t.method){var i=ti(e,t.method);i&&(n.push(i),r=t.value)}n.forEach(function(t){try{if(typeof t==`function`){t.call(e,r);return}t.resolve(r)}catch{}})}var oi=`airplay.audio_tracks.audiotrack.autopause.autoplay.background.byline.cc.chapter_id.chapters.chromecast.color.colors.controls.dnt.end_time.fullscreen.height.id.initial_quality.interactive_params.keyboard.loop.maxheight.max_quality.maxwidth.min_quality.muted.play_button_position.playsinline.portrait.preload.progress_bar.quality.quality_selector.responsive.skipping_forward.speed.start_time.texttrack.thumbnail_id.title.transcript.transparent.unmute_button.url.vimeo_logo.volume.watch_full_video.width`.split(`.`);function si(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return oi.reduce(function(t,n){var r=e.getAttribute(`data-vimeo-${n}`);return(r||r===``)&&(t[n]=r===``?1:r),t},t)}function ci(e,t){var n=e.html;if(!t)throw TypeError(`An element must be provided`);if(t.getAttribute(`data-vimeo-initialized`)!==null)return t.querySelector(`iframe`);var r=document.createElement(`div`);return r.innerHTML=n,t.appendChild(r.firstChild),t.setAttribute(`data-vimeo-initialized`,`true`),t.querySelector(`iframe`)}function li(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return new Promise(function(r,i){if(!Vr(e))throw TypeError(`â${e}â is not a vimeo.com url.`);var a=`https://${Ur(e)}/api/oembed.json?url=${encodeURIComponent(e)}`;for(var o in t)t.hasOwnProperty(o)&&(a+=`&${o}=${encodeURIComponent(t[o])}`);var s=`XDomainRequest`in window?new XDomainRequest:new XMLHttpRequest;s.open(`GET`,a,!0),s.onload=function(){if(s.status===404){i(Error(`â${e}â was not found.`));return}if(s.status===403){i(Error(`â${e}â is not embeddable.`));return}try{var t=JSON.parse(s.responseText);if(t.domain_status_code===403){ci(t,n),i(Error(`â${e}â is not embeddable.`));return}r(t)}catch(e){i(e)}},s.onerror=function(){var e=s.status?` (${s.status})`:``;i(Error(`There was an error fetching the embed code from Vimeo${e}.`))},s.send()})}function ui(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,t=[].slice.call(e.querySelectorAll(`[data-vimeo-id], [data-vimeo-url]`)),n=function(e){`
2console`in window&&console.error&&console.error(`There was an error creating an embed: ${e}`)};t.forEach(function(e){try{if(e.getAttribute(`data-vimeo-defer`)!==null)return;var t=si(e);li(Wr(t),t,e).then(function(t){return ci(t,e)}).catch(n)}catch(e){n(e)}})}function di(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoPlayerResizeEmbeds_||(window.VimeoPlayerResizeEmbeds_=!0,window.addEventListener(`message`,function(t){if(Vr(t.origin)&&!(!t.data||t.data.event!==`spacechange`)){for(var n=e.querySelectorAll(`iframe`),r=0;r<n.length;r++)if(n[r].contentWindow===t.source){var i=n[r].parentElement;i.style.paddingBottom=`${t.data.data[0].bottom}px`;break}}}))}function fi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;window.VimeoSeoMetadataAppended||(window.VimeoSeoMetadataAppended=!0,window.addEventListener(`message`,function(t){if(Vr(t.origin)){var n=ri(t.data);if(!(!n||n.event!==`ready`))for(var r=e.querySelectorAll(`iframe`),i=0;i<r.length;i++){var a=r[i],o=a.contentWindow===t.source;Hr(a.src)&&o&&new bi(a).callMethod(`appendVideoMetadata`,window.location.href)}}}))}function pi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document;if(!window.VimeoCheckedUrlTimeParam){window.VimeoCheckedUrlTimeParam
2=!0;var t=function(e){`console`in window&&console.error&&console.error(`There was an error getting video Id: ${e}`)};window.addEventListener(`message`,function(n){if(Vr(n.origin)){var r=ri(n.data);if(!(!r||r.event!==`ready`))for(var i=e.querySelectorAll(`iframe`),a=function(){var e=i[o],r=e.contentWindow===n.source;if(Hr(e.src)&&r){var a=new bi(e);a.getVideoId().then(function(e){var t=RegExp(`[?&]vimeo_t_${e}=([^&#]*)`).exec(window.location.href);if(t&&t[1]){var n=decodeURI(t[1]);a.setCurrentTime(n)}}).catch(t)}},o=0;o<i.length;o++)a()}})}}function mi(){var e=function(){for(var e,t=[[`requestFullscreen`,`exitFullscreen`,`fullscreenElement`,`fullscreenEnabled`,`fullscreenchange`,`fullscreenerror`],[`webkitRequestFullscreen`,`webkitExitFullscreen`,`webkitFullscreenElement`,`webkitFullscreenEnabled`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`webkitRequestFullScreen`,`webkitCancelFullScreen`,`webkitCurrentFullScreenElement`,`webkitCancelFullScreen`,`webkitfullscreenchange`,`webkitfullscreenerror`],[`mozRequestFullScreen`,`mozCancelFullScreen`,`mozFullScreenElement`,`mozFullScreenEnabled`,`mozfullscreenchange`,`mozfullscreenerror`],[`msRequestFullscreen`,`msExitFullscreen`,`msFullscreenElement`,`msFullscreenEnabled`,`MSFullscreenChange`,`MSFullscreenError`]],n=0,r=t.length,i={};n<r;n++)if(e=t[n],e&&e[1]in document){for(n=0;n<e.length;n++)i[t[0][n]]=e[n];return i}return!1}(),t={fullscreenchange:e.fullscreenchange,fullscreenerror:e.fullscreenerror},n={request:function(t){return new Promise(function(r,i){var a=function e(){n.off(`fullscreenchange`,e),r()};n.on(`fullscreenchange`,a),t=t||document.documentElement;var o=t[e.requestFullscreen]();o instanceof Promise&&o.then(a).catch(i)})},exit:function(){return new Promise(function(t,r){if(!n.isFullscreen){t();return}var i=function e(){n.off(`fullscreenchange`,e),t()};n.on(`fullscreenchange`,i);var a=document[e.exitFullscreen]();a instanceof Promise&&a.then(i).catch(r)})},on:function(e,n){var r=t[e];r&&document.addEventListener(r,n)},off:function(e,n){var r=t[e];r&&document.removeEventListener(r,n)}};return Object.defineProperties(n,{isFullscreen:{get:function(){return!!document[e.fullscreenElement]}},element:{enumerable:!0,get:function(){return document[e.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return!!document[e.fullscreenEnabled]}}}),n}var hi={role:`viewer`,autoPlayMuted:!0,allowedDrift:.3,maxAllowedDrift:1,minCheckInterval:.1,maxRateAdjustment:.2,maxTimeToCatchUp:1},gi=function(e){Tr(n,e);var t=Pr(n);function n(e,r){var i,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=arguments.length>3?arguments[3]:void 0;return xr(this,n),i=t.call(this),wr(Mr(i),`logger`,void 0),wr(Mr(i),`speedAdjustment`,0),wr(Mr(i),`adjustSpeed`,function(){var e=br(vr().mark(function e(t,n){var r;return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i.speedAdjustment!==n){e.next=2;break}return e.abrupt(`return`);case 2:return e.next=4,t.getPlaybackRate();case 4:return e.t0=e.sent,e.t1=i.speedAdjustment,e.t2=e.t0-e.t1,e.t3=n,r=e.t2+e.t3,i.log(`New playbackRate: ${r}`),e.next=12,t.setPlaybackRate(r);case 12:i.speedAdjustment=n;case 13:case`end`:return e.stop()}},e)}));return function(t,n){return e.apply(this,arguments)}}()),i.logger=o,i.init(r,e,_r(_r({},hi),a)),i}return Cr(n,[{key:`disconnect`,value:function(){this.dispatchEvent(new Event(`disconnect`))}}
2,{key:`init`,value:function(){var e=br(vr().mark(function e(t,n,r){var i=this,a,o,s;return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.waitForTOReadyState(t,`open`);case 2:if(r.role!==`viewer`){e.next=10;break}return e.next=5,this.updatePlayer(t,n,r);case 5:a=Gr(t,`change`,function(){return i.updatePlayer(t,n,r)}),o=this.maintainPlaybackPosition(t,n,r),this.addEventListener(`disconnect`,function(){o.cancel(),a.cancel()}),e.next=14;break;case 10:return e.next=12,this.updateTimingObject(t,n);case 12:s=Gr(n,[`seeked`,`play`,`pause`,`ratechange`],function(){return i.updateTimingObject(t,n)},`on`,`off`),this.addEventListener(`disconnect`,function(){return s.cancel()});case 14:case`end`:return e.stop()}},e,this)}));function t(t,n,r){return e.apply(this,arguments)}return t}()},{key:`updateTimingObject`,value:function(){var e=br(vr().mark(function e(t,n){return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=t,e.next=3,n.getCurrentTime();case 3:return e.t1=e.sent,e.next=6,n.getPaused();case 6:if(!e.sent){e.next=10;break}e.t2=0,e.next=13;break;case 10:return e.next=12,n.getPlaybackRate();case 12:e.t2=e.sent;case 13:e.t3=e.t2,e.t4={position:e.t1,velocity:e.t3},e.t0.update.call(e.t0,e.t4);case 16:case`end`:return e.stop()}},e)}));function t(t,n){return e.apply(this,arguments)}return t}()},{key:`updatePlayer`,value:function(){var e=br(vr().mark(function e(t,n,r){var i,a,o;return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(i=t.query(),a=i.position,o=i.velocity,typeof a==`number`&&n.setCurrentTime(a),typeof o!=`number`){e.next=25;break}if(o!==0){e.next=11;break}return e.next=6,n.getPaused();case 6:if(e.t0=e.sent,e.t0!==!1){e.next=9;break}n.pause();case 9:e.next=25;break;case 11:if(!(o>0)){e.next=25;break}return e.next=14,n.getPaused();case 14:if(e.t1=e.sent,e.t1!==!0){e.next=19;break}return e.next=18,n.play().catch(function(){var e=br(vr().mark(function e(t){return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t.name===`NotAllowedError`&&r.autoPlayMuted)){e.next=5;break}return e.next=3,n.setMuted(!0);case 3:return e.next=5,n.play().catch(function(e){return console.error(`Couldn't play the video from TimingSrcConnector. Error:`,e)});case 5:case`end`:return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}());case 18:this.updatePlayer(t,n,r);case 19:return e.next=21,n.getPlaybackRate();case 21:if(e.t2=e.sent,e.t3=o,e.t2===e.t3){e.next=25;break}n.setPlaybackRate(o);case 25:case`end`:return e.stop()}},e,this)}));function t(t,n,r){return e.apply(this,arguments)}return t}()},{key:`maintainPlaybackPosition`,value:function(e,t,n){var r=this,i=n.allowedDrift,a=n.maxAllowedDrift,o=n.minCheckInterval,s=n.maxRateAdjustment,c=n.maxTimeToCatchUp,l=Math.min(c,Math.max(o,a))*1e3,u=function(){var n=br(vr().mark(function n(){var o,l,u,d,f;return vr().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:if(n.t0=e.query().velocity===0,n.t0){n.next=6;break}return n.next=4,t.getPaused();case 4:n.t1=n.sent,n.t0=n.t1===!0;case 6:if(!n.t0){n.next=8;break}return n.abrupt(`return`);case 8:return n.t2=e.query().position,n.next=11,t.getCurrentTime();case 11:if(n.t3=n.sent,o=n.t2-n.t3,l=Math.abs(o),r.log(`Drift: ${o}`),!(l>a)){n.next=22;break}return n.next=18,r.adjustSpeed(t,0);case 18:t.setCurrentTime(e.query().position),r.log(`Resync by currentTime`),n.next=29;break;case 22:if(!(l>i)){n.next=29;break}return u=l/c,d=s,f=u<d?(d-u)/2:d,n.next=28,r.adjustSpeed(t,f*Math.sign(o));case 28:r.log(`Resync by playbackRate`);case 29:case`end`:return n.stop()}},n)}));return function(){return n.apply(this,arguments)}}(),d=setInterval(function(){return u()},l);return{cancel:function(){return clearInterval(d)}}}},{key:`log`,value:function(e){var t;(t=this.logger)==null||t.call(this,`TimingSrcConnector: ${e}`)}},{key:`waitForTOReadyState`,value:function(e,t){return new Promise(function(n){(function r(){e.readyState===t?n():e.addEventListener(`readystatechange`,r,{once:!0})})()})}}]),n}(jr(EventTarget)),_i=new WeakMap,vi=new WeakMap,yi={},bi=function(){function e(t){var n=this,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(xr(this,e),window.jQuery&&t instanceof jQuery&&(t.length>1&&window.console&&console.warn&&console.warn(`A jQuery object with multiple elements was passed, using the first element.`),t=t[0]),typeof document<`u`&&typeof t==`string`&&(t=document.getElementById(t)),!zr(t))throw TypeError(`You must pass either a valid element or a valid id.`);
2if(t.nodeName!==`IFRAME`){var i=t.querySelector(`iframe`);i&&(t=i)}if(t.nodeName===`IFRAME`&&!Vr(t.getAttribute(`src`)||``))throw Error(`The player element passed isnât a Vimeo embed.`);if(_i.has(t))return _i.get(t);this._window=t.ownerDocument.defaultView,this.element=t,this.origin=`*`;var a=new Xr(function(e,i){if(n._onMessage=function(t){if(!(!Vr(t.origin)||n.element.contentWindow!==t.source)){n.origin===`*`&&(n.origin=t.origin);var r=ri(t.data);if(r&&r.event===`error`&&r.data&&r.data.method===`ready`){var a=Error(r.data.message);a.name=r.data.name,i(a);return}var o=r&&r.event===`ready`,s=r&&r.method===`ping`;if(o||s){n.element.setAttribute(`data-ready`,`true`),e();return}ai(n,r)}},n._window.addEventListener(`message`,n._onMessage),n.element.nodeName!==`IFRAME`){var a=si(t,r);li(Wr(a),a,t).then(function(e){var r=ci(e,t);return n.element=r,n._originalElement=t,ni(t,r),_i.set(n.element,n),e}).catch(i)}});if(vi.set(this,a),_i.set(this.element,this),this.element.nodeName===`IFRAME`&&ii(this,`ping`),yi.isEnabled){var o=function(){return yi.exit()};this.fullscreenchangeHandler=function(){yi.isFullscreen?Qr(n,`event:exitFullscreen`,o):ei(n,`event:exitFullscreen`,o),n.ready().then(function(){ii(n,`fullscreenchange`,yi.isFullscreen)})},yi.on(`fullscreenchange`,this.fullscreenchangeHandler)}return this}return Cr(e,[{key:`callMethod`,value:function(e){var t=this,n=[...arguments].slice(1);if(e==null)throw TypeError(`You must pass a method name.`);return new Xr(function(r,i){return t.ready().then(function(){Qr(t,e,{resolve:r,reject:i}),ii(t,e,n)}).catch(i)})}},{key:`get`,value:function(e){var t=this;return new Xr(function(n,r){return e=Rr(e,`get`),t.ready().then(function(){Qr(t,e,{resolve:n,reject:r}),ii(t,e)}).catch(r)})}},{key:`set`,value:function(e,t){var n=this;return new Xr(function(r,i){if(e=Rr(e,`set`),t==null)throw TypeError(`There must be a value to set.`);return n.ready().then(function(){Qr(n,e,{resolve:r,reject:i}),ii(n,e,t)}).catch(i)})}},{key:`on`,value:function(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(!t)throw TypeError(`You must pass a callback function.`);if(typeof t!=`function`)throw TypeError(`The callback must be a function.`);$r(this,`event:${e}`).length===0&&this.callMethod(`addEventListener`,e).catch(function(){}),Qr(this,`event:${e}`,t)}},{key:`off`,value:function(e,t){if(!e)throw TypeError(`You must pass an event name.`);if(t&&typeof t!=`function`)throw TypeError(`The callback must be a function.`);ei(this,`event:${e}`,t)&&this.callMethod(`removeEventListener`,e).catch(function(e){})}},{key:`loadVideo`,value:function(e){return this.callMethod(`loadVideo`,e)}},{key:`ready`,value:function(){var e=vi.get(this)||new Xr(function(e,t){t(Error(`Unknown player. Probably unloaded.`))});return Xr.resolve(e)}},{key:`addCuePoint`,value:function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return this.callMethod(`addCuePoint`,{time:e,data:t})}},{key:`removeCuePoint`,value:function(e){return this.callMethod(`removeCuePoint`,e)}},{key:`enableTextTrack`,value:function(e,t){if(!e)throw TypeError(`You must pass a language.`);return this.callMethod(`enableTextTrack`,{language:e,kind:t})}},{key:`disableTextTrack`,value:function(){return this.callMethod(`disableTextTrack`)}},{key:`pause`,value:function(){return this.callMethod(`pause`)}},{key:`play`,value:function(){return this.callMethod(`play`)}},{key:`requestFullscreen`,value:function(){return yi.isEnabled?yi.request(this.element):this.callMethod(`requestFullscreen`)}},{key:`exitFullscreen`,value:function(){return yi.isEnabled?yi.exit():this.callMethod(`exitFullscreen`)}},{key:`getFullscreen`,value:function(){return yi.isEnabled?Xr.resolve(yi.isFullscreen):this.get(`fullscreen`)}},{key:`requestPictureInPicture`,value:function(){return this.callMethod(`requestPictureInPicture`)}},{key:`exitPictureInPicture`,value:function(){return this.callMethod(`exitPictureInPicture`)}},{key:`getPictureInPicture`,value:function(){return this.get(`pictureInPicture`)}},{key:`remotePlaybackPrompt`,value:function(){return this.callMethod(`remotePlaybackPrompt`)}},{key:`unload`,value:function(){return this.callMethod(`unload`)}},{key:`destroy`,value:function(){var e=this;return new Xr(function(t){if(vi.delete(e),_i.delete(e.element),e._originalElement&&(_i.delete(e._originalElement),e._originalElement.removeAttribute(`data-vimeo-initialized`)),e.element&&e.element.nodeName===`IFRAME`&&e.element.parentNode&&(e.element.parentNode.parentNode&&e._originalElement&&e._originalElement!==e.element.parentNode?e.element.parentNode.parentNode.removeChild(e.element.parentNode):e.element.parentNode.removeChild(e.element)),e.element&&e.element.nodeName===`DIV`&&e.element.parentNode){e.element.removeAttribute(`data-vimeo-initialized`);var n=e.element.querySelector(`iframe`);n&&n.parentNode&&(n.parentNode.parentNode&&e._originalElement&&e._originalElement!==n.parentNode?n.parentNode.parentNode.removeChild(n.parentNode):n.parentNode.removeChild(n))}e._window.removeEventListener(`message`,e._onMessage),yi.isEnabled&&yi.off(`fullscreenchange`,e.fullscreenchangeHandler),t()})}},{key:`getAutopause`,value:function(){return this.get(`autopause`)}},{key:`setAutopause`,value:function(e){return this.set(`autopause`,e)}},{key:`getBuffered`,value:function(){return this.get(`buffered`)}},{key:`getCameraProps`,value:function(){return this.get(`cameraProps`)}},{key:`setCameraProps`,value:function(e){return this.set(`cameraProps`,e)}},{key:`getChapters`,value:function(){return this.get(`chapters`)}},{key:`getCurrentChapter`,value:function(){return this.get(`currentChapter`)}},{key:`getColor`,value:function(){return this.get(`color`)}},{key:`getColors`,value:function(){return Xr.all([this.get(`colorOne`),this.get(`colorTwo`),this.get(`colorThree`),this.get(`colorFour`)])}},{key:`setColor`,value:function(e){return this.set(`color`,e)}},{key:`setColors`,value:function(e){if(!Array.isArray(e))return new Xr(function(e,t){return t(TypeError(`Argument must be an array.`))});var t=new Xr(function(e){return e(null)}),n=[e[0]?this.set(`colorOne`,e[0]):t,e[1]?this.set(`colorTwo`,e[1]):t,e[2]?this.set(`colorThree`,e[2]):t,e[3]?this.set(`colorFour`,e[3]):t];return Xr.all(n)}},{key:`getCuePoints`,value:function(){return this.get(`cuePoints`)}},{key:`getCurrentTime`,value:function(){return this.get(`currentTime`)}},{key:`setCurrentTime`,value:function(e){return this.set(`currentTime`,e)}},{key:`getDuration`,value:function(){return this.get(`duration`)}},{key:`getEnded`,value:function(){return this.get(`ended`)}},{key:`getLoop`,value:function(){return this.get(`loop`)}},{key:`setLoop`,value:function(e){return this.set(`loop`,e)}},{key:`setMuted`,value:function(e){return this.set(`muted`,e)}},{key:`getMuted`,value:function(){return this.get(`muted`)}},{key:`getPaused`,value:function(){return this.get(`paused`)}},{key:`getPlaybackRate`,value:function(){return this.get(`playbackRate`)}},{key:`setPlaybackRate`,value:function(e){return this.set(`playbackRate`,e)}},{key:`getPlayed`,value:function(){return this.get(`played`)}},{key:`getQualities`,value:function(){return this.get(`qualities`)}},{key:`getQuality`,value:function(){return this.get(`quality`)}},{key:`setQuality`,value:function(e){return this.set(`quality`,e)}},{key:`getRemotePlaybackAvailability`,value:function(){return this.get(`remotePlaybackAvailability`)}},{key:`getRemotePlaybackState`,value:function(){return this.get(`remotePlaybackState`)}},{key:`getSeekable`,value:function(){return this.get(`seekable`)}},{key:`getSeeking`,value:function(){return this.get(`seeking`)}},{key:`getTextTracks`,value:function(){return this.get(`textTracks`)}},{key:`getVideoEmbedCode`,value:function(){return this.get(`videoEmbedCode`)}},{key:`getVideoId`,value:function(){return this.get(`videoId`)}},{key:`getVideoTitle`,value:function(){return this.get(`videoTitle`)}},{key:`getVideoWidth`,value:function(){return this.get(`videoWidth`)}},{key:`getVideoHeight`,value:function(){return this.get(`videoHeight`)}},{key:`getVideoUrl`,value:function(){return this.get(`videoUrl`)}},{key:`getVolume`,value:function(){return this.get(`volume`)}},{key:`setVolume`,value:function(e){return this.set(`volume`,e)}},{key:`setTimingSrc`,value:function(){var e=br(vr().mark(function e(t,n){var r=this,i;return vr().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw TypeError(`A Timing Object must be provided.`);case 2:return e.next=4,this.ready();case 4:return i=new gi(this,t,n),ii(this,`notifyTimingObjectConnect`),i.addEventListener(`disconnect`,function(){return ii(r,`notifyTimingObjectDisconnect`)}),e.abrupt(`return`,i);case 8:case`end`:return e.stop()}},e,this)}));function t(t,n){return e.apply(this,arguments)}return t}()}]),e}();
2Lr||(yi=mi(),ui(),di(),fi(),pi());function xi(e){var t=e.player,n=e.event,r=e.emit;t.on(n,function(e){return r(n,e,t)})}var Si=[`play`,`playing`,`pause`,`ended`,`timeupdate`,`progress`,`seeking`,`seeked`,`texttrackchange`,`chapterchange`,`cuechange`,`cuepoint`,`volumechange`,`playbackratechange`,`bufferstart`,`bufferend`,`error`,`loaded`,`durationchange`,`fullscreenchange`,`qualitychange`,`camerachange`,`resize`],Ci={name:`VimeoPlayer`,props:{playerHeight:{type:Number,default:320},playerWidth:{type:Number,default:640},options:{type:Object,default:function(){return{}}},videoId:{type:String,default:``},videoUrl:{type:String,default:``},loop:{type:Boolean,default:!1},autoplay:{type:Boolean,default:!1},controls:{type:Boolean,default:!0},eventsToEmit:{type:Array,default:function(){return Si}}},setup:function(e,t){var n=t.emit,r,i=ie(null),a=p(e),o=a.videoId,s=a.videoUrl;!e.videoId&&!e.videoUrl&&console.warn(`[VueVimeoPlayer: You mist provide at least a videoId or a videoUrl prop]`);var c=function(t){var n=t.id,r=t.url,i={width:e.playerWidth,height:e.playerHeight,loop:e.loop,autoplay:e.autoplay,controls:e.controls};return S(r)&&(i.url=S(r)),S(n)&&(i.id=S(n)),Object.assign(i,e.options)},l=function(){return r.play()},u=function(){return r.pause()},d=function(){return r.setVolume(0)},f=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:.5;return r.setVolume(e)},m=function(){r.ready().then(function(){n(`ready`,r)}).catch(function(e){n(`error`,e,r)}),e.eventsToEmit.forEach(function(e){return xi({player:r,event:e,emit:n})})};return E(function(){r=new bi(i.value,c({id:e.videoId,url:e.videoUrl})),m()}),g(function(){return r.unload()}),ce(o,function(e){return r.loadVideo(c({id:e}))}),ce(s,function(e){return r.loadVideo(c({url:e}))}),ce(x(e,`controls`),function(){return r.loadVideo(c({url:s,id:o}))}),{update:function(e){return r.loadVideo(c({id:e}))},play:l,pause:u,mute:d,unmute:f,elementRef:i,player:r}}},wi={ref:`elementRef`};function Ti(e,t,n,r,i,a){return s(),y(`div`,wi,null,512)}Ci.render=Ti;var Ei={props:{data:null},components:{vimeoPlayer:Ci},computed:{vimeoId:function(){if(this.data.url.includes(`.com/`))return this.data.url.split(`.com/`)[1]}},mounted(){}},Di={"data-block":`vimeo`};function Oi(e,t,n,r,i,a){let o=ne(`vimeo-player`),c=Ee;return s(),f(c,null,{default:D(()=>[C(`div`,Di,[v(o,m({ref:`player`,"video-id":a.vimeoId},{options:{responsive:!0}}),null,16,[`video-id`])])]),_:1})}var ki=Object.assign(A(Ei,[[`render`,Oi]]),{__name:`ElementVimeoPost`}),Ai={"data-block":`twitter`},ji=[`innerHTML`],Mi=Object.assign(b({__name:`TwitterPost`,props:{url:{}},async setup(e){let t,n,r=e,i;if(r.url.startsWith(`https://twitter.com`)||r.url.startsWith(`https://x.com`)){let e=([t,n]=ee(()=>Ft(`/api/getTwitterEmbed?date=`+Date.now(),{method:`POST`,body:{url:r.url}})),t=await t,n(),t);console.log(e),i=e.error.value||e.data.value.error?`<p class="brik-note text-sm rounded-lg lg:rounded-2xl py-2 px-3 mb-4">\nTwitter is overbelast. Klik <a href="${r.url}" style="color: cornflowerblue;">hier</a> om de Tweet te bekijken.\n</p>`:e.data.value.html,xe({script:[{src:`https://platform.twitter.com/widgets.js`}]})}return(e,t)=>(s(),y(`div`,Ai,[S(i)?(s(),y(`div`,{key:0,innerHTML:S(i)},null,8,ji)):u(``,!0)]))}}),{__name:`ElementTwitterPost`}),Ni={props:{html:null},mounted(){let e=this.html.match(`<script.*src="(.+?)"><\\/script>`);e&&(e=e[1],xe({script:[{src:e}]}))}},Pi=[`innerHTML`];function Fi(e,t,n,r,i,a){return s(),y(`div`,{"data-block":`html`,innerHTML:n.html},null,8,Pi)}var Ii=Object.assign(A(Ni,[[`render`,Fi]]),{__name:`ElementHtml`}),Li={data(){return{id:null,embedType:null,blub:null}},props:{data:null},methods:{getVariables:function(){let e=this.data.url,t=``;e.includes(`/playlist/`)?(t=e.split(`/playlist/`),this.embedType=`playlist`):e.includes(`/track/`)?(t=e.split(`/track/`),this.embedType=`track`):e.includes(`/show/`)?(t=e.split(`/show/`),this.embedType=`show`):e.includes(`/episode/`)?(t=e.split(`/episode/`),this.embedType=`episode`):e.includes(`/album/`)&&(t=e.split(`/album/`),this.embedType=`album`),this.id=t[1]},createEmbed:function(e){let t=document.getElementById(`embed-iframe`),n={uri:`spotify:${this.embedType}:${this.id}`};e.createController(t,n,e=>{})}},mounted(){this.getVariables(),window.onSpotifyIframeApiReady=e=>{this.createEmbed(e)}},created(){window.SpotifyIframeConfig&&window.SpotifyIframeConfig.loading&&(window.SpotifyIframeConfig.loading=0);let e=document.createElement(`script`);
2e.src=`https://open.spotify.com/embed/iframe-api/v1`,document.body.appendChild(e)}},Ri={"data-block":`spotify`};function zi(e,t,n,r,i,a){return s(),y(`div`,Ri,[...t[0]||(t[0]=[C(`div`,{id:`embed-iframe`},null,-1)])])}var Bi=Object.assign(A(Li,[[`render`,zi]]),{__name:`ElementSpotifyPlaylist`}),Vi={ADD:`add`,REMOVE:`remove`},Hi={PROPERTYCHANGE:`propertychange`};function Ui(e){for(let t in e)delete e[t]}function Wi(e){let t;for(t in e)return!1;return!t}function j(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r==null?this:r,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function Gi(e,t,n,r){return j(e,t,n,r,!0)}function M(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Ui(e))}var N={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},Ki=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function qi(e,t,n){let r,i;n=n||Ji;let a=0,o=e.length,s=!1;for(;a<o;)r=a+(o-a>>1),i=+n(e[r],t),i<0?a=r+1:(o=r,s=!i);return s?a:~a}function Ji(e,t){return e>t?1:e<t?-1:0}function Yi(e,t){return e<t?1:e>t?-1:0}function Xi(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Zi(e,t,n){for(;t<n;){let r=e[t];e[t]=e[n],e[n]=r,++t,--n}}function Qi(e,t){let n=Array.isArray(t)?t:[t],r=n.length;for(let t=0;t<r;t++)e[e.length]=n[t]}function $i(e,t){let n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function ea(e,t,n){let r=t||Ji;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function ta(){return!0}function na(){return!1}function ra(){}function ia(e){let t,n,r;return function(){let i=Array.prototype.slice.call(arguments);return(!n||this!==r||!$i(i,n))&&(r=this,n=i,t=e.apply(this,arguments)),t}}function aa(e){function t(){let t;try{t=e()}catch(e){return Promise.reject(e)}return t instanceof Promise?t:Promise.resolve(t)}return t()}var oa=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},sa=class extends Ki{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||(this.listeners_={}),r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new oa(e):e;i.target||(i.target=this.eventTarget_||this);let a=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,ra);delete a[n]}return s}disposeInternal(){this.listeners_&&Ui(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=ra,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},ca=class extends sa{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(N.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=j(this,e[i],t);return r}return j(this,e,t)}
2onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=Gi(this,e[i],t)}else n=Gi(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)la(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};ca.prototype.on,ca.prototype.once,ca.prototype.un;function la(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)M(e[t]);else M(e)}function P(){throw Error(`Unimplemented abstract method.`)}var ua=0;function F(e){return e.ol_uid||(e.ol_uid=String(++ua))}var da=class extends oa{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},fa=class extends ca{constructor(e){super(),this.on,this.once,this.un,F(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new da(n,e,t)),n=Hi.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new da(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||(this.values_={});if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||(this.values_={}),e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],Wi(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},pa={LENGTH:`length`},ma=class extends oa{constructor(e,t,n){super(e),this.element=t,this.index=n}},ha=class extends fa{constructor(e,t){if(super(),this.on,this.once,this.un,t=t||{},this.unique_=!!t.unique,this.array_=e==null?[]:e,this.unique_)for(let e=1,t=this.array_.length;e<t;++e)this.assertUnique_(this.array_[e],e);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(e){for(let t=0,n=e.length;t<n;++t)this.push(e[t]);return this}forEach(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)e(t[n],n,t)}getArray(){return this.array_}item(e){return this.array_[e]}getLength(){return this.get(pa.LENGTH)}insertAt(e,t){if(e<0||e>this.getLength())throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t),this.array_.splice(e,0,t),this.updateLength_(),this.dispatchEvent(new ma(Vi.ADD,t,e))}pop(){return this.removeAt(this.getLength()-1)}push(e){let t=this.getLength();return this.insertAt(t,e),this.getLength()}remove(e){let t=this.array_;for(let n=0,r=t.length;n<r;++n)if(t[n]===e)return this.removeAt(n)}removeAt(e){if(e<0||e>=this.getLength())return;let t=this.array_[e];return this.array_.splice(e,1),this.updateLength_(),this.dispatchEvent(new ma(Vi.REMOVE,t,e)),t}setAt(e,t){if(e>=this.getLength()){this.insertAt(e,t);return}if(e<0)throw Error(`Index out of bounds: `+e);this.unique_&&this.assertUnique_(t,e);let n=this.array_[e];this.array_[e]=t,this.dispatchEvent(new ma(Vi.REMOVE,n,e)),this.dispatchEvent(new ma(Vi.ADD,t,e))}updateLength_(){this.set(pa.LENGTH,this.array_.length)}assertUnique_(e,t){let n=this.array_;for(let r=0,i=n.length;r<i;++r)if(n[r]===e&&r!==t)throw Error(`Duplicate item added to a unique collection`)}},ga=class extends oa{constructor(e,t,n){super(e),this.map=t,this.frameState=n===void 0?null:n}},_a=class extends ga{constructor(e,t,n,r,i,a){super(e,t,i),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=r!==void 0&&r,this.activePointers=a}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(e){this.pixel_=e}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(e){this.coordinate_=e}preventDefault(){super.preventDefault(),`preventDefault`in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),`stopPropagation`in this.originalEvent&&this.originalEvent.stopPropagation()}},I={SINGLECLICK:`singleclick`,CLICK:N.CLICK,DBLCLICK:N.DBLCLICK,POINTERDRAG:`pointerdrag`,POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},va=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;va.includes(`safari`)&&!va.includes(`chrom`)&&(va.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(va));var ya=va.includes(`webkit`)&&!va.includes(`edge`),ba=va.includes(`macintosh`),xa=typeof devicePixelRatio<`u`?devicePixelRatio:1,Sa=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,Ca=typeof Image<`u`&&Image.prototype.decode,wa=(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})(),Ta={POINTERMOVE:`pointermove`,POINTERDOWN:`pointerdown`,POINTERUP:`pointerup`,POINTEROVER:`pointerover`,POINTEROUT:`pointerout`,POINTERENTER:`pointerenter`,POINTERLEAVE:`pointerleave`,POINTERCANCEL:`pointercancel`},Ea=class extends sa{constructor(e,t){super(e),this.map_=e,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=t===void 0?1:t,this.down_=null;let n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=j(n,Ta.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=j(n,Ta.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(N.TOUCHMOVE,this.boundHandleTouchMove_,wa?{passive:!1}:!1)}emulateClick_(e){let t=new _a(I.CLICK,this.map_,e);this.dispatchEvent(t),this.clickTimeoutId_===void 0?this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let t=new _a(I.SINGLECLICK,this.map_,e);this.dispatchEvent(t)},250):(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,t=new _a(I.DBLCLICK,this.map_,e),this.dispatchEvent(t))}updateActivePointers_(e){let t=e,n=t.pointerId;if(t.type==I.POINTERUP||t.type==I.POINTERCANCEL){delete this.trackedTouches_[n];for(let e in this.trackedTouches_)if(this.trackedTouches_[e].target!==t.target){delete this.trackedTouches_[e];break}}else(t.type==I.POINTERDOWN||t.type==I.POINTERMOVE)&&(this.trackedTouches_[n]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(e){this.updateActivePointers_(e);let t=new _a(I.POINTERUP,this.map_,e,void 0,void 0,this.activePointers_);this.dispatchEvent(t),this.emulateClicks_&&!t.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(e)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(M),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(e){return e.button===0}handlePointerDown_(e){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(e);let t=new _a(I.POINTERDOWN,this.map_,e,void 0,void 0,this.activePointers_);
2if(this.dispatchEvent(t),this.down_=new PointerEvent(e.type,e),Object.defineProperty(this.down_,"target",{writable:!1,value:e.target}),this.dragListenerKeys_.length===0){let e=this.map_.getOwnerDocument();this.dragListenerKeys_.push(j(e,I.POINTERMOVE,this.handlePointerMove_,this),j(e,I.POINTERUP,this.handlePointerUp_,this),j(this.element_,I.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==e&&this.dragListenerKeys_.push(j(this.element_.getRootNode(),I.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(e){if(this.isMoving_(e)){this.updateActivePointers_(e),this.dragging_=!0;let t=new _a(I.POINTERDRAG,this.map_,e,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(t)}}relayMoveEvent_(e){this.originalPointerMoveEvent_=e;let t=!!(this.down_&&this.isMoving_(e));this.dispatchEvent(new _a(I.POINTERMOVE,this.map_,e,t))}handleTouchMove_(e){let t=this.originalPointerMoveEvent_;(!t||t.defaultPrevented)&&(typeof e.cancelable!=`boolean`||e.cancelable===!0)&&e.preventDefault()}isMoving_(e){return this.dragging_||Math.abs(e.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(e.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(M(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(N.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(M(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(M),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},Da={POSTRENDER:`postrender`,MOVESTART:`movestart`,MOVEEND:`moveend`,LOADSTART:`loadstart`,LOADEND:`loadend`},Oa={LAYERGROUP:`layergroup`,SIZE:`size`,TARGET:`target`,VIEW:`view`},L={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function R(e,t){if(!e)throw Error(t)}var ka=1/0,Aa=class{constructor(e,t){this.priorityFunction_=e,this.keyFunction_=t,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ui(this.queuedElements_)}dequeue(){let e=this.elements_,t=this.priorities_,n=e[0];e.length==1?(e.length=0,t.length=0):(e[0]=e.pop(),t[0]=t.pop(),this.siftUp_(0));let r=this.keyFunction_(n);return delete this.queuedElements_[r],n}enqueue(e){R(!(this.keyFunction_(e)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let t=this.priorityFunction_(e);return t!=1/0&&(this.elements_.push(e),this.priorities_.push(t),this.queuedElements_[this.keyFunction_(e)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(e){return e*2+1}getRightChildIndex_(e){return e*2+2}getParentIndex_(e){return e-1>>1}heapify_(){let e;for(e=(this.elements_.length>>1)-1;e>=0;e--)this.siftUp_(e)}isEmpty(){return this.elements_.length===0}isKeyQueued(e){return e in this.queuedElements_}isQueued(e){return this.isKeyQueued(this.keyFunction_(e))}siftUp_(e){let t=this.elements_,n=this.priorities_,r=t.length,i=t[e],a=n[e],o=e;for(;e<r>>1;){let i=this.getLeftChildIndex_(e),a=this.getRightChildIndex_(e),o=a<r&&n[a]<n[i]?a:i;t[e]=t[o],n[e]=n[o],e=o}t[e]=i,n[e]=a,this.siftDown_(o,e)}siftDown_(e,t){let n=this.elements_,r=this.priorities_,i=n[t],a=r[t];for(;t>e;){let e=this.getParentIndex_(t);if(r[e]>a)n[t]=n[e],r[t]=r[e],t=e;else break}n[t]=i,r[t]=a}reprioritize(){let e=this.priorityFunction_,t=this.elements_,n=this.priorities_,r=0,i=t.length,a,o,s;for(o=0;o<i;++o)a=t[o],s=e(a),s==1/0?delete this.queuedElements_[this.keyFunction_(a)]:(n[r]=s,t[r++]=a);t.length=r,n.length=r,this.heapify_()}},ja=class extends Aa{constructor(e,t){super(t=>e.apply(null,t),e=>e[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=t,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(e){let t=super.enqueue(e);return t&&e[0].addEventListener(N.CHANGE,this.boundHandleTileChange_),t}getTilesLoading(){return this.tilesLoading_}handleTileChange(e){let t=e.target,n=t.getState();if(n===L.LOADED||n===L.ERROR||n===L.EMPTY){n!==L.ERROR&&t.removeEventListener(N.CHANGE,this.boundHandleTileChange_);let e=t.getKey();e in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[e],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(e,t){let n=0;for(;this.tilesLoading_<e&&n<t&&this.getCount()>0;){let e=this.dequeue()[0],t=e.getKey();e.getState()===L.IDLE&&!(t in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[t]=!0,++this.tilesLoading_,++n,e.load())}}};function Ma(e,t,n,r,i){if(!e||!(n in e.wantedTiles)||!e.wantedTiles[n][t.getKey()])return ka;let a=e.viewState.center,o=r[0]-a[0],s=r[1]-a[1];return 65536*Math.log(i)+Math.sqrt(o*o+s*s)/i}
2var Na={ANIMATING:0,INTERACTING:1},Pa={CENTER:`center`,RESOLUTION:`resolution`,ROTATION:`rotation`};function z(e,t,n){return Math.min(Math.max(e,t),n)}function Fa(e,t,n,r,i,a){let o=i-n,s=a-r;if(o!==0||s!==0){let c=((e-n)*o+(t-r)*s)/(o*o+s*s);c>1?(n=i,r=a):c>0&&(n+=o*c,r+=s*c)}return Ia(e,t,n,r)}function Ia(e,t,n,r){let i=n-e,a=r-t;return i*i+a*a}function La(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function Ra(e){return e*180/Math.PI}function za(e){return e*Math.PI/180}function Ba(e,t){let n=e%t;return n*t<0?n+t:n}function Va(e,t,n){return e+n*(t-e)}function Ha(e,t){let n=10**t;return Math.round(e*n)/n}function Ua(e,t){return Math.floor(Ha(e,t))}function Wa(e,t){return Math.ceil(Ha(e,t))}function Ga(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}function Ka(e,t,n){return(function(r,i,a,o,s){if(!r)return;if(!i&&!t)return r;let c=t?0:a[0]*i,l=t?0:a[1]*i,u=s?s[0]:0,d=s?s[1]:0,f=e[0]+c/2+u,p=e[2]-c/2+u,m=e[1]+l/2+d,h=e[3]-l/2+d;f>p&&(f=(p+f)/2,p=f),m>h&&(m=(h+m)/2,h=m);let g=z(r[0],f,p),_=z(r[1],m,h);if(o&&n&&i){let e=30*i;g+=-e*Math.log(1+Math.max(0,f-r[0])/e)+e*Math.log(1+Math.max(0,r[0]-p)/e),_+=-e*Math.log(1+Math.max(0,m-r[1])/e)+e*Math.log(1+Math.max(0,r[1]-h)/e)}return[g,_]})}function qa(e){return e}var B={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Ja(e){let t=no();for(let n=0,r=e.length;n<r;++n)lo(t,e[n]);return t}function Ya(e,t,n){return n?(n[0]=e[0]-t,n[1]=e[1]-t,n[2]=e[2]+t,n[3]=e[3]+t,n):[e[0]-t,e[1]-t,e[2]+t,e[3]+t]}function Xa(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e.slice()}function Za(e,t,n){let r,i;return r=t<e[0]?e[0]-t:e[2]<t?t-e[2]:0,i=n<e[1]?e[1]-n:e[3]<n?n-e[3]:0,r*r+i*i}function Qa(e,t){return eo(e,t[0],t[1])}function $a(e,t){return e[0]<=t[0]&&t[2]<=e[2]&&e[1]<=t[1]&&t[3]<=e[3]}function eo(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function to(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=B.UNKNOWN;return o<n?c|=B.LEFT:o>i&&(c|=B.RIGHT),s<r?c|=B.BELOW:s>a&&(c|=B.ABOVE),c===B.UNKNOWN&&(c=B.INTERSECTING),c}function no(){return[1/0,1/0,-1/0,-1/0]}function ro(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function io(e){return ro(1/0,1/0,-1/0,-1/0,e)}function ao(e,t){let n=e[0],r=e[1];return ro(n,r,n,r,t)}function oo(e,t,n,r,i){return uo(io(i),e,t,n,r)}function so(e,t){return e[0]==t[0]&&e[2]==t[2]&&e[1]==t[1]&&e[3]==t[3]}function co(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function lo(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function uo(e,t,n,r,i){for(;n<r;n+=i)fo(e,t[n],t[n+1]);return e}function fo(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function po(e,t){let n;return n=t(ho(e)),n||(n=t(go(e)),n)||(n=t(To(e)),n)||(n=t(wo(e)),n)?n:!1}function mo(e){let t=0;return Do(e)||(t=V(e)*xo(e)),t}function ho(e){return[e[0],e[1]]}function go(e){return[e[2],e[1]]}function _o(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function vo(e,t){let n;if(t===`bottom-left`)n=ho(e);else if(t===`bottom-right`)n=go(e);else if(t===`top-left`)n=wo(e);else if(t===`top-right`)n=To(e);else throw Error(`Invalid corner`);return n}function yo(e,t,n,r,i){let[a,o,s,c,l,u,d,f]=bo(e,t,n,r);return ro(Math.min(a,s,l,d),Math.min(o,c,u,f),Math.max(a,s,l,d),Math.max(o,c,u,f),i)}function bo(e,t,n,r){let i=t*r[0]/2,a=t*r[1]/2,o=Math.cos(n),s=Math.sin(n),c=i*o,l=i*s,u=a*o,d=a*s,f=e[0],p=e[1];return[f-c+d,p-l-u,f-c-d,p-l+u,f+c-d,p+l+u,f+c+d,p+l-u,f-c+d,p-l-u]}function xo(e){return e[3]-e[1]}function So(e,t,n){let r=n||no();return Eo(e,t)?(r[0]=e[0]>t[0]?e[0]:t[0],r[1]=e[1]>t[1]?e[1]:t[1],r[2]=e[2]<t[2]?e[2]:t[2],r[3]=e[3]<t[3]?e[3]:t[3]):io(r),r}function Co(e,t){if(!Eo(e,t))return[e.slice()];if($a(t,e))return[];let[n,r,i,a]=e,o=Math.max(n,t[0]),s=Math.max(r,t[1]),c=Math.min(i,t[2]),l=Math.min(a,t[3]),u=[];return o>n&&u.push([n,r,o,a]),c<i&&u.push([c,r,i,a]),s>r&&u.push([o,r,c,s]),l<a&&u.push([o,l,c,a]),u}function wo(e){return[e[0],e[3]]}function To(e){return[e[2],e[3]]}function V(e){return e[2]-e[0]}function Eo(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function Do(e){return e[2]<e[0]||e[3]<e[1]}function Oo(e,t){return t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}function ko(e,t,n){let r=!1,i=to(e,t),a=to(e,n);if(i===B.INTERSECTING||a===B.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&B.ABOVE&&!(i&B.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&B.RIGHT&&!(i&B.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&B.BELOW&&!(i&B.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&B.LEFT&&!(i&B.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function Ao(e,t){let n=t.getExtent(),r=_o(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=V(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function jo(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];Ao(e,t);let i=V(r);if(V(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function Mo(e,t){let n=[e];for(let e=0,r=t.length;e<r&&n.length>0;++e){let r=[];for(let i=0,a=n.length;i<a;++i)r.push(...Co(n[i],t[e]));n=r}return n}function No(e,t){return e[0]+=+t[0],e[1]+=+t[1],e}function Po(e,t){let n=!0;for(let r=e.length-1;r>=0;--r)if(e[r]!=t[r]){n=!1;break}return n}function Fo(e,t){let n=Math.cos(t),r=Math.sin(t),i=e[0]*n-e[1]*r,a=e[1]*n+e[0]*r;return e[0]=i,e[1]=a,e}function Io(e,t){return e[0]*=t,e[1]*=t,e}function Lo(e,t){if(t.canWrapX()){let n=V(t.getExtent()),r=Ro(e,t,n);r&&(e[0]-=r*n)}return e}
2function Ro(e,t,n){let r=t.getExtent(),i=0;return t.canWrapX()&&(e[0]<r[0]||e[0]>r[2])&&(n=n||V(r),i=Math.floor((e[0]-r[0])/n)),i}function zo(e,t,n){let r=Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])),i=[(t[0]-e[0])/r,(t[1]-e[1])/r],a=[-i[1],i[0]],o=Math.sqrt((n[0]-e[0])*(n[0]-e[0])+(n[1]-e[1])*(n[1]-e[1])),s=[(n[0]-e[0])/o,(n[1]-e[1])/o],c=r===0||o===0?0:Math.acos(z(s[0]*i[0]+s[1]*i[1],-1,1));return c=Math.max(c,1e-5),s[0]*a[0]+s[1]*a[1]>0?c:Math.PI*2-c}function Bo(e){return e**3}function Vo(e){return 1-Bo(1-e)}function Ho(e){return 3*e*e-2*e*e*e}function Uo(e){return e}function Wo(e,t,n){n=n||6371008.8;let r=za(e[1]),i=za(t[1]),a=(i-r)/2,o=za(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var Go={info:1,warn:2,error:3,none:4},Ko=Go.info;function qo(...e){Ko>Go.warn||console.warn(...e)}var Jo={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},Yo=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global!==void 0&&e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||Jo[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},Xo=6378137,Zo=Math.PI*Xo,Qo=[-Zo,-Zo,Zo,Zo],$o=[-180,-85,180,85],es=Xo*Math.log(Math.tan(Math.PI/2)),ts=class extends Yo{constructor(e){super({code:e,units:`m`,extent:Qo,global:!0,worldExtent:$o,getPointResolution:function(e,t){return e/Math.cosh(t[1]/Xo)}})}},ns=[new ts(`EPSG:3857`),new ts(`EPSG:102100`),new ts(`EPSG:102113`),new ts(`EPSG:900913`),new ts(`http://www.opengis.net/def/crs/EPSG/0/3857`),new ts(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function rs(e,t,n,r){var i;let a=e.length;n=n>1?n:2,r=(i=r)==null?n:i,t===void 0&&(t=n>2?e.slice():Array(a));for(let n=0;n<a;n+=r){t[n]=Zo*e[n]/180;let r=Xo*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>es?r=es:r<-es&&(r=-es),t[n+1]=r}return t}function is(e,t,n,r){var i;let a=e.length;n=n>1?n:2,r=(i=r)==null?n:i,t===void 0&&(t=n>2?e.slice():Array(a));for(let n=0;n<a;n+=r)t[n]=180*e[n]/Zo,t[n+1]=360*Math.atan(Math.exp(e[n+1]/Xo))/Math.PI-90;return t}var as=6378137,os=[-180,-90,180,90],ss=Math.PI*as/180,cs=class extends Yo{constructor(e,t){super({code:e,units:`degrees`,extent:os,axisOrientation:t,global:!0,metersPerUnit:ss,worldExtent:os})}},ls=[new cs(`CRS:84`),new cs(`EPSG:4326`,`neu`),new cs(`urn:ogc:def:crs:OGC:1.3:CRS84`),new cs(`urn:ogc:def:crs:OGC:2:84`),new cs(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new cs(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new cs(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],us={};function ds(e){return us[e]||us[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function fs(e,t){us[e]=t}var ps={};function ms(e,t,n){let r=e.getCode(),i=t.getCode();r in ps||(ps[r]={}),ps[r][i]=n}function hs(e,t){return e in ps&&t in ps[e]?ps[e][t]:null}var gs=.9996,_s=.00669438,vs=_s*_s,ys=vs*_s,bs=_s/.99330562,xs=Math.sqrt(.99330562),Ss=(1-xs)/(1+xs),Cs=Ss*Ss,ws=Cs*Ss,Ts=ws*Ss,Es=Ts*Ss,Ds=1-_s/4-3*vs/64-5*ys/256,Os=.002514607064228144,ks=26390466021299826e-22,As=35*ys/3072,js=3/2*Ss-27/32*ws+269/512*Es,Ms=21/16*Cs-55/32*Ts,Ns=151/96*ws-417/128*Es,Ps=1097/512*Ts,Fs=6378137;function Is(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/gs/(Fs*Ds),a=i+js*Math.sin(2*i)+Ms*Math.sin(4*i)+Ns*Math.sin(6*i)+Ps*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-_s*s,p=Fs/Math.sqrt(1-_s*s),m=.99330562/f,h=bs*c**2,g=h*h,_=r/(p*gs),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*bs))+S/720*(61+90*u+298*h+45*d-252*bs-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*bs+24*d))/c;return w=Ga(w+za(Hs(n.number)),-Math.PI,Math.PI),[Ra(w),Ra(C)]}var Ls=-80,Rs=84,zs=-180,Bs=180;function Vs(e,t,n){e=Ga(e,zs,Bs),t<Ls?t=Ls:t>Rs&&(t=Rs);let r=za(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=za(e),u=za(Hs(n.number)),d=Fs/Math.sqrt(1-_s*i**2),f=bs*a**2,p=a*Ga(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h
2*p,_=g*p,v=_*p,y=Fs*(Ds*r-Os*Math.sin(2*r)+ks*Math.sin(4*r)-As*Math.sin(6*r)),b=gs*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*bs))+5e5,x=gs*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*bs)));return n.north||(x+=1e7),[b,x]}function Hs(e){return(e-1)*6-180+3}var Us=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Ws(e){let t=0;for(let n of Us){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function Gs(e,t){return function(n,r,i,a){var o;let s=n.length;i=i>1?i:2,a=(o=a)==null?i:o,r||(r=i>2?n.slice():Array(s));for(let i=0;i<s;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function Ks(e){return Ws(e)?new Yo({code:e,units:`m`}):null}function qs(e){let t=Ws(e.getCode());return t?{forward:Gs(Vs,t),inverse:Gs(Is,t)}:null}var Js=[qs],Ys=[Ks],Xs=!0;function Zs(e){Xs=!(e===void 0||e)}function Qs(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function $s(e){fs(e.getCode(),e),ms(e,e,Qs)}function ec(e){e.forEach($s)}function tc(e){if(typeof e!=`string`)return e;let t=ds(e);if(t)return t;for(let t of Ys){let n=t(e);if(n)return n}return null}function nc(e,t,n,r){e=tc(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/Jo[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=lc(e,tc(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(Wo(e.slice(0,2),e.slice(2,4))+Wo(e.slice(4,6),e.slice(6,8)))/2}let s=r?Jo[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function rc(e){ec(e),e.forEach(function(t){e.forEach(function(e){t!==e&&ms(t,e,Qs)})})}function ic(e,t,n,r){e.forEach(function(e){t.forEach(function(t){ms(e,t,n),ms(t,e,r)})})}function ac(e,t){return e?typeof e==`string`?tc(e):e:tc(t)}function oc(e){return(function(t,n,r,i){var a;let o=t.length;r=r===void 0?2:r,i=(a=i)==null?r:a,n=n===void 0?Array(o):n;for(let a=0;a<o;a+=i){let o=e(t.slice(a,a+r)),s=o.length;for(let e=0,r=i;e<r;++e)n[a+e]=e>=s?t[a+e]:o[e]}return n})}function sc(e,t){return Zs(),fc(e,`EPSG:4326`,t===void 0?`EPSG:3857`:t)}function cc(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||lc(e,t)===Qs)&&n}function lc(e,t){let n=e.getCode(),r=t.getCode(),i=hs(n,r);if(i)return i;let a=null,o=null;for(let n of Js)a||(a=n(e)),o||(o=n(t));if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=hs(s,r);e&&(i=uc(a.inverse,e))}else if(a)i=uc(a.inverse,o.forward);else{let e=hs(n,s);e&&(i=uc(e,o.forward))}return i&&($s(e),$s(t),ms(e,t,i)),i}function uc(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function dc(e,t){return lc(tc(e),tc(t))}function fc(e,t,n){let r=dc(t,n);if(!r){let e=tc(t).getCode(),r=tc(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}var pc=null;function mc(){return pc}function hc(e,t){return e}function gc(e,t){return Xs&&!Po(e,[0,0])&&e[0]>=-180&&e[0]<=180&&e[1]>=-90&&e[1]<=90&&(Xs=!1,qo(`Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.`)),e}function _c(e,t){return e}function vc(e,t){return e}function yc(e,t){return e}function bc(){rc(ns),rc(ls),ic(ls,ns,rs,is)}bc();var xc=[1,0,0,1,0,0];function Sc(){return xc.slice(0)}function Cc(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function H(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}function wc(e,t,n,r,i,a,o,s){let c=Math.sin(a),l=Math.cos(a);return e[0]=r*l,e[1]=i*c,e[2]=-r*c,e[3]=i*l,e[4]=o*r*l-s*r*c+t,e[5]=o*i*c+s*i*l+n,e}function Tc(e,t){let n=Ec(t);R(n!==0,`Transformation matrix cannot be inverted`);let r=t[0],i=t[1],a=t[2],o=t[3],s=t[4],c=t[5];return e[0]=o/n,e[1]=-i/n,e[2]=-a/n,e[3]=r/n,e[4]=(a*c-o*s)/n,e[5]=-(r*c-i*s)/n,e}function Ec(e){return e[0]*e[3]-e[1]*e[2]}var Dc=[1e5,1e5,1e5,1e5,2,2];function Oc(e){return`matrix(`+e.join(`, `)+`)`}function kc(e){return e.substring(7,e.length-1).split(`,`).map(parseFloat)}function Ac(e,t){let n=kc(e),r=kc(t);for(let e=0;e<6;++e)if(Math.round((n[e]-r[e])*Dc[e])!==0)return!1;return!0}function jc(e,t,n,r,i,a,o){a=a||[],o=o||2;let s=0;for(let c=t;c<n;c+=r){let t=e[c],n=e[c+1];a[s++]=i[0]*t+i[2]*n+i[4],a[s++]=i[1]*t+i[3]*n+i[5];for(let t=2;t<o;t++)a[s++]=e[c+t]}return a&&a.length!=s&&(a.length=s),a}function Mc(e,t,n,r,i,a,o){o=o||[];let s=Math.cos(i),c=Math.sin(i),l=a[0],u=a[1],d=0;for(let i=t;i<n;i+=r){let t=e[i]-l,n=e[i+1]-u;o[d++]=l+t*s-n*c,o[d++]=u+t*c+n*s;for(let t=i+2;t<i+r;++t)o[d++]=e[t]}return o&&o.length!=d&&(o.length=d),o}function Nc(e,t,n,r,i,a,o,s){s=s||[];let c=o[0],l=o[1],u=0;for(let o=t;o<n;o+=r){let t=e[o]-c,n=e[o+1]-l;s[u++]=c+i*t,s[u++]=l+a*n;for(let t=o+2;t<o+r;++t)s[u++]=e[t]}return s&&s.length!=u&&(s.length=u),s}function Pc(e,t,n,r,i,a,o){o=o||[];let s=0;for(let c=t;c<n;c+=r){o[s++]=e[c]+i,o[s++]=e[c+1]+a;for(let t=c+2;t<c+r;++t)o[s++]=e[t]}return o&&o.length!=s&&(o.length=s),o}var Fc=Sc(),Ic=[NaN,NaN],Lc=class extends fa{constructor(){super(),this.extent_=no(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ia((e,t,n)=>
2{if(!n)return this.getSimplifiedGeometry(t);let r=this.clone();return r.applyTransform(n),r.getSimplifiedGeometry(t)})}simplifyTransformed(e,t){return this.simplifyTransformedInternal(this.getRevision(),e,t)}clone(){return P()}closestPointXY(e,t,n,r){return P()}containsXY(e,t){return this.closestPointXY(e,t,Ic,Number.MIN_VALUE)===0}getClosestPoint(e,t){return t=t||[NaN,NaN],this.closestPointXY(e[0],e[1],t,1/0),t}intersectsCoordinate(e){return this.containsXY(e[0],e[1])}computeExtent(e){return P()}getExtent(e){if(this.extentRevision_!=this.getRevision()){let e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&io(e),this.extentRevision_=this.getRevision()}return Oo(this.extent_,e)}rotate(e,t){P()}scale(e,t,n){P()}simplify(e){return this.getSimplifiedGeometry(e*e)}getSimplifiedGeometry(e){return P()}getType(){return P()}applyTransform(e){P()}intersectsExtent(e){return P()}translate(e,t){P()}transform(e,t){let n=tc(e),r=n.getUnits()==`tile-pixels`?function(e,r,i){let a=n.getExtent(),o=n.getWorldExtent(),s=xo(o)/xo(a);wc(Fc,o[0],o[3],s,-s,0,0,0);let c=jc(e,0,e.length,i,Fc,r),l=dc(n,t);return l?l(c,c,i):c}:dc(n,t);return this.applyTransform(r),this}},Rc=class extends Lc{constructor(){super(),this.layout=`XY`,this.stride=2,this.flatCoordinates}computeExtent(e){return oo(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}getCoordinates(){return P()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(e){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),e<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&e<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let t=this.getSimplifiedGeometryInternal(e);return t.getFlatCoordinates().length<this.flatCoordinates.length?t:(this.simplifiedGeometryMaxMinSquaredTolerance=e,this)}getSimplifiedGeometryInternal(e){return this}getStride(){return this.stride}setFlatCoordinates(e,t){this.stride=Bc(e),this.layout=e,this.flatCoordinates=t}setCoordinates(e,t){P()}setLayout(e,t,n){let r;if(e)r=Bc(e);else{for(let e=0;e<n;++e){if(t.length===0){this.layout=`XY`,this.stride=2;return}t=t[0]}r=t.length,e=zc(r)}this.layout=e,this.stride=r}applyTransform(e){this.flatCoordinates&&(e(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith(`XYZ`)?3:2,this.stride),this.changed())}rotate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Mc(n,0,n.length,r,e,t,n),this.changed()}}scale(e,t,n){t===void 0&&(t=e),n||(n=_o(this.getExtent()));let r=this.getFlatCoordinates();if(r){let i=this.getStride();Nc(r,0,r.length,i,e,t,n,r),this.changed()}}translate(e,t){let n=this.getFlatCoordinates();if(n){let r=this.getStride();Pc(n,0,n.length,r,e,t,n),this.changed()}}};function zc(e){let t;return e==2?t=`XY`:e==3?t=`XYZ`:e==4&&(t=`XYZM`),t}function Bc(e){let t;return e==`XY`?t=2:e==`XYZ`||e==`XYM`?t=3:e==`XYZM`&&(t=4),t}function Vc(e,t,n){let r=e.getFlatCoordinates();if(!r)return null;let i=e.getStride();return jc(r,0,r.length,i,t,n)}function Hc(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1],s=0,c=0;for(;t<n;t+=r){let n=e[t]-a,r=e[t+1]-o;i+=c*n-s*r,s=n,c=r}return i/2}function Uc(e,t,n,r){let i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a];i+=Hc(e,t,o,r),t=o}return i}function Wc(e,t,n,r,i,a,o){let s=e[t],c=e[t+1],l=e[n]-s,u=e[n+1]-c,d;if(l===0&&u===0)d=t;else{let f=((i-s)*l+(a-c)*u)/(l*l+u*u);if(f>1)d=n;else if(f>0){for(let i=0;i<r;++i)o[i]=Va(e[t+i],e[n+i],f);o.length=r;return}else d=t}for(let t=0;t<r;++t)o[t]=e[d+t];o.length=r}function Gc(e,t,n,r,i){let a=e[t],o=e[t+1];for(t+=r;t<n;t+=r){let n=e[t],r=e[t+1],s=Ia(a,o,n,r);s>i&&(i=s),a=n,o=r}return i}function Kc(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a];i=Gc(e,t,o,r,i),t=o}return i}function qc(e,t,n,r,i,a,o,s,c,l,u){if(t==n)return l;let d,f;if(i===0){if(f=Ia(o,s,e[t],e[t+1]),f<l){for(d=0;d<r;++d)c[d]=e[t+d];return c.length=r,f}return l}u=u||[NaN,NaN];let p=t+r;for(;p<n;)if(Wc(e,p-r,p,r,o,s,u),f=Ia(o,s,u[0],u[1]),f<l){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r,p+=r}else p+=r*Math.max((Math.sqrt(f)-Math.sqrt(l))/i|0,1);if(a&&(Wc(e,n-r,t,r,o,s,u),f=Ia(o,s,u[0],u[1]),f<l)){for(l=f,d=0;d<r;++d)c[d]=u[d];c.length=r}return l}
2function Jc(e,t,n,r,i,a,o,s,c,l,u){u=u||[NaN,NaN];for(let d=0,f=n.length;d<f;++d){let f=n[d];l=qc(e,t,f,r,i,a,o,s,c,l,u),t=f}return l}function Yc(e,t,n,r){for(let r=0,i=n.length;r<i;++r)e[t++]=n[r];return t}function Xc(e,t,n,r){for(let i=0,a=n.length;i<a;++i){let a=n[i];for(let n=0;n<r;++n)e[t++]=a[n]}return t}function Zc(e,t,n,r,i){i=i||[];let a=0;for(let o=0,s=n.length;o<s;++o){let s=Xc(e,t,n[o],r);i[a++]=s,t=s}return i.length=a,i}function Qc(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=t;o<n;o+=r)i[a++]=e.slice(o,o+r);return i.length=a,i}function $c(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=Qc(e,t,s,r,i[a]),t=s}return i.length=a,i}function el(e,t,n,r,i){i=i===void 0?[]:i;let a=0;for(let o=0,s=n.length;o<s;++o){let s=n[o];i[a++]=s.length===1&&s[0]===t?[]:$c(e,t,s,r,i[a]),t=s[s.length-1]}return i.length=a,i}function tl(e,t,n,r,i){return!po(i,function(i){return!nl(e,t,n,r,i[0],i[1])})}function nl(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function rl(e,t,n,r,i,a){if(n.length===0||!nl(e,t,n[0],r,i,a))return!1;for(let t=1,o=n.length;t<o;++t)if(nl(e,n[t-1],n[t],r,i,a))return!1;return!0}function il(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function al(e,t,n,r,i,a){var o;return a=(o=a)==null?uo(no(),e,t,n,r):o,Eo(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]||il(e,t,n,r,function(e,t){return ko(i,e,t)}):!1}function ol(e,t,n,r,i){return!!(al(e,t,n,r,i)||nl(e,t,n,r,i[0],i[1])||nl(e,t,n,r,i[0],i[3])||nl(e,t,n,r,i[2],i[1])||nl(e,t,n,r,i[2],i[3]))}function sl(e,t,n,r,i){if(!ol(e,t,n[0],r,i))return!1;if(n.length===1)return!0;for(let t=1,a=n.length;t<a;++t)if(tl(e,n[t-1],n[t],r,i)&&!al(e,n[t-1],n[t],r,i))return!1;return!0}function cl(e,t,n,r,i,a,o){let s=(n-t)/r;if(s<3){for(;t<n;t+=r)a[o++]=e[t],a[o++]=e[t+1];return o}let c=Array(s);c[0]=1,c[s-1]=1;let l=[t,n-r],u=0;for(;l.length>0;){let n=l.pop(),a=l.pop(),o=0,s=e[a],d=e[a+1],f=e[n],p=e[n+1];for(let t=a+r;t<n;t+=r){let n=e[t],r=e[t+1],i=Fa(n,r,s,d,f,p);i>o&&(u=t,o=i)}o>i&&(c[(u-t)/r]=1,a+r<u&&l.push(a,u),u+r<n&&l.push(u,n))}for(let n=0;n<s;++n)c[n]&&(a[o++]=e[t+n*r],a[o++]=e[t+n*r+1]);return o}function ll(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=cl(e,t,l,r,i,a,o),s.push(o),t=l}return o}function ul(e,t){return t*Math.round(e/t)}function dl(e,t,n,r,i,a,o){if(t==n)return o;let s=ul(e[t],i),c=ul(e[t+1],i);t+=r,a[o++]=s,a[o++]=c;let l,u;do if(l=ul(e[t],i),u=ul(e[t+1],i),t+=r,t==n)return a[o++]=l,a[o++]=u,o;while(l==s&&u==c);for(;t<n;){let n=ul(e[t],i),d=ul(e[t+1],i);if(t+=r,n==l&&d==u)continue;let f=l-s,p=u-c,m=n-s,h=d-c;if(f*h==p*m&&(f<0&&m<f||f==m||f>0&&m>f)&&(p<0&&h<p||p==h||p>0&&h>p)){l=n,u=d;continue}a[o++]=l,a[o++]=u,s=l,c=u,l=n,u=d}return a[o++]=l,a[o++]=u,o}function fl(e,t,n,r,i,a,o,s){for(let c=0,l=n.length;c<l;++c){let l=n[c];o=dl(e,t,l,r,i,a,o),s.push(o),t=l}return o}var pl=class e extends Rc{constructor(e,t){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,t!==void 0&&!Array.isArray(e[0])?this.setFlatCoordinates(t,e):this.setCoordinates(e,t)}clone(){return new e(this.flatCoordinates.slice(),this.layout)}closestPointXY(e,t,n,r){return r<Za(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Gc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),qc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,e,t,n,r))}getArea(){return Hc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return Qc(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let n=[];return n.length=cl(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,n,0),new e(n,`XY`)}getType(){return`LinearRing`}intersectsExtent(e){return al(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Xc(this.flatCoordinates,0,e,this.stride),this.changed()}},ml=class e extends Rc{constructor(e,t){super(),this.setCoordinates(e,t)}clone(){let t=new e(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(e,t,n,r){let i=this.flatCoordinates,a=Ia(e,t,i[0],i[1]);if(a<r){let e=this.stride;for(let t=0;t<e;++t)n[t]=i[t];return n.length=e,a}return r}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(e){return ao(this.flatCoordinates,e)}getType(){return`Point`}intersectsExtent(e){return eo(e,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(e,t){this.setLayout(t,e,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Yc(this.flatCoordinates,0,e,this.stride),this.changed()}};function hl(e,t,n,r,i,a,o){let s,c,l,u,d,f,p,m=i[a+1],h=[];for(let i=0,a=n.length;i<a;++i){let a=n[i];for(u=e[a-r],f=e[a-r+1],s=t;s<a;
2s+=r)d=e[s],p=e[s+1],(m<=f&&p<=m||f<=m&&m<=p)&&(l=(m-f)/(p-f)*(d-u)+u,h.push(l)),u=d,f=p}let g=NaN,_=-1/0;for(h.sort(Ji),u=h[0],s=1,c=h.length;s<c;++s){d=h[s];let i=Math.abs(d-u);i>_&&(l=(u+d)/2,rl(e,t,n,r,l,m)&&(g=l,_=i)),u=d}return isNaN(g)&&(g=i[a]),o?(o.push(g,m,_),o):[g,m,_]}function gl(e,t,n,r,i){let a=[];for(let o=0,s=n.length;o<s;++o){let s=n[o];a=hl(e,t,s,r,i,2*o,a),t=s[s.length-1]}return a}function _l(e,t,n,r){for(;t<n-r;){for(let i=0;i<r;++i){let a=e[t+i];e[t+i]=e[n-r+i],e[n-r+i]=a}t+=r,n-=r}}function vl(e,t,n,r){let i=0,a=e[n-r],o=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];i+=(n-a)*(r+o),a=n,o=r}return i===0?void 0:i>0}function yl(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=vl(e,t,o,r);if(a===0){if(i&&s||!i&&!s)return!1}else if(i&&!s||!i&&s)return!1;t=o}return!0}function bl(e,t,n,r,i){i=i!==void 0&&i;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=vl(e,t,o,r);(a===0?i&&s||!i&&!s:i&&!s||!i&&s)&&_l(e,t,o,r),t=o}return t}function xl(e,t){let n=[],r=0,i=0,a;for(let o=0,s=t.length;o<s;++o){let s=t[o],c=vl(e,r,s,2);if(a===void 0&&(a=c),c===a)n.push(t.slice(i,o+1));else{if(n.length===0)continue;n[n.length-1].push(t[i])}i=o+1,r=s}return n}var Sl=class e extends Rc{constructor(e,t,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,t!==void 0&&n?(this.setFlatCoordinates(t,e),this.ends_=n):this.setCoordinates(e,t)}appendLinearRing(e){this.flatCoordinates?Qi(this.flatCoordinates,e.getFlatCoordinates()):this.flatCoordinates=e.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new e(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(e,t,n,r){return r<Za(this.getExtent(),e,t)?r:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Kc(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Jc(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,e,t,n,r))}containsXY(e,t){return rl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,t)}getArea(){return Uc(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(e){let t;return e===void 0?t=this.flatCoordinates:(t=this.getOrientedFlatCoordinates().slice(),bl(t,0,this.ends_,this.stride,e)),$c(t,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let e=_o(this.getExtent());this.flatInteriorPoint_=hl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ml(this.getFlatInteriorPoint(),`XYM`)}getLinearRingCount(){return this.ends_.length}getLinearRing(e){return e<0||this.ends_.length<=e?null:new pl(this.flatCoordinates.slice(e===0?0:this.ends_[e-1],this.ends_[e]),this.layout)}getLinearRings(){let e=this.layout,t=this.flatCoordinates,n=this.ends_,r=[],i=0;for(let a=0,o=n.length;a<o;++a){let o=n[a],s=new pl(t.slice(i,o),e);r.push(s),i=o}return r}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let e=this.flatCoordinates;yl(e,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=e:(this.orientedFlatCoordinates_=e.slice(),this.orientedFlatCoordinates_.length=bl(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let n=[],r=[];return n.length=fl(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),n,0,r),new e(n,`XY`,r)}getType(){return`Polygon`}intersectsExtent(e){return sl(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,e)}setCoordinates(e,t){this.setLayout(t,e,2),this.flatCoordinates||(this.flatCoordinates=[]);let n=Zc(this.flatCoordinates,0,e,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}};function Cl(e){if(Do(e))throw Error(`Cannot create polygon from empty extent`);let t=e[0],n=e[1],r=e[2],i=e[3],a=[t,n,t,i,r,i,r,n,t,n];return new Sl(a,`XY`,[a.length])}function wl(e,t,n,r){let i=V(t)/n[0],a=xo(t)/n[1];return r?Math.min(e,Math.max(i,a)):Math.min(e,Math.min(i,a))}function Tl(e,t,n){let r=Math.min(e,t);return r*=Math.log(1+50*Math.max(0,e/t-1))/50+1,n&&(r=Math.max(r,n),r/=Math.log(1+50*Math.max(0,n/e-1))/50+1),z(r,n/2,t*2)}function El(e,t,n,r){return t=t===void 0||t,(function(i,a,o,s){if
2(i!==void 0){let c=e[0],l=e[e.length-1],u=n?wl(c,n,o,r):c;if(s)return t?Tl(i,u,l):z(i,l,u);let d=Math.floor(Xi(e,Math.min(u,i),a));return e[d]>u&&d<e.length-1?e[d+1]:e[d]}})}function Dl(e,t,n,r,i,a){return r=r===void 0||r,n=n===void 0?0:n,(function(o,s,c,l){if(o!==void 0){let u=i?wl(t,i,c,a):t;if(l)return r?Tl(o,u,n):z(o,n,u);let d=Math.ceil(Math.log(t/u)/Math.log(e)-1e-9),f=-s*.499999999+.5,p=Math.floor(Math.log(t/Math.min(u,o))/Math.log(e)+f);return z(t/e**+Math.max(d,p),n,u)}})}function Ol(e,t,n,r,i){return n=n===void 0||n,(function(a,o,s,c){if(a!==void 0){let o=r?wl(e,r,s,i):e;return!n||!c?z(a,t,o):Tl(a,o,t)}})}function kl(e){if(e!==void 0)return 0}function Al(e){if(e!==void 0)return e}function jl(e){let t=2*Math.PI/e;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function Ml(e){let t=e===void 0?za(5):e;return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}var Nl=0,Pl=class extends fa{constructor(e){super(),this.on,this.once,this.un,e=Object.assign({},e),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=ac(e.projection,`EPSG:3857`),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,e.projection&&Zs(),e.center&&(e.center=gc(e.center,this.projection_)),e.extent&&(e.extent=vc(e.extent,this.projection_)),this.applyOptions_(e)}applyOptions_(e){let t=Object.assign({},e);for(let e in Pa)delete t[e];this.setProperties(t,!0);let n=Ll(e);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=e.resolutions,this.padding_=e.padding,this.minZoom_=n.minZoom;let r=Il(e),i=n.constraint,a=Rl(e);this.constraints_={center:r,resolution:i,rotation:a},this.setRotation(e.rotation===void 0?0:e.rotation),this.setCenterInternal(e.center===void 0?null:e.center),e.resolution===void 0?e.zoom!==void 0&&this.setZoom(e.zoom):this.setResolution(e.resolution)}get padding(){return this.padding_}set padding(e){let t=this.padding_;this.padding_=e;let n=this.getCenterInternal();if(n){let r=e||[0,0,0,0];t=t||[0,0,0,0];let i=this.getResolution(),a=i/2*(r[3]-t[3]+t[1]-r[1]),o=i/2*(r[0]-t[0]+t[2]-r[2]);this.setCenterInternal([n[0]+a,n[1]-o])}}getUpdatedOptions_(e){let t=this.getProperties();return t.resolution===void 0?t.zoom=this.getZoom():t.resolution=this.getResolution(),t.center=this.getCenterInternal(),t.rotation=this.getRotation(),Object.assign({},t,e)}animate(e){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);let t=Array(arguments.length);for(let e=0;e<t.length;++e){let n=arguments[e];n.center&&(n=Object.assign({},n),n.center=gc(n.center,this.getProjection())),n.anchor&&(n=Object.assign({},n),n.anchor=gc(n.anchor,this.getProjection())),t[e]=n}this.animateInternal.apply(this,t)}animateInternal(e){let t=arguments.length,n;t>1&&typeof arguments[t-1]==`function`&&(n=arguments[t-1],--t);let r=0;for(;r<t&&!this.isDef();++r){let e=arguments[r];e.center&&this.setCenterInternal(e.center),e.zoom===void 0?e.resolution&&this.setResolution(e.resolution):this.setZoom(e.zoom),e.rotation!==void 0&&this.setRotation(e.rotation)}if(r===t){n&&Fl(n,!0);return}let i=Date.now(),a=this.targetCenter_.slice(),o=this.targetResolution_,s=this.targetRotation_,c=[];for(;r<t;++r){let e=arguments[r],t={start:i,complete:!1,anchor:e.anchor,duration:e.duration===void 0?1e3:e.duration,easing:e.easing||Ho,callback:n};if(e.center&&(t.sourceCenter=a,t.targetCenter=e.center.slice(),a=t.targetCenter),e.zoom===void 0?e.resolution&&(t.sourceResolution=o,t.targetResolution=e.resolution,o=t.targetResolution):(t.sourceResolution=o,t.targetResolution=this.getResolutionForZoom(e.zoom),o=t.targetResolution),e.rotation!==void 0){t.sourceRotation=s;let n=Ba(e.rotation-s+Math.PI,2*Math.PI)-Math.PI;t.targetRotation=s+n,s=t.targetRotation}zl(t)?t.complete=!0:i+=t.duration,c.push(t)}this.animations_.push(c),this.setHint(Na.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[Na.ANIMATING]>0}getInteracting(){return this.hints_[Na.INTERACTING]>0}cancelAnimations(){this.setHint(Na.ANIMATING,-this.hints_[Na.ANIMATING]);let e;for(let t=0,n=this.animations_.length;t<n;++t){let n=this.animations_[t];if(n[0].callback&&Fl(n[0].callback,!1),!e)for(let t=0,r=n.length;t<r;++t){let r=n[t];if(!r.complete){e=r.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=e,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(this.updateAnimationKey_!==void 0&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let e=Date.now(),t=!1;for(let n=this.animations_.length-1;n>=0;--n){let r=this.animations_[n],i=!0;for(let n=0,a=r.length;n<a;++n){let a=r[n];if(a.complete)continue;let o=e-a.start,s=a.duration>0?o/a.duration:1;s>=1?(a.complete=!0,s=1):i=!1;let c=a.easing(s);if(a.sourceCenter){let e=a.sourceCenter[0],t=a.sourceCenter[1],n=a.targetCenter[0],r=a.targetCenter[1];this.nextCenter_=a.targetCenter;let i=e+c*(n-e),o=t+c*(r-t);this.targetCenter_=[i,o]}if(a.sourceResolution&&a.targetResolution){let e=c===1?a.targetResolution:a.sourceResolution+c*(a.targetResolution-a.sourceResolution);if(a.anchor){let t=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(e,0,t,!0);this.targetCenter_=this.calculateCenterZoom(n,a.anchor)}this.nextResolution_=a.targetResolution,this.targetResolution_=e,this.applyTargetState_(!0)}if(a.sourceRotation!==void 0&&a.targetRotation!==void 0){let e=c===1?Ba(a.targetRotation+Math.PI,2*Math.PI)-Math.PI:a.sourceRotation+c*(a.targetRotation-a.sourceRotation);if(a.anchor){let t=this.constraints_.rotation(e,!0);this.targetCenter_=this.calculateCenterRotate(t,a.anchor)}this.nextRotation_=a.targetRotation,this.targetRotation_=e}if(this.applyTargetState_(!0),t=!0,!a.complete)break}if(i){this.animations_[n]=null,this.setHint(Na.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let e=r[0].callback;e&&Fl(e,!0)}}this.animations_=this.animations_.filter(Boolean),t&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(e,t){let n,r=this.getCenterInternal();return r!==void 0&&(n=[r[0]-t[0],r[1]-t[1]],Fo(n,e-this.getRotation()),No(n,t)),n}calculateCenterZoom(e,t){let n,r=this.getCenterInternal(),i=this.getResolution();return r!==void 0&&i!==void 0&&(n=[t[0]-e*(t[0]-r[0])/i,t[1]-e*(t[1]-r[1])/i]),n}getViewportSize_(e){let t=this.viewportSize_;if(e){let n=t[0],r=t[1];return[Math.abs(n*Math.cos(e))+Math.abs(r*Math.sin(e)),Math.abs(n*Math.sin(e))+Math.abs(r*Math.cos(e))]}return t}setViewportSize(e){this.viewportSize_=Array.isArray(e)?e.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){let e=this.getCenterInternal();return e&&hc(e,this.getProjection())}getCenterInternal(){return this.get(Pa.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get(`constrainResolution`)}getHints(e){return e===void 0?this.hints_.slice():(e[0]=this.hints_[0],e[1]=this.hints_[1],e)}calculateExtent(e){return _c(this.calculateExtentInternal(e),this.getProjection())}calculateExtentInternal(e){e=e||this.getViewportSizeMinusPadding_();let t=this.getCenterInternal();R(t,`The view center is not defined`);let n=this.getResolution();R(n!==void 0,`The view resolution is not defined`);let r=this.getRotation();return R(r!==void 0,`The view rotation is not defined`),yo(t,n,r,e)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(e){this.applyOptions_(this.getUpdatedOptions_({maxZoom:e}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(e){this.applyOptions_(this.getUpdatedOptions_({minZoom:e}))}setConstrainResolution(e){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:e}))}getProjection(){return this.projection_}getResolution(){return this.get(Pa.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(e,t){return this.getResolutionForExtentInternal(vc(e,this.getProjection()),t)}getResolutionForExtentInternal(e,t){t=t||this.getViewportSizeMinusPadding_();let n=V(e)/t[0],r=xo(e)/t[1];return Math.max(n,r)}getResolutionForValueFunction(e){e=e||2;let t=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,r=Math.log(t/n)/Math.log(e);return(function(n){return t/e**+(n*r)})}getRotation(){return this.get(Pa.ROTATION)}getValueForResolutionFunction(e){let t=Math.log(e||2),n=this.getConstrainedResolution(this.maxResolution_),r=this.minResolution_,i=Math.log(n/r)/t;return(function(e){return Math.log(n/e)/t/i})}getViewportSizeMinusPadding_(e){let t=this.getViewportSize_(e),n=this.padding_;return n&&(t=[t[0]-n[1]-n[3],t[1]-n[0]-n[2]]),t}getState(){let e=this.getProjection(),t=this.getResolution(),n=this.getRotation(),r=this.getCenterInternal(),i=this.padding_;if(i){let e=this.getViewportSizeMinusPadding_();r=Bl(r,this.getViewportSize_(),[e[0]/2+i[3],e[1]/2+i[0]],t,n)}return{center:r.slice(0),projection:e===void 0?null:e,resolution:t,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let e,t=this.getResolution();return t!==void 0&&(e=this.getZoomForResolution(t)),e}getZoomForResolution(e){let t=this.minZoom_||0,n,r;if(this.resolutions_){let i=Xi(this.resolutions_,e,1);t=i,n=this.resolutions_[i],r=i==this.resolutions_.length-1?2:n/this.resolutions_[i+1]}else n=this.maxResolution_,r=this.zoomFactor_;return t+Math.log(n/e)/Math.log(r)}getResolutionForZoom(e){var t;if((t=this.resolutions_)!=null&&t.length){if(this.resolutions_.length===1)return this.resolutions_[0];let t=z(Math.floor(e),0,this.resolutions_.length-2),n=this.resolutions_[t]/this.resolutions_[t+1];return this.resolutions_[t]/n**+z(e-t,0,1)}return this.maxResolution_/this.zoomFactor_**+(e-this.minZoom_)}
2fit(e,t){let n;if(R(Array.isArray(e)||typeof e.getSimplifiedGeometry==`function`,"Invalid extent or geometry provided as `geometry`"),Array.isArray(e))R(!Do(e),"Cannot fit empty extent provided as `geometry`"),n=Cl(vc(e,this.getProjection()));else if(e.getType()===`Circle`){let t=vc(e.getExtent(),this.getProjection());n=Cl(t),n.rotate(this.getRotation(),_o(t))}else{let t=mc();n=t?e.clone().transform(t,this.getProjection()):e}this.fitInternal(n,t)}rotatedExtentForGeometry(e){let t=this.getRotation(),n=Math.cos(t),r=Math.sin(-t),i=e.getFlatCoordinates(),a=e.getStride(),o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e=0,t=i.length;e<t;e+=a){let t=i[e]*n-i[e+1]*r,a=i[e]*r+i[e+1]*n;o=Math.min(o,t),s=Math.min(s,a),c=Math.max(c,t),l=Math.max(l,a)}return[o,s,c,l]}fitInternal(e,t){t=t||{};let n=t.size;n||(n=this.getViewportSizeMinusPadding_());let r=t.padding===void 0?[0,0,0,0]:t.padding,i=t.nearest!==void 0&&t.nearest,a;a=t.minResolution===void 0?t.maxZoom===void 0?0:this.getResolutionForZoom(t.maxZoom):t.minResolution;let o=this.rotatedExtentForGeometry(e),s=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);s=isNaN(s)?a:Math.max(s,a),s=this.getConstrainedResolution(s,+!i);let c=this.getRotation(),l=Math.sin(c),u=Math.cos(c),d=_o(o);d[0]+=(r[1]-r[3])/2*s,d[1]+=(r[0]-r[2])/2*s;let f=d[0]*u-d[1]*l,p=d[1]*u+d[0]*l,m=this.getConstrainedCenter([f,p],s),h=t.callback?t.callback:ra;t.duration===void 0?(this.targetResolution_=s,this.targetCenter_=m,this.applyTargetState_(!1,!0),Fl(h,!0)):this.animateInternal({resolution:s,center:m,duration:t.duration,easing:t.easing},h)}centerOn(e,t,n){this.centerOnInternal(gc(e,this.getProjection()),t,n)}centerOnInternal(e,t,n){this.setCenterInternal(Bl(e,t,n,this.getResolution(),this.getRotation()))}calculateCenterShift(e,t,n,r){let i,a=this.padding_;if(a&&e){let o=this.getViewportSizeMinusPadding_(-n),s=Bl(e,r,[o[0]/2+a[3],o[1]/2+a[0]],t,n);i=[e[0]-s[0],e[1]-s[1]]}return i}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(e){let t=hc(this.targetCenter_,this.getProjection());this.setCenter([t[0]+e[0],t[1]+e[1]])}adjustCenterInternal(e){let t=this.targetCenter_;this.setCenterInternal([t[0]+e[0],t[1]+e[1]])}adjustResolution(e,t){t=t&&gc(t,this.getProjection()),this.adjustResolutionInternal(e,t)}adjustResolutionInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(this.targetResolution_*e,0,r,n);t&&(this.targetCenter_=this.calculateCenterZoom(i,t)),this.targetResolution_*=e,this.applyTargetState_()}adjustZoom(e,t){this.adjustResolution(this.zoomFactor_**+-e,t)}adjustRotation(e,t){t&&(t=gc(t,this.getProjection())),this.adjustRotationInternal(e,t)}adjustRotationInternal(e,t){let n=this.getAnimating()||this.getInteracting(),r=this.constraints_.rotation(this.targetRotation_+e,n);t&&(this.targetCenter_=this.calculateCenterRotate(r,t)),this.targetRotation_+=e,this.applyTargetState_()}setCenter(e){this.setCenterInternal(e&&gc(e,this.getProjection()))}setCenterInternal(e){this.targetCenter_=e,this.applyTargetState_()}setHint(e,t){return this.hints_[e]+=t,this.changed(),this.hints_[e]}setResolution(e){this.targetResolution_=e,this.applyTargetState_()}setRotation(e){this.targetRotation_=e,this.applyTargetState_()}setZoom(e){this.setResolution(this.getResolutionForZoom(e))}applyTargetState_(e,t){let n=this.getAnimating()||this.getInteracting()||t,r=this.constraints_.rotation(this.targetRotation_,n),i=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,0,i,n),o=this.constraints_.center(this.targetCenter_,a,i,n,this.calculateCenterShift(this.targetCenter_,a,r,i));this.get(Pa.ROTATION)!==r&&this.set(Pa.ROTATION,r),this.get(Pa.RESOLUTION)!==a&&(this.set(Pa.RESOLUTION,a),this.set(`zoom`,this.getZoom(),!0)),(!o||!this.get(Pa.CENTER)||!Po(this.get(Pa.CENTER),o))&&this.set(Pa.CENTER,o),this.getAnimating()&&!e&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(e,t,n){e=e===void 0?200:e;let r=t||0,i=this.constraints_.rotation(this.targetRotation_),a=this.getViewportSize_(i),o=this.constraints_.resolution(this.targetResolution_,r,a),s=this.constraints_.center(this.targetCenter_,o,a,!1,this.calculateCenterShift(this.targetCenter_,o,i,a));if(e===0&&!this.cancelAnchor_){this.targetResolution_=o,this.targetRotation_=i,this.targetCenter_=s,this.applyTargetState_();return}n=n||(e===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==o||this.getRotation()!==i||!this.getCenterInternal()||!Po(this.getCenterInternal(),s))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:i,center:s,resolution:o,duration:e,easing:Vo,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(Na.INTERACTING,1)}endInteraction(e,t,n){n=n&&gc(n,this.getProjection()),this.endInteractionInternal(e,t,n)}endInteractionInternal(e,t,n){this.getInteracting()&&(this.setHint(Na.INTERACTING,-1),this.resolveConstraints(e,t,n
2))}getConstrainedCenter(e,t){let n=this.getViewportSize_(this.getRotation());return this.constraints_.center(e,t||this.getResolution(),n)}getConstrainedZoom(e,t){let n=this.getResolutionForZoom(e);return this.getZoomForResolution(this.getConstrainedResolution(n,t))}getConstrainedResolution(e,t){t=t||0;let n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(e,t,n)}};function Fl(e,t){setTimeout(function(){e(t)},0)}function Il(e){if(e.extent!==void 0){let t=e.smoothExtentConstraint===void 0||e.smoothExtentConstraint;return Ka(e.extent,e.constrainOnlyCenter,t)}let t=ac(e.projection,`EPSG:3857`);if(e.multiWorld!==!0&&t.isGlobal()){let e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,Ka(e,!1,!1)}return qa}function Ll(e){let t,n,r,i=e.minZoom===void 0?Nl:e.minZoom,a=e.maxZoom===void 0?28:e.maxZoom,o=e.zoomFactor===void 0?2:e.zoomFactor,s=e.multiWorld!==void 0&&e.multiWorld,c=e.smoothResolutionConstraint===void 0||e.smoothResolutionConstraint,l=e.showFullExtent!==void 0&&e.showFullExtent,u=ac(e.projection,`EPSG:3857`),d=u.getExtent(),f=e.constrainOnlyCenter,p=e.extent;if(!s&&!p&&u.isGlobal()&&(f=!1,p=d),e.resolutions!==void 0){let o=e.resolutions;n=o[i],r=o[a]===void 0?o[o.length-1]:o[a],t=e.constrainResolution?El(o,c,!f&&p,l):Ol(n,r,c,!f&&p,l)}else{let s=(d?Math.max(V(d),xo(d)):360*Jo.degrees/u.getMetersPerUnit())/256/2**Nl,m=s/2**28;n=e.maxResolution,n===void 0?n=s/o**+i:i=0,r=e.minResolution,r===void 0&&(r=e.maxZoom===void 0?m:e.maxResolution===void 0?s/o**+a:n/o**+a),a=i+Math.floor(Math.log(n/r)/Math.log(o)),r=n/o**+(a-i),t=e.constrainResolution?Dl(o,n,r,c,!f&&p,l):Ol(n,r,c,!f&&p,l)}return{constraint:t,maxResolution:n,minResolution:r,minZoom:i,zoomFactor:o}}function Rl(e){if(e.enableRotation===void 0||e.enableRotation){let t=e.constrainRotation;return t===void 0||t===!0?Ml():t===!1?Al:typeof t==`number`?jl(t):Al}return kl}function zl(e){return!(e.sourceCenter&&e.targetCenter&&!Po(e.sourceCenter,e.targetCenter)||e.sourceResolution!==e.targetResolution||e.sourceRotation!==e.targetRotation)}function Bl(e,t,n,r,i){let a=Math.cos(-i),o=Math.sin(-i),s=e[0]*a-e[1]*o,c=e[1]*a+e[0]*o;return s+=(t[0]/2-n[0])*r,c+=(n[1]-t[1]/2)*r,o=-o,[s*a-c*o,c*a+s*o]}var Vl=`ol-hidden`,Hl=`ol-unselectable`,Ul=`ol-control`,Wl=`ol-collapsed`,Gl=new RegExp([`^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)`,`(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)`,`(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?`,`(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))`,`(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))`,`?\\s*([-,\\"\\'\\sa-z0-9]+?)\\s*$`].join(``),`i`),Kl=[`style`,`variant`,`weight`,`size`,`lineHeight`,`family`],ql={normal:400,bold:700},Jl=function(e){let t=e.match(Gl);if(!t)return null;let n={lineHeight:`normal`,size:`1.2em`,style:`normal`,weight:`400`,variant:`normal`};for(let e=0,r=Kl.length;e<r;++e){let r=t[e+1];r!==void 0&&(n[Kl[e]]=typeof r==`string`?r.trim():r)}return isNaN(Number(n.weight))&&n.weight in ql&&(n.weight=ql[n.weight]),n.families=n.family.split(/,\s?/).map(e=>e.trim().replace(/^['"]|['"]$/g,``)),n};function U(e,t,r,i){let a;return a=r&&r.length?r.shift():Sa?new class extends OffscreenCanvas{constructor(...e){super(...e),n(this,`style`,{})}}(e==null?300:e,t==null?150:t):document.createElement(`canvas`),e&&(a.width=e),t&&(a.height=t),a.getContext(`2d`,i)}var Yl;function Xl(){return Yl||(Yl=U(1,1)),Yl}function Zl(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}function Ql(e,t){let n=t.parentNode;n&&n.replaceChild(e,t)}function $l(e){for(;e.lastChild;)e.lastChild.remove()}function eu(e,t){let n=e.childNodes;for(let r=0;;++r){let i=n[r],a=t[r];if(!i&&!a)break;if(i!==a){if(!i){e.appendChild(a);continue}if(!a){e.removeChild(i),--r;continue}e.insertBefore(a,i)}}}function tu(){return new Proxy({childNodes:[],appendChild:function(e){return this.childNodes.push(e),e},remove:function(){},removeChild:function(e){let t=this.childNodes.indexOf(e);if(t===-1)throw Error(`Node to remove was not found`);return this.childNodes.splice(t,1),e},insertBefore:function(e,t){let n=this.childNodes.indexOf(t);if(n===-1)throw Error(`Reference node not found`);return this.childNodes.splice(n,0,e),e},style:{}},{get(e,t,n){return t===`firstElementChild`?e.childNodes.length>0?e.childNodes[0]:null:Reflect.get(e,t,n)}})}function nu(e){return typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement||typeof OffscreenCanvas<`u`&&e instanceof OffscreenCanvas}var ru=class extends fa{constructor(e){super();let t=e.element;t&&!e.target&&!t.style.pointerEvents&&(t.style.pointerEvents=`auto`),this.element=t||null,this.target_=null,this.map_=null,this.listenerKeys=[],e.render&&(this.render=e.render),e.target&&this.setTarget(e.target)}disposeInternal(){var e;(e=this.element)==null||e.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(e){if(this.map_){var t;(t=this.element)==null||t.remove()}for(let e=0,t=this.listenerKeys.length;e<t;++e)M(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=e,e){var n;let t=(n=this.target_)==null?e.getOverlayContainerStopEvent():n;this.element&&t.appendChild(this.element),this.render!==ra&&this.listenerKeys.push(j(e,Da.POSTRENDER,this.render,this)),e.render()}}render(e){}setTarget(e){this.target_=typeof e==`string`?document.getElementById(e):e}},iu=class extends ru{constructor(e){e=e||{},super({element:document.createElement(`div`),render:e.render,target:e.target}),this.ulElement_=document.createElement(`ul`),this.collapsed_=e.collapsed===void 0||e.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=e.collapsible!==void 0,this.collapsible_=e.collapsible===void 0||e.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=e.attributions;let t=e.className===void 0?`ol-attribution`:e.className,n=e.tipLabel===void 0?`Attributions`:e.tipLabel,r=e.expandClassName===void 0?t+`-expand`:e.expandClassName,i=e.collapseLabel===void 0?`âº`:e.collapseLabel,a=e.collapseClassName===void 0?t+`-collapse`:e.collapseClassName;typeof i==`string`?(this.collapseLabel_=document.createElement(`span`),this.collapseLabel_.textContent=i,this.collapseLabel_.className=a):this.collapseLabel_=i;let o=e.label===void 0?`i`:e.label;typeof o==`string`?(this.label_=document.createElement(`span`),this.label_.textContent=o,this.label_.className=r):this.label_=o;let s=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement(`button`),this.toggleButton_.setAttribute(`type`,`button`),this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(s),this.toggleButton_.addEventListener(N.CLICK,this.handleClick_.bind(this),!1);let c=t+` `+Hl+` `+Ul+(this.collapsed_&&this.collapsible_?` `+Wl:``)+(this.collapsible_?``:` ol-uncollapsible`),l=this.element;l.className=c,l.appendChild(this.toggleButton_),l.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(e){let t=this.getMap().getAllLayers(),n=new Set(t.flatMap(t=>t.getAttributions(e)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(e
2=>n.add(e)):n.add(this.attributions_)),!this.overrideCollapsible_){let e=!t.some(e=>{var t;return((t=e.getSource())==null?void 0:t.getAttributionsCollapsible())===!1});this.setCollapsible(e)}return Array.from(n)}async updateElement_(e){if(!e){this.renderedVisible_&&(this.element.style.display=`none`,this.renderedVisible_=!1);return}let t=await Promise.all(this.collectSourceAttributions_(e).map(e=>aa(()=>e))),n=t.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?``:`none`,this.renderedVisible_=n),!$i(t,this.renderedAttributions_)){$l(this.ulElement_);for(let e=0,n=t.length;e<n;++e){let n=document.createElement(`li`);n.innerHTML=t[e],this.ulElement_.appendChild(n)}this.renderedAttributions_=t}}handleClick_(e){e.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(Wl),this.collapsed_?Ql(this.collapseLabel_,this.label_):Ql(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute(`aria-expanded`,String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(e){this.collapsible_!==e&&(this.collapsible_=e,this.element.classList.toggle(`ol-uncollapsible`),this.userCollapsed_&&this.handleToggle_())}setCollapsed(e){this.userCollapsed_=e,!(!this.collapsible_||this.collapsed_===e)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(e){this.updateElement_(e.frameState)}},au=class extends ru{constructor(e){e=e||{},super({element:document.createElement(`div`),render:e.render,target:e.target});let t=e.className===void 0?`ol-rotate`:e.className,n=e.label===void 0?`â§`:e.label,r=e.compassClassName===void 0?`ol-compass`:e.compassClassName;this.label_=null,typeof n==`string`?(this.label_=document.createElement(`span`),this.label_.className=r,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(r));let i=e.tipLabel?e.tipLabel:`Reset rotation`,a=document.createElement(`button`);a.className=t+`-reset`,a.setAttribute(`type`,`button`),a.title=i,a.appendChild(this.label_),a.addEventListener(N.CLICK,this.handleClick_.bind(this),!1);let o=t+` `+Hl+` `+Ul,s=this.element;s.className=o,s.appendChild(a),this.callResetNorth_=e.resetNorth?e.resetNorth:void 0,this.duration_=e.duration===void 0?250:e.duration,this.autoHide_=e.autoHide===void 0||e.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(Vl)}handleClick_(e){e.preventDefault(),this.callResetNorth_===void 0?this.resetNorth_():this.callResetNorth_()}resetNorth_(){let e=this.getMap().getView();if(!e)return;let t=e.getRotation();t!==void 0&&(this.duration_>0&&t%(2*Math.PI)!=0?e.animate({rotation:0,duration:this.duration_,easing:Vo}):e.setRotation(0))}render(e){let t=e.frameState;if(!t)return;let n=t.viewState.rotation;if(n!=this.rotation_){let e=`rotate(`+n+`rad)`;if(this.autoHide_){let e=this.element.classList.contains(Vl);!e&&n===0?this.element.classList.add(Vl):e&&n!==0&&this.element.classList.remove(Vl)}this.label_.style.transform=e}this.rotation_=n}},ou=class extends ru{constructor(e){e=e||{},super({element:document.createElement(`div`),target:e.target});let t=e.className===void 0?`ol-zoom`:e.className,n=e.delta===void 0?1:e.delta,r=e.zoomInClassName===void 0?t+`-in`:e.zoomInClassName,i=e.zoomOutClassName===void 0?t+`-out`:e.zoomOutClassName,a=e.zoomInLabel===void 0?`+`:e.zoomInLabel,o=e.zoomOutLabel===void 0?`â`:e.zoomOutLabel,s=e.zoomInTipLabel===void 0?`Zoom in`:e.zoomInTipLabel,c=e.zoomOutTipLabel===void 0?`Zoom out`:e.zoomOutTipLabel,l=document.createElement(`button`);l.className=r,l.setAttribute(`type`,`button`),l.title=s,l.appendChild(typeof a==`string`?document.createTextNode(a):a),l.addEventListener(N.CLICK,this.handleClick_.bind(this,n),!1);let u=document.createElement(`button`);u.className=i,u.setAttribute(`type`,`button`),u.title=c,u.appendChild(typeof o==`string`?document.createTextNode(o):o),u.addEventListener(N.CLICK,this.handleClick_.bind(this,-n),!1);let d=t+` `+Hl+` `+Ul,f=this.element;f.className=d,f.appendChild(l),f.appendChild(u),this.duration_=e.duration===void 0?250:e.duration}handleClick_(e,t){t.preventDefault(),this.zoomByDelta_(e)}zoomByDelta_(e){let t=this.getMap().getView();if(!t)return;let n=t.getZoom();if(n!==void 0){let r=t.getConstrainedZoom(n+e);this.duration_>0?(t.getAnimating()&&t.cancelAnimations(),t.animate({zoom:r,duration:this.duration_,easing:Vo})):t.setZoom(r)}}};function su(e){e=e||{};let t=new ha;return(e.zoom===void 0||e.zoom)&&t.push(new ou(e.zoomOptions)),(e.rotate===void 0||e.rotate)&&t.push(new au(e.rotateOptions)),(e.attribution===void 0||e.attribution)&&t.push(new iu(e.attributionOptions)),t}var cu=class{constructor(e,t,n){this.decay_=e,this.minVelocity_=t,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(e,t){this.points_.push(e,t,Date.now())}end(){if(this.points_.length<6)return!1;let e=Date.now()-this.delay_,t=this.points_.length-3;if(this.points_[t+2]<e)return!1;let n=t-3;for(;n>0&&this.points_[n+2]>e;)n-=3;let r=this.points_[t+2]-this.points_[n+2];if(r<1e3/60)return!1;let i=this.points_[t]-this.points_[n],a=this.points_[t+1]-this.points_[n+1];return this.angle_=Math.atan2(a,i),this.initialVelocity_=Math.sqrt(i*i+a*a)/r,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},lu={ACTIVE:`active`},uu=class extends fa{constructor(e){super(),this.on,this.once,this.un,e&&e.handleEvent&&(this.handleEvent=e.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(lu.ACTIVE)}getMap(){return this.map_}handleEvent(e){return!0}setActive(e){this.set(lu.ACTIVE,e)}setMap(e){this.map_=e}};function du(e,t,n){let r=e.getCenterInternal();if(r){let i=[r[0]+t[0],r[1]+t[1]];e.animateInternal({duration:n===void 0?250:n,easing:Uo,center:e.getConstrainedCenter(i)})}}function fu(e,t,n,r){let i=e.getZoom();if(i===void 0)return;let a=e.getConstrainedZoom(i+t),o=e.getResolutionForZoom(a);e.getAnimating()&&e.cancelAnimations(),e.animate({resolution:o,anchor:n,duration:r===void 0?250:r,easing:Vo})}var pu=class extends uu{constructor(e){super(),e=e||{},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?250:e.duration}handleEvent(e){let t=!1;if(e.type==I.DBLCLICK){let n=e.originalEvent,r=e.map,i=e.coordinate,a=n.shiftKey?-this.delta_:this.delta_;fu(r.getView(),a,i,this.duration_),n.preventDefault(),t=!0}return!t}};function mu(e){let t=arguments;return function(e){let n=!0;for(let r=0,i=t.length;r<i&&(n=n&&t[r](e),n);++r);return n}}var hu=function(e){let t=e.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},gu=function(e){let t=e.map.getTargetElement(),n=t.getRootNode(),r=e.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(r):t.contains(r)},_u=function(e){let t=e.map.getTargetElement(),n=t.getRootNode();return!(n instanceof ShadowRoot?n.host:t).hasAttribute(`tabindex`)||gu(e)},vu=ta,yu=function(e){let t=e.originalEvent;return`pointerId`in t&&t.button==0&&!(ya&&ba&&t.ctrlKey)},bu=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},xu=function(e){let t=e.originalEvent;return ba?t.metaKey:t.ctrlKey},Su=function(e){let t=e.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Cu=function(e){let t=e.originalEvent,n=t.target.tagName;return n!==`INPUT`&&n!==`SELECT`&&n!==`TEXTAREA`&&!t.target.isContentEditable},wu=function(e){let t=e.originalEvent;return`pointerId`in t&&t.pointerType==`mouse`},Tu=function(e){let t=e.originalEvent;return`pointerId`in t&&t.isPrimary&&t.button===0},Eu=class extends uu{constructor(e){e=e||{},super(e),e.handleDownEvent&&(this.handleDownEvent=e.handleDownEvent),e.handleDragEvent&&(this.handleDragEvent=e.handleDragEvent),e.handleMoveEvent&&(this.handleMoveEvent=e.handleMoveEvent),e.handleUpEvent&&(this.handleUpEvent=e.handleUpEvent),e.stopDown&&(this.stopDown=e.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(e){return!1}handleDragEvent(e){}handleEvent(e){if(!e.originalEvent)return!0;let t=!1;if(this.updateTrackedPointers_(e),this.handlingDownUpSequence){if(e.type==I.POINTERDRAG)this.handleDragEvent(e),e.originalEvent.preventDefault();else if(e.type==I.POINTERUP){let t=this.handleUpEvent(e);this.handlingDownUpSequence=t&&this.targetPointers.length>0}}else if(e.type==I.POINTERDOWN){let n=this.handleDownEvent(e);this.handlingDownUpSequence=n,t=this.stopDown(n)}else e.type==I.POINTERMOVE&&this.handleMoveEvent(e);return!t}handleMoveEvent(e){}handleUpEvent(e){return!1}stopDown(e){return e}updateTrackedPointers_(e){e.activePointers&&(this.targetPointers=e.activePointers)}};function Du(e){let t=e.length,n=0,r=0;for(let i=0;i<t;i++)n+=e[i].clientX,r+=e[i].clientY;return{clientX:n/t,clientY:r/t}}
2var Ou=class extends Eu{constructor(e){super({stopDown:na}),e=e||{},this.kinetic_=e.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;let t=e.condition?e.condition:mu(bu,Tu);this.condition_=e.onFocusOnly?mu(_u,t):t,this.noKinetic_=!1}handleDragEvent(e){let t=e.map;this.panning_||(this.panning_=!0,t.getView().beginInteraction());let n=this.targetPointers,r=t.getEventPixel(Du(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(r[0],r[1]),this.lastCentroid){let t=[this.lastCentroid[0]-r[0],r[1]-this.lastCentroid[1]],n=e.map.getView();Io(t,n.getResolution()),Fo(t,n.getRotation()),n.adjustCenterInternal(t)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=r,this.lastPointersCount_=n.length,e.originalEvent.preventDefault()}handleUpEvent(e){let t=e.map,n=t.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let e=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),i=n.getCenterInternal(),a=t.getPixelFromCoordinateInternal(i),o=t.getCoordinateFromPixelInternal([a[0]-e*Math.cos(r),a[1]-e*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:Vo})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(e){if(this.targetPointers.length>0&&this.condition_(e)){let t=e.map.getView();return this.lastCentroid=null,t.getAnimating()&&t.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},ku=class extends Eu{constructor(e){e=e||{},super({stopDown:na}),this.condition_=e.condition?e.condition:hu,this.lastAngle_=void 0,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){if(!wu(e))return;let t=e.map,n=t.getView();if(n.getConstraints().rotation===kl)return;let r=t.getSize(),i=e.pixel,a=Math.atan2(r[1]/2-i[1],i[0]-r[0]/2);if(this.lastAngle_!==void 0){let e=a-this.lastAngle_;n.adjustRotationInternal(-e)}this.lastAngle_=a}handleUpEvent(e){return!wu(e)||(e.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(e){return wu(e)&&yu(e)&&this.condition_(e)?(e.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}},Au=class extends Ki{constructor(e){super(),this.geometry_=null,this.element_=document.createElement(`div`),this.element_.style.position=`absolute`,this.element_.style.pointerEvents=`auto`,this.element_.className=`ol-box `+e,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){let e=this.startPixel_,t=this.endPixel_,n=this.element_.style;n.left=Math.min(e[0],t[0])+`px`,n.top=Math.min(e[1],t[1])+`px`,n.width=Math.abs(t[0]-e[0])+`px`,n.height=Math.abs(t[1]-e[1])+`px`}setMap(e){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let e=this.element_.style;e.left=`inherit`,e.top=`inherit`,e.width=`inherit`,e.height=`inherit`}this.map_=e,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(e,t){this.startPixel_=e,this.endPixel_=t,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;let e=this.startPixel_,t=this.endPixel_,n=[e,[e[0],t[1]],t,[t[0],e[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new Sl([n])}getGeometry(){return this.geometry_}},ju={BOXSTART:`boxstart`,BOXDRAG:`boxdrag`,BOXEND:`boxend`,BOXCANCEL:`boxcancel`},Mu=class extends oa{constructor(e,t,n){super(e),this.coordinate=t,this.mapBrowserEvent=n}},Nu=class extends Eu{constructor(e){var t,n,r,i;super(),this.on,this.once,this.un,e=(t=e)==null?{}:t,this.box_=new Au(e.className||`ol-dragbox`),this.minArea_=(n=e.minArea)==null?64:n,e.onBoxEnd&&(this.onBoxEnd=e.onBoxEnd),this.startPixel_=null,this.condition_=(r=e.condition)==null?yu:r,this.boxEndCondition_=(i=e.boxEndCondition)==null?this.defaultBoxEndCondition:i}defaultBoxEndCondition(e,t,n){let r=n[0]-t[0],i=n[1]-t[1];return r*r+i*i>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(e){this.startPixel_&&(this.box_.setPixels(this.startPixel_,e.pixel),this.dispatchEvent(new Mu(ju.BOXDRAG,e.coordinate,e)))}handleUpEvent(e){if(!this.startPixel_)return!1;let t=this.boxEndCondition_(e,this.startPixel_,e.pixel);return t&&this.onBoxEnd(e),this.dispatchEvent(new Mu(t?ju.BOXEND:ju.BOXCANCEL,e.coordinate,e)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(e){return this.condition_(e)?(this.startPixel_=e.pixel,this.box_.setMap(e.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new Mu(ju.BOXSTART,e.coordinate,e)),!0):!1}onBoxEnd(e){}setActive(e){e||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Mu(ju.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(e)}setMap(e){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new Mu(ju.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(e)}},Pu=class extends Nu{constructor(e){e=e||{};let t=e.condition?e.condition:Su;super({condition:t,className:e.className||`ol-dragzoom`,minArea:e.minArea}),this.duration_=e.duration===void 0?200:e.duration,this.out_=e.out!==void 0&&e.out}onBoxEnd(e){let t=this.getMap().getView(),n=this.getGeometry();if(this.out_){let e=t.rotatedExtentForGeometry(n),r=t.getResolutionForExtentInternal(e),i=t.getResolution()/r;n=n.clone(),n.scale(i*i)}t.fitInternal(n,{duration:this.duration_,easing:Vo})}},Fu={LEFT:`ArrowLeft`,UP:`ArrowUp`,RIGHT:`ArrowRight`,DOWN:`ArrowDown`},Iu=class extends uu{constructor(e){super(),e=e||{},this.defaultCondition_=function(e){return bu(e)&&Cu(e)},this.condition_=e.condition===void 0?this.defaultCondition_:e.condition,this.duration_=e.duration===void 0?100:e.duration,this.pixelDelta_=e.pixelDelta===void 0?128:e.pixelDelta}handleEvent(e){let t=!1;if(e.type==N.KEYDOWN){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r==Fu.DOWN||r==Fu.LEFT||r==Fu.RIGHT||r==Fu.UP)){let i=e.map.getView(),a=i.getResolution()*this.pixelDelta_,o=0,s=0;r==Fu.DOWN?s=-a:r==Fu.LEFT?o=-a:r==Fu.RIGHT?o=a:s=a;let c=[o,s];Fo(c,i.getRotation()),du(i,c,this.duration_),n.preventDefault(),t=!0}}return!t}},Lu=class extends uu{constructor(e){super(),e=e||{},this.condition_=e.condition?e.condition:function(e){return!xu(e)&&Cu(e)},this.delta_=e.delta?e.delta:1,this.duration_=e.duration===void 0?100:e.duration}handleEvent(e){let t=!1;if(e.type==N.KEYDOWN||e.type==N.KEYPRESS){let n=e.originalEvent,r=n.key;if(this.condition_(e)&&(r===`+`||r===`-`)){let i=e.map,a=r===`+`?this.delta_:-this.delta_;fu(i.getView(),a,void 0,this.duration_),n.preventDefault(),t=!0}}return!t}}
2,Ru=40,zu=300,Bu=3,Vu=class extends uu{constructor(e){e=e||{},super(e),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=e.maxDelta===void 0?1:e.maxDelta,this.duration_=e.duration===void 0?250:e.duration,this.timeout_=e.timeout===void 0?80:e.timeout,this.useAnchor_=e.useAnchor===void 0||e.useAnchor,this.constrainResolution_=e.constrainResolution!==void 0&&e.constrainResolution;let t=e.condition?e.condition:vu;this.condition_=e.onFocusOnly?mu(_u,t):t,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300,this.ctrlKeyPressed_=!1,this.ctrlKeyListenerKeys_=[]}setMap(e){if(this.ctrlKeyListenerKeys_.forEach(M),this.ctrlKeyListenerKeys_.length=0,this.ctrlKeyPressed_=!1,super.setMap(e),e){let t=e.getOwnerDocument();this.ctrlKeyListenerKeys_.push(j(t,`keydown`,e=>{e.key===`Control`&&(this.ctrlKeyPressed_=!0)}),j(t,`keyup`,e=>{e.key===`Control`&&(this.ctrlKeyPressed_=!1)}))}}endInteraction_(){this.trackpadTimeoutId_=void 0;let e=this.getMap();if(!e)return;let t=e.getView(),n=this.lastDelta_?this.lastDelta_>0?1:-1:0;t.endInteraction(this.constrainResolution_||t.getConstrainResolution()?100:void 0,n,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(e){if(!this.condition_(e)||e.type!==N.WHEEL)return!0;let t=e.map,n=e.originalEvent;n.preventDefault();let r=n.ctrlKey&&!this.ctrlKeyPressed_;n.ctrlKey||(this.ctrlKeyPressed_=!1),this.useAnchor_&&(this.lastAnchor_=e.pixel);let i=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:i*=Ru;break;case WheelEvent.DOM_DELTA_PAGE:i*=zu}if(i===0)return!1;this.lastDelta_=i;let a=Date.now();this.startTime_===void 0&&(this.startTime_=a),(!this.mode_||a-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?`trackpad`:`wheel`);let o=t.getView();if(this.mode_===`trackpad`)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(o.getAnimating()&&o.cancelAnimations(),o.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),r&&(i*=Bu),o.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=a,!1;this.totalDelta_+=i;let s=Math.max(this.timeout_-(a-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,t),s),!1}handleWheelZoom_(e){let t=e.getView();t.getAnimating()&&t.cancelAnimations();let n=-z(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(t.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),fu(t,n,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(e){this.useAnchor_=e,e||(this.lastAnchor_=null)}},Hu=class extends Eu{constructor(e){e=e||{};let t=e;t.stopDown||(t.stopDown=na),super(t),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=e.threshold===void 0?.3:e.threshold,this.duration_=e.duration===void 0?250:e.duration}handleDragEvent(e){let t=0,n=this.targetPointers[0],r=this.targetPointers[1],i=Math.atan2(r.clientY-n.clientY,r.clientX-n.clientX);if(this.lastAngle_!==void 0){let e=i-this.lastAngle_;this.rotationDelta_+=e,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),t=e}this.lastAngle_=i;let a=e.map,o=a.getView();o.getConstraints().rotation!==kl&&(this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(Du(this.targetPointers))),this.rotating_&&(a.render(),o.adjustRotationInternal(t,this.anchor_)))}handleUpEvent(e){return this.targetPointers.length<2?(e.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}},Uu=class extends Eu{constructor(e){e=e||{};let t=e;t.stopDown||(t.stopDown=na),super(t),this.anchor_=null,this.duration_=e.duration===void 0?400:e.duration,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(e){let t=1,n=this.targetPointers[0],r=this.targetPointers[1],i=n.clientX-r.clientX,a=n.clientY-r.clientY,o=Math.sqrt(i*i+a*a);this.lastDistance_!==void 0&&(t=this.lastDistance_/o),this.lastDistance_=o;let s=e.map,c=s.getView();t!=1&&(this.lastScaleDelta_=t),this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(Du(this.targetPointers))),s.render(),c.adjustResolutionInternal(t,this.anchor_)}handleUpEvent(e){if(this.targetPointers.length<2){let t=e.map.getView(),n=this.lastScaleDelta_>1?1:-1;return t.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(e){if(this.targetPointers.length>=2){let t=e.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||t.getView().beginInteraction(),!0}return!1}};function Wu(e){e=e||{};let t=new ha,n=new cu(-.005,.05,100);return(e.altShiftDragRotate===void 0||e.altShiftDragRotate)&&t.push(new ku),(e.doubleClickZoom===void 0||e.doubleClickZoom)&&t.push(new pu({delta:e.zoomDelta,duration:e.zoomDuration})),(e.dragPan===void 0||e.dragPan)&&t.push(new Ou({onFocusOnly:e.onFocusOnly,kinetic:n})),(e.pinchRotate===void 0||e.pinchRotate)&&t.push(new Hu),(e.pinchZoom===void 0||e.pinchZoom)&&t.push(new Uu({duration:e.zoomDuration})),(e.keyboard===void 0||e.keyboard)&&(t.push(new Iu),t.push(new Lu({delta:e.zoomDelta,duration:e.zoomDuration}))),(e.mouseWheelZoom===void 0||e.mouseWheelZoom)&&t.push(new Vu({onFocusOnly:e.onFocusOnly,duration:e.zoomDuration})),(e.shiftDragZoom===void 0||e.shiftDragZoom)&&t.push(new Pu({duration:e.zoomDuration})),t}var W={OPACITY:`opacity`,VISIBLE:`visible`,EXTENT:`extent`,Z_INDEX:`zIndex`,MAX_RESOLUTION:`maxResolution`,MIN_RESOLUTION:`minResolution`,MAX_ZOOM:`maxZoom`,MIN_ZOOM:`minZoom`,SOURCE:`source`,MAP:`map`},Gu=class extends fa{constructor(e){super(),this.on,this.once,this.un,this.background_=e.background;let t=Object.assign({},e);typeof e.properties==`object`&&(delete t.properties,Object.assign(t,e.properties)),t[W.OPACITY]=e.opacity===void 0?1:e.opacity,R(typeof t[W.OPACITY]==`number`,`Layer opacity must be a number`),t[W.VISIBLE]=e.visible===void 0||e.visible,t[W.Z_INDEX]=e.zIndex,t[W.MAX_RESOLUTION]=e.maxResolution===void 0?1/0:e.maxResolution,t[W.MIN_RESOLUTION]=e.minResolution===void 0?0:e.minResolution,t[W.MIN_ZOOM]=e.minZoom===void 0?-1/0:e.minZoom,t[W.MAX_ZOOM]=e.maxZoom===void 0?1/0:e.maxZoom,this.className_=t.className===void 0?`ol-layer`:t.className,delete t.className,this.setProperties(t),this.state_=null}
2getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(e){let t=this.state_||{layer:this,managed:e===void 0||e},n=this.getZIndex();return t.opacity=z(Math.round(this.getOpacity()*100)/100,0,1),t.visible=this.getVisible(),t.extent=this.getExtent(),t.zIndex=n===void 0&&!t.managed?1/0:n,t.maxResolution=this.getMaxResolution(),t.minResolution=Math.max(this.getMinResolution(),0),t.minZoom=this.getMinZoom(),t.maxZoom=this.getMaxZoom(),this.state_=t,t}getLayersArray(e){return P()}getLayerStatesArray(e){return P()}getExtent(){return this.get(W.EXTENT)}getMaxResolution(){return this.get(W.MAX_RESOLUTION)}getMinResolution(){return this.get(W.MIN_RESOLUTION)}getMinZoom(){return this.get(W.MIN_ZOOM)}getMaxZoom(){return this.get(W.MAX_ZOOM)}getOpacity(){return this.get(W.OPACITY)}getSourceState(){return P()}getVisible(){return this.get(W.VISIBLE)}getZIndex(){return this.get(W.Z_INDEX)}setBackground(e){this.background_=e,this.changed()}setExtent(e){this.set(W.EXTENT,e)}setMaxResolution(e){this.set(W.MAX_RESOLUTION,e)}setMinResolution(e){this.set(W.MIN_RESOLUTION,e)}setMaxZoom(e){this.set(W.MAX_ZOOM,e)}setMinZoom(e){this.set(W.MIN_ZOOM,e)}setOpacity(e){R(typeof e==`number`,`Layer opacity must be a number`),this.set(W.OPACITY,e)}setVisible(e){this.set(W.VISIBLE,e)}setZIndex(e){this.set(W.Z_INDEX,e)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}},Ku={ADDLAYER:`addlayer`,REMOVELAYER:`removelayer`},qu=class extends oa{constructor(e,t){super(e),this.layer=t}},Ju={LAYERS:`layers`},Yu=class e extends Gu{constructor(e){e=e||{};let t=Object.assign({},e);delete t.layers;let n=e.layers;super(t),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Ju.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ha(n.slice(),{unique:!0}):R(typeof n.getArray==`function`,"Expected `layers` to be an array or a `Collection`"):n=new ha(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(M),this.layersListenerKeys_.length=0;let e=this.getLayers();this.layersListenerKeys_.push(j(e,Vi.ADD,this.handleLayersAdd_,this),j(e,Vi.REMOVE,this.handleLayersRemove_,this));for(let e in this.listenerKeys_)this.listenerKeys_[e].forEach(M);Ui(this.listenerKeys_);let t=e.getArray();for(let e=0,n=t.length;e<n;e++){let n=t[e];this.registerLayerListeners_(n),this.dispatchEvent(new qu(Ku.ADDLAYER,n))}this.changed()}registerLayerListeners_(t){let n=[j(t,Hi.PROPERTYCHANGE,this.handleLayerChange_,this),j(t,N.CHANGE,this.handleLayerChange_,this)];t instanceof e&&n.push(j(t,Ku.ADDLAYER,this.handleLayerGroupAdd_,this),j(t,Ku.REMOVELAYER,this.handleLayerGroupRemove_,this)),this.listenerKeys_[F(t)]=n}handleLayerGroupAdd_(e){this.dispatchEvent(new qu(Ku.ADDLAYER,e.layer))}handleLayerGroupRemove_(e){this.dispatchEvent(new qu(Ku.REMOVELAYER,e.layer))}handleLayersAdd_(e){let t=e.element;this.registerLayerListeners_(t),this.dispatchEvent(new qu(Ku.ADDLAYER,t)),this.changed()}handleLayersRemove_(e){let t=e.element,n=F(t);this.listenerKeys_[n].forEach(M),delete this.listenerKeys_[n],this.dispatchEvent(new qu(Ku.REMOVELAYER,t)),this.changed()}getLayers(){return this.get(Ju.LAYERS)}setLayers(e){let t=this.getLayers();if(t){let e=t.getArray();for(let t=0,n=e.length;t<n;++t)this.dispatchEvent(new qu(Ku.REMOVELAYER,e[t]))}this.set(Ju.LAYERS,e)}getLayersArray(e){return e=e===void 0?[]:e,this.getLayers().forEach(function(t){t.getLayersArray(e)}),e}getLayerStatesArray(e){let t=e===void 0?[]:e,n=t.length;this.getLayers().forEach(function(e){e.getLayerStatesArray(t)});let r=this.getLayerState(),i=r.zIndex;!e&&r.zIndex===void 0&&(i=0);for(let e=n,a=t.length;e<a;e++){let n=t[e];n.opacity*=r.opacity,n.visible=n.visible&&r.visible,n.maxResolution=Math.min(n.maxResolution,r.maxResolution),n.minResolution=Math.max(n.minResolution,r.minResolution),n.minZoom=Math.max(n.minZoom,r.minZoom),n.maxZoom=Math.min(n.maxZoom,r.maxZoom),r.extent!==void 0&&(n.extent=n.extent===void 0?r.extent:So(n.extent,r.extent)),n.zIndex===void 0&&(n.zIndex=i)}return t}getSourceState(){return`ready`}},Xu={PRERENDER:`prerender`,POSTRENDER:`postrender`,PRECOMPOSE:`precompose`,POSTCOMPOSE:`postcompose`,RENDERCOMPLETE:`rendercomplete`},Zu=class extends Gu{constructor(e){let t=Object.assign({},e);delete t.source,super(t),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,e.render&&(this.render=e.render),e.map&&this.setMap(e.map),this.addChangeListener(W.SOURCE,this.handleSourcePropertyChange_);let n=e.source?e.source:null;this.setSource(n)}getLayersArray(e){return e=e||[],e.push(this),e}getLayerStatesArray(e){return e=e||[],e.push(this.getLayerState()),e}getSource(){return this.get(W.SOURCE)||null}
2getRenderSource(){return this.getSource()}getSourceState(){let e=this.getSource();return e?e.getState():`undefined`}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!==`ready`)&&(this.sourceReady_=!0,this.dispatchEvent(`sourceready`))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(M(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let e=this.getSource();e&&(this.sourceChangeKey_=j(e,N.CHANGE,this.handleSourceChange_,this),e.getState()===`ready`&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent(`sourceready`)},0))),this.changed()}getFeatures(e){return this.renderer_?this.renderer_.getFeatures(e):Promise.resolve([])}getData(e){return!this.renderer_||!this.rendered?null:this.renderer_.getData(e)}isVisible(e){let t,n=this.getMapInternal();!e&&n&&(e=n.getView()),t=e instanceof Pl?{viewState:e.getState(),extent:e.calculateExtent()}:e,!t.layerStatesArray&&n&&(t.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let r;if(t.layerStatesArray){if(r=t.layerStatesArray.find(e=>e.layer===this),!r)return!1}else r=this.getLayerState();let i=this.getExtent();return Qu(r,t.viewState)&&(!i||Eo(i,t.extent))}getAttributions(e){var t;if(!this.isVisible(e))return[];let n=(t=this.getSource())==null?void 0:t.getAttributions();if(!n)return[];let r=n(e instanceof Pl?e.getViewStateAndExtent():e);return Array.isArray(r)||(r=[r]),r}render(e,t){let n=this.getRenderer();return n.prepareFrame(e)?(this.rendered=!0,n.renderFrame(e,t)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(e,t){}renderDeferred(e){let t=this.getRenderer();t&&t.renderDeferred(e)}setMapInternal(e){e||this.unrender(),this.set(W.MAP,e)}getMapInternal(){return this.get(W.MAP)}setMap(e){this.mapPrecomposeKey_&&(M(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),e||this.changed(),this.mapRenderKey_&&(M(this.mapRenderKey_),this.mapRenderKey_=null),e&&(this.mapPrecomposeKey_=j(e,Xu.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=j(this,N.CHANGE,e.render,e),this.changed())}handlePrecompose_(e){let t=e.frameState.layerStatesArray,n=this.getLayerState(!1);R(!t.some(e=>e.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),t.push(n)}setSource(e){this.set(W.SOURCE,e)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}};function Qu(e,t){if(!e.visible)return!1;let n=t.resolution;if(n<e.minResolution||n>=e.maxResolution)return!1;let r=t.zoom;return r>e.minZoom&&r<=e.maxZoom}function $u(e,t,n=0,r=e.length-1,i=td){for(;r>n;){if(r-n>600){let a=r-n+1,o=t-n+1,s=Math.log(a),c=.5*Math.exp(2*s/3),l=.5*Math.sqrt(s*c*(a-c)/a)*(o-a/2<0?-1:1);$u(e,t,Math.max(n,Math.floor(t-o*c/a+l)),Math.min(r,Math.floor(t+(a-o)*c/a+l)),i)}let a=e[t],o=n,s=r;for(ed(e,n,t),i(e[r],a)>0&&ed(e,n,r);o<s;){for(ed(e,o,s),o++,s--;i(e[o],a)<0;)o++;for(;i(e[s],a)>0;)s--}i(e[n],a)===0?ed(e,n,s):(s++,ed(e,s,r)),s<=t&&(n=s+1),t<=s&&(r=s-1)}}function ed(e,t,n){let r=e[t];e[t]=e[n],e[n]=r}function td(e,t){return e<t?-1:+(e>t)}var nd=class{constructor(e=9){this._maxEntries=Math.max(4,e),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(e){let t=this.data,n=[];if(!md(e,t))return n;let r=this.toBBox,i=[];for(;t;){for(let a=0;a<t.children.length;a++){let o=t.children[a],s=t.leaf?r(o):o;md(e,s)&&(t.leaf?n.push(o):pd(e,s)?this._all(o,n):i.push(o))}t=i.pop()}return n}collides(e){let t=this.data;if(!md(e,t))return!1;let n=[];for(;t;){for(let r=0;r<t.children.length;r++){let i=t.children[r],a=t.leaf?this.toBBox(i):i;if(md(e,a)){if(t.leaf||pd(e,a))return!0;n.push(i)}}t=n.pop()}return!1}load(e){if(!(e&&e.length))return this;if(e.length<this._minEntries){for(let t=0;t<e.length;t++)this.insert(e[t]);return this}let t=this._build(e.slice(),0,e.length-1,0);if(!this.data.children.length)this.data=t;else if(this.data.height===t.height)this._splitRoot(this.data,t);else{if(this.data.height<t.height){let e=this.data;this.data=t,t=e}this._insert(t,this.data.height-t.height-1,!0)}return this}insert(e){return e&&this._insert(e,this.data.height-1),this}clear(){return this.data=hd([]),this}remove(e,t){if(!e)return this;let n=this.data,r=this.toBBox(e),i=[],a=[],o,s,c;for(;n||i.length;){if(n||(n=i.pop(),s=i[i.length-1],o=a.pop(),c=!0),n.leaf){let r=rd(e,n.children,t);
2if(r!==-1)return n.children.splice(r,1),i.push(n),this._condense(i),this}!c&&!n.leaf&&pd(n,r)?(i.push(n),a.push(o),o=0,s=n,n=n.children[0]):s?(o++,n=s.children[o],c=!1):n=null}return this}toBBox(e){return e}compareMinX(e,t){return e.minX-t.minX}compareMinY(e,t){return e.minY-t.minY}toJSON(){return this.data}fromJSON(e){return this.data=e,this}_all(e,t){let n=[];for(;e;)e.leaf?t.push(...e.children):n.push(...e.children),e=n.pop();return t}_build(e,t,n,r){let i=n-t+1,a=this._maxEntries,o;if(i<=a)return o=hd(e.slice(t,n+1)),id(o,this.toBBox),o;r||(r=Math.ceil(Math.log(i)/Math.log(a)),a=Math.ceil(i/a**(r-1))),o=hd([]),o.leaf=!1,o.height=r;let s=Math.ceil(i/a),c=s*Math.ceil(Math.sqrt(a));gd(e,t,n,c,this.compareMinX);for(let i=t;i<=n;i+=c){let t=Math.min(i+c-1,n);gd(e,i,t,s,this.compareMinY);for(let n=i;n<=t;n+=s){let i=Math.min(n+s-1,t);o.children.push(this._build(e,n,i,r-1))}}return id(o,this.toBBox),o}_chooseSubtree(e,t,n,r){for(;r.push(t),!(t.leaf||r.length-1===n);){let n=1/0,r=1/0,i;for(let a=0;a<t.children.length;a++){let o=t.children[a],s=ld(o),c=dd(e,o)-s;c<r?(r=c,n=s<n?s:n,i=o):c===r&&s<n&&(n=s,i=o)}t=i||t.children[0]}return t}_insert(e,t,n){let r=n?e:this.toBBox(e),i=[],a=this._chooseSubtree(r,this.data,t,i);for(a.children.push(e),od(a,r);t>=0&&i[t].children.length>this._maxEntries;)this._split(i,t),t--;this._adjustParentBBoxes(r,i,t)}_split(e,t){let n=e[t],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);let a=this._chooseSplitIndex(n,i,r),o=hd(n.children.splice(a,n.children.length-a));o.height=n.height,o.leaf=n.leaf,id(n,this.toBBox),id(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(n,o)}_splitRoot(e,t){this.data=hd([e,t]),this.data.height=e.height+1,this.data.leaf=!1,id(this.data,this.toBBox)}_chooseSplitIndex(e,t,n){let r,i=1/0,a=1/0;for(let o=t;o<=n-t;o++){let t=ad(e,0,o,this.toBBox),s=ad(e,o,n,this.toBBox),c=fd(t,s),l=ld(t)+ld(s);c<i?(i=c,r=o,a=l<a?l:a):c===i&&l<a&&(a=l,r=o)}return r||n-t}_chooseSplitAxis(e,t,n){let r=e.leaf?this.compareMinX:sd,i=e.leaf?this.compareMinY:cd;this._allDistMargin(e,t,n,r)<this._allDistMargin(e,t,n,i)&&e.children.sort(r)}_allDistMargin(e,t,n,r){e.children.sort(r);let i=this.toBBox,a=ad(e,0,t,i),o=ad(e,n-t,n,i),s=ud(a)+ud(o);for(let r=t;r<n-t;r++){let t=e.children[r];od(a,e.leaf?i(t):t),s+=ud(a)}for(let r=n-t-1;r>=t;r--){let t=e.children[r];od(o,e.leaf?i(t):t),s+=ud(o)}return s}_adjustParentBBoxes(e,t,n){for(let r=n;r>=0;r--)od(t[r],e)}_condense(e){for(let t=e.length-1,n;t>=0;t--)e[t].children.length===0?t>0?(n=e[t-1].children,n.splice(n.indexOf(e[t]),1)):this.clear():id(e[t],this.toBBox)}};function rd(e,t,n){if(!n)return t.indexOf(e);for(let r=0;r<t.length;r++)if(n(e,t[r]))return r;return-1}function id(e,t){ad(e,0,e.children.length,t,e)}function ad(e,t,n,r,i){i||(i=hd(null)),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let a=t;a<n;a++){let t=e.children[a];od(i,e.leaf?r(t):t)}return i}function od(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function sd(e,t){return e.minX-t.minX}function cd(e,t){return e.minY-t.minY}function ld(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function ud(e){return e.maxX-e.minX+(e.maxY-e.minY)}function dd(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function fd(e,t){let n=Math.max(e.minX,t.minX),r=Math.max(e.minY,t.minY),i=Math.min(e.maxX,t.maxX),a=Math.min(e.maxY,t.maxY);return Math.max(0,i-n)*Math.max(0,a-r)}function pd(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function md(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function hd(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function gd(e,t,n,r,i){let a=[t,n];for(;a.length;){if(n=a.pop(),t=a.pop(),n-t<=r)continue;let o=t+Math.ceil((n-t)/r/2)*r;$u(e,o,t,n,i),a.push(t,o,o,n)}}var _d=[NaN,NaN,NaN,0],vd;function yd(){return vd||(vd=U(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),vd}var bd=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,xd=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Sd=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Cd=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function wd(e,t){return e.endsWith(`%`)?Number(e.substring(0,e.length-1))/t:Number(e)}function Td(e){throw Error(`failed to parse "`+e+`" as color`)}function Ed(e){if(e.toLowerCase().startsWith(`rgb`)){let t=e.match(xd)||e.match(bd)||e.match(Sd);if(t){let e=t[4],n=100/255;return[z(wd(t[1],n)+.5|0,0,255),z(wd(t[2],n)+.5|0,0,255),z(wd(t[3],n)+.5|0,0,255),e===void 0?1:z(wd(e,100),0,1)]}Td(e)}if(e.startsWith(`#`)){if(Cd.test(e)){let t=e.substring(1),n=t.length<=4?1:2,r=[0,0,0,255];for(let e=0,i=t.length;e<i;e+=n){let i=parseInt(t.substring(e,e+n),16);n===1&&(i+=i<<4),r[e/n]=i}return r[3]/=255,r}Td(e)}let t=yd();t.fillStyle=`#abcdef`;let n=t.fillStyle;t.fillStyle=e,t.fillStyle===n&&(t.fillStyle=`#fedcba`,n=t.fillStyle,t.fillStyle=e,t.fillStyle===n&&Td(e));let r=t.fillStyle;if(r.startsWith(`#`)||r.startsWith(`rgba`))return Ed(r);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);let i=Array.from(t.getImageData(0,0,1,1).data);return i[3]=Ha(i[3]/255,3),i}function Dd(e){return typeof e==`string`?e:Bd(e)}var Od=1024,kd={},Ad=0;
2function jd(e){if(e.length===4)return e;let t=e.slice();return t[3]=1,t}function Md(e){return e>.0031308?e**(1/2.4)*269.025-14.025:e*3294.6}function Nd(e){return e>.2068965?e**3:(e-4/29)*(108/841)}function Pd(e){return e>10.314724?((e+14.025)/269.025)**2.4:e/3294.6}function Fd(e){return e>.0088564?e**(1/3):e/(108/841)+4/29}function Id(e){let t=Pd(e[0]),n=Pd(e[1]),r=Pd(e[2]),i=Fd(t*.222488403+n*.716873169+r*.06060791),a=500*(Fd(t*.452247074+n*.399439023+r*.148375274)-i),o=200*(i-Fd(t*.016863605+n*.117638439+r*.865350722)),s=180/Math.PI*Math.atan2(o,a);return[116*i-16,Math.sqrt(a*a+o*o),s<0?s+360:s,e[3]]}function Ld(e){let t=(e[0]+16)/116,n=e[1],r=e[2]*Math.PI/180,i=Nd(t),a=Nd(t+n/500*Math.cos(r)),o=Nd(t-n/200*Math.sin(r)),s=Md(a*3.021973625-i*1.617392459-o*.404875592),c=Md(a*-.943766287+i*1.916279586+o*.027607165),l=Md(a*.069407491-i*.22898585+o*1.159737864);return[z(s+.5|0,0,255),z(c+.5|0,0,255),z(l+.5|0,0,255),e[3]]}function Rd(e){if(e===`none`)return _d;if(kd.hasOwnProperty(e))return kd[e];if(Ad>=Od){let e=0;for(let t in kd)e++&3||(delete kd[t],--Ad)}let t=Ed(e);t.length!==4&&Td(e);for(let n of t)isNaN(n)&&Td(e);return kd[e]=t,++Ad,t}function zd(e){return Array.isArray(e)?e:Rd(e)}function Bd(e){let t=e[0];t!=(t|0)&&(t=t+.5|0);let n=e[1];n!=(n|0)&&(n=n+.5|0);let r=e[2];r!=(r|0)&&(r=r+.5|0);let i=e[3]===void 0?1:Math.round(e[3]*1e3)/1e3;return`rgba(`+t+`,`+n+`,`+r+`,`+i+`)`}function Vd(e){return e[0]>0&&e[1]>0}function Hd(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function Ud(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var Wd=0,Gd=1<<Wd++,G=1<<Wd++,Kd=1<<Wd++,qd=1<<Wd++,Jd=1<<Wd++,Yd=1<<Wd++,Xd=2**Wd-1,Zd={[Gd]:`boolean`,[G]:`number`,[Kd]:`string`,[qd]:`color`,[Jd]:`number[]`,[Yd]:`size`},Qd=Object.keys(Zd).map(Number).sort(Ji);function $d(e){return e in Zd}function ef(e){let t=[];for(let n of Qd)tf(e,n)&&t.push(Zd[n]);return t.length===0?`untyped`:t.length<3?t.join(` or `):t.slice(0,-1).join(`, `)+`, or `+t[t.length-1]}function tf(e,t){return(e&t)===t}function nf(e,t){return!!(e&t)}function rf(e,t){return e===t}var K=class{constructor(e,t){if(!$d(e))throw Error(`literal expressions must have a specific type, got ${ef(e)}`);this.type=e,this.value=t}},af=class{constructor(e,t,...n){this.type=e,this.operator=t,this.args=n}};function of(e){return{variables:new Map,properties:new Map,featureId:!1,geometryType:!1,mCoordinate:!1,mapState:!1,inputVariables:e}}function q(e,t,n){switch(typeof e){case`boolean`:if(rf(t,Kd))return new K(Kd,e?`true`:`false`);if(!tf(t,Gd))throw Error(`got a boolean, but expected ${ef(t)}`);return new K(Gd,e);case`number`:if(rf(t,Yd))return new K(Yd,Ud(e));if(rf(t,Gd))return new K(Gd,!!e);if(rf(t,Kd))return new K(Kd,e.toString());if(!tf(t,G))throw Error(`got a number, but expected ${ef(t)}`);return new K(G,e);case`string`:if(rf(t,qd))return new K(qd,Rd(e));if(rf(t,Gd))return new K(Gd,!!e);if(!tf(t,Kd))throw Error(`got a string, but expected ${ef(t)}`);return new K(Kd,e)}if(!Array.isArray(e))throw Error(`expression must be an array or a primitive value`);if(e.length===0)throw Error(`empty expression`);if(typeof e[0]==`string`)return wf(e,t,n);for(let t of e)if(typeof t!=`number`)throw Error(`expected an array of numbers`);if(rf(t,Yd)){if(e.length!==2)throw Error(`expected an array of two values for a size, got ${e.length}`);return new K(Yd,e)}if(rf(t,qd)){if(e.length===3)return new K(qd,[...e,1]);if(e.length===4)return new K(qd,e);throw Error(`expected an array of 3 or 4 values for a color, got ${e.length}`)}if(!tf(t,Jd))throw Error(`got an array of numbers, but expected ${ef(t)}`);return new K(Jd,e)}var J={Get:`get`,Var:`var`,Concat:`concat`,GeometryType:`geometry-type`,LineMetric:`line-metric`,Any:`any`,All:`all`,Not:`!`,Resolution:`resolution`,Zoom:`zoom`,Time:`time`,Equal:`==`,NotEqual:`!=`,GreaterThan:`>`,GreaterThanOrEqualTo:`>=`,LessThan:`<`,LessThanOrEqualTo:`<=`,Multiply:`*`,Divide:`/`,Add:`+`,Subtract:`-`,Clamp:`clamp`,Mod:`%`,Pow:`^`,Abs:`abs`,Floor:`floor`,Ceil:`ceil`,Round:`round`,Sin:`sin`,Cos:`cos`,Atan:`atan`,Sqrt:`sqrt`,Match:`match`,Between:`between`,Interpolate:`interpolate`,Coalesce:`coalesce`,Case:`case`,In:`in`,Number:`number`,String:`string`,Array:`array`,Color:`color`,Id:`id`,Band:`band`,Palette:`palette`,ToString:`to-string`,Has:`has`},sf={[J.Get]:Z(Y(1,1/0),cf),[J.Var]:lf(),[J.Has]:Z(Y(1,1/0),cf),[J.Id]:Z(uf,mf),[J.Concat]:Z(Y(2,1/0),X(Kd)),[J.GeometryType]:Z(df,mf),[J.LineMetric]:Z(ff,mf),[J.Resolution]:Z(pf,mf),[J.Zoom]:Z(pf,mf),[J.Time]:Z(pf,mf),[J.Any]:Z(Y(2,1/0),X(Gd)),[J.All]:Z(Y(2,1/0),X(Gd)),[J.Not]:Z(Y(1,1),X(Gd)),[J.Equal]:Z(Y(2,2),gf()),[J.NotEqual]:Z(Y(2,2),gf()),[J.GreaterThan]:Z(Y(2,2),X(G)),[J.GreaterThanOrEqualTo]:Z(Y(2,2),X(G)),[J.LessThan]:Z(Y(2,2),X(G)),[J.LessThanOrEqualTo]:Z(Y(2,2),X(G)),[J.Multiply]:Z(Y(2,1/0),hf),[J.Coalesce]:Z(Y(2,1/0),hf),[J.Divi
2de]:Z(Y(2,2),X(G)),[J.Add]:Z(Y(2,1/0),X(G)),[J.Subtract]:Z(Y(2,2),X(G)),[J.Clamp]:Z(Y(3,3),X(G)),[J.Mod]:Z(Y(2,2),X(G)),[J.Pow]:Z(Y(2,2),X(G)),[J.Abs]:Z(Y(1,1),X(G)),[J.Floor]:Z(Y(1,1),X(G)),[J.Ceil]:Z(Y(1,1),X(G)),[J.Round]:Z(Y(1,1),X(G)),[J.Sin]:Z(Y(1,1),X(G)),[J.Cos]:Z(Y(1,1),X(G)),[J.Atan]:Z(Y(1,2),X(G)),[J.Sqrt]:Z(Y(1,1),X(G)),[J.Match]:Z(Y(4,1/0),vf,yf),[J.Between]:Z(Y(3,3),X(G)),[J.Interpolate]:Z(Y(6,1/0),vf,bf),[J.Case]:Z(Y(3,1/0),_f,xf),[J.In]:Z(Y(2,2),Sf),[J.Number]:Z(Y(1,1/0),X(Xd)),[J.String]:Z(Y(1,1/0),X(Xd)),[J.Array]:Z(Y(1,1/0),X(G)),[J.Color]:Z(Y(1,4),X(G)),[J.Band]:Z(Y(1,3),X(G)),[J.Palette]:Z(Y(2,2),Cf),[J.ToString]:Z(Y(1,1),X(Gd|G|Kd|qd))};function cf(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a){let r=e[a+1];switch(typeof r){case`number`:i[a]=new K(G,r);break;case`string`:i[a]=new K(Kd,r);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${r}`)}a===0&&n.properties.set(String(r),t)}return i}function lf(){return function(e,t,n){var r;let i=e[1];if(typeof i!=`string`)throw Error(`expected a string argument for var operation`);let a=t,o=(r=n.inputVariables)==null?void 0:r[i];if(o!==void 0){let e=q(o,Xd,n);if(!(e instanceof K))throw Error(`style variables should only be literal values (no expressions!), variable name: ${i}`);let r=e.type;if(typeof o==`string`&&nf(a,qd)&&!nf(a,Kd)?r=qd:Array.isArray(o)&&o.length===2&&nf(a,Yd)&&!nf(a,Jd)&&(r=Yd),a&=r,a===0)throw Error(`the type expected from the var operator (${ef(t)}) did not have any overlap with the type of the corresponding style variables (${ef(r)}), variable name: ${i}`)}if(n.variables.has(i)){let e=n.variables.get(i);if(a&=e,a===0)throw Error(`a new type expected from the var operator (${ef(t)}) did not have any overlap with the previous type expected for it (${ef(e)}), variable name: ${i}`)}return n.variables.set(i,a),new af(a,`var`,new K(Kd,i))}}function uf(e,t,n){n.featureId=!0}function df(e,t,n){n.geometryType=!0}function ff(e,t,n){n.mCoordinate=!0}function pf(e,t,n){n.mapState=!0}function mf(e,t,n){let r=e[0];if(e.length!==1)throw Error(`expected no arguments for ${r} operation`);return[]}function Y(e,t){return function(n,r,i){let a=n[0],o=n.length-1;if(e===t){if(o!==e)throw Error(`expected ${e} argument${e===1?``:`s`} for ${a}, got ${o}`)}else if(o<e||o>t){let n=t===1/0?`${e} or more`:`${e} to ${t}`;throw Error(`expected ${n} arguments for ${a}, got ${o}`)}}}function hf(e,t,n){let r=e.length-1,i=Array(r);for(let a=0;a<r;++a){let r=q(e[a+1],t,n);i[a]=r}return i}function X(e){return function(t,n,r){let i=t.length-1,a=Array(i);for(let n=0;n<i;++n){let i=q(t[n+1],e,r);a[n]=i}return a}}function gf(){return function(e,t,n){let r=e[0],i=e.length-1,a=Array(i),o=Xd;for(let t=0;t<i;++t){let r=q(e[t+1],o,n);o&=r.type}if(o===0)throw Error(`no common type was found among the arguments of ${r}`);for(let t=0;t<i;++t){let r=q(e[t+1],o,n);a[t]=r}return a}}function _f(e,t,n){let r=e[0],i=e.length-1;if(i%2==0)throw Error(`expected an odd number of arguments for ${r}, got ${i} instead`)}function vf(e,t,n){let r=e[0],i=e.length-1;if(i%2==1)throw Error(`expected an even number of arguments for operation ${r}, got ${i} instead`)}function yf(e,t,n){let r=e.length-1,i=q(e[e.length-1],t,n),a=Kd|G|Gd,o=Array(r-2);for(let t=0;t<r-2;t+=2){try{let r=q(e[t+2],a,n);a&=r.type}catch(e){throw Error(`failed to parse argument ${t+1} of match expression: ${e.message}`)}if(a===0)throw Error(`no common type was found among the arguments of match expression`)}for(let t=0;t<r-2;t+=2){try{let r=q(e[t+2],a,n);o[t]=r}catch(e){throw Error(`failed to parse argument ${t+1} of match expression: ${e.message}`)}try{let r=q(e[t+3],i.type,n);o[t+1]=r}catch(e){throw Error(`failed to parse argument ${t+2} of match expression: ${e.message}`)}}return[q(e[1],a,n),...o,i]}function bf(e,t,n){let r=e[1],i;switch(r[0]){case`linear`:i=1;break;case`exponential`:let e=r[1];if(typeof e!=`number`||e<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(e)} instead`);i=e;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(r)}`)}let a=new K(G,i),o;try{o=q(e[2],G,n)}catch(e){throw Error(`failed to parse argument 1 in interpolate expression: ${e.message}`)}let s=Array(e.length-3);for(let r=0;r<s.length;r+=2){try{let t=q(e[r+3],G,n);s[r]=t}catch(e){throw Error(`failed to parse argument ${r+2} for interpolate expression: ${e.message}`)}try{let i=q(e[r+4],t,n);s[r+1]=i}catch(e){throw Error(`failed to parse argument ${r+3} for interpolate expression: ${e.message}`)}}return[a,o,...s]}function xf(e,t,n){let r=q(e[e.length-1],t,n),i=Array(e.length-1);for(let t=0;t<i.length-1;t+=2){try{let r=q(e[t+1],Gd,n);i[t]=r}catch(e){throw Error(`failed to parse argument ${t} of case expression: ${e.message}`)}try{let a=q(e[t+2],r.type,n);i[t+1]=a}catch(e){throw Error(`failed to parse argument ${t+1} of case expression: ${e.message}`)}}return i[i.length-1]=r,i}function Sf(e,t,n){let r=e[2];if(!Array.isArray(r))throw Error(`the second argument for the "in" operator must be an array`);let i;if(r[0]===`literal`){if(r=r[1],!Array.isArray(r))throw Error(`failed to parse "in" expression: the literal operator must be followed by an array`)}else if(typeof r[0]==`string`)throw Error(`for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions`);i=typeof r[0]==`string`?Kd:G;let a=Array(r.length);for(let e=0;e<a.length;e++)try{let t=q(r[e],i,n);a[e]=t}catch(t){throw Error(`failed to parse haystack item ${e} for "in" expression: ${t.message}`)}return[q(e[1],i,n),...a]}function Cf(e,t,n){let r;try{r=q(e[1],G,n)}catch(e){throw Error(`failed to parse first argument in palette expression: ${e.message}`)}let i=e[2];if(!Array.isArray(i))throw Error(`the second argument of palette must be an array`);let a=Array(i.length);for(let e=0;e<a.length;e++){let t;try{t=q(i[e],qd,n)}catch(t){throw Error(`failed to parse color at index ${e} in palette expression: ${t.message}`)}if(!(t instanceof K))throw Error(`the palette color at index ${e} must be a literal value`);a[e]=t}return[r,...a]}function Z(...e){return function(t,n,r){let i=t[0],a;for(let i=0;i<e.length;i++){let o=e[i](t,n,r);if(i==e.length-1){if(!o)throw Error(`expected last argument validator to return the parsed args`);a=o}}return new af(n,i,...a)}}function wf(e,t,n){let r=e[0],i=sf[r];if(!i)throw Error(`unknown operator: ${r}`);return i(e,t,n)}function Tf(e){if(!e)return``;let t=e.getType();
2switch(t){case`Point`:case`LineString`:case`Polygon`:return t;case`MultiPoint`:case`MultiLineString`:case`MultiPolygon`:return t.substring(5);case`Circle`:return`Polygon`;case`GeometryCollection`:return Tf(e.getGeometries()[0]);default:return``}}function Ef(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:``}}function Df(e,t,n){return Of(q(e,t,n),n)}function Of(e,t){if(e instanceof K){if(e.type===qd&&typeof e.value==`string`){let t=Rd(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case J.Number:case J.String:case J.Coalesce:return kf(e,t);case J.Get:case J.Var:case J.Has:return Af(e,t);case J.Id:return e=>e.featureId;case J.GeometryType:return e=>e.geometryType;case J.Concat:{let n=e.args.map(e=>Of(e,t));return e=>``.concat(...n.map(t=>t(e).toString()))}case J.Resolution:return e=>e.resolution;case J.Any:case J.All:case J.Between:case J.In:case J.Not:return Mf(e,t);case J.Equal:case J.NotEqual:case J.LessThan:case J.LessThanOrEqualTo:case J.GreaterThan:case J.GreaterThanOrEqualTo:return jf(e,t);case J.Multiply:case J.Divide:case J.Add:case J.Subtract:case J.Clamp:case J.Mod:case J.Pow:case J.Abs:case J.Floor:case J.Ceil:case J.Round:case J.Sin:case J.Cos:case J.Atan:case J.Sqrt:return Nf(e,t);case J.Case:return Pf(e,t);case J.Match:return Ff(e,t);case J.Interpolate:return If(e,t);case J.ToString:return Lf(e,t);default:throw Error(`Unsupported operator ${n}`)}}function kf(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=Of(e.args[n],t);switch(n){case J.Coalesce:return e=>{for(let t=0;t<r;++t){let n=i[t](e);if(n!=null)return n}throw Error(`Expected one of the values to be non-null`)};case J.Number:case J.String:return e=>{for(let t=0;t<r;++t){let r=i[t](e);if(typeof r===n)return r}throw Error(`Expected one of the values to be a ${n}`)};default:throw Error(`Unsupported assertion operator ${n}`)}}function Af(e,t){let n=e.args[0].value;switch(e.operator){case J.Get:return t=>{let r=e.args,i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;i=i[t]}return i};case J.Var:return e=>e.variables[n];case J.Has:return t=>{let r=e.args;if(!(n in t.properties))return!1;let i=t.properties[n];for(let e=1,t=r.length;e<t;++e){let t=r[e].value;if(!i||!Object.hasOwn(i,t))return!1;i=i[t]}return!0};default:throw Error(`Unsupported accessor operator ${e.operator}`)}}function jf(e,t){let n=e.operator,r=Of(e.args[0],t),i=Of(e.args[1],t);switch(n){case J.Equal:return e=>r(e)===i(e);case J.NotEqual:return e=>r(e)!==i(e);case J.LessThan:return e=>r(e)<i(e);case J.LessThanOrEqualTo:return e=>r(e)<=i(e);case J.GreaterThan:return e=>r(e)>i(e);case J.GreaterThanOrEqualTo:return e=>r(e)>=i(e);default:throw Error(`Unsupported comparison operator ${n}`)}}function Mf(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=Of(e.args[n],t);switch(n){case J.Any:return e=>{for(let t=0;t<r;++t)if(i[t](e))return!0;return!1};case J.All:return e=>{for(let t=0;t<r;++t)if(!i[t](e))return!1;return!0};case J.Between:return e=>{let t=i[0](e),n=i[1](e),r=i[2](e);return t>=n&&t<=r};case J.In:return e=>{let t=i[0](e);for(let n=1;n<r;++n)if(t===i[n](e))return!0;return!1};case J.Not:return e=>!i[0](e);default:throw Error(`Unsupported logical operator ${n}`)}}function Nf(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=Of(e.args[n],t);switch(n){case J.Multiply:return e=>{let t=1;for(let n=0;n<r;++n)t*=i[n](e);return t};case J.Divide:return e=>i[0](e)/i[1](e);case J.Add:return e=>{let t=0;for(let n=0;n<r;++n)t+=i[n](e);return t};case J.Subtract:return e=>i[0](e)-i[1](e);case J.Clamp:return e=>{let t=i[0](e),n=i[1](e);if(t<n)return n;let r=i[2](e);return t>r?r:t};case J.Mod:return e=>i[0](e)%i[1](e);case J.Pow:return e=>i[0](e)**+i[1](e);case J.Abs:return e=>Math.abs(i[0](e));case J.Floor:return e=>Math.floor(i[0](e));case J.Ceil:return e=>Math.ceil(i[0](e));case J.Round:return e=>Math.round(i[0](e));case J.Sin:return e=>Math.sin(i[0](e));case J.Cos:return e=>Math.cos(i[0](e));case J.Atan:return r===2?e=>Math.atan2(i[0](e),i[1](e)):e=>Math.atan(i[0](e));case J.Sqrt:return e=>Math.sqrt(i[0](e));default:throw Error(`Unsupported numeric operator ${n}`)}}function Pf(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=Of(e.args[i],t);return e=>{for(let t=0;t<n-1;t+=2)if(r[t](e))return r[t+1](e);return r[n-1](e)}}function Ff(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=Of(e.args[i],t);return e=>{let t=r[0](e);for(let i=1;i<n-1;i+=2)if(t===r[i](e))return r[i+1](e);return r[n-1](e)}}function If(e,t){let n=e.args.length,r=Array(n);for(let i=0;i<n;++i)r[i]=Of(e.args[i],t);return e=>{let t=r[0](e),i=r[1](e),a,o;for(let s=2;s<n;s+=2){let n=r[s](e),c=r[s+1](e),l=Array.isArray(c);if(l&&(c=jd(c)),n>=i)return s===2?c:l?zf(t,i,a,o,n,c):Rf(t,i,a,o,n,c);a=n,o=c}return o}}function Lf(e,t){let n=e.operator,r=e.args.length,i=Array(r);for(let n=0;n<r;++n)i[n]=Of(e.args[n],t);switch(n){case J.ToString:return t=>{let n=i[0](t);return e.args[0].type===qd?Bd(n):n.toString()};default:throw Error(`Unsupported convert operator ${n}`)}}function Rf(e,t,n,r,i,a){let o=i-n;if(o===0)return r;let s=t-n;return r+(e===1?s/o:(e**+s-1)/(e**+o-1))*(a-r)}function zf(e,t,n,r,i,a){if(i-n===0)return r;let o=Id(r),s=Id(a),c=s[2]-o[2];return c>180?c-=360:c<-180&&(c+=360),Ld([Rf(e,t,n,o[0],i,s[0]),Rf(e,t,n,o[1],i,s[1]),o[2]+Rf(e,t,n,0,i,c),Rf(e,t,n,r[3],i,a[3])])}var Q={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Bf(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[Gi(r,N.LOAD,function(){o=!0,a||t()})];return r.src&&Ca?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())}
2)):s.push(Gi(r,N.ERROR,n)),function(){i=!1,s.forEach(M)}}function Vf(e,t){return new Promise((n,r)=>{function i(){o(),n(e)}function a(){o(),r(Error(`Image load error`))}function o(){e.removeEventListener(`load`,i),e.removeEventListener(`error`,a)}e.addEventListener(`load`,i),e.addEventListener(`error`,a),t&&(e.src=t)})}function Hf(e,t){return t&&(e.src=t),e.src&&Ca?new Promise((t,n)=>e.decode().then(()=>t(e)).catch(r=>e.complete&&e.width?t(e):n(r))):Vf(e)}var Uf=class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let e=0;for(let t in this.cache_){let n=this.cache_[t];!(e++&3)&&!n.hasListener()&&(delete this.cache_[t],delete this.patternCache_[t],--this.cacheSize_)}}}get(e,t){let n=Wf(e,t);return n in this.cache_?this.cache_[n]:null}getPattern(e,t){let n=Wf(e,t);return n in this.patternCache_?this.patternCache_[n]:null}set(e,t,n,r){let i=Wf(e,t),a=i in this.cache_;this.cache_[i]=n,r&&(n.getImageState()===Q.IDLE&&n.load(),n.getImageState()===Q.LOADING?n.ready().then(()=>{this.patternCache_[i]=Xl().createPattern(n.getImage(1),`repeat`)}):this.patternCache_[i]=Xl().createPattern(n.getImage(1),`repeat`)),a||++this.cacheSize_}setSize(e){this.maxCacheSize_=e,this.expire()}};function Wf(e,t){let n=t?zd(t):`null`;return e+`:`+n}var Gf=new Uf,Kf=null,qf=class extends sa{constructor(e,t,n,r,i){super(),this.hitDetectionImage_=null,this.image_=e,this.crossOrigin_=n==null?void 0:n.crossOrigin,this.referrerPolicy_=n==null?void 0:n.referrerPolicy,this.canvas_={},this.color_=i,this.imageState_=r===void 0?Q.IDLE:r,this.size_=e&&e.width&&e.height?[e.width,e.height]:null,this.src_=t,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Q.LOADED){Kf||(Kf=U(1,1,void 0,{willReadFrequently:!0})),Kf.drawImage(this.image_,0,0);try{Kf.getImageData(0,0,1,1),this.tainted_=!1}catch{Kf=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(N.CHANGE)}handleImageError_(){this.imageState_=Q.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Q.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(e){return this.image_||this.initializeImage_(),this.replaceColor_(e),this.canvas_[e]?this.canvas_[e]:this.image_}setImage(e){this.image_=e}getPixelRatio(e){return this.replaceColor_(e),this.canvas_[e]?e:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_){if(this.isTainted_()){let e=this.size_[0],t=this.size_[1],n=U(e,t);n.fillRect(0,0,e,t),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_}return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Q.IDLE){this.image_||this.initializeImage_(),this.imageState_=Q.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Hf(this.image_,this.src_).then(e=>{this.image_=e,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(e){if(!this.color_||this.canvas_[e]||this.imageState_!==Q.LOADED)return;let t=this.image_,n=U(Math.ceil(t.width*e),Math.ceil(t.height*e)),r=n.canvas;n.scale(e,e),n.drawImage(t,0,0),n.globalCompositeOperation=`multiply`,n.fillStyle=Dd(this.color_),n.fillRect(0,0,r.width/e,r.height/e),n.globalCompositeOperation=`destination-in`,n.drawImage(t,0,0),this.canvas_[e]=r}ready(){return this.ready_||(this.ready_=new Promise(e=>{if(this.imageState_===Q.LOADED||this.imageState_===Q.ERROR)e();else{let t=()=>{(this.imageState_===Q.LOADED||this.imageState_===Q.ERROR)&&(this.removeEventListener(N.CHANGE,t),e())};this.addEventListener(N.CHANGE,t)}})),this.ready_}};function Jf(e,t,n,r,i,a){let o=t===void 0?void 0:Gf.get(t,i);return o||(o=new qf(e,e&&`src`in e?e.src||void 0:t,n,r,i),Gf.set(t,i,o,a)),a&&o&&!Gf.getPattern(t,i)&&Gf.set(t,i,o,a),o}function Yf(e){return e?Array.isArray(e)?Bd(e):typeof e==`object`&&`src`in e?Xf(e):e:null}function Xf(e){if(!e.offset||!e.size)return Gf.getPattern(e.src,e.color);let t=e.src+`:`+e.offset,n=Gf.getPattern(t,e.color);if(n)return n;let r=Gf.get(e.src,null);if(r.getImageState()!==Q.LOADED)return null;let i=U(e.size[0],e.size[1]);return i.drawImage(r.getImage(1),e.offset[0],e.offset[1],e.size[0],e.size[1],0,0,e.size[0],e.size[1]),Jf(i.canvas,t,void 0,Q.LOADED,e.color,!0),Gf.getPattern(t,e.color)}var Zf=`10px sans-serif`,Qf=`#000`,$f=`round`,ep=[],tp=`round`,np=`#000`,rp=`center`,ip=`middle`,ap=[0,0,0,0],op=new fa,sp=null,cp,lp={},up=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`,`emoji`,`math`,`fangsong`]);function dp(e,t,n){return`${e} ${t} 16px "${n}"`}var fp=(function(){let e,t;async function n(e){await t.ready;let n=Jl(e),r=n.families[0].toLowerCase(),i=n.weight,a=[];
2return t.forEach(e=>{let t=e.family.replace(/^['"]|['"]$/g,``).toLowerCase(),o=ql[e.weight]||e.weight;t===r&&e.style===n.style&&o==i&&a.push(e)}),a.length!==0&&(await Promise.all(a.map(e=>e.load().then(()=>!0,()=>!1)))).some(e=>e)}async function r(){await t.ready;let i=!0,a=op.getProperties(),o=Object.keys(a).filter(e=>a[e]<100);for(let e=o.length-1;e>=0;--e){let t=o[e],r=a[t];r<100&&(await n(t)?(Ui(lp),op.set(t,100)):(r+=10,op.set(t,r,!0),r<100&&(i=!1)))}e=void 0,i||(e=setTimeout(r,100))}return async function(n){t||(t=Sa?self.fonts:document.fonts);let i=Jl(n);if(!i)return;let a=i.families,o=!1;for(let e of a){if(up.has(e))continue;let t=dp(i.style,i.weight,e);op.get(t)===void 0&&(op.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}})(),pp=(function(){let e;return function(t){let n=lp[t];if(n==null){if(Sa){let e=Jl(t),r=mp(t,`Žg`);n=(isNaN(Number(e.lineHeight))?1.2:Number(e.lineHeight))*(r.actualBoundingBoxAscent+r.actualBoundingBoxDescent)}else e||(e=document.createElement(`div`),e.innerHTML=`M`,e.style.minHeight=`0`,e.style.maxHeight=`none`,e.style.height=`auto`,e.style.padding=`0`,e.style.border=`none`,e.style.position=`absolute`,e.style.display=`block`,e.style.left=`-99999px`),e.style.font=t,document.body.appendChild(e),n=e.offsetHeight,document.body.removeChild(e);lp[t]=n}return n}})();function mp(e,t){return sp||(sp=U(1,1)),e!=cp&&(sp.font=e,cp=sp.font),sp.measureText(t)}function hp(e,t){return mp(e,t).width}function gp(e,t,n){if(t in n)return n[t];let r=t.split(` 3`).reduce((t,n)=>Math.max(t,hp(e,n)),0);return n[t]=r,r}function _p(e,t){let n=[],r=[],i=[],a=0,o=0,s=0,c=0;for(let l=0,u=t.length;l<=u;l+=2){let d=t[l];if(d===` 4`||l===u){a=Math.max(a,o),i.push(o),o=0,s+=c,c=0;continue}let f=t[l+1]||e.font,p=hp(f,d);n.push(p),o+=p;let m=pp(f);r.push(m),c=Math.max(c,m)}return{width:a,height:s,widths:n,heights:r,lineWidths:i}}function vp(e,t,n,r,i,a,o,s,c,l,u){e.save(),n!==1&&(e.globalAlpha===void 0?e.globalAlpha=e=>e.globalAlpha*=n:e.globalAlpha*=n),t&&e.transform.apply(e,t),r.contextInstructions?(e.translate(c,l),e.scale(u[0],u[1]),yp(r,e)):u[0]<0||u[1]<0?(e.translate(c,l),e.scale(u[0],u[1]),e.drawImage(r,i,a,o,s,0,0,o,s)):e.drawImage(r,i,a,o,s,c,l,o*u[0],s*u[1]),e.restore()}function yp(e,t){let n=e.contextInstructions;for(let e=0,r=n.length;e<r;e+=2)Array.isArray(n[e+1])?t[n[e]].apply(t,n[e+1]):t[n[e]]=n[e+1]}var bp=class e{constructor(e){this.opacity_=e.opacity,this.rotateWithView_=e.rotateWithView,this.rotation_=e.rotation,this.scale_=e.scale,this.scaleArray_=Ud(e.scale),this.displacement_=e.displacement,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return P()}getImage(e){return P()}getHitDetectionImage(){return P()}getPixelRatio(e){return 1}getImageState(){return P()}getImageSize(){return P()}getOrigin(){return P()}getSize(){return P()}setDisplacement(e){this.displacement_=e}setOpacity(e){this.opacity_=e}setRotateWithView(e){this.rotateWithView_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Ud(e)}listenImageChange(e){P()}load(){P()}unlistenImageChange(e){P()}ready(){return Promise.resolve()}},xp=class e extends bp{constructor(e){super({opacity:1,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,rotation:e.rotation===void 0?0:e.rotation,scale:e.scale===void 0?1:e.scale,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=e.fill===void 0?null:e.fill,this.origin_=[0,0],this.points_=e.points,this.radius=e.radius,this.radius2_=e.radius2,this.angle_=e.angle===void 0?0:e.angle,this.stroke_=e.stroke===void 0?null:e.stroke,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?Q.LOADING:Q.LOADED,this.imageState_===Q.LOADING&&this.ready().then(()=>this.imageState_=Q.LOADED),this.render()}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.get
4Stroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}getAnchor(){let e=this.size_,t=this.getDisplacement(),n=this.getScaleArray();return[e[0]/2-t[0]/n[0],e[1]/2+t[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(e){this.fill_=e,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(e){var t,n;let r=(t=this.fill_)==null?void 0:t.getKey(),i=`${e},${this.angle_},${this.radius},${this.radius2_},${this.points_},${r}`+Object.values(this.renderOptions_).join(`,`),a=(n=Gf.get(i,null))==null?void 0:n.getImage(1);if(!a){let t=this.renderOptions_,n=Math.ceil(t.size*e),r=U(n,n);this.draw_(t,r,e),a=r.canvas;let o=new qf(a,void 0,null,Q.LOADED,null);Gf.set(i,null,o),createImageBitmap(a).then(e=>{o.setImage(e)})}return a}getPixelRatio(e){return e}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}setRadius(e){this.radius!==e&&(this.radius=e,this.render())}getRadius2(){return this.radius2_}setRadius2(e){this.radius2_!==e&&(this.radius2_=e,this.render())}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e,this.render()}listenImageChange(e){}load(){}unlistenImageChange(e){}calculateLineJoinSize_(e,t,n){if(t===0||this.points_===1/0||e!==`bevel`&&e!==`miter`)return t;let r=this.radius,i=this.radius2_===void 0?r:this.radius2_;if(r<i){let e=r;r=i,i=e}let a=this.radius2_===void 0?this.points_:this.points_*2,o=2*Math.PI/a,s=i*Math.sin(o),c=Math.sqrt(i*i-s*s),l=r-c,u=Math.sqrt(s*s+l*l),d=u/s;if(e===`miter`&&d<=n)return d*t;let f=t/2/d,p=t/2*(l/u),m=Math.sqrt((r+f)*(r+f)+p*p)-r;if(this.radius2_===void 0||e===`bevel`)return m*2;let h=r*Math.sin(o),g=Math.sqrt(r*r-h*h),_=i-g,v=Math.sqrt(h*h+_*_)/h;if(v<=n){let e=v*t/2-i-r;return 2*Math.max(m,e)}return m*2}createRenderOptions(){let e=$f,t=tp,n=0,r=null,i=0,a,o=0;if(this.stroke_){var s,c,l,u,d,f;a=Yf((s=this.stroke_.getColor())==null?np:s),o=(c=this.stroke_.getWidth())==null?1:c,r=this.stroke_.getLineDash(),i=(l=this.stroke_.getLineDashOffset())==null?0:l,t=(u=this.stroke_.getLineJoin())==null?tp:u,e=(d=this.stroke_.getLineCap())==null?$f:d,n=(f=this.stroke_.getMiterLimit())==null?10:f}let p=this.calculateLineJoinSize_(t,o,n),m=Math.max(this.radius,this.radius2_||0),h=Math.ceil(2*m+p);return{strokeStyle:a,strokeWidth:o,size:h,lineCap:e,lineDash:r,lineDashOffset:i,lineJoin:t,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let e=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[e,e]}draw_(e,t,n){if(t.scale(n,n),t.translate(e.size/2,e.size/2),this.createPath_(t),this.fill_){let e=this.fill_.getColor();e===null&&(e=Qf),t.fillStyle=Yf(e),t.fill()}e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineCap=e.lineCap,t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}createHitDetectionCanvas_(e){let t;if(this.fill_){let n=this.fill_.getColor(),r=0;typeof n==`string`&&(n=zd(n)),n===null?r=1:Array.isArray(n)&&(r=n.length===4?n[3]:1),r===0&&(t=U(e.size,e.size),this.drawHitDetectionCanvas_(e,t))}return t?t.canvas:this.getImage(1)}createPath_(e){let t=this.points_,n=this.radius;if(t===1/0)e.arc(0,0,n,0,2*Math.PI);else{let r=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(t*=2);let i=this.angle_-Math.PI/2,a=2*Math.PI/t;for(let o=0;o<t;o++){let t=i+o*a,s=o%2==0?n:r;e.lineTo(s*Math.cos(t),s*Math.sin(t))}e.closePath()}}drawHitDetectionCanvas_(e,t){t.translate(e.size/2,e.size/2),this.createPath_(t),t.fillStyle=Qf,t.fill(),e.strokeStyle&&(t.strokeStyle=e.strokeStyle,t.lineWidth=e.strokeWidth,e.lineDash&&(t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset),t.lineJoin=e.lineJoin,t.miterLimit=e.miterLimit,t.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}},Sp=class e extends xp{constructor(e){e=e||{radius:5},super({points:1/0,fill:e.fill,radius:e.radius,stroke:e.stroke,scale:e.scale===void 0?1:e.scale,rotation:e.rotation===void 0?0:e.rotation,rotateWithView:e.rotateWithView!==void 0&&e.rotateWithView,displacement:e.displacement===void 0?[0,0]:e.displacement,declutterMode:e.declutterMode})}clone(){let t=this.getScale(),n=new e({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.get
4Stroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return n.setOpacity(this.getOpacity()),n}},Cp=class e{constructor(e){e=e||{},this.patternImage_=null,this.color_=null,e.color!==void 0&&this.setColor(e.color)}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(e){if(typeof e==`object`&&e&&`src`in e){let t=Jf(null,e.src,{crossOrigin:`anonymous`},void 0,e.offset?null:e.color?e.color:null,!(e.offset&&e.size));t.ready().then(()=>{this.patternImage_=null}),t.getImageState()===Q.IDLE&&t.load(),t.getImageState()===Q.LOADING&&(this.patternImage_=t)}this.color_=e}getKey(){let e=this.getColor();return e?e instanceof CanvasPattern||e instanceof CanvasGradient?F(e):typeof e==`object`&&`src`in e?e.src+`:`+e.offset:zd(e).toString():``}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}};function wp(e,t,n,r){return n!==void 0&&r!==void 0?[n/e,r/t]:n===void 0?r===void 0?1:r/t:n/e}var Tp=class e extends bp{constructor(e){e=e||{};let t=e.opacity===void 0?1:e.opacity,n=e.rotation===void 0?0:e.rotation,r=e.scale===void 0?1:e.scale,i=e.rotateWithView!==void 0&&e.rotateWithView;super({opacity:t,rotation:n,scale:r,displacement:e.displacement===void 0?[0,0]:e.displacement,rotateWithView:i,declutterMode:e.declutterMode}),this.anchor_=e.anchor===void 0?[.5,.5]:e.anchor,this.normalizedAnchor_=null,this.anchorOrigin_=e.anchorOrigin===void 0?`top-left`:e.anchorOrigin,this.anchorXUnits_=e.anchorXUnits===void 0?`fraction`:e.anchorXUnits,this.anchorYUnits_=e.anchorYUnits===void 0?`fraction`:e.anchorYUnits,this.crossOrigin_=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy_=e.referrerPolicy;let a=e.img===void 0?null:e.img,o=e.src;R(!(o!==void 0&&a),"`image` and `src` cannot be provided at the same time"),(o===void 0||o.length===0)&&a&&(o=a.src||F(a)),R(o!==void 0&&o.length>0,"A defined and non-empty `src` or `image` must be provided"),R(e.width===void 0&&e.height===void 0||e.scale===void 0,"`width` or `height` cannot be provided together with `scale`");let s;if(e.src===void 0?a!==void 0&&(s=`complete`in a?a.complete?a.src?Q.LOADED:Q.IDLE:Q.LOADING:Q.LOADED):s=Q.IDLE,this.color_=e.color===void 0?null:zd(e.color),this.iconImage_=Jf(a,o,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},s,this.color_),this.offset_=e.offset===void 0?[0,0]:e.offset,this.offsetOrigin_=e.offsetOrigin===void 0?`top-left`:e.offsetOrigin,this.origin_=null,this.size_=e.size===void 0?null:e.size,this.initialOptions_,e.width!==void 0||e.height!==void 0){let t,n;if(e.size)[t,n]=e.size;else{let r=this.getImage(1);if(r.width&&r.height)t=r.width,n=r.height;else if(r instanceof HTMLImageElement){this.initialOptions_=e;let t=()=>{if(this.unlistenImageChange(t),!this.initialOptions_)return;let n=this.iconImage_.getSize();this.setScale(wp(n[0],n[1],e.width,e.height))};this.listenImageChange(t);return}}t!==void 0&&this.setScale(wp(t,n,e.width,e.height))}}clone(){let t,n,r;return this.initialOptions_?(n=this.initialOptions_.width,r=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new e({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:n,height:r,size:this.size_===null?void 0:this.size_.slice(),src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let e=this.normalizedAnchor_;if(!e){e=this.anchor_;let t=this.getSize();if(this.anchorXUnits_==`fraction`||this.anchorYUnits_==`fraction`){if(!t)return null;e=this.anchor_.slice(),this.anchorXUnits_==`fraction`&&(e[0]*=t[0]),this.anchorYUnits_==`fraction`&&(e[1]*=t[1])}if(this.anchorOrigin_!=`top-left`){if(!t)return null;e===this.anchor_&&(e=this.anchor_.slice()),(this.anchorOrigin_==`top-right`||this.anchorOrigin_==`bottom-right`)&&(e[0]=-e[0]+t[0]),(this.anchorOrigin_==`bottom-left`||this.anchorOrigin_==`bottom-right`)&&(e[1]=-e[1]+t[1])}this.normalizedAnchor_=e}let t=this.getDisplacement(),n=this.getScaleArray();return[e[0]-t[0]/n[0],e[1]+t[1]/n[1]]}setAnchor(e){this.anchor_=e,this.normalizedAnchor_=null}getColor(){return this.color_}setColor(e){let t=e?zd(e):null;if(this.color_===t||this.color_&&t&&this.color_.length===t.length&&this.color_.every((e,n)=>e===t[n]))return;this.color_=t;let n=this.getSrc(),r=n===void 0?this.getHitDetectionImage():null,i=n===void 0?this.iconImage_.getImageState():Q.IDLE;this.iconImage_=Jf(r,n,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},i,this.color_)}getImage(e){return this.iconImage_.getImage(e)}getPixelRatio(e){return this.iconImage_.getPixelRatio(e)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let e=this.offset_;if(this.offsetOrigin_!=`top-left`){let t=this.getSize(),n=this.iconImage_.getSize();if(!t||!n)return null;e=e.slice(),(this.offsetOrigin_==`top-right`||this.offsetOrigin_==`bottom-right`)&&(e[0]=n[0]-t[0]-e[0]),(this.offsetOrigin_==`bottom-left`||this.offsetOrigin_==`bottom-right`)&&(e[1]=n[1]-t[1]-e[1])}return this.origin_=e,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(e){this.iconImage_=Jf(null,e,{crossOrigin:this.crossOrigin_,referrerPolicy:this.referrerPolicy_},Q.IDLE,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){let e=this.getScaleArray();if(this.size_)return this.size_[0]*e[0];if(this.iconImage_.getImageState()==Q.LOADED)return this.iconImage_.getSize()[0]*e[0]}getHeight(){let e=this.getScaleArray();if(this.size_)return this.size_[1]*e[1];if(this.iconImage_.getImageState()==Q.LOADED)return this.iconImage_.getSize()[1]*e[1]}setScale(e){delete this.initialOptions_,super.setScale(e)}listenImageChange(e){this.iconImage_.addEventListener(N.CHANGE,e)}load(){this.iconImage_.load()}unlistenImageChange(e){this.iconImage_.removeEventListener(N.CHANGE,e)}ready(){return this.iconImage_.ready()}},Ep=class e{constructor(e){e=e||{},this.color_=e.color===void 0?null:e.color,this.lineCap_=e.lineCap,this.lineDash_=e.lineDash===void 0?null:e.lineDash,this.lineDashOffset_=e.lineDashOffset,this.lineJoin_=e.lineJoin,this.miterLimit_=e.miterLimit,this.offset_=e.offset,this.width_=e.width}clone(){let t=this.getColor();return new e({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),offset:this.getOffset(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getOffset(){return this.offset_}getWidth(){return this.width_}setColor(e){this.color_=e}setLineCap(e){this.lineCap_=e}setLineDash(e){this.lineDash_=e}setLineDashOffset(e){this.lineDashOffset_=e}setLineJoin(e){this.lineJoin_=e}setMiterLimit(e){this.miterLimit_=e}setOffset(e){this.offset_=e}setWidth(e){this.width_=e}},Dp=class e{constructor(e){e=e||{},this.geometry_=null,this.geometryFunction_=jp,e.geometry!==void 0&&this.setGeometry(e.geometry),this.fill_=e.fill===void 0?null:e.fill,this.image_=e.image===void 0?null:e.image,this.renderer_=e.renderer===void 0?null:e.renderer,this.hitDetectionRenderer_=e.hitDetectionRenderer===void 0?null:e.hitDetectionRenderer,this.stroke_=e.stroke===void 0?null:e.stroke,this.text_=e.text===void 0?null:e.text,this.zIndex_=e.zIndex}clone(){var t,n;let r=this.getGeometry();return r&&typeof r==`object`&&(r=r.clone()),new e({geometry:(t=r)==null?void 0:t,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:(n=this.getRenderer())==null?void 0:n,stroke:this.getStroke()?this.get
4Stroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(e){this.renderer_=e}setHitDetectionRenderer(e){this.hitDetectionRenderer_=e}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(e){this.fill_=e}getImage(){return this.image_}setImage(e){this.image_=e}getStroke(){return this.stroke_}setStroke(e){this.stroke_=e}getText(){return this.text_}setText(e){this.text_=e}getZIndex(){return this.zIndex_}setGeometry(e){typeof e==`function`?this.geometryFunction_=e:typeof e==`string`?this.geometryFunction_=function(t){return t.get(e)}:e?e!==void 0&&(this.geometryFunction_=function(){return e}):this.geometryFunction_=jp,this.geometry_=e}setZIndex(e){this.zIndex_=e}};function Op(e){let t;if(typeof e==`function`)t=e;else{let n;Array.isArray(e)?n=e:(R(typeof e.getZIndex==`function`,"Expected an `Style` or an array of `Style`"),n=[e]),t=function(){return n}}return t}var kp=null;function Ap(e,t){if(!kp){let e=new Cp({color:`rgba(255,255,255,0.4)`}),t=new Ep({color:`#3399CC`,width:1.25});
4kp=[new Dp({image:new Sp({fill:e,stroke:t,radius:5}),fill:e,stroke:t})]}return kp}function jp(e){return e.getGeometry()}var Mp=`#333`,Np=class e{constructor(e){e=e||{},this.font_=e.font,this.rotation_=e.rotation,this.rotateWithView_=e.rotateWithView,this.keepUpright_=e.keepUpright,this.scale_=e.scale,this.scaleArray_=Ud(e.scale===void 0?1:e.scale),this.text_=e.text,this.textAlign_=e.textAlign,this.justify_=e.justify,this.repeat_=e.repeat,this.textBaseline_=e.textBaseline,this.fill_=e.fill===void 0?new Cp({color:Mp}):e.fill,this.maxAngle_=e.maxAngle===void 0?Math.PI/4:e.maxAngle,this.placement_=e.placement===void 0?`point`:e.placement,this.overflow_=!!e.overflow,this.stroke_=e.stroke===void 0?null:e.stroke,this.offsetX_=e.offsetX===void 0?0:e.offsetX,this.offsetY_=e.offsetY===void 0?0:e.offsetY,this.backgroundFill_=e.backgroundFill?e.backgroundFill:null,this.backgroundStroke_=e.backgroundStroke?e.backgroundStroke:null,this.padding_=e.padding===void 0?null:e.padding,this.declutterMode_=e.declutterMode}clone(){let t=this.getScale();return new e({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof Cp?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(e){this.overflow_=e}setFont(e){this.font_=e}setMaxAngle(e){this.maxAngle_=e}setOffsetX(e){this.offsetX_=e}setOffsetY(e){this.offsetY_=e}setPlacement(e){this.placement_=e}setRepeat(e){this.repeat_=e}setRotateWithView(e){this.rotateWithView_=e}setKeepUpright(e){this.keepUpright_=e}setFill(e){this.fill_=e}setRotation(e){this.rotation_=e}setScale(e){this.scale_=e,this.scaleArray_=Ud(e===void 0?1:e)}setStroke(e){this.stroke_=e}setText(e){this.text_=e}setTextAlign(e){this.textAlign_=e}setJustify(e){this.justify_=e}setTextBaseline(e){this.textBaseline_=e}setBackgroundFill(e){this.backgroundFill_=e}setBackgroundStroke(e){this.backgroundStroke_=e}setPadding(e){this.padding_=e}};function Pp(e){return!0}function Fp(e,t){var n;t=(n=t)==null?of():n;let r=Rp(e,t),i=Ef();return function(e,n){if(i.properties=e.getPropertiesInternal(),i.resolution=n,t.featureId){let t=e.getId();t===void 0?i.featureId=null:i.featureId=t}return t.geometryType&&(i.geometryType=Tf(e.getGeometry())),r(i)}}function Ip(e,t){var n;t=(n=t)==null?of():n;let r=e.length,i=Array(r);for(let n=0;n<r;++n)i[n]=zp(e[n],t);let a=Ef(),o=Array(r);return function(e,n){if(a.properties=e.getPropertiesInternal(),a.resolution=n,t.featureId){let t=e.getId();t===void 0?a.featureId=null:a.featureId=t}t.geometryType&&(a.geometryType=Tf(e.getGeometry()));let s=0;for(let e=0;e<r;++e){let t=i[e](a);t&&(o[s]=t,s+=1)}return o.length=s,o}}function Lp(e,t){var n;
4if(t=(n=t)==null?of():n,!Array.isArray(e))return Ip([e],t);let r=e.length;if(`style`in e[0]){let n=Array(r);for(let t=0;t<r;++t){let r=e[t];if(!(`style`in r))throw Error(`Expected a list of rules with a style property`);n[t]=r}return Fp(n,t)}return Ip(e,t)}function Rp(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i){let n=e[i],a=`filter`in n?Df(n.filter,Gd,t):Pp,o;if(Array.isArray(n.style)){let e=n.style.length;o=Array(e);for(let r=0;r<e;++r)o[r]=zp(n.style[r],t)}else o=[zp(n.style,t)];r[i]={filter:a,styles:o}}return function(t){let i=[],a=!1;for(let o=0;o<n;++o){let n=r[o].filter;if(n(t)&&!(e[o].else&&a)){a=!0;for(let e of r[o].styles){let n=e(t);n&&i.push(n)}}}return i}}function zp(e,t){let n=Bp(e,``,t),r=Vp(e,``,t),i=Hp(e,t),a=Up(e,t),o=Jp(e,`z-index`,t);if(!n&&!r&&!i&&!a&&!Wi(e))throw Error(`No fill, stroke, point, or text symbolizer properties in style: `+JSON.stringify(e));let s=new Dp;return function(e){let t=!0;if(n){let r=n(e);r&&(t=!1),s.setFill(r)}if(r){let n=r(e);n&&(t=!1),s.setStroke(n)}if(i){let n=i(e);n&&(t=!1),s.setText(n)}if(a){let n=a(e);n&&(t=!1),s.setImage(n)}return o&&s.setZIndex(o(e)),t?null:s}}function Bp(e,t,n){let r;if(t+`fill-pattern-src`in e)r=Xp(e,t+`fill-`,n);else{if(e[t+`fill-color`]===`none`)return e=>null;r=Qp(e,t+`fill-color`,n)}if(!r)return null;let i=new Cp;return function(e){let t=r(e);return t===_d?null:(i.setColor(t),i)}}function Vp(e,t,n){let r=Jp(e,t+`stroke-width`,n),i=Qp(e,t+`stroke-color`,n);if(!r&&!i)return null;let a=Yp(e,t+`stroke-line-cap`,n),o=Yp(e,t+`stroke-line-join`,n),s=$p(e,t+`stroke-line-dash`,n),c=Jp(e,t+`stroke-line-dash-offset`,n),l=Jp(e,t+`stroke-miter-limit`,n),u=Jp(e,t+`stroke-offset`,n),d=new Ep;return function(e){if(i){let t=i(e);if(t===_d)return null;d.setColor(t)}if(r&&d.setWidth(r(e)),a){let t=a(e);if(t!==`butt`&&t!==`round`&&t!==`square`)throw Error(`Expected butt, round, or square line cap`);d.setLineCap(t)}if(o){let t=o(e);if(t!==`bevel`&&t!==`round`&&t!==`miter`)throw Error(`Expected bevel, round, or miter line join`);d.setLineJoin(t)}return s&&d.setLineDash(s(e)),c&&d.setLineDashOffset(c(e)),l&&d.setMiterLimit(l(e)),u&&d.setOffset(u(e)),d}}function Hp(e,t){let n=`text-`,r=Yp(e,`text-value`,t);if(!r)return null;let i=Bp(e,n,t),a=Bp(e,`text-background-`,t),o=Vp(e,n,t),s=Vp(e,`text-background-`,t),c=Yp(e,`text-font`,t),l=Jp(e,`text-max-angle`,t),u=Jp(e,`text-offset-x`,t),d=Jp(e,`text-offset-y`,t),f=Zp(e,`text-overflow`,t),p=Yp(e,`text-placement`,t),m=Jp(e,`text-repeat`,t),h=nm(e,`text-scale`,t),g=Zp(e,`text-rotate-with-view`,t),_=Jp(e,`text-rotation`,t),v=Yp(e,`text-align`,t),y=Yp(e,`text-justify`,t),b=Yp(e,`text-baseline`,t),x=Zp(e,`text-keep-upright`,t),S=$p(e,`text-padding`,t),C=new Np({declutterMode:lm(e,`text-declutter-mode`)});return function(e){if(C.setText(r(e)),i&&C.setFill(i(e)),a&&C.setBackgroundFill(a(e)),o&&C.setStroke(o(e)),s&&C.setBackgroundStroke(s(e)),c&&C.setFont(c(e)),l&&C.setMaxAngle(l(e)),u&&C.setOffsetX(u(e)),d&&C.setOffsetY(d(e)),f&&C.setOverflow(f(e)),p){let t=p(e);if(t!==`point`&&t!==`line`)throw Error(`Expected point or line for text-placement`);C.setPlacement(t)}if(m&&C.setRepeat(m(e)),h&&C.setScale(h(e)),g&&C.setRotateWithView(g(e)),_&&C.setRotation(_(e)),v){let t=v(e);if(t!==`left`&&t!==`center`&&t!==`right`&&t!==`end`&&t!==`start`)throw Error(`Expected left, right, center, start, or end for text-align`);C.setTextAlign(t)}if(y){let t=y(e);if(t!==`left`&&t!==`right`&&t!==`center`)throw Error(`Expected left, right, or center for text-justify`);C.setJustify(t)}if(b){let t=b(e);if(t!==`bottom`&&t!==`top`&&t!==`middle`&&t!==`alphabetic`&&t!==`hanging`)throw Error(`Expected bottom, top, middle, alphabetic, or hanging for text-baseline`);C.setTextBaseline(t)}return S&&C.setPadding(S(e)),x&&C.setKeepUpright(x(e)),C}}function Up(e,t){return`icon-src`in e?Wp(e,t):`shape-points`in e?Gp(e,t):`circle-radius`in e?Kp(e,t):null}function Wp(e,t){let n=`icon-src`,r=dm(e[n],n),i=em(e,`icon-anchor`,t),a=nm(e,`icon-scale`,t),o=Jp(e,`icon-opacity`,t),s=em(e,`icon-displacement`,t),c=Jp(e,`icon-rotation`,t),l=Zp(e,`icon-rotate-with-view`,t),u=om(e,`icon-anchor-origin`),d=sm(e,`icon-anchor-x-units`),f=sm(e,`icon-anchor-y-units`),p=qp(e,`icon-color`),m,h=null;p!==void 0&&(Array.isArray(p)&&p.length>0&&typeof p[0]==`string`?h=Qp(e,`icon-color`,t):m=pm(p,`icon-color`));let g=am(e,`icon-cross-origin`),_=cm(e,`icon-offset`),v=om(e,`icon-offset-
4origin`),y=rm(e,`icon-width`),b={src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,crossOrigin:g,offset:_,offsetOrigin:v,height:rm(e,`icon-height`),width:y,size:im(e,`icon-size`),declutterMode:lm(e,`icon-declutter-mode`)},x=null;return function(e){if(x)h&&x.setColor(h(e));else{let t=h?h(e):m;x=new Tp(t===void 0?Object.assign({},b):Object.assign({},b,{color:t}))}return o&&x.setOpacity(o(e)),s&&x.setDisplacement(s(e)),c&&x.setRotation(c(e)),l&&x.setRotateWithView(l(e)),a&&x.setScale(a(e)),i&&x.setAnchor(i(e)),x}}function Gp(e,t){let n=`shape-`,r=`shape-points`,i=`shape-radius`,a=fm(e[r],r);if(!(i in e))throw Error(`Expected a number for ${i}`);let o=Jp(e,i,t),s=typeof e[i]==`number`?e[i]:5,c=`shape-radius2`,l=Jp(e,c,t),u=typeof e[c]==`number`?e[c]:void 0,d=Bp(e,n,t),f=Vp(e,n,t),p=nm(e,`shape-scale`,t),m=em(e,`shape-displacement`,t),h=Jp(e,`shape-rotation`,t),g=Zp(e,`shape-rotate-with-view`,t),_=new xp({points:a,radius:s,radius2:u,angle:rm(e,`shape-angle`),declutterMode:lm(e,`shape-declutter-mode`)});return function(e){return o&&_.setRadius(o(e)),l&&_.setRadius2(l(e)),d&&_.setFill(d(e)),f&&_.setStroke(f(e)),m&&_.setDisplacement(m(e)),h&&_.setRotation(h(e)),g&&_.setRotateWithView(g(e)),p&&_.setScale(p(e)),_}}function Kp(e,t){let n=`circle-`,r=Bp(e,n,t),i=Vp(e,n,t),a=Jp(e,`circle-radius`,t),o=nm(e,`circle-scale`,t),s=em(e,`circle-displacement`,t),c=Jp(e,`circle-rotation`,t),l=Zp(e,`circle-rotate-with-view`,t),u=new Sp({radius:5,declutterMode:lm(e,`circle-declutter-mode`)});return function(e){return a&&u.setRadius(a(e)),r&&u.setFill(r(e)),i&&u.setStroke(i(e)),s&&u.setDisplacement(s(e)),c&&u.setRotation(c(e)),l&&u.setRotateWithView(l(e)),o&&u.setScale(o(e)),u}}function qp(e,t){if(!(t in e))return;let n=e[t];return n===void 0?void 0:n}function Jp(e,t,n){let r=qp(e,t);if(r===void 0)return;let i=Df(r,G,n);return function(e){return fm(i(e),t)}}function Yp(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,Kd,n);return function(e){return dm(i(e),t)}}function Xp(e,t,n){let r=Yp(e,t+`pattern-src`,n),i=tm(e,t+`pattern-offset`,n),a=tm(e,t+`pattern-size`,n),o=Qp(e,t+`color`,n);return function(e){return{src:r(e),offset:i&&i(e),size:a&&a(e),color:o&&o(e)}}}function Zp(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,Gd,n);return function(e){let n=i(e);if(typeof n!=`boolean`)throw Error(`Expected a boolean for ${t}`);return n}}function Qp(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,qd,n);return function(e){return pm(i(e),t)}}function $p(e,t,n){let r=qp(e,t);if(r===void 0)return null;if(Array.isArray(r)&&(r.length===0||typeof r[0]!=`string`)){let e=r.map((e,r)=>{if(typeof e==`number`)return()=>e;let i=Df(e,G,n);return function(e){return fm(i(e),`${t}[${r}]`)}});return function(t){let n=Array(e.length);for(let r=0;r<e.length;++r)n[r]=e[r](t);return n}}let i=Df(r,Jd,n);return function(e){return um(i(e),t)}}function em(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,Jd,n);return function(e){let n=um(i(e),t);if(n.length!==2)throw Error(`Expected two numbers for ${t}`);return n}}function tm(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,Jd,n);return function(e){return mm(i(e),t)}}function nm(e,t,n){let r=qp(e,t);if(r===void 0)return null;let i=Df(r,Jd|G,n);return function(e){return hm(i(e),t)}}function rm(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`number`)throw Error(`Expected a number for ${t}`);return n}}function im(e,t){let n=e[t];if(n!==void 0){if(typeof n==`number`)return Ud(n);if(!Array.isArray(n)||n.length!==2||typeof n[0]!=`number`||typeof n[1]!=`number`)throw Error(`Expected a number or size array for ${t}`);return n}}function am(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);return n}}function om(e,t){let n=e[t];if(n!==void 0){if(n!==`bottom-left`&&n!==`bottom-right`&&n!==`top-left`&&n!==`top-right`)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return n}}function sm(e,t){let n=e[t];if(n!==void 0){if(n!==`pixels`&&n!==`fraction`)throw Error(`Expected pixels or fraction for ${t}`);return n}}function cm(e,t){let n=e[t];if(n!==void 0)return um(n,t)}function lm(e,t){let n=e[t];if(n!==void 0){if(typeof n!=`string`)throw Error(`Expected a string for ${t}`);if(n!==`declutter`&&n!==`obstacle`&&n!==`none`)throw Error(`Expected declutter, obstacle, or none for ${t}`);return n}}function um(e,t){if(!Array.isArray(e))throw Error(`Expected an array for ${t}`);let n=e.length;for(let r=0;r<n;++r)if(typeof e[r]!=`number`)throw Error(`Expected an array of numbers for ${t}`);return e}function dm(e,t){if(typeof e!=`string`)throw Error(`Expected a string for ${t}`);return e}function fm(e,t){if(typeof e!=`number`)throw Error(`Expected a number for ${t}`);return e}function pm(e,t){if(typeof e==`string`)return e;let n=um(e,t),r=n.length;if(r<3||r>4)throw Error(`Expected a color with 3 or 4 values for ${t}`);return n}function mm(e,t){let n=um(e,t);if(n.length!==2)throw Error(`Expected an array of two numbers for ${t}`);return n}function hm(e,t){return typeof e==`number`?e:mm(e,t)}var gm={RENDER_ORDER:`renderOrder`},_m=class extends Zu{constructor(e){e=e||{};let t=Object.assign({},e);delete t.style,delete t.renderBuffer,delete t.updateWhileAnimating,delete t.updateWhileInteracting,super(t),this.declutter_=e.declutter?String(e.declutter):void 0,this.renderBuffer_=e.renderBuffer===void 0?100:e.renderBuffer,this.style_=null,this.styleFunction_=void 0,this.setStyle(e.style),this.updateWhileAnimating_=e.updateWhileAnimating!==void 0&&e.updateWhileAnimating,this.updateWhileInteracting_=e.updateWhileInteracting!==void 0&&e.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(e){return super.getFeatures(e)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(gm.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(e,t){let n=this.getDeclutter();n in e.declutter||(e.declutter[n]=new nd(9)),this.getRenderer().renderDeclutter(e,t)}setRenderOrder(e){this.set(gm.RENDER_ORDER,e)}setStyle(e){this.style_=e===void 0?Ap:e;let t=vm(e);this.styleFunction_=e===null?void 0:Op(t),this.changed()}setDeclutter(e){this.declutter_=e?String(e):void 0,this.changed()}};function vm(e){if(e===void 0)return Ap;if(!e)return null;if(typeof e==`function`||e instanceof Dp)return e;if(Array.isArray(e)&&e.length===0)return[];if(Array.isArray(e)&&e[0]instanceof Dp){let t=e.length,n=Array(t);for(let r=0;r<t;++r){let t=e[r];if(!(t instanceof Dp))throw Error(`Expected a list of style instances`);n[r]=t}return n}return Lp(e)}var ym=class extends oa{constructor(e,t,n,r){super(e),this.inversePixelTransform=t,this.frameState=n,this.context=r}},bm=class extends Ki{constructor(e){super(),this.map_=e}dispatchRenderEvent(e,t){P()}calculateMatrices2D(e){let t=e.viewState,n=e.coordinateToPixelTransform,r=e.pixelToCoordinateTransform;wc(n,e.size[0]/2,e.size[1]/2,1/t.resolution,-1/t.resolution,-t.rotation,-t.center[0],-t.center[1]),Tc(r,n)}forEachFeatureAtCoordinate(e,t,n,r,i,a,o,s){let c,l=t.viewState;function u(e,t,n,r){return i.call(a,t,e?n:null,r)}let d=l.projection,f=Lo(e.slice(),d),p=[[0,0]];if(d.canWrapX()&&r){let e=V(d.getExtent());p.push([-e,0],[e,0])}let m=t.layerStatesArray,h=m.length,g=[],_=[];for(let r=0;r<p.length;r++)for(let i=h-1;i>=0;--i){let a=m[i],d=a.layer;if(d.hasRenderer()&&Qu(a,l)&&o.call(s,d)){let i=d.getRenderer(),o=d.getSource();if(i&&o){let s=o.getWrapX()?f:e,l=u.bind(null,a.managed);_[0]=s[0]+p[r][0],_[1]=s[1]+p[r][1],c=i.forEachFeatureAtCoordinate(_,t,n,l,g)}if(c)return c}}if(g.length===0)return;let v=1/g.length;return g.forEach((e,t)=>e.distanceSq+=t*v),g.sort((e,t)=>
4e.distanceSq-t.distanceSq),g.some(e=>c=e.callback(e.feature,e.layer,e.geometry)),c}hasFeatureAtCoordinate(e,t,n,r,i,a){return this.forEachFeatureAtCoordinate(e,t,n,r,ta,this,i,a)!==void 0}getMap(){return this.map_}renderFrame(e){P()}scheduleExpireIconCache(e){Gf.canExpireCache()&&e.postRenderFunctions.push(xm)}};function xm(e,t){Gf.expire()}var Sm=class extends bm{constructor(e){super(e),this.fontChangeListenerKey_=j(op,Hi.PROPERTYCHANGE,e.redrawText,e),this.element_=Sa?tu():document.createElement(`div`);let t=this.element_.style;t.position=`absolute`,t.width=`100%`,t.height=`100%`,t.zIndex=`0`,this.element_.className=Hl+` ol-layers`;let n=e.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(e,t){let n=this.getMap();if(n.hasListener(e)){let r=new ym(e,void 0,t);n.dispatchEvent(r)}}disposeInternal(){M(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(e){if(!e){this.renderedVisible_&&(this.element_.style.display=`none`,this.renderedVisible_=!1);return}this.calculateMatrices2D(e),this.dispatchRenderEvent(Xu.PRECOMPOSE,e);let t=e.layerStatesArray.sort((e,t)=>e.zIndex-t.zIndex);t.some(e=>e.layer instanceof _m&&e.layer.getDeclutter())&&(e.declutter={});let n=e.viewState;this.children_.length=0;let r=this.getMap().getTargetElement(),i;nu(r)&&(i=r.getContext(`2d`),i.setTransform(1,0,0,1,0,0),i.clearRect(0,0,r.width,r.height));let a=[],o=i?r:null;for(let r=0,i=t.length;r<i;++r){let i=t[r];e.layerIndex=r;let s=i.layer,c=s.getSourceState();if(!Qu(i,n)||c!=`ready`&&c!=`undefined`){s.unrender();continue}let l=s.render(e,o);l&&(l!==o&&(this.children_.push(l),o=l),a.push(i))}this.declutter(e,a),eu(this.element_,this.children_);for(let e of i?this.children_:[]){let t=e.firstElementChild||e,n=e.style.backgroundColor;if(n&&(!nu(t)||t.width>0)&&(i.fillStyle=n,i.fillRect(0,0,i.canvas.width,i.canvas.height)),!nu(t)||t.width===0)continue;i.save();let r=e.style.opacity||t.style.opacity;i.globalAlpha=r===``?1:Number(r);let a=t.style.transform;if(a)i.transform(...kc(a));else{let e=parseFloat(t.style.width)/t.width,n=parseFloat(t.style.height)/t.height;i.transform(e,0,0,n,0,0)}i.drawImage(t,0,0),i.restore()}this.dispatchRenderEvent(Xu.POSTCOMPOSE,e),this.renderedVisible_||(this.element_.style.display=``,this.renderedVisible_=!0),this.scheduleExpireIconCache(e)}declutter(e,t){if(e.declutter){for(let n=t.length-1;n>=0;--n){let r=t[n],i=r.layer;i.getDeclutter()&&i.renderDeclutter(e,r)}t.forEach(t=>t.layer.renderDeferred(e))}}};function Cm(e){if(e instanceof Zu){e.setMapInternal(null);return}e instanceof Yu&&e.getLayers().forEach(Cm)}function wm(e,t){if(e instanceof Zu){e.setMapInternal(t);return}if(e instanceof Yu){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)wm(n[e],t)}}var Tm=class extends fa{constructor(e){super(),e=e||{},this.on,this.once,this.un;let t=Em(e);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=e.maxTilesLoading===void 0?16:e.maxTilesLoading,this.pixelRatio_=e.pixelRatio===void 0?xa:e.pixelRatio,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Sc(),this.pixelToCoordinateTransform_=Sc(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,Sa||(this.viewport_=document.createElement(`div`),this.viewport_.className=`ol-viewport`+(`ontouchstart`in window?` ol-touch`:``),this.viewport_.style.position=`relative`,this.viewport_.style.overflow=`hidden`,this.viewport_.style.width=`100%`,this.viewport_.style.height=`100%`,this.overlayContainer_=document.createElement(`div`),this.overlayContainer_.style.position=`absolute`,this.overlayContainer_.style.zIndex=`0`,this.overlayContainer_.style.width=`100%`,this.overlayContainer_.style.height=`100%`,this.overlayContainer_.style.pointerEvents=`none`,this.overlayContainer_.className=`ol-
4overlaycontainer`,this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement(`div`),this.overlayContainerStopEvent_.style.position=`absolute`,this.overlayContainerStopEvent_.style.zIndex=`0`,this.overlayContainerStopEvent_.style.width=`100%`,this.overlayContainerStopEvent_.style.height=`100%`,this.overlayContainerStopEvent_.style.pointerEvents=`none`,this.overlayContainerStopEvent_.className=`ol-overlaycontainer-stopevent`,this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=e.moveTolerance,this.keyboardEventTarget_=t.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,Sa||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=t.controls||(Sa?new ha:su()),this.interactions=t.interactions||(Sa?new ha:Wu({onFocusOnly:!0})),this.overlays_=t.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new ja(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(Oa.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(Oa.VIEW,this.handleViewChanged_),this.addChangeListener(Oa.SIZE,this.handleSizeChanged_),this.addChangeListener(Oa.TARGET,this.handleTargetChanged_),this.setProperties(t.values);let n=this;e.view&&!(e.view instanceof Pl)&&e.view.then(function(e){n.setVie
4w(new Pl(e))}),this.controls.addEventListener(Vi.ADD,e=>{e.element.setMap(this)}),this.controls.addEventListener(Vi.REMOVE,e=>{e.element.setMap(null)}),this.interactions.addEventListener(Vi.ADD,e=>{e.element.setMap(this)}),this.interactions.addEventListener(Vi.REMOVE,e=>{e.element.setMap(null)}),this.overlays_.addEventListener(Vi.ADD,e=>{this.addOverlayInternal_(e.element)}),this.overlays_.addEventListener(Vi.REMOVE,e=>{let t=e.element.getId();t!==void 0&&delete this.overlayIdIndex_[t.toString()],e.element.setMap(null)}),this.controls.forEach(e=>{e.setMap(this)}),this.interactions.forEach(e=>{e.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(e){this.getControls().push(e)}addInteraction(e){this.getInteractions().push(e)}addLayer(e){this.getLayerGroup().getLayers().push(e)}handleLayerAdd_(e){wm(e.layer,this)}addOverlay(e){this.getOverlays().push(e)}addOverlayInternal_(e){let t=e.getId();t!==void 0&&(this.overlayIdIndex_[t.toString()]=e),e.setMap(this)}disposeInternal(){var e;this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),(e=this.resizeObserver_)==null||e.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(e,t,n){if(!this.frameState_||!this.renderer_)return;let r=this.getCoordinateFromPixelInternal(e);n=n===void 0?{}:n;let i=n.hitTolerance===void 0?0:n.hitTolerance,a=n.layerFilter===void 0?ta:n.layerFilter,o=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(r,this.frameState_,i,o,t,null,a,null)}getFeaturesAtPixel(e,t){let n=[];return this.forEachFeatureAtPixel(e,function(e){n.push(e)},t),n}getAllLayers(){let e=[];function t(n){n.forEach(function(n){n instanceof Yu?t(n.getLayers()):e.push(n)})}return t(this.getLayers()),e}hasFeatureAtPixel(e,t){if(!this.frameState_||!this.renderer_)return!1;let n=this.getCoordinateFromPixelInternal(e);t=t===void 0?{}:t;let r=t.layerFilter===void 0?ta:t.layerFilter,i=t.hitTolerance===void 0?0:t.hitTolerance,a=t.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,i,a,r,null)}getEventCoordinate(e){return this.getCoordinateFromPixel(this.getEventPixel(e))}getEventCoordinateInternal(e){return this.getCoordinateFromPixelInternal(this.getEventPixel(e))}getEventPixel(e){let t=this.viewport_.getBoundingClientRect(),n=this.getSize(),r=t.width/n[0],i=t.height/n[1],a=`changedTouches`in e?e.changedTouches[0]:e;return[(a.clientX-t.left)/r,(a.clientY-t.top)/i]}getTarget(){return this.get(Oa.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(e){return hc(this.getCoordinateFromPixelInternal(e),this.getView().getProjection())}getCoordinateFromPixelInternal(e){let t=this.frameState_;return t?H(t.pixelToCoordinateTransform,e.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(e){let t=this.overlayIdIndex_[e.toString()];return t===void 0?null:t}getInteractions(){return this.interactions}getLayerGroup(){return this.get(Oa.LAYERGROUP)}setLayers(e){let t=this.getLayerGroup();if(e instanceof ha){t.setLayers(e);return}let n=t.getLayers();n.clear(),n.extend(e)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let e=this.getLayerGroup().getLayerStatesArray();for(let t=0,n=e.length;t<n;++t){let n=e[t];if(!n.visible)continue;let r=n.layer.getRenderer();if(r&&!r.ready)return!0;let i=n.layer.getSource();if(i&&i.loading)return!0}return!1}getPixelFromCoordinate(e){let t=gc(e,this.getView().getProjection());return this.getPixelFromCoordinateInternal(t)}getPixelFromCoordinateInternal(e){let t=this.frameState_;return t?H(t.coordinateToPixelTransform,e.slice(0,2)):null}getPixelRatio(){return this.pixelRatio_}setPixelRatio(e){this.pixelRatio_!==e&&(this.pixelRatio_=e,this.render())}getRenderer(){return this.renderer_}getSize(){return this.get(Oa.SIZE)}getView(){return this.get(Oa.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let e=this.getTargetElement();return e?e.ownerDocument:document}getTilePriority(e,t,n,r){return Ma(this.frameState_,e,t,n,r)}handleBrowserEvent(e,t){t=t||e.type;let n=new _a(t,this,e);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(e){if(!this.frameState_)return;let t=e.originalEvent,n=t.type;if(n===Ta.POINTERDOWN||n===N.WHEEL||n===N.KEYDOWN){let e=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():e,r=t.target,i=n instanceof ShadowRoot?n.host===r?n.host.ownerDocument:n:n===e?e.documentElement:n;if(this.overlayContainerStopEvent_.contains(r)||!i.contains(r))return}if(e.frameState=this.frameState_,this.dispatchEvent(e)!==!1){let t=this.getInteractions().getArray().slice();for(let n=t.length-1;n>=0;n--){let r=t[n];if(!(r.getMap()!==this||!r.getActive()||!this.getTargetElement())&&(!r.handleEvent(e)||e.propagationStopped))break}}}handlePostRender(){let e=this.frameState_,t=this.tileQueue_;if(!t.isEmpty()){let n=this.maxTilesLoading_,r=n,i=e?e.viewHints:void 0,a=i?i[Na.ANIMATING]||i[Na.INTERACTING]:!1;if(a){let t=Date.now()-e.time>8;n=t?0:8,r=t?0:2}t.getTilesLoading()<n&&(a&&t.reprioritize(),t.loadMoreTiles(n,r))}e&&this.renderer_&&!e.animate&&(this.renderComplete_?(this.hasListener(Xu.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Xu.RENDERCOMPLETE,e),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new ga(Da.LOADEND,this,e)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new ga(Da.LOADSTART,this,e))));let n=this.postRenderFunctions_;if(e)for(let t=0,r=n.length;t<r;++t)n[t](this,e);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let e=0,t=this.targetChangeHandlerKeys_.length;e<t;++e)M(this.targetChangeHandlerKeys_[e]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(N.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(N.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!nu(this.targetElement_)){var e;(e=this.resizeObserver_)==null||e.unobserve(this.targetElement_);let t=this.targetElement_.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.unobserve(t.host),this.setSize(void 0)}let t=this.getTarget(),n=typeof t==`string`?document.getElementById(t):t;if(this.targetElement_=n,!n)this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);else{if(nu(n)||n.appendChild(this.viewport_),this.renderer_||(this.renderer_=new Sm(this)),!nu(n)){this.mapBrowserEventHandler_=new Ea(this,this.moveTolerance_);for(let e in I)this.mapBrowserEventHandler_.addEventListener(I[e],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(N.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(N.WHEEL,this.boundHandleBrowserEvent_,wa?{passive:!1}:!1);let e;if(this.keyboardEventTarget_)e=this.keyboardEventTarget_;else{let t=n.getRootNode();e=t instanceof ShadowRoot?t.host:n}if(this.targetChangeHandlerKeys_=[j(e,N.KEYDOWN,this.handleBrowserEvent,this),j(e,N.KEYPRESS,this.handleBrowserEvent,this)],!nu(n)){var r;let e=n.getRootNode();e instanceof ShadowRoot&&this.resizeObserver_.observe(e.host),(r=this.resizeObserver_)==null||r.observe(n)}}this.updateSize()}}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(M(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(M(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);let e=this.getView();e&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=j(e,Hi.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=j(e,N.CHANGE,this.handleViewPropertyChanged_,this),e.resolve
4Constraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(M),this.layerGroupPropertyListenerKeys_=null);let e=this.getLayerGroup();e&&(this.handleLayerAdd_(new qu(`addlayer`,e)),this.layerGroupPropertyListenerKeys_=[j(e,Hi.PROPERTYCHANGE,this.render,this),j(e,N.CHANGE,this.render,this),j(e,`addlayer`,this.handleLayerAdd_,this),j(e,`removelayer`,this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;let e=this.frameState_.layerStatesArray;for(let t=0,n=e.length;t<n;++t){let n=e[t].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(e){return this.getControls().remove(e)}removeInteraction(e){return this.getInteractions().remove(e)}removeLayer(e){return this.getLayerGroup().getLayers().remove(e)}handleLayerRemove_(e){Cm(e.layer)}removeOverlay(e){return this.getOverlays().remove(e)}renderFrame_(e){let t=this.getSize(),n=this.getView(),r=this.frameState_,i=null;if(t!==void 0&&Vd(t)&&n&&n.isDef()){let r=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(i={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:yo(a.center,a.resolution,a.rotation,t),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:t,tileQueue:this.tileQueue_,time:e,usedTiles:{},viewState:a,viewHints:r,wantedTiles:{},mapId:F(this),renderTargets:{}},a.nextCenter&&a.nextResolution){let e=isNaN(a.nextRotation)?a.rotation:a.nextRotation;i.nextExtent=yo(a.nextCenter,a.nextResolution,e,t)}}this.frameState_=i,this.renderer_.renderFrame(i),i&&(i.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,i.postRenderFunctions),r&&(!this.previousExtent_||!Do(this.previousExtent_)&&!so(i.extent,this.previousExtent_))&&(this.dispatchEvent(new ga(Da.MOVESTART,this,r)),this.previousExtent_=io(this.previousExtent_)),this.previousExtent_&&!i.viewHints[Na.ANIMATING]&&!i.viewHints[Na.INTERACTING]&&!so(i.extent,this.previousExtent_)&&(this.dispatchEvent(new ga(Da.MOVEEND,this,i)),Xa(i.extent,this.previousExtent_))),this.dispatchEvent(new ga(Da.POSTRENDER,this,i)),this.renderComplete_=(this.hasListener(Da.LOADSTART)||this.hasListener(Da.LOADEND)||this.hasListener(Xu.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(e){let t=this.getLayerGroup();t&&this.handleLayerRemove_(new qu(`removelayer`,t)),this.set(Oa.LAYERGROUP,e)}setSize(e){this.set(Oa.SIZE,e)}setTarget(e){this.set(Oa.TARGET,e)}setView(e){if(!e||e instanceof Pl){this.set(Oa.VIEW,e);return}this.set(Oa.VIEW,new Pl);let t=this;e.then(function(e){t.setView(new Pl(e))})}updateSize(){let e=this.getTargetElement(),t;if(e){let n,r;if(nu(e)){let t=e.getContext(`2d`).getTransform();n=e.width/t.a,r=e.height/t.d}else{let t=getComputedStyle(e);n=e.offsetWidth-parseFloat(t.borderLeftWidth)-parseFloat(t.paddingLeft)-parseFloat(t.paddingRight)-parseFloat(t.borderRightWidth),r=e.offsetHeight-parseFloat(t.borderTopWidth)-parseFloat(t.paddingTop)-parseFloat(t.paddingBottom)-parseFloat(t.borderBottomWidth)}!isNaN(n)&&!isNaN(r)&&(t=[Math.max(0,n),Math.max(0,r)],!Vd(t)&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&qo(`No map visible because the map container's width or height are 0.`))}let n=this.getSize();t&&(!n||!$i(t,n))&&(this.updateViewportSize_(t),this.setSize(t))}updateViewportSize_(e){let t=this.getView();t&&t.setViewportSize(e)}};function Em(e){let t=null;e.keyboardEventTarget!==void 0&&(t=typeof e.keyboardEventTarget==`string`?document.getElementById(e.keyboardEventTarget):e.keyboardEventTarget);let n={},r=e.layers&&typeof e.layers.getLayers==`function`?e.layers:new Yu({layers:e.layers});n[Oa.LAYERGROUP]=r,n[Oa.TARGET]=e.target,n[Oa.VIEW]=e.view instanceof Pl?e.view:new Pl;let i;e.controls!==void 0&&(Array.isArray(e.controls)?i=new ha(e.controls.slice()):(R(typeof e.controls.getArray==`function`,"Expected `controls` to be an array or an `ol/Collection.js`"),i=e.controls));let a;e.interactions!==void 0&&(Array.isArray(e.interactions)?a=new ha(e.interactions.slice()):(R(typeof e.interactions.getArray==`function`,"Expected `interactions` to be an array or an `ol/Collection.js`"),a=e.interactions));let o;return e.overlays===void 0?o=new ha:Array.isArray(e.overlays)?o=new ha(e.overlays.slice()):(R(typeof e.overlays.getArray==`function`,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=e.overlays),{controls:i,interactions:a,keyboardEventTarget:t,overlays:o,values:n}}var Dm=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}
4getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}};function Om(e,t,n,r,i){return i===void 0?new Dm(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}function km(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function Am(e,t,n){return e+`/`+t+`/`+n}function jm(e,t,n,r,i){return`${F(e)},${t},${Am(n,r,i)}`}function Mm(e){return Nm(e[0],e[1],e[2])}function Nm(e,t,n){return(t<<e)+n}function Pm(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return!a||a.containsXY(r,i)}var Fm=[0,0,0],Im=5,Lm=class{constructor(e){let t=e.minZoom,n=e.resolutions;t===void 0&&n&&(t=n.findIndex(e=>e!==void 0)),this.minZoom=t===void 0?0:t,this.resolutions_=n,R(ea(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let r;if(!e.origins){for(let e=0,t=this.resolutions_.length-1;e<t;++e)if(!r)r=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==r){r=void 0;break}}this.zoomFactor_=r,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,R(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let i=e.extent;i!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=wo(i)),R(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,R(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,R(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=i===void 0?null:i,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.tileRanges===void 0?e.sizes===void 0?i&&this.calculateTileRanges_(i):this.fullTileRanges_=e.sizes.map((e,t)=>{let n=new Dm(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(i){let e=this.getTileRangeForExtentAndZ(i,t);n.minX=Math.max(e.minX,n.minX),n.maxX=Math.min(e.maxX,n.maxX),n.minY=Math.max(e.minY,n.minY),n.maxY=Math.min(e.maxY,n.maxY)}return n}):this.fullTileRanges_=e.tileRanges}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Om(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getOrigins(){return this.origins_}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Om(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Om(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Om(o,o,s,s,n):Om(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,Fm);let r=Fm[1],i=Fm[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,Fm);let a=Fm[1],o=Fm[2];return Om(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=Ud(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=Ud(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return ro(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=Ud(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=Wa(l,Im)-1,u=Wa(u,Im)-1):(l=Ua(l,Im),u=Ua(u,Im)),km(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=Ud(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=Wa(c,Im)-1,l=Wa(l,Im)-1):(c=Ua(c,Im),l=Ua(l,Im)),km(n,c,l,i)}
4getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return z(Xi(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return ol(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function Rm(e){let t=e.getDefaultTileGrid();return t||(t=Um(e),e.setDefaultTileGrid(t)),t}function zm(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=Wm(n);if(!Qa(a,i)){let t=V(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function Bm(e,t,n,r){r=r===void 0?`top-left`:r;let i=Hm(e,t,n);return new Lm({extent:e,origin:vo(e,r),resolutions:i,tileSize:n})}function Vm(e){let t=e||{},n=t.extent||tc(`EPSG:3857`).getExtent();return new Lm({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:Hm(n,t.maxZoom,t.tileSize,t.maxResolution)})}function Hm(e,t,n,r){t=t===void 0?42:t,n=Ud(n===void 0?256:n);let i=xo(e),a=V(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function Um(e,t,n,r){return Bm(Wm(e),t,n,r)}function Wm(e){e=tc(e);let t=e.getExtent();if(!t){let n=180*Jo.degrees/e.getMetersPerUnit();t=ro(-n,-n,n,n)}return t}var Gm=class extends sa{constructor(e,t,n){super(),n=n||{},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(N.CHANGE)}release(){this.setState(L.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==L.EMPTY){if(this.state!==L.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){P()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Bo(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}},Km=class extends Gm{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r==null?void 0:r.crossOrigin,this.referrerPolicy_=r==null?void 0:r.referrerPolicy,this.src_=n,this.key=n,this.image_,Sa?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=L.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=L.ERROR,this.unlistenImage_(),this.image_=qm(),this.changed()}handleImageLoad_(){if(Sa)this.state=L.LOADED;else{let e=this.image_;this.state=e.naturalWidth&&e.naturalHeight?L.LOADED:L.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==L.ERROR&&(this.state=L.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==L.IDLE&&(this.state=L.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Bf(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function qm(){let e=U(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Jm,Ym=[];function Xm(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore(
4)}function Zm(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-191.25)>2}function Qm(){if(Jm===void 0){let e=U(6,6,Ym);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,Xm(e,4,5,4,0),Xm(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;Jm=Zm(t,0)||Zm(t,4)||Zm(t,8),Zl(e),Ym.push(e.canvas)}return Jm}function $m(e,t,n,r){let i=fc(n,t,e),a=nc(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||Qa(c,i)){let t=nc(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function eh(e,t,n,r){let i=$m(e,t,_o(n),r);return(!isFinite(i)||i<=0)&&po(n,function(n){return i=$m(e,t,n,r),isFinite(i)&&i>0}),i}function th(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=U(Math.round(n*e),Math.round(n*t),Ym);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=no();c.forEach(function(e,t,n){co(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=U(Math.round(V(g)*v),Math.round(xo(g)*v),Ym),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=V(i)*v,r=xo(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=V(e.clipExtent)*v,i=xo(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=V(e.extent)*v,i=xo(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=wo(o);
4return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),E=o,D=s;o=0,s=0,l-=E,u-=D,f-=E,p-=D;let O=La([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!O)return;if(m.save(),m.beginPath(),Qm()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(O[0],O[2],O[1],O[3],v,x),m.translate(g[0]-E,g[3]-D);let k;if(_)k=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;k=e.image,m.scale(V(t)/k.width,-xo(t)/k.height)}m.drawImage(k,0,0),m.restore()}),_&&(Zl(_),Ym.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}var nh=10,rh=.25,ih=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?oc(e=>H(o,fc(e,this.targetProj_,this.sourceProj_))):dc(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&V(r)>=V(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?V(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?V(this.targetProj_.getExtent()):null;let l=wo(n),u=To(n),d=go(n),f=ho(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=nh+(a?Math.max(0,Math.ceil(Math.log2(mo(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=Ja([i,a,o,s]),u=this.sourceWorldWidth_?V(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=V(Ja([e,t,n,r]))/this.targetWorldWidth_>rh||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>rh||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!Eo(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+ +(!isFinite(s[0])||!isFinite(s[1])),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(Ba(i[0],d)+Ba(o[0],d))/2-Ba(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=no();return this.triangles_.forEach(function(t,n,r){let i=t.source;lo(e,i[0]),lo(e,i[1]),lo(e,i[2])}),e}getTriangles(){return this.triangles_}},ah=.5,oh=class extends Gm{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,L.IDLE,d),this.renderEdges_=u!==void 0&&u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?So(f,p):f;if(mo(h)===0){this.state=L.EMPTY;return}let g=e.getExtent();g&&(m=m?So(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=eh(e,n,h,_);if(!isFinite(v)||v<=0){this.state=L.EMPTY;return}let y=l===void 0?ah:l;if(this.triangulation_=new ih(e,n,h,m,v*y,_),this.triangulation_.getTr
4iangles().length===0){this.state=L.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=z(b[1],m[1],m[3]),b[3]=z(b[3],m[1],m[3])):b=So(b,m)),!mo(b))this.state=L.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=V(g),r=Math.floor((b[0]-g[0])/n)),jo(b.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=r*n;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,e,t,o),offset:i})}++r}),this.sourceTiles_.length===0&&(this.state=L.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==L.LOADED){var r;let i=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);i[0]+=t.offset,i[2]+=t.offset;let a=(r=this.clipExtent_)==null?void 0:r.slice();a&&(a[0]+=t.offset,a[2]+=t.offset),e.push({extent:i,clipExtent:a,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=L.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=th(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=L.LOADED}this.changed()}load(){for(let e of this.sourceTiles_)e.tile=e.getTile();if(this.state==L.IDLE){this.state=L.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n==L.IDLE||n==L.LOADING){e++;let n=j(t,N.CHANGE,r=>{let i=t.getState();(i==L.LOADED||i==L.ERROR||i==L.EMPTY)&&(M(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){e.getState()==L.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(M),this.sourcesListenerKeys_=null}release(){this.canvas_&&(Zl(this.canvas_.getContext(`2d`)),Ym.push(this.canvas_),this.canvas_=null),this.sourceTiles_.length=0,super.release()}},sh=/\{z\}/g,ch=/\{x\}/g,lh=/\{y\}/g,uh=/\{-y\}/g;function dh(e,t,n,r,i){return e.replace(sh,t.toString()).replace(ch,n.toString()).replace(lh,r.toString()).replace(uh,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function fh(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function ph(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return dh(e,o,n[1],n[2],a)})}function mh(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=ph(e[i],t);return hh(r)}function hh(e){return e.length===1?e[0]:(function(t,n,r){return t?e[Ba(Mm(t),e.length)](t,n,r):void 0})}var gh=class extends fa{constructor(e){var t;super(),this.projection=tc(e.projection),this.attributions_=_h(e.attributions),this.attributionsCollapsible_=(t=e.attributionsCollapsible)==null||t,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX!==void 0&&e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let n=this;this.viewPromise_=new Promise(function(e,t){n.viewResolver=e,n.viewRejector=t})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}ready(){let e=this.getState();return e===`ready`?Promise.resolve():e===`error`?Promise.reject(Error(`Source failed to load`)):new Promise((e,t)=>{let n=()=>{let r=this.getState();r===`ready`?(this.un(`change`,n),e()):r===`error`&&(this.un(`change`,n),t(Error(`Source failed to load`)))};this.on(`change`,n)})}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=_h(e),this.changed()}setState(e){this.state_=e,this.changed()}};function _h(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var vh=class extends gh{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio===void 0?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&Ud(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||F(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return P()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:Rm(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=Ud(r.getTileSize(e),this.tmpSize);return i==1?a:Hd(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=zm(r,e,n)),Pm(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},yh=class extends oa{constructor(e,t){super(e),this.tile=t}},bh={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},xh=class e extends vh{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===e.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(e){let t=e.target,n=F(t),r=t.getState(),i;r==L.LOADING?(this.tileLoadingKeys_[n]=!0,i=bh.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==L.ERROR?bh.TILELOADERROR:r==L.LOADED?bh.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new yh(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=fh(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(` 5`);this.generateTileUrlFunction_?this.setTileUrlFunction(mh(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},Sh=class extends xh{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:Ch,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0||e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?Km:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!cc(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();
5if(this.tileGrid&&(!t||cc(t,e)))return this.tileGrid;let n=F(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=Rm(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?L.EMPTY:L.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(N.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||cc(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new oh(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=jm(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a==null||a.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=tc(e);if(n){let e=F(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function Ch(e,t){if(Sa){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{var n;let r=e.getImage();r.width=t.width,r.height=t.height,r.getContext(`2d`).drawImage(t,0,0),(n=t.close)==null||n.call(t),r.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var wh=class extends Sh{constructor(e){e=e||{};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?Vm({extent:Wm(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0||e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}},Th=`© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.`,Eh=class extends wh{constructor(e){e=e||{};let t;t=e.attributions===void 0?[Th]:e.attributions;let n=e.url===void 0?`https://tile.openstreetmap.org/{z}/{x}/{y}.png`:e.url;super({attributions:t,attributionsCollapsible:!1,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin===void 0?`anonymous`:e.crossOrigin,referrerPolicy:e.referrerPolicy||`origin-when-cross-origin`,interpolate:e.interpolate,maxZoom:e.maxZoom===void 0?19:e.maxZoom,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileLoadFunction:e.tileLoadFunction,transition:e.transition,url:n,wrapX:e.wrapX,zDirection:e.zDirection})}};function Dh(e){return e instanceof Image||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof ImageBitmap?e:null}var Oh=Error(`disposed`),kh=[256,256],Ah=class extends Gm{constructor(e){let t=L.IDLE;super(e.tileCoord,t,{transition:e.transition,interpolate:e.interpolate}),this.loader_=e.loader,this.data_=null,this.error_=null,this.size_=e.size||null,this.controller_=e.controller||null}getSize(){if(this.size_)return this.size_;let e=Dh(this.data_);return e?[e.width,e.height]:kh}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==L.IDLE&&this.state!==L.ERROR)return;this.state=L.LOADING,this.changed();let e=this;this.loader_().then(function(t){e.data_=t,e.state=L.LOADED,e.changed()}).catch(function(t){e.error_=t,e.state=L.ERROR,e.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(Oh),this.controller_=null),super.disposeInternal()}},jh=class{constructor(e){this.highWaterMark=e===void 0?2048:e,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let e=this.pop();e instanceof Ki&&e.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(e){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(e){return this.entries_.hasOwnProperty(e)}forEach(e){let t=this.oldest_;for(;t;)e(t.value_,t.key_,this),t=t.newer}get(e,t){let n=this.entries_[e];return R(n!==void 0,`Tried to get a value for a key that does not exist in the cache`),n===this.newest_?n.value_:(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n,n.value_)}remove(e){let t=this.entries_[e];return R(t!==void 0,`Tried to get a value for a key that does not exist in the cache`),t===this.newest_?(this.newest_=t.older,this.newest_&&(this.newest_.newer=null)):t===this.oldest_?(this.oldest_=t.newer,this.oldest_&&(this.oldest_.older=null)):(t.newer.older=t.older,t.older.newer=t.newer),delete this.entries_[e],--this.count_,t.value_}getCount(){return this.count_}getKeys(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.key_;return e}getValues(){let e=Array(this.count_),t=0,n;for(n=this.newest_;n;n=n.older)e[t++]=n.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(e){var t;return(t=this.entries_[e])==null?void 0:t.value_}pop(){let e=this.oldest_;return delete this.entries_[e.key_],e.newer&&(e.newer.older=null),this.oldest_=e.newer,this.oldest_||(this.newest_=null),--this.count_,e.value_}replace(e,t){this.get(e),this.entries_[e].value_=t}set(e,t){R(!(e in this.entries_),`Tried to set a value for a key that is used already`);let n={key_:e,newer:null,older:this.newest_,value_:t};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[e]=n,++this.count_}setSize(e){this.highWaterMark=e}},Mh=class{constructor(){n(this,`pushMethodArgs_`,(...e)=>{this.push_(this.pendingMethod_,e)}
5),this.instructions_=[],this.zIndex=0,this.offset_=0,this.pendingMethod_,this.context_=new Proxy(Xl(),{get:(e,t)=>{if(typeof e[t]==`function`)return this.pendingMethod_=t,this.pushMethodArgs_},set:(e,t,n)=>(this.push_(t,n),!0)})}push_(...e){let t=this.instructions_,n=this.zIndex+this.offset_;t[n]||(t[n]=[]),t[n].push(...e)}pushFunction(e){this.push_(e)}getContext(){return this.context_}draw(e){this.instructions_.forEach(t=>{for(let n=0,r=t.length;n<r;++n){let r=t[n];if(typeof r==`function`){r(e);continue}let i=t[++n];typeof e[r]==`function`?e[r](...i):e[r]=typeof i==`function`?i(e):i}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},Nh=5,Ph=class extends ca{constructor(e){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=e,this.staleKeys_=[],this.maxStaleKeys=Nh,this.renderedSourceKey_}getStaleKeys(){return this.staleKeys_}prependStaleKey(e){this.staleKeys_.unshift(e),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}updateStaleKeys(e){this.renderedSourceKey_?this.renderedSourceKey_!==e&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=e):this.renderedSourceKey_=e}getFeatures(e){return P()}getData(e){return null}prepareFrame(e){return P()}renderFrame(e,t){return P()}forEachFeatureAtCoordinate(e,t,n,r,i){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(e){let t=e.target;(t.getState()===Q.LOADED||t.getState()===Q.ERROR)&&this.renderIfReadyAndVisible()}loadImage(e){let t=e.getState();return t!=Q.LOADED&&t!=Q.ERROR&&e.addEventListener(N.CHANGE,this.boundHandleImageChange_),t==Q.IDLE&&(e.load(),t=e.getState()),t==Q.LOADED}renderIfReadyAndVisible(){let e=this.getLayer();e&&e.getVisible()&&e.getSourceState()===`ready`&&e.changed()}renderDeferred(e){}disposeInternal(){delete this.layer_,super.disposeInternal()}},Fh=[],Ih=null;function Lh(){Ih=U(1,1,void 0,{willReadFrequently:!0})}var Rh=class extends Ph{constructor(e){super(e),this.container=null,this.renderedResolution,this.tempTransform=Sc(),this.pixelTransform=Sc(),this.inversePixelTransform=Sc(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(e,t,n){Ih||Lh(),Ih.clearRect(0,0,1,1);let r;try{Ih.drawImage(e,t,n,1,1,0,0,1,1),r=Ih.getImageData(0,0,1,1).data}catch{return Ih=null,null}return r}getBackground(e){let t=this.getLayer().getBackground();return typeof t==`function`&&(t=t(e.viewState.resolution)),t||void 0}useContainer(e,t,n,r,i){if(nu(e)&&this.pixelTransform[1]===0&&this.pixelTransform[2]===0&&this.pixelTransform[4]===0&&this.pixelTransform[5]===0&&e.width===r&&e.height===i){let t=e,r=t.getContext(`2d`);if(r){this.container=e,this.context=r,this.containerReused=!0,n&&(r.fillStyle=n,r.fillRect(0,0,t.width,t.height));return}}let a=this.getLayer().getClassName(),o,s;if(e&&e.className===a&&(!n||e&&e.style.backgroundColor&&$i(zd(e.style.backgroundColor),zd(n)))){let t=e.firstElementChild;nu(t)&&(s=t.getContext(`2d`))}if(s&&Ac(s.canvas.style.transform,t)?(this.container=e,this.context=s,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){o=Sa?tu():document.createElement(`div`),o.className=a;let e=o.style;e.position=`absolute`,e.width=`100%`,e.height=`100%`,s=U();let t=s.canvas;o.appendChild(t),e=t.style,e.position=`absolute`,e.left=`0`,e.transformOrigin=`top left`,this.container=o,this.context=s}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(e,t,n){let r=wo(n),i=To(n),a=go(n),o=ho(n);H(t.coordinateToPixelTransform,r),H(t.coordinateToPixelTransform,i),H(t.coordinateToPixelTransform,a),H(t.coordinateToPixelTransform,o);let s=this.inversePixelTransform;H(s,r),H(s,i),H(s,a),H(s,o),e.save(),e.beginPath(),e.moveTo(Math.round(r[0]),Math.round(r[1])
5),e.lineTo(Math.round(i[0]),Math.round(i[1])),e.lineTo(Math.round(a[0]),Math.round(a[1])),e.lineTo(Math.round(o[0]),Math.round(o[1])),e.clip()}prepareContainer(e,t){let n=e.extent,r=e.viewState.resolution,i=e.viewState.rotation,a=e.pixelRatio,o=Math.round(V(n)/r*a),s=Math.round(xo(n)/r*a);wc(this.pixelTransform,e.size[0]/2,e.size[1]/2,1/a,1/a,i,-o/2,-s/2),Tc(this.inversePixelTransform,this.pixelTransform);let c=Oc(this.pixelTransform),l=this.getBackground(e);if(this.useContainer(t,c,l,o,s),!this.containerReused){let e=this.context.canvas;e.width!=o||e.height!=s?(e.width=o,e.height=s):this.context.clearRect(0,0,o,s),c!==e.style.transform&&(e.style.transform=c)}}dispatchRenderEvent_(e,t,n){let r=this.getLayer();if(r.hasListener(e)){let i=new ym(e,this.inversePixelTransform,n,t);r.dispatchEvent(i)}}preRender(e,t){this.frameState=t,!t.declutter&&this.dispatchRenderEvent_(Xu.PRERENDER,e,t)}postRender(e,t){t.declutter||this.dispatchRenderEvent_(Xu.POSTRENDER,e,t)}renderDeferredInternal(e){}getRenderContext(e){return e.declutter&&!this.deferredContext_&&(this.deferredContext_=new Mh),e.declutter?this.deferredContext_.getContext():this.context}renderDeferred(e){e.declutter&&(this.dispatchRenderEvent_(Xu.PRERENDER,this.context,e),e.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(e),this.dispatchRenderEvent_(Xu.POSTRENDER,this.context,e))}getRenderTransform(e,t,n,r,i,a,o){let s=i/2,c=a/2,l=r/t,u=-l,d=-e[0]+o,f=-e[1];return wc(this.tempTransform,s,c,l,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}};function zh(e,t,n){if(!(n in e))return e[n]=new Set([t]),!0;let r=e[n],i=r.has(t);return i||r.add(t),!i}function Bh(e,t,n){let r=e[n];return r?r.delete(t):!1}function Vh(e,t){let n=e.layerStatesArray[e.layerIndex];n.extent&&(t=So(t,vc(n.extent,e.viewState.projection)));let r=n.layer.getRenderSource();if(!r.getWrapX()){let n=r.getTileGridForProjection(e.viewState.projection).getExtent();n&&(t=So(t,n))}return t}var Hh=class extends Rh{constructor(e,t){super(e),t=t||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceRevision_,this.tempExtent=no(),this.tempTileRange_=new Dm(0,0,0,0),this.tempTileCoord_=km(0,0,0);let n=t.cacheSize===void 0?512:t.cacheSize;this.tileCache_=new jh(n),this.sourceTileCache_=null,this.layerExtent=null,this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new jh(512)),this.sourceTileCache_}getOrCreateTile(e,t,n,r){let i=this.tileCache_,a=this.getLayer().getSource(),o=jm(a,a.getKey(),e,t,n),s;if(i.containsKey(o))s=i.get(o);else{let c=r.viewState.projection,l=a.getProjection();if(s=a.getTile(e,t,n,r.pixelRatio,c,!l||cc(l,c)?void 0:this.getSourceTileCache()),!s)return null;i.set(o,s)}return s}getTile(e,t,n,r){return this.getOrCreateTile(e,t,n,r)||null}getData(e){let t=this.frameState;if(!t)return null;let n=this.getLayer(),r=H(t.pixelToCoordinateTransform,e.slice()),i=n.getExtent();if(i&&!Qa(i,r))return null;let a=t.viewState,o=n.getRenderSource(),s=o.getTileGridForProjection(a.projection),c=o.getTilePixelRatio(t.pixelRatio);for(let e=s.getZForResolution(a.resolution);e>=s.getMinZoom();--e){let n=s.getTileCoordForCoordAndZ(r,e),i=this.getTile(e,n[1],n[2],t);if(!i||i.getState()!==L.LOADED)continue;let l=s.getOrigin(e),u=Ud(s.getTileSize(e)),d=s.getResolution(e),f;if(i instanceof Km||i instanceof oh)f=i.getImage();else if(i instanceof Ah){if(f=Dh(i.getData()),!f)continue}else continue;let p=Math.floor(c*((r[0]-l[0])/d-n[1]*u[0])),m=Math.floor(c*((l[1]-r[1])/d-n[2]*u[1])),h=Math.round(c*o.getGutterForProjection(a.projection));return this.getImageData(f,p+h,m+h)}return null}prepareFrame(e){this.renderedProjection?e.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=e.viewState.projection):this.renderedProjection=e.viewState.projection;let t=this.getLayer().getSource();if(!t)return!1;let n=t.getRevision();if(!this.renderedSourceRevision_)this.renderedSourceRevision_=n;else if(this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===t.getKey())){var r;this.tileCache_.clear(),(r=this.sourceTileCache_)==null||r.clear()}return!0}
5enqueueTilesForNextExtent(){return!0}enqueueTiles(e,t,n,r,i){let a=e.viewState,o=this.getLayer(),s=o.getRenderSource(),c=s.getTileGridForProjection(a.projection),l=F(s);l in e.wantedTiles||(e.wantedTiles[l]={});let u=e.wantedTiles[l],d=o.getMapInternal(),f=Math.max(n-i,c.getMinZoom(),c.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):c.getResolution(0)),s.zDirection)),p=a.rotation,m=p?bo(a.center,a.resolution,p,e.size):void 0;for(let i=n;i>=f;--i){let n=c.getTileRangeForExtentAndZ(t,i,this.tempTileRange_),a=c.getResolution(i);for(let t=n.minX;t<=n.maxX;++t)for(let o=n.minY;o<=n.maxY;++o){if(p&&!c.tileCoordIntersectsViewport([i,t,o],m))continue;let n=this.getTile(i,t,o,e);if(!n||!zh(r,n,i))continue;let s=n.getKey();if(u[s]=!0,n.getState()===L.IDLE&&!e.tileQueue.isKeyQueued(s)){let r=km(i,t,o,this.tempTileCoord_);e.tileQueue.enqueue([n,l,c.getTileCoordCenter(r),a])}}}}findStaleTile_(e,t){let n=this.tileCache_,r=e[0],i=e[1],a=e[2],o=this.getStaleKeys();for(let e=0;e<o.length;++e){let s=jm(this.getLayer().getSource(),o[e],r,i,a);if(n.containsKey(s)){let e=n.peek(s);if(e.getState()===L.LOADED)return e.endTransition(F(this)),zh(t,e,r),!0}}return!1}findAltTiles_(e,t,n,r){let i=e.getTileRangeForTileCoordAndZ(t,n,this.tempTileRange_);if(!i)return!1;let a=!0,o=this.tileCache_,s=this.getLayer().getRenderSource(),c=s.getKey();for(let e=i.minX;e<=i.maxX;++e)for(let t=i.minY;t<=i.maxY;++t){let i=jm(s,c,n,e,t),l=!1;if(o.containsKey(i)){let e=o.peek(i);e.getState()===L.LOADED&&(zh(r,e,n),l=!0)}l||(a=!1)}return a}renderFrame(e,t){this.renderComplete=!0;let n=e.layerStatesArray[e.layerIndex],r=e.viewState,i=r.projection,a=r.resolution,o=r.center,s=e.pixelRatio,c=this.getLayer(),l=c.getSource(),u=l.getTileGridForProjection(i),d=u.getZForResolution(a,l.zDirection),f=u.getResolution(d);this.updateStaleKeys(l.getKey());let p=e.extent,m=l.getTilePixelRatio(s);this.prepareContainer(e,t);let h=this.context.canvas.width,g=this.context.canvas.height;this.layerExtent=n.extent?vc(n.extent,i):null,this.layerExtent&&(p=So(p,this.layerExtent));let _=f*h/2/m,v=f*g/2/m,y=[o[0]-_,o[1]-v,o[0]+_,o[1]+v],b={};this.renderedTiles.length=0;let x=c.getPreload();if(e.nextExtent&&this.enqueueTilesForNextExtent()){let t=u.getZForResolution(r.nextResolution,l.zDirection),n=Vh(e,e.nextExtent);this.enqueueTiles(e,n,t,b,x)}let S=Vh(e,p);if(this.enqueueTiles(e,S,d,b,0),x>0&&setTimeout(()=>{this.enqueueTiles(e,S,d-1,b,x-1)},0),!(d in b))return this.container;let C=F(this),w=e.time;for(let t of b[d]){let n=t.getState();if(n===L.EMPTY)continue;let r=t.tileCoord;if(n===L.LOADED&&t.getAlpha(C,w)===1){t.endTransition(C);continue}if(n!==L.ERROR&&(this.renderComplete=!1),this.findStaleTile_(r,b)){Bh(b,t,d),e.animate=!0;continue}if(this.findAltTiles_(u,r,d+1,b))continue;let i=u.getMinZoom();for(let e=d-1;e>=i&&!this.findAltTiles_(u,r,e,b);--e);}let T=f/a*s/m,E=this.getRenderContext(e);wc(this.tempTransform,h/2,g/2,T,T,0,-h/2,-g/2),this.layerExtent&&this.clipUnrotated(E,e,this.layerExtent),l.getInterpolate()||(E.imageSmoothingEnabled=!1),this.preRender(E,e);let D=Object.keys(b).map(Number);D.sort(Ji);let O=[],k=[],ee=[];for(let t=D.length-1;t>=0;--t){let n=D[t],r=l.getTilePixelSize(n,s,i),a=u.getResolution(n)/f,o=r[0]*a*T,c=r[1]*a*T,p=u.getTileCoordForCoordAndZ(wo(y),n),h=u.getTileCoordExtent(p),g=H(this.tempTransform,[m*(h[0]-y[0])/f,m*(y[3]-h[3])/f]),_=m*l.getGutterForProjection(i);for(let t of b[n]){if(t.getState()!==L.LOADED)continue;let r=t.tileCoord,i=p[1]-r[1],a=Math.round(g[0]-(i-1)*o),s=p[2]-r[2],u=Math.round(g[1]-(s-1)*c),f=Math.round(g[0]-i*o),m=Math.round(g[1]-s*c),h=a-f,v=u-m,y=n===d;if(y&&t.inTransition(C)){ee.push({tile:t,x:f,y:m,w:h,h:v,gutter:_}),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t);continue}let b=[f,m,f+h,m+v],x=[];for(let e=0,t=O.length;e<t;++e)n<k[e]&&Eo(b,O[e])&&x.push(O[e]);let S;x.length>0&&(S=Mo(b,x)),O.push(b),k.push(n),this.drawTile(t,e,f,m,h,v,_,y,S),this.renderedTiles.unshift(t),this.updateUsedTiles(e.usedTiles,l,t)}}for(let t=0,n=ee.length;t<n;++t){let{tile:n,x:r,y:i,w:a,h:o,gutter:s}=ee[t];this.drawTile(n,e,r,i,a,o,s,!0,void 0)}return this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!so(this.renderedExtent_,y),this.renderedExtent_=y,this.renderedPixelRatio=s,this.postRender(this.context,e),this.layerExtent&&E.restore(
5),E.imageSmoothingEnabled=!0,this.renderComplete&&e.postRenderFunctions.push((e,t)=>{var n;let r=F(l),i=t.wantedTiles[r],a=i?Object.keys(i).length:0;this.updateCacheSize(a),this.tileCache_.expireCache(),(n=this.sourceTileCache_)==null||n.expireCache()}),this.container}updateCacheSize(e){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,e*2)}drawTile(e,t,n,r,i,a,o,s,c){let l;if(e instanceof Ah){if(l=Dh(e.getData()),!l)throw Error(`Rendering array data is not yet supported`)}else l=this.getTileImage(e);if(!l)return;let u=this.getRenderContext(t),d=F(this),f=t.layerStatesArray[t.layerIndex],p=f.opacity*(s?e.getAlpha(d,t.time):1),m=p!==u.globalAlpha;m&&(u.save(),u.globalAlpha=p);let h=l.width-2*o,g=l.height-2*o;if(c){let e=h/i,t=g/a;for(let i=0,a=c.length;i<a;++i){let a=c[i],s=a[0],d=a[1],f=a[2]-a[0],p=a[3]-a[1];u.drawImage(l,o+(s-n)*e,o+(d-r)*t,f*e,p*t,s,d,f,p)}}else u.drawImage(l,o,o,h,g,n,r,i,a);m&&u.restore(),p===f.opacity?s&&e.endTransition(d):t.animate=!0}getImage(){let e=this.context;return e?e.canvas:null}getTileImage(e){return e.getImage()}updateUsedTiles(e,t,n){let r=F(t);r in e||(e[r]={}),e[r][n.getKey()]=!0}},Uh={PRELOAD:`preload`,USE_INTERIM_TILES_ON_ERROR:`useInterimTilesOnError`},Wh=class extends Zu{constructor(e){e=e||{};let t=Object.assign({},e),n=e.cacheSize;delete e.cacheSize,delete t.preload,delete t.useInterimTilesOnError,super(t),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(e.preload===void 0?0:e.preload),this.setUseInterimTilesOnError(e.useInterimTilesOnError===void 0||e.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Uh.PRELOAD)}setPreload(e){this.set(Uh.PRELOAD,e)}getUseInterimTilesOnError(){return this.get(Uh.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(e){this.set(Uh.USE_INTERIM_TILES_ON_ERROR,e)}getData(e){return super.getData(e)}},Gh=class extends Wh{constructor(e){super(e)}createRenderer(){return new Hh(this,{cacheSize:this.getCacheSize()})}},Kh=class{drawCustom(e,t,n,r,i){}drawGeometry(e){}setStyle(e){}drawCircle(e,t,n){}drawFeature(e,t,n){}drawGeometryCollection(e,t,n){}drawLineString(e,t,n){}drawMultiLineString(e,t,n){}drawMultiPoint(e,t,n){}drawMultiPolygon(e,t,n){}drawPoint(e,t,n){}drawPolygon(e,t,n){}drawText(e,t,n){}setFillStrokeStyle(e,t){}setImageStyle(e,t){}setTextStyle(e,t){}},$={BEGIN_GEOMETRY:0,BEGIN_PATH:1,CIRCLE:2,CLOSE_PATH:3,CUSTOM:4,DRAW_CHARS:5,DRAW_IMAGE:6,END_GEOMETRY:7,FILL:8,MOVE_TO_LINE_TO:9,SET_FILL_STYLE:10,SET_STROKE_STYLE:11,STROKE:12},qh=[$.FILL],Jh=[$.STROKE],Yh=[$.BEGIN_PATH],Xh=[$.CLOSE_PATH],Zh=class extends Kh{constructor(e,t,n,r){super(),this.tolerance=e,this.maxExtent=t,this.pixelRatio=r,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(e){let t=this.pixelRatio;return t==1?e:e.map(function(e){return e*t})}appendFlatPointCoordinates(e,t){let n=this.getBufferedMaxExtent(),r=this.tmpCoordinate_,i=this.coordinates,a=i.length;for(let o=0,s=e.length;o<s;o+=t)r[0]=e[o],r[1]=e[o+1],Qa(n,r)&&(i[a++]=r[0],i[a++]=r[1]);return a}appendFlatLineCoordinates(e,t,n,r,i,a){let o=this.coordinates,s=o.length,c=this.getBufferedMaxExtent();a&&(t+=r);let l=e[t],u=e[t+1],d=this.tmpCoordinate_,f=!0,p,m,h;for(p=t+r;p<n;p+=r)d[0]=e[p],d[1]=e[p+1],h=to(c,d),h===m?h===B.INTERSECTING?(o[s++]=d[0],o[s++]=d[1],f=!1):f=!0:(f&&(o[s++]=l,o[s++]=u,f=!1),o[s++]=d[0],o[s++]=d[1]),l=d[0],u=d[1],m=h;return(i&&f||p===t+r)&&(o[s++]=l,o[s++]=u),s}drawCustomCoordinates_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a){let o=n[a],s=this.appendFlatLineCoordinates(e,t,o,r,!1,!1);i.push(s),t=o}return t}drawCustom(e,t,n,r,i){this.beginGeometry(e,t,i);let a=e.getType(),o=e.getStride(),s=this.coordinates.length,c,l,u,d,f;switch(a){case`MultiPolygon`:c=e.getOrientedFlatCoordinates(),d=[];let t=e.getEndss();f=0;for(let e=0,n=t.length;e<n;++e){let n=[];f=this.drawCustomCoordinates_(c,f,t[e],o,n),d.push(n)}this.instructions.push([$.CUSTOM,s,d,e,n,el,i]),this.hitDetectionInstructions.push([$.CUSTOM,s,d,e,r||n,el,i]);break;
5case`Polygon`:case`MultiLineString`:u=[],c=a==`Polygon`?e.getOrientedFlatCoordinates():e.getFlatCoordinates(),f=this.drawCustomCoordinates_(c,0,e.getEnds(),o,u),this.instructions.push([$.CUSTOM,s,u,e,n,$c,i]),this.hitDetectionInstructions.push([$.CUSTOM,s,u,e,r||n,$c,i]);break;case`LineString`:case`Circle`:c=e.getFlatCoordinates(),l=this.appendFlatLineCoordinates(c,0,c.length,o,!1,!1),this.instructions.push([$.CUSTOM,s,l,e,n,Qc,i]),this.hitDetectionInstructions.push([$.CUSTOM,s,l,e,r||n,Qc,i]);break;case`MultiPoint`:c=e.getFlatCoordinates(),l=this.appendFlatPointCoordinates(c,o),l>s&&(this.instructions.push([$.CUSTOM,s,l,e,n,Qc,i]),this.hitDetectionInstructions.push([$.CUSTOM,s,l,e,r||n,Qc,i]));break;case`Point`:c=e.getFlatCoordinates(),this.coordinates.push(c[0],c[1]),l=this.coordinates.length,this.instructions.push([$.CUSTOM,s,l,e,n,void 0,i]),this.hitDetectionInstructions.push([$.CUSTOM,s,l,e,r||n,void 0,i])}this.endGeometry(t)}beginGeometry(e,t,n){this.beginGeometryInstruction1_=[$.BEGIN_GEOMETRY,t,0,e,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[$.BEGIN_GEOMETRY,t,0,e,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){let e=this.hitDetectionInstructions;e.reverse();let t,n=e.length,r,i,a=-1;for(t=0;t<n;++t)r=e[t],i=r[0],i==$.END_GEOMETRY?a=t:i==$.BEGIN_GEOMETRY&&(r[2]=t,Zi(this.hitDetectionInstructions,a,t),a=-1)}fillStyleToState(e,t={}){if(e){var n;let r=e.getColor();t.fillPatternScale=r&&typeof r==`object`&&`src`in r?this.pixelRatio:1,t.fillStyle=(n=Yf(r||`#000`))==null?void 0:n}else t.fillStyle=void 0;return t}strokeStyleToState(e,t={}){if(e){t.strokeStyle=Yf(e.getColor()||np);let n=e.getLineCap();t.lineCap=n===void 0?$f:n;let r=e.getLineDash();t.lineDash=r?r.slice():ep,t.lineDashOffset=e.getLineDashOffset()||0;let i=e.getLineJoin();t.lineJoin=i===void 0?tp:i;let a=e.getWidth();t.lineWidth=a===void 0?1:a;let o=e.getMiterLimit();t.miterLimit=o===void 0?10:o;let s=e.getOffset();t.strokeOffset=s==null?0:s,t.lineWidth>this.maxLineWidth&&(this.maxLineWidth=t.lineWidth,this.bufferedMaxExtent_=null)}else t.strokeStyle=void 0,t.lineCap=void 0,t.lineDash=null,t.lineDashOffset=void 0,t.lineJoin=void 0,t.lineWidth=void 0,t.miterLimit=void 0,t.strokeOffset=void 0;return t}setFillStrokeStyle(e,t){let n=this.state;this.fillStyleToState(e,n),this.strokeStyleToState(t,n)}createFill(e){let t=e.fillStyle,n=[$.SET_FILL_STYLE,t];return typeof t!=`string`&&n.push(e.fillPatternScale),n}applyStroke(e){this.instructions.push(this.createStroke(e))}createStroke(e){return[$.SET_STROKE_STYLE,e.strokeStyle,e.lineWidth*this.pixelRatio,e.lineCap,e.lineJoin,e.miterLimit,e.lineDash?this.applyPixelRatio(e.lineDash):null,e.lineDashOffset*this.pixelRatio]}updateFillStyle(e,t){let n=e.fillStyle;(n!==void 0&&typeof n!=`string`||e.currentFillStyle!=n)&&(this.instructions.push(t.call(this,e)),e.currentFillStyle=n)}updateStrokeStyle(e,t){let n=e.strokeStyle,r=e.lineCap,i=e.lineDash,a=e.lineDashOffset,o=e.lineJoin,s=e.lineWidth,c=e.miterLimit,l=e.strokeOffset;(e.currentStrokeStyle!=n||e.currentLineCap!=r||i!=e.currentLineDash&&!$i(e.currentLineDash,i)||e.currentLineDashOffset!=a||e.currentLineJoin!=o||e.currentLineWidth!=s||e.currentMiterLimit!=c||e.currentStrokeOffset!=l)&&(t.call(this,e),e.currentStrokeStyle=n,e.currentLineCap=r,e.currentLineDash=i,e.currentLineDashOffset=a,e.currentLineJoin=o,e.currentLineWidth=s,e.currentMiterLimit=c,e.currentStrokeOffset=l)}endGeometry(e){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;let t=[$.END_GEOMETRY,e];this.instructions.push(t),this.hitDetectionInstructions.push(t)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=Xa(this.maxExtent),this.maxLineWidth>0)){let e=this.resolution*(this.maxLineWidth+1)/2;Ya(this.bufferedMaxExtent_,e,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}},Qh=class extends Zh{constructor(e,t,n,r){super(e,t,n,r),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(e,t,n){if(!this.image_||this.maxExtent&&!Qa(this.maxExtent,e.getFlatCoordinates()))return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=e.getStride(),a=this.coordinates.length,o=this.appendFlatPointCoordinates(r,i);this.instructions.push([$.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.
5ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}drawMultiPoint(e,t,n){if(!this.image_)return;this.beginGeometry(e,t,n);let r=e.getFlatCoordinates(),i=[];for(let t=0,n=r.length;t<n;t+=e.getStride())(!this.maxExtent||Qa(this.maxExtent,r.slice(t,t+2)))&&i.push(r[t],r[t+1]);let a=this.coordinates.length,o=this.appendFlatPointCoordinates(i,2);this.instructions.push([$.DRAW_IMAGE,a,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([$.DRAW_IMAGE,a,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(t)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(e,t){let n=e.getAnchor(),r=e.getSize(),i=e.getOrigin();this.imagePixelRatio_=e.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=e.getHitDetectionImage(),this.image_=e.getImage(this.pixelRatio),this.height_=r[1],this.opacity_=e.getOpacity(),this.originX_=i[0],this.originY_=i[1],this.rotateWithView_=e.getRotateWithView(),this.rotation_=e.getRotation(),this.scale_=e.getScaleArray(),this.width_=r[0],this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}},$h=class extends Zh{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinates_(e,t,n,r,i){let a=this.coordinates.length,o=this.appendFlatLineCoordinates(e,t,n,r,!1,!1);return this.instructions.push([$.MOVE_TO_LINE_TO,a,o,i*this.pixelRatio]),this.hitDetectionInstructions.push([$.MOVE_TO_LINE_TO,a,o,i]),n}drawLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([$.SET_STROKE_STYLE,np,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ep,0],Yh);let s=e.getFlatCoordinates(),c=e.getStride();this.drawFlatCoordinates_(s,0,s.length,c,o),this.hitDetectionInstructions.push(Jh),this.endGeometry(t)}drawMultiLineString(e,t,n){let r=this.state,i=r.strokeStyle,a=r.lineWidth,o=r.strokeOffset;if(i===void 0||a===void 0)return;this.updateStrokeStyle(r,this.applyStroke),this.beginGeometry(e,t,n),this.hitDetectionInstructions.push([$.SET_STROKE_STYLE,np,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ep,0],Yh);let s=e.getEnds(),c=e.getFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinates_(c,u,s[e],l,o);this.hitDetectionInstructions.push(Jh),this.endGeometry(t)}finish(){let e=this.state;return e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&this.instructions.push(Jh),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(e){e.lastStroke!=null&&e.lastStroke!=this.coordinates.length&&(this.instructions.push(Jh),e.lastStroke=this.coordinates.length),e.lastStroke=0,super.applyStroke(e),this.instructions.push(Yh)}},eg=class extends Zh{constructor(e,t,n,r){super(e,t,n,r)}drawFlatCoordinatess_(e,t,n,r,i){let a=this.state,o=a.fillStyle!==void 0,s=a.strokeStyle!==void 0,c=n.length;this.instructions.push(Yh),this.hitDetectionInstructions.push(Yh);for(let a=0;a<c;++a){let o=n[a],c=this.coordinates.length,l=this.appendFlatLineCoordinates(e,t,o,r,!0,!s);this.instructions.push([$.MOVE_TO_LINE_TO,c,l,i*this.pixelRatio,!0]),this.hitDetectionInstructions.push([$.MOVE_TO_LINE_TO,c,l,i,!0]),s&&(this.instructions.push(Xh),this.hitDetectionInstructions.push(Xh)),t=o}return o&&(this.instructions.push(qh),this.hitDetectionInstructions.push(qh)),s&&(this.instructions.push(Jh),this.hitDetectionInstructions.push(Jh)),t}
5drawCircle(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawCircle(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_FILL_STYLE,Qf]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_STROKE_STYLE,np,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ep,0]);let s=e.getFlatCoordinates(),c=e.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(s,0,s.length,c,!1,!1);let u=[$.CIRCLE,l,o];this.instructions.push(Yh,u),this.hitDetectionInstructions.push(Yh,u),r.fillStyle!==void 0&&(this.instructions.push(qh),this.hitDetectionInstructions.push(qh)),r.strokeStyle!==void 0&&(this.instructions.push(Jh),this.hitDetectionInstructions.push(Jh)),this.endGeometry(t)}drawPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_FILL_STYLE,Qf]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_STROKE_STYLE,np,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ep,0]);let s=e.getEnds(),c=e.getOrientedFlatCoordinates(),l=e.getStride();this.drawFlatCoordinatess_(c,0,s,l,o),this.endGeometry(t)}
5drawMultiPolygon(e,t,n){let r=this.state,i=r.fillStyle,a=r.strokeStyle,o=r.strokeOffset;if(i===void 0&&a===void 0||this.handleStrokeOffset_(()=>this.drawMultiPolygon(e,t,n)))return;this.setFillStrokeStyles_(),this.beginGeometry(e,t,n),r.fillStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_FILL_STYLE,Qf]),r.strokeStyle!==void 0&&this.hitDetectionInstructions.push([$.SET_STROKE_STYLE,np,r.lineWidth,r.lineCap,r.lineJoin,r.miterLimit,ep,0]);let s=e.getEndss(),c=e.getOrientedFlatCoordinates(),l=e.getStride(),u=0;for(let e=0,t=s.length;e<t;++e)u=this.drawFlatCoordinatess_(c,u,s[e],l,o);this.endGeometry(t)}finish(){this.reverseHitDetectionInstructions(),this.state=null;let e=this.tolerance;if(e!==0){let t=this.coordinates;for(let n=0,r=t.length;n<r;++n)t[n]=ul(t[n],e)}return super.finish()}setFillStrokeStyles_(){let e=this.state;this.updateFillStyle(e,this.createFill),this.updateStrokeStyle(e,this.applyStroke)}handleStrokeOffset_(e){let t=this.state,n=t.fillStyle,r=t.strokeStyle,i=t.strokeOffset;return Math.abs(i)>0&&n!==void 0&&r!==void 0&&(t.strokeStyle=void 0,t.strokeOffset=0,e(),t.fillStyle=void 0,t.strokeStyle=r,t.strokeOffset=i,e(),t.fillStyle=n,!0)}},tg=0,ng=1;function rg(e,t,n,r,i,a,o,s){let c=o-i,l=s-a,u=0,d=1;if(c===0){if(i<e||i>n)return!1}else{let t=(e-i)/c,r=(n-i)/c;if(t>r){let e=t;t=r,r=e}if(t>u&&(u=t),r<d&&(d=r),u>d)return!1}if(l===0){if(a<t||a>r)return!1}else{let e=(t-a)/l,n=(r-a)/l;if(e>n){let t=e;e=n,n=t}if(e>u&&(u=e),n<d&&(d=n),u>d)return!1}return tg=u,ng=d,!0}function ig(e,t,n,r){let i=r[0],a=r[1],o=r[2],s=r[3],c=[],l=[],u=!1,d,f,p=0;for(let r=0,m=t.length;r<m;++r){let m=t[r],h=e[p],g=e[p+1],_=!1;for(let t=p+n;t<m;t+=n){let n=e[t],r=e[t+1];if(rg(i,a,o,s,h,g,n,r)){let e=n-h,t=r-g,i=h+tg*e,a=g+tg*t,o=h+ng*e,s=g+ng*t;u&&_&&i===d&&a===f?c.push(o,s):(u&&l.push(c.length),c.push(i,a,o,s),u=!0),d=o,f=s,_=!0}h=n,g=r}p=m}return u&&l.push(c.length),{flatCoordinates:c,ends:l}}function ag(e,t,n,r,i){let a=[],o=n,s=0,c=t.slice(n,2);for(;s<e&&o+i<r;){let[n,r]=c.slice(-2),l=t[o+i],u=t[o+i+1],d=Math.sqrt((l-n)*(l-n)+(u-r)*(u-r));if(s+=d,s>=e){let t=(e-s+d)/d,f=Va(n,l,t),p=Va(r,u,t);c.push(f,p),a.push(c),c=[f,p],s==e&&(o+=i),s=0}else if(s<e)c.push(t[o+i],t[o+i+1]),o+=i;else{let e=d-s,t=Va(n,l,e/d),f=Va(r,u,e/d);c.push(t,f),a.push(c),c=[t,f],s=0,o+=i}}return s>0&&a.push(c),a}function og(e,t,n,r,i){let a=n,o=n,s=0,c=0,l=n,u,d,f,p,m,h,g,_,v,y;for(d=n;d<r;d+=i){let n=t[d],r=t[d+1];m!==void 0&&(v=n-m,y=r-h,p=Math.sqrt(v*v+y*y),g!==void 0&&(c+=f,u=Math.acos((g*v+_*y)/(f*p)),u>e&&(c>s&&(s=c,a=l,o=d),c=0,l=d-i)),f=p,g=v,_=y),m=n,h=r}return c+=p,c>s?[l,d]:[a,o]}var sg={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},cg={Circle:eg,Default:Zh,Image:Qh,LineString:$h,Polygon:eg,Text:class extends Zh{constructor(e,t,n,r){super(e,t,n,r),this.labels_=null,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[Qf]={fillStyle:Qf},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_=``,this.fillKey_=``,this.strokeKey_=``,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){let e=super.finish();return e.textStates=this.textStates,e.fillStates=this.fillStates,e.strokeStates=this.strokeStates,e}drawText(e,t,n){let r=this.textFillState_,i=this.textStrokeState_,a=this.textState_;if(this.text_===``||!a||!r&&!i)return;let o=this.coordinates,s=o.length,c=e.getType(),l=null,u=e.getStride();if(a.placement===`line`&&(c==`LineString`||c==`MultiLineString`||c==`Polygon`||c==`MultiPolygon`)){let r=e.getExtent();if(!Eo(this.maxExtent,r))return;let i;if(l=e.getFlatCoordinates(),c==`LineString`)i=[l.length];else if(c==`MultiLineString`)i=e.getEnds();else if(c==`Polygon`)i=e.getEnds().slice(0,1);else if(c==`MultiPolygon`){let t=e.getEndss();i=[];for(let e=0,n=t.length;e<n;++e)i.push(t[e][0])}if((c==`LineString`||c==`MultiLineString`)&&!$a(this.getBufferedMaxExtent(),r)){let e=ig(l,i,u,this.getBufferedMaxExtent());if(l=e.flatCoordinates,i=e.ends,u=2,i.length===0)return}this.beginGeometry(e,t,n);let d=a.repeat,f=d?void 0:a.textAlign,p=0;for(let e=0,t=i.length;e<t;++e){let t;t=d?ag(d*this.resolution,l,p,i[e],u):[l.slice(p,i[e])];for(let n=0,r=t.length;n<r;++n){let r=t[n],c=0,l=r.length;if(f==null){let e=og(a.maxAngle,r,0,r.length,2);c=e[0],l=e[1]}for(let e=c;e<l;e+=u)o.push(r[e],r[e+1]);let d=o.length;p=i[e],this.drawChars_(s,d),s=d}}this.endGeometry(t)}else{let r=a.overflow?null:[];switch(c){case`Point`:case`MultiPoint`:l=e.getFlatCoordinates();break;case`LineString`:l=e.getFlatMidpoint();break;case`Circle`:l=e.getCenter();break;case`MultiLineString`:l=e.getFlatMidpoints(),u=2;break;
5case`Polygon`:l=e.getFlatInteriorPoint(),a.overflow||r.push(l[2]/this.resolution),u=3;break;case`MultiPolygon`:let t=e.getFlatInteriorPoints();l=[];for(let e=0,n=t.length;e<n;e+=3)a.overflow||r.push(t[e+2]/this.resolution),l.push(t[e],t[e+1]);if(l.length===0)return;u=2}let i=this.appendFlatPointCoordinates(l,u);if(i===s)return;if(r&&(i-s)/2!==l.length/u){let e=s/2;r=r.filter((t,n)=>{let r=o[(e+n)*2]===l[n*u]&&o[(e+n)*2+1]===l[n*u+1];return r||--e,r})}this.saveTextStates_();let d=a.backgroundFill?this.createFill(this.fillStyleToState(a.backgroundFill)):null,f=a.backgroundStroke?this.createStroke(this.strokeStyleToState(a.backgroundStroke)):null;this.beginGeometry(e,t,n);let p=a.padding;if(p!=ap&&(a.scale[0]<0||a.scale[1]<0)){let e=a.padding[0],t=a.padding[1],n=a.padding[2],r=a.padding[3];a.scale[0]<0&&(t=-t,r=-r),a.scale[1]<0&&(e=-e,n=-n),p=[e,t,n,r]}let m=this.pixelRatio;this.instructions.push([$.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==ap?ap:p.map(function(e){return e*m}),d,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]);let h=1/m,g=d?d.slice(0):null;g&&(g[1]=Qf),this.hitDetectionInstructions.push([$.DRAW_IMAGE,s,i,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[h,h],NaN,this.declutterMode_,this.declutterImageWithText_,p,g,f,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Qf:this.fillKey_,this.textOffsetX_,this.textOffsetY_,r]),this.endGeometry(t)}}saveTextStates_(){let e=this.textStrokeState_,t=this.textState_,n=this.textFillState_,r=this.strokeKey_;e&&(r in this.strokeStates||(this.strokeStates[r]={strokeStyle:e.strokeStyle,lineCap:e.lineCap,lineDashOffset:e.lineDashOffset,lineWidth:e.lineWidth,lineJoin:e.lineJoin,miterLimit:e.miterLimit,lineDash:e.lineDash}));let i=this.textKey_;i in this.textStates||(this.textStates[i]={font:t.font,textAlign:t.textAlign||`center`,justify:t.justify,textBaseline:t.textBaseline||`middle`,scale:t.scale});let a=this.fillKey_;n&&(a in this.fillStates||(this.fillStates[a]={fillStyle:n.fillStyle}))}drawChars_(e,t){let n=this.textStrokeState_,r=this.textState_,i=this.strokeKey_,a=this.textKey_,o=this.fillKey_;this.saveTextStates_();let s=this.pixelRatio,c=sg[r.textBaseline],l=this.textOffsetX_*s,u=this.textOffsetY_*s,d=this.text_,f=n?n.lineWidth*Math.abs(r.scale[0])/2:0;this.instructions.push([$.DRAW_CHARS,e,t,c,r.overflow,o,r.maxAngle,s,u,i,f*s,d,a,1,this.declutterMode_,this.textKeepUpright_,l]),this.hitDetectionInstructions.push([$.DRAW_CHARS,e,t,c,r.overflow,o&&Qf,r.maxAngle,s,u,i,f*s,d,a,1/s,this.declutterMode_,this.textKeepUpright_,l])}setTextStyle(e,t){let n,r,i;if(!e)this.text_=``;else{let t=e.getFill();t?(r=this.textFillState_,r||(r={},this.textFillState_=r),r.fillStyle=Yf(t.getColor()||`#000`)):(r=null,this.textFillState_=r);let a=e.getStroke();if(!a)i=null,this.textStrokeState_=i;else{i=this.textStrokeState_,i||(i={},this.textStrokeState_=i);let e=a.getLineDash(),t=a.getLineDashOffset(),n=a.getWidth(),r=a.getMiterLimit();i.lineCap=a.getLineCap()||`round`,i.lineDash=e?e.slice():ep,i.lineDashOffset=t===void 0?0:t,i.lineJoin=a.getLineJoin()||`round`,i.lineWidth=n===void 0?1:n,i.miterLimit=r===void 0?10:r,i.strokeStyle=Yf(a.getColor()||`#000`)}n=this.textState_;let o=e.getFont()||`10px sans-serif`;fp(o);let s=e.getScaleArray();n.overflow=e.getOverflow(),n.font=o,n.maxAngle=e.getMaxAngle(),n.placement=e.getPlacement(),n.textAlign=e.getTextAlign(),n.repeat=e.getRepeat(),n.justify=e.getJustify(),n.textBaseline=e.getTextBaseline()||`middle`,n.backgroundFill=e.getBackgroundFill(),n.backgroundStroke=e.getBackgroundStroke(),n.padding=e.getPadding()||ap,n.scale=s===void 0?[1,1]:s;let c=e.getOffsetX(),l=e.getOffsetY(),u=e.getRotateWithView(),d=e.getKeepUpright(),f=e.getRotation();this.text_=e.getText()||``,this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=l===void 0?0:l,this.textRotateWithView_=u!==void 0&&u,this.textKeepUpright_=d===void 0||d,this.textRotation_=f===void 0?0:f,this.strokeKey_=i?(typeof i.strokeStyle==`string`?i.strokeStyle:F(i.strokeStyle))+i.lineCap+i.lineDashOffset+`|`+i.lineWidth+i.lineJoin+i.miterLimit+`[`+i.lineDash.join()+`]`:``,this.textKey_=n.font+n.scale+(n.textAlign||`?`)+(n.repeat||`?`)+(n.justify||`?`)+(n.textBaseline||`?`),this.fillKey_=r&&r.fillStyle?typeof r.fillStyle==`string`?r.fillStyle:`|`+F(r.fillStyle):``}this.declutterMode_=e.getDeclutterMode(),this.declutterImageWithText_=t}}},lg=class{constructor(e,t,n,r){this.tolerance_=e,this.maxExtent_=t,this.pixelRatio_=r,this.resolution_=n,this.buildersByZIndex_
5={}}finish(){let e={};for(let t in this.buildersByZIndex_){e[t]=e[t]||{};let n=this.buildersByZIndex_[t];for(let r in n){let i=n[r].finish();e[t][r]=i}}return e}getBuilder(e,t){let n=e===void 0?`0`:e.toString(),r=this.buildersByZIndex_[n];r===void 0&&(r={},this.buildersByZIndex_[n]=r);let i=r[t];if(i===void 0){let e=cg[t];i=new e(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),r[t]=i}return i}};function ug(e,t,n,r){let i=e[t],a=e[t+1],o=0;for(let s=t+r;s<n;s+=r){let t=e[s],n=e[s+1];o+=Math.sqrt((t-i)*(t-i)+(n-a)*(n-a)),i=t,a=n}return o}function dg(e,t,n,r,i,a,o,s){var c,l;o=(c=o)==null?[]:c,s=(l=s)==null?r:l;let u=e[t+r],d=e[t+r+1],f=e[n-2*r],p=e[n-2*r+1],m,h,g,_,v,y,b,x,S=0;for(let c=t;c<n;c+=r){g=m,_=h,v=void 0,y=void 0,c+r<n&&(v=e[c+r],y=e[c+r+1]),a&&c===t&&(g=f,_=p),a&&c===n-r&&(v=u,y=d),m=e[c],h=e[c+1],[b,x]=fg(m,h,g,_,v,y,i),o[S++]=b,o[S++]=x;for(let t=2;t<s;t++)o[S++]=e[c+t]}return o.length!=S&&(o.length=S),o}function fg(e,t,n,r,i,a,o){let s,c;n!==void 0&&r!==void 0?(s=e-n,c=t-r):i!==void 0&&a!==void 0?(s=i-e,c=a-t):(s=1,c=0);let l=Math.hypot(s,c),u=s/l,d=c/l;if(s=-d,c=u,n===void 0||r===void 0||i===void 0||a===void 0)return[e+s*o,t+c*o];let f=zo([e,t],[n,r],[i,a]);if(Math.cos(f)>.998)return[e+u*o,t+d*o];let p=Math.cos(f/2),m=Math.sin(f/2),h=m*s+p*c,g=-p*s+m*c,_=1/m*h,v=1/m*g;return[e+_*o,t+v*o]}function pg(e,t,n=!1){for(let r=0,i=e.length-2;r<i;r+=t){let i=n&&r===0?e.length-3*t:e.length-2*t;for(let n=i;n>r+t;n-=t){let i=e[r],a=e[r+1],o=e[r+t],s=e[r+t+1],c=e[n],l=e[n+1],u=e[n+t],d=e[n+t+1],f=(d-l)*(o-i)-(u-c)*(s-a);if(f===0)continue;let p=((u-c)*(a-l)-(d-l)*(i-c))/f,m=((o-i)*(a-l)-(s-a)*(i-c))/f;if(p>0&&p<1&&m>0&&m<1){let c=i+p*(o-i),l=a+p*(s-a);e[r+t]=c,e[r+t+1]=l,e.splice(r+2*t,n-r-t);break}}}return e}var mg;function hg(){return mg||(mg=new Intl.Segmenter(void 0,{granularity:`grapheme`})),mg}function gg(e,t,n,r,i,a,o,s,c,l,u,d,f=!0){let p=e[t],m=e[t+1],h=0,g=0,_=0,v=0;function y(){h=p,g=m,t+=r,p=e[t],m=e[t+1],v+=_,_=Math.sqrt((p-h)*(p-h)+(m-g)*(m-g))}do y();while(t<n-r&&v+_<a);let b=_===0?0:(a-v)/_,x=Va(h,p,b),S=Va(g,m,b),C=t-r,w=v,T=a+s*c(l,i,u);for(;t<n-r&&v+_<T;)y();b=_===0?0:(T-v)/_;let E=Va(h,p,b),D=Va(g,m,b),O=!1;if(f){if(d){let e=[x,S,E,D];Mc(e,0,4,2,d,e,e),O=e[0]>e[2]}else O=x>E}let k=Math.PI,ee=[],te=C+r===t;t=C,_=0,v=w,p=e[t],m=e[t+1];let ne;if(te)return y(),ne=Math.atan2(m-g,p-h),O&&(ne+=ne>0?-k:k),ee[0]=[(E+x)/2,(D+S)/2,(T-a)/2,ne,i],ee;i=i.replace(/\n/g,` `);let re=Array.from(hg().segment(i),e=>e.segment);for(let e=0,i=re.length;e<i;){y();let d=Math.atan2(m-g,p-h);if(O&&(d+=d>0?-k:k),ne!==void 0){let e=d-ne;if(e+=e>k?-2*k:e<-k?2*k:0,Math.abs(e)>o)return null}ne=d;let f=e,x=0;for(;e<i;++e){let o=s*c(l,re[O?i-e-1:e],u);if(t+r<n&&v+_<a+x+o/2)break;x+=o}if(e===f)continue;let S=(O?re.slice(i-e,i-f):re.slice(f,e)).join(``);b=_===0?0:(a+x/2-v)/_;let C=Va(h,p,b),w=Va(g,m,b);ee.push([C,w,x/2,d,S]),a+=x}return ee}var _g=no(),vg=[],yg=[],bg=[],xg=[];function Sg(e){return e[3].declutterBox}var Cg=RegExp(`[Ö-ࣿï¬-ï·¿ï¹°-ﻼà -à¿¿î -î¿¿]`);function wg(e,t){return t===`start`?t=Cg.test(e)?`right`:`left`:t===`end`&&(t=Cg.test(e)?`left`:`right`),sg[t]}function Tg(e,t,n){return n>0&&e.push(` 6`,``),e.push(t,``),e}function Eg(e,t,n){return n%2==0&&(e+=t),e}var Dg=class{constructor(e,t,n,r,i){this.overlaps=n,this.pixelRatio=t,this.resolution=e,this.alignAndScaleFill_,this.instructions=r.instructions,this.coordinates=r.coordinates,this.coordinateCache_={},this.renderedTransform_=Sc(),this.hitDetectionInstructions=r.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=r.fillStates||{},this.strokeStates=r.strokeStates||{},this.textStates=r.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=i?new Mh:null}getZIndexContext(){return this.zIndexContext_}createLabel(e,t,n,r){let i=e+t+n+r;if(this.labels_[i])return this.labels_[i];let a=r?this.strokeStates[r]:null,o=n?this.fillStates[n]:null,s=this.textStates[t],c=this.pixelRatio,l=[s.scale[0]*c,s.scale[1]*c],u=s.justify?sg[s.justify]:wg(Array.isArray(e)?e[0]:e,s.textAlign||`center`),d=r&&a.lineWidth?a.lineWidth:0,f=Array.isArray(e)?e:String(e).split(` 7`).reduce(Tg,[]),{width:p,height:m,widths:h,heights:g,lineWidths:_}=_p(s,f),v=p+d,y=[],b=(v+2)*l[0],x=(m+d)*l[1],S={width:b<0?Math.floor(b):Math.ceil(b),height:x<0?Math.floor(x):Math.ceil(x),contextInstructions:y};(l[0]!=1||l[1]!=1)&&y.push(`scale`,l),r&&(y.push(`strokeStyle`,a.strokeStyle),y.push(`lineWidth`,d),y.push(`lineCap`,a.lineCap),y.push(`lineJoin`,a.lineJoin),y.push(`miterLimit`,a.miterLimit),y.push(`setLineDash`,[a.lineDash]),y.push(`lineDashOffset`,a.lineDashOffset)),n&&y.push(`fillStyle`,o.fillStyle),y.push(`textBaseline`,`middle`),y.push(`textAlign`,`center`);let C=.5-u,w=u*v+C*d,T=[],E=[],D=0,O=0,k=0,ee=0,te;for(let e=0,t=f.length;e<t;e+=2){let t=f[e];if(t===` 8`){O+=D,D=0,w=u*v+C*d,++ee;continue}let i=f[e+1]||s.font;i!==te&&(r&&T.push(`font`,i),n&&E.push(`font`,i),te=i),D=Math.max(D,g[k]);let a=[t,w+C*h[k]+u*(h[k]-_[ee]),.5*(d+D)+O];
8w+=h[k],r&&T.push(`strokeText`,a),n&&E.push(`fillText`,a),++k}return Array.prototype.push.apply(y,T),Array.prototype.push.apply(y,E),this.labels_[i]=S,S}replayTextBackground_(e,t,n,r,i,a,o){e.beginPath(),e.moveTo.apply(e,t),e.lineTo.apply(e,n),e.lineTo.apply(e,r),e.lineTo.apply(e,i),e.lineTo.apply(e,t),a&&(this.alignAndScaleFill_=a[2],e.fillStyle=a[1],this.fill_(e)),o&&(this.setStrokeStyle_(e,o),e.stroke())}calculateImageOrLabelDimensions_(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){o*=d[0],s*=d[1];let g=n-o,_=r-s,v=i+c>e?e-c:i,y=a+l>t?t-l:a,b=p[3]+v*d[0]+p[1],x=p[0]+y*d[1]+p[2],S=g-p[3],C=_-p[0];(m||u!==0)&&(vg[0]=S,xg[0]=S,vg[1]=C,yg[1]=C,yg[0]=S+b,bg[0]=yg[0],bg[1]=C+x,xg[1]=bg[1]);let w;return u===0?ro(Math.min(S,S+b),Math.min(C,C+x),Math.max(S,S+b),Math.max(C,C+x),_g):(w=wc(Sc(),n,r,1,1,u,-n,-r),H(w,vg),H(w,yg),H(w,bg),H(w,xg),ro(Math.min(vg[0],yg[0],bg[0],xg[0]),Math.min(vg[1],yg[1],bg[1],xg[1]),Math.max(vg[0],yg[0],bg[0],xg[0]),Math.max(vg[1],yg[1],bg[1],xg[1]),_g)),f&&(g=Math.round(g),_=Math.round(_)),{drawImageX:g,drawImageY:_,drawImageW:v,drawImageH:y,originX:c,originY:l,declutterBox:{minX:_g[0],minY:_g[1],maxX:_g[2],maxY:_g[3],value:h},canvasTransform:w,scale:d}}replayImageOrLabel_(e,t,n,r,i,a,o){let s=!!(a||o),c=r.declutterBox,l=o?o[2]*r.scale[0]/2:0;return c.minX-l<=t[0]&&c.maxX+l>=0&&c.minY-l<=t[1]&&c.maxY+l>=0&&(s&&this.replayTextBackground_(e,vg,yg,bg,xg,a,o),vp(e,r.canvasTransform,i,n,r.originX,r.originY,r.drawImageW,r.drawImageH,r.drawImageX,r.drawImageY,r.scale)),!0}fill_(e){let t=this.alignAndScaleFill_;if(t){let n=H(this.renderedTransform_,[0,0]),r=512*this.pixelRatio;e.save(),e.translate(n[0]%r,n[1]%r),t!==1&&e.scale(t,t)}e.fill(),t&&e.restore()}setStrokeStyle_(e,t){e.strokeStyle=t[1],t[1]&&(e.lineWidth=t[2],e.lineCap=t[3],e.lineJoin=t[4],e.miterLimit=t[5],e.lineDashOffset=t[7],e.setLineDash(t[6]))}drawLabelWithPointPlacement_(e,t,n,r){let i=this.textStates[t],a=this.createLabel(e,t,r,n),o=this.strokeStates[n],s=this.pixelRatio,c=wg(Array.isArray(e)?e[0]:e,i.textAlign||`center`),l=sg[i.textBaseline||`middle`],u=o&&o.lineWidth?o.lineWidth:0;return{label:a,anchorX:c*(a.width/s-2*i.scale[0])+2*(.5-c)*u,anchorY:l*a.height/s+2*(.5-l)*u}}execute_(e,t,n,r,i,a,o,s){let c=this.zIndexContext_,l;this.pixelCoordinates_&&$i(n,this.renderedTransform_)?l=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),l=jc(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Cc(this.renderedTransform_,n));let u=0,d=r.length,f=0,p,m=[],h,g,_,v,y,b,x,S,C,w,T,E,D,O=0,k=0,ee=this.coordinateCache_,te=this.viewRotation_,ne=Math.round(Math.atan2(-n[1],n[0])*0xe8d4a51000)/0xe8d4a51000,re={context:e,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:te},ie=this.instructions!=r||this.overlaps?0:200,ae,oe,se,ce;for(;u<d;){let n=r[u];switch(n[0]){case $.BEGIN_GEOMETRY:ae=n[1],ce=n[3],ae.getGeometry()?o!==void 0&&!Eo(o,ce.getExtent())?u=n[2]+1:++u:u=n[2],c&&(c.zIndex=n[4]);break;case $.BEGIN_PATH:O>ie&&(this.fill_(e),O=0),k>ie&&(e.stroke(),k=0),!O&&!k&&(e.beginPath(),y=NaN,b=NaN),++u;break;case $.CIRCLE:var le;f=n[1],_=(le=n[2])==null?0:le;let r=l[f],d=l[f+1],de=l[f+2]-_,fe=l[f+3]-_,pe=de-r,me=fe-d,he=Math.sqrt(pe*pe+me*me);e.moveTo(r+he,d),e.arc(r,d,he,0,2*Math.PI,!0),++u;break;case $.CLOSE_PATH:e.closePath(),++u;break;case $.CUSTOM:f=n[1],p=n[2];let ge=n[3],_e=n[4],ve=n[5];re.geometry=ge,re.feature=ae,u in ee||(ee[u]=[]);let ye=ee[u];ve?ve(l,f,p,2,ye):(ye[0]=l[f],ye[1]=l[f+1],ye.length=2),c&&(c.zIndex=n[6]),_e(ye,re),++u;break;case $.DRAW_IMAGE:f=n[1],p=n[2],C=n[3],h=n[4],g=n[5];let be=n[6],xe=n[7],Se=n[8],Ce=n[9],we=n[10],Te=n[11],Ee=n[12],De=n[13];v=n[14]||`declutter`;let Oe=n[15];if(!C&&n.length>=20){w=n[19],T=n[20],E=n[21],D=n[22];let e=this.drawLabelWithPointPlacement_(w,T,E,D);C=e.label,n[3]=C;let t=n[23];h=(e.anchorX-t)*this.pixelRatio,n[4]=h;let r=n[24];g=(e.anchorY-r)*this.pixelRatio,n[5]=g,be=C.height,n[6]=be,De=C.width,n[13]=De}let A;n.length>25&&(A=n[25]);let ke,Ae,je;n.length>17?(ke=n[16],Ae=n[17],je=n[18]):(ke=ap,Ae=null,je=null),we&&ne?Te+=te:!we&&!ne&&(Te-=te);let Me=0;for(;f<p;f+=2){if(A&&A[Me++]<De/this.pixelRatio)continue;let n=this.calculateImageOrLabelDimensions_(C.width,C.height,l[f],l[f+1],De,be,h,g,Se,Ce,Te,Ee,i,ke,!!Ae||!!je,ae),r=[e,t,C,n,xe,Ae,je];if(s){let e,t,i;if(Oe){let n=p-f;if(!Oe[n]){Oe[n]={args:r,declutterMode:v};continue}let a=Oe[n];e=a.args,t=a.declutterMode,delete Oe[n],i=Sg(e)}let a,o;if(e&&(t!==`declutter`||!s.collides(i))&&(a=!0),(v!==`declutter`||!s.collides(n.declutterBox))&&(o=!0),t===`declutter`&&v===`declutter`){let e=a&&o;a=e,o=e}a&&(t!==`none`&&s.insert(i),this.replayImageOrLabel_.apply(this,e)),o&&(v!==`none`&&s.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,r))}else this.replayImageOrLabel_.apply(this,r)}++u;break;case $.DRAW_CHARS:let Ne=n[1],Pe=n[2],Fe=n[3],Ie=n[4];D=n[5];let Le=n[6],Re=n[7],ze=n[8];E=n[9];let Be=n[10];w=n[11],Array.isArray(w)&&(w=w.reduce(Eg,``)),T=n[12];let Ve=[n[13],n[13]];v=n[14]||`declutter`;let He=n[15],Ue=n[16],We=this.textStates[T],Ge=We.font,Ke=[We.scale[0]*Re,We.scale[1]*Re],qe;Ge in this.widths_?qe=this.widths_[Ge]:(qe={},this.widths_[Ge]=qe);let Je=ug(l,Ne,Pe,2),Ye=Math.abs(Ke[0])*gp(Ge,w,qe);if(Ie||Ye<=Je){let n=this.textStates[T].textAlign,r=(Je-Ye)*wg(w,n),i=gg(l,Ne,Pe,2,w,r,Le,Math.abs(Ke[0]),gp,Ge,qe,ne?0:this.viewRotation_,He);drawChars:if(i){let n=[],r,a,o,c,l;if(E)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,T,``,E),h=l[2]+(Ke[0]<0?-Be:Be)-Ue,g=Fe*c.height+(.5-Fe)*2*Be*Ke[1]/Ke[0]-ze;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,h,g,0,0,l[3],Ve,!1,ap,!1,ae);if(s&&v===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}if(D)for(r=0,a=i.length;r<a;++r){l=i[r],o=l[4],c=this.createLabel(o,T,D,``),h=l[2]-Ue,g=Fe*c.height-ze;let a=this.calculateImageOrLabelDimensions_(c.width,c.height,l[0],l[1],c.width,c.height,h,g,0,0,l[3],Ve,!1,ap,!1,ae);if(s&&v===`declutter`&&s.collides(a.declutterBox))break drawChars;n.push([e,t,c,a,1,null,null])}s&&v!==`none`&&s.load(n.map(Sg));for(let e=0,t=n.length;e<t;++e)this.replayImageOrLabel_.apply(this,n[e])}}++u;break;case $.END_GEOMETRY:if(a!==void 0){ae=n[1];let e=a(ae,ce,v);if(e)return e}++u;break;case $.FILL:ie?O++:this.fill_(e),++u;break;case $.MOVE_TO_LINE_TO:f=n[1],p=n[2],_=n[3];let Xe,Ze,Qe;if(_){var ue;let e=(ue=n[4])!=null&&ue||Math.abs(l[f]-l[p-2])<1e-6&&Math.abs(l[f+1
8]-l[p-1])<1e-6;dg(l,f,p,2,_,e,m),pg(m,2,e),Xe=m,Ze=0,Qe=Xe.length}else Xe=l,Ze=f,Qe=p;oe=Xe[Ze],se=Xe[Ze+1],e.moveTo(oe,se),y=oe+.5|0,b=se+.5|0;for(let t=Ze+2;t<Qe;t+=2)oe=Xe[t],se=Xe[t+1],x=oe+.5|0,S=se+.5|0,(t==Qe-2||x!==y||S!==b)&&(e.lineTo(oe,se),y=x,b=S);++u;break;case $.SET_FILL_STYLE:this.alignAndScaleFill_=n[2],O?(this.fill_(e),O=0,k&&(e.stroke(),k=0)):k&&n[1]&&(e.stroke(),k=0),e.fillStyle=n[1],++u;break;case $.SET_STROKE_STYLE:O&&n[1]&&(this.fill_(e),O=0),k&&(e.stroke(),k=0),this.setStrokeStyle_(e,n),++u;break;case $.STROKE:ie?k++:e.stroke(),++u;break;default:++u}}O&&this.fill_(e),k&&e.stroke()}execute(e,t,n,r,i,a){this.viewRotation_=r,this.execute_(e,t,n,this.instructions,i,void 0,void 0,a)}executeHitDetection(e,t,n,r,i){return this.viewRotation_=n,this.execute_(e,[e.canvas.width,e.canvas.height],t,this.hitDetectionInstructions,!0,r,i)}},Og=[`Polygon`,`Circle`,`LineString`,`Image`,`Text`,`Default`],kg=[`Image`,`Text`],Ag=Og.filter(e=>!kg.includes(e)),jg=!1,Mg=!1;function Ng(){let e=0,t=t=>{let n=U(1,1,null,{willReadFrequently:t}),r=0,i=performance.now();for(;performance.now()-i<50;++r)n.fillStyle=`rgba(255,0,${r%256},1)`,n.fillRect(0,0,1,1),n.getImageData(0,0,1,1);return e=r>e?r:e,r};jg={[t(!0)]:!0,[t(!1)]:!1,[t(void 0)]:void 0}[e],Mg=!0}var Pg=class{constructor(e,t,n,r,i,a,o){this.maxExtent_=e,this.overlaps_=r,this.pixelRatio_=n,this.resolution_=t,this.renderBuffer_=a,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Sc(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(i,o)}clip(e,t){let n=this.getClipCoords(t);e.beginPath(),e.moveTo(n[0],n[1]),e.lineTo(n[2],n[3]),e.lineTo(n[4],n[5]),e.lineTo(n[6],n[7]),e.clip()}createExecutors_(e,t){for(let n in e){let r=this.executorsByZIndex_[n];r===void 0&&(r={},this.executorsByZIndex_[n]=r);let i=e[n];for(let e in i){let n=i[e];r[e]=new Dg(this.resolution_,this.pixelRatio_,this.overlaps_,n,t)}}}hasExecutors(e){for(let t in this.executorsByZIndex_){let n=this.executorsByZIndex_[t];for(let t=0,r=e.length;t<r;++t)if(e[t]in n)return!0}return!1}forEachFeatureAtCoordinate(e,t,n,r,i,a){Mg===!1&&Ng(),r=Math.round(r);let o=r*2+1,s=wc(this.hitDetectionTransform_,r+.5,r+.5,1/t,-1/t,-n,-e[0],-e[1]),c=!this.hitDetectionContext_;c&&(this.hitDetectionContext_=U(o,o,null,{willReadFrequently:jg}));let l=this.hitDetectionContext_;l.canvas.width!==o||l.canvas.height!==o?(l.canvas.width=o,l.canvas.height=o):c||l.clearRect(0,0,o,o);let u;this.renderBuffer_!==void 0&&(u=no(),lo(u,e),Ya(u,t*(this.renderBuffer_+r),u));let d=Ig(r),f;function p(e,t,n){let s=l.getImageData(0,0,o,o).data;for(let c=0,u=d.length;c<u;c++)if(s[d[c]]>0){if(!a||n===`none`||f!==`Image`&&f!==`Text`||a.includes(e)){let n=(d[c]-3)/4,a=r-n%o,s=r-(n/o|0),l=i(e,t,a*a+s*s);if(l)return l}l.clearRect(0,0,o,o);break}}let m=Object.keys(this.executorsByZIndex_).map(Number);m.sort(Ji);let h,g,_,v,y;for(h=m.length-1;h>=0;--h){let e=m[h].toString();for(_=this.executorsByZIndex_[e],g=Og.length-1;g>=0;--g)if(f=Og[g],v=_[f],v!==void 0&&(y=v.executeHitDetection(l,s,n,p,u),y))return y}}getClipCoords(e){let t=this.maxExtent_;if(!t)return null;let n=t[0],r=t[1],i=t[2],a=t[3],o=[n,r,n,a,i,a,i,r];return jc(o,0,8,2,e,o),o}isEmpty(){return Wi(this.executorsByZIndex_)}execute(e,t,n,r,i,a,o){let s=Object.keys(this.executorsByZIndex_).map(Number);s.sort(o?Yi:Ji),a=a||Og;let c=Og.length;for(let l=0,u=s.length;l<u;++l){let u=s[l].toString(),d=this.executorsByZIndex_[u];for(let u=0,f=a.length;u<f;++u){let f=a[u],p=d[f];if(p!==void 0){let a=o===null?void 0:p.getZIndexContext(),u=a?a.getContext():e,d=this.maxExtent_&&f!==`Image`&&f!==`Text`;if(d&&(u.save(),this.clip(u,n)),!a||f===`Text`||f===`Image`?p.execute(u,t,n,r,i,o):a.pushFunction(e=>p.execute(e,t,n,r,i,o)),d&&u.restore(),a){a.offset();let e=s[l]*c+Og.indexOf(f);this.deferredZIndexContexts_[e]||(this.deferredZIndexContexts_[e]=[]),this.deferredZIndexContexts_[e].push(a)}}}}this.renderedContext_=e}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){let e=this.deferredZIndexContexts_,t=Object.keys(e).map(Number).sort(Ji);for(let n=0,r=t.length;n<r;
8++n)e[t[n]].forEach(e=>{e.draw(this.renderedContext_),e.clear()}),e[t[n]].length=0}},Fg={};function Ig(e){if(Fg[e]!==void 0)return Fg[e];let t=e*2+1,n=e*e,r=Array(n+1);for(let i=0;i<=e;++i)for(let a=0;a<=e;++a){let o=i*i+a*a;if(o>n)break;let s=r[o];s||(s=[],r[o]=s),s.push(((e+i)*t+(e+a))*4+3),i>0&&s.push(((e-i)*t+(e+a))*4+3),a>0&&(s.push(((e+i)*t+(e-a))*4+3),i>0&&s.push(((e-i)*t+(e-a))*4+3))}let i=[];for(let e=0,t=r.length;e<t;++e)r[e]&&i.push(...r[e]);return Fg[e]=i,i}var Lg=class extends Kh{constructor(e,t,n,r,i,a,o){super(),this.context_=e,this.pixelRatio_=t,this.extent_=n,this.transform_=r,this.transformRotation_=r?Ha(Math.atan2(r[1],r[0]),10):0,this.viewRotation_=i,this.squaredTolerance_=a,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_=``,this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=Sc()}drawImages_(e,t,n,r){if(!this.image_)return;let i=jc(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.tmpLocalTransform_,s=a.globalAlpha;this.imageOpacity_!=1&&(a.globalAlpha=s*this.imageOpacity_);let c=this.imageRotation_;this.transformRotation_===0&&(c-=this.viewRotation_),this.imageRotateWithView_&&(c+=this.viewRotation_);for(let e=0,t=i.length;e<t;e+=2){let t=i[e]-this.imageAnchorX_,n=i[e+1]-this.imageAnchorY_;if(c!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){let e=t+this.imageAnchorX_,r=n+this.imageAnchorY_;wc(o,e,r,1,1,c,-e,-r),a.save(),a.transform.apply(a,o),a.translate(e,r),a.scale(this.imageScale_[0],this.imageScale_[1]),a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),a.restore()}else a.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,n,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(a.globalAlpha=s)}drawText_(e,t,n,r){if(!this.textState_||this.text_===``)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);let i=jc(e,t,n,r,this.transform_,this.pixelCoordinates_),a=this.context_,o=this.textRotation_;for(this.transformRotation_===0&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);t<n;t+=r){let e=i[t]+this.textOffsetX_,n=i[t+1]+this.textOffsetY_;o!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(a.save(),a.translate(e-this.textOffsetX_,n-this.textOffsetY_),a.rotate(o),a.translate(this.textOffsetX_,this.textOffsetY_),a.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&a.strokeText(this.text_,0,0),this.textFillState_&&a.fillText(this.text_,0,0),a.restore()):(this.textStrokeState_&&a.strokeText(this.text_,e,n),this.textFillState_&&a.fillText(this.text_,e,n))}}moveToLineTo_(e,t,n,r,i,a){let o=this.context_,s=jc(e,t,n,r,this.transform_,this.pixelCoordinates_);if(Math.abs(a)>0){let e=s.length,t=i||Math.abs(s[0]-s[e-2])<1e-6&&Math.abs(s[1]-s[e-1])<1e-6;s=dg(s,0,e,2,a,t,s),pg(s,2,t)}o.moveTo(s[0],s[1]);let c=s.length;i&&(c-=2);for(let e=2;e<c;e+=2)o.lineTo(s[e],s[e+1]);return i&&o.closePath(),n}drawRings_(e,t,n,r,i){for(let a=0,o=n.length;a<o;++a)t=this.moveToLineTo_(e,t,n[a],r,!0,i);return t}drawCircle(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Eo(this.extent_,e.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let t=Vc(e,this.transform_,this.pixelCoordinates_),n=t[2]-t[0],r=t[3]-t[1],i=Math.sqrt(n*n+r*r),a=this.context_;a.beginPath(),a.arc(t[0],t[1],i,0,2*Math.PI),this.fillState_&&a.fill(),this.strokeState_&&a.stroke()}this.text_!==``&&this.drawText_(e.getCenter(),0,2,2)}}
8setStyle(e){this.setFillStrokeStyle(e.getFill(),e.getStroke()),this.setImageStyle(e.getImage()),this.setTextStyle(e.getText())}setTransform(e){this.transform_=e}drawGeometry(e){switch(e.getType()){case`Point`:this.drawPoint(e);break;case`LineString`:this.drawLineString(e);break;case`Polygon`:this.drawPolygon(e);break;case`MultiPoint`:this.drawMultiPoint(e);break;case`MultiLineString`:this.drawMultiLineString(e);break;case`MultiPolygon`:this.drawMultiPolygon(e);break;case`GeometryCollection`:this.drawGeometryCollection(e);break;case`Circle`:this.drawCircle(e)}}drawFeature(e,t){let n=t.getGeometryFunction()(e);n&&(this.setStyle(t),this.drawGeometry(n))}drawGeometryCollection(e){let t=e.getGeometriesArray();for(let e=0,n=t.length;e<n;++e)this.drawGeometry(t[e])}drawPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawMultiPoint(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getFlatCoordinates(),n=e.getStride();this.image_&&this.drawImages_(t,0,t.length,n),this.text_!==``&&this.drawText_(t,0,t.length,n)}drawLineString(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Eo(this.extent_,e.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates();t.beginPath(),this.moveToLineTo_(n,0,n.length,e.getStride(),!1,this.strokeState_.strokeOffset),t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoint();this.drawText_(t,0,2,2)}}}drawMultiLineString(e){this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_));let t=e.getExtent();if(Eo(this.extent_,t)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);let t=this.context_,n=e.getFlatCoordinates(),r=0,i=e.getEnds(),a=e.getStride();t.beginPath();for(let e=0,t=i.length;e<t;++e)r=this.moveToLineTo_(n,r,i[e],a,!1,this.strokeState_.strokeOffset);t.stroke()}if(this.text_!==``){let t=e.getFlatMidpoints();this.drawText_(t,0,t.length,2)}}}drawPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Eo(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){var t;this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let n=this.context_;n.beginPath(),this.drawRings_(e.getOrientedFlatCoordinates(),0,e.getEnds(),e.getStride(),(t=this.strokeState_)==null?void 0:t.strokeOffset),this.fillState_&&n.fill(),this.strokeState_&&n.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoint();this.drawText_(t,0,2,2)}}}drawMultiPolygon(e){if(this.squaredTolerance_&&(e=e.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),Eo(this.extent_,e.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);let n=this.context_,r=e.getOrientedFlatCoordinates(),i=0,a=e.getEndss(),o=e.getStride();n.beginPath();for(let e=0,n=a.length;e<n;++e){var t;let n=a[e];i=this.drawRings_(r,i,n,o,(t=this.strokeState_)==null?void 0:t.strokeOffset)}this.fillState_&&n.fill(),this.strokeState_&&n.stroke()}if(this.text_!==``){let t=e.getFlatInteriorPoints();this.drawText_(t,0,t.length,2)}}}setContextFillState_(e){let t=this.context_,n=this.contextFillState_;n?n.fillStyle!=e.fillStyle&&(n.fillStyle=e.fillStyle,t.fillStyle=e.fillStyle):(t.fillStyle=e.fillStyle,this.contextFillState_={fillStyle:e.fillStyle})}setContextStrokeState_(e){let t=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=e.lineCap&&(n.lineCap=e.lineCap,t.lineCap=e.lineCap),$i(n.lineDash,e.lineDash)||t.setLineDash(n.lineDash=e.lineDash),n.lineDashOffset!=e.lineDashOffset&&(n.lineDashOffset=e.lineDashOffset,t.lineDashOffset=e.lineDashOffset),n.lineJoin!=e.lineJoin&&(n.lineJoin=e.lineJoin,t.lineJoin=e.lineJoin),n.lineWidth!=e.lineWidth&&(n.lineWidth=e.lineWidth,t.lineWidth=e.lineWidth),n.miterLimit!=e.miter
8Limit&&(n.miterLimit=e.miterLimit,t.miterLimit=e.miterLimit),n.strokeStyle!=e.strokeStyle&&(n.strokeStyle=e.strokeStyle,t.strokeStyle=e.strokeStyle)):(t.lineCap=e.lineCap,t.setLineDash(e.lineDash),t.lineDashOffset=e.lineDashOffset,t.lineJoin=e.lineJoin,t.lineWidth=e.lineWidth,t.miterLimit=e.miterLimit,t.strokeStyle=e.strokeStyle,this.contextStrokeState_={lineCap:e.lineCap,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset,lineJoin:e.lineJoin,lineWidth:e.lineWidth,miterLimit:e.miterLimit,strokeStyle:e.strokeStyle})}setContextTextState_(e){let t=this.context_,n=this.contextTextState_,r=e.textAlign?e.textAlign:rp;n?(n.font!=e.font&&(n.font=e.font,t.font=e.font),n.textAlign!=r&&(n.textAlign=r,t.textAlign=r),n.textBaseline!=e.textBaseline&&(n.textBaseline=e.textBaseline,t.textBaseline=e.textBaseline)):(t.font=e.font,t.textAlign=r,t.textBaseline=e.textBaseline,this.contextTextState_={font:e.font,textAlign:r,textBaseline:e.textBaseline})}setFillStrokeStyle(e,t){if(!e)this.fillState_=null;else{let t=e.getColor();this.fillState_={fillStyle:Yf(t||Qf)}}if(!t)this.strokeState_=null;else{let e=t.getColor(),n=t.getLineCap(),r=t.getLineDash(),i=t.getLineDashOffset(),a=t.getLineJoin(),o=t.getWidth(),s=t.getMiterLimit(),c=r||ep,l=t.getOffset();this.strokeState_={lineCap:n===void 0?$f:n,lineDash:this.pixelRatio_===1?c:c.map(e=>e*this.pixelRatio_),lineDashOffset:(i||0)*this.pixelRatio_,lineJoin:a===void 0?tp:a,lineWidth:(o===void 0?1:o)*this.pixelRatio_,miter
8Limit:s===void 0?10:s,strokeStyle:Yf(e||np),strokeOffset:(l==null?0:l)*this.pixelRatio_}}}setImageStyle(e){let t;if(!e||!(t=e.getSize())){this.image_=null;return}let n=e.getPixelRatio(this.pixelRatio_),r=e.getAnchor(),i=e.getOrigin();this.image_=e.getImage(this.pixelRatio_),this.imageAnchorX_=r[0]*n,this.imageAnchorY_=r[1]*n,this.imageHeight_=t[1]*n,this.imageOpacity_=e.getOpacity(),this.imageOriginX_=i[0],this.imageOriginY_=i[1],this.imageRotateWithView_=e.getRotateWithView(),this.imageRotation_=e.getRotation();let a=e.getScaleArray();this.imageScale_=[a[0]*this.pixelRatio_/n,a[1]*this.pixelRatio_/n],this.imageWidth_=t[0]*n}setTextStyle(e){if(!e)this.text_=``;else{let t=e.getFill();if(!t)this.textFillState_=null;else{let e=t.getColor();this.textFillState_={fillStyle:Yf(e||Qf)}}let n=e.getStroke();if(!n)this.textStrokeState_=null;else{let e=n.getColor(),t=n.getLineCap(),r=n.getLineDash(),i=n.getLineDashOffset(),a=n.getLineJoin(),o=n.getWidth(),s=n.getMiterLimit();this.textStrokeState_={lineCap:t===void 0?$f:t,lineDash:r||ep,lineDashOffset:i||0,lineJoin:a===void 0?tp:a,lineWidth:o===void 0?1:o,miterLimit:s===void 0?10:s,strokeStyle:Yf(e||np)}}let r=e.getFont(),i=e.getOffsetX(),a=e.getOffsetY(),o=e.getRotateWithView(),s=e.getRotation(),c=e.getScaleArray(),l=e.getText(),u=e.getTextAlign(),d=e.getTextBaseline();this.textState_={font:r===void 0?Zf:r,textAlign:u===void 0?rp:u,textBaseline:d===void 0?ip:d},this.text_=l===void 0?``:Array.isArray(l)?l.reduce((e,t,n)=>e+=n%2?` `:t,``):l,this.textOffsetX_=i===void 0?0:this.pixelRatio_*i,this.textOffsetY_=a===void 0?0:this.pixelRatio_*a,this.textRotateWithView_=o!==void 0&&o,this.textRotation_=s===void 0?0:s,this.textScale_=[this.pixelRatio_*c[0],this.pixelRatio_*c[1]]}}},Rg=.5;function zg(e,t,n,r,i,a,o,s,c){let l=c?_c(i,c):i,u=U(e[0]*Rg,e[1]*Rg);u.imageSmoothingEnabled=!1;let d=u.canvas,f=new Lg(u,Rg,i,null,o,s,c?lc(mc(),c):null),p=n.length,m=Math.floor(16777215/p),h={};for(let e=1;e<=p;++e){let t=n[e-1],i=t.getStyleFunction()||r;if(!i)continue;let o=i(t,a);if(!o)continue;Array.isArray(o)||(o=[o]);let s=(e*m).toString(16).padStart(7,`#00000`);for(let e=0,n=o.length;e<n;++e){let n=o[e],r=n.getGeometryFunction()(t);if(!r||!Eo(l,r.getExtent()))continue;let i=n.clone(),a=i.getFill();a&&a.setColor(s);let c=i.getStroke();c&&(c.setColor(s),c.setLineDash(null)),i.setText(void 0);let u=n.getImage();if(u){let e=u.getImageSize();if(!e)continue;let t=U(e[0],e[1],void 0,{alpha:!1}),n=t.canvas;t.fillStyle=s,t.fillRect(0,0,n.width,n.height),i.setImage(new Tp({img:n,anchor:u.getAnchor(),anchorXUnits:`pixels`,anchorYUnits:`pixels`,offset:u.getOrigin(),opacity:1,size:u.getSize(),scale:u.getScale(),rotation:u.getRotation(),rotateWithView:u.getRotateWithView()}))}let d=i.getZIndex()||0,f=h[d];f||(f={},h[d]=f,f.Polygon=[],f.Circle=[],f.LineString=[],f.Point=[]);let p=r.getType();if(p===`GeometryCollection`){let e=r.getGeometriesArrayRecursive();for(let t=0,n=e.length;t<n;++t){let n=e[t];f[n.getType().replace(`Multi`,``)].push(n,i)}}else f[p.replace(`Multi`,``)].push(r,i)}}let g=Object.keys(h).map(Number).sort(Ji);for(let e=0,n=g.length;e<n;++e){let n=h[g[e]];for(let e in n){let r=n[e];for(let e=0,n=r.length;e<n;e+=2){f.setStyle(r[e+1]);for(let n=0,i=t.length;n<i;++n)f.setTransform(t[n]),f.drawGeometry(r[e])}}}return u.getImageData(0,0,d.width,d.height)}function Bg(e,t,n){let r=[];if(n){let i=Math.floor(Math.round(e[0])*Rg),a=Math.floor(Math.round(e[1])*Rg),o=(z(i,0,n.width-1)+z(a,0,n.height-1)*n.width)*4,s=n.data[o],c=n.data[o+1],l=n.data[o+2]+256*(c+256*s),u=Math.floor(16777215/t.length);l&&l%u===0&&r.push(t[l/u-1])}return r}var Vg=.5,Hg={Point:e_,LineString:Zg,Polygon:n_,MultiPoint:t_,MultiLineString:Qg,MultiPolygon:$g,GeometryCollection:Xg,Circle:Kg};function Ug(e,t){return parseInt(F(e),10)-parseInt(F(t),10)}function Wg(e,t){let n=Gg(e,t);return n*n}function Gg(e,t){return Vg*e/t}function Kg(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Circle`);s.setFillStrokeStyle(a,o),s.drawCircle(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function qg(e,t,n,r,i,a,o,s){let c=[],l=n.getImage();if(l){let e=!0,t=l.getImageState();t==Q.LOADED||t==Q.ERROR?e=!1:t==Q.IDLE&&l.load(),e&&c.push(l.ready())}let u=n.getFill();u&&u.loading()&&c.push(u.ready());let d=c.length>0;return d&&Promise.all(c).then(()=>i(null)),Jg(e,t,n,r,a,o,s),d}function Jg(e,t,n,r,i,a,o){let s=n.getGeometryFunction()(t);if(!s)return;let c=s.simplifyTransformed(r,i);if(n.getRenderer())Yg(e,c,n,t,o);else{let r=Hg[c.getType()];r(e,c,n,t,o,a)}}function Yg(e,t,n,r,i){if(t.getType()==`GeometryCollection`){let a=t.getGeometries();for(let t=0,o=a.length;t<o;++t)Yg(e,a[t],n,r,i);return}e.getBuilder(n.getZIndex(),`Default`).drawCustom(t,r,n.getRenderer(),n.getHitDetectionRenderer(),i)}function Xg(e,t,n,r,i,a){let o=t.getGeometriesArray(),s,c;for(s=0,c=o.length;s<c;++s){let t=Hg[o[s].getType()];t(e,o[s],n,r,i,a)}}
8function Zg(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function Qg(e,t,n,r,i){let a=n.getStroke();if(a){let o=e.getBuilder(n.getZIndex(),`LineString`);o.setFillStrokeStyle(null,a),o.drawMultiLineString(t,r,i)}let o=n.getText();if(o&&o.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(o),a.drawText(t,r,i)}}function $g(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(o||a){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawMultiPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}function e_(e,t,n,r,i,a){let o=n.getImage(),s=n.getText(),c=s&&s.getText(),l=a&&o&&c?{}:void 0;if(o){if(o.getImageState()!=Q.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,l),a.drawPoint(t,r,i)}if(c){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s,l),a.drawText(t,r,i)}}function t_(e,t,n,r,i,a){let o=n.getImage(),s=o&&o.getOpacity()!==0,c=n.getText(),l=c&&c.getText(),u=a&&s&&l?{}:void 0;if(s){if(o.getImageState()!=Q.LOADED)return;let a=e.getBuilder(n.getZIndex(),`Image`);a.setImageStyle(o,u),a.drawMultiPoint(t,r,i)}if(l){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(c,u),a.drawText(t,r,i)}}function n_(e,t,n,r,i){let a=n.getFill(),o=n.getStroke();if(a||o){let s=e.getBuilder(n.getZIndex(),`Polygon`);s.setFillStrokeStyle(a,o),s.drawPolygon(t,r,i)}let s=n.getText();if(s&&s.getText()){let a=e.getBuilder(n.getZIndex(),`Text`);a.setTextStyle(s),a.drawText(t,r,i)}}var r_=class extends Rh{constructor(e){super(e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipExtent_=null,this.extendX_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=no(),this.wrappedRenderedExtent_=no(),this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(e,t,n){let r=t.extent,i=t.viewState,a=i.center,o=i.resolution,s=i.projection,c=i.rotation,l=s.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=t.pixelRatio,p=t.viewHints,m=!(p[Na.ANIMATING]||p[Na.INTERACTING]),h=this.context,g=Math.round(V(r)/o*f),_=Math.round(xo(r)/o*f),v=u.getWrapX()&&s.canWrapX(),y=v?V(l):null,b=v?Math.ceil((r[2]-l[2])/y)+(this.extendX_?2:1):1,x=v?Math.floor((r[0]-l[0])/y)-+!!this.extendX_:0;do{let r=this.getRenderTransform(a,o,0,f,g,_,x*y);t.declutter&&(r=r.slice(0)),e.execute(h,[h.canvas.width,h.canvas.height],r,c,m,n===void 0?Og:n?kg:Ag,n?d&&t.declutter[d]:void 0)}while(++x<b)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=U(this.context.canvas.width,this.context.canvas.height,Fh))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){let e=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=e,Zl(this.context),Fh.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(e){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,e,!0)}renderDeferredInternal(e){this.replayGroup_&&(this.clipExtent_&&this.clipUnrotated(this.context,e,this.clipExtent_),this.replayGroup_.renderDeferred(),this.clipExtent_&&(this.context.restore(),this.clipExtent_=null),this.resetDrawContext_())}renderFrame(e,t){let n=e.layerStatesArray[e.layerIndex];this.opacity_=n.opacity;let r=e.viewState;this.prepareContainer(e,t);let i=this.context,a=this.replayGroup_,o=a&&!a.isEmpty();if(!o&&!(this.getLayer().hasListener(Xu.PRERENDER)||this.getLayer().hasListener(Xu.POSTRENDER)))return this.container;this.setDrawContext_(),this.preRender(i,e);let s=r.projection;this.clipExtent_=null;
8let c=!1;if(o&&n.extent&&this.clipping){let t=vc(n.extent,s);o=Eo(t,e.extent),o&&!$a(t,e.extent)&&(e.declutter?this.clipExtent_=t:(this.clipUnrotated(i,e,t),c=!0))}return o&&this.renderWorlds(a,e,!this.getLayer().getDeclutter()&&void 0),c&&i.restore(),this.postRender(i,e),this.renderedRotation_!==r.rotation&&(this.renderedRotation_=r.rotation,this.hitDetectionImageData_=null),e.declutter||this.resetDrawContext_(),this.container}getFeatures(e){return new Promise(t=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){let e=this.frameState.size.slice(),t=this.renderedCenter_,n=this.renderedResolution_,r=this.renderedRotation_,i=this.renderedProjection_,a=this.wrappedRenderedExtent_,o=this.getLayer(),s=[],c=e[0]*Rg,l=e[1]*Rg;s.push(this.getRenderTransform(t,n,r,Rg,c,l,0).slice());let u=o.getSource(),d=i.getExtent();if(u.getWrapX()&&i.canWrapX()&&!$a(d,a)){let e=a[0],i=V(d),o=0,u;for(;e<d[0];)--o,u=i*o,s.push(this.getRenderTransform(t,n,r,Rg,c,l,u).slice()),e+=i;for(o=0,e=a[2];e>d[2];)++o,u=i*o,s.push(this.getRenderTransform(t,n,r,Rg,c,l,u).slice()),e-=i}let f=mc();this.hitDetectionImageData_=zg(e,s,this.renderedFeatures_,o.getStyleFunction(),a,n,r,Wg(n,this.renderedPixelRatio_),f?i:null)}t(Bg(e,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(e,t,n,r,i){var a;if(!this.replayGroup_)return;let o=t.viewState.resolution,s=t.viewState.rotation,c=this.getLayer(),l={},u=function(e,t,n){let a=F(e),o=l[a];if(!o){if(n===0)return l[a]=!0,r(e,c,t);i.push(l[a]={feature:e,layer:c,geometry:t,distanceSq:n,callback:r})}else if(o!==!0&&n<o.distanceSq){if(n===0)return l[a]=!0,i.splice(i.lastIndexOf(o),1),r(e,c,t);o.geometry=t,o.distanceSq=n}},d=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(e,o,s,n,u,d?(a=t.declutter)==null||(a=a[d])==null?void 0:a.all().map(e=>e.value):null)}handleFontsChanged(){let e=this.getLayer();e.getVisible()&&this.replayGroup_&&e.changed()}handleStyleImageChange_(e){this.renderIfReadyAndVisible()}prepareFrame(e){let t=this.getLayer(),n=t.getSource();if(!n)return!1;let r=e.viewHints[Na.ANIMATING],i=e.viewHints[Na.INTERACTING],a=t.getUpdateWhileAnimating(),o=t.getUpdateWhileInteracting();if(this.ready&&!a&&r||!o&&i)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;let s=e.extent,c=e.viewState,l=c.projection,u=c.resolution,d=e.pixelRatio,f=t.getRevision(),p=t.getRenderBuffer(),m=t.getRenderOrder();m===void 0&&(m=Ug);let h=c.center.slice(),g=Ya(s,p*u),_=g.slice(),v=[g.slice()],y=l.getExtent(),b=n.getWrapX()&&l.canWrapX();if(this.extendX_=!1,b){let e=n.getExtent();e&&!Do(e)&&(this.extendX_=e[0]<y[0]||e[2]>y[2])}if(b&&(!$a(y,e.extent)||this.extendX_)){let e=V(y),t=Math.max(V(g)/2,e),n=y[0],r=y[2];this.extendX_&&(n-=e,r+=e),g[0]=n-t,g[2]=r+t,Lo(h,l);let i=Ao(v[0],l);i[0]<y[0]&&i[2]<y[2]?v.push([i[0]+e,i[1],i[2]+e,i[3]]):i[0]>y[0]&&i[2]>y[2]&&v.push([i[0]-e,i[1],i[2]-e,i[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedPixelRatio_===d&&this.renderedRevision_==f&&this.renderedRenderOrder_==m&&this.renderedFrameDeclutter_===!!e.declutter&&$a(this.wrappedRenderedExtent_,g))return $i(this.renderedExtent_,_)||(this.hitDetectionImageData_=null,this.renderedExtent_=_),this.renderedCenter_=h,this.replayGroupChanged=!1,!0;this.replayGroup_=null;let x=new lg(Gg(u,d),g,u,d),S=mc(),C;if(S){for(let e=0,t=v.length;e<t;++e){let t=v[e],r=_c(t,l);n.loadFeatures(r,yc(u,l),S)}C=lc(S,l)}else for(let e=0,t=v.length;e<t;++e)n.loadFeatures(v[e],u,l);let w=Wg(u,d),T=!0,E=(e,n)=>{let r,i=e.getStyleFunction()||t.getStyleFunction();if(i&&(r=i(e,u)),r){let t=this.renderFeature(e,w,r,x,C,this.getLayer().getDeclutter(),n);T=T&&!t}},D=_c(g,l),O=n.getFeaturesInExtent(D);m&&O.sort(m);for(let e=0,t=O.length;e<t;++e)E(O[e],e);this.renderedFeatures_=O,this.ready=T;let k=x.finish(),ee=new Pg(g,u,d,n.getOverlaps(),k,t.getRenderBuffer(),!!e.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=m,this.renderedFrameDeclutter_=!!e.declutter,this.renderedExtent_=_,this.wrappedRenderedExtent_=g,this.renderedCenter_=h,this.renderedProjection_=l,this.renderedPixelRatio_=d,this.replayGroup_=ee,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(e,t,n,r,i,a,o){if(!n)return!1;let s=!1;if(Array.isArray(n))for(let c=0,l=n.length;c<l;++c)s=qg(r,e,n[c],t,this.boundHandleStyleImageChange_,i,a,o)||s;else s=qg(r,e,n,t,this.boundHandleStyleImageChange_,i,a,o);return s}},i_=class extends _m{constructor(e){super(e)}createRenderer(){return new r_(this)}},a_=!1;function o_(e,t,n,r,i,a,o){let s=new XMLHttpRequest;s.open(`GET`,typeof e==`function`?e(n,r,i):e,!0),t.getType()==`arraybuffer`&&(s.responseType=`arraybuffer`),s.withCredentials=a_,s.onload=function(e){if(!s.status||s.status>=200&&s.status<300){let e=t.getType();try{let r;e==`text`||e==`json`?r=s.responseText:e==`xml`?r=s.responseXML||s.responseText:e==`arraybuffer`&&(r=s.response),r?a(t.readFeatures(r,{extent:n,featureProjection:i}),t.readProjection(r)):o()}catch{o()}}else o()},s.onerror=o,s.send()}function s_(e,t){return function(n,r,i,a,o){o_(e,t,n,r,i,(e,t)=>{this.addFeatures(e),a!==void 0&&a(e)},()=>{this.changed(),o!==void 0&&o()})}}function c_(e,t){return[[-1/0,-1/0,1/0,1/0]]}var l_=class e extends fa{constructor(e){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_=`geometry`,this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),e){if(typeof e.getSimplifiedGeometry==`function`){let t=e;this.setGeometry(t)}else{let t=e;this.setProperties(t)}}}clone(){let t=new e,n=this.geometryName_;t.setGeometryName(n);let r=this.getPropertiesInternal();if(r){let e=this.getGeometry();for(let i in r)i===n&&e?t.set(i,e.clone()):t.set(i,r[i],!0)}let i=this.getStyle();return i&&t.setStyle(i),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(M(this.geometryChangeKey_),this.geometryChangeKey_=null);let e=this.getGeometry();e&&(this.geometryChangeKey_=j(e,N.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(e){this.set(this.geometryName_,e)}setStyle(e){this.style_=e,this.styleFunction_=e?u_(e):void 0,this.changed()}setId(e){this.id_=e,this.changed()}setGeometryName(e){e!==this.geometryName_&&(this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=e,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_())}};function u_(e){if(typeof e==`function`)return e;let t;return Array.isArray(e)?t=e:(R(typeof e.getZIndex==`function`,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[e]),function(){return t}}function d_(e,t,n,r,i,a,o){let s,c,l=(n-t)/r;if(l===1)s=t;else if(l===2)s=t,c=i;else if(l!==0){let a=e[t],o=e[t+1],l=0,u=[0];for(let i=t+r;i<n;i+=r){let t=e[i],n=e[i+1];l+=Math.sqrt((t-a)*(t-a)+(n-o)*(n-o)),u.push(l),a=t,o=n}let d=i*l,f=qi(u,d);f<0?(c=(d-u[-f-2])/(u[-f-1]-u[-f-2]),s=t+(-f-2)*r):s=t+f*r}o=o>1?o:2,a=a||Array(o);for(let t=0;t<o;++t)a[t]=s===void 0?NaN:c===void 0?e[s+t]:Va(e[s+t],e[s+r+t],c);return a}function f_(e,t,n,r){let i=[],a=no();for(let o=0,s=n.length;o<s;++o){let s=n[o];a=oo(e,t,s[0],r),i.push((a[0]+a[2])/2,(a[1]+a[3])/2),t=s[s.length-1]}return i}var p_=Sc(),m_=class e{constructor(e,t,n,r,i,a){this.styleFunction,this.extent_,this.id_=a,this.type_=e,this.flatCoordinates_=t,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=i,this.squaredTolerance_,this.stride_=r,this.simplifiedGeometry_}get(e){return this.properties_[e]}getExtent(){return this.extent_||(this.extent_=this.type_===`Point`?ao(this.flatCoordinates_):oo(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){let e=_o(this.getExtent());this.flatInteriorPoints_=hl(this.flatCoordinates_,0,this.ends_,this.stride_,e,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){let e=xl(this.flatCoordinates_,this.ends_),t=f_(this.flatCoordinates_,0,e,this.stride_);this.flatInteriorPoints_=gl(this.flatCoordinates_,0,e,this.stride_,t)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=d_(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];let e=this.flatCoordinates_,t=0,n=this.ends_;for(let r=0,i=n.length;r<i;++r){let i=n[r],a=d_(e,t,i,this.stride_,.5);Qi(this.flatMidpoints_,a),t=i}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(e){return this}simplifyTransformed(e,t){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(e){e=tc(e);let t=e.getExtent(),n=e.getWorldExtent();if(t&&n){let e=xo(n)/xo(t);wc(p_,n[0],n[3],e,-e,0,0,0),jc(this.flatCoordinates_,0,this.flatCoordinates_.length,this.stride_,p_,this.flatCoordinates_)}}applyTransform(e){e(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){var t;
8return new e(this.type_,this.flatCoordinates_.slice(),(t=this.ends_)==null?void 0:t.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ia((t,n)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),n&&this.simplifiedGeometry_.applyTransform(n);let r=this.simplifiedGeometry_.getFlatCoordinates(),i;switch(this.type_){case`LineString`:r.length=cl(r,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,r,0),i=[r.length];break;case`MultiLineString`:i=[],r.length=ll(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,r,0,i);break;case`Polygon`:i=[],r.length=fl(r,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),r,0,i)}return i&&(this.simplifiedGeometry_=new e(this.type_,r,i,this.stride_,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}};m_.prototype.getFlatCoordinates=m_.prototype.getOrientedFlatCoordinates;var h_=class{constructor(e){this.rbush_=new nd(e),this.items_={}}insert(e,t){let n={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3],value:t};this.rbush_.insert(n),this.items_[F(t)]=n}load(e,t){let n=Array(t.length);for(let r=0,i=t.length;r<i;r++){let i=e[r],a=t[r],o={minX:i[0],minY:i[1],maxX:i[2],maxY:i[3],value:a};n[r]=o,this.items_[F(a)]=o}this.rbush_.load(n)}remove(e){let t=F(e),n=this.items_[t];return delete this.items_[t],this.rbush_.remove(n)!==null}update(e,t){let n=this.items_[F(t)];so([n.minX,n.minY,n.maxX,n.maxY],e)||(this.remove(t),this.insert(e,t))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(e){let t={minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]};return this.rbush_.search(t).map(function(e){return e.value})}forEach(e){return this.forEach_(this.getAll(),e)}forEachInExtent(e,t){return this.forEach_(this.getInExtent(e),t)}forEach_(e,t){let n;for(let r=0,i=e.length;r<i;r++)if(n=t(e[r]),n)return n;return n}isEmpty(){return Wi(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(e){let t=this.rbush_.toJSON();return ro(t.minX,t.minY,t.maxX,t.maxY,e)}concat(e){this.rbush_.load(e.rbush_.all());for(let t in e.items_)this.items_[t]=e.items_[t]}},g_={ADDFEATURE:`addfeature`,CHANGEFEATURE:`changefeature`,CLEAR:`clear`,REMOVEFEATURE:`removefeature`,FEATURESLOADSTART:`featuresloadstart`,FEATURESLOADEND:`featuresloadend`,FEATURESLOADERROR:`featuresloaderror`},__=class extends oa{constructor(e,t,n){super(e),this.feature=t,this.features=n}},v_=class extends gh{constructor(e){e=e||{},super({attributions:e.attributions,interpolate:!0,projection:void 0,state:`ready`,wrapX:e.wrapX===void 0||e.wrapX}),this.on,this.once,this.un,this.loader_=ra,this.format_=e.format||null,this.overlaps_=e.overlaps===void 0||e.overlaps,this.url_=e.url,e.loader===void 0?this.url_!==void 0&&(R(this.format_,"`format` must be set when `url` is set"),this.loader_=s_(this.url_,this.format_)):this.loader_=e.loader,this.strategy_=e.strategy===void 0?c_:e.strategy;let t=e.useSpatialIndex===void 0||e.useSpatialIndex;this.featuresRtree_=t?new h_:null,this.loadedExtentsRtree_=new h_,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,r;Array.isArray(e.features)?r=e.features:e.features&&(n=e.features,r=n.getArray()),!t&&n===void 0&&(n=new ha(r)),r!==void 0&&this.addFeaturesInternal(r),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(e){this.addFeatureInternal(e),this.changed()}addFeatureInternal(e){let t=F(e);if(!this.addToIndex_(t,e)){this.featuresCollection_&&this.featuresCollection_.remove(e);return}this.setupChangeEvents_(t,e);let n=e.getGeometry();if(n){let t=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(t,e)}else this.nullGeometryFeatures_[t]=e;this.dispatchEvent(new __(g_.ADDFEATURE,e))}setupChangeEvents_(e,t){t instanceof m_||(this.featureChangeKeys_[e]=[j(t,N.CHANGE,this.handleFeatureChange_,this),j(t,Hi.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(e,t){let n=!0;if(t.getId()!==void 0){let e=String(t.getId());if(!(e in this.idIndex_))this.idIndex_[e]=t;else if(t instanceof m_){let r=this.idIndex_[e];r instanceof m_?Array.isArray(r)?r.push(t):this.idIndex_[e]=[r,t]:n=!1}else n=!1}return n&&(R(!(e in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[e]=t),n}addFeatures(e){this.addFeaturesInternal(e),this.changed()}addFeaturesInternal(e){let t=[],n=[],r=[];for(let t=0,r=e.length;t<r;t++){let r=e[t],i=F(r);this.addToIndex_(i,r)&&n.push(r)}for(let e=0,i=n.length;e<i;e++){let i=n[e],a=F(i);this.setupChangeEvents_(a,i);let o=i.getGeometry();if(o){let e=o.getExtent();t.push(e),r.push(i)}else this.nullGeometryFeatures_[a]=i}if(this.featuresRtree_&&this.featuresRtree_.load(t,r),this.hasListener(g_.ADDFEATURE))for(let e=0,t=n.length;e<t;e++)this.dispatchEvent(new __(g_.ADDFEATURE,n[e]))}bindFeaturesCollection_(e){let t=!1;this.addEventListener(g_.ADDFEATURE,function(n){t||(t=!0,e.push(n.feature),t=!1)}),this.addEventListener(g_.REMOVEFEATURE,function(n){t||(t=!0,e.remove(n.feature),t=!1)}),e.addEventListener(Vi.ADD,e=>{t||(t=!0,this.addFeature(e.element),t=!1)}),e.addEventListener(Vi.REMOVE,e=>
8{t||(t=!0,this.removeFeature(e.element),t=!1)}),this.featuresCollection_=e}clear(e){if(e){for(let e in this.featureChangeKeys_)this.featureChangeKeys_[e].forEach(M);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(e=>{this.removeFeatureInternal(e)});for(let e in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[e])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};let t=new __(g_.CLEAR);this.dispatchEvent(t),this.changed()}forEachFeature(e){if(this.featuresRtree_)return this.featuresRtree_.forEach(e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureAtCoordinateDirect(e,t){let n=[e[0],e[1],e[0],e[1]];return this.forEachFeatureInExtent(n,function(n){let r=n.getGeometry();if(r instanceof m_||r.intersectsCoordinate(e))return t(n)})}forEachFeatureInExtent(e,t){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(e,t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureIntersectingExtent(e,t){return this.forEachFeatureInExtent(e,function(n){let r=n.getGeometry();if(r instanceof m_||r.intersectsExtent(e)){let e=t(n);if(e)return e}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let e;return this.featuresCollection_?e=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(e=this.featuresRtree_.getAll(),Wi(this.nullGeometryFeatures_)||Qi(e,Object.values(this.nullGeometryFeatures_))),e}getFeaturesAtCoordinate(e){let t=[];return this.forEachFeatureAtCoordinateDirect(e,function(e){t.push(e)}),t}getFeaturesInExtent(e,t){if(this.featuresRtree_){if(!(t&&t.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(e);let n=jo(e,t);return[].concat(...n.map(e=>this.featuresRtree_.getInExtent(e)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(e,t){let n=e[0],r=e[1],i=null,a=[NaN,NaN],o=1/0,s=[-1/0,-1/0,1/0,1/0];return t=t||ta,this.featuresRtree_.forEachInExtent(s,function(e){if(t(e)){let t=e.getGeometry(),c=o;if(o=t instanceof m_?0:t.closestPointXY(n,r,a,o),o<c){i=e;let t=Math.sqrt(o);s[0]=n-t,s[1]=r-t,s[2]=n+t,s[3]=r+t}}}),i}getExtent(e){var t,n;return(t=(n=this.featuresRtree_)==null?void 0:n.getExtent(e))==null?null:t}getFeatureById(e){let t=this.idIndex_[e.toString()];return t===void 0?null:t}getFeatureByUid(e){let t=this.uidIndex_[e];return t===void 0?null:t}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(e){let t=e.target,n=F(t),r=t.getGeometry();if(!r)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(t),this.nullGeometryFeatures_[n]=t);else{let e=r.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(e,t)):this.featuresRtree_&&this.featuresRtree_.update(e,t)}let i=t.getId();if(i!==void 0){let e=i.toString();this.idIndex_[e]!==t&&(this.removeFromIdIndex_(t),this.idIndex_[e]=t)}else this.removeFromIdIndex_(t),this.uidIndex_[n]=t;this.changed(),this.dispatchEvent(new __(g_.CHANGEFEATURE,t))}hasFeature(e){let t=e.getId();if(t!==void 0){let n=this.idIndex_[String(t)];return Array.isArray(n)?n.includes(e):n===e}return F(e)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Wi(this.nullGeometryFeatures_):!this.featuresCollection_||this.featuresCollection_.getLength()===0}loadFeatures(e,t,n){let r=this.loadedExtentsRtree_,i=this.strategy_(e,t,n);for(let e=0,a=i.length;e<a;++e){let a=i[e];if(!r.forEachInExtent(a,function(e){return $a(e.extent,a)})){this.loading=Number(this.loading)+1,this.dispatchEvent(new __(g_.FEATURESLOADSTART));let e=e=>{this.loading=Number(this.loading)-1,this.dispatchEvent(new __(g_.FEATURESLOADEND,void 0,e))},i=()=>{this.changed(),this.loading=Number(this.loading)-1,this.dispatchEvent(new __(g_.FEATURESLOADERROR))},o=!1,s=this.loader_.call(this,a,t,n,t=>o||e(t),()=>o||i());s instanceof Promise?(o=!0,s.then(t=>{this.addFeatures(t),e(t)}).catch(i)):this.loader_.length<4&&(this.loading=!1),r.insert(a,{extent:a.slice()})}}}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(e){let t=this.loadedExtentsRtree_,n=[];t.forEachInExtent(e,function(e){n.push(e)}
8),n.forEach(n=>{t.remove(n);let r=Co(n.extent,e);for(let e of r)t.insert(e,{extent:e})})}removeFeatures(e){let t=!1;for(let n=0,r=e.length;n<r;++n)t=this.removeFeatureInternal(e[n])||t;t&&this.changed()}removeFeature(e){e&&this.removeFeatureInternal(e)&&this.changed()}removeFeatureInternal(e){let t=F(e);if(!(t in this.uidIndex_))return!1;t in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[t]:this.featuresRtree_&&this.featuresRtree_.remove(e);let n=this.featureChangeKeys_[t];n==null||n.forEach(M),delete this.featureChangeKeys_[t];let r=e.getId();if(r!==void 0){let t=r.toString(),n=this.idIndex_[t];n===e?delete this.idIndex_[t]:Array.isArray(n)&&(n.splice(n.indexOf(e),1),n.length===1&&(this.idIndex_[t]=n[0]))}return delete this.uidIndex_[t],this.hasListener(g_.REMOVEFEATURE)&&this.dispatchEvent(new __(g_.REMOVEFEATURE,e)),!0}removeFromIdIndex_(e){for(let t in this.idIndex_)if(this.idIndex_[t]===e){delete this.idIndex_[t];break}}setLoader(e){this.loader_=e}setUrl(e){R(this.format_,"`format` must be set when `url` is set"),this.url_=e,this.setLoader(s_(e,this.format_))}setOverlaps(e){this.overlaps_=e,this.changed()}},y_={data(){return{map:null}},props:{latitude:String,longitude:String},methods:{placeMap:function(){this.map=null;let e=new l_({type:`icon`,geometry:new ml(sc([this.longitude,this.latitude]))});this.map=new Tm({layers:[new Gh({source:new Eh}),new i_({source:new v_({features:[e]}),style:new Dp({image:new Tp({anchor:[.5,1],src:`/icons/marker.png`,scale:.5,anchorOrigin:`bottom-center`})})})],target:this.$refs.map,view:new Pl({center:sc([this.longitude,this.latitude]),zoom:12})})}},mounted(){this.placeMap()}},b_={"data-block":`coordinates`},x_={class:`aspect-[3/2] relative`},S_={id:`map`,tabindex:`1`,ref:`map`,class:`absolute inset-0`};function C_(e,t,n,r,i,a){return s(),y(`div`,b_,[C(`div`,x_,[C(`div`,S_,null,512)])])}var w_=Object.assign(A(y_,[[`render`,C_]]),{__name:`ElementCoordinates`}),T_={data(){return{params:`auto_play=false`}},props:{data:null}},E_={"data-block":`soundcloud`},D_=[`src`];function O_(e,t,n,r,i,a){let o=k(`not-lazy`);return s(),y(`div`,E_,[pe(C(`iframe`,{width:`100%`,height:`166`,scrolling:`no`,frameborder:`no`,allow:`autoplay`,src:`https://w.soundcloud.com/player/?url=${n.data.url}&${i.params}`},null,8,D_),[[o]])])}var k_=Object.assign(A(T_,[[`render`,O_]]),{__name:`ElementSoundCloudPost`}),A_={__name:`ComponentResolverNina`,props:{element:{type:Object,required:!0},blockPrerolls:Boolean},setup(e){return(t,n)=>{var r,i;let a=Ut,o=qt,c=en,l=cn,u=jn,d=Vn,p=Yn,m=nr,h=or,g=hr,_=ki,v=Mi,b=Ii,x=Bi,S=w_,C=k_;return e.element.toString().includes(`TextElement`)?(s(),y(ge,{key:0},[e.element.format==`Code`?(s(),f(a,{key:0,code:e.element.html},null,8,[`code`])):(s(),f(o,{key:1,text:e.element.body},null,8,[`text`]))],64)):e.element.toString().includes(`QuoteElement`)?(s(),f(c,{key:1,data:e.element},null,8,[`data`])):e.element.toString().includes(`ResourceElement`)?(s(),f(l,{key:2,data:e.element},null,8,[`data`])):e.element.toString().includes(`AssetsElementDto`)?(s(),y(ge,{key:3},[e.element.items.length==1?(s(),f(u,{key:0,items:e.element.items,"block-prerolls":e.blockPrerolls},null,8,[`items`,`block-prerolls`])):(s(),f(d,{key:1,items:e.element.items,"block-prerolls":e.blockPrerolls},null,8,[`items`,`block-prerolls`]))],64)):e.element.toString().includes(`HighlightElement`)?(s(),f(p,{key:4,data:e.element},null,8,[`data`])):e.element.toString().includes(`InstagramPostElement`)?(s(),f(m,{key:5,data:e.element},null,8,[`data`])):e.element.toString().includes(`FacebookPostElement`)?(s(),f(h,{key:6,data:e.element},null,8,[`data`])):e.element.toString().includes(`YouTubePostElement`)?(s(),f(g,{key:7,data:e.element},null,8,[`data`])):e.element.toString().includes(`VimeoPostElement`)?(s(),f(_,{key:8,data:e.element},null,8,[`data`])):e.element.toString().includes(`TwitterPostElement`)?(s(),f(v,{key:9,url:e.element.url},null,8,[`url`])):e.element.toString().includes(`CodeElement`)?(s(),f(b,{key:10,html:e.element.code},null,8,[`html`])):e.element.toString().includes(`SpotifyPlaylistElement`)?(s(),f(x,{key:11,data:e.element},null,8,[`data`])):e.element.toString().includes(`CoordinatesElement`)?(s(),f(S,{key:12,latitude:`${(r=e.element)==null?void 0:r.latitude}`,longitude:`${(i=e.element)==null?void 0:i.longitude}`},null,8,[`latitude`,`longitude`])):e.element.toString().includes(`SoundCloudPost`)?(s(),f(C,{key:13,data:e.element},null,8,[`data`])):(s(),y(ge,{key:14},[],64))}}};export{At as a,vt as c,Ve as d,He as f,It as i,gt as l,mn as n,bt as o,Me as p,Rt as r,xt as s,A_ as t,pt as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.