@convergeapp/chat-widget 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/widget.js +150 -20
- package/package.json +2 -1
package/dist/widget.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var o=document.createElement("style");o.appendChild(document.createTextNode(':root,:host{--ol-background-color: white;--ol-accent-background-color: #F5F5F5;--ol-subtle-background-color: rgba(128, 128, 128, .25);--ol-partial-background-color: rgba(255, 255, 255, .75);--ol-foreground-color: #333333;--ol-subtle-foreground-color: #666666;--ol-brand-color: #00AAFF}.ol-box{box-sizing:border-box;border-radius:2px;border:1.5px solid var(--ol-background-color);background-color:var(--ol-partial-background-color)}.ol-mouse-position{top:8px;right:8px;position:absolute}.ol-scale-line{background:var(--ol-partial-background-color);border-radius:4px;bottom:8px;left:8px;padding:2px;position:absolute}.ol-scale-line-inner{border:1px solid var(--ol-subtle-foreground-color);border-top:none;color:var(--ol-foreground-color);font-size:10px;text-align:center;margin:1px;will-change:contents,width;transition:all .25s}.ol-scale-bar{position:absolute;bottom:8px;left:8px}.ol-scale-bar-inner{display:flex}.ol-scale-step-marker{width:1px;height:15px;background-color:var(--ol-foreground-color);float:right;z-index:10}.ol-scale-step-text{position:absolute;bottom:-5px;font-size:10px;z-index:11;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-text{position:absolute;font-size:12px;text-align:center;bottom:25px;color:var(--ol-foreground-color);text-shadow:-1.5px 0 var(--ol-partial-background-color),0 1.5px var(--ol-partial-background-color),1.5px 0 var(--ol-partial-background-color),0 -1.5px var(--ol-partial-background-color)}.ol-scale-singlebar{position:relative;height:10px;z-index:9;box-sizing:border-box;border:1px solid var(--ol-foreground-color)}.ol-scale-singlebar-even{background-color:var(--ol-subtle-foreground-color)}.ol-scale-singlebar-odd{background-color:var(--ol-background-color)}.ol-unsupported{display:none}.ol-viewport,.ol-unselectable{-webkit-touch-callout:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ol-viewport canvas{all:unset;overflow:hidden}.ol-viewport{touch-action:pan-x pan-y}.ol-selectable{-webkit-touch-callout:default;-webkit-user-select:text;-moz-user-select:text;user-select:text}.ol-grabbing{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.ol-grab{cursor:move;cursor:-webkit-grab;cursor:-moz-grab;cursor:grab}.ol-control{position:absolute;background-color:var(--ol-subtle-background-color);border-radius:4px}.ol-zoom{top:.5em;left:.5em}.ol-rotate{top:.5em;right:.5em;transition:opacity .25s linear,visibility 0s linear}.ol-rotate.ol-hidden{opacity:0;visibility:hidden;transition:opacity .25s linear,visibility 0s linear .25s}.ol-zoom-extent{top:4.643em;left:.5em}.ol-full-screen{right:.5em;top:.5em}.ol-control button{display:block;margin:1px;padding:0;color:var(--ol-subtle-foreground-color);font-weight:700;text-decoration:none;font-size:inherit;text-align:center;height:1.375em;width:1.375em;line-height:.4em;background-color:var(--ol-background-color);border:none;border-radius:2px}.ol-control button::-moz-focus-inner{border:none;padding:0}.ol-zoom-extent button{line-height:1.4em}.ol-compass{display:block;font-weight:400;will-change:transform}.ol-touch .ol-control button{font-size:1.5em}.ol-touch .ol-zoom-extent{top:5.5em}.ol-control button:hover,.ol-control button:focus{text-decoration:none;outline:1px solid var(--ol-subtle-foreground-color);color:var(--ol-foreground-color)}.ol-zoom .ol-zoom-in{border-radius:2px 2px 0 0}.ol-zoom .ol-zoom-out{border-radius:0 0 2px 2px}.ol-attribution{text-align:right;bottom:.5em;right:.5em;max-width:calc(100% - 1.3em);display:flex;flex-flow:row-reverse;align-items:center}.ol-attribution a{color:var(--ol-subtle-foreground-color);text-decoration:none}.ol-attribution ul{margin:0;padding:1px .5em;color:var(--ol-foreground-color);text-shadow:0 0 2px var(--ol-background-color);font-size:12px}.ol-attribution li{display:inline;list-style:none}.ol-attribution li:not(:last-child):after{content:" "}.ol-attribution img{max-height:2em;max-width:inherit;vertical-align:middle}.ol-attribution button{flex-shrink:0}.ol-attribution.ol-collapsed ul{display:none}.ol-attribution:not(.ol-collapsed){background:var(--ol-partial-background-color)}.ol-attribution.ol-uncollapsible{bottom:0;right:0;border-radius:4px 0 0}.ol-attribution.ol-uncollapsible img{margin-top:-.2em;max-height:1.6em}.ol-attribution.ol-uncollapsible button{display:none}.ol-zoomslider{top:4.5em;left:.5em;height:200px}.ol-zoomslider button{position:relative;height:10px}.ol-touch .ol-zoomslider{top:5.5em}.ol-overviewmap{left:.5em;bottom:.5em}.ol-overviewmap.ol-uncollapsible{bottom:0;left:0;border-radius:0 4px 0 0}.ol-overviewmap .ol-overviewmap-map,.ol-overviewmap button{display:block}.ol-overviewmap .ol-overviewmap-map{border:1px solid var(--ol-subtle-foreground-color);height:150px;width:150px}.ol-overviewmap:not(.ol-collapsed) button{bottom:0;left:0;position:absolute}.ol-overviewmap.ol-collapsed .ol-overviewmap-map,.ol-overviewmap.ol-uncollapsible button{display:none}.ol-overviewmap:not(.ol-collapsed){background:var(--ol-subtle-background-color)}.ol-overviewmap-box{border:1.5px dotted var(--ol-subtle-foreground-color)}.ol-overviewmap .ol-overviewmap-box:hover{cursor:move}.ol-overviewmap .ol-viewport:hover{cursor:pointer}')),document.head.appendChild(o)}}catch(l){console.error("vite-plugin-css-injected-by-js",l)}})();
|
|
2
|
-
(function(){"use strict";var Li,Y,So,Ne,bo,Ro,To,Io,As,ks,Os,Mo,Un={},Lo=[],jh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xn=Array.isArray;function ae(i,t){for(var e in t)i[e]=t[e];return i}function Ps(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function g(i,t,e){var n,s,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?s=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?Li.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)o[r]===void 0&&(o[r]=i.defaultProps[r]);return Ai(i,o,n,s,null)}function Ai(i,t,e,n,s){var r={type:i,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++So,__i:-1,__u:0};return s==null&&Y.vnode!=null&&Y.vnode(r),r}function on(i){return i.children}function le(i,t){this.props=i,this.context=t}function an(i,t){if(t==null)return i.__?an(i.__,i.__i+1):null;for(var e;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null)return e.__e;return typeof i.type=="function"?an(i):null}function Ao(i){var t,e;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,t=0;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null){i.__e=i.__c.base=e.__e;break}return Ao(i)}}function Ds(i){(!i.__d&&(i.__d=!0)&&Ne.push(i)&&!ki.__r++||bo!=Y.debounceRendering)&&((bo=Y.debounceRendering)||Ro)(ki)}function ki(){for(var i,t,e,n,s,r,o,a=1;Ne.length;)Ne.length>a&&Ne.sort(To),i=Ne.shift(),a=Ne.length,i.__d&&(e=void 0,n=void 0,s=(n=(t=i).__v).__e,r=[],o=[],t.__P&&((e=ae({},n)).__v=n.__v+1,Y.vnode&&Y.vnode(e),Fs(t.__P,e,n,t.__n,t.__P.namespaceURI,32&n.__u?[s]:null,r,s??an(n),!!(32&n.__u),o),e.__v=n.__v,e.__.__k[e.__i]=e,Fo(r,e,o),n.__e=n.__=null,e.__e!=s&&Ao(e)));ki.__r=0}function ko(i,t,e,n,s,r,o,a,l,h,c){var u,d,f,_,p,m,y,x=n&&n.__k||Lo,v=t.length;for(l=Hh(e,t,x,l,v),u=0;u<v;u++)(f=e.__k[u])!=null&&(d=f.__i==-1?Un:x[f.__i]||Un,f.__i=u,m=Fs(i,f,d,s,r,o,a,l,h,c),_=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Ns(d.ref,null,f),c.push(f.ref,f.__c||_,f)),p==null&&_!=null&&(p=_),(y=!!(4&f.__u))||d.__k===f.__k?l=Oo(f,l,i,y):typeof f.type=="function"&&m!==void 0?l=m:_&&(l=_.nextSibling),f.__u&=-7);return e.__e=p,l}function Hh(i,t,e,n,s){var r,o,a,l,h,c=e.length,u=c,d=0;for(i.__k=new Array(s),r=0;r<s;r++)(o=t[r])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=r+d,(o=i.__k[r]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ai(null,o,null,null,null):Xn(o)?Ai(on,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ai(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=i,o.__b=i.__b+1,a=null,(h=o.__i=$h(o,e,l,u))!=-1&&(u--,(a=e[h])&&(a.__u|=2)),a==null||a.__v==null?(h==-1&&(s>c?d--:s<c&&d++),typeof o.type!="function"&&(o.__u|=4)):h!=l&&(h==l-1?d--:h==l+1?d++:(h>l?d--:d++,o.__u|=4))):i.__k[r]=null;if(u)for(r=0;r<c;r++)(a=e[r])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=an(a)),No(a,a));return n}function Oo(i,t,e,n){var s,r;if(typeof i.type=="function"){for(s=i.__k,r=0;s&&r<s.length;r++)s[r]&&(s[r].__=i,t=Oo(s[r],t,e,n));return t}i.__e!=t&&(n&&(t&&i.type&&!t.parentNode&&(t=an(i)),e.insertBefore(i.__e,t||null)),t=i.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Oi(i,t){return t=t||[],i==null||typeof i=="boolean"||(Xn(i)?i.some(function(e){Oi(e,t)}):t.push(i)),t}function $h(i,t,e,n){var s,r,o,a=i.key,l=i.type,h=t[e],c=h!=null&&(2&h.__u)==0;if(h===null&&i.key==null||c&&a==h.key&&l==h.type)return e;if(n>(c?1:0)){for(s=e-1,r=e+1;s>=0||r<t.length;)if((h=t[o=s>=0?s--:r++])!=null&&(2&h.__u)==0&&a==h.key&&l==h.type)return o}return-1}function Po(i,t,e){t[0]=="-"?i.setProperty(t,e??""):i[t]=e==null?"":typeof e!="number"||jh.test(t)?e:e+"px"}function Pi(i,t,e,n,s){var r,o;t:if(t=="style")if(typeof e=="string")i.style.cssText=e;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(t in n)e&&t in e||Po(i.style,t,"");if(e)for(t in e)n&&e[t]==n[t]||Po(i.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Io,"$1")),o=t.toLowerCase(),t=o in i||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),i.l||(i.l={}),i.l[t+r]=e,e?n?e.u=n.u:(e.u=As,i.addEventListener(t,r?Os:ks,r)):i.removeEventListener(t,r?Os:ks,r);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in i)try{i[t]=e??"";break t}catch{}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?i.removeAttribute(t):i.setAttribute(t,t=="popover"&&e==1?"":e))}}function Do(i){return function(t){if(this.l){var e=this.l[t.type+i];if(t.t==null)t.t=As++;else if(t.t<e.u)return;return e(Y.event?Y.event(t):t)}}}function Fs(i,t,e,n,s,r,o,a,l,h){var c,u,d,f,_,p,m,y,x,v,w,C,T,b,R,I,L,k=t.type;if(t.constructor!=null)return null;128&e.__u&&(l=!!(32&e.__u),r=[a=t.__e=e.__e]),(c=Y.__b)&&c(t);t:if(typeof k=="function")try{if(y=t.props,x="prototype"in k&&k.prototype.render,v=(c=k.contextType)&&n[c.__c],w=c?v?v.props.value:c.__:n,e.__c?m=(u=t.__c=e.__c).__=u.__E:(x?t.__c=u=new k(y,w):(t.__c=u=new le(y,w),u.constructor=k,u.render=Jh),v&&v.sub(u),u.props=y,u.state||(u.state={}),u.context=w,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),x&&u.__s==null&&(u.__s=u.state),x&&k.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=ae({},u.__s)),ae(u.__s,k.getDerivedStateFromProps(y,u.__s))),f=u.props,_=u.state,u.__v=t,d)x&&k.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),x&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(x&&k.getDerivedStateFromProps==null&&y!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(y,w),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(y,u.__s,w)===!1||t.__v==e.__v){for(t.__v!=e.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(A){A&&(A.__=t)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&o.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(y,u.__s,w),x&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,_,p)})}if(u.context=w,u.props=y,u.__P=i,u.__e=!1,T=Y.__r,b=0,x){for(u.state=u.__s,u.__d=!1,T&&T(t),c=u.render(u.props,u.state,u.context),R=0;R<u._sb.length;R++)u.__h.push(u._sb[R]);u._sb=[]}else do u.__d=!1,T&&T(t),c=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++b<25);u.state=u.__s,u.getChildContext!=null&&(n=ae(ae({},n),u.getChildContext())),x&&!d&&u.getSnapshotBeforeUpdate!=null&&(p=u.getSnapshotBeforeUpdate(f,_)),I=c,c!=null&&c.type===on&&c.key==null&&(I=zo(c.props.children)),a=ko(i,Xn(I)?I:[I],t,e,n,s,r,o,a,l,h),u.base=t.__e,t.__u&=-161,u.__h.length&&o.push(u),m&&(u.__E=u.__=null)}catch(A){if(t.__v=null,l||r!=null)if(A.then){for(t.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,t.__e=a}else{for(L=r.length;L--;)Ps(r[L]);zs(t)}else t.__e=e.__e,t.__k=e.__k,A.then||zs(t);Y.__e(A,t,e)}else r==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):a=t.__e=qh(e.__e,t,e,n,s,r,o,l,h);return(c=Y.diffed)&&c(t),128&t.__u?void 0:a}function zs(i){i&&i.__c&&(i.__c.__e=!0),i&&i.__k&&i.__k.forEach(zs)}function Fo(i,t,e){for(var n=0;n<e.length;n++)Ns(e[n],e[++n],e[++n]);Y.__c&&Y.__c(t,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(r){r.call(s)})}catch(r){Y.__e(r,s.__v)}})}function zo(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:Xn(i)?i.map(zo):ae({},i)}function qh(i,t,e,n,s,r,o,a,l){var h,c,u,d,f,_,p,m=e.props,y=t.props,x=t.type;if(x=="svg"?s="http://www.w3.org/2000/svg":x=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),r!=null){for(h=0;h<r.length;h++)if((f=r[h])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){i=f,r[h]=null;break}}if(i==null){if(x==null)return document.createTextNode(y);i=document.createElementNS(s,x,y.is&&y),a&&(Y.__m&&Y.__m(t,r),a=!1),r=null}if(x==null)m===y||a&&i.data==y||(i.data=y);else{if(r=r&&Li.call(i.childNodes),m=e.props||Un,!a&&r!=null)for(m={},h=0;h<i.attributes.length;h++)m[(f=i.attributes[h]).name]=f.value;for(h in m)if(f=m[h],h!="children"){if(h=="dangerouslySetInnerHTML")u=f;else if(!(h in y)){if(h=="value"&&"defaultValue"in y||h=="checked"&&"defaultChecked"in y)continue;Pi(i,h,null,f,s)}}for(h in y)f=y[h],h=="children"?d=f:h=="dangerouslySetInnerHTML"?c=f:h=="value"?_=f:h=="checked"?p=f:a&&typeof f!="function"||m[h]===f||Pi(i,h,f,m[h],s);if(c)a||u&&(c.__html==u.__html||c.__html==i.innerHTML)||(i.innerHTML=c.__html),t.__k=[];else if(u&&(i.innerHTML=""),ko(t.type=="template"?i.content:i,Xn(d)?d:[d],t,e,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":s,r,o,r?r[0]:e.__k&&an(e,0),a,l),r!=null)for(h=r.length;h--;)Ps(r[h]);a||(h="value",x=="progress"&&_==null?i.removeAttribute("value"):_!=null&&(_!==i[h]||x=="progress"&&!_||x=="option"&&_!=m[h])&&Pi(i,h,_,m[h],s),h="checked",p!=null&&p!=i[h]&&Pi(i,h,p,m[h],s))}return i}function Ns(i,t,e){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&t==null||(i.__u=i(t))}else i.current=t}catch(s){Y.__e(s,e)}}function No(i,t,e){var n,s;if(Y.unmount&&Y.unmount(i),(n=i.ref)&&(n.current&&n.current!=i.__e||Ns(n,null,t)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){Y.__e(r,t)}n.base=n.__P=null}if(n=i.__k)for(s=0;s<n.length;s++)n[s]&&No(n[s],t,e||typeof i.type!="function");e||Ps(i.__e),i.__c=i.__=i.__e=void 0}function Jh(i,t,e){return this.constructor(i,e)}function Qh(i,t,e){var n,s,r,o;t==document&&(t=document.documentElement),Y.__&&Y.__(i,t),s=(n=!1)?null:t.__k,r=[],o=[],Fs(t,i=t.__k=g(on,null,[i]),s||Un,Un,t.namespaceURI,s?null:t.firstChild?Li.call(t.childNodes):null,r,s?s.__e:t.firstChild,n,o),Fo(r,i,o)}function tc(i){function t(e){var n,s;return this.getChildContext||(n=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(r){this.props.value!=r.value&&n.forEach(function(o){o.__e=!0,Ds(o)})},this.sub=function(r){n.add(r);var o=r.componentWillUnmount;r.componentWillUnmount=function(){n&&n.delete(r),o&&o.call(r)}}),e.children}return t.__c="__cC"+Mo++,t.__=i,t.Provider=t.__l=(t.Consumer=function(e,n){return e.children(n)}).contextType=t,t}Li=Lo.slice,Y={__e:function(i,t,e,n){for(var s,r,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((r=s.constructor)&&r.getDerivedStateFromError!=null&&(s.setState(r.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,n||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},So=0,le.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ae({},this.state),typeof i=="function"&&(i=i(ae({},e),this.props)),i&&ae(e,i),i!=null&&this.__v&&(t&&this._sb.push(t),Ds(this))},le.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Ds(this))},le.prototype.render=on,Ne=[],Ro=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,To=function(i,t){return i.__v.__b-t.__v.__b},ki.__r=0,Io=/(PointerCapture)$|Capture$/i,As=0,ks=Do(!1),Os=Do(!0),Mo=0;var ec=0;function E(i,t,e,n,s,r){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)a=="ref"?o=t[a]:l[a]=t[a];var h={type:i,props:l,key:e,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ec,__i:-1,__u:0,__source:s,__self:r};if(typeof i=="function"&&(o=i.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return Y.vnode&&Y.vnode(h),h}var Ge,ot,Gs,Go,Bn=0,Wo=[],dt=Y,Uo=dt.__b,Xo=dt.__r,Bo=dt.diffed,Yo=dt.__c,Vo=dt.unmount,Ko=dt.__;function Yn(i,t){dt.__h&&dt.__h(ot,i,Bn||t),Bn=0;var e=ot.__H||(ot.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function Mt(i){return Bn=1,Zo($o,i)}function Zo(i,t,e){var n=Yn(Ge++,2);if(n.t=i,!n.__c&&(n.__=[e?e(t):$o(void 0,t),function(a){var l=n.__N?n.__N[0]:n.__[0],h=n.t(l,a);l!==h&&(n.__N=[h,n.__[1]],n.__c.setState({}))}],n.__c=ot,!ot.__f)){var s=function(a,l,h){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(d){return!!d.__c});if(c.every(function(d){return!d.__N}))return!r||r.call(this,a,l,h);var u=n.__c.props!==a;return c.forEach(function(d){if(d.__N){var f=d.__[0];d.__=d.__N,d.__N=void 0,f!==d.__[0]&&(u=!0)}}),r&&r.call(this,a,l,h)||u};ot.__f=!0;var r=ot.shouldComponentUpdate,o=ot.componentWillUpdate;ot.componentWillUpdate=function(a,l,h){if(this.__e){var c=r;r=void 0,s(a,l,h),r=c}o&&o.call(this,a,l,h)},ot.shouldComponentUpdate=s}return n.__N||n.__}function he(i,t){var e=Yn(Ge++,3);!dt.__s&&Us(e.__H,t)&&(e.__=i,e.u=t,ot.__H.__h.push(e))}function nc(i,t){var e=Yn(Ge++,4);!dt.__s&&Us(e.__H,t)&&(e.__=i,e.u=t,ot.__h.push(e))}function We(i){return Bn=5,jo(function(){return{current:i}},[])}function jo(i,t){var e=Yn(Ge++,7);return Us(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function Lt(i,t){return Bn=8,jo(function(){return i},t)}function ic(i){var t=ot.context[i.__c],e=Yn(Ge++,9);return e.c=i,t?(e.__==null&&(e.__=!0,t.sub(ot)),t.props.value):i.__}function sc(){for(var i;i=Wo.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Di),i.__H.__h.forEach(Ws),i.__H.__h=[]}catch(t){i.__H.__h=[],dt.__e(t,i.__v)}}dt.__b=function(i){ot=null,Uo&&Uo(i)},dt.__=function(i,t){i&&t.__k&&t.__k.__m&&(i.__m=t.__k.__m),Ko&&Ko(i,t)},dt.__r=function(i){Xo&&Xo(i),Ge=0;var t=(ot=i.__c).__H;t&&(Gs===ot?(t.__h=[],ot.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Di),t.__h.forEach(Ws),t.__h=[],Ge=0)),Gs=ot},dt.diffed=function(i){Bo&&Bo(i);var t=i.__c;t&&t.__H&&(t.__H.__h.length&&(Wo.push(t)!==1&&Go===dt.requestAnimationFrame||((Go=dt.requestAnimationFrame)||rc)(sc)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Gs=ot=null},dt.__c=function(i,t){t.some(function(e){try{e.__h.forEach(Di),e.__h=e.__h.filter(function(n){return!n.__||Ws(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],dt.__e(n,e.__v)}}),Yo&&Yo(i,t)},dt.unmount=function(i){Vo&&Vo(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Di(n)}catch(s){t=s}}),e.__H=void 0,t&&dt.__e(t,e.__v))};var Ho=typeof requestAnimationFrame=="function";function rc(i){var t,e=function(){clearTimeout(n),Ho&&cancelAnimationFrame(t),setTimeout(i)},n=setTimeout(e,35);Ho&&(t=requestAnimationFrame(e))}function Di(i){var t=ot,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),ot=t}function Ws(i){var t=ot;i.__c=i.__(),ot=t}function Us(i,t){return!i||i.length!==t.length||t.some(function(e,n){return e!==i[n]})}function $o(i,t){return typeof t=="function"?t(i):t}const Xs="converge_widget_",ln={get(i,t){try{const e=localStorage.getItem(Xs+i);return e?JSON.parse(e):t}catch{return t}},set(i,t){try{localStorage.setItem(Xs+i,JSON.stringify(t))}catch(e){console.error("Failed to save to localStorage:",e)}},remove(i){try{localStorage.removeItem(Xs+i)}catch(t){console.error("Failed to remove from localStorage:",t)}}};function oc(i){const t={id:i.id,isSupport:i.from==="agent",timestamp:i.timestamp},e=i.messageType||"text";if(e==="location")try{const n=JSON.parse(i.content);return{...t,type:"location",latitude:n.latitude,longitude:n.longitude,name:n.name,address:n.address}}catch{return{...t,type:"text",content:i.content}}return e==="photo"?{...t,type:"photo",url:i.contentUrl||"",filename:i.fileName||void 0,size:i.fileSize||void 0,content:i.content}:e==="video"?{...t,type:"video",url:i.contentUrl||"",filename:i.fileName||void 0,size:i.fileSize||void 0,content:i.content}:e==="file"?{...t,type:"file",url:i.contentUrl||"",filename:i.fileName||"file",size:i.fileSize||void 0,mimeType:i.mimeType||void 0}:{...t,type:"text",content:i.content}}const qo=tc(null);function ac({children:i,config:t}){const[e,n]=Mt(!1),[s,r]=Mt(!0),[o,a]=Mt(""),[l,h]=Mt(ln.get("token","")),[c,u]=Mt(ln.get("name","")),[d,f]=Mt(ln.get("customer_id","")),[_,p]=Mt([]),[m,y]=Mt(!1),[x,v]=Mt(!1),[w,C]=Mt([]),[T,b]=Mt(null),[R,I]=Mt(!0),L=We(),k=We(void 0),A=We();he(()=>{ln.set("token",l)},[l]),he(()=>{ln.set("name",c)},[c]),he(()=>{ln.set("customer_id",d)},[d]);const O=Lt(async()=>{if(l)try{const G=k.current?`${t.apiUrl}/messages?since=${encodeURIComponent(k.current)}`:`${t.apiUrl}/messages`,it=await fetch(G,{headers:{Authorization:`Bearer ${l}`}});if(!it.ok)throw new Error("Failed to poll messages");const B=await it.json();if(B.messages&&B.messages.length>0){const ft=B.messages.map(oc);C(Yt=>[...Yt,...ft]),k.current=ft[ft.length-1].timestamp}}catch(G){console.error("Failed to poll messages:",G)}finally{L.current=setTimeout(O,1e3)}},[l,t.apiUrl]),P=Lt(()=>{L.current||!l||O()},[l,O]),U=Lt(async()=>{try{const G=await fetch(`${t.apiUrl}/platforms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.apiKey})});if(!G.ok)throw new Error("Failed to fetch platforms");const it=await G.json();p(it.platforms||[]),b(null)}catch(G){console.error("Failed to fetch platforms:",G),b("Unable to connect. Please try again later."),p([])}},[t.apiUrl,t.apiKey]);he(()=>((async()=>{l&&c?(r(!1),P()):await U()})(),()=>{L.current&&clearTimeout(L.current),A.current&&clearTimeout(A.current)}),[l,c,P,U]);const N=Lt(async(G,it)=>{if(!G.trim())return;const B=d||`widget_${Date.now()}_${Math.random().toString(36).substring(2,15)}`;try{const ft=await fetch(`${t.apiUrl}/init`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.apiKey,customerId:B,customerName:G,customerEmail:it||void 0})});if(!ft.ok)throw new Error("Failed to initialize");const Yt=await ft.json();h(Yt.token),f(B),u(G),r(!1),P()}catch(ft){console.error("Widget initialization failed:",ft)}},[d,t.apiUrl,t.apiKey,P]),X=Lt(G=>{G.type==="converge"?r(!1):G.link&&(window.open(G.link,"_blank"),n(!1))},[l,c]),F=Lt(()=>{r(!0)},[]),Z=Lt(async()=>{if(!o.trim()||!l||m)return;const G=o.trim();a(""),y(!0);try{const it={type:"text",content:G};if(!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(it)})).ok)throw new Error("Failed to send message")}catch(it){console.error("Failed to send message:",it),a(G)}finally{y(!1)}},[o,l,m,t.apiUrl]),H=Lt(async(G,it)=>{if(!(!l||m)){y(!0),v(!1);try{const B=new FormData;if(B.append("file",it),B.append("messageData",JSON.stringify(G)),!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{Authorization:`Bearer ${l}`},body:B})).ok)throw new Error("Failed to send attachment")}catch(B){console.error("Failed to send attachment:",B)}finally{y(!1)}}},[l,m,t.apiUrl]),nt=Lt(()=>{const G=document.createElement("input");G.type="file",G.accept="image/*,video/*",G.onchange=async it=>{const B=it.target.files?.[0];if(!B)return;const ft=10*1024*1024;if(B.size>ft){alert("File size must be less than 10MB");return}const en=B.type.startsWith("video/")?{type:"video",filename:B.name,size:B.size}:{type:"photo",filename:B.name,size:B.size};await H(en,B)},G.click()},[H]),M=Lt(()=>{const G=document.createElement("input");G.type="file",G.accept=".pdf,.doc,.docx,.xls,.xlsx,.txt,.zip,.rar",G.onchange=async it=>{const B=it.target.files?.[0];if(!B)return;const ft=10*1024*1024;if(B.size>ft){alert("File size must be less than 10MB");return}const Yt={type:"file",filename:B.name,size:B.size,mimeType:B.type};await H(Yt,B)},G.click()},[H]),yt=Lt(async()=>{if(v(!1),!navigator.geolocation){console.error("Geolocation is not supported");return}if(!m){y(!0);try{const G=await new Promise((ft,Yt)=>{navigator.geolocation.getCurrentPosition(ft,Yt)}),it={type:"location",latitude:G.coords.latitude,longitude:G.coords.longitude};if(!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(it)})).ok)throw new Error("Failed to send location")}catch(G){console.error("Failed to send location:",G)}finally{y(!1)}}},[m,l,t.apiUrl]),Ct=Lt(()=>{n(G=>!G)},[]),ht=Lt(()=>{v(G=>!G)},[]),Tt=Lt(()=>{R&&(I(!1),U(),A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{I(!0)},1e4))},[R,U]),xt={config:t,isOpen:e,onMainMenu:s,inputMessage:o,customerName:c,availablePlatforms:_,isSending:m,showAttachmentMenu:x,messages:w,platformError:T,canRetryPlatforms:R,setInputMessage:a,toggleChat:Ct,toggleAttachmentMenu:ht,selectPlatform:X,goBackToMainMenu:F,startChat:N,sendMessage:Z,handleGalleryUpload:nt,handleFileUpload:M,handleLocationShare:yt,retryFetchPlatforms:Tt};return E(qo.Provider,{value:xt,children:i})}function lc(){const i=ic(qo);if(!i)throw new Error("useWidget must be used within WidgetProvider");return i}function hn(i,t,e){let n=e.initialDeps??[],s;function r(){var o,a,l,h;let c;e.key&&((o=e.debug)!=null&&o.call(e))&&(c=Date.now());const u=i();if(!(u.length!==n.length||u.some((_,p)=>n[p]!==_)))return s;n=u;let f;if(e.key&&((a=e.debug)!=null&&a.call(e))&&(f=Date.now()),s=t(...u),e.key&&((l=e.debug)!=null&&l.call(e))){const _=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-f)*100)/100,m=p/16,y=(x,v)=>{for(x=String(x);x.length<v;)x=" "+x;return x};console.info(`%c⏱ ${y(p,5)} /${y(_,5)} ms`,`
|
|
2
|
+
(function(){"use strict";var Li,B,Ro,Ue,To,Io,Mo,Lo,ks,Os,Ps,Ao,Un={},ko=[],$h=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Xn=Array.isArray;function he(i,t){for(var e in t)i[e]=t[e];return i}function Ds(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function g(i,t,e){var n,s,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?s=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?Li.call(arguments,2):e),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)o[r]===void 0&&(o[r]=i.defaultProps[r]);return Ai(i,o,n,s,null)}function Ai(i,t,e,n,s){var r={type:i,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:s??++Ro,__i:-1,__u:0};return s==null&&B.vnode!=null&&B.vnode(r),r}function Xe(i){return i.children}function ce(i,t){this.props=i,this.context=t}function ln(i,t){if(t==null)return i.__?ln(i.__,i.__i+1):null;for(var e;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null)return e.__e;return typeof i.type=="function"?ln(i):null}function Oo(i){var t,e;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,t=0;t<i.__k.length;t++)if((e=i.__k[t])!=null&&e.__e!=null){i.__e=i.__c.base=e.__e;break}return Oo(i)}}function Fs(i){(!i.__d&&(i.__d=!0)&&Ue.push(i)&&!ki.__r++||To!=B.debounceRendering)&&((To=B.debounceRendering)||Io)(ki)}function ki(){for(var i,t,e,n,s,r,o,a=1;Ue.length;)Ue.length>a&&Ue.sort(Mo),i=Ue.shift(),a=Ue.length,i.__d&&(e=void 0,n=void 0,s=(n=(t=i).__v).__e,r=[],o=[],t.__P&&((e=he({},n)).__v=n.__v+1,B.vnode&&B.vnode(e),zs(t.__P,e,n,t.__n,t.__P.namespaceURI,32&n.__u?[s]:null,r,s??ln(n),!!(32&n.__u),o),e.__v=n.__v,e.__.__k[e.__i]=e,No(r,e,o),n.__e=n.__=null,e.__e!=s&&Oo(e)));ki.__r=0}function Po(i,t,e,n,s,r,o,a,l,h,c){var u,d,f,_,p,m,y,x=n&&n.__k||ko,v=t.length;for(l=qh(e,t,x,l,v),u=0;u<v;u++)(f=e.__k[u])!=null&&(d=f.__i==-1?Un:x[f.__i]||Un,f.__i=u,m=zs(i,f,d,s,r,o,a,l,h,c),_=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Gs(d.ref,null,f),c.push(f.ref,f.__c||_,f)),p==null&&_!=null&&(p=_),(y=!!(4&f.__u))||d.__k===f.__k?l=Do(f,l,i,y):typeof f.type=="function"&&m!==void 0?l=m:_&&(l=_.nextSibling),f.__u&=-7);return e.__e=p,l}function qh(i,t,e,n,s){var r,o,a,l,h,c=e.length,u=c,d=0;for(i.__k=new Array(s),r=0;r<s;r++)(o=t[r])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=r+d,(o=i.__k[r]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ai(null,o,null,null,null):Xn(o)?Ai(Xe,{children:o},null,null,null):o.constructor==null&&o.__b>0?Ai(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=i,o.__b=i.__b+1,a=null,(h=o.__i=Jh(o,e,l,u))!=-1&&(u--,(a=e[h])&&(a.__u|=2)),a==null||a.__v==null?(h==-1&&(s>c?d--:s<c&&d++),typeof o.type!="function"&&(o.__u|=4)):h!=l&&(h==l-1?d--:h==l+1?d++:(h>l?d--:d++,o.__u|=4))):i.__k[r]=null;if(u)for(r=0;r<c;r++)(a=e[r])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=ln(a)),Wo(a,a));return n}function Do(i,t,e,n){var s,r;if(typeof i.type=="function"){for(s=i.__k,r=0;s&&r<s.length;r++)s[r]&&(s[r].__=i,t=Do(s[r],t,e,n));return t}i.__e!=t&&(n&&(t&&i.type&&!t.parentNode&&(t=ln(i)),e.insertBefore(i.__e,t||null)),t=i.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Oi(i,t){return t=t||[],i==null||typeof i=="boolean"||(Xn(i)?i.some(function(e){Oi(e,t)}):t.push(i)),t}function Jh(i,t,e,n){var s,r,o,a=i.key,l=i.type,h=t[e],c=h!=null&&(2&h.__u)==0;if(h===null&&i.key==null||c&&a==h.key&&l==h.type)return e;if(n>(c?1:0)){for(s=e-1,r=e+1;s>=0||r<t.length;)if((h=t[o=s>=0?s--:r++])!=null&&(2&h.__u)==0&&a==h.key&&l==h.type)return o}return-1}function Fo(i,t,e){t[0]=="-"?i.setProperty(t,e??""):i[t]=e==null?"":typeof e!="number"||$h.test(t)?e:e+"px"}function Pi(i,t,e,n,s){var r,o;t:if(t=="style")if(typeof e=="string")i.style.cssText=e;else{if(typeof n=="string"&&(i.style.cssText=n=""),n)for(t in n)e&&t in e||Fo(i.style,t,"");if(e)for(t in e)n&&e[t]==n[t]||Fo(i.style,t,e[t])}else if(t[0]=="o"&&t[1]=="n")r=t!=(t=t.replace(Lo,"$1")),o=t.toLowerCase(),t=o in i||t=="onFocusOut"||t=="onFocusIn"?o.slice(2):t.slice(2),i.l||(i.l={}),i.l[t+r]=e,e?n?e.u=n.u:(e.u=ks,i.addEventListener(t,r?Ps:Os,r)):i.removeEventListener(t,r?Ps:Os,r);else{if(s=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in i)try{i[t]=e??"";break t}catch{}typeof e=="function"||(e==null||e===!1&&t[4]!="-"?i.removeAttribute(t):i.setAttribute(t,t=="popover"&&e==1?"":e))}}function zo(i){return function(t){if(this.l){var e=this.l[t.type+i];if(t.t==null)t.t=ks++;else if(t.t<e.u)return;return e(B.event?B.event(t):t)}}}function zs(i,t,e,n,s,r,o,a,l,h){var c,u,d,f,_,p,m,y,x,v,E,C,R,I,T,S,L,O=t.type;if(t.constructor!=null)return null;128&e.__u&&(l=!!(32&e.__u),r=[a=t.__e=e.__e]),(c=B.__b)&&c(t);t:if(typeof O=="function")try{if(y=t.props,x="prototype"in O&&O.prototype.render,v=(c=O.contextType)&&n[c.__c],E=c?v?v.props.value:c.__:n,e.__c?m=(u=t.__c=e.__c).__=u.__E:(x?t.__c=u=new O(y,E):(t.__c=u=new ce(y,E),u.constructor=O,u.render=tc),v&&v.sub(u),u.props=y,u.state||(u.state={}),u.context=E,u.__n=n,d=u.__d=!0,u.__h=[],u._sb=[]),x&&u.__s==null&&(u.__s=u.state),x&&O.getDerivedStateFromProps!=null&&(u.__s==u.state&&(u.__s=he({},u.__s)),he(u.__s,O.getDerivedStateFromProps(y,u.__s))),f=u.props,_=u.state,u.__v=t,d)x&&O.getDerivedStateFromProps==null&&u.componentWillMount!=null&&u.componentWillMount(),x&&u.componentDidMount!=null&&u.__h.push(u.componentDidMount);else{if(x&&O.getDerivedStateFromProps==null&&y!==f&&u.componentWillReceiveProps!=null&&u.componentWillReceiveProps(y,E),!u.__e&&u.shouldComponentUpdate!=null&&u.shouldComponentUpdate(y,u.__s,E)===!1||t.__v==e.__v){for(t.__v!=e.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(A){A&&(A.__=t)}),C=0;C<u._sb.length;C++)u.__h.push(u._sb[C]);u._sb=[],u.__h.length&&o.push(u);break t}u.componentWillUpdate!=null&&u.componentWillUpdate(y,u.__s,E),x&&u.componentDidUpdate!=null&&u.__h.push(function(){u.componentDidUpdate(f,_,p)})}if(u.context=E,u.props=y,u.__P=i,u.__e=!1,R=B.__r,I=0,x){for(u.state=u.__s,u.__d=!1,R&&R(t),c=u.render(u.props,u.state,u.context),T=0;T<u._sb.length;T++)u.__h.push(u._sb[T]);u._sb=[]}else do u.__d=!1,R&&R(t),c=u.render(u.props,u.state,u.context),u.state=u.__s;while(u.__d&&++I<25);u.state=u.__s,u.getChildContext!=null&&(n=he(he({},n),u.getChildContext())),x&&!d&&u.getSnapshotBeforeUpdate!=null&&(p=u.getSnapshotBeforeUpdate(f,_)),S=c,c!=null&&c.type===Xe&&c.key==null&&(S=Go(c.props.children)),a=Po(i,Xn(S)?S:[S],t,e,n,s,r,o,a,l,h),u.base=t.__e,t.__u&=-161,u.__h.length&&o.push(u),m&&(u.__E=u.__=null)}catch(A){if(t.__v=null,l||r!=null)if(A.then){for(t.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,t.__e=a}else{for(L=r.length;L--;)Ds(r[L]);Ns(t)}else t.__e=e.__e,t.__k=e.__k,A.then||Ns(t);B.__e(A,t,e)}else r==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):a=t.__e=Qh(e.__e,t,e,n,s,r,o,l,h);return(c=B.diffed)&&c(t),128&t.__u?void 0:a}function Ns(i){i&&i.__c&&(i.__c.__e=!0),i&&i.__k&&i.__k.forEach(Ns)}function No(i,t,e){for(var n=0;n<e.length;n++)Gs(e[n],e[++n],e[++n]);B.__c&&B.__c(t,i),i.some(function(s){try{i=s.__h,s.__h=[],i.some(function(r){r.call(s)})}catch(r){B.__e(r,s.__v)}})}function Go(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:Xn(i)?i.map(Go):he({},i)}function Qh(i,t,e,n,s,r,o,a,l){var h,c,u,d,f,_,p,m=e.props,y=t.props,x=t.type;if(x=="svg"?s="http://www.w3.org/2000/svg":x=="math"?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),r!=null){for(h=0;h<r.length;h++)if((f=r[h])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){i=f,r[h]=null;break}}if(i==null){if(x==null)return document.createTextNode(y);i=document.createElementNS(s,x,y.is&&y),a&&(B.__m&&B.__m(t,r),a=!1),r=null}if(x==null)m===y||a&&i.data==y||(i.data=y);else{if(r=r&&Li.call(i.childNodes),m=e.props||Un,!a&&r!=null)for(m={},h=0;h<i.attributes.length;h++)m[(f=i.attributes[h]).name]=f.value;for(h in m)if(f=m[h],h!="children"){if(h=="dangerouslySetInnerHTML")u=f;else if(!(h in y)){if(h=="value"&&"defaultValue"in y||h=="checked"&&"defaultChecked"in y)continue;Pi(i,h,null,f,s)}}for(h in y)f=y[h],h=="children"?d=f:h=="dangerouslySetInnerHTML"?c=f:h=="value"?_=f:h=="checked"?p=f:a&&typeof f!="function"||m[h]===f||Pi(i,h,f,m[h],s);if(c)a||u&&(c.__html==u.__html||c.__html==i.innerHTML)||(i.innerHTML=c.__html),t.__k=[];else if(u&&(i.innerHTML=""),Po(t.type=="template"?i.content:i,Xn(d)?d:[d],t,e,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":s,r,o,r?r[0]:e.__k&&ln(e,0),a,l),r!=null)for(h=r.length;h--;)Ds(r[h]);a||(h="value",x=="progress"&&_==null?i.removeAttribute("value"):_!=null&&(_!==i[h]||x=="progress"&&!_||x=="option"&&_!=m[h])&&Pi(i,h,_,m[h],s),h="checked",p!=null&&p!=i[h]&&Pi(i,h,p,m[h],s))}return i}function Gs(i,t,e){try{if(typeof i=="function"){var n=typeof i.__u=="function";n&&i.__u(),n&&t==null||(i.__u=i(t))}else i.current=t}catch(s){B.__e(s,e)}}function Wo(i,t,e){var n,s;if(B.unmount&&B.unmount(i),(n=i.ref)&&(n.current&&n.current!=i.__e||Gs(n,null,t)),(n=i.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(r){B.__e(r,t)}n.base=n.__P=null}if(n=i.__k)for(s=0;s<n.length;s++)n[s]&&Wo(n[s],t,e||typeof i.type!="function");e||Ds(i.__e),i.__c=i.__=i.__e=void 0}function tc(i,t,e){return this.constructor(i,e)}function ec(i,t,e){var n,s,r,o;t==document&&(t=document.documentElement),B.__&&B.__(i,t),s=(n=!1)?null:t.__k,r=[],o=[],zs(t,i=t.__k=g(Xe,null,[i]),s||Un,Un,t.namespaceURI,s?null:t.firstChild?Li.call(t.childNodes):null,r,s?s.__e:t.firstChild,n,o),No(r,i,o)}function nc(i){function t(e){var n,s;return this.getChildContext||(n=new Set,(s={})[t.__c]=this,this.getChildContext=function(){return s},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(r){this.props.value!=r.value&&n.forEach(function(o){o.__e=!0,Fs(o)})},this.sub=function(r){n.add(r);var o=r.componentWillUnmount;r.componentWillUnmount=function(){n&&n.delete(r),o&&o.call(r)}}),e.children}return t.__c="__cC"+Ao++,t.__=i,t.Provider=t.__l=(t.Consumer=function(e,n){return e.children(n)}).contextType=t,t}Li=ko.slice,B={__e:function(i,t,e,n){for(var s,r,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((r=s.constructor)&&r.getDerivedStateFromError!=null&&(s.setState(r.getDerivedStateFromError(i)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,n||{}),o=s.__d),o)return s.__E=s}catch(a){i=a}throw i}},Ro=0,ce.prototype.setState=function(i,t){var e;e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=he({},this.state),typeof i=="function"&&(i=i(he({},e),this.props)),i&&he(e,i),i!=null&&this.__v&&(t&&this._sb.push(t),Fs(this))},ce.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Fs(this))},ce.prototype.render=Xe,Ue=[],Io=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Mo=function(i,t){return i.__v.__b-t.__v.__b},ki.__r=0,Lo=/(PointerCapture)$|Capture$/i,ks=0,Os=zo(!1),Ps=zo(!0),Ao=0;var ic=0;function w(i,t,e,n,s,r){t||(t={});var o,a,l=t;if("ref"in l)for(a in l={},t)a=="ref"?o=t[a]:l[a]=t[a];var h={type:i,props:l,key:e,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ic,__i:-1,__u:0,__source:s,__self:r};if(typeof i=="function"&&(o=i.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return B.vnode&&B.vnode(h),h}var Be,ot,Ws,Uo,Bn=0,Xo=[],dt=B,Bo=dt.__b,Yo=dt.__r,Vo=dt.diffed,Ko=dt.__c,Zo=dt.unmount,jo=dt.__;function Yn(i,t){dt.__h&&dt.__h(ot,i,Bn||t),Bn=0;var e=ot.__H||(ot.__H={__:[],__h:[]});return i>=e.__.length&&e.__.push({}),e.__[i]}function Tt(i){return Bn=1,Ho(Jo,i)}function Ho(i,t,e){var n=Yn(Be++,2);if(n.t=i,!n.__c&&(n.__=[e?e(t):Jo(void 0,t),function(a){var l=n.__N?n.__N[0]:n.__[0],h=n.t(l,a);l!==h&&(n.__N=[h,n.__[1]],n.__c.setState({}))}],n.__c=ot,!ot.__f)){var s=function(a,l,h){if(!n.__c.__H)return!0;var c=n.__c.__H.__.filter(function(d){return!!d.__c});if(c.every(function(d){return!d.__N}))return!r||r.call(this,a,l,h);var u=n.__c.props!==a;return c.forEach(function(d){if(d.__N){var f=d.__[0];d.__=d.__N,d.__N=void 0,f!==d.__[0]&&(u=!0)}}),r&&r.call(this,a,l,h)||u};ot.__f=!0;var r=ot.shouldComponentUpdate,o=ot.componentWillUpdate;ot.componentWillUpdate=function(a,l,h){if(this.__e){var c=r;r=void 0,s(a,l,h),r=c}o&&o.call(this,a,l,h)},ot.shouldComponentUpdate=s}return n.__N||n.__}function be(i,t){var e=Yn(Be++,3);!dt.__s&&Xs(e.__H,t)&&(e.__=i,e.u=t,ot.__H.__h.push(e))}function sc(i,t){var e=Yn(Be++,4);!dt.__s&&Xs(e.__H,t)&&(e.__=i,e.u=t,ot.__h.push(e))}function Ye(i){return Bn=5,$o(function(){return{current:i}},[])}function $o(i,t){var e=Yn(Be++,7);return Xs(e.__H,t)&&(e.__=i(),e.__H=t,e.__h=i),e.__}function kt(i,t){return Bn=8,$o(function(){return i},t)}function rc(i){var t=ot.context[i.__c],e=Yn(Be++,9);return e.c=i,t?(e.__==null&&(e.__=!0,t.sub(ot)),t.props.value):i.__}function oc(){for(var i;i=Xo.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Di),i.__H.__h.forEach(Us),i.__H.__h=[]}catch(t){i.__H.__h=[],dt.__e(t,i.__v)}}dt.__b=function(i){ot=null,Bo&&Bo(i)},dt.__=function(i,t){i&&t.__k&&t.__k.__m&&(i.__m=t.__k.__m),jo&&jo(i,t)},dt.__r=function(i){Yo&&Yo(i),Be=0;var t=(ot=i.__c).__H;t&&(Ws===ot?(t.__h=[],ot.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(Di),t.__h.forEach(Us),t.__h=[],Be=0)),Ws=ot},dt.diffed=function(i){Vo&&Vo(i);var t=i.__c;t&&t.__H&&(t.__H.__h.length&&(Xo.push(t)!==1&&Uo===dt.requestAnimationFrame||((Uo=dt.requestAnimationFrame)||ac)(oc)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),Ws=ot=null},dt.__c=function(i,t){t.some(function(e){try{e.__h.forEach(Di),e.__h=e.__h.filter(function(n){return!n.__||Us(n)})}catch(n){t.some(function(s){s.__h&&(s.__h=[])}),t=[],dt.__e(n,e.__v)}}),Ko&&Ko(i,t)},dt.unmount=function(i){Zo&&Zo(i);var t,e=i.__c;e&&e.__H&&(e.__H.__.forEach(function(n){try{Di(n)}catch(s){t=s}}),e.__H=void 0,t&&dt.__e(t,e.__v))};var qo=typeof requestAnimationFrame=="function";function ac(i){var t,e=function(){clearTimeout(n),qo&&cancelAnimationFrame(t),setTimeout(i)},n=setTimeout(e,35);qo&&(t=requestAnimationFrame(e))}function Di(i){var t=ot,e=i.__c;typeof e=="function"&&(i.__c=void 0,e()),ot=t}function Us(i){var t=ot;i.__c=i.__(),ot=t}function Xs(i,t){return!i||i.length!==t.length||t.some(function(e,n){return e!==i[n]})}function Jo(i,t){return typeof t=="function"?t(i):t}const Bs="converge_widget_",Se={get(i,t){try{const e=localStorage.getItem(Bs+i);return e?JSON.parse(e):t}catch{return t}},set(i,t){try{localStorage.setItem(Bs+i,JSON.stringify(t))}catch(e){console.error("Failed to save to localStorage:",e)}},remove(i){try{localStorage.removeItem(Bs+i)}catch(t){console.error("Failed to remove from localStorage:",t)}}};function lc(i){const t={id:i.id,isSupport:i.from==="agent",timestamp:i.timestamp},e=i.messageType||"text";if(e==="location")try{const n=JSON.parse(i.content);return{...t,type:"location",latitude:n.latitude,longitude:n.longitude,name:n.name,address:n.address}}catch{return{...t,type:"text",content:i.content}}return e==="photo"?{...t,type:"photo",url:i.contentUrl||"",filename:i.fileName||void 0,size:i.fileSize||void 0,content:i.content}:e==="video"?{...t,type:"video",url:i.contentUrl||"",filename:i.fileName||void 0,size:i.fileSize||void 0,content:i.content}:e==="file"?{...t,type:"file",url:i.contentUrl||"",filename:i.fileName||"file",size:i.fileSize||void 0,mimeType:i.mimeType||void 0}:{...t,type:"text",content:i.content}}const Qo=nc(null);function hc({children:i,config:t}){const[e,n]=Tt(!1),[s,r]=Tt(!0),[o,a]=Tt(""),[l,h]=Tt(Se.get("token","")),[c,u]=Tt(Se.get("name","")),[d,f]=Tt(Se.get("customer_id","")),[_,p]=Tt([]),[m,y]=Tt(!1),[x,v]=Tt(!1),[E,C]=Tt([]),[R,I]=Tt(null),[T,S]=Tt(!0),[L,O]=Tt(!1),A=Ye(),k=Ye(void 0),P=Ye();be(()=>{Se.set("token",l)},[l]),be(()=>{Se.set("name",c)},[c]),be(()=>{Se.set("customer_id",d)},[d]);const X=kt(async()=>{if(l)try{const F=k.current?`${t.apiUrl}/messages?since=${encodeURIComponent(k.current)}`:`${t.apiUrl}/messages`,rt=await fetch(F,{headers:{Authorization:`Bearer ${l}`}});if(!rt.ok)throw new Error("Failed to poll messages");const H=await rt.json();if(H.messages&&H.messages.length>0){const _t=H.messages.map(lc);C(mt=>[...mt,..._t]),k.current=_t[_t.length-1].timestamp}}catch(F){console.error("Failed to poll messages:",F)}finally{A.current=setTimeout(X,1e3)}},[l,t.apiUrl]),D=kt(()=>{A.current||!l||X()},[l,X]),W=kt(async()=>{try{const F=await fetch(`${t.apiUrl}/platforms`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.apiKey})});if(!F.ok)throw new Error("Failed to fetch platforms");const H=(await F.json()).platforms||[];p(H),Se.set("platforms",H),I(null),O(!1)}catch(F){console.error("Failed to fetch platforms:",F);const rt=Se.get("platforms",[]);rt.length>0?(p(rt),I("Unable to connect to server."),O(!0)):(I("Unable to connect. Please try again later."),p([]),O(!1))}},[t.apiUrl,t.apiKey]);be(()=>((async()=>{l&&c?(r(!1),D()):await W()})(),()=>{A.current&&clearTimeout(A.current),P.current&&clearTimeout(P.current)}),[l,c,D,W]);const N=kt(async(F,rt,H)=>{if(!F.trim())return;const _t=d||`widget_${Date.now()}_${Math.random().toString(36).substring(2,15)}`;try{const mt=await fetch(`${t.apiUrl}/init`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t.apiKey,customerId:_t,customerName:F,customerEmail:rt||void 0,customerPhone:H||void 0})});if(!mt.ok)throw new Error("Failed to initialize");const Rt=await mt.json();h(Rt.token),f(_t),u(F),r(!1),D()}catch(mt){console.error("Widget initialization failed:",mt)}},[d,t.apiUrl,t.apiKey,D]),K=kt(F=>{F.type==="converge"?r(!1):F.link&&(window.open(F.link,"_blank"),n(!1))},[l,c]),j=kt(()=>{r(!0),_.length===0&&W()},[_.length,W]),nt=kt(async()=>{if(!o.trim()||!l||m)return;const F=o.trim();a(""),y(!0);try{const rt={type:"text",content:F};if(!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(rt)})).ok)throw new Error("Failed to send message")}catch(rt){console.error("Failed to send message:",rt),a(F)}finally{y(!1)}},[o,l,m,t.apiUrl]),M=kt(async(F,rt)=>{if(!(!l||m)){y(!0),v(!1);try{const H=new FormData;if(H.append("file",rt),H.append("messageData",JSON.stringify(F)),!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{Authorization:`Bearer ${l}`},body:H})).ok)throw new Error("Failed to send attachment")}catch(H){console.error("Failed to send attachment:",H)}finally{y(!1)}}},[l,m,t.apiUrl]),xt=kt(()=>{const F=document.createElement("input");F.type="file",F.accept="image/*,video/*",F.onchange=async rt=>{const H=rt.target.files?.[0];if(!H)return;const _t=10*1024*1024;if(H.size>_t){alert("File size must be less than 10MB");return}const Rt=H.type.startsWith("video/")?{type:"video",filename:H.name,size:H.size}:{type:"photo",filename:H.name,size:H.size};await M(Rt,H)},F.click()},[M]),vt=kt(()=>{const F=document.createElement("input");F.type="file",F.accept=".pdf,.doc,.docx,.xls,.xlsx,.txt,.zip,.rar",F.onchange=async rt=>{const H=rt.target.files?.[0];if(!H)return;const _t=10*1024*1024;if(H.size>_t){alert("File size must be less than 10MB");return}const mt={type:"file",filename:H.name,size:H.size,mimeType:H.type};await M(mt,H)},F.click()},[M]),ht=kt(async()=>{if(v(!1),!navigator.geolocation){console.error("Geolocation is not supported");return}if(!m){y(!0);try{const F=await new Promise((_t,mt)=>{navigator.geolocation.getCurrentPosition(_t,mt)}),rt={type:"location",latitude:F.coords.latitude,longitude:F.coords.longitude};if(!(await fetch(`${t.apiUrl}/message`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${l}`},body:JSON.stringify(rt)})).ok)throw new Error("Failed to send location")}catch(F){console.error("Failed to send location:",F)}finally{y(!1)}}},[m,l,t.apiUrl]),Lt=kt(()=>{n(F=>!F)},[]),wt=kt(()=>{v(F=>!F)},[]),Zt=kt(()=>{T&&(S(!1),W(),P.current&&clearTimeout(P.current),P.current=setTimeout(()=>{S(!0)},1e4))},[T,W]),Wt={config:t,isOpen:e,onMainMenu:s,inputMessage:o,customerName:c,availablePlatforms:_,isSending:m,showAttachmentMenu:x,messages:E,platformError:R,canRetryPlatforms:T,isUsingCachedPlatforms:L,setInputMessage:a,toggleChat:Lt,toggleAttachmentMenu:wt,selectPlatform:K,goBackToMainMenu:j,startChat:N,sendMessage:nt,handleGalleryUpload:xt,handleFileUpload:vt,handleLocationShare:ht,retryFetchPlatforms:Zt};return w(Qo.Provider,{value:Wt,children:i})}function cc(){const i=rc(Qo);if(!i)throw new Error("useWidget must be used within WidgetProvider");return i}function hn(i,t,e){let n=e.initialDeps??[],s;function r(){var o,a,l,h;let c;e.key&&((o=e.debug)!=null&&o.call(e))&&(c=Date.now());const u=i();if(!(u.length!==n.length||u.some((_,p)=>n[p]!==_)))return s;n=u;let f;if(e.key&&((a=e.debug)!=null&&a.call(e))&&(f=Date.now()),s=t(...u),e.key&&((l=e.debug)!=null&&l.call(e))){const _=Math.round((Date.now()-c)*100)/100,p=Math.round((Date.now()-f)*100)/100,m=p/16,y=(x,v)=>{for(x=String(x);x.length<v;)x=" "+x;return x};console.info(`%c⏱ ${y(p,5)} /${y(_,5)} ms`,`
|
|
3
3
|
font-size: .6rem;
|
|
4
4
|
font-weight: bold;
|
|
5
|
-
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,e?.key)}return(h=e?.onChange)==null||h.call(e,s),s}return r.updateDeps=o=>{n=o},r}function Jo(i,t){if(i===void 0)throw new Error("Unexpected undefined");return i}const hc=(i,t)=>Math.abs(i-t)<1.01,cc=(i,t,e)=>{let n;return function(...s){i.clearTimeout(n),n=i.setTimeout(()=>t.apply(this,s),e)}},Qo=i=>{const{offsetWidth:t,offsetHeight:e}=i;return{width:t,height:e}},uc=i=>i,dc=i=>{const t=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let s=t;s<=e;s++)n.push(s);return n},fc=(i,t)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;const s=o=>{const{width:a,height:l}=o;t({width:Math.round(a),height:Math.round(l)})};if(s(Qo(e)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver(o=>{const a=()=>{const l=o[0];if(l?.borderBoxSize){const h=l.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(Qo(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(e,{box:"border-box"}),()=>{r.unobserve(e)}},ta={passive:!0},ea=typeof window>"u"?!0:"onscrollend"in window,gc=(i,t)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;let s=0;const r=i.options.useScrollendEvent&&ea?()=>{}:cc(n,()=>{t(s,!1)},i.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:u,isRtl:d}=i.options;s=u?e.scrollLeft*(d&&-1||1):e.scrollTop,r(),t(s,c)},a=o(!0),l=o(!1);l(),e.addEventListener("scroll",a,ta);const h=i.options.useScrollendEvent&&ea;return h&&e.addEventListener("scrollend",l,ta),()=>{e.removeEventListener("scroll",a),h&&e.removeEventListener("scrollend",l)}},_c=(i,t,e)=>{if(t?.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]},mc=(i,{adjustments:t=0,behavior:e},n)=>{var s,r;const o=i+t;(r=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||r.call(s,{[n.options.horizontal?"left":"top"]:o,behavior:e})};class pc{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(r=>{const o=()=>{this._measureElement(r.target,r)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var r;return(r=n())==null?void 0:r.observe(s,{box:"border-box"})},unobserve:s=>{var r;return(r=n())==null?void 0:r.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:uc,rangeExtractor:dc,onChange:()=>{},measureElement:_c,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=hn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=r,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const s=new Map,r=new Map;for(let o=n-1;o>=0;o--){const a=e[o];if(s.has(a.lane))continue;const l=r.get(a.lane);if(l==null||a.end>l.end?r.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=hn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,n,s,r,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:o}),{key:!1}),this.getMeasurements=hn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:o},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const h=this.measurementsCache.slice(0,l);for(let c=l;c<e;c++){const u=r(c),d=this.options.lanes===1?h[c-1]:this.getFurthestMeasurement(h,c),f=d?d.end+this.options.gap:n+s,_=a.get(u),p=typeof _=="number"?_:this.options.estimateSize(c),m=f+p,y=d?d.lane:c%this.options.lanes;h[c]={index:c,start:f,size:p,end:m,key:u,lane:y}}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,r)=>this.range=e.length>0&&n>0?yc({measurements:e,outerSize:n,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=hn(()=>{let e=null,n=null;const s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,r,o)=>r===null||o===null?[]:e({startIndex:r,endIndex:o,overscan:n,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const s=this.indexFromElement(e),r=this.measurementsCache[s];if(!r)return;const o=r.key,a=this.elementsCache.get(o);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{const s=this.measurementsCache[e];if(!s)return;const r=this.itemSizeCache.get(s.key)??s.size,o=n-r;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,s)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(s))});return}this._measureElement(e,void 0)},this.getVirtualItems=hn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const s=[];for(let r=0,o=e.length;r<o;r++){const a=e[r],l=n[a];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return Jo(n[na(0,n.length-1,s=>Jo(n[s]).start,e)])},this.getOffsetForAlignment=(e,n,s=0)=>{const r=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=e>=o+r?"end":"start"),n==="center"?e+=(s-r)/2:n==="end"&&(e-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const s=this.measurementsCache[e];if(!s)return;const r=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(s.end>=o+r-this.options.scrollPaddingEnd)n="end";else if(s.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const a=n==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,s.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:n="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let r=0;const o=10,a=h=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(e,h);if(!c){console.warn("Failed to get offset for index:",e);return}const[u,d]=c;this._scrollToOffset(u,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),_=this.getOffsetForIndex(e,d);if(!_){console.warn("Failed to get offset for index:",e);return}hc(_[0],f)||l(d)})},l=h=>{this.targetWindow&&(r++,r<o?this.targetWindow.requestAnimationFrame(()=>a(h)):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};a(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{const r=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&r.some(a=>a===null);){const a=n[o];r[a.lane]===null&&(r[a.lane]=a.end),o--}s=Math.max(...r.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const na=(i,t,e,n)=>{for(;i<=t;){const s=(i+t)/2|0,r=e(s);if(r<n)i=s+1;else if(r>n)t=s-1;else return s}return i>0?i-1:0};function yc({measurements:i,outerSize:t,scrollOffset:e,lanes:n}){const s=i.length-1,r=l=>i[l].start;if(i.length<=n)return{startIndex:0,endIndex:s};let o=na(0,s,r,e),a=o;if(n===1)for(;a<s&&i[a].end<e+t;)a++;else if(n>1){const l=Array(n).fill(0);for(;a<s&&l.some(c=>c<e+t);){const c=i[a];l[c.lane]=c.end,a++}const h=Array(n).fill(e+t);for(;o>=0&&h.some(c=>c>=e);){const c=i[o];h[c.lane]=c.start,o--}o=Math.max(0,o-o%n),a=Math.min(s,a+(n-1-a%n))}return{startIndex:o,endIndex:a}}const xc=typeof window<"u"?nc:he;function wc(i){const t=Zo(()=>({}),{})[1],e={...i,onChange:s=>{t(),i.onChange?.(s)}},[n]=Mt(()=>new pc(e));return n.setOptions(e),he(()=>n._didMount(),[]),xc(()=>n._willUpdate()),n}function Ec(i){return wc({observeElementRect:fc,observeElementOffset:gc,scrollToFn:mc,...i})}function Cc({content:i,timestamp:t,isFromCustomer:e}){return E("div",{class:`message-wrapper ${e?"message-wrapper-end":"message-wrapper-start"}`,children:E("div",{class:`message-bubble message-text-content ${e?"message-bubble-customer":"message-bubble-support"}`,children:[E("p",{class:"message-text",children:i}),E("span",{class:`message-timestamp ${e?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})}function vc({url:i,filename:t,size:e,caption:n,timestamp:s,isFromCustomer:r}){const o=()=>{const a=document.createElement("a");a.href=i,a.download=t||"image.jpg",a.click()};return E("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:E("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,style:"overflow: hidden;",children:E("div",{class:"message-media-content",children:[E("img",{src:i,alt:t||"Photo",class:"message-image"}),n&&E("p",{class:`message-caption ${r?"":"message-bubble-support"}`,style:r?"color: white;":"color: #18181b;",children:n}),E("div",{class:"message-meta",children:[E("div",{class:"message-file-info",children:[t&&E("span",{class:`message-filename ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:t}),e&&E("span",{class:`message-filesize ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:[(e/1024).toFixed(1)," KB"]})]}),E("button",{type:"button",onClick:o,class:`message-download-button ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"Download"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),E("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function Sc({url:i,filename:t,size:e,caption:n,timestamp:s,isFromCustomer:r}){const[o,a]=Mt(!0);return E("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:E("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,style:"overflow: hidden;",children:E("div",{class:"message-media-content",children:[E("div",{class:"message-video-container",children:[o&&E("div",{class:"message-video-loading",children:E("svg",{class:"icon-lg icon-spinner",fill:"none",viewBox:"0 0 24 24",children:[E("title",{children:"Loading"}),E("circle",{style:"opacity: 0.25;",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),E("path",{style:"opacity: 0.75;",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),E("video",{controls:!0,class:"message-video",preload:"metadata",style:{opacity:o?0:1},onLoadedData:()=>a(!1),children:[E("source",{src:i,type:"video/mp4"}),E("track",{kind:"captions"})]})]}),n&&E("p",{class:`message-caption ${r?"":"message-bubble-support"}`,style:r?"color: white;":"color: #18181b;",children:n}),E("div",{class:"message-meta",children:[t&&E("span",{class:`message-filename ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:t}),E("button",{type:"button",onClick:()=>{const h=document.createElement("a");h.href=i,h.download=t||"video.mp4",h.click()},class:`message-download-button ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"Download"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),E("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function bc({url:i,filename:t,size:e,mimeType:n,timestamp:s,isFromCustomer:r}){const o=()=>{const l=document.createElement("a");l.href=i,l.download=t,l.click()};return E("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:E("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,children:E("div",{class:"message-file-container",children:[E("div",{class:"message-file-row",children:[E("div",{class:"message-file-icon",children:n?.startsWith("application/pdf")?E("svg",{class:"icon-lg icon-pdf",fill:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"PDF"}),E("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),E("path",{d:"M14 2v6h6"}),E("path",{d:"M9 13h6"}),E("path",{d:"M9 17h6"})]}):E("svg",{class:"icon-lg icon-file",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"File"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})]})}),E("div",{class:"message-file-details",children:[E("p",{class:"message-file-name ",style:r?"color: white;":"color: #18181b;",children:t}),e&&E("p",{class:`message-file-size ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:[(e/1024).toFixed(1)," KB"]})]}),E("button",{type:"button",onClick:o,class:`message-file-download ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"Download"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),E("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,style:"margin-top: 0.5rem;",children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}const At={ADD:"add",REMOVE:"remove"},cn={PROPERTYCHANGE:"propertychange"},V={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Fi{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Rc(i,t,e){let n,s;e=e||ce;let r=0,o=i.length,a=!1;for(;r<o;)n=r+(o-r>>1),s=+e(i[n],t),s<0?r=n+1:(o=n,a=!s);return a?r:~r}function ce(i,t){return i>t?1:i<t?-1:0}function Tc(i,t){return i<t?1:i>t?-1:0}function Bs(i,t,e){if(i[0]<=t)return 0;const n=i.length;if(t<=i[n-1])return n-1;if(typeof e=="function"){for(let s=1;s<n;++s){const r=i[s];if(r===t)return s;if(r<t)return e(t,i[s-1],r)>0?s-1:s}return n-1}if(e>0){for(let s=1;s<n;++s)if(i[s]<t)return s-1;return n-1}if(e<0){for(let s=1;s<n;++s)if(i[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(i[s]==t)return s;if(i[s]<t)return i[s-1]-t<t-i[s]?s-1:s}return n-1}function Ic(i,t,e){for(;t<e;){const n=i[t];i[t]=i[e],i[e]=n,++t,--e}}function Ys(i,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let s=0;s<n;s++)i[i.length]=e[s]}function ve(i,t){const e=i.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(i[n]!==t[n])return!1;return!0}function Mc(i,t,e){const n=t||ce;return i.every(function(s,r){if(r===0)return!0;const o=n(i[r-1],s);return!(o>0||o===0)})}function Vn(){return!0}function zi(){return!1}function Kn(){}function ia(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!ve(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}function Lc(i){function t(){let e;try{e=i()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function Zn(i){for(const t in i)delete i[t]}function un(i){let t;for(t in i)return!1;return!t}class ue{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ni extends Fi{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?new ue(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,c=s.length;h<c;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[n]===0){let h=a[n];for(delete a[n];h--;)this.removeEventListener(n,Kn);delete o[n]}return l}disposeInternal(){this.listeners_&&Zn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Kn,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}function q(i,t,e,n,s){if(s){const o=e;e=function(a){return i.removeEventListener(t,e),o.call(n??this,a)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function Gi(i,t,e,n){return q(i,t,e,n,!0)}function at(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),Zn(i))}class jn extends Ni{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(V.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=q(this,t[r],e);return s}return q(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=Gi(this,t[r],e)}else n=Gi(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)Ac(n);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}}jn.prototype.on,jn.prototype.once,jn.prototype.un;function Ac(i){if(Array.isArray(i))for(let t=0,e=i.length;t<e;++t)at(i[t]);else at(i)}function J(){throw new Error("Unimplemented abstract method.")}let kc=0;function Q(i){return i.ol_uid||(i.ol_uid=String(++kc))}class sa extends ue{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class te extends jn{constructor(t){super(),this.on,this.once,this.un,Q(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}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(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new sa(n,t,e)),n=cn.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new sa(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const s=this.values_||(this.values_={});if(n)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],un(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}const ra={LENGTH:"length"};class Wi extends ue{constructor(t,e,n){super(t),this.element=e,this.index=n}}class ee extends te{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let n=0,s=this.array_.length;n<s;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(ra.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Wi(At.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Wi(At.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Wi(At.REMOVE,s,t)),this.dispatchEvent(new Wi(At.ADD,e,t))}updateLength_(){this.set(ra.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,s=this.array_.length;n<s;++n)if(this.array_[n]===t&&n!==e)throw new Error("Duplicate item added to a unique collection")}}class dn extends ue{constructor(t,e,n){super(t),this.map=e,this.frameState=n!==void 0?n:null}}class Se extends dn{constructor(t,e,n,s,r,o){super(t,e,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=s!==void 0?s:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const ct={SINGLECLICK:"singleclick",CLICK:V.CLICK,DBLCLICK:V.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ue=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Ue.includes("safari")&&!Ue.includes("chrom")&&(Ue.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ue));const Oc=Ue.includes("webkit")&&!Ue.includes("edge"),oa=Ue.includes("macintosh"),Pc=typeof devicePixelRatio<"u"?devicePixelRatio:1,Vs=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,aa=typeof Image<"u"&&Image.prototype.decode,la=(function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i})(),Ks={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class Dc extends Ni{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=q(n,Ks.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=q(n,Ks.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(V.TOUCHMOVE,this.boundHandleTouchMove_,la?{passive:!1}:!1)}emulateClick_(t){let e=new Se(ct.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Se(ct.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new Se(ct.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==ct.POINTERUP||e.type==ct.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==ct.POINTERDOWN||e.type==ct.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Se(ct.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(at),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new Se(ct.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(q(n,ct.POINTERMOVE,this.handlePointerMove_,this),q(n,ct.POINTERUP,this.handlePointerUp_,this),q(this.element_,ct.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(q(this.element_.getRootNode(),ct.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Se(ct.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Se(ct.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(at(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(V.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(at(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(at),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const be={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},vt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},z={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function et(i,t){if(!i)throw new Error(t)}const Ui=1/0;class Fc{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Zn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){et(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Ui?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,s=e.length,r=e[t],o=n[t],a=t;for(;t<s>>1;){const l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=h<s&&n[h]<n[l]?h:l;e[t]=e[c],n[t]=n[c],t=c}e[t]=r,n[t]=o,this.siftDown_(a,t)}siftDown_(t,e){const n=this.elements_,s=this.priorities_,r=n[e],o=s[e];for(;e>t;){const a=this.getParentIndex_(e);if(s[a]>o)n[e]=n[a],s[e]=s[a],e=a;else break}n[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let s=0;const r=e.length;let o,a,l;for(a=0;a<r;++a)o=e[a],l=t(o),l==Ui?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=l,e[s++]=o);e.length=s,n.length=s,this.heapify_()}}class zc extends Fc{constructor(t,e){super(n=>t.apply(null,n),n=>n[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(V.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(n===z.LOADED||n===z.ERROR||n===z.EMPTY){n!==z.ERROR&&e.removeEventListener(V.CHANGE,this.boundHandleTileChange_);const s=e.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===z.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function Nc(i,t,e,n,s){if(!i||!(e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return Ui;const r=i.viewState.center,o=n[0]-r[0],a=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}const St={ANIMATING:0,INTERACTING:1},Ht={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function lt(i,t,e){return Math.min(Math.max(i,t),e)}function Gc(i,t,e,n,s,r){const o=s-e,a=r-n;if(o!==0||a!==0){const l=((i-e)*o+(t-n)*a)/(o*o+a*a);l>1?(e=s,n=r):l>0&&(e+=o*l,n+=a*l)}return fn(i,t,e,n)}function fn(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function Wc(i){const t=i.length;for(let n=0;n<t;n++){let s=n,r=Math.abs(i[n][n]);for(let a=n+1;a<t;a++){const l=Math.abs(i[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=i[s];i[s]=i[n],i[n]=o;for(let a=n+1;a<t;a++){const l=-i[a][n]/i[n][n];for(let h=n;h<t+1;h++)n==h?i[a][h]=0:i[a][h]+=l*i[n][h]}}const e=new Array(t);for(let n=t-1;n>=0;n--){e[n]=i[n][t]/i[n][n];for(let s=n-1;s>=0;s--)i[s][t]-=i[s][n]*e[n]}return e}function ha(i){return i*180/Math.PI}function Re(i){return i*Math.PI/180}function gn(i,t){const e=i%t;return e*t<0?e+t:e}function Nt(i,t,e){return i+e*(t-i)}function Xi(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function Bi(i,t){return Math.floor(Xi(i,t))}function Yi(i,t){return Math.ceil(Xi(i,t))}function Zs(i,t,e){if(i>=t&&i<e)return i;const n=e-t;return((i-t)%n+n)%n+t}function ca(i,t,e){return(function(n,s,r,o,a){if(!n)return;if(!s&&!t)return n;const l=t?0:r[0]*s,h=t?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let d=i[0]+l/2+c,f=i[2]-l/2+c,_=i[1]+h/2+u,p=i[3]-h/2+u;d>f&&(d=(f+d)/2,f=d),_>p&&(_=(p+_)/2,p=_);let m=lt(n[0],d,f),y=lt(n[1],_,p);if(o&&e&&s){const x=30*s;m+=-x*Math.log(1+Math.max(0,d-n[0])/x)+x*Math.log(1+Math.max(0,n[0]-f)/x),y+=-x*Math.log(1+Math.max(0,_-n[1])/x)+x*Math.log(1+Math.max(0,n[1]-p)/x)}return[m,y]})}function Uc(i){return i}const mt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function ua(i){const t=Gt();for(let e=0,n=i.length;e<n;++e)qn(t,i[e]);return t}function js(i,t,e){return e?(e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]+t,e[3]=i[3]+t,e):[i[0]-t,i[1]-t,i[2]+t,i[3]+t]}function da(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i.slice()}function fa(i,t,e){let n,s;return t<i[0]?n=i[0]-t:i[2]<t?n=t-i[2]:n=0,e<i[1]?s=i[1]-e:i[3]<e?s=e-i[3]:s=0,n*n+s*s}function _n(i,t){return ga(i,t[0],t[1])}function Hn(i,t){return i[0]<=t[0]&&t[2]<=i[2]&&i[1]<=t[1]&&t[3]<=i[3]}function ga(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function Hs(i,t){const e=i[0],n=i[1],s=i[2],r=i[3],o=t[0],a=t[1];let l=mt.UNKNOWN;return o<e?l=l|mt.LEFT:o>s&&(l=l|mt.RIGHT),a<n?l=l|mt.BELOW:a>r&&(l=l|mt.ABOVE),l===mt.UNKNOWN&&(l=mt.INTERSECTING),l}function Gt(){return[1/0,1/0,-1/0,-1/0]}function Te(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Vi(i){return Te(1/0,1/0,-1/0,-1/0,i)}function _a(i,t){const e=i[0],n=i[1];return Te(e,n,e,n,t)}function $s(i,t,e,n,s){const r=Vi(s);return ma(r,i,t,e,n)}function $n(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function Xc(i,t){return t[0]<i[0]&&(i[0]=t[0]),t[2]>i[2]&&(i[2]=t[2]),t[1]<i[1]&&(i[1]=t[1]),t[3]>i[3]&&(i[3]=t[3]),i}function qn(i,t){t[0]<i[0]&&(i[0]=t[0]),t[0]>i[2]&&(i[2]=t[0]),t[1]<i[1]&&(i[1]=t[1]),t[1]>i[3]&&(i[3]=t[1])}function ma(i,t,e,n,s){for(;e<n;e+=s)Bc(i,t[e],t[e+1]);return i}function Bc(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function pa(i,t){let e;return e=t(Ki(i)),e||(e=t(Zi(i)),e)||(e=t(ji(i)),e)||(e=t(Ye(i)),e)?e:!1}function qs(i){let t=0;return Hi(i)||(t=st(i)*bt(i)),t}function Ki(i){return[i[0],i[1]]}function Zi(i){return[i[2],i[1]]}function Xe(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Yc(i,t){let e;if(t==="bottom-left")e=Ki(i);else if(t==="bottom-right")e=Zi(i);else if(t==="top-left")e=Ye(i);else if(t==="top-right")e=ji(i);else throw new Error("Invalid corner");return e}function Js(i,t,e,n,s){const[r,o,a,l,h,c,u,d]=ya(i,t,e,n);return Te(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function ya(i,t,e,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,h=s*a,c=r*o,u=r*a,d=i[0],f=i[1];return[d-l+u,f-h-c,d-l-u,f-h+c,d+l-u,f+h+c,d+l+u,f+h-c,d-l+u,f-h-c]}function bt(i){return i[3]-i[1]}function Be(i,t,e){const n=e||Gt();return kt(i,t)?(i[0]>t[0]?n[0]=i[0]:n[0]=t[0],i[1]>t[1]?n[1]=i[1]:n[1]=t[1],i[2]<t[2]?n[2]=i[2]:n[2]=t[2],i[3]<t[3]?n[3]=i[3]:n[3]=t[3]):Vi(n),n}function Ye(i){return[i[0],i[3]]}function ji(i){return[i[2],i[3]]}function st(i){return i[2]-i[0]}function kt(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function Hi(i){return i[2]<i[0]||i[3]<i[1]}function Vc(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}function Kc(i,t,e){let n=!1;const s=Hs(i,t),r=Hs(i,e);if(s===mt.INTERSECTING||r===mt.INTERSECTING)n=!0;else{const o=i[0],a=i[1],l=i[2],h=i[3],c=t[0],u=t[1],d=e[0],f=e[1],_=(f-u)/(d-c);let p,m;r&mt.ABOVE&&!(s&mt.ABOVE)&&(p=d-(f-h)/_,n=p>=o&&p<=l),!n&&r&mt.RIGHT&&!(s&mt.RIGHT)&&(m=f-(d-l)*_,n=m>=a&&m<=h),!n&&r&mt.BELOW&&!(s&mt.BELOW)&&(p=d-(f-a)/_,n=p>=o&&p<=l),!n&&r&mt.LEFT&&!(s&mt.LEFT)&&(m=f-(d-o)*_,n=m>=a&&m<=h)}return n}function xa(i,t){const e=t.getExtent(),n=Xe(i);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const s=st(e),o=Math.floor((n[0]-e[0])/s)*s;i[0]-=o,i[2]-=o}return i}function wa(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];xa(i,t);const s=st(n);if(st(i)>s&&!e)return[[n[0],i[1],n[2],i[3]]];if(i[0]<n[0])return[[i[0]+s,i[1],n[2],i[3]],[n[0],i[1],i[2],i[3]]];if(i[2]>n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}function Zc(i,t){return i[0]+=+t[0],i[1]+=+t[1],i}function $i(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function Qs(i,t){const e=Math.cos(t),n=Math.sin(t),s=i[0]*e-i[1]*n,r=i[1]*e+i[0]*n;return i[0]=s,i[1]=r,i}function jc(i,t){return i[0]*=t,i[1]*=t,i}function Ea(i,t){if(t.canWrapX()){const e=st(t.getExtent()),n=Hc(i,t,e);n&&(i[0]-=n*e)}return i}function Hc(i,t,e){const n=t.getExtent();let s=0;return t.canWrapX()&&(i[0]<n[0]||i[0]>n[2])&&(e=e||st(n),s=Math.floor((i[0]-n[0])/e)),s}function Ca(i){return Math.pow(i,3)}function mn(i){return 1-Ca(1-i)}function $c(i){return 3*i*i-2*i*i*i}function qc(i){return i}const Jc=63710088e-1;function va(i,t,e){e=e||Jc;const n=Re(i[1]),s=Re(t[1]),r=(s-n)/2,o=Re(t[0]-i[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Sa(...i){console.warn(...i)}const tr={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class er{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||tr[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Jn=6378137,pn=Math.PI*Jn,Qc=[-pn,-pn,pn,pn],tu=[-180,-85,180,85],qi=Jn*Math.log(Math.tan(Math.PI/2));class yn extends er{constructor(t){super({code:t,units:"m",extent:Qc,global:!0,worldExtent:tu,getPointResolution:function(e,n){return e/Math.cosh(n[1]/Jn)}})}}const ba=[new yn("EPSG:3857"),new yn("EPSG:102100"),new yn("EPSG:102113"),new yn("EPSG:900913"),new yn("http://www.opengis.net/def/crs/EPSG/0/3857"),new yn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function eu(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n){t[r]=pn*i[r]/180;let o=Jn*Math.log(Math.tan(Math.PI*(+i[r+1]+90)/360));o>qi?o=qi:o<-qi&&(o=-qi),t[r+1]=o}return t}function nu(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n)t[r]=180*i[r]/pn,t[r+1]=360*Math.atan(Math.exp(i[r+1]/Jn))/Math.PI-90;return t}const iu=6378137,Ra=[-180,-90,180,90],su=Math.PI*iu/180;class Ve extends er{constructor(t,e){super({code:t,units:"degrees",extent:Ra,axisOrientation:e,global:!0,metersPerUnit:su,worldExtent:Ra})}}const Ta=[new Ve("CRS:84"),new Ve("EPSG:4326","neu"),new Ve("urn:ogc:def:crs:OGC:1.3:CRS84"),new Ve("urn:ogc:def:crs:OGC:2:84"),new Ve("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new Ve("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new Ve("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let nr={};function ru(i){return nr[i]||nr[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function ou(i,t){nr[i]=t}let xn={};function Qn(i,t,e){const n=i.getCode(),s=t.getCode();n in xn||(xn[n]={}),xn[n][s]=e}function ir(i,t){return i in xn&&t in xn[i]?xn[i][t]:null}const Ji=.9996,Wt=.00669438,Qi=Wt*Wt,ts=Qi*Wt,Ke=Wt/(1-Wt),Ia=Math.sqrt(1-Wt),wn=(1-Ia)/(1+Ia),Ma=wn*wn,sr=Ma*wn,rr=sr*wn,La=rr*wn,Aa=1-Wt/4-3*Qi/64-5*ts/256,au=3*Wt/8+3*Qi/32+45*ts/1024,lu=15*Qi/256+45*ts/1024,hu=35*ts/3072,cu=3/2*wn-27/32*sr+269/512*La,uu=21/16*Ma-55/32*rr,du=151/96*sr-417/128*La,fu=1097/512*rr,es=6378137;function gu(i,t,e){const n=i-5e5,o=(e.north?t:t-1e7)/Ji/(es*Aa),a=o+cu*Math.sin(2*o)+uu*Math.sin(4*o)+du*Math.sin(6*o)+fu*Math.sin(8*o),l=Math.sin(a),h=l*l,c=Math.cos(a),u=l/c,d=u*u,f=d*d,_=1-Wt*h,p=Math.sqrt(1-Wt*h),m=es/p,y=(1-Wt)/_,x=Ke*c**2,v=x*x,w=n/(m*Ji),C=w*w,T=C*w,b=T*w,R=b*w,I=R*w,L=a-u/y*(C/2-b/24*(5+3*d+10*x-4*v-9*Ke))+I/720*(61+90*d+298*x+45*f-252*Ke-3*v);let k=(w-T/6*(1+2*d+x)+R/120*(5-2*x+28*d-3*v+8*Ke+24*f))/c;return k=Zs(k+Re(Pa(e.number)),-Math.PI,Math.PI),[ha(k),ha(L)]}const ka=-80,Oa=84,_u=-180,mu=180;function pu(i,t,e){i=Zs(i,_u,mu),t<ka?t=ka:t>Oa&&(t=Oa);const n=Re(t),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,h=Re(i),c=Pa(e.number),u=Re(c),d=es/Math.sqrt(1-Wt*s**2),f=Ke*r**2,_=r*Zs(h-u,-Math.PI,Math.PI),p=_*_,m=p*_,y=m*_,x=y*_,v=x*_,w=es*(Aa*n-au*Math.sin(2*n)+lu*Math.sin(4*n)-hu*Math.sin(6*n)),C=Ji*d*(_+m/6*(1-a+f)+x/120*(5-18*a+l+72*f-58*Ke))+5e5;let T=Ji*(w+d*o*(p/2+y/24*(5-a+9*f+4*f**2)+v/720*(61-58*a+l+600*f-330*Ke)));return e.north||(T+=1e7),[C,T]}function Pa(i){return(i-1)*6-180+3}const yu=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function Da(i){let t=0;for(const s of yu){const r=i.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let e=0,n=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(n=!0,e=t-32600),e?{number:e,north:n}:null}function Fa(i,t){return function(e,n,s,r){const o=e.length;s=s>1?s:2,r=r??s,n||(s>2?n=e.slice():n=new Array(o));for(let a=0;a<o;a+=r){const l=e[a],h=e[a+1],c=i(l,h,t);n[a]=c[0],n[a+1]=c[1]}return n}}function xu(i){return Da(i)?new er({code:i,units:"m"}):null}function wu(i){const t=Da(i.getCode());return t?{forward:Fa(pu,t),inverse:Fa(gu,t)}:null}const Eu=[wu],Cu=[xu];let or=!0;function za(i){or=!1}function ar(i,t){if(t!==void 0){for(let e=0,n=i.length;e<n;++e)t[e]=i[e];t=t}else t=i.slice();return t}function lr(i){ou(i.getCode(),i),Qn(i,i,ar)}function vu(i){i.forEach(lr)}function Ot(i){if(typeof i!="string")return i;const t=ru(i);if(t)return t;for(const e of Cu){const n=e(i);if(n)return n}return null}function Na(i,t,e,n){i=Ot(i);let s;const r=i.getPointResolutionFunc();if(r)s=r(t,e);else{const o=i.getUnits();if(o=="degrees"&&!n||n=="degrees")s=t;else{const a=ur(i,Ot("EPSG:4326"));if(!a&&o!=="degrees")s=t*i.getMetersPerUnit();else{let h=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];h=a(h,h,2);const c=va(h.slice(0,2),h.slice(2,4)),u=va(h.slice(4,6),h.slice(6,8));s=(c+u)/2}const l=i.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function Ga(i){vu(i),i.forEach(function(t){i.forEach(function(e){t!==e&&Qn(t,e,ar)})})}function Su(i,t,e,n){i.forEach(function(s){t.forEach(function(r){Qn(s,r,e),Qn(r,s,n)})})}function hr(i,t){return i?typeof i=="string"?Ot(i):i:Ot(t)}function bu(i){return(function(t,e,n,s){const r=t.length;n=n!==void 0?n:2,s=s??n,e=e!==void 0?e:new Array(r);for(let o=0;o<r;o+=s){const a=i(t.slice(o,o+n)),l=a.length;for(let h=0,c=s;h<c;++h)e[o+h]=h>=l?t[o+h]:a[h]}return e})}function Ru(i,t){return za(),fr(i,"EPSG:4326","EPSG:3857")}function cr(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||ur(i,t)===ar)&&e}function ur(i,t){const e=i.getCode(),n=t.getCode();let s=ir(e,n);if(s)return s;let r=null,o=null;for(const l of Eu)r||(r=l(i)),o||(o=l(t));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=dr(r.inverse,o.forward);else{const l=ir(e,a);l&&(s=dr(l,o.forward))}else{const l=ir(a,n);l&&(s=dr(r.inverse,l))}return s&&(lr(i),lr(t),Qn(i,t,s)),s}function dr(i,t){return function(e,n,s,r){return n=i(e,n,s,r),t(n,n,s,r)}}function ns(i,t){const e=Ot(i),n=Ot(t);return ur(e,n)}function fr(i,t,e){const n=ns(t,e);if(!n){const s=Ot(t).getCode(),r=Ot(e).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(i,void 0,i.length)}function gr(i,t){return i}function de(i,t){return or&&!$i(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(or=!1,Sa("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Wa(i,t){return i}function Ie(i,t){return i}function Tu(){Ga(ba),Ga(Ta),Su(Ta,ba,eu,nu)}Tu(),new Array(6);function $t(){return[1,0,0,1,0,0]}function Iu(i,t){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i}function pt(i,t){const e=t[0],n=t[1];return t[0]=i[0]*e+i[2]*n+i[4],t[1]=i[1]*e+i[3]*n+i[5],t}function fe(i,t,e,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return i[0]=n*h,i[1]=s*l,i[2]=-n*l,i[3]=s*h,i[4]=o*n*h-a*n*l+t,i[5]=o*s*l+a*s*h+e,i}function Ua(i,t){const e=Mu(t);et(e!==0,"Transformation matrix cannot be inverted");const n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return i[0]=o/e,i[1]=-s/e,i[2]=-r/e,i[3]=n/e,i[4]=(r*l-o*a)/e,i[5]=-(n*l-s*a)/e,i}function Mu(i){return i[0]*i[3]-i[1]*i[2]}const Lu=[1e5,1e5,1e5,1e5,2,2];function Au(i){return"matrix("+i.join(", ")+")"}function Xa(i){return i.substring(7,i.length-1).split(",").map(parseFloat)}function ku(i,t){const e=Xa(i),n=Xa(t);for(let s=0;s<6;++s)if(Math.round((e[s]-n[s])*Lu[s])!==0)return!1;return!0}function Me(i,t,e,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l<e;l+=n){const h=i[l],c=i[l+1];r[a++]=s[0]*h+s[2]*c+s[4],r[a++]=s[1]*h+s[3]*c+s[5];for(let u=2;u<o;u++)r[a++]=i[l+u]}return r&&r.length!=a&&(r.length=a),r}function Ba(i,t,e,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let d=t;d<e;d+=n){const f=i[d]-h,_=i[d+1]-c;o[u++]=h+f*a-_*l,o[u++]=c+f*l+_*a;for(let p=d+2;p<d+n;++p)o[u++]=i[p]}return o&&o.length!=u&&(o.length=u),o}function Ou(i,t,e,n,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=n){const d=i[u]-l,f=i[u+1]-h;a[c++]=l+s*d,a[c++]=h+r*f;for(let _=u+2;_<u+n;++_)a[c++]=i[_]}return a&&a.length!=c&&(a.length=c),a}function Pu(i,t,e,n,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=n){o[a++]=i[l]+s,o[a++]=i[l+1]+r;for(let h=l+2;h<l+n;++h)o[a++]=i[h]}return o&&o.length!=a&&(o.length=a),o}const Ya=$t(),Du=[NaN,NaN];class Fu extends te{constructor(){super(),this.extent_=Gt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ia((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return J()}closestPointXY(t,e,n,s){return J()}containsXY(t,e){return this.closestPointXY(t,e,Du,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return J()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Vi(e),this.extentRevision_=this.getRevision()}return Vc(this.extent_,t)}rotate(t,e){J()}scale(t,e,n){J()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return J()}getType(){return J()}applyTransform(t){J()}intersectsExtent(t){return J()}translate(t,e){J()}transform(t,e){const n=Ot(t),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=bt(h)/bt(l);fe(Ya,h[0],h[3],c,-c,0,0,0);const u=Me(r,0,r.length,a,Ya,o),d=ns(n,e);return d?d(u,u,a):u}:ns(n,e);return this.applyTransform(s),this}}class _r extends Fu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return $s(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return J()}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(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=Va(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){J()}setLayout(t,e,n){let s;if(t)s=Va(t);else{for(let r=0;r<n;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=zu(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Ba(n,0,n.length,s,t,e,n),this.changed()}}scale(t,e,n){e===void 0&&(e=t),n||(n=Xe(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();Ou(s,0,s.length,r,t,e,n,s),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Pu(n,0,n.length,s,t,e,n),this.changed()}}}function zu(i){let t;return i==2?t="XY":i==3?t="XYZ":i==4&&(t="XYZM"),t}function Va(i){let t;return i=="XY"?t=2:i=="XYZ"||i=="XYM"?t=3:i=="XYZM"&&(t=4),t}function Nu(i,t,e){const n=i.getFlatCoordinates();if(!n)return null;const s=i.getStride();return Me(n,0,n.length,s,t,e)}function Ka(i,t,e,n){let s=0;const r=i[e-n],o=i[e-n+1];let a=0,l=0;for(;t<e;t+=n){const h=i[t]-r,c=i[t+1]-o;s+=l*h-a*c,a=h,l=c}return s/2}function Gu(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=Ka(i,t,a,n),t=a}return s}function Za(i,t,e,n,s,r,o){const a=i[t],l=i[t+1],h=i[e]-a,c=i[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((s-a)*h+(r-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let f=0;f<n;++f)o[f]=Nt(i[t+f],i[e+f],d);o.length=n;return}else u=t}for(let d=0;d<n;++d)o[d]=i[u+d];o.length=n}function ja(i,t,e,n,s){let r=i[t],o=i[t+1];for(t+=n;t<e;t+=n){const a=i[t],l=i[t+1],h=fn(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function Wu(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=ja(i,t,a,n,s),t=a}return s}function Ha(i,t,e,n,s,r,o,a,l,h,c){if(t==e)return h;let u,d;if(s===0){if(d=fn(o,a,i[t],i[t+1]),d<h){for(u=0;u<n;++u)l[u]=i[t+u];return l.length=n,d}return h}c=c||[NaN,NaN];let f=t+n;for(;f<e;)if(Za(i,f-n,f,n,o,a,c),d=fn(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n,f+=n}else f+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1);if(Za(i,e-n,t,n,o,a,c),d=fn(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Uu(i,t,e,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const f=e[u];h=Ha(i,t,f,n,s,r,o,a,l,h,c),t=f}return h}function Xu(i,t,e,n){for(let s=0,r=e.length;s<r;++s)i[t++]=e[s];return t}function $a(i,t,e,n){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<n;++a)i[t++]=o[a]}return t}function Bu(i,t,e,n,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=$a(i,t,e[o],n);s[r++]=l,t=l}return s.length=r,s}function En(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function is(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=En(i,t,l,n,s[r]),t=l}return s.length=r,s}function qa(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=l.length===1&&l[0]===t?[]:is(i,t,l,n,s[r]),t=l[l.length-1]}return s.length=r,s}function mr(i,t,e,n,s,r,o){const a=(e-t)/n;if(a<3){for(;t<e;t+=n)r[o++]=i[t],r[o++]=i[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-n];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let f=0;const _=i[d],p=i[d+1],m=i[u],y=i[u+1];for(let x=d+n;x<u;x+=n){const v=i[x],w=i[x+1],C=Gc(v,w,_,p,m,y);C>f&&(c=x,f=C)}f>s&&(l[(c-t)/n]=1,d+n<c&&h.push(d,c),c+n<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=i[t+u*n],r[o++]=i[t+u*n+1]);return o}function Yu(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=mr(i,t,c,n,s,r,o),a.push(o),t=c}return o}function Ze(i,t){return t*Math.round(i/t)}function Vu(i,t,e,n,s,r,o){if(t==e)return o;let a=Ze(i[t],s),l=Ze(i[t+1],s);t+=n,r[o++]=a,r[o++]=l;let h,c;do if(h=Ze(i[t],s),c=Ze(i[t+1],s),t+=n,t==e)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=Ze(i[t],s),d=Ze(i[t+1],s);if(t+=n,u==h&&d==c)continue;const f=h-a,_=c-l,p=u-a,m=d-l;if(f*m==_*p&&(f<0&&p<f||f==p||f>0&&p>f)&&(_<0&&m<_||_==m||_>0&&m>_)){h=u,c=d;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=d}return r[o++]=h,r[o++]=c,o}function Ja(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=Vu(i,t,c,n,s,r,o),a.push(o),t=c}return o}class ti extends _r{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new ti(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,s){return s<fa(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Ha(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,s))}getArea(){return Ka(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return En(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=mr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new ti(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=$a(this.flatCoordinates,0,t,this.stride),this.changed()}}class ss extends _r{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new ss(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=fn(t,e,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)n[l]=r[l];return n.length=a,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return _a(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return ga(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Xu(this.flatCoordinates,0,t,this.stride),this.changed()}}function Ku(i,t,e,n,s){return!pa(s,function(o){return!je(i,t,e,n,o[0],o[1])})}function je(i,t,e,n,s,r){let o=0,a=i[e-n],l=i[e-n+1];for(;t<e;t+=n){const h=i[t],c=i[t+1];l<=r?c>r&&(h-a)*(r-l)-(s-a)*(c-l)>0&&o++:c<=r&&(h-a)*(r-l)-(s-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function Qa(i,t,e,n,s,r){if(e.length===0||!je(i,t,e[0],n,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(je(i,e[o-1],e[o],n,s,r))return!1;return!0}function pr(i,t,e,n,s,r,o){let a,l,h,c,u,d,f;const _=s[r+1],p=[];for(let x=0,v=e.length;x<v;++x){const w=e[x];for(c=i[w-n],d=i[w-n+1],a=t;a<w;a+=n)u=i[a],f=i[a+1],(_<=d&&f<=_||d<=_&&_<=f)&&(h=(_-d)/(f-d)*(u-c)+c,p.push(h)),c=u,d=f}let m=NaN,y=-1/0;for(p.sort(ce),c=p[0],a=1,l=p.length;a<l;++a){u=p[a];const x=Math.abs(u-c);x>y&&(h=(c+u)/2,Qa(i,t,e,n,h,_)&&(m=h,y=x)),c=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,_,y),o):[m,_,y]}function Zu(i,t,e,n,s){let r=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];r=pr(i,t,l,n,s,2*o,r),t=l[l.length-1]}return r}function ju(i,t,e,n,s){let r;for(t+=n;t<e;t+=n)if(r=s(i.slice(t-n,t),i.slice(t,t+n)),r)return r;return!1}function tl(i,t,e,n,s,r){return r=r??ma(Gt(),i,t,e,n),kt(s,r)?r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:ju(i,t,e,n,function(o,a){return Kc(s,o,a)}):!1}function el(i,t,e,n,s){return!!(tl(i,t,e,n,s)||je(i,t,e,n,s[0],s[1])||je(i,t,e,n,s[0],s[3])||je(i,t,e,n,s[2],s[1])||je(i,t,e,n,s[2],s[3]))}function Hu(i,t,e,n,s){if(!el(i,t,e[0],n,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(Ku(i,e[r-1],e[r],n,s)&&!tl(i,e[r-1],e[r],n,s))return!1;return!0}function $u(i,t,e,n){for(;t<e-n;){for(let s=0;s<n;++s){const r=i[t+s];i[t+s]=i[e-n+s],i[e-n+s]=r}t+=n,e-=n}}function yr(i,t,e,n){let s=0,r=i[e-n],o=i[e-n+1];for(;t<e;t+=n){const a=i[t],l=i[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function qu(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=yr(i,t,a,n);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function nl(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=yr(i,t,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&$u(i,t,a,n),t=a}return t}function Ju(i,t){const e=[];let n=0,s=0,r;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=yr(i,n,l,2);if(r===void 0&&(r=h),h===r)e.push(t.slice(s,o+1));else{if(e.length===0)continue;e[e.length-1].push(t[s])}s=o+1,n=l}return e}class ei extends _r{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Ys(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new ei(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<fa(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Wu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Uu(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return Qa(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Gu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),nl(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,is(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Xe(this.getExtent());this.flatInteriorPoint_=pr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ss(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new ti(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o],h=new ti(e.slice(r,l),t);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;qu(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=nl(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=Ja(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new ei(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return Hu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Bu(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function il(i){if(Hi(i))throw new Error("Cannot create polygon from empty extent");const t=i[0],e=i[1],n=i[2],s=i[3],r=[t,e,t,s,n,s,n,e,t,e];return new ei(r,"XY",[r.length])}function xr(i,t,e,n){const s=st(t)/e[0],r=bt(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function wr(i,t,e){let n=Math.min(i,t);const s=50;return n*=Math.log(1+s*Math.max(0,i/t-1))/s+1,e&&(n=Math.max(n,e),n/=Math.log(1+s*Math.max(0,e/i-1))/s+1),lt(n,e/2,t*2)}function Qu(i,t,e,n){return t=t!==void 0?t:!0,(function(s,r,o,a){if(s!==void 0){const l=i[0],h=i[i.length-1],c=e?xr(l,e,o,n):l;if(a)return t?wr(s,c,h):lt(s,h,c);const u=Math.min(c,s),d=Math.floor(Bs(i,u,r));return i[d]>c&&d<i.length-1?i[d+1]:i[d]}})}function td(i,t,e,n,s,r){return n=n!==void 0?n:!0,e=e!==void 0?e:0,(function(o,a,l,h){if(o!==void 0){const c=s?xr(t,s,l,r):t;if(h)return n?wr(o,c,e):lt(o,e,c);const u=1e-9,d=Math.ceil(Math.log(t/c)/Math.log(i)-u),f=-a*(.5-u)+.5,_=Math.min(c,o),p=Math.floor(Math.log(t/_)/Math.log(i)+f),m=Math.max(d,p),y=t/Math.pow(i,m);return lt(y,e,c)}})}function sl(i,t,e,n,s){return e=e!==void 0?e:!0,(function(r,o,a,l){if(r!==void 0){const h=n?xr(i,n,a,s):i;return!e||!l?lt(r,t,h):wr(r,h,t)}})}function Er(i){if(i!==void 0)return 0}function rl(i){if(i!==void 0)return i}function ed(i){const t=2*Math.PI/i;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function nd(i){const t=Re(5);return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}const id=42,Cr=256,vr=0;class ne extends te{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=hr(t.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,t.projection&&za(),t.center&&(t.center=de(t.center,this.projection_)),t.extent&&(t.extent=Ie(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const a in Ht)delete e[a];this.setProperties(e,!0);const n=rd(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const s=sd(t),r=n.constraint,o=od(t);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const s=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-e[3]+e[1]-s[1]),a=r/2*(s[0]-e[0]+e[2]-s[2]);this.setCenterInternal([n[0]+o,n[1]-a])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=de(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=de(s.anchor,this.getProjection())),e[n]=s}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let s=0;for(;s<e&&!this.isDef();++s){const c=arguments[s];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(s===e){n&&rs(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<e;++s){const c=arguments[s],u={start:r,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||$c,callback:n};if(c.center&&(u.sourceCenter=o,u.targetCenter=c.center.slice(),o=u.targetCenter),c.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(c.zoom),a=u.targetResolution):c.resolution&&(u.sourceResolution=a,u.targetResolution=c.resolution,a=u.targetResolution),c.rotation!==void 0){u.sourceRotation=l;const d=gn(c.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}ad(u)?u.complete=!0:r+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(St.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[St.ANIMATING]>0}getInteracting(){return this.hints_[St.INTERACTING]>0}cancelAnimations(){this.setHint(St.ANIMATING,-this.hints_[St.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const s=this.animations_[e];if(s[0].callback&&rs(s[0].callback,!1),!t)for(let r=0,o=s.length;r<o;++r){const a=s[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,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;const t=Date.now();let e=!1;for(let n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const h=t-l.start;let c=l.duration>0?h/l.duration:1;c>=1?(l.complete=!0,c=1):r=!1;const u=l.easing(c);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],_=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(_-d),y=f+u*(p-f);this.targetCenter_=[m,y]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(_,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?gn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[n]=null,this.setHint(St.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&rs(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-e[0],s[1]-e[1]],Qs(n,t-this.getRotation()),Zc(n,e)),n}calculateCenterZoom(t,e){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&gr(t,this.getProjection())}getCenterInternal(){return this.get(Ht.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Wa(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();et(e,"The view center is not defined");const n=this.getResolution();et(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return et(s!==void 0,"The view rotation is not defined"),Js(e,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Ht.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Ie(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=st(t)/e[0],s=bt(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(e/n)/Math.log(t);return(function(r){return e/Math.pow(t,r*s)})}getRotation(){return this.get(Ht.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/e;return(function(o){return Math.log(n/o)/e/r})}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Sr(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,s;if(this.resolutions_){const r=Bs(this.resolutions_,t,1);e=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=lt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,lt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(et(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){et(!Hi(t),"Cannot fit empty extent provided as `geometry`");const s=Ie(t,this.getProjection());n=il(s)}else if(t.getType()==="Circle"){const s=Ie(t.getExtent(),this.getProjection());n=il(s),n.rotate(this.getRotation(),Xe(s))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=r.length;u<d;u+=o){const f=r[u]*n-r[u+1]*s,_=r[u]*s+r[u+1]*n;a=Math.min(a,f),l=Math.min(l,_),h=Math.max(h,f),c=Math.max(c,_)}return[a,l,h,c]}fitInternal(t,e){e=e||{};let n=e.size;n||(n=this.getViewportSizeMinusPadding_());const s=e.padding!==void 0?e.padding:[0,0,0,0],r=e.nearest!==void 0?e.nearest:!1;let o;e.minResolution!==void 0?o=e.minResolution:e.maxZoom!==void 0?o=this.getResolutionForZoom(e.maxZoom):o=0;const a=this.rotatedExtentForGeometry(t);let l=this.getResolutionForExtentInternal(a,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const h=this.getRotation(),c=Math.sin(h),u=Math.cos(h),d=Xe(a);d[0]+=(s[1]-s[3])/2*l,d[1]+=(s[0]-s[2])/2*l;const f=d[0]*u-d[1]*c,_=d[1]*u+d[0]*c,p=this.getConstrainedCenter([f,_],l),m=e.callback?e.callback:Kn;e.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:e.duration,easing:e.easing},m):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),rs(m,!0))}centerOn(t,e,n){this.centerOnInternal(de(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(Sr(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-n),l=Sr(t,s,[a[0]/2+o[3],a[1]/2+o[0]],e,n);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=gr(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&de(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=de(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&de(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(Ht.ROTATION)!==s&&this.set(Ht.ROTATION,s),this.get(Ht.RESOLUTION)!==o&&(this.set(Ht.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(Ht.CENTER)||!$i(this.get(Ht.CENTER),a))&&this.set(Ht.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){t=t!==void 0?t:200;const s=e||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,s,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,r,o));if(t===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,this.applyTargetState_();return}n=n||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!$i(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:t,easing:mn,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(St.INTERACTING,1)}endInteraction(t,e,n){n=n&&de(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(St.INTERACTING,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function rs(i,t){setTimeout(function(){i(t)},0)}function sd(i){if(i.extent!==void 0){const e=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return ca(i.extent,i.constrainOnlyCenter,e)}const t=hr(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,ca(e,!1,!1)}return Uc}function rd(i){let t,e,n,o=i.minZoom!==void 0?i.minZoom:vr,a=i.maxZoom!==void 0?i.maxZoom:28;const l=i.zoomFactor!==void 0?i.zoomFactor:2,h=i.multiWorld!==void 0?i.multiWorld:!1,c=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,u=i.showFullExtent!==void 0?i.showFullExtent:!1,d=hr(i.projection,"EPSG:3857"),f=d.getExtent();let _=i.constrainOnlyCenter,p=i.extent;if(!h&&!p&&d.isGlobal()&&(_=!1,p=f),i.resolutions!==void 0){const m=i.resolutions;e=m[o],n=m[a]!==void 0?m[a]:m[m.length-1],i.constrainResolution?t=Qu(m,c,!_&&p,u):t=sl(e,n,c,!_&&p,u)}else{const y=(f?Math.max(st(f),bt(f)):360*tr.degrees/d.getMetersPerUnit())/Cr/Math.pow(2,vr),x=y/Math.pow(2,28-vr);e=i.maxResolution,e!==void 0?o=0:e=y/Math.pow(l,o),n=i.minResolution,n===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?n=e/Math.pow(l,a):n=y/Math.pow(l,a):n=x),a=o+Math.floor(Math.log(e/n)/Math.log(l)),n=e/Math.pow(l,a-o),i.constrainResolution?t=td(l,e,n,c,!_&&p,u):t=sl(e,n,c,!_&&p,u)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:o,zoomFactor:l}}function od(i){if(i.enableRotation!==void 0?i.enableRotation:!0){const e=i.constrainRotation;return e===void 0||e===!0?nd():e===!1?rl:typeof e=="number"?ed(e):rl}return Er}function ad(i){return!(i.sourceCenter&&i.targetCenter&&!$i(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Sr(i,t,e,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=i[0]*r-i[1]*o,l=i[1]*r+i[0]*o;a+=(t[0]/2-e[0])*n,l+=(e[1]-t[1]/2)*n,o=-o;const h=a*r-l*o,c=l*r+a*o;return[h,c]}const os="ol-hidden",as="ol-unselectable",br="ol-control",ol="ol-collapsed",ld=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"),al=["style","variant","weight","size","lineHeight","family"],Rr={normal:400,bold:700},Tr=function(i){const t=i.match(ld);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let n=0,s=al.length;n<s;++n){const r=t[n+1];r!==void 0&&(e[al[n]]=typeof r=="string"?r.trim():r)}return isNaN(Number(e.weight))&&e.weight in Rr&&(e.weight=Rr[e.weight]),e.families=e.family.split(/,\s?/).map(n=>n.trim().replace(/^['"]|['"]$/g,"")),e};function gt(i,t,e,n){let s;return e&&e.length?s=e.shift():Vs?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let Ir;function ls(){return Ir||(Ir=gt(1,1)),Ir}function hs(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function ll(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function hd(i){for(;i.lastChild;)i.lastChild.remove()}function cd(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}class Mr extends te{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,n=this.listenerKeys.length;e<n;++e)at(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){const e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==Kn&&this.listenerKeys.push(q(t,be.POSTRENDER,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}class ud extends Mr{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=t.className!==void 0?t.className:"ol-attribution",n=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:e+"-expand",r=t.collapseLabel!==void 0?t.collapseLabel:"›",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof r=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=o):this.collapseLabel_=r;const a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=s):this.label_=a;const l=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(l),this.toggleButton_.addEventListener(V.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+as+" "+br+(this.collapsed_&&this.collapsible_?" "+ol:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),n=new Set(e.flatMap(s=>s.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(n)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(s=>Lc(()=>s))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!ve(e,this.renderedAttributions_)){hd(this.ulElement_);for(let s=0,r=e.length;s<r;++s){const o=document.createElement("li");o.innerHTML=e[s],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(ol),this.collapsed_?ll(this.collapseLabel_,this.label_):ll(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}class dd extends Mr{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==void 0?t.className:"ol-rotate",n=t.label!==void 0?t.label:"⇧",s=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof n=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(s));const r=t.tipLabel?t.tipLabel:"Reset rotation",o=document.createElement("button");o.className=e+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener(V.CLICK,this.handleClick_.bind(this),!1);const a=e+" "+as+" "+br,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(os)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const n=e.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:mn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(os);!r&&n===0?this.element.classList.add(os):r&&n!==0&&this.element.classList.remove(os)}this.label_.style.transform=s}this.rotation_=n}}class fd extends Mr{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(V.CLICK,this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(V.CLICK,this.handleClick_.bind(this,-n),!1);const d=e+" "+as+" "+br,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:mn})):n.setZoom(r)}}}function gd(i){i=i||{};const t=new ee;return(i.zoom!==void 0?i.zoom:!0)&&t.push(new fd(i.zoomOptions)),(i.rotate!==void 0?i.rotate:!0)&&t.push(new dd(i.rotateOptions)),(i.attribution!==void 0?i.attribution:!0)&&t.push(new ud(i.attributionOptions)),t}class _d{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const s=this.points_[e+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const hl={ACTIVE:"active"};class ni extends te{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(hl.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(hl.ACTIVE,t)}setMap(t){this.map_=t}}function md(i,t,e){const n=i.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];i.animateInternal({duration:e!==void 0?e:250,easing:qc,center:i.getConstrainedCenter(s)})}}function Lr(i,t,e,n){const s=i.getZoom();if(s===void 0)return;const r=i.getConstrainedZoom(s+t),o=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:o,anchor:e,duration:n!==void 0?n:250,easing:mn})}class pd extends ni{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==ct.DBLCLICK){const n=t.originalEvent,s=t.map,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_,a=s.getView();Lr(a,o,r,this.duration_),n.preventDefault(),e=!0}return!e}}function Ar(i){const t=arguments;return function(e){let n=!0;for(let s=0,r=t.length;s<r&&(n=n&&t[s](e),!!n);++s);return n}}const yd=function(i){const t=i.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},xd=function(i){const t=i.map.getTargetElement(),e=t.getRootNode(),n=i.map.getOwnerDocument().activeElement;return e instanceof ShadowRoot?e.host.contains(n):t.contains(n)},cl=function(i){const t=i.map.getTargetElement(),e=t.getRootNode();return(e instanceof ShadowRoot?e.host:t).hasAttribute("tabindex")?xd(i):!0},wd=Vn,ul=function(i){const t=i.originalEvent;return"pointerId"in t&&t.button==0&&!(Oc&&oa&&t.ctrlKey)},dl=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},Ed=function(i){const t=i.originalEvent;return oa?t.metaKey:t.ctrlKey},Cd=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},fl=function(i){const t=i.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},kr=function(i){const t=i.originalEvent;return"pointerId"in t&&t.pointerType=="mouse"},vd=function(i){const t=i.originalEvent;return"pointerId"in t&&t.isPrimary&&t.button===0};class ii extends ni{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ct.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ct.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==ct.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ct.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Or(i){const t=i.length;let e=0,n=0;for(let s=0;s<t;s++)e+=i[s].clientX,n+=i[s].clientY;return{clientX:e/t,clientY:n/t}}class Sd extends ii{constructor(t){super({stopDown:zi}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:Ar(dl,vd);this.condition_=t.onFocusOnly?Ar(cl,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,s=e.getEventPixel(Or(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const r=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],a=t.map.getView();jc(r,a.getResolution()),Qs(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,n=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const s=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),l=e.getCoordinateFromPixelInternal([a[0]-s*Math.cos(r),a[1]-s*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(l),duration:500,easing:mn})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class bd extends ii{constructor(t){t=t||{},super({stopDown:zi}),this.condition_=t.condition?t.condition:yd,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!kr(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Er)return;const s=e.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return kr(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return kr(t)&&ul(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Rd extends Fi{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+n,s.top=Math.min(t[1],e[1])+n,s.width=Math.abs(e[0]-t[0])+n,s.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new ei([s])}getGeometry(){return this.geometry_}}const Cn={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class si extends ue{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class Td extends ii{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Rd(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??ul,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const s=n[0]-e[0],r=n[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new si(Cn.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new si(e?Cn.BOXEND:Cn.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new si(Cn.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new si(Cn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new si(Cn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class Id extends Td{constructor(t){t=t||{};const e=t.condition?t.condition:Cd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),o=n.getResolutionForExtentInternal(r),a=n.getResolution()/o;s=s.clone(),s.scale(a*a)}n.fitInternal(s,{duration:this.duration_,easing:mn})}}const He={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Md extends ni{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return dl(e)&&fl(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==V.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==He.DOWN||s==He.LEFT||s==He.RIGHT||s==He.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;s==He.DOWN?h=-a:s==He.LEFT?l=-a:s==He.RIGHT?l=a:h=a;const c=[l,h];Qs(c,o.getRotation()),md(o,c,this.duration_),n.preventDefault(),e=!0}}return!e}}class Ld extends ni{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!Ed(e)&&fl(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==V.KEYDOWN||t.type==V.KEYPRESS){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Lr(a,o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}}const Ad=40,kd=300;class Od extends ni{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:wd;this.condition_=t.onFocusOnly?Ar(cl,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==V.WHEEL)return!0;const n=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r=s.deltaY;switch(s.deltaMode){case WheelEvent.DOM_DELTA_LINE:r*=Ad;break;case WheelEvent.DOM_DELTA_PAGE:r*=kd;break}if(r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=n.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-lt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Lr(e,n,this.lastAnchor_?t.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(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class Pd extends ii{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=zi),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=r;const o=t.map,a=o.getView();a.getConstraints().rotation!==Er&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Or(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class Dd extends ii{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=zi),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,o=n.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Or(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function Fd(i){i=i||{};const t=new ee,e=new _d(-.005,.05,100);return(i.altShiftDragRotate!==void 0?i.altShiftDragRotate:!0)&&t.push(new bd),(i.doubleClickZoom!==void 0?i.doubleClickZoom:!0)&&t.push(new pd({delta:i.zoomDelta,duration:i.zoomDuration})),(i.dragPan!==void 0?i.dragPan:!0)&&t.push(new Sd({onFocusOnly:i.onFocusOnly,kinetic:e})),(i.pinchRotate!==void 0?i.pinchRotate:!0)&&t.push(new Pd),(i.pinchZoom!==void 0?i.pinchZoom:!0)&&t.push(new Dd({duration:i.zoomDuration})),(i.keyboard!==void 0?i.keyboard:!0)&&(t.push(new Md),t.push(new Ld({delta:i.zoomDelta,duration:i.zoomDuration}))),(i.mouseWheelZoom!==void 0?i.mouseWheelZoom:!0)&&t.push(new Od({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(i.shiftDragZoom!==void 0?i.shiftDragZoom:!0)&&t.push(new Id({duration:i.zoomDuration})),t}const rt={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"};class gl extends te{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[rt.OPACITY]=t.opacity!==void 0?t.opacity:1,et(typeof e[rt.OPACITY]=="number","Layer opacity must be a number"),e[rt.VISIBLE]=t.visible!==void 0?t.visible:!0,e[rt.Z_INDEX]=t.zIndex,e[rt.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[rt.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[rt.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[rt.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=lt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return J()}getLayerStatesArray(t){return J()}getExtent(){return this.get(rt.EXTENT)}getMaxResolution(){return this.get(rt.MAX_RESOLUTION)}getMinResolution(){return this.get(rt.MIN_RESOLUTION)}getMinZoom(){return this.get(rt.MIN_ZOOM)}getMaxZoom(){return this.get(rt.MAX_ZOOM)}getOpacity(){return this.get(rt.OPACITY)}getSourceState(){return J()}getVisible(){return this.get(rt.VISIBLE)}getZIndex(){return this.get(rt.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(rt.EXTENT,t)}setMaxResolution(t){this.set(rt.MAX_RESOLUTION,t)}setMinResolution(t){this.set(rt.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(rt.MAX_ZOOM,t)}setMinZoom(t){this.set(rt.MIN_ZOOM,t)}setOpacity(t){et(typeof t=="number","Layer opacity must be a number"),this.set(rt.OPACITY,t)}setVisible(t){this.set(rt.VISIBLE,t)}setZIndex(t){this.set(rt.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}class Le extends ue{constructor(t,e){super(t),this.layer=e}}const Pr={LAYERS:"layers"};class vn extends gl{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Pr.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ee(n.slice(),{unique:!0}):et(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new ee(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(at),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(q(t,At.ADD,this.handleLayersAdd_,this),q(t,At.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(at);Zn(this.listenerKeys_);const e=t.getArray();for(let n=0,s=e.length;n<s;n++){const r=e[n];this.registerLayerListeners_(r),this.dispatchEvent(new Le("addlayer",r))}this.changed()}registerLayerListeners_(t){const e=[q(t,cn.PROPERTYCHANGE,this.handleLayerChange_,this),q(t,V.CHANGE,this.handleLayerChange_,this)];t instanceof vn&&e.push(q(t,"addlayer",this.handleLayerGroupAdd_,this),q(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Q(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Le("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Le("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Le("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=Q(e);this.listenerKeys_[n].forEach(at),delete this.listenerKeys_[n],this.dispatchEvent(new Le("removelayer",e)),this.changed()}getLayers(){return this.get(Pr.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const n=e.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new Le("removelayer",n[s]))}this.set(Pr.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],n=e.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(e)});const s=this.getLayerState();let r=s.zIndex;!t&&s.zIndex===void 0&&(r=0);for(let o=n,a=e.length;o<a;o++){const l=e[o];l.opacity*=s.opacity,l.visible=l.visible&&s.visible,l.maxResolution=Math.min(l.maxResolution,s.maxResolution),l.minResolution=Math.max(l.minResolution,s.minResolution),l.minZoom=Math.max(l.minZoom,s.minZoom),l.maxZoom=Math.min(l.maxZoom,s.maxZoom),s.extent!==void 0&&(l.extent!==void 0?l.extent=Be(l.extent,s.extent):l.extent=s.extent),l.zIndex===void 0&&(l.zIndex=r)}return e}getSourceState(){return"ready"}}const Ut={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class cs extends gl{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(rt.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(rt.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(at(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=q(t,V.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof ne?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(e.layerStatesArray){if(s=e.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return Dr(s,e.viewState)&&(!r||kt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const n=t instanceof ne?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(rt.MAP,t)}getMapInternal(){return this.get(rt.MAP)}setMap(t){this.mapPrecomposeKey_&&(at(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(at(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=q(t,Ut.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=q(this,V.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);et(!e.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set(rt.SOURCE,t)}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 Dr(i,t){if(!i.visible)return!1;const e=t.resolution;if(e<i.minResolution||e>=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}function _l(i,t,e=0,n=i.length-1,s=zd){for(;n>e;){if(n-e>600){const l=n-e+1,h=t-e+1,c=Math.log(l),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(l-u)/l)*(h-l/2<0?-1:1),f=Math.max(e,Math.floor(t-h*u/l+d)),_=Math.min(n,Math.floor(t+(l-h)*u/l+d));_l(i,t,f,_,s)}const r=i[t];let o=e,a=n;for(ri(i,e,t),s(i[n],r)>0&&ri(i,e,n);o<a;){for(ri(i,o,a),o++,a--;s(i[o],r)<0;)o++;for(;s(i[a],r)>0;)a--}s(i[e],r)===0?ri(i,e,a):(a++,ri(i,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1)}}function ri(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function zd(i,t){return i<t?-1:i>t?1:0}let ml=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ds(t,e))return n;const s=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],l=e.leaf?s(a):a;ds(t,l)&&(e.leaf?n.push(a):zr(t,l)?this._all(a,n):r.push(a))}e=r.pop()}return n}collides(t){let e=this.data;if(!ds(t,e))return!1;const n=[];for(;e;){for(let s=0;s<e.children.length;s++){const r=e.children[s],o=e.leaf?this.toBBox(r):r;if(ds(t,o)){if(e.leaf||zr(t,o))return!0;n.push(r)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=bn([]),this}remove(t,e){if(!t)return this;let n=this.data;const s=this.toBBox(t),r=[],o=[];let a,l,h;for(;n||r.length;){if(n||(n=r.pop(),l=r[r.length-1],a=o.pop(),h=!0),n.leaf){const c=Nd(t,n.children,e);if(c!==-1)return n.children.splice(c,1),r.push(n),this._condense(r),this}!h&&!n.leaf&&zr(n,s)?(r.push(n),o.push(a),a=0,l=n,n=n.children[0]):l?(a++,n=l.children[a],h=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,s){const r=n-e+1;let o=this._maxEntries,a;if(r<=o)return a=bn(t.slice(e,n+1)),Sn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,s-1))),a=bn([]),a.leaf=!1,a.height=s;const l=Math.ceil(r/o),h=l*Math.ceil(Math.sqrt(o));pl(t,e,n,h,this.compareMinX);for(let c=e;c<=n;c+=h){const u=Math.min(c+h-1,n);pl(t,c,u,l,this.compareMinY);for(let d=c;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(t,d,f,s-1))}}return Sn(a,this.toBBox),a}_chooseSubtree(t,e,n,s){for(;s.push(e),!(e.leaf||s.length-1===n);){let r=1/0,o=1/0,a;for(let l=0;l<e.children.length;l++){const h=e.children[l],c=Fr(h),u=Ud(t,h)-c;u<o?(o=u,r=c<r?c:r,a=h):u===o&&c<r&&(r=c,a=h)}e=a||e.children[0]}return e}_insert(t,e,n){const s=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),ai(o,s);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const n=t[e],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const o=this._chooseSplitIndex(n,r,s),a=bn(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,Sn(n,this.toBBox),Sn(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=bn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Sn(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let s,r=1/0,o=1/0;for(let a=e;a<=n-e;a++){const l=oi(t,0,a,this.toBBox),h=oi(t,a,n,this.toBBox),c=Xd(l,h),u=Fr(l)+Fr(h);c<r?(r=c,s=a,o=u<o?u:o):c===r&&u<o&&(o=u,s=a)}return s||n-e}_chooseSplitAxis(t,e,n){const s=t.leaf?this.compareMinX:Gd,r=t.leaf?this.compareMinY:Wd,o=this._allDistMargin(t,e,n,s),a=this._allDistMargin(t,e,n,r);o<a&&t.children.sort(s)}_allDistMargin(t,e,n,s){t.children.sort(s);const r=this.toBBox,o=oi(t,0,e,r),a=oi(t,n-e,n,r);let l=us(o)+us(a);for(let h=e;h<n-e;h++){const c=t.children[h];ai(o,t.leaf?r(c):c),l+=us(o)}for(let h=n-e-1;h>=e;h--){const c=t.children[h];ai(a,t.leaf?r(c):c),l+=us(a)}return l}_adjustParentBBoxes(t,e,n){for(let s=n;s>=0;s--)ai(e[s],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():Sn(t[e],this.toBBox)}};function Nd(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function Sn(i,t){oi(i,0,i.children.length,t,i)}function oi(i,t,e,n,s){s||(s=bn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let r=t;r<e;r++){const o=i.children[r];ai(s,i.leaf?n(o):o)}return s}function ai(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function Gd(i,t){return i.minX-t.minX}function Wd(i,t){return i.minY-t.minY}function Fr(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function us(i){return i.maxX-i.minX+(i.maxY-i.minY)}function Ud(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function Xd(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),s=Math.min(i.maxX,t.maxX),r=Math.min(i.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,r-n)}function zr(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function ds(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function bn(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function pl(i,t,e,n,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;_l(i,o,t,e,s),r.push(t,o,o,e)}}const Nr=[NaN,NaN,NaN,0];let Gr;function Bd(){return Gr||(Gr=gt(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Gr}const Yd=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Vd=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Kd=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Zd=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function fs(i,t){return i.endsWith("%")?Number(i.substring(0,i.length-1))/t:Number(i)}function li(i){throw new Error('failed to parse "'+i+'" as color')}function yl(i){if(i.toLowerCase().startsWith("rgb")){const r=i.match(Vd)||i.match(Yd)||i.match(Kd);if(r){const o=r[4],a=100/255;return[lt(fs(r[1],a)+.5|0,0,255),lt(fs(r[2],a)+.5|0,0,255),lt(fs(r[3],a)+.5|0,0,255),o!==void 0?lt(fs(o,100),0,1):1]}li(i)}if(i.startsWith("#")){if(Zd.test(i)){const r=i.substring(1),o=r.length<=4?1:2,a=[0,0,0,255];for(let l=0,h=r.length;l<h;l+=o){let c=parseInt(r.substring(l,l+o),16);o===1&&(c+=c<<4),a[l/o]=c}return a[3]=a[3]/255,a}li(i)}const t=Bd();t.fillStyle="#abcdef";let e=t.fillStyle;t.fillStyle=i,t.fillStyle===e&&(t.fillStyle="#fedcba",e=t.fillStyle,t.fillStyle=i,t.fillStyle===e&&li(i));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return yl(n);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);const s=Array.from(t.getImageData(0,0,1,1).data);return s[3]=Xi(s[3]/255,3),s}function jd(i){return typeof i=="string"?i:Kr(i)}const Hd=1024,hi={};let Wr=0;function $d(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function Ur(i){return i>.0031308?Math.pow(i,1/2.4)*269.025-14.025:i*3294.6}function Xr(i){return i>.2068965?Math.pow(i,3):(i-4/29)*(108/841)}function Br(i){return i>10.314724?Math.pow((i+14.025)/269.025,2.4):i/3294.6}function Yr(i){return i>.0088564?Math.pow(i,1/3):i/(108/841)+4/29}function xl(i){const t=Br(i[0]),e=Br(i[1]),n=Br(i[2]),s=Yr(t*.222488403+e*.716873169+n*.06060791),r=500*(Yr(t*.452247074+e*.399439023+n*.148375274)-s),o=200*(s-Yr(t*.016863605+e*.117638439+n*.865350722)),a=Math.atan2(o,r)*(180/Math.PI);return[116*s-16,Math.sqrt(r*r+o*o),a<0?a+360:a,i[3]]}function qd(i){const t=(i[0]+16)/116,e=i[1],n=i[2]*Math.PI/180,s=Xr(t),r=Xr(t+e/500*Math.cos(n)),o=Xr(t-e/200*Math.sin(n)),a=Ur(r*3.021973625-s*1.617392459-o*.404875592),l=Ur(r*-.943766287+s*1.916279586+o*.027607165),h=Ur(r*.069407491-s*.22898585+o*1.159737864);return[lt(a+.5|0,0,255),lt(l+.5|0,0,255),lt(h+.5|0,0,255),i[3]]}function Vr(i){if(i==="none")return Nr;if(hi.hasOwnProperty(i))return hi[i];if(Wr>=Hd){let e=0;for(const n in hi)(e++&3)===0&&(delete hi[n],--Wr)}const t=yl(i);t.length!==4&&li(i);for(const e of t)isNaN(e)&&li(i);return hi[i]=t,++Wr,t}function Rn(i){return Array.isArray(i)?i:Vr(i)}function Kr(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}function wl(i){return i[0]>0&&i[1]>0}function Jd(i,t,e){return e===void 0&&(e=[0,0]),e[0]=i[0]*t+.5|0,e[1]=i[1]*t+.5|0,e}function Pt(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}let $e=0;const Rt=1<<$e++,$=1<<$e++,Dt=1<<$e++,qt=1<<$e++,qe=1<<$e++,ci=1<<$e++,gs=Math.pow(2,$e)-1,Zr={[Rt]:"boolean",[$]:"number",[Dt]:"string",[qt]:"color",[qe]:"number[]",[ci]:"size"},Qd=Object.keys(Zr).map(Number).sort(ce);function tf(i){return i in Zr}function ui(i){const t=[];for(const e of Qd)di(i,e)&&t.push(Zr[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function di(i,t){return(i&t)===t}function Ae(i,t){return i===t}class _t{constructor(t,e){if(!tf(t))throw new Error(`literal expressions must have a specific type, got ${ui(t)}`);this.type=t,this.value=e}}class ef{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function El(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Et(i,t,e){switch(typeof i){case"boolean":{if(Ae(t,Dt))return new _t(Dt,i?"true":"false");if(!di(t,Rt))throw new Error(`got a boolean, but expected ${ui(t)}`);return new _t(Rt,i)}case"number":{if(Ae(t,ci))return new _t(ci,Pt(i));if(Ae(t,Rt))return new _t(Rt,!!i);if(Ae(t,Dt))return new _t(Dt,i.toString());if(!di(t,$))throw new Error(`got a number, but expected ${ui(t)}`);return new _t($,i)}case"string":{if(Ae(t,qt))return new _t(qt,Vr(i));if(Ae(t,Rt))return new _t(Rt,!!i);if(!di(t,Dt))throw new Error(`got a string, but expected ${ui(t)}`);return new _t(Dt,i)}}if(!Array.isArray(i))throw new Error("expression must be an array or a primitive value");if(i.length===0)throw new Error("empty expression");if(typeof i[0]=="string")return ff(i,t,e);for(const n of i)if(typeof n!="number")throw new Error("expected an array of numbers");if(Ae(t,ci)){if(i.length!==2)throw new Error(`expected an array of two values for a size, got ${i.length}`);return new _t(ci,i)}if(Ae(t,qt)){if(i.length===3)return new _t(qt,[...i,1]);if(i.length===4)return new _t(qt,i);throw new Error(`expected an array of 3 or 4 values for a color, got ${i.length}`)}if(!di(t,qe))throw new Error(`got an array of numbers, but expected ${ui(t)}`);return new _t(qe,i)}const S={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"},nf={[S.Get]:W(K(1,1/0),Cl),[S.Var]:W(K(1,1),sf),[S.Has]:W(K(1,1/0),Cl),[S.Id]:W(rf,Tn),[S.Concat]:W(K(2,1/0),tt(Dt)),[S.GeometryType]:W(of,Tn),[S.LineMetric]:W(Tn),[S.Resolution]:W(jr,Tn),[S.Zoom]:W(jr,Tn),[S.Time]:W(jr,Tn),[S.Any]:W(K(2,1/0),tt(Rt)),[S.All]:W(K(2,1/0),tt(Rt)),[S.Not]:W(K(1,1),tt(Rt)),[S.Equal]:W(K(2,2),tt(gs)),[S.NotEqual]:W(K(2,2),tt(gs)),[S.GreaterThan]:W(K(2,2),tt($)),[S.GreaterThanOrEqualTo]:W(K(2,2),tt($)),[S.LessThan]:W(K(2,2),tt($)),[S.LessThanOrEqualTo]:W(K(2,2),tt($)),[S.Multiply]:W(K(2,1/0),vl),[S.Coalesce]:W(K(2,1/0),vl),[S.Divide]:W(K(2,2),tt($)),[S.Add]:W(K(2,1/0),tt($)),[S.Subtract]:W(K(2,2),tt($)),[S.Clamp]:W(K(3,3),tt($)),[S.Mod]:W(K(2,2),tt($)),[S.Pow]:W(K(2,2),tt($)),[S.Abs]:W(K(1,1),tt($)),[S.Floor]:W(K(1,1),tt($)),[S.Ceil]:W(K(1,1),tt($)),[S.Round]:W(K(1,1),tt($)),[S.Sin]:W(K(1,1),tt($)),[S.Cos]:W(K(1,1),tt($)),[S.Atan]:W(K(1,2),tt($)),[S.Sqrt]:W(K(1,1),tt($)),[S.Match]:W(K(4,1/0),Sl,lf),[S.Between]:W(K(3,3),tt($)),[S.Interpolate]:W(K(6,1/0),Sl,hf),[S.Case]:W(K(3,1/0),af,cf),[S.In]:W(K(2,2),uf),[S.Number]:W(K(1,1/0),tt(gs)),[S.String]:W(K(1,1/0),tt(gs)),[S.Array]:W(K(1,1/0),tt($)),[S.Color]:W(K(1,4),tt($)),[S.Band]:W(K(1,3),tt($)),[S.Palette]:W(K(2,2),df),[S.ToString]:W(K(1,1),tt(Rt|$|Dt|qt))};function Cl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=i[r+1];switch(typeof o){case"number":{s[r]=new _t($,o);break}case"string":{s[r]=new _t(Dt,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}r===0&&e.properties.add(String(o))}return s}function sf(i,t,e){const n=i[1];if(typeof n!="string")throw new Error("expected a string argument for var operation");return e.variables.add(n),[new _t(Dt,n)]}function rf(i,t,e){e.featureId=!0}function of(i,t,e){e.geometryType=!0}function jr(i,t,e){e.mapState=!0}function Tn(i,t,e){const n=i[0];if(i.length!==1)throw new Error(`expected no arguments for ${n} operation`);return[]}function K(i,t){return function(e,n,s){const r=e[0],o=e.length-1;if(i===t){if(o!==i){const a=i===1?"":"s";throw new Error(`expected ${i} argument${a} for ${r}, got ${o}`)}}else if(o<i||o>t){const a=t===1/0?`${i} or more`:`${i} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function vl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=Et(i[r+1],t,e);s[r]=o}return s}function tt(i){return function(t,e,n){const s=t.length-1,r=new Array(s);for(let o=0;o<s;++o){const a=Et(t[o+1],i,n);r[o]=a}return r}}function af(i,t,e){const n=i[0],s=i.length-1;if(s%2===0)throw new Error(`expected an odd number of arguments for ${n}, got ${s} instead`)}function Sl(i,t,e){const n=i[0],s=i.length-1;if(s%2===1)throw new Error(`expected an even number of arguments for operation ${n}, got ${s} instead`)}function lf(i,t,e){const n=i.length-1,s=Dt|$|Rt,r=Et(i[1],s,e),o=Et(i[i.length-1],t,e),a=new Array(n-2);for(let l=0;l<n-2;l+=2){try{const h=Et(i[l+2],r.type,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+1} of match expression: ${h.message}`)}try{const h=Et(i[l+3],o.type,e);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+2} of match expression: ${h.message}`)}}return[r,...a,o]}function hf(i,t,e){const n=i[1];let s;switch(n[0]){case"linear":s=1;break;case"exponential":const l=n[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);s=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}const r=new _t($,s);let o;try{o=Et(i[2],$,e)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(i.length-3);for(let l=0;l<a.length;l+=2){try{const h=Et(i[l+3],$,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${h.message}`)}try{const h=Et(i[l+4],t,e);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${h.message}`)}}return[r,o,...a]}function cf(i,t,e){const n=Et(i[i.length-1],t,e),s=new Array(i.length-1);for(let r=0;r<s.length-1;r+=2){try{const o=Et(i[r+1],Rt,e);s[r]=o}catch(o){throw new Error(`failed to parse argument ${r} of case expression: ${o.message}`)}try{const o=Et(i[r+2],n.type,e);s[r+1]=o}catch(o){throw new Error(`failed to parse argument ${r+1} of case expression: ${o.message}`)}}return s[s.length-1]=n,s}function uf(i,t,e){let n=i[2];if(!Array.isArray(n))throw new Error('the second argument for the "in" operator must be an array');let s;if(typeof n[0]=="string"){if(n[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(n[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');n=n[1],s=Dt}else s=$;const r=new Array(n.length);for(let a=0;a<r.length;a++)try{const l=Et(n[a],s,e);r[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[Et(i[1],s,e),...r]}function df(i,t,e){let n;try{n=Et(i[1],$,e)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const s=i[2];if(!Array.isArray(s))throw new Error("the second argument of palette must be an array");const r=new Array(s.length);for(let o=0;o<r.length;o++){let a;try{a=Et(s[o],qt,e)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof _t))throw new Error(`the palette color at index ${o} must be a literal value`);r[o]=a}return[n,...r]}function W(...i){return function(t,e,n){const s=t[0];let r;for(let o=0;o<i.length;o++){const a=i[o](t,e,n);if(o==i.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");r=a}}return new ef(e,s,...r)}}function ff(i,t,e){const n=i[0],s=nf[n];if(!s)throw new Error(`unknown operator: ${n}`);return s(i,t,e)}function bl(i){if(!i)return"";const t=i.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return bl(i.getGeometries()[0]);default:return""}}function Rl(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function ge(i,t,e){const n=Et(i,t,e);return Jt(n)}function Jt(i,t){if(i instanceof _t){if(i.type===qt&&typeof i.value=="string"){const n=Vr(i.value);return function(){return n}}return function(){return i.value}}const e=i.operator;switch(e){case S.Number:case S.String:case S.Coalesce:return gf(i);case S.Get:case S.Var:case S.Has:return _f(i);case S.Id:return n=>n.featureId;case S.GeometryType:return n=>n.geometryType;case S.Concat:{const n=i.args.map(s=>Jt(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case S.Resolution:return n=>n.resolution;case S.Any:case S.All:case S.Between:case S.In:case S.Not:return pf(i);case S.Equal:case S.NotEqual:case S.LessThan:case S.LessThanOrEqualTo:case S.GreaterThan:case S.GreaterThanOrEqualTo:return mf(i);case S.Multiply:case S.Divide:case S.Add:case S.Subtract:case S.Clamp:case S.Mod:case S.Pow:case S.Abs:case S.Floor:case S.Ceil:case S.Round:case S.Sin:case S.Cos:case S.Atan:case S.Sqrt:return yf(i);case S.Case:return xf(i);case S.Match:return wf(i);case S.Interpolate:return Ef(i);case S.ToString:return Cf(i);default:throw new Error(`Unsupported operator ${e}`)}}function gf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Jt(i.args[r]);switch(e){case S.Coalesce:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case S.Number:case S.String:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a===e)return a}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function _f(i,t){const n=i.args[0].value;switch(i.operator){case S.Get:return s=>{const r=i.args;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;o=o[c]}return o};case S.Var:return s=>s.variables[n];case S.Has:return s=>{const r=i.args;if(!(n in s.properties))return!1;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;if(!o||!Object.hasOwn(o,c))return!1;o=o[c]}return!0};default:throw new Error(`Unsupported accessor operator ${i.operator}`)}}function mf(i,t){const e=i.operator,n=Jt(i.args[0]),s=Jt(i.args[1]);switch(e){case S.Equal:return r=>n(r)===s(r);case S.NotEqual:return r=>n(r)!==s(r);case S.LessThan:return r=>n(r)<s(r);case S.LessThanOrEqualTo:return r=>n(r)<=s(r);case S.GreaterThan:return r=>n(r)>s(r);case S.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function pf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Jt(i.args[r]);switch(e){case S.Any:return r=>{for(let o=0;o<n;++o)if(s[o](r))return!0;return!1};case S.All:return r=>{for(let o=0;o<n;++o)if(!s[o](r))return!1;return!0};case S.Between:return r=>{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case S.In:return r=>{const o=s[0](r);for(let a=1;a<n;++a)if(o===s[a](r))return!0;return!1};case S.Not:return r=>!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function yf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Jt(i.args[r]);switch(e){case S.Multiply:return r=>{let o=1;for(let a=0;a<n;++a)o*=s[a](r);return o};case S.Divide:return r=>s[0](r)/s[1](r);case S.Add:return r=>{let o=0;for(let a=0;a<n;++a)o+=s[a](r);return o};case S.Subtract:return r=>s[0](r)-s[1](r);case S.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(o<a)return a;const l=s[2](r);return o>l?l:o};case S.Mod:return r=>s[0](r)%s[1](r);case S.Pow:return r=>Math.pow(s[0](r),s[1](r));case S.Abs:return r=>Math.abs(s[0](r));case S.Floor:return r=>Math.floor(s[0](r));case S.Ceil:return r=>Math.ceil(s[0](r));case S.Round:return r=>Math.round(s[0](r));case S.Sin:return r=>Math.sin(s[0](r));case S.Cos:return r=>Math.cos(s[0](r));case S.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case S.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function xf(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Jt(i.args[s]);return s=>{for(let r=0;r<e-1;r+=2)if(n[r](s))return n[r+1](s);return n[e-1](s)}}function wf(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Jt(i.args[s]);return s=>{const r=n[0](s);for(let o=1;o<e-1;o+=2)if(r===n[o](s))return n[o+1](s);return n[e-1](s)}}function Ef(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Jt(i.args[s]);return s=>{const r=n[0](s),o=n[1](s);let a,l;for(let h=2;h<e;h+=2){const c=n[h](s);let u=n[h+1](s);const d=Array.isArray(u);if(d&&(u=$d(u)),c>=o)return h===2?u:d?vf(r,o,a,l,c,u):fi(r,o,a,l,c,u);a=c,l=u}return l}}function Cf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=Jt(i.args[r]);switch(e){case S.ToString:return r=>{const o=s[0](r);return i.args[0].type===qt?Kr(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function fi(i,t,e,n,s,r){const o=s-e;if(o===0)return n;const a=t-e,l=i===1?a/o:(Math.pow(i,a)-1)/(Math.pow(i,o)-1);return n+l*(r-n)}function vf(i,t,e,n,s,r){if(s-e===0)return n;const a=xl(n),l=xl(r);let h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);const c=[fi(i,t,e,a[0],s,l[0]),fi(i,t,e,a[1],s,l[1]),a[2]+fi(i,t,e,0,s,h),fi(i,t,e,n[3],s,r[3])];return qd(c)}const j={IDLE:0,LOADING:1,LOADED:2,ERROR:3};function Sf(i,t,e){const n=i;let s=!0,r=!1,o=!1;const a=[Gi(n,V.LOAD,function(){o=!0,r||t()})];return n.src&&aa?(r=!0,n.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(Gi(n,V.ERROR,e)),function(){s=!1,a.forEach(at)}}function bf(i,t){return new Promise((e,n)=>{function s(){o(),e(i)}function r(){o(),n(new Error("Image load error"))}function o(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function Rf(i,t){return t&&(i.src=t),i.src&&aa?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):bf(i)}class Tf{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 t=0;for(const e in this.cache_){const n=this.cache_[e];(t++&3)===0&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const s=Hr(t,e,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,n){const s=Hr(t,e,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,n,s,r){const o=Hr(t,e,n),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===j.IDLE&&s.load(),s.getImageState()===j.LOADING?s.ready().then(()=>{this.patternCache_[o]=ls().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=ls().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function Hr(i,t,e){const n=e?Rn(e):"null";return t+":"+i+":"+n}const Xt=new Tf;let gi=null;class Tl extends Ni{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?j.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===j.LOADED){gi||(gi=gt(1,1,void 0,{willReadFrequently:!0})),gi.drawImage(this.image_,0,0);try{gi.getImageData(0,0,1,1),this.tainted_=!1}catch{gi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(V.CHANGE)}handleImageError_(){this.imageState_=j.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=j.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=gt(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===j.IDLE){this.image_||this.initializeImage_(),this.imageState_=j.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&Rf(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==j.LOADED)return;const e=this.image_,n=gt(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=jd(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===j.LOADED||this.imageState_===j.ERROR)t();else{const e=()=>{(this.imageState_===j.LOADED||this.imageState_===j.ERROR)&&(this.removeEventListener(V.CHANGE,e),t())};this.addEventListener(V.CHANGE,e)}})),this.ready_}}function $r(i,t,e,n,s,r){let o=t===void 0?void 0:Xt.get(t,e,s);return o||(o=new Tl(i,i&&"src"in i?i.src||void 0:t,e,n,s),Xt.set(t,e,s,o,r)),r&&o&&!Xt.getPattern(t,e,s)&&Xt.set(t,e,s,o,r),o}function ie(i){return i?Array.isArray(i)?Kr(i):typeof i=="object"&&"src"in i?If(i):i:null}function If(i){if(!i.offset||!i.size)return Xt.getPattern(i.src,"anonymous",i.color);const t=i.src+":"+i.offset,e=Xt.getPattern(t,void 0,i.color);if(e)return e;const n=Xt.get(i.src,"anonymous",null);if(n.getImageState()!==j.LOADED)return null;const s=gt(i.size[0],i.size[1]);return s.drawImage(n.getImage(1),i.offset[0],i.offset[1],i.size[0],i.size[1],0,0,i.size[0],i.size[1]),$r(s.canvas,t,void 0,j.LOADED,i.color,!0),Xt.getPattern(t,void 0,i.color)}const Il="10px sans-serif",Ft="#000",In="round",_e=[],me=0,Mn="round",_i=10,mi="#000",pi="center",_s="middle",Je=[0,0,0,0],yi=1,Ln=new te;let xi=null,Ml;const qr={},Mf=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function Lf(i,t,e){return`${i} ${t} 16px "${e}"`}const Af=(function(){let t,e;async function n(r){await e.ready;const o=await e.load(r);if(o.length===0)return!1;const a=Tr(r),l=a.families[0].toLowerCase(),h=a.weight;return o.some(c=>{const u=c.family.replace(/^['"]|['"]$/g,"").toLowerCase(),d=Rr[c.weight]||c.weight;return u===l&&c.style===a.style&&d==h})}async function s(){await e.ready;let r=!0;const o=Ln.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const h=a[l];let c=o[h];c<100&&(await n(h)?(Zn(qr),Ln.set(h,100)):(c+=10,Ln.set(h,c,!0),c<100&&(r=!1)))}t=void 0,r||(t=setTimeout(s,100))}return async function(r){e||(e=Vs?self.fonts:document.fonts);const o=Tr(r);if(!o)return;const a=o.families;let l=!1;for(const h of a){if(Mf.has(h))continue;const c=Lf(o.style,o.weight,h);Ln.get(c)===void 0&&(Ln.set(c,0,!0),l=!0)}l&&(clearTimeout(t),t=setTimeout(s,100))}})(),kf=(function(){let i;return function(t){let e=qr[t];if(e==null){if(Vs){const n=Tr(t),s=Ll(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=t,document.body.appendChild(i),e=i.offsetHeight,document.body.removeChild(i);qr[t]=e}return e}})();function Ll(i,t){return xi||(xi=gt(1,1)),i!=Ml&&(xi.font=i,Ml=xi.font),xi.measureText(t)}function Al(i,t){return Ll(i,t).width}function kl(i,t,e){if(t in e)return e[t];const n=t.split(`
|
|
6
|
-
`).reduce((s,r)=>Math.max(s,
|
|
7
|
-
`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=t[h+1]||i.font,f=Al(d,u);e.push(f),o+=f;const _=kf(d);n.push(_),l=Math.max(l,_)}return{width:r,height:a,widths:e,heights:n,lineWidths:s}}function Pf(i,t,e,n,s,r,o,a,l,h,c){i.save(),e!==1&&(i.globalAlpha===void 0?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(l,h),i.scale(c[0],c[1]),Df(n,i)):c[0]<0||c[1]<0?(i.translate(l,h),i.scale(c[0],c[1]),i.drawImage(n,s,r,o,a,0,0,o,a)):i.drawImage(n,s,r,o,a,l,h,o*c[0],a*c[1]),i.restore()}function Df(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;n<s;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}class ms{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Pt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new ms({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 J()}getImage(t){return J()}getHitDetectionImage(){return J()}getPixelRatio(t){return 1}getImageState(){return J()}getImageSize(){return J()}getOrigin(){return J()}getSize(){return J()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Pt(t)}listenImageChange(t){J()}load(){J()}unlistenImageChange(t){J()}ready(){return Promise.resolve()}}class ps extends ms{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?j.LOADING:j.LOADED,this.imageState_===j.LOADING&&this.ready().then(()=>this.imageState_=j.LOADED),this.render()}clone(){const t=this.getScale(),e=new ps({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const e=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(",");let s=Xt.get(n,null,null)?.getImage(1);if(!s){const r=this.renderOptions_,o=Math.ceil(r.size*t),a=gt(o,o);this.draw_(r,a,t),s=a.canvas,Xt.set(n,null,null,new Tl(s,void 0,null,j.LOADED,null))}return s}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const T=s;s=r,r=T}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),h=Math.sqrt(r*r-l*l),c=s-h,u=Math.sqrt(l*l+c*c),d=u/l;if(t==="miter"&&d<=n)return d*e;const f=e/2/d,_=e/2*(c/u),m=Math.sqrt((s+f)*(s+f)+_*_)-s;if(this.radius2_===void 0||t==="bevel")return m*2;const y=s*Math.sin(a),x=Math.sqrt(s*s-y*y),v=r-x,C=Math.sqrt(y*y+v*v)/y;if(C<=n){const T=C*e/2-r-s;return 2*Math.max(m,T)}return m*2}createRenderOptions(){let t=In,e=Mn,n=0,s=null,r=0,o,a=0;this.stroke_&&(o=ie(this.stroke_.getColor()??mi),a=this.stroke_.getWidth()??yi,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??Mn,t=this.stroke_.getLineCap()??In,n=this.stroke_.getMiterLimit()??_i);const l=this.calculateLineJoinSize_(e,a,n),h=Math.max(this.radius,this.radius2_||0),c=Math.ceil(2*h+l);return{strokeStyle:o,strokeWidth:a,size:c,lineCap:t,lineDash:s,lineDashOffset:r,lineJoin:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();s===null&&(s=Ft),e.fillStyle=ie(s),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor(),s=0;typeof n=="string"&&(n=Rn(n)),n===null?s=1:Array.isArray(n)&&(s=n.length===4?n[3]:1),s===0&&(e=gt(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const s=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;a++){const l=r+a*o,h=a%2===0?n:s;t.lineTo(h*Math.cos(l),h*Math.sin(l))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Ft,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class ys extends ps{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new ys({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}class wi{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new wi({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=$r(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===j.IDLE&&e.load(),e.getImageState()===j.LOADING&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?Q(t):typeof t=="object"&&"src"in t?t.src+":"+t.offset:Rn(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Ol(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class Ei extends ms{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;et(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Q(o)),et(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),et(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=j.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?j.LOADED:j.IDLE:l=j.LOADING:l=j.LOADED),this.color_=t.color!==void 0?Rn(t.color):null,this.iconImage_=$r(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(Ol(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(Ol(h,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Ei({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==j.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==j.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(V.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(V.CHANGE,t)}ready(){return this.iconImage_.ready()}}class xs{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new xs({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class ke{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=Dl,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new ke({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=Dl,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Ff(i){let t;if(typeof i=="function")t=i;else{let e;Array.isArray(i)?e=i:(et(typeof i.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[i]),t=function(){return e}}return t}let Jr=null;function Pl(i,t){if(!Jr){const e=new wi({color:"rgba(255,255,255,0.4)"}),n=new xs({color:"#3399CC",width:1.25});Jr=[new ke({image:new ys({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Jr}function Dl(i){return i.getGeometry()}const zf="#333";class Qr{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=Pt(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new wi({color:zf}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Qr({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Pt(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function Nf(i){return!0}function Gf(i){const t=El(),e=Wf(i,t),n=Rl();return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const o=s.getId();o!==void 0?n.featureId=o:n.featureId=null}return t.geometryType&&(n.geometryType=bl(s.getGeometry())),e(n)}}function Fl(i){const t=El(),e=i.length,n=new Array(e);for(let o=0;o<e;++o)n[o]=to(i[o],t);const s=Rl(),r=new Array(e);return function(o,a){if(s.properties=o.getPropertiesInternal(),s.resolution=a,t.featureId){const h=o.getId();h!==void 0?s.featureId=h:s.featureId=null}let l=0;for(let h=0;h<e;++h){const c=n[h](s);c&&(r[l]=c,l+=1)}return r.length=l,r}}function Wf(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s){const r=i[s],o="filter"in r?ge(r.filter,Rt,t):Nf;let a;if(Array.isArray(r.style)){const l=r.style.length;a=new Array(l);for(let h=0;h<l;++h)a[h]=to(r.style[h],t)}else a=[to(r.style,t)];n[s]={filter:o,styles:a}}return function(s){const r=[];let o=!1;for(let a=0;a<e;++a){const l=n[a].filter;if(l(s)&&!(i[a].else&&o)){o=!0;for(const h of n[a].styles){const c=h(s);c&&r.push(c)}}}return r}}function to(i,t){const e=Ci(i,"",t),n=vi(i,"",t),s=Uf(i,t),r=Xf(i,t),o=zt(i,"z-index",t);if(!e&&!n&&!s&&!r&&!un(i))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(i));const a=new ke;return function(l){let h=!0;if(e){const c=e(l);c&&(h=!1),a.setFill(c)}if(n){const c=n(l);c&&(h=!1),a.setStroke(c)}if(s){const c=s(l);c&&(h=!1),a.setText(c)}if(r){const c=r(l);c&&(h=!1),a.setImage(c)}return o&&a.setZIndex(o(l)),h?null:a}}function Ci(i,t,e){let n;if(t+"fill-pattern-src"in i)n=Kf(i,t+"fill-",e);else{if(i[t+"fill-color"]==="none")return r=>null;n=eo(i,t+"fill-color",e)}if(!n)return null;const s=new wi;return function(r){const o=n(r);return o===Nr?null:(s.setColor(o),s)}}function vi(i,t,e){const n=zt(i,t+"stroke-width",e),s=eo(i,t+"stroke-color",e);if(!n&&!s)return null;const r=pe(i,t+"stroke-line-cap",e),o=pe(i,t+"stroke-line-join",e),a=zl(i,t+"stroke-line-dash",e),l=zt(i,t+"stroke-line-dash-offset",e),h=zt(i,t+"stroke-miter-limit",e),c=new xs;return function(u){if(s){const d=s(u);if(d===Nr)return null;c.setColor(d)}if(n&&c.setWidth(n(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");c.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(d)}return a&&c.setLineDash(a(u)),l&&c.setLineDashOffset(l(u)),h&&c.setMiterLimit(h(u)),c}}function Uf(i,t){const e="text-",n=pe(i,e+"value",t);if(!n)return null;const s=Ci(i,e,t),r=Ci(i,e+"background-",t),o=vi(i,e,t),a=vi(i,e+"background-",t),l=pe(i,e+"font",t),h=zt(i,e+"max-angle",t),c=zt(i,e+"offset-x",t),u=zt(i,e+"offset-y",t),d=An(i,e+"overflow",t),f=pe(i,e+"placement",t),_=zt(i,e+"repeat",t),p=Es(i,e+"scale",t),m=An(i,e+"rotate-with-view",t),y=zt(i,e+"rotation",t),x=pe(i,e+"align",t),v=pe(i,e+"justify",t),w=pe(i,e+"baseline",t),C=An(i,e+"keep-upright",t),T=zl(i,e+"padding",t),b=vs(i,e+"declutter-mode"),R=new Qr({declutterMode:b});return function(I){if(R.setText(n(I)),s&&R.setFill(s(I)),r&&R.setBackgroundFill(r(I)),o&&R.setStroke(o(I)),a&&R.setBackgroundStroke(a(I)),l&&R.setFont(l(I)),h&&R.setMaxAngle(h(I)),c&&R.setOffsetX(c(I)),u&&R.setOffsetY(u(I)),d&&R.setOverflow(d(I)),f){const L=f(I);if(L!=="point"&&L!=="line")throw new Error("Expected point or line for text-placement");R.setPlacement(L)}if(_&&R.setRepeat(_(I)),p&&R.setScale(p(I)),m&&R.setRotateWithView(m(I)),y&&R.setRotation(y(I)),x){const L=x(I);if(L!=="left"&&L!=="center"&&L!=="right"&&L!=="end"&&L!=="start")throw new Error("Expected left, right, center, start, or end for text-align");R.setTextAlign(L)}if(v){const L=v(I);if(L!=="left"&&L!=="right"&&L!=="center")throw new Error("Expected left, right, or center for text-justify");R.setJustify(L)}if(w){const L=w(I);if(L!=="bottom"&&L!=="top"&&L!=="middle"&&L!=="alphabetic"&&L!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");R.setTextBaseline(L)}return T&&R.setPadding(T(I)),C&&R.setKeepUpright(C(I)),R}}function Xf(i,t){return"icon-src"in i?Bf(i,t):"shape-points"in i?Yf(i,t):"circle-radius"in i?Vf(i,t):null}function Bf(i,t){const e="icon-",n=e+"src",s=Ul(i[n],n),r=ws(i,e+"anchor",t),o=Es(i,e+"scale",t),a=zt(i,e+"opacity",t),l=ws(i,e+"displacement",t),h=zt(i,e+"rotation",t),c=An(i,e+"rotate-with-view",t),u=Gl(i,e+"anchor-origin"),d=Wl(i,e+"anchor-x-units"),f=Wl(i,e+"anchor-y-units"),_=$f(i,e+"color"),p=jf(i,e+"cross-origin"),m=Hf(i,e+"offset"),y=Gl(i,e+"offset-origin"),x=Cs(i,e+"width"),v=Cs(i,e+"height"),w=Zf(i,e+"size"),C=vs(i,e+"declutter-mode"),T=new Ei({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:_,crossOrigin:p,offset:m,offsetOrigin:y,height:v,width:x,size:w,declutterMode:C});return function(b){return a&&T.setOpacity(a(b)),l&&T.setDisplacement(l(b)),h&&T.setRotation(h(b)),c&&T.setRotateWithView(c(b)),o&&T.setScale(o(b)),r&&T.setAnchor(r(b)),T}}function Yf(i,t){const e="shape-",n=e+"points",s=e+"radius",r=no(i[n],n),o=no(i[s],s),a=Ci(i,e,t),l=vi(i,e,t),h=Es(i,e+"scale",t),c=ws(i,e+"displacement",t),u=zt(i,e+"rotation",t),d=An(i,e+"rotate-with-view",t),f=Cs(i,e+"radius2"),_=Cs(i,e+"angle"),p=vs(i,e+"declutter-mode"),m=new ps({points:r,radius:o,radius2:f,angle:_,declutterMode:p});return function(y){return a&&m.setFill(a(y)),l&&m.setStroke(l(y)),c&&m.setDisplacement(c(y)),u&&m.setRotation(u(y)),d&&m.setRotateWithView(d(y)),h&&m.setScale(h(y)),m}}function Vf(i,t){const e="circle-",n=Ci(i,e,t),s=vi(i,e,t),r=zt(i,e+"radius",t),o=Es(i,e+"scale",t),a=ws(i,e+"displacement",t),l=zt(i,e+"rotation",t),h=An(i,e+"rotate-with-view",t),c=vs(i,e+"declutter-mode"),u=new ys({radius:5,declutterMode:c});return function(d){return r&&u.setRadius(r(d)),n&&u.setFill(n(d)),s&&u.setStroke(s(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),h&&u.setRotateWithView(h(d)),o&&u.setScale(o(d)),u}}function zt(i,t,e){if(!(t in i))return;const n=ge(i[t],$,e);return function(s){return no(n(s),t)}}function pe(i,t,e){if(!(t in i))return null;const n=ge(i[t],Dt,e);return function(s){return Ul(n(s),t)}}function Kf(i,t,e){const n=pe(i,t+"pattern-src",e),s=Nl(i,t+"pattern-offset",e),r=Nl(i,t+"pattern-size",e),o=eo(i,t+"color",e);return function(a){return{src:n(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function An(i,t,e){if(!(t in i))return null;const n=ge(i[t],Rt,e);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function eo(i,t,e){if(!(t in i))return null;const n=ge(i[t],qt,e);return function(s){return Xl(n(s),t)}}function zl(i,t,e){if(!(t in i))return null;const n=ge(i[t],qe,e);return function(s){return Si(n(s),t)}}function ws(i,t,e){if(!(t in i))return null;const n=ge(i[t],qe,e);return function(s){const r=Si(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function Nl(i,t,e){if(!(t in i))return null;const n=ge(i[t],qe,e);return function(s){return Bl(n(s),t)}}function Es(i,t,e){if(!(t in i))return null;const n=ge(i[t],qe|$,e);return function(s){return qf(n(s),t)}}function Cs(i,t){const e=i[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function Zf(i,t){const e=i[t];if(e!==void 0){if(typeof e=="number")return Pt(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function jf(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Gl(i,t){const e=i[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Wl(i,t){const e=i[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function Hf(i,t){const e=i[t];if(e!==void 0)return Si(e,t)}function vs(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function $f(i,t){const e=i[t];if(e!==void 0)return Xl(e,t)}function Si(i,t){if(!Array.isArray(i))throw new Error(`Expected an array for ${t}`);const e=i.length;for(let n=0;n<e;++n)if(typeof i[n]!="number")throw new Error(`Expected an array of numbers for ${t}`);return i}function Ul(i,t){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);return i}function no(i,t){if(typeof i!="number")throw new Error(`Expected a number for ${t}`);return i}function Xl(i,t){if(typeof i=="string")return i;const e=Si(i,t),n=e.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Bl(i,t){const e=Si(i,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function qf(i,t){return typeof i=="number"?i:Bl(i,t)}const Yl={RENDER_ORDER:"renderOrder"};class Vl extends cs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Yl.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new ml(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Yl.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Pl:t;const e=Jf(t);this.styleFunction_=t===null?void 0:Ff(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function Jf(i){if(i===void 0)return Pl;if(!i)return null;if(typeof i=="function"||i instanceof ke)return i;if(!Array.isArray(i))return Fl([i]);if(i.length===0)return[];const t=i.length,e=i[0];if(e instanceof ke){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!(o instanceof ke))throw new Error("Expected a list of style instances");s[r]=o}return s}if("style"in e){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!("style"in o))throw new Error("Expected a list of rules with a style property");s[r]=o}return Gf(s)}return Fl(i)}class Kl extends ue{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}class Qf extends Fi{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){J()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;fe(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ua(s,n)}forEachFeatureAtCoordinate(t,e,n,s,r,o,a,l){let h;const c=e.viewState;function u(w,C,T,b){return r.call(o,C,w?T:null,b)}const d=c.projection,f=Ea(t.slice(),d),_=[[0,0]];if(d.canWrapX()&&s){const w=d.getExtent(),C=st(w);_.push([-C,0],[C,0])}const p=e.layerStatesArray,m=p.length,y=[],x=[];for(let w=0;w<_.length;w++)for(let C=m-1;C>=0;--C){const T=p[C],b=T.layer;if(b.hasRenderer()&&Dr(T,c)&&a.call(l,b)){const R=b.getRenderer(),I=b.getSource();if(R&&I){const L=I.getWrapX()?f:t,k=u.bind(null,T.managed);x[0]=L[0]+_[w][0],x[1]=L[1]+_[w][1],h=R.forEachFeatureAtCoordinate(x,e,n,k,y)}if(h)return h}}if(y.length===0)return;const v=1/y.length;return y.forEach((w,C)=>w.distanceSq+=C*v),y.sort((w,C)=>w.distanceSq-C.distanceSq),y.some(w=>h=w.callback(w.feature,w.layer,w.geometry)),h}hasFeatureAtCoordinate(t,e,n,s,r,o){return this.forEachFeatureAtCoordinate(t,e,n,s,Vn,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){J()}scheduleExpireIconCache(t){Xt.canExpireCache()&&t.postRenderFunctions.push(tg)}}function tg(i,t){Xt.expire()}class eg extends Qf{constructor(t){super(t),this.fontChangeListenerKey_=q(Ln,cn.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=as+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const s=new Kl(t,void 0,e);n.dispatchEvent(s)}}disposeInternal(){at(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Ut.PRECOMPOSE,t);const e=t.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);e.some(a=>a.layer instanceof Vl&&a.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=e.length;a<l;++a){const h=e[a];t.layerIndex=a;const c=h.layer,u=c.getSourceState();if(!Dr(h,s)||u!="ready"&&u!="undefined"){c.unrender();continue}const d=c.render(t,o);d&&(d!==o&&(this.children_.push(d),o=d),r.push(h))}this.declutter(t,r),cd(this.element_,this.children_),this.dispatchRenderEvent(Ut.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const s=e[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(n=>n.layer.renderDeferred(t))}}}function Zl(i){if(i instanceof cs){i.setMapInternal(null);return}i instanceof vn&&i.getLayers().forEach(Zl)}function jl(i,t){if(i instanceof cs){i.setMapInternal(t);return}if(i instanceof vn){const e=i.getLayers().getArray();for(let n=0,s=e.length;n<s;++n)jl(e[n],t)}}let ng=class extends te{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=ig(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:Pc,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=$t(),this.pixelToCoordinateTransform_=$t(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||gd(),this.interactions=e.interactions||Fd({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new zc(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(vt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(vt.VIEW,this.handleViewChanged_),this.addChangeListener(vt.SIZE,this.handleSizeChanged_),this.addChangeListener(vt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const n=this;t.view&&!(t.view instanceof ne)&&t.view.then(function(s){n.setView(new ne(s))}),this.controls.addEventListener(At.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(At.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(At.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(At.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(At.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(At.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){jl(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.layerFilter!==void 0?n.layerFilter:Vn,a=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,e,null,o,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},e),n}getAllLayers(){const t=[];function e(n){n.forEach(function(s){s instanceof vn?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:Vn,r=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],o=n.height/s[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-n.left)/r,(a.clientY-n.top)/o]}getTarget(){return this.get(vt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return gr(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?pt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(vt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof ee){e.setLayers(t);return}const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const s=t[e];if(!s.visible)continue;const r=s.layer.getRenderer();if(r&&!r.ready)return!0;const o=s.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(t){const e=de(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?pt(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(vt.SIZE)}getView(){return this.get(vt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,s){return Nc(this.frameState_,t,e,n,s)}handleBrowserEvent(t,e){e=e||t.type;const n=new Se(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if(n===Ks.POINTERDOWN||n===V.WHEEL||n===V.KEYDOWN){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=e.target,a=r instanceof ShadowRoot?r.host===o?r.host.ownerDocument:r:r===s?s.documentElement:r;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const s=this.getInteractions().getArray().slice();for(let r=s.length-1;r>=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const o=t.viewHints;if(o[St.ANIMATING]||o[St.INTERACTING]){const a=Date.now()-t.time>8;s=a?0:8,r=a?0:2}}e.getTilesLoading()<s&&(e.reprioritize(),e.loadMoreTiles(s,r))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(Ut.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Ut.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new dn(be.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new dn(be.LOADSTART,this,t))));const n=this.postRenderFunctions_;if(t)for(let s=0,r=n.length;s<r;++s)n[s](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,s=this.targetChangeHandlerKeys_.length;n<s;++n)at(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(V.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(V.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host),this.setSize(void 0)}const t=this.getTarget(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)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{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new eg(this)),this.mapBrowserEventHandler_=new Dc(this,this.moveTolerance_);for(const r in ct)this.mapBrowserEventHandler_.addEventListener(ct[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(V.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(V.WHEEL,this.boundHandleBrowserEvent_,la?{passive:!1}:!1);let n;if(this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{const r=e.getRootNode();n=r instanceof ShadowRoot?r.host:e}this.targetChangeHandlerKeys_=[q(n,V.KEYDOWN,this.handleBrowserEvent,this),q(n,V.KEYPRESS,this.handleBrowserEvent,this)];const s=e.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(at(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(at(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=q(t,cn.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=q(t,V.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(at),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Le("addlayer",t)),this.layerGroupPropertyListenerKeys_=[q(t,cn.PROPERTYCHANGE,this.render,this),q(t,V.CHANGE,this.render,this),q(t,"addlayer",this.handleLayerAdd_,this),q(t,"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;const t=this.frameState_.layerStatesArray;for(let e=0,n=t.length;e<n;++e){const s=t[e].layer;s.hasRenderer()&&s.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Zl(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(e!==void 0&&wl(e)&&n&&n.isDef()){const o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:Js(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Q(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=Js(a.nextCenter,a.nextResolution,l,e)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),s&&(!this.previousExtent_||!Hi(this.previousExtent_)&&!$n(r.extent,this.previousExtent_))&&(this.dispatchEvent(new dn(be.MOVESTART,this,s)),this.previousExtent_=Vi(this.previousExtent_)),this.previousExtent_&&!r.viewHints[St.ANIMATING]&&!r.viewHints[St.INTERACTING]&&!$n(r.extent,this.previousExtent_)&&(this.dispatchEvent(new dn(be.MOVEEND,this,r)),da(r.extent,this.previousExtent_))),this.dispatchEvent(new dn(be.POSTRENDER,this,r)),this.renderComplete_=(this.hasListener(be.LOADSTART)||this.hasListener(be.LOADEND)||this.hasListener(Ut.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Le("removelayer",e)),this.set(vt.LAYERGROUP,t)}setSize(t){this.set(vt.SIZE,t)}setTarget(t){this.set(vt.TARGET,t)}setView(t){if(!t||t instanceof ne){this.set(vt.VIEW,t);return}this.set(vt.VIEW,new ne);const e=this;t.then(function(n){e.setView(new ne(n))})}updateSize(){const t=this.getTargetElement();let e;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(e=[Math.max(0,r),Math.max(0,o)],!wl(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Sa("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!ve(e,n))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};function ig(i){let t=null;i.keyboardEventTarget!==void 0&&(t=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const e={},n=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new vn({layers:i.layers});e[vt.LAYERGROUP]=n,e[vt.TARGET]=i.target,e[vt.VIEW]=i.view instanceof ne?i.view:new ne;let s;i.controls!==void 0&&(Array.isArray(i.controls)?s=new ee(i.controls.slice()):(et(typeof i.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=i.controls));let r;i.interactions!==void 0&&(Array.isArray(i.interactions)?r=new ee(i.interactions.slice()):(et(typeof i.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=i.interactions));let o;return i.overlays!==void 0?Array.isArray(i.overlays)?o=new ee(i.overlays.slice()):(et(typeof i.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=i.overlays):o=new ee,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}class io extends Ni{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(V.CHANGE)}release(){this.setState(z.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==z.EMPTY){if(this.state!==z.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){J()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=e-n+1e3/60;return s>=this.transition_?1:Ca(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function so(i){return i instanceof Image||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageBitmap?i:null}const sg=new Error("disposed"),rg=[256,256];class Hl extends io{constructor(t){const e=z.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=so(this.data_);return t?[t.width,t.height]:rg}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==z.IDLE&&this.state!==z.ERROR)return;this.state=z.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=z.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=z.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(sg),this.controller_=null),super.disposeInternal()}}class $l extends io{constructor(t,e,n,s,r,o){super(t,e,o),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=z.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=z.ERROR,this.unlistenImage_(),this.image_=og(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=z.LOADED:this.state=z.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==z.ERROR&&(this.state=z.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==z.IDLE&&(this.state=z.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Sf(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 og(){const i=gt(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}class ro{constructor(t,e,n,s){this.minX=t,this.maxX=e,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function kn(i,t,e,n,s){return s!==void 0?(s.minX=i,s.maxX=t,s.minY=e,s.maxY=n,s):new ro(i,t,e,n)}let oo;const On=[];function ql(i,t,e,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(t,e),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(t,n)+1,Math.max(e,s)),i.restore()}function ao(i,t){return Math.abs(i[t*4]-210)>2||Math.abs(i[t*4+3]-.75*255)>2}function ag(){if(oo===void 0){const i=gt(6,6,On);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",ql(i,4,5,4,0),ql(i,4,5,0,5);const t=i.getImageData(0,0,3,3).data;oo=ao(t,0)||ao(t,4)||ao(t,8),hs(i),On.push(i.canvas)}return oo}function Jl(i,t,e,n){const s=fr(e,t,i);let r=Na(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=i.getMetersPerUnit();a!==void 0&&(r/=a);const l=i.getExtent();if(!l||_n(l,s)){const h=Na(i,r,s)/r;isFinite(h)&&h>0&&(r/=h)}return r}function lg(i,t,e,n){const s=Xe(e);let r=Jl(i,t,s,n);return(!isFinite(r)||r<=0)&&pa(e,function(o){return r=Jl(i,t,o,n),isFinite(r)&&r>0}),r}function hg(i,t,e,n,s,r,o,a,l,h,c,u,d,f){const _=gt(Math.round(e*i),Math.round(e*t),On);if(u||(_.imageSmoothingEnabled=!1),l.length===0)return _.canvas;_.scale(e,e);function p(C){return Math.round(C*e)/e}_.globalCompositeOperation="lighter";const m=Gt();l.forEach(function(C,T,b){Xc(m,C.extent)});let y;const x=e/n,v=(u?1:1+Math.pow(2,-24))/x;y=gt(Math.round(st(m)*x),Math.round(bt(m)*x),On),u||(y.imageSmoothingEnabled=!1),l.forEach(function(C,T,b){if(C.image.width>0&&C.image.height>0){if(C.clipExtent){y.save();const A=(C.clipExtent[0]-m[0])*x,O=-(C.clipExtent[3]-m[3])*x,P=st(C.clipExtent)*x,U=bt(C.clipExtent)*x;y.rect(u?A:Math.round(A),u?O:Math.round(O),u?P:Math.round(A+P)-Math.round(A),u?U:Math.round(O+U)-Math.round(O)),y.clip()}const R=(C.extent[0]-m[0])*x,I=-(C.extent[3]-m[3])*x,L=st(C.extent)*x,k=bt(C.extent)*x;y.drawImage(C.image,h,h,C.image.width-2*h,C.image.height-2*h,u?R:Math.round(R),u?I:Math.round(I),u?L:Math.round(R+L)-Math.round(R),u?k:Math.round(I+k)-Math.round(I)),C.clipExtent&&y.restore()}});const w=Ye(o);return a.getTriangles().forEach(function(C,T,b){const R=C.source,I=C.target;let L=R[0][0],k=R[0][1],A=R[1][0],O=R[1][1],P=R[2][0],U=R[2][1];const N=p((I[0][0]-w[0])/r),X=p(-(I[0][1]-w[1])/r),F=p((I[1][0]-w[0])/r),Z=p(-(I[1][1]-w[1])/r),H=p((I[2][0]-w[0])/r),nt=p(-(I[2][1]-w[1])/r),M=L,yt=k;L=0,k=0,A-=M,O-=yt,P-=M,U-=yt;const Ct=[[A,O,0,0,F-N],[P,U,0,0,H-N],[0,0,A,O,Z-X],[0,0,P,U,nt-X]],ht=Wc(Ct);if(!ht)return;if(_.save(),_.beginPath(),ag()||!u){_.moveTo(F,Z);const xt=4,G=N-F,it=X-Z;for(let B=0;B<xt;B++)_.lineTo(F+p((B+1)*G/xt),Z+p(B*it/(xt-1))),B!=xt-1&&_.lineTo(F+p((B+1)*G/xt),Z+p((B+1)*it/(xt-1)));_.lineTo(H,nt)}else _.moveTo(F,Z),_.lineTo(N,X),_.lineTo(H,nt);_.clip(),_.transform(ht[0],ht[2],ht[1],ht[3],N,X),_.translate(m[0]-M,m[3]-yt);let Tt;if(y)Tt=y.canvas,_.scale(v,-v);else{const xt=l[0],G=xt.extent;Tt=xt.image,_.scale(st(G)/Tt.width,-bt(G)/Tt.height)}_.drawImage(Tt,0,0),_.restore()}),y&&(hs(y),On.push(y.canvas)),c&&(_.save(),_.globalCompositeOperation="source-over",_.strokeStyle="black",_.lineWidth=1,a.getTriangles().forEach(function(C,T,b){const R=C.target,I=(R[0][0]-w[0])/r,L=-(R[0][1]-w[1])/r,k=(R[1][0]-w[0])/r,A=-(R[1][1]-w[1])/r,O=(R[2][0]-w[0])/r,P=-(R[2][1]-w[1])/r;_.beginPath(),_.moveTo(k,A),_.lineTo(I,L),_.lineTo(O,P),_.closePath(),_.stroke()}),_.restore()),_.canvas}const cg=10,Ql=.25;class ug{constructor(t,e,n,s,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const h=a?bu(v=>pt(a,fr(v,this.targetProj_,this.sourceProj_))):ns(this.targetProj_,this.sourceProj_);this.transformInv_=function(v){const w=v[0]+"/"+v[1];return l[w]||(l[w]=h(v)),l[w]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&st(s)>=st(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?st(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?st(this.targetProj_.getExtent()):null;const c=Ye(n),u=ji(n),d=Zi(n),f=Ki(n),_=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(f),x=cg+(o?Math.max(0,Math.ceil(Math.log2(qs(n)/(o*o*256*256)))):0);if(this.addQuad_(c,u,d,f,_,p,m,y,x),this.wrapsXInSource_){let v=1/0;this.triangles_.forEach(function(w,C,T){v=Math.min(v,w.source[0][0],w.source[1][0],w.source[2][0])}),this.triangles_.forEach(w=>{if(Math.max(w.source[0][0],w.source[1][0],w.source[2][0])-v>this.sourceWorldWidth_/2){const C=[[w.source[0][0],w.source[0][1]],[w.source[1][0],w.source[1][1]],[w.source[2][0],w.source[2][1]]];C[0][0]-v>this.sourceWorldWidth_/2&&(C[0][0]-=this.sourceWorldWidth_),C[1][0]-v>this.sourceWorldWidth_/2&&(C[1][0]-=this.sourceWorldWidth_),C[2][0]-v>this.sourceWorldWidth_/2&&(C[2][0]-=this.sourceWorldWidth_);const T=Math.min(C[0][0],C[1][0],C[2][0]);Math.max(C[0][0],C[1][0],C[2][0])-T<this.sourceWorldWidth_/2&&(w.source=C)}})}l={}}addTriangle_(t,e,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[t,e,n]})}addQuad_(t,e,n,s,r,o,a,l,h){const c=ua([r,o,a,l]),u=this.sourceWorldWidth_?st(c)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1;let _=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=ua([t,e,n,s]);_=st(m)/this.targetWorldWidth_>Ql||_}!f&&this.sourceProj_.isGlobal()&&u&&(_=u>Ql||_)}if(!_&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!kt(c,this.maxSourceExtent_))return;let p=0;if(!_&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)_=!0;else if(p=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(h>0){if(!_){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(m);let x;f?x=(gn(r[0],d)+gn(a[0],d))/2-gn(y[0],d):x=(r[0]+a[0])/2-y[0];const v=(r[1]+a[1])/2-y[1];_=x*x+v*v>this.errorThresholdSquared_}if(_){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(m),x=[(s[0]+t[0])/2,(s[1]+t[1])/2],v=this.transformInv_(x);this.addQuad_(t,e,m,x,r,o,y,v,h-1),this.addQuad_(x,m,n,s,v,y,a,l,h-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(m),x=[(n[0]+s[0])/2,(n[1]+s[1])/2],v=this.transformInv_(x);this.addQuad_(t,m,x,s,r,y,v,l,h-1),this.addQuad_(m,e,n,x,y,o,a,v,h-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(t,n,s,r,a,l),(p&14)==0&&this.addTriangle_(t,n,e,r,a,o),p&&((p&13)==0&&this.addTriangle_(e,s,t,o,l,r),(p&7)==0&&this.addTriangle_(e,s,n,o,l,a))}calculateSourceExtent(){const t=Gt();return this.triangles_.forEach(function(e,n,s){const r=e.source;qn(t,r[0]),qn(t,r[1]),qn(t,r[2])}),t}getTriangles(){return this.triangles_}}const dg=.5;class th extends io{constructor(t,e,n,s,r,o,a,l,h,c,u,d){super(r,z.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const f=s.getTileCoordExtent(this.wrappedTileCoord_),_=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const m=_?Be(f,_):f;if(qs(m)===0){this.state=z.EMPTY;return}const y=t.getExtent();y&&(p?p=Be(p,y):p=y);const x=s.getResolution(this.wrappedTileCoord_[0]),v=lg(t,n,m,x);if(!isFinite(v)||v<=0){this.state=z.EMPTY;return}const w=c!==void 0?c:dg;if(this.triangulation_=new ug(t,n,m,p,v*w,x),this.triangulation_.getTriangles().length===0){this.state=z.EMPTY;return}this.sourceZ_=e.getZForResolution(v);let C=this.triangulation_.calculateSourceExtent();if(p&&(t.canWrapX()?(C[1]=lt(C[1],p[1],p[3]),C[3]=lt(C[3],p[1],p[3])):C=Be(C,p)),!qs(C))this.state=z.EMPTY;else{let T=0,b=0;t.canWrapX()&&(T=st(y),b=Math.floor((C[0]-y[0])/T)),wa(C.slice(),t,!0).forEach(I=>{const L=e.getTileRangeForExtentAndZ(I,this.sourceZ_);for(let k=L.minX;k<=L.maxX;k++)for(let A=L.minY;A<=L.maxY;A++){const O=h(this.sourceZ_,k,A,a);if(O){const P=b*T;this.sourceTiles_.push({tile:O,offset:P})}}++b}),this.sourceTiles_.length===0&&(this.state=z.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const n=e.tile;if(n&&n.getState()==z.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=z.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=hg(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=z.LOADED}this.changed()}load(){if(this.state==z.IDLE){this.state=z.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==z.IDLE||n==z.LOADING){t++;const s=q(e,V.CHANGE,r=>{const o=e.getState();(o==z.LOADED||o==z.ERROR||o==z.EMPTY)&&(at(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,s){e.getState()==z.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(at),this.sourcesListenerKeys_=null}release(){this.canvas_&&(hs(this.canvas_.getContext("2d")),On.push(this.canvas_),this.canvas_=null),super.release()}}class fg{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof Fi&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return et(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(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(t){const e=this.entries_[t];return et(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){et(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function Ss(i,t,e,n){return n!==void 0?(n[0]=i,n[1]=t,n[2]=e,n):[i,t,e]}function gg(i,t,e){return i+"/"+t+"/"+e}function _g(i){return mg(i[0],i[1],i[2])}function mg(i,t,e){return(t<<i)+e}function pg(i,t){const e=i[0],n=i[1],s=i[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(n,s):!0}class eh{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ls(),{get:(t,e)=>{if(typeof ls()[e]=="function")return this.push_(e),this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n<s;++n){const r=e[n];if(typeof r=="function"){r(t);continue}const o=e[++n];if(typeof t[r]=="function")t[r](...o);else{if(typeof o=="function"){t[r]=o(t);continue}t[r]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const yg=5;class xg extends jn{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=yg}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return J()}getData(t){return null}prepareFrame(t){return J()}renderFrame(t,e){return J()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===j.LOADED||e.getState()===j.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=j.LOADED&&e!=j.ERROR&&t.addEventListener(V.CHANGE,this.boundHandleImageChange_),e==j.IDLE&&(t.load(),e=t.getState()),e==j.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const nh=[];let Pn=null;function wg(){Pn=gt(1,1,void 0,{willReadFrequently:!0})}class ih extends xg{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=$t(),this.pixelTransform=$t(),this.inversePixelTransform=$t(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){Pn||wg(),Pn.clearRect(0,0,1,1);let s;try{Pn.drawImage(t,e,n,1,1,0,0,1,1),s=Pn.getImageData(0,0,1,1).data}catch{return Pn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&ve(Rn(t.style.backgroundColor),Rn(n)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&ku(o.canvas.style.transform,e)?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=gt();const l=o.canvas;r.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=Ye(n),r=ji(n),o=Zi(n),a=Ki(n);pt(e.coordinateToPixelTransform,s),pt(e.coordinateToPixelTransform,r),pt(e.coordinateToPixelTransform,o),pt(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;pt(l,s),pt(l,r),pt(l,o),pt(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,a=Math.round(st(n)/s*o),l=Math.round(bt(n)/s*o);fe(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-a/2,-l/2),Ua(this.inversePixelTransform,this.pixelTransform);const h=Au(this.pixelTransform);if(this.useContainer(e,h,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=a||c.height!=l?(c.width=a,c.height=l):this.context.clearRect(0,0,a,l),h!==c.style.transform&&(c.style.transform=h)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new Kl(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Ut.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Ut.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new eh),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Ut.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Ut.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,o,a){const l=r/2,h=o/2,c=s/e,u=-c,d=-t[0]+a,f=-t[1];return fe(this.tempTransform,l,h,c,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function lo(i,t,e,n,s){return`${Q(i)},${t},${gg(e,n,s)}`}function ho(i,t,e){if(!(e in i))return i[e]=new Set([t]),!0;const n=i[e],s=n.has(t);return s||n.add(t),!s}function Eg(i,t,e){const n=i[e];return n?n.delete(t):!1}function sh(i,t){const e=i.layerStatesArray[i.layerIndex];e.extent&&(t=Be(t,Ie(e.extent,i.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(i.viewState.projection).getExtent();s&&(t=Be(t,s))}return t}class Cg extends ih{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Gt(),this.tempTileRange_=new ro(0,0,0,0),this.tempTileCoord_=Ss(0,0,0);const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new fg(n),this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,n,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=lo(a,a.getKey(),t,e,n);let h;if(r.containsKey(l))h=r.get(l);else{if(h=a.getTile(t,e,n,s.pixelRatio,s.viewState.projection),!h)return null;r.set(l,h)}return h}getTile(t,e,n,s){const r=this.getOrCreateTile(t,e,n,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=pt(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!_n(r,s))return null;const o=e.viewState,a=n.getRenderSource(),l=a.getTileGridForProjection(o.projection),h=a.getTilePixelRatio(e.pixelRatio);for(let c=l.getZForResolution(o.resolution);c>=l.getMinZoom();--c){const u=l.getTileCoordForCoordAndZ(s,c),d=this.getTile(c,u[1],u[2],e);if(!d||d.getState()!==z.LOADED)continue;const f=l.getOrigin(c),_=Pt(l.getTileSize(c)),p=l.getResolution(c);let m;if(d instanceof $l||d instanceof th)m=d.getImage();else if(d instanceof Hl){if(m=so(d.getData()),!m)continue}else continue;const y=Math.floor(h*((s[0]-f[0])/p-u[1]*_[0])),x=Math.floor(h*((f[1]-s[1])/p-u[2]*_[1])),v=Math.round(h*a.getGutterForProjection(o.projection));return this.getImageData(m,y+v,x+v)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=n,!0}enqueueTiles(t,e,n,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=Q(l);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=a.getMapInternal(),f=Math.max(n-r,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection)),_=o.rotation,p=_?ya(o.center,o.resolution,_,t.size):void 0;for(let m=n;m>=f;--m){const y=h.getTileRangeForExtentAndZ(e,m,this.tempTileRange_),x=h.getResolution(m);for(let v=y.minX;v<=y.maxX;++v)for(let w=y.minY;w<=y.maxY;++w){if(_&&!h.tileCoordIntersectsViewport([m,v,w],p))continue;const C=this.getTile(m,v,w,t);if(!C||!ho(s,C,m))continue;const b=C.getKey();if(u[b]=!0,C.getState()===z.IDLE&&!t.tileQueue.isKeyQueued(b)){const R=Ss(m,v,w,this.tempTileCoord_);t.tileQueue.enqueue([C,c,h.getTileCoordCenter(R),x])}}}}findStaleTile_(t,e){const n=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const h=lo(this.getLayer().getSource(),a[l],s,r,o);if(n.containsKey(h)){const c=n.peek(h);if(c.getState()===z.LOADED)return c.endTransition(Q(this)),ho(e,c,s),!0}}return!1}findAltTiles_(t,e,n,s){const r=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!r)return!1;let o=!0;const a=this.tileCache_,l=this.getLayer().getRenderSource(),h=l.getKey();for(let c=r.minX;c<=r.maxX;++c)for(let u=r.minY;u<=r.maxY;++u){const d=lo(l,h,n,c,u);let f=!1;if(a.containsKey(d)){const _=a.peek(d);_.getState()===z.LOADED&&(ho(s,_,n),f=!0)}f||(o=!1)}return o}renderFrame(t,e){this.renderComplete=!0;const n=t.layerStatesArray[t.layerIndex],s=t.viewState,r=s.projection,o=s.resolution,a=s.center,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),u=c.getTileGridForProjection(r),d=u.getZForResolution(o,c.zDirection),f=u.getResolution(d),_=c.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==_&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=_):this.renderedSourceKey_=_;let p=t.extent;const m=c.getTilePixelRatio(l);this.prepareContainer(t,e);const y=this.context.canvas.width,x=this.context.canvas.height,v=n.extent&&Ie(n.extent);v&&(p=Be(p,Ie(n.extent)));const w=f*y/2/m,C=f*x/2/m,T=[a[0]-w,a[1]-C,a[0]+w,a[1]+C],b={};this.renderedTiles.length=0;const R=h.getPreload();if(t.nextExtent){const F=u.getZForResolution(s.nextResolution,c.zDirection),Z=sh(t,t.nextExtent);this.enqueueTiles(t,Z,F,b,R)}const I=sh(t,p);if(this.enqueueTiles(t,I,d,b,0),R>0&&setTimeout(()=>{this.enqueueTiles(t,I,d-1,b,R-1)},0),!(d in b))return this.container;const L=Q(this),k=t.time;for(const F of b[d]){const Z=F.getState();if(Z===z.EMPTY)continue;const H=F.tileCoord;if(Z===z.LOADED&&F.getAlpha(L,k)===1){F.endTransition(L);continue}if(Z!==z.ERROR&&(this.renderComplete=!1),this.findStaleTile_(H,b)){Eg(b,F,d),t.animate=!0;continue}if(this.findAltTiles_(u,H,d+1,b))continue;const yt=u.getMinZoom();for(let Ct=d-1;Ct>=yt&&!this.findAltTiles_(u,H,Ct,b);--Ct);}const A=f/o*l/m,O=this.getRenderContext(t);fe(this.tempTransform,y/2,x/2,A,A,0,-y/2,-x/2),n.extent&&this.clipUnrotated(O,t,v),c.getInterpolate()||(O.imageSmoothingEnabled=!1),this.preRender(O,t);const P=Object.keys(b).map(Number);P.sort(ce);let U;const N=[],X=[];for(let F=P.length-1;F>=0;--F){const Z=P[F],H=c.getTilePixelSize(Z,l,r),M=u.getResolution(Z)/f,yt=H[0]*M*A,Ct=H[1]*M*A,ht=u.getTileCoordForCoordAndZ(Ye(T),Z),Tt=u.getTileCoordExtent(ht),xt=pt(this.tempTransform,[m*(Tt[0]-T[0])/f,m*(T[3]-Tt[3])/f]),G=m*c.getGutterForProjection(r);for(const it of b[Z]){if(it.getState()!==z.LOADED)continue;const B=it.tileCoord,ft=ht[1]-B[1],Yt=Math.round(xt[0]-(ft-1)*yt),en=ht[2]-B[2],nn=Math.round(xt[1]-(en-1)*Ct),Vt=Math.round(xt[0]-ft*yt),re=Math.round(xt[1]-en*Ct),zn=Yt-Vt,Nn=nn-re,Ri=P.length===1;let sn=!1;U=[Vt,re,Vt+zn,re,Vt+zn,re+Nn,Vt,re+Nn];for(let Gn=0,Wn=N.length;Gn<Wn;++Gn)if(!Ri&&Z<X[Gn]){const wt=N[Gn];kt([Vt,re,Vt+zn,re+Nn],[wt[0],wt[3],wt[4],wt[7]])&&(sn||(O.save(),sn=!0),O.beginPath(),O.moveTo(U[0],U[1]),O.lineTo(U[2],U[3]),O.lineTo(U[4],U[5]),O.lineTo(U[6],U[7]),O.moveTo(wt[6],wt[7]),O.lineTo(wt[4],wt[5]),O.lineTo(wt[2],wt[3]),O.lineTo(wt[0],wt[1]),O.clip())}N.push(U),X.push(Z),this.drawTile(it,t,Vt,re,zn,Nn,G,Ri),sn&&O.restore(),this.renderedTiles.unshift(it),this.updateUsedTiles(t.usedTiles,c,it)}}if(this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!$n(this.renderedExtent_,T),this.renderedExtent_=T,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&O.restore(),O.imageSmoothingEnabled=!0,this.renderComplete){const F=(Z,H)=>{const nt=Q(c),M=H.wantedTiles[nt],yt=M?Object.keys(M).length:0;this.updateCacheSize(yt),this.tileCache_.expireCache()};t.postRenderFunctions.push(F)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,s,r,o,a,l){let h;if(t instanceof Hl){if(h=so(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(e),u=Q(this),d=e.layerStatesArray[e.layerIndex],f=d.opacity*(l?t.getAlpha(u,e.time):1),_=f!==c.globalAlpha;_&&(c.save(),c.globalAlpha=f),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,n,s,r,o),_&&c.restore(),f!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const s=Q(e);s in t||(t[s]={}),t[s][n.getKey()]=!0}}const bs={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class vg extends cs{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(bs.PRELOAD)}setPreload(t){this.set(bs.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(bs.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(bs.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class Sg extends vg{constructor(t){super(t)}createRenderer(){return new Cg(this,{cacheSize:this.getCacheSize()})}}const Dn=[0,0,0],Oe=5;class rh{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,et(Mc(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!e)e=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,et(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=Ye(n)),et(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,et(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:Cr,et(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((s,r)=>{const o=new ro(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([e,r,a])}forEachTileCoordParentTileRange(t,e,n,s){let r,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=kn(o,o,a,a,n)):r=this.getTileRangeForExtentAndZ(l,h,n),e(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const r=t[1]*2,o=t[2]*2;return kn(r,r+1,o,o+1,e)}const s=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const s=t[0],r=t[1],o=t[2];if(e===s)return kn(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,e-s),h=Math.floor(r*l),c=Math.floor(o*l);if(e<s)return kn(h,h,c,c,n);const u=Math.floor(l*(r+1))-1,d=Math.floor(l*(o+1))-1;return kn(h,u,c,d,n)}const a=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Dn);const s=Dn[1],r=Dn[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Dn);const o=Dn[1],a=Dn[2];return kn(s,o,r,a,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=Pt(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*s[0]*n,e[1]-(t[2]+.5)*s[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]),s=this.getResolution(t[0]),r=Pt(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*s,a=n[1]-(t[2]+1)*r[1]*s,l=o+r[0]*s,h=a+r[1]*s;return Te(o,a,l,h,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,n,s,r){const o=this.getZForResolution(n),a=n/this.getResolution(o),l=this.getOrigin(o),h=Pt(this.getTileSize(o),this.tmpSize_);let c=a*(t-l[0])/n/h[0],u=a*(l[1]-e)/n/h[1];return s?(c=Yi(c,Oe)-1,u=Yi(u,Oe)-1):(c=Bi(c,Oe),u=Bi(u,Oe)),Ss(o,c,u,r)}getTileCoordForXYAndZ_(t,e,n,s,r){const o=this.getOrigin(n),a=this.getResolution(n),l=Pt(this.getTileSize(n),this.tmpSize_);let h=(t-o[0])/a/l[0],c=(o[1]-e)/a/l[1];return s?(h=Yi(h,Oe)-1,c=Yi(c,Oe)-1):(h=Bi(h,Oe),c=Bi(c,Oe)),Ss(n,h,c,r)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const n=Bs(this.resolutions_,t,e||0);return lt(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return el(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let s=this.minZoom;s<e;++s)n[s]=this.getTileRangeForExtentAndZ(t,s);this.fullTileRanges_=n}}function oh(i){let t=i.getDefaultTileGrid();return t||(t=Ig(i),i.setDefaultTileGrid(t)),t}function bg(i,t,e){const n=t[0],s=i.getTileCoordCenter(t),r=co(e);if(!_n(r,s)){const o=st(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,i.getTileCoordForCoordAndZ(s,n)}return t}function Rg(i,t,e,n){n=n!==void 0?n:"top-left";const s=ah(i,t,e);return new rh({extent:i,origin:Yc(i,n),resolutions:s,tileSize:e})}function Tg(i){const t=i||{},e=t.extent||Ot("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:ah(e,t.maxZoom,t.tileSize,t.maxResolution)};return new rh(n)}function ah(i,t,e,n){t=t!==void 0?t:id,e=Pt(e!==void 0?e:Cr);const s=bt(i),r=st(i);n=n>0?n:Math.max(r/e[0],s/e[1]);const o=t+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=n/Math.pow(2,l);return a}function Ig(i,t,e,n){const s=co(i);return Rg(s,t,e,n)}function co(i){i=Ot(i);let t=i.getExtent();if(!t){const e=180*tr.degrees/i.getMetersPerUnit();t=Te(-e,-e,e,e)}return t}const Mg=/\{z\}/g,Lg=/\{x\}/g,Ag=/\{y\}/g,kg=/\{-y\}/g;function Og(i,t,e,n,s){return i.replace(Mg,t.toString()).replace(Lg,e.toString()).replace(Ag,n.toString()).replace(kg,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function Pg(i){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(i);if(e){const n=e[1].charCodeAt(0),s=e[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(i.replace(e[0],String.fromCharCode(r)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(i),e){const n=parseInt(e[2],10);for(let s=parseInt(e[1],10);s<=n;s++)t.push(i.replace(e[0],s.toString()));return t}return t.push(i),t}function Dg(i,t){return(function(e,n,s){if(!e)return;let r;const o=e[0];if(t){const a=t.getFullTileRange(o);a&&(r=a.getHeight()-1)}return Og(i,o,e[1],e[2],r)})}function Fg(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=Dg(i[s],t);return zg(n)}function zg(i){return i.length===1?i[0]:(function(t,e,n){if(!t)return;const s=_g(t),r=gn(s,i.length);return i[r](t,e,n)})}class lh extends te{constructor(t){super(),this.projection=Ot(t.projection),this.attributions_=hh(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,s){e.viewResolver=n,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=hh(t),this.changed()}setState(t){this.state_=t,this.changed()}}function hh(i){return i?typeof i=="function"?i:(Array.isArray(i)||(i=[i]),t=>i):null}class Ng extends lh{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&Pt(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tmpSize=[0,0],this.key_=t.key||Q(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,s,r){return J()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:oh(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),o=Pt(s.getTileSize(t),this.tmpSize);return r==1?o:Jd(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){const n=e!==void 0?e:this.getProjection(),s=e!==void 0?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=bg(s,t,n)),pg(t,s)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class Gg extends ue{constructor(t,e){super(t),this.tile=e}}const uo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class fo extends Ng{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===fo.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(t){const e=t.target,n=Q(e),s=e.getState();let r;s==z.LOADING?(this.tileLoadingKeys_[n]=!0,r=uo.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==z.ERROR?uo.TILELOADERROR:s==z.LOADED?uo.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new Gg(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=Pg(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
|
|
8
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Fg(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}}class Wg extends fo{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Ug,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:$l,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!cr(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||cr(e,t)))return this.tileGrid;const n=Q(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=oh(t)),this.tileGridForProjection[n]}createTile_(t,e,n,s,r,o){const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,r),h=l?this.tileUrlFunction(l,s,r):void 0,c=new this.tileClass(a,h!==void 0?z.IDLE:z.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(V.CHANGE,this.handleTileChange.bind(this)),c}getTile(t,e,n,s,r){const o=this.getProjection();if(!o||!r||cr(o,r))return this.getTileInternal(t,e,n,s,o||r);const a=[t,e,n],l=this.getKey(),h=this.getTileGridForProjection(o),c=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(a,r),d=new th(o,h,r,c,a,u,this.getTilePixelRatio(s),this.getGutter(),(f,_,p,m)=>this.getTileInternal(f,_,p,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,n,s,r){const o=this.getKey();return this.createTile_(t,e,n,s,r,o)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=Ot(t);if(n){const s=Q(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function Ug(i,t){i.getImage().src=t}class Xg extends Wg{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:Tg({extent:co(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const Bg='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class Yg extends Xg{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[Bg];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}class go extends te{constructor(t){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_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new go(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),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_&&(at(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=q(t,V.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Vg(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Vg(i){if(typeof i=="function")return i;let t;return Array.isArray(i)?t=i:(et(typeof i.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[i]),function(){return t}}function ch(i,t,e,n,s,r,o){let a,l;const h=(e-t)/n;if(h===1)a=t;else if(h===2)a=t,l=s;else if(h!==0){let c=i[t],u=i[t+1],d=0;const f=[0];for(let m=t+n;m<e;m+=n){const y=i[m],x=i[m+1];d+=Math.sqrt((y-c)*(y-c)+(x-u)*(x-u)),f.push(d),c=y,u=x}const _=s*d,p=Rc(f,_);p<0?(l=(_-f[-p-2])/(f[-p-1]-f[-p-2]),a=t+(-p-2)*n):a=t+p*n}o=o>1?o:2,r=r||new Array(o);for(let c=0;c<o;++c)r[c]=a===void 0?NaN:l===void 0?i[a+c]:Nt(i[a+c],i[a+n+c],l);return r}function Kg(i,t,e,n){let s=i[t],r=i[t+1],o=0;for(let a=t+n;a<e;a+=n){const l=i[a],h=i[a+1];o+=Math.sqrt((l-s)*(l-s)+(h-r)*(h-r)),s=l,r=h}return o}class uh{drawCustom(t,e,n,s,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class Zg extends uh{constructor(t,e,n,s,r,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=s,this.transformRotation_=s?Xi(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=o,this.userTransform_=a,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_=$t()}drawImages_(t,e,n,s){if(!this.image_)return;const r=Me(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=r.length;c<u;c+=2){const d=r[c]-this.imageAnchorX_,f=r[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const _=d+this.imageAnchorX_,p=f+this.imageAnchorY_;fe(a,_,p,1,1,h,-_,-p),o.save(),o.transform.apply(o,a),o.translate(_,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,f,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(t,e,n,s){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=Me(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);e<n;e+=s){const l=r[e]+this.textOffsetX_,h=r[e+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,h-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,l,h),this.textFillState_&&o.fillText(this.text_,l,h))}}moveToLineTo_(t,e,n,s,r){const o=this.context_,a=Me(t,e,n,s,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;r&&(l-=2);for(let h=2;h<l;h+=2)o.lineTo(a[h],a[h+1]);return r&&o.closePath(),n}drawRings_(t,e,n,s){for(let r=0,o=n.length;r<o;++r)e=this.moveToLineTo_(t,e,n[r],s,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!kt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Nu(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],s=e[3]-e[1],r=Math.sqrt(n*n+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,s=e.length;n<s;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!kt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(kt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,s=t.getFlatCoordinates();let r=0;const o=t.getEnds(),a=t.getStride();n.beginPath();for(let l=0,h=o.length;l<h;++l)r=this.moveToLineTo_(s,r,o[l],a,!1);n.stroke()}if(this.text_!==""){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!kt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!kt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();e.beginPath();for(let a=0,l=r.length;a<l;++a){const h=r[a];s=this.drawRings_(n,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),ve(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,s=t.textAlign?t.textAlign:pi;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=s&&(n.textAlign=s,e.textAlign=s),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:ie(n||Ft)}}if(!e)this.strokeState_=null;else{const n=e.getColor(),s=e.getLineCap(),r=e.getLineDash(),o=e.getLineDashOffset(),a=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit(),c=r||_e;this.strokeState_={lineCap:s!==void 0?s:In,lineDash:this.pixelRatio_===1?c:c.map(u=>u*this.pixelRatio_),lineDashOffset:(o||me)*this.pixelRatio_,lineJoin:a!==void 0?a:Mn,lineWidth:(l!==void 0?l:yi)*this.pixelRatio_,miterLimit:h!==void 0?h:_i,strokeStyle:ie(n||mi)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const f=e.getColor();this.textFillState_={fillStyle:ie(f||Ft)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const f=n.getColor(),_=n.getLineCap(),p=n.getLineDash(),m=n.getLineDashOffset(),y=n.getLineJoin(),x=n.getWidth(),v=n.getMiterLimit();this.textStrokeState_={lineCap:_!==void 0?_:In,lineDash:p||_e,lineDashOffset:m||me,lineJoin:y!==void 0?y:Mn,lineWidth:x!==void 0?x:yi,miterLimit:v!==void 0?v:_i,strokeStyle:ie(f||mi)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:Il,textAlign:u!==void 0?u:pi,textBaseline:d!==void 0?d:_s},this.text_=c!==void 0?Array.isArray(c)?c.reduce((f,_,p)=>f+=p%2?" ":_,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const jg=.5,dh={Point:n1,LineString:Qg,Polygon:s1,MultiPoint:i1,MultiLineString:t1,MultiPolygon:e1,GeometryCollection:Jg,Circle:$g};function Hg(i,t){return parseInt(Q(i),10)-parseInt(Q(t),10)}function fh(i,t){const e=gh(i,t);return e*e}function gh(i,t){return jg*i/t}function $g(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(r,o),l.drawCircle(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n)}}function _h(i,t,e,n,s,r,o,a){const l=[],h=e.getImage();if(h){let d=!0;const f=h.getImageState();f==j.LOADED||f==j.ERROR?d=!1:f==j.IDLE&&h.load(),d&&l.push(h.ready())}const c=e.getFill();c&&c.loading()&&l.push(c.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>s(null)),qg(i,t,e,n,r,o,a),u}function qg(i,t,e,n,s,r,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,s);if(e.getRenderer())mh(i,l,e,t,o);else{const c=dh[l.getType()];c(i,l,e,t,o,r)}}function mh(i,t,e,n,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a<l;++a)mh(i,o[a],e,n,s);return}i.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer(),s)}function Jg(i,t,e,n,s,r){const o=t.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const h=dh[o[a].getType()];h(i,o[a],e,n,s,r)}}function Qg(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function t1(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawMultiLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function e1(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(o||r){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawMultiPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}function n1(i,t,e,n,s,r){const o=e.getImage(),a=e.getText(),l=a&&a.getText(),h=r&&o&&l?{}:void 0;if(o){if(o.getImageState()!=j.LOADED)return;const c=i.getBuilder(e.getZIndex(),"Image");c.setImageStyle(o,h),c.drawPoint(t,n,s)}if(l){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(a,h),c.drawText(t,n,s)}}function i1(i,t,e,n,s,r){const o=e.getImage(),a=o&&o.getOpacity()!==0,l=e.getText(),h=l&&l.getText(),c=r&&a&&h?{}:void 0;if(a){if(o.getImageState()!=j.LOADED)return;const u=i.getBuilder(e.getZIndex(),"Image");u.setImageStyle(o,c),u.drawMultiPoint(t,n,s)}if(h){const u=i.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l,c),u.drawText(t,n,s)}}function s1(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}let r1=!1;function o1(i,t,e,n,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof i=="function"?i(e,n,s):i,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=r1,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const h=t.getType();try{let c;h=="text"||h=="json"?c=a.responseText:h=="xml"?c=a.responseXML||a.responseText:h=="arraybuffer"&&(c=a.response),c?r(t.readFeatures(c,{extent:e,featureProjection:s}),t.readProjection(c)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function ph(i,t){return function(e,n,s,r,o){o1(i,t,e,n,s,(a,l)=>{this.addFeatures(a),r!==void 0&&r(a)},()=>{this.changed(),o!==void 0&&o()})}}function a1(i,t){return[[-1/0,-1/0,1/0,1/0]]}function l1(i,t,e,n){const s=[];let r=Gt();for(let o=0,a=e.length;o<a;++o){const l=e[o];r=$s(i,t,l[0],n),s.push((r[0]+r[2])/2,(r[1]+r[3])/2),t=l[l.length-1]}return s}const yh=$t();class Qt{constructor(t,e,n,s,r,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=r,this.squaredTolerance_,this.stride_=s,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?_a(this.flatCoordinates_):$s(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Xe(this.getExtent());this.flatInteriorPoints_=pr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=Ju(this.flatCoordinates_,this.ends_),e=l1(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=Zu(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=ch(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let s=0,r=n.length;s<r;++s){const o=n[s],a=ch(t,e,o,2,.5);Ys(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=Ot(t);const e=t.getExtent(),n=t.getWorldExtent();if(e&&n){const s=bt(n)/bt(e);fe(yh,n[0],n[3],s,-s,0,0,0),Me(this.flatCoordinates_,0,this.flatCoordinates_.length,2,yh,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Qt(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ia((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=mr(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=Yu(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=Ja(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s);break}return s&&(this.simplifiedGeometry_=new Qt(this.type_,n,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Qt.prototype.getFlatCoordinates=Qt.prototype.getOrientedFlatCoordinates;class xh{constructor(t){this.rbush_=new ml(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[Q(e)]=n}load(t,e){const n=new Array(e.length);for(let s=0,r=e.length;s<r;s++){const o=t[s],a=e[s],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};n[s]=l,this.items_[Q(a)]=l}this.rbush_.load(n)}remove(t){const e=Q(t),n=this.items_[e];return delete this.items_[e],this.rbush_.remove(n)!==null}update(t,e){const n=this.items_[Q(e)],s=[n.minX,n.minY,n.maxX,n.maxY];$n(s,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let s=0,r=t.length;s<r;s++)if(n=e(t[s]),n)return n;return n}isEmpty(){return un(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Te(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const Bt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class Pe extends ue{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class h1 extends lh{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Kn,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(et(this.format_,"`format` must be set when `url` is set"),this.loader_=ph(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:a1;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new xh:null,this.loadedExtentsRtree_=new xh,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,s;Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!e&&n===void 0&&(n=new ee(s)),s!==void 0&&this.addFeaturesInternal(s),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=Q(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new Pe(Bt.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof Qt||(this.featureChangeKeys_[t]=[q(e,V.CHANGE,this.handleFeatureChange_,this),q(e,cn.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof Qt){const r=this.idIndex_[s];r instanceof Qt?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:n=!1}else n=!1}return n&&(et(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],s=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=Q(a);this.addToIndex_(l,a)&&n.push(a)}for(let r=0,o=n.length;r<o;r++){const a=n[r],l=Q(a);this.setupChangeEvents_(l,a);const h=a.getGeometry();if(h){const c=h.getExtent();e.push(c),s.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener(Bt.ADDFEATURE))for(let r=0,o=n.length;r<o;r++)this.dispatchEvent(new Pe(Bt.ADDFEATURE,n[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Bt.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(Bt.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(At.ADD,n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(At.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(at);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(n=>{this.removeFeatureInternal(n)});for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new Pe(Bt.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof Qt||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof Qt||s.intersectsExtent(t)){const r=e(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),un(this.nullGeometryFeatures_)||Ys(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=wa(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Vn,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){const c=h.getGeometry(),u=a;if(a=c instanceof Qt?0:c.closestPointXY(n,s,o,a),a<u){r=h;const d=Math.sqrt(a);l[0]=n-d,l[1]=s-d,l[2]=n+d,l[3]=s+d}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=Q(e),s=e.getGeometry();if(!s)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{const o=s.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const r=e.getId();if(r!==void 0){const o=r.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new Pe(Bt.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:Q(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&un(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,n){const s=this.loadedExtentsRtree_,r=this.strategy_(t,e,n);for(let o=0,a=r.length;o<a;++o){const l=r[o];s.forEachInExtent(l,function(c){return Hn(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new Pe(Bt.FEATURESLOADSTART)),this.loader_.call(this,l,e,n,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pe(Bt.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new Pe(Bt.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,n=e.forEachInExtent(t,function(s){if($n(s.extent,t))return s});n&&e.remove(n)}removeFeatures(t){let e=!1;for(let n=0,s=t.length;n<s;++n)e=this.removeFeatureInternal(t[n])||e;e&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=Q(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.featureChangeKeys_[e]?.forEach(at),delete this.featureChangeKeys_[e];const s=t.getId();if(s!==void 0){const r=s.toString(),o=this.idIndex_[r];o===t?delete this.idIndex_[r]:Array.isArray(o)&&(o.splice(o.indexOf(t),1),o.length===1&&(this.idIndex_[r]=o[0]))}return delete this.uidIndex_[e],this.hasListener(Bt.REMOVEFEATURE)&&this.dispatchEvent(new Pe(Bt.REMOVEFEATURE,t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){et(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(ph(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}}const D={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},Rs=[D.FILL],De=[D.STROKE],Qe=[D.BEGIN_PATH],wh=[D.CLOSE_PATH];class bi extends uh{constructor(t,e,n,s){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=s,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(t){const e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let a=0,l=t.length;a<l;a+=e)s[0]=t[a],s[1]=t[a+1],_n(n,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,n,s,r,o){const a=this.coordinates;let l=a.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let c=t[e],u=t[e+1];const d=this.tmpCoordinate_;let f=!0,_,p,m;for(_=e+s;_<n;_+=s)d[0]=t[_],d[1]=t[_+1],m=Hs(h,d),m!==p?(f&&(a[l++]=c,a[l++]=u,f=!1),a[l++]=d[0],a[l++]=d[1]):m===mt.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],f=!1):f=!0,c=d[0],u=d[1],p=m;return(r&&f||_===e+s)&&(a[l++]=c,a[l++]=u),l}drawCustomCoordinates_(t,e,n,s,r){for(let o=0,a=n.length;o<a;++o){const l=n[o],h=this.appendFlatLineCoordinates(t,e,l,s,!1,!1);r.push(h),e=l}return e}drawCustom(t,e,n,s,r){this.beginGeometry(t,e,r);const o=t.getType(),a=t.getStride(),l=this.coordinates.length;let h,c,u,d,f;switch(o){case"MultiPolygon":h=t.getOrientedFlatCoordinates(),d=[];const _=t.getEndss();f=0;for(let p=0,m=_.length;p<m;++p){const y=[];f=this.drawCustomCoordinates_(h,f,_[p],a,y),d.push(y)}this.instructions.push([D.CUSTOM,l,d,t,n,qa,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,d,t,s||n,qa,r]);break;case"Polygon":case"MultiLineString":u=[],h=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),f=this.drawCustomCoordinates_(h,0,t.getEnds(),a,u),this.instructions.push([D.CUSTOM,l,u,t,n,is,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,u,t,s||n,is,r]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(h,0,h.length,a,!1,!1),this.instructions.push([D.CUSTOM,l,c,t,n,En,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,c,t,s||n,En,r]);break;case"MultiPoint":h=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(h,a),c>l&&(this.instructions.push([D.CUSTOM,l,c,t,n,En,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,c,t,s||n,En,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),c=this.coordinates.length,this.instructions.push([D.CUSTOM,l,c,t,n,void 0,r]),this.hitDetectionInstructions.push([D.CUSTOM,l,c,t,s||n,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[D.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[D.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let s,r,o=-1;for(e=0;e<n;++e)s=t[e],r=s[0],r==D.END_GEOMETRY?o=e:r==D.BEGIN_GEOMETRY&&(s[2]=e,Ic(this.hitDetectionInstructions,o,e),o=-1)}fillStyleToState(t,e={}){if(t){const n=t.getColor();e.fillPatternScale=n&&typeof n=="object"&&"src"in n?this.pixelRatio:1,e.fillStyle=ie(n||Ft)}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){const n=t.getColor();e.strokeStyle=ie(n||mi);const s=t.getLineCap();e.lineCap=s!==void 0?s:In;const r=t.getLineDash();e.lineDash=r?r.slice():_e;const o=t.getLineDashOffset();e.lineDashOffset=o||me;const a=t.getLineJoin();e.lineJoin=a!==void 0?a:Mn;const l=t.getWidth();e.lineWidth=l!==void 0?l:yi;const h=t.getMiterLimit();e.miterLimit=h!==void 0?h:_i,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(e,n)}createFill(t){const e=t.fillStyle,n=[D.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[D.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!ve(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[D.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=da(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;js(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class c1 extends bi{constructor(t,e,n,s){super(t,e,n,s),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(t,e,n){if(!this.image_||this.maxExtent&&!_n(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([D.DRAW_IMAGE,o,a,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([D.DRAW_IMAGE,o,a,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(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=[];for(let l=0,h=s.length;l<h;l+=t.getStride())(!this.maxExtent||_n(this.maxExtent,s.slice(l,l+2)))&&r.push(s[l],s[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,2);this.instructions.push([D.DRAW_IMAGE,o,a,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([D.DRAW_IMAGE,o,a,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(e)}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(t,e){const n=t.getAnchor(),s=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}class u1 extends bi{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinates_(t,e,n,s){const r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,s,!1,!1),a=[D.MOVE_TO_LINE_TO,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,e,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([D.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,_e,me],Qe);const a=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(De),this.endGeometry(e)}drawMultiLineString(t,e,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([D.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,_e,me],Qe);const a=t.getEnds(),l=t.getFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,d=a.length;u<d;++u)c=this.drawFlatCoordinates_(l,c,a[u],h);this.hitDetectionInstructions.push(De),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(De),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(De),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(Qe)}}class Eh extends bi{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinatess_(t,e,n,s){const r=this.state,o=r.fillStyle!==void 0,a=r.strokeStyle!==void 0,l=n.length;this.instructions.push(Qe),this.hitDetectionInstructions.push(Qe);for(let h=0;h<l;++h){const c=n[h],u=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,c,s,!0,!a),f=[D.MOVE_TO_LINE_TO,u,d];this.instructions.push(f),this.hitDetectionInstructions.push(f),a&&(this.instructions.push(wh),this.hitDetectionInstructions.push(wh)),e=c}return o&&(this.instructions.push(Rs),this.hitDetectionInstructions.push(Rs)),a&&(this.instructions.push(De),this.hitDetectionInstructions.push(De)),e}drawCircle(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_FILL_STYLE,Ft]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,_e,me]);const a=t.getFlatCoordinates(),l=t.getStride(),h=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const c=[D.CIRCLE,h];this.instructions.push(Qe,c),this.hitDetectionInstructions.push(Qe,c),s.fillStyle!==void 0&&(this.instructions.push(Rs),this.hitDetectionInstructions.push(Rs)),s.strokeStyle!==void 0&&(this.instructions.push(De),this.hitDetectionInstructions.push(De)),this.endGeometry(e)}drawPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_FILL_STYLE,Ft]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,_e,me]);const a=t.getEnds(),l=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(l,0,a,h),this.endGeometry(e)}drawMultiPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_FILL_STYLE,Ft]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([D.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,_e,me]);const a=t.getEndss(),l=t.getOrientedFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,d=a.length;u<d;++u)c=this.drawFlatCoordinatess_(l,c,a[u],h);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,s=e.length;n<s;++n)e[n]=Ze(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}}function d1(i,t,e,n,s){const r=[];let o=e,a=0,l=t.slice(e,2);for(;a<i&&o+s<n;){const[h,c]=l.slice(-2),u=t[o+s],d=t[o+s+1],f=Math.sqrt((u-h)*(u-h)+(d-c)*(d-c));if(a+=f,a>=i){const _=(i-a+f)/f,p=Nt(h,u,_),m=Nt(c,d,_);l.push(p,m),r.push(l),l=[p,m],a==i&&(o+=s),a=0}else if(a<i)l.push(t[o+s],t[o+s+1]),o+=s;else{const _=f-a,p=Nt(h,u,_/f),m=Nt(c,d,_/f);l.push(p,m),r.push(l),l=[p,m],a=0,o+=s}}return a>0&&r.push(l),r}function f1(i,t,e,n,s){let r=e,o=e,a=0,l=0,h=e,c,u,d,f,_,p,m,y,x,v;for(u=e;u<n;u+=s){const w=t[u],C=t[u+1];_!==void 0&&(x=w-_,v=C-p,f=Math.sqrt(x*x+v*v),m!==void 0&&(l+=d,c=Math.acos((m*x+y*v)/(d*f)),c>i&&(l>a&&(a=l,r=h,o=u),l=0,h=u-s)),d=f,m=x,y=v),_=w,p=C}return l+=f,l>a?[h,u]:[r,o]}const Ts={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class g1 extends bi{constructor(t,e,n,s){super(t,e,n,s),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[Ft]={fillStyle:Ft},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const h=t.getType();let c=null,u=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!kt(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),h=="LineString")d=[c.length];else if(h=="MultiLineString")d=t.getEnds();else if(h=="Polygon")d=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const m=t.getEndss();d=[];for(let y=0,x=m.length;y<x;++y)d.push(m[y][0])}this.beginGeometry(t,e,n);const f=o.repeat,_=f?void 0:o.textAlign;let p=0;for(let m=0,y=d.length;m<y;++m){let x;f?x=d1(f*this.resolution,c,p,d[m],u):x=[c.slice(p,d[m])];for(let v=0,w=x.length;v<w;++v){const C=x[v];let T=0,b=C.length;if(_==null){const I=f1(o.maxAngle,C,0,C.length,2);T=I[0],b=I[1]}for(let I=T;I<b;I+=u)a.push(C[I],C[I+1]);const R=a.length;p=d[m],this.drawChars_(l,R),l=R}}this.endGeometry(e)}else{let d=o.overflow?null:[];switch(h){case"Point":case"MultiPoint":c=t.getFlatCoordinates();break;case"LineString":c=t.getFlatMidpoint();break;case"Circle":c=t.getCenter();break;case"MultiLineString":c=t.getFlatMidpoints(),u=2;break;case"Polygon":c=t.getFlatInteriorPoint(),o.overflow||d.push(c[2]/this.resolution),u=3;break;case"MultiPolygon":const w=t.getFlatInteriorPoints();c=[];for(let C=0,T=w.length;C<T;C+=3)o.overflow||d.push(w[C+2]/this.resolution),c.push(w[C],w[C+1]);if(c.length===0)return;u=2;break}const f=this.appendFlatPointCoordinates(c,u);if(f===l)return;if(d&&(f-l)/2!==c.length/u){let w=l/2;d=d.filter((C,T)=>{const b=a[(w+T)*2]===c[T*u]&&a[(w+T)*2+1]===c[T*u+1];return b||--w,b})}this.saveTextStates_();const _=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(t,e,n);let m=o.padding;if(m!=Je&&(o.scale[0]<0||o.scale[1]<0)){let w=o.padding[0],C=o.padding[1],T=o.padding[2],b=o.padding[3];o.scale[0]<0&&(C=-C,b=-b),o.scale[1]<0&&(w=-w,T=-T),m=[w,C,T,b]}const y=this.pixelRatio;this.instructions.push([D.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==Je?Je:m.map(function(w){return w*y}),_,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const x=1/y,v=_?_.slice(0):null;v&&(v[1]=Ft),this.hitDetectionInstructions.push([D.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[x,x],NaN,this.declutterMode_,this.declutterImageWithText_,m,v,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Ft:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||pi,justify:e.justify,textBaseline:e.textBaseline||_s,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=Ts[s.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([D.DRAW_CHARS,t,e,h,s.overflow,a,s.maxAngle,l,c,r,d*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([D.DRAW_CHARS,t,e,h,s.overflow,a&&Ft,s.maxAngle,l,c,r,d*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let n,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=ie(o.getColor()||Ft)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const p=a.getLineDash(),m=a.getLineDashOffset(),y=a.getWidth(),x=a.getMiterLimit();r.lineCap=a.getLineCap()||In,r.lineDash=p?p.slice():_e,r.lineDashOffset=m===void 0?me:m,r.lineJoin=a.getLineJoin()||Mn,r.lineWidth=y===void 0?yi:y,r.miterLimit=x===void 0?_i:x,r.strokeStyle=ie(a.getColor()||mi)}n=this.textState_;const l=t.getFont()||Il;Af(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||_s,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||Je,n.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getKeepUpright(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=f===void 0?!0:f,this.textRotation_=_===void 0?0:_,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:Q(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+Q(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const _1={Circle:Eh,Default:bi,Image:c1,LineString:u1,Polygon:Eh,Text:g1};class m1{constructor(t,e,n,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const s in n){const r=n[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[e];if(r===void 0){const o=_1[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function p1(i,t,e,n,s,r,o,a,l,h,c,u,d=!0){let f=i[t],_=i[t+1],p=0,m=0,y=0,x=0;function v(){p=f,m=_,t+=n,f=i[t],_=i[t+1],x+=y,y=Math.sqrt((f-p)*(f-p)+(_-m)*(_-m))}do v();while(t<e-n&&x+y<r);let w=y===0?0:(r-x)/y;const C=Nt(p,f,w),T=Nt(m,_,w),b=t-n,R=x,I=r+a*l(h,s,c);for(;t<e-n&&x+y<I;)v();w=y===0?0:(I-x)/y;const L=Nt(p,f,w),k=Nt(m,_,w);let A=!1;if(d)if(u){const X=[C,T,L,k];Ba(X,0,4,2,u,X,X),A=X[0]>X[2]}else A=C>L;const O=Math.PI,P=[],U=b+n===t;t=b,y=0,x=R,f=i[t],_=i[t+1];let N;if(U){v(),N=Math.atan2(_-m,f-p),A&&(N+=N>0?-O:O);const X=(L+C)/2,F=(k+T)/2;return P[0]=[X,F,(I-r)/2,N,s],P}s=s.replace(/\n/g," ");for(let X=0,F=s.length;X<F;){v();let Z=Math.atan2(_-m,f-p);if(A&&(Z+=Z>0?-O:O),N!==void 0){let ht=Z-N;if(ht+=ht>O?-2*O:ht<-O?2*O:0,Math.abs(ht)>o)return null}N=Z;const H=X;let nt=0;for(;X<F;++X){const ht=A?F-X-1:X,Tt=a*l(h,s[ht],c);if(t+n<e&&x+y<r+nt+Tt/2)break;nt+=Tt}if(X===H)continue;const M=A?s.substring(F-H,F-X):s.substring(H,X);w=y===0?0:(r+nt/2-x)/y;const yt=Nt(p,f,w),Ct=Nt(m,_,w);P.push([yt,Ct,nt/2,Z,M]),r+=nt}return P}const Fn=Gt(),Fe=[],ye=[],xe=[],ze=[];function Ch(i){return i[3].declutterBox}const vh=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function _o(i,t){return t==="start"?t=vh.test(i)?"right":"left":t==="end"&&(t=vh.test(i)?"left":"right"),Ts[t]}function y1(i,t,e){return e>0&&i.push(`
|
|
9
|
-
`,""),i.push(t,""),i}function
|
|
10
|
-
`).reduce(
|
|
11
|
-
`){O+=A,A=0,I=u*v+R*d,++U;continue}const H=f[X+1]||l.font;H!==N&&(s&&L.push("font",H),n&&k.push("font",H),N=H),A=Math.max(A,y[P]);const nt=[Z,I+R*m[P]+u*(m[P]-x[U]),.5*(d+A)+O];I+=m[P],s&&L.push("strokeText",nt),n&&k.push("fillText",nt),++P}return Array.prototype.push.apply(w,L),Array.prototype.push.apply(w,k),this.labels_[r]=b,b}replayTextBackground_(t,e,n,s,r,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignAndScaleFill_=o[2],t.fillStyle=o[1],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,s,r,o,a,l,h,c,u,d,f,_,p,m){a*=d[0],l*=d[1];let y=n-a,x=s-l;const v=r+h>t?t-h:r,w=o+c>e?e-c:o,C=_[3]+v*d[0]+_[1],T=_[0]+w*d[1]+_[2],b=y-_[3],R=x-_[0];(p||u!==0)&&(Fe[0]=b,ze[0]=b,Fe[1]=R,ye[1]=R,ye[0]=b+C,xe[0]=ye[0],xe[1]=R+T,ze[1]=xe[1]);let I;return u!==0?(I=fe($t(),n,s,1,1,u,-n,-s),pt(I,Fe),pt(I,ye),pt(I,xe),pt(I,ze),Te(Math.min(Fe[0],ye[0],xe[0],ze[0]),Math.min(Fe[1],ye[1],xe[1],ze[1]),Math.max(Fe[0],ye[0],xe[0],ze[0]),Math.max(Fe[1],ye[1],xe[1],ze[1]),Fn)):Te(Math.min(b,b+C),Math.min(R,R+T),Math.max(b,b+C),Math.max(R,R+T),Fn),f&&(y=Math.round(y),x=Math.round(x)),{drawImageX:y,drawImageY:x,drawImageW:v,drawImageH:w,originX:h,originY:c,declutterBox:{minX:Fn[0],minY:Fn[1],maxX:Fn[2],maxY:Fn[3],value:m},canvasTransform:I,scale:d}}replayImageOrLabel_(t,e,n,s,r,o,a){const l=!!(o||a),h=s.declutterBox,c=a?a[2]*s.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,Fe,ye,xe,ze,o,a),Pf(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=pt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,n,s){const r=this.textStates[e],o=this.createLabel(t,e,s,n),a=this.strokeStates[n],l=this.pixelRatio,h=_o(Array.isArray(t)?t[0]:t,r.textAlign||pi),c=Ts[r.textBaseline||_s],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],f=h*d+2*(.5-h)*u,_=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:f,anchorY:_}}execute_(t,e,n,s,r,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&ve(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=Me(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Iu(this.renderedTransform_,n));let u=0;const d=s.length;let f=0,_,p,m,y,x,v,w,C,T,b,R,I,L,k=0,A=0;const O=this.coordinateCache_,P=this.viewRotation_,U=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,N={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},X=this.instructions!=s||this.overlaps?0:200;let F,Z,H,nt;for(;u<d;){const M=s[u];switch(M[0]){case D.BEGIN_GEOMETRY:F=M[1],nt=M[3],F.getGeometry()?a!==void 0&&!kt(a,nt.getExtent())?u=M[2]+1:++u:u=M[2],h&&(h.zIndex=M[4]);break;case D.BEGIN_PATH:k>X&&(this.fill_(t),k=0),A>X&&(t.stroke(),A=0),!k&&!A&&(t.beginPath(),x=NaN,v=NaN),++u;break;case D.CIRCLE:f=M[1];const Ct=c[f],ht=c[f+1],Tt=c[f+2],xt=c[f+3],G=Tt-Ct,it=xt-ht,B=Math.sqrt(G*G+it*it);t.moveTo(Ct+B,ht),t.arc(Ct,ht,B,0,2*Math.PI,!0),++u;break;case D.CLOSE_PATH:t.closePath(),++u;break;case D.CUSTOM:f=M[1],_=M[2];const ft=M[3],Yt=M[4],en=M[5];N.geometry=ft,N.feature=F,u in O||(O[u]=[]);const nn=O[u];en?en(c,f,_,2,nn):(nn[0]=c[f],nn[1]=c[f+1],nn.length=2),h&&(h.zIndex=M[6]),Yt(nn,N),++u;break;case D.DRAW_IMAGE:f=M[1],_=M[2],T=M[3],p=M[4],m=M[5];let Vt=M[6];const re=M[7],zn=M[8],Nn=M[9],Ri=M[10];let sn=M[11];const Gn=M[12];let Wn=M[13];y=M[14]||"declutter";const wt=M[15];if(!T&&M.length>=20){b=M[19],R=M[20],I=M[21],L=M[22];const Kt=this.drawLabelWithPointPlacement_(b,R,I,L);T=Kt.label,M[3]=T;const rn=M[23];p=(Kt.anchorX-rn)*this.pixelRatio,M[4]=p;const Zt=M[24];m=(Kt.anchorY-Zt)*this.pixelRatio,M[5]=m,Vt=T.height,M[6]=Vt,Wn=T.width,M[13]=Wn}let xo;M.length>25&&(xo=M[25]);let wo,Ms,Ls;M.length>17?(wo=M[16],Ms=M[17],Ls=M[18]):(wo=Je,Ms=null,Ls=null),Ri&&U?sn+=P:!Ri&&!U&&(sn-=P);let o0=0;for(;f<_;f+=2){if(xo&&xo[o0++]<Wn/this.pixelRatio)continue;const Kt=this.calculateImageOrLabelDimensions_(T.width,T.height,c[f],c[f+1],Wn,Vt,p,m,zn,Nn,sn,Gn,r,wo,!!Ms||!!Ls,F),rn=[t,e,T,Kt,re,Ms,Ls];if(l){let Zt,oe,jt;if(wt){const ut=_-f;if(!wt[ut]){wt[ut]={args:rn,declutterMode:y};continue}const It=wt[ut];Zt=It.args,oe=It.declutterMode,delete wt[ut],jt=Ch(Zt)}let we,Ee;if(Zt&&(oe!=="declutter"||!l.collides(jt))&&(we=!0),(y!=="declutter"||!l.collides(Kt.declutterBox))&&(Ee=!0),oe==="declutter"&&y==="declutter"){const ut=we&&Ee;we=ut,Ee=ut}we&&(oe!=="none"&&l.insert(jt),this.replayImageOrLabel_.apply(this,Zt)),Ee&&(y!=="none"&&l.insert(Kt.declutterBox),this.replayImageOrLabel_.apply(this,rn))}else this.replayImageOrLabel_.apply(this,rn)}++u;break;case D.DRAW_CHARS:const Uh=M[1],Xh=M[2],Eo=M[3],a0=M[4];L=M[5];const l0=M[6],Bh=M[7],Yh=M[8];I=M[9];const Co=M[10];b=M[11],Array.isArray(b)&&(b=b.reduce(x1,"")),R=M[12];const Vh=[M[13],M[13]];y=M[14]||"declutter";const h0=M[15],vo=this.textStates[R],Ti=vo.font,Ii=[vo.scale[0]*Bh,vo.scale[1]*Bh];let Mi;Ti in this.widths_?Mi=this.widths_[Ti]:(Mi={},this.widths_[Ti]=Mi);const Kh=Kg(c,Uh,Xh,2),Zh=Math.abs(Ii[0])*kl(Ti,b,Mi);if(a0||Zh<=Kh){const Kt=this.textStates[R].textAlign,rn=(Kh-Zh)*_o(b,Kt),Zt=p1(c,Uh,Xh,2,b,rn,l0,Math.abs(Ii[0]),kl,Ti,Mi,U?0:this.viewRotation_,h0);t:if(Zt){const oe=[];let jt,we,Ee,ut,It;if(I)for(jt=0,we=Zt.length;jt<we;++jt){It=Zt[jt],Ee=It[4],ut=this.createLabel(Ee,R,"",I),p=It[2]+(Ii[0]<0?-Co:Co),m=Eo*ut.height+(.5-Eo)*2*Co*Ii[1]/Ii[0]-Yh;const Ce=this.calculateImageOrLabelDimensions_(ut.width,ut.height,It[0],It[1],ut.width,ut.height,p,m,0,0,It[3],Vh,!1,Je,!1,F);if(l&&y==="declutter"&&l.collides(Ce.declutterBox))break t;oe.push([t,e,ut,Ce,1,null,null])}if(L)for(jt=0,we=Zt.length;jt<we;++jt){It=Zt[jt],Ee=It[4],ut=this.createLabel(Ee,R,L,""),p=It[2],m=Eo*ut.height-Yh;const Ce=this.calculateImageOrLabelDimensions_(ut.width,ut.height,It[0],It[1],ut.width,ut.height,p,m,0,0,It[3],Vh,!1,Je,!1,F);if(l&&y==="declutter"&&l.collides(Ce.declutterBox))break t;oe.push([t,e,ut,Ce,1,null,null])}l&&y!=="none"&&l.load(oe.map(Ch));for(let Ce=0,c0=oe.length;Ce<c0;++Ce)this.replayImageOrLabel_.apply(this,oe[Ce])}}++u;break;case D.END_GEOMETRY:if(o!==void 0){F=M[1];const Kt=o(F,nt,y);if(Kt)return Kt}++u;break;case D.FILL:X?k++:this.fill_(t),++u;break;case D.MOVE_TO_LINE_TO:for(f=M[1],_=M[2],Z=c[f],H=c[f+1],t.moveTo(Z,H),x=Z+.5|0,v=H+.5|0,f+=2;f<_;f+=2)Z=c[f],H=c[f+1],w=Z+.5|0,C=H+.5|0,(f==_-2||w!==x||C!==v)&&(t.lineTo(Z,H),x=w,v=C);++u;break;case D.SET_FILL_STYLE:this.alignAndScaleFill_=M[2],k&&(this.fill_(t),k=0,A&&(t.stroke(),A=0)),t.fillStyle=M[1],++u;break;case D.SET_STROKE_STYLE:A&&(t.stroke(),A=0),this.setStrokeStyle_(t,M),++u;break;case D.STROKE:X?A++:t.stroke(),++u;break;default:++u;break}}k&&this.fill_(t),A&&t.stroke()}execute(t,e,n,s,r,o){this.viewRotation_=s,this.execute_(t,e,n,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,e,n,s,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,s,r)}}const tn=["Polygon","Circle","LineString","Image","Text","Default"],Sh=["Image","Text"],E1=tn.filter(i=>!Sh.includes(i));class C1{constructor(t,e,n,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=$t(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const o in r){const a=r[o];s[o]=new w1(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s<r;++s)if(t[s]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,s,r,o){s=Math.round(s);const a=s*2+1,l=fe(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=gt(a,a));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):h||c.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=Gt(),qn(u,t),js(u,e*(this.renderBuffer_+s),u));const d=v1(s);let f;function _(C,T,b){const R=c.getImageData(0,0,a,a).data;for(let I=0,L=d.length;I<L;I++)if(R[d[I]]>0){if(!o||b==="none"||f!=="Image"&&f!=="Text"||o.includes(C)){const k=(d[I]-3)/4,A=s-k%a,O=s-(k/a|0),P=r(C,T,A*A+O*O);if(P)return P}c.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(ce);let m,y,x,v,w;for(m=p.length-1;m>=0;--m){const C=p[m].toString();for(x=this.executorsByZIndex_[C],y=tn.length-1;y>=0;--y)if(f=tn[y],v=x[f],v!==void 0&&(w=v.executeHitDetection(c,l,n,_,u),w))return w}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],s=e[1],r=e[2],o=e[3],a=[n,s,n,o,r,o,r,s];return Me(a,0,8,2,t,a),a}isEmpty(){return un(this.executorsByZIndex_)}execute(t,e,n,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?Tc:ce),o=o||tn;const h=tn.length;for(let c=0,u=l.length;c<u;++c){const d=l[c].toString(),f=this.executorsByZIndex_[d];for(let _=0,p=o.length;_<p;++_){const m=o[_],y=f[m];if(y!==void 0){const x=a===null?void 0:y.getZIndexContext(),v=x?x.getContext():t,w=this.maxExtent_&&m!=="Image"&&m!=="Text";if(w&&(v.save(),this.clip(v,n)),!x||m==="Text"||m==="Image"?y.execute(v,e,n,s,r,a):x.pushFunction(C=>y.execute(C,e,n,s,r,a)),w&&v.restore(),x){x.offset();const C=l[c]*h+tn.indexOf(m);this.deferredZIndexContexts_[C]||(this.deferredZIndexContexts_[C]=[]),this.deferredZIndexContexts_[C].push(x)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(ce);for(let n=0,s=e.length;n<s;++n)t[e[n]].forEach(r=>{r.draw(this.renderedContext_),r.clear()}),t[e[n]].length=0}}const mo={};function v1(i){if(mo[i]!==void 0)return mo[i];const t=i*2+1,e=i*i,n=new Array(e+1);for(let r=0;r<=i;++r)for(let o=0;o<=i;++o){const a=r*r+o*o;if(a>e)break;let l=n[a];l||(l=[],n[a]=l),l.push(((i+r)*t+(i+o))*4+3),r>0&&l.push(((i-r)*t+(i+o))*4+3),o>0&&(l.push(((i+r)*t+(i-o))*4+3),r>0&&l.push(((i-r)*t+(i-o))*4+3))}const s=[];for(let r=0,o=n.length;r<o;++r)n[r]&&s.push(...n[r]);return mo[i]=s,s}const se=.5;function S1(i,t,e,n,s,r,o,a,l){const h=s,c=i[0]*se,u=i[1]*se,d=gt(c,u);d.imageSmoothingEnabled=!1;const f=d.canvas,_=new Zg(d,se,s,null,o,a,null),p=e.length,m=Math.floor((256*256*256-1)/p),y={};for(let v=1;v<=p;++v){const w=e[v-1],C=w.getStyleFunction()||n;if(!C)continue;let T=C(w,r);if(!T)continue;Array.isArray(T)||(T=[T]);const R=(v*m).toString(16).padStart(7,"#00000");for(let I=0,L=T.length;I<L;++I){const k=T[I],A=k.getGeometryFunction()(w);if(!A||!kt(h,A.getExtent()))continue;const O=k.clone(),P=O.getFill();P&&P.setColor(R);const U=O.getStroke();U&&(U.setColor(R),U.setLineDash(null)),O.setText(void 0);const N=k.getImage();if(N){const H=N.getImageSize();if(!H)continue;const nt=gt(H[0],H[1],void 0,{alpha:!1}),M=nt.canvas;nt.fillStyle=R,nt.fillRect(0,0,M.width,M.height),O.setImage(new Ei({img:M,anchor:N.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:N.getOrigin(),opacity:1,size:N.getSize(),scale:N.getScale(),rotation:N.getRotation(),rotateWithView:N.getRotateWithView()}))}const X=O.getZIndex()||0;let F=y[X];F||(F={},y[X]=F,F.Polygon=[],F.Circle=[],F.LineString=[],F.Point=[]);const Z=A.getType();if(Z==="GeometryCollection"){const H=A.getGeometriesArrayRecursive();for(let nt=0,M=H.length;nt<M;++nt){const yt=H[nt];F[yt.getType().replace("Multi","")].push(yt,O)}}else F[Z.replace("Multi","")].push(A,O)}}const x=Object.keys(y).map(Number).sort(ce);for(let v=0,w=x.length;v<w;++v){const C=y[x[v]];for(const T in C){const b=C[T];for(let R=0,I=b.length;R<I;R+=2){_.setStyle(b[R+1]);for(let L=0,k=t.length;L<k;++L)_.setTransform(t[L]),_.drawGeometry(b[R])}}}return d.getImageData(0,0,f.width,f.height)}function b1(i,t,e){const n=[];if(e){const s=Math.floor(Math.round(i[0])*se),r=Math.floor(Math.round(i[1])*se),o=(lt(s,0,e.width-1)+lt(r,0,e.height-1)*e.width)*4,a=e.data[o],l=e.data[o+1],c=e.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/t.length);c&&c%u===0&&n.push(t[c/u-1])}return n}class R1 extends ih{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Gt(),this.wrappedRenderedExtent_=Gt(),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(t,e,n){const s=e.extent,r=e.viewState,o=r.center,a=r.resolution,l=r.projection,h=r.rotation,c=l.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=e.pixelRatio,_=e.viewHints,p=!(_[St.ANIMATING]||_[St.INTERACTING]),m=this.context,y=Math.round(st(s)/a*f),x=Math.round(bt(s)/a*f),v=u.getWrapX()&&l.canWrapX(),w=v?st(c):null,C=v?Math.ceil((s[2]-c[2])/w)+1:1;let T=v?Math.floor((s[0]-c[0])/w):0;do{let b=this.getRenderTransform(o,a,0,f,y,x,T*w);e.declutter&&(b=b.slice(0)),t.execute(m,[m.canvas.width,m.canvas.height],b,h,p,n===void 0?tn:n?Sh:E1,n?d&&e.declutter[d]:void 0)}while(++T<C)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=gt(this.context.canvas.width,this.context.canvas.height,nh))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,hs(this.context),nh.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const s=t.viewState;this.prepareContainer(t,e);const r=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(Ut.PRERENDER)||this.getLayer().hasListener(Ut.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(r,t),s.projection,this.clipped_=!1,a&&n.extent&&this.clipping){const l=Ie(n.extent);a=kt(l,t.extent),this.clipped_=a&&!Hn(l,t.extent),this.clipped_&&this.clipUnrotated(r,t,l)}return a&&this.renderWorlds(o,t,this.getLayer().getDeclutter()?!1:void 0),!t.declutter&&this.clipped_&&r.restore(),this.postRender(r,t),this.renderedRotation_!==s.rotation&&(this.renderedRotation_=s.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=n[0]*se,d=n[1]*se;c.push(this.getRenderTransform(s,r,o,se,u,d,0).slice());const f=h.getSource(),_=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!Hn(_,l)){let p=l[0];const m=st(_);let y=0,x;for(;p<_[0];)--y,x=m*y,c.push(this.getRenderTransform(s,r,o,se,u,d,x).slice()),p+=m;for(y=0,p=l[2];p>_[2];)++y,x=m*y,c.push(this.getRenderTransform(s,r,o,se,u,d,x).slice()),p-=m}this.hitDetectionImageData_=S1(n,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o,fh(r,this.renderedPixelRatio_))}e(b1(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(d,f,_){const p=Q(d),m=h[p];if(m){if(m!==!0&&_<m.distanceSq){if(_===0)return h[p]=!0,r.splice(r.lastIndexOf(m),1),s(d,l,f);m.geometry=f,m.distanceSq=_}}else{if(_===0)return h[p]=!0,s(d,l,f);r.push(h[p]={feature:d,layer:l,geometry:f,distanceSq:_,callback:s})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,o,a,n,c,u?e.declutter?.[u]?.all().map(d=>d.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const s=t.viewHints[St.ANIMATING],r=t.viewHints[St.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,f=e.getRevision(),_=e.getRenderBuffer();let p=e.getRenderOrder();p===void 0&&(p=Hg);const m=h.center.slice(),y=js(l,_*u),x=y.slice(),v=[y.slice()],w=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!Hn(w,t.extent)){const P=st(w),U=Math.max(st(y)/2,P);y[0]=w[0]-U,y[2]=w[2]+U,Ea(m,c);const N=xa(v[0],c);N[0]<w[0]&&N[2]<w[2]?v.push([N[0]+P,N[1],N[2]+P,N[3]]):N[0]>w[0]&&N[2]>w[2]&&v.push([N[0]-P,N[1],N[2]-P,N[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!t.declutter&&Hn(this.wrappedRenderedExtent_,y))return ve(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const C=new m1(gh(u,d),y,u,d);let T;for(let P=0,U=v.length;P<U;++P)n.loadFeatures(v[P],u,c);const b=fh(u,d);let R=!0;const I=(P,U)=>{let N;const X=P.getStyleFunction()||e.getStyleFunction();if(X&&(N=X(P,u)),N){const F=this.renderFeature(P,b,N,C,T,this.getLayer().getDeclutter(),U);R=R&&!F}},L=Wa(y),k=n.getFeaturesInExtent(L);p&&k.sort(p);for(let P=0,U=k.length;P<U;++P)I(k[P],P);this.renderedFeatures_=k,this.ready=R;const A=C.finish(),O=new C1(y,u,d,n.getOverlaps(),A,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=x,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=c,this.renderedPixelRatio_=d,this.replayGroup_=O,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,s,r,o,a){if(!n)return!1;let l=!1;if(Array.isArray(n))for(let h=0,c=n.length;h<c;++h)l=_h(s,t,n[h],e,this.boundHandleStyleImageChange_,r,o,a)||l;else l=_h(s,t,n,e,this.boundHandleStyleImageChange_,r,o,a);return l}}class T1 extends Vl{constructor(t){super(t)}createRenderer(){return new R1(this)}}function I1({latitude:i,longitude:t,name:e,address:n,url:s,timestamp:r,isFromCustomer:o}){const a=We(null),l=We(null);he(()=>{if(!a.current)return;const u=Ru([t,i]),d=new go({geometry:new ss(u)});d.setStyle(new ke({image:new Ei({anchor:[.5,1],src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23ef4444' stroke='white' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3' fill='white'%3E%3C/circle%3E%3C/svg%3E",scale:1.5})}));const f=new h1({features:[d]}),_=new T1({source:f}),p=new ng({target:a.current,layers:[new Sg({source:new Yg}),_],view:new ne({center:u,zoom:15}),controls:[]});return l.current=p,()=>{p.setTarget(void 0),l.current=null}},[i,t]);const h=`https://www.google.com/maps?q=${i},${t}`,c=`https://www.openstreetmap.org/?mlat=${i}&mlon=${t}&zoom=15`;return E("div",{class:`message-wrapper ${o?"message-wrapper-end":"message-wrapper-start"}`,children:E("div",{class:`message-bubble ${o?"message-bubble-customer":"message-bubble-support"}`,children:E("div",{class:"message-media-content",children:[E("div",{ref:a,class:"message-location-map"}),(e||n)&&E("div",{class:"message-location-info",children:[e&&E("p",{class:"message-location-name ",style:o?"color: white;":"color: #18181b;",children:e}),n&&E("p",{class:`message-location-address ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:n})]}),E("div",{class:"message-location-coords",children:[E("svg",{class:`icon-xs ${o?"message-timestamp-customer":"message-timestamp-support"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("title",{children:"Pin"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),E("span",{class:`message-filesize ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:[i.toFixed(6),", ",t.toFixed(6)]})]}),s&&E("a",{href:s,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,children:"Visit Website"}),E("div",{class:"message-location-links",children:[E("a",{href:h,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,style:"flex: 1;",children:"Google Maps"}),E("a",{href:c,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,style:"flex: 1;",children:"OpenStreetMap"})]}),E("span",{class:`message-timestamp ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function M1({messages:i}){const t=We(null),e=Ec({count:i.length,getScrollElement:()=>t.current,estimateSize:()=>192,overscan:5});he(()=>{i.length>0&&e.scrollToIndex(i.length-1,{align:"end"})},[i.length]);const n=r=>{const o={timestamp:r.timestamp,isFromCustomer:!r.isSupport};switch(r.type){case"text":return E(Cc,{content:r.content||"",...o});case"photo":return E(vc,{url:r.url||"",filename:r.filename,size:r.size,caption:r.content,...o});case"video":return E(Sc,{url:r.url||"",filename:r.filename,size:r.size,caption:r.content,...o});case"file":return E(bc,{url:r.url||"",filename:r.filename||"file",size:r.size,mimeType:r.mimeType,...o});case"location":return E(I1,{latitude:r.latitude||0,longitude:r.longitude||0,name:r.name,address:r.address,...o});default:return null}},s=e.getVirtualItems();return E("div",{ref:t,class:"message-list",children:E("div",{style:{height:`${e.getTotalSize()}px`,width:"100%",position:"relative"},children:s.map(r=>{const o=i[r.index];return o?E("div",{"data-index":r.index,ref:e.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${r.start}px)`},children:n(o)},r.key):null})})})}function L1(i,t){for(var e in t)i[e]=t[e];return i}function bh(i,t){for(var e in i)if(e!=="__source"&&!(e in t))return!0;for(var n in t)if(n!=="__source"&&i[n]!==t[n])return!0;return!1}function Rh(i,t){this.props=i,this.context=t}(Rh.prototype=new le).isPureReactComponent=!0,Rh.prototype.shouldComponentUpdate=function(i,t){return bh(this.props,i)||bh(this.state,t)};var Th=Y.__b;Y.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Th&&Th(i)};var A1=Y.__e;Y.__e=function(i,t,e,n){if(i.then){for(var s,r=t;r=r.__;)if((s=r.__c)&&s.__c)return t.__e==null&&(t.__e=e.__e,t.__k=e.__k),s.__c(i,t)}A1(i,t,e,n)};var Ih=Y.unmount;function Mh(i,t,e){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),i.__c.__H=null),(i=L1({},i)).__c!=null&&(i.__c.__P===e&&(i.__c.__P=t),i.__c.__e=!0,i.__c=null),i.__k=i.__k&&i.__k.map(function(n){return Mh(n,t,e)})),i}function Lh(i,t,e){return i&&e&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(n){return Lh(n,t,e)}),i.__c&&i.__c.__P===t&&(i.__e&&e.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=e)),i}function po(){this.__u=0,this.o=null,this.__b=null}function Ah(i){var t=i.__.__c;return t&&t.__a&&t.__a(i)}function Is(){this.i=null,this.l=null}Y.unmount=function(i){var t=i.__c;t&&t.__R&&t.__R(),t&&32&i.__u&&(i.type=null),Ih&&Ih(i)},(po.prototype=new le).__c=function(i,t){var e=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(e);var s=Ah(n.__v),r=!1,o=function(){r||(r=!0,e.__R=null,s?s(a):a())};e.__R=o;var a=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=Lh(l,l.__c.__P,l.__c.__O)}var h;for(n.setState({__a:n.__b=null});h=n.o.pop();)h.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),i.then(o,o)},po.prototype.componentWillUnmount=function(){this.o=[]},po.prototype.render=function(i,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Mh(this.__b,e,n.__O=n.__P)}this.__b=null}var s=t.__a&&g(on,null,i.fallback);return s&&(s.__u&=-33),[g(on,null,t.__a?null:i.children),s]};var kh=function(i,t,e){if(++e[1]===e[0]&&i.l.delete(t),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.l.size))for(e=i.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;i.i=e=e[2]}};(Is.prototype=new le).__a=function(i){var t=this,e=Ah(t.__v),n=t.l.get(i);return n[0]++,function(s){var r=function(){t.props.revealOrder?(n.push(s),kh(t,i,n)):s()};e?e(r):r()}},Is.prototype.render=function(i){this.i=null,this.l=new Map;var t=Oi(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return i.children},Is.prototype.componentDidUpdate=Is.prototype.componentDidMount=function(){var i=this;this.l.forEach(function(t,e){kh(i,e,t)})};var k1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,O1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,P1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,D1=/[A-Z0-9]/g,F1=typeof document<"u",z1=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};le.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(le.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(t){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t})}})});var Oh=Y.event;function N1(){}function G1(){return this.cancelBubble}function W1(){return this.defaultPrevented}Y.event=function(i){return Oh&&(i=Oh(i)),i.persist=N1,i.isPropagationStopped=G1,i.isDefaultPrevented=W1,i.nativeEvent=i};var U1={enumerable:!1,configurable:!0,get:function(){return this.class}},Ph=Y.vnode;Y.vnode=function(i){typeof i.type=="string"&&(function(t){var e=t.props,n=t.type,s={},r=n.indexOf("-")===-1;for(var o in e){var a=e[o];if(!(o==="value"&&"defaultValue"in e&&a==null||F1&&o==="children"&&n==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in e&&e.value==null?o="value":o==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?o="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||z1(e.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":P1.test(o)&&(o=l):l=o="oninput":r&&O1.test(o)?o=o.replace(D1,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&s[o=l]&&(o="oninputCapture"),s[o]=a}}n=="select"&&s.multiple&&Array.isArray(s.value)&&(s.value=Oi(e.children).forEach(function(h){h.props.selected=s.value.indexOf(h.props.value)!=-1})),n=="select"&&s.defaultValue!=null&&(s.value=Oi(e.children).forEach(function(h){h.props.selected=s.multiple?s.defaultValue.indexOf(h.props.value)!=-1:s.defaultValue==h.props.value})),e.class&&!e.className?(s.class=e.class,Object.defineProperty(s,"className",U1)):(e.className&&!e.class||e.class&&e.className)&&(s.class=s.className=e.className),t.props=s})(i),i.$$typeof=k1,Ph&&Ph(i)};var Dh=Y.__r;Y.__r=function(i){Dh&&Dh(i),i.__c};var Fh=Y.diffed;Y.diffed=function(i){Fh&&Fh(i);var t=i.props,e=i.__e;e!=null&&i.type==="textarea"&&"value"in t&&t.value!==e.value&&(e.value=t.value==null?"":t.value)};const zh=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg",baseProfile:"tiny",viewBox:"0 0 1000 1000",overflow:"visible","xmlns:v":"https://vecta.io/nano",...i},g("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:830.5784,y1:292.0937,x2:904.9009,y2:370.9836},g("stop",{offset:.176,stopColor:"#fb8c0b"}),g("stop",{offset:.2112,stopColor:"#fb8d12"}),g("stop",{offset:.5104,stopColor:"#fd964b"}),g("stop",{offset:.7327,stopColor:"#ff9c6e"}),g("stop",{offset:.852,stopColor:"#ff9e7b"})),g("path",{fill:"url(#A)",d:"M858.44 302.57l.02.02c44.13 50.68 60.09 100.95 60.58 102.51-11.62-16.59-25.32-28.2-25.32-28.2-44.96-75.63-79.85-89.47-80.92-89.88.94.14 19.93 3.2 45.62 15.54l.02.01z"}),g("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:550.4614,y1:225.9705,x2:954.0455,y2:611.2855},g("stop",{offset:.0927,stopColor:"#ff9b00"}),g("stop",{offset:.1525,stopColor:"#fd9501"}),g("stop",{offset:.3972,stopColor:"#f78105"}),g("stop",{offset:.5633,stopColor:"#f57a07"}),g("stop",{offset:.6623,stopColor:"#f68006"}),g("stop",{offset:.7888,stopColor:"#f88f05"}),g("stop",{offset:.9298,stopColor:"#fcaa02"}),g("stop",{offset:.9506,stopColor:"#fdae01"})),g("path",{fill:"url(#B)",d:"M767.48 327.05c-147.63-77.8-276.72-27.72-321.56-5.16 42.21-31.97 102.06-62.94 178.44-67.27 0 0 114.88-1.26 181.54 68.47-.71-1.17-23.82-38.95-74.72-62.25 0 0 81.58 26.17 131.39 85.31-.27-.98-9.32-32.16-49.76-59.13 1.07.41 35.96 14.25 80.92 89.88 42.37 107.53 37.37 172 37.37 172-3.12-14.64-9.65-37.69-9.65-37.69 5.92 74.75-19.62 145.44-19.62 145.44 5.29-42.35 2.49-86.57 2.49-86.57-.31 9.04-3.73 28.65-3.73 28.65-5.92-151.34-70.56-210.27-94.98-227.65-62.6-44.52-152.21-53.8-175.95-52.93l-10.09.46c-6.74.35-13.26.82-19.58 1.39 65.15-24.14 165.23 6.36 167.49 7.05z"}),g("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:371.8762,y1:310.8523,x2:862.566,y2:310.8523},g("stop",{offset:.0887,stopColor:"#ffb506"}),g("stop",{offset:.1614,stopColor:"#fd9e05"}),g("stop",{offset:.312,stopColor:"#fa7402"}),g("stop",{offset:.4305,stopColor:"#f85b01"}),g("stop",{offset:.5012,stopColor:"#f75100"}),g("stop",{offset:.6939,stopColor:"#f75f00"}),g("stop",{offset:.8718,stopColor:"#f67000"})),g("path",{fill:"url(#C)",d:"M445.92 321.89c-47.34 35.85-72.51 72.97-74.04 75.24 1.28-2.55 24.45-47.67 76.17-91.23l.03-.03c44.13-37.17 109.02-73.19 198.85-80.67 13.21-1.1 26.5-.72 39.59 1.26 35.22 5.34 107.97 22.42 171.9 76.1-25.69-12.34-44.68-15.4-45.62-15.54 40.44 26.97 49.5 58.16 49.76 59.13-49.81-59.15-131.39-85.31-131.39-85.31 50.9 23.3 74.01 61.08 74.72 62.25-66.66-69.73-181.54-68.47-181.54-68.47-76.37 4.32-136.22 35.29-178.43 67.27z"}),g("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:768.9774,y1:212.5162,x2:881.7068,y2:297.219},g("stop",{offset:.1369,stopColor:"#feaf02"}),g("stop",{offset:.305,stopColor:"#fcad2e"}),g("stop",{offset:.542,stopColor:"#faab67"}),g("stop",{offset:.7183,stopColor:"#f9aa8a"}),g("stop",{offset:.8128,stopColor:"#f8a997"})),g("path",{fill:"url(#D)",d:"M840.59 250.66c43.31 41.28 60.5 82.56 61.02 83.83-20.04-20.83-42.46-31.58-43.15-31.91l-.02-.02-.02-.02c-.74-1.21-40-64.01-123.03-88.86 11.56-1.62 37-3.27 71.68 5.49.02 0 .02 0 .03.02 39.26 20.51 58.39 42.26 58.39 42.26-10.37-5.8-24.9-10.79-24.9-10.79z"}),g("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:493.187,y1:254.5463,x2:806.463,y2:255.7919},g("stop",{offset:.2263,stopColor:"#ffaf00"}),g("stop",{offset:.5904,stopColor:"#fd9401"}),g("stop",{offset:.8408,stopColor:"#fc8702"})),g("path",{fill:"url(#E)",d:"M735.39 213.7c83.03 24.84 122.29 87.64 123.03 88.86-63.93-53.68-136.68-70.77-171.9-76.1-13.1-1.98-26.39-2.36-39.59-1.26-89.83 7.48-154.73 43.5-198.85 80.67 28.95-34.29 102.76-102.85 219.37-102.11 25.24.15 47.88 3.92 67.94 9.94z"}),g("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:311.0594,y1:578.8053,x2:347.5978,y2:307.2579},g("stop",{offset:.2039,stopColor:"#002d61"}),g("stop",{offset:.8575,stopColor:"#006b7c"})),g("path",{fill:"url(#F)",d:"M323.64 464.49s-2.42 55.5 25.71 94.52c-5.2-3.51-10.31-7.23-15.37-11.15-9.43-7.26-18.59-15.21-27.5-23.79-6.69-21.27-10.06-43.78-11.71-62.36-.94-10.63-.71-21.25.69-31.72 1.09-8.12 2.87-16.14 5.35-23.96 0-.02.02-.03.02-.05 2.82-8.93 6.55-17.6 11.15-25.85 11.32-20.31 27.99-44.93 50.57-65.49-21.33 33-31.12 69.37-35.53 98-4.69 30.23-3.38 51.85-3.38 51.85z"}),g("linearGradient",{id:"G",gradientUnits:"userSpaceOnUse",x1:351.8596,y1:378.1933,x2:635.0329,y2:152.319},g("stop",{offset:.176,stopColor:"#00b6af"}),g("stop",{offset:.8408,stopColor:"#06114c"})),g("path",{fill:"url(#G)",d:"M667.02 135.23c58.03 20.84 84.31 41.29 85.11 41.92-58.96-24.91-112.46-24.91-112.46-24.91-157.31-2.06-249.91 128.47-258.73 138.27-6.94 7.71-13.04 15.81-18.4 24.12-22.58 20.56-39.25 45.18-50.57 65.49-4.6 8.25-8.33 16.92-11.15 25.85 1.01-4.44 70.71-305.01 366.2-270.74z"}),g("linearGradient",{id:"H",gradientUnits:"userSpaceOnUse",x1:317.6593,y1:353.339,x2:594.1892,y2:140.7514},g("stop",{offset:.1536,stopColor:"#017c84"}),g("stop",{offset:.8743,stopColor:"#00396d"})),g("path",{fill:"url(#H)",d:"M396.23 170.36c95.5-79.58 228.12-56.71 228.12-56.71 70.39 15.13 109.12 41.09 110.31 41.91-41.09-14.52-67.65-20.32-67.65-20.32-295.49-34.27-365.18 266.3-366.19 270.75 0 .02-.02.03-.02.05 3.69-120.9 44.23-193.02 95.43-235.68z"}),g("linearGradient",{id:"I",gradientUnits:"userSpaceOnUse",x1:266.0229,y1:513.5699,x2:343.252,y2:155.6588},g("stop",{offset:.2934,stopColor:"#004f63"}),g("stop",{offset:.3903,stopColor:"#005366"}),g("stop",{offset:.4955,stopColor:"#006070"}),g("stop",{offset:.6045,stopColor:"#007680"}),g("stop",{offset:.7156,stopColor:"#009497"}),g("stop",{offset:.7731,stopColor:"#00a7a5"})),g("path",{fill:"url(#I)",d:"M284.61 320s22.31-91.88 111.62-149.64c-51.2 42.66-91.74 114.79-95.42 235.68-2.49 7.82-4.27 15.84-5.35 23.96-1.4 10.47-1.64 21.1-.69 31.72 1.65 18.58 5.02 41.09 11.71 62.36-13.78-13.27-26.91-28.05-39.3-44.22-11.4-14.86-20.94-28.79-28.59-43.26-2.2-65.95 11.87-121.84 31.91-167.3 13.54-22.01 28.01-41.18 43.01-57.87-10.05 20.94-25.83 60.64-28.9 108.57z"}),g("linearGradient",{id:"J",gradientUnits:"userSpaceOnUse",x1:302.5277,y1:300.2615,x2:573.4523,y2:113.4169},g("stop",{offset:.1592,stopColor:"#00c6b9"}),g("stop",{offset:.8687,stopColor:"#005399"})),g("path",{fill:"url(#J)",d:"M582.32 102.01c81.38 6.23 111.7 21.17 111.7 21.17-39.45-9.13-69.66-9.54-69.66-9.54s-132.62-22.88-228.12 56.71C306.92 228.12 284.61 320 284.61 320c3.07-47.92 18.84-87.63 28.9-108.58C431.2 80.49 582.32 102.01 582.32 102.01z"}),g("linearGradient",{id:"K",gradientUnits:"userSpaceOnUse",x1:549.8682,y1:85.1864,x2:327.3156,y2:216.3928},g("stop",{offset:.2318,stopColor:"#d2f3ff"}),g("stop",{offset:.6229,stopColor:"#4799c4"})),g("path",{fill:"url(#K)",d:"M313.52 211.41c-15 16.69-29.47 35.86-43.01 57.87 10.12-22.95 21.77-43.25 33.63-60.83 45.47-67.49 118.91-111.42 200-118.3 65.15-5.53 110.99 8.96 110.99 8.96-18.28 0-32.81 2.9-32.81 2.9s-151.12-21.52-268.8 109.4z"}),g("path",{fill:"#f9a9b2",d:"M350.17 106.19c-13.26 7.05-21.95 15.35-21.95 15.35s-23.63 12.08-51.18 35.08c-41.85 28.67-68.09 58.44-68.09 58.44 7.65-19 18.83-40.52 19.18-41.18l.02-.02c63.34-50.69 120.25-67.17 122.02-67.67z"}),g("linearGradient",{id:"L",gradientUnits:"userSpaceOnUse",x1:108.8685,y1:422.9365,x2:199.3843,y2:204.536},g("stop",{offset:.2877,stopColor:"#badbf2"}),g("stop",{offset:.824,stopColor:"#ea8f97"})),g("path",{fill:"url(#L)",d:"M248.04 152.69c-8.71 7.07-19.9 21.16-19.9 21.16l-.02.02c-57.68 58.55-84.26 155.36-84.26 155.36s0 .02-.02.03c-.6 1.09-18.33 33.9-21.13 94.33-10.45-70.31 7.07-143.55 52.79-202.16 35.75-45.82 71.44-68.06 72.54-68.74z"}),g("path",{fill:"#7a8abc",d:"M143.85 329.25c-.6 2.47-32.12 133.35 65.63 260.24-16.29-17.18-30.35-35.11-42.4-52.76-23.68-34.65-38.48-73.41-44.36-113.1v-.05c2.8-60.43 20.53-93.24 21.13-94.33z"}),g("linearGradient",{id:"M",gradientUnits:"userSpaceOnUse",x1:220.3083,y1:187.7026,x2:215.3258,y2:476.6888},g("stop",{offset:.1201,stopColor:"#ff4e62"}),g("stop",{offset:.9134,stopColor:"#f81134"})),g("path",{fill:"url(#M)",d:"M287.41 598.8c-25.21-14.89-50.22-35.01-72.55-62.06-80.56-97.56-71-207.51-71-207.51s26.57-96.81 84.26-155.36c-.35.66-11.52 22.18-19.18 41.18 0 0 26.24-29.77 68.09-58.44-22.25 18.56-47.06 44.27-64.03 76.5-7.67 14.55-13.38 29.93-17.08 45.75-10.26 21.32-26.32 70.04-9.71 145.78 0 0 13.18 105.53 101.2 174.16z"}),g("linearGradient",{id:"N",gradientUnits:"userSpaceOnUse",x1:298.8625,y1:138.71,x2:355.3311,y2:582.9848},g("stop",{offset:.159,stopColor:"#fc152e"}),g("stop",{offset:.4989,stopColor:"#fb163f"}),g("stop",{offset:.6118,stopColor:"#fb1b3c"}),g("stop",{offset:.7462,stopColor:"#f92933"}),g("stop",{offset:.8397,stopColor:"#f8382a"})),g("path",{fill:"url(#N)",d:"M238.59 436.59c7.65 14.47 17.19 28.4 28.59 43.26 12.39 16.17 25.52 30.95 39.3 44.22 8.91 8.58 18.07 16.53 27.5 23.79-102.76-25.31-132.54-137.76-141.17-197.6-3.45-23.91-2.35-48.13 3.12-71.4 3.7-15.82 9.41-31.2 17.08-45.75 16.97-32.23 41.78-57.94 64.03-76.5 27.55-23 51.18-35.08 51.18-35.08 65.18-29.9 97.15-33.63 97.15-33.63-58.96 22.83-110.9 60.74-143.5 96.88-50.85 56.36-67.95 116.83-66.59 156.8 1.35 39.66 9.11 68.23 23.31 95.01z"}),g("linearGradient",{id:"O",gradientUnits:"userSpaceOnUse",x1:358.3707,y1:541.8871,x2:681.6118,y2:217.4005},g("stop",{offset:.1373,stopColor:"#fce304"}),g("stop",{offset:.3727,stopColor:"#fcc703"}),g("stop",{offset:.714,stopColor:"#fca401"}),g("stop",{offset:.8979,stopColor:"#fc9700"})),g("path",{fill:"url(#O)",d:"M370.25 508.1s.54 43.92 20.59 74.09l-7.05-3.27c-11.78-5.68-23.27-12.33-34.45-19.9-28.13-39.03-25.71-94.52-25.71-94.52s-1.31-21.62 3.37-51.84c39-86.01 110.41-144.13 110.41-144.13 108.36-88.02 230.03-84.7 230.03-84.7 60.74 2.25 107.1 18.4 139.63 35.38-34.68-8.77-60.12-7.12-71.68-5.49-20.06-6.01-42.7-9.79-67.95-9.95-116.61-.74-190.42 67.82-219.37 102.11l-.03.03c-51.72 43.56-74.89 88.68-76.17 91.23 1.53-2.27 26.7-39.39 74.04-75.24 44.84-22.56 173.93-72.64 321.56 5.16-2.25-.69-102.33-31.19-167.49-7.07-34.97 3.12-63.7 9.32-87.69 17.49-44.18 15.05-72.31 36.87-93.81 58.8-51.55 52.56-48.23 111.82-48.23 111.82z"}),g("linearGradient",{id:"P",gradientUnits:"userSpaceOnUse",x1:317.0297,y1:590.4086,x2:549.5474,y2:591.2391},g("stop",{offset:.2035,stopColor:"#ffcf00"}),g("stop",{offset:.8463,stopColor:"#ee961e"})),g("path",{fill:"url(#P)",d:"M390.85 582.19c25.98 11.6 53.24 18.5 81.44 20.15 76.89 4.52 121.87-44.98 123.19-46.46-22.56 37.91-56.96 58.61-87.34 69.88-122.63 8.14-175.98-51.24-175.98-51.24s22.99 6.39 51.64 4.39c2.32 1.14 4.69 2.22 7.05 3.28z"}),g("path",{fill:"#ffb709",d:"M508.14 625.76c-35.14 13.07-64.91 13.54-64.91 13.54-22.99 1.78-89.28-1.57-154.68-39.83 113.13 52.35 219.59 26.29 219.59 26.29z"}),g("linearGradient",{id:"Q",gradientUnits:"userSpaceOnUse",x1:173.8351,y1:282.2208,x2:410.5049,y2:644.284},g("stop",{offset:.2095,stopColor:"#fb2847"}),g("stop",{offset:.3121,stopColor:"#fb2c44"}),g("stop",{offset:.4235,stopColor:"#fb393c"}),g("stop",{offset:.5392,stopColor:"#fb4f2d"}),g("stop",{offset:.6576,stopColor:"#fa6e1a"}),g("stop",{offset:.7772,stopColor:"#fa9400"}),g("stop",{offset:.7793,stopColor:"#fa9500"})),g("path",{fill:"url(#Q)",d:"M349.35 559.01c11.18 7.57 22.67 14.22 34.45 19.9-28.65 2-51.64-4.39-51.64-4.39s53.35 59.38 175.98 51.24c0 0-106.46 26.06-219.59-26.29-.38-.22-.76-.44-1.13-.68-88.02-68.63-101.2-174.15-101.2-174.15-16.61-75.74-.55-124.47 9.71-145.78-5.46 23.27-6.57 47.48-3.12 71.4 8.63 59.84 38.41 172.3 141.17 197.61 5.06 3.92 10.17 7.63 15.37 11.14z"}),g("linearGradient",{id:"R",gradientUnits:"userSpaceOnUse",x1:162.403,y1:411.6314,x2:468.828,y2:623.3885},g("stop",{offset:.2318,stopColor:"#09144e"}),g("stop",{offset:.7179,stopColor:"#071c4c"})),g("path",{fill:"url(#R)",d:"M288.55 599.47c65.4 38.26 131.69 41.61 154.68 39.83 0 0 29.77-.47 64.91-13.54 30.38-11.27 64.78-31.97 87.34-69.88h.02c-.38 1.29-11.13 36.15-46.9 71.41-45.07 36.37-91.89 57.15-135.66 67.18-90.21-11.63-156.19-55.1-203.4-104.93l-.05-.05c-97.75-126.89-66.23-257.77-65.63-260.24.02-.02.02-.03.02-.03s-9.56 109.95 71 207.51c22.32 27.05 47.34 47.17 72.55 62.06.36.24.74.46 1.12.68z"}),g("linearGradient",{id:"S",gradientUnits:"userSpaceOnUse",x1:138.8448,y1:758.079,x2:493.8495,y2:801.0532},g("stop",{offset:.1872,stopColor:"#b0185c"}),g("stop",{offset:.852,stopColor:"#431d55"})),g("path",{fill:"url(#S)",d:"M426 804.55s64.78-5.76 134.13-34.04c-95.53 63.68-185 63.52-185 63.52-179.25 6.6-252.16-127.49-253.26-129.52 12.69 15.54 42.22 36.27 43.15 36.92l.02.02s38.6 27.13 77.22 39.93C322.82 825.31 426 804.55 426 804.55z"}),g("linearGradient",{id:"T",gradientUnits:"userSpaceOnUse",x1:85.7245,y1:679.5264,x2:355.015,y2:679.5264},g("stop",{offset:.1927,stopColor:"#ff4e6c"}),g("stop",{offset:.4075,stopColor:"#bc3963"}),g("stop",{offset:.6132,stopColor:"#84285c"}),g("stop",{offset:.765,stopColor:"#601d58"}),g("stop",{offset:.8464,stopColor:"#531956"})),g("path",{fill:"url(#T)",d:"M355.02 781.21c-54.69 5.49-112.75.16-112.75.16-38.62-12.8-77.22-39.93-77.22-39.93l-.02-.02c-67.67-79.32-79.3-166.08-79.3-166.08 9.65 27.76 27.88 56.68 29.02 58.46.02.03.03.06.05.09 44.65 89.69 130.39 122.89 130.39 122.89.02 0 .02 0 .03.02 1.43.72 45.92 22.42 109.8 24.41z"}),g("linearGradient",{id:"U",gradientUnits:"userSpaceOnUse",x1:98.0806,y1:561.1125,x2:281.6034,y2:754.6004},g("stop",{offset:.3101,stopColor:"#f32e6f"}),g("stop",{offset:.4613,stopColor:"#b22566"}),g("stop",{offset:.6104,stopColor:"#7a1e5e"}),g("stop",{offset:.7204,stopColor:"#561959"}),g("stop",{offset:.7793,stopColor:"#491757"})),g("path",{fill:"url(#U)",d:"M154.44 668.16s67.89 83.46 199.31 91.55c0 0-67.04 6.64-108.55-2.9-.02-.02-.02-.02-.03-.02 0 0-85.74-33.2-130.39-122.89-.02-.03-.03-.06-.05-.09-32.23-70.26-45.6-135.14-46.01-137.16 6.03 15.24 21.9 47.37 22.39 48.36.02.02.02.02.02.03-.01.01 23.66 73.5 63.31 123.12z"}),g("linearGradient",{id:"V",gradientUnits:"userSpaceOnUse",x1:75.0084,y1:526.226,x2:365.6554,y2:746.2873},g("stop",{offset:.2655,stopColor:"#001149"}),g("stop",{offset:.3455,stopColor:"#381a59"}),g("stop",{offset:.4348,stopColor:"#702368"}),g("stop",{offset:.5013,stopColor:"#942972"}),g("stop",{offset:.537,stopColor:"#a12b76"}),g("stop",{offset:.5872,stopColor:"#972a75"}),g("stop",{offset:.7885,stopColor:"#742771"}),g("stop",{offset:.8969,stopColor:"#67266f"})),g("path",{fill:"url(#V)",d:"M384.49 709.68c-15.63 6.36-41 12.64-81.05 13.74-45.64-8.25-100.19-24.29-149-55.26-39.66-49.62-63.32-123.11-63.32-123.11 0-.02 0-.02-.02-.03-16.59-56.05-14.52-91.74-14.52-91.74s12.04 121.24 101.23 193.91c35.96 29.3 89.77 50.65 152.88 54.39 23.36 1.39 49.18-.17 76.26-5.81-1.41 1.64-7.44 7.8-22.46 13.91z"}),g("linearGradient",{id:"W",gradientUnits:"userSpaceOnUse",x1:362.453,y1:725.0145,x2:621.5441,y2:629.5162},g("stop",{offset:.2207,stopColor:"#061f5e"}),g("stop",{offset:.5032,stopColor:"#033378"}),g("stop",{offset:.8408,stopColor:"#00509c"})),g("path",{fill:"url(#W)",d:"M643.29 587.49c-1.83 3.72-58.09 114.67-217.98 141.44-14.63 2.46-29.49 3.35-44.32 2.85-18.2-.61-45.7-2.6-77.55-8.36 40.05-1.1 65.41-7.38 81.05-13.74 164.83 2.56 256.02-118.46 258.8-122.19z"}),g("linearGradient",{id:"X",gradientUnits:"userSpaceOnUse",x1:164.869,y1:742.5378,x2:707.341,y2:652.2296},g("stop",{offset:.1242,stopColor:"#281f60"}),g("stop",{offset:.5843,stopColor:"#091a4d"}),g("stop",{offset:.6629,stopColor:"#081d51"}),g("stop",{offset:.7483,stopColor:"#07265e"}),g("stop",{offset:.8369,stopColor:"#043574"}),g("stop",{offset:.9271,stopColor:"#014a92"}),g("stop",{offset:.9419,stopColor:"#004e98"})),g("path",{fill:"url(#X)",d:"M355.02 781.21c-63.87-2-108.36-23.69-109.81-24.4 41.52 9.54 108.55 2.9 108.55 2.9-131.43-8.09-199.31-91.55-199.31-91.55 48.8 30.97 103.36 47.01 149 55.26 31.85 5.76 59.35 7.75 77.55 8.36 14.83.5 29.69-.39 44.32-2.85 159.89-26.76 216.16-137.72 217.98-141.44.02-.03.03-.06.05-.08-27.41 80.56-102.25 142.37-159.31 168.22-46.53 21.07-91.18 26.78-129.02 25.58z"}),g("linearGradient",{id:"Y",gradientUnits:"userSpaceOnUse",x1:523.5785,y1:779.6559,x2:676.3758,y2:497.313},g("stop",{offset:.1313,stopColor:"#04174d"}),g("stop",{offset:.2856,stopColor:"#053067"}),g("stop",{offset:.6132,stopColor:"#0970a9"}),g("stop",{offset:.8799,stopColor:"#0ca8e3"})),g("path",{fill:"url(#Y)",d:"M706.88 571.17v.03c-13.89 84.35-79.3 142.84-79.3 142.84-22.09 22.92-44.93 41.47-67.44 56.47C490.79 798.78 426 804.55 426 804.55s148.48-59.42 216.44-178.84c5.73-10.08 10.33-20.75 14-31.75 7.87-23.65 20.29-68.92 21.17-121.6 15.38 24.72 27.65 57.12 29.27 98.81z"}),g("linearGradient",{id:"Z",gradientUnits:"userSpaceOnUse",x1:307.9633,y1:836.7527,x2:672.5178,y2:504.5846},g("stop",{offset:.1313,stopColor:"#251f5c"}),g("stop",{offset:.5559,stopColor:"#043d80"}),g("stop",{offset:.6334,stopColor:"#1d5795"}),g("stop",{offset:.798,stopColor:"#5b99cb"}),g("stop",{offset:.8911,stopColor:"#81c1ec"})),g("path",{fill:"url(#Z)",d:"M677.61 472.35c-.88 52.68-13.3 97.96-21.17 121.6-3.67 11-8.27 21.68-14 31.75C574.48 745.13 426 804.55 426 804.55s-103.18 20.77-183.74-23.17c0 0 58.06 5.34 112.75-.16 37.85 1.2 82.5-4.52 129.02-25.58 57.05-25.85 131.9-87.66 159.31-168.22l.02-.02s27.31-80.4 3.62-152.76c10.21 9.82 21.03 22.26 30.63 37.71z"}),g("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:429.3755,y1:719.3273,x2:689.297,y2:436.1541},g("stop",{offset:.1416,stopColor:"#0b3882"}),g("stop",{offset:.3507,stopColor:"#074f9d"}),g("stop",{offset:.6646,stopColor:"#036dc0"}),g("stop",{offset:.8337,stopColor:"#0178cd"})),g("path",{fill:"url(#a)",d:"M412.93 694.47c43.77-10.03 90.59-30.81 135.66-67.18 17.55-14.17 34.84-30.68 51.58-49.86 10.91-12.48 32.43-44.68 38.63-83.8 1.2-7.51 1.12-15.16-.03-22.69-2.03-13.18-7.34-35.22-21.13-59.08 5.21 2.94 10.19 6.3 14.88 10.08 4.52 3.64 9.41 7.84 14.45 12.7 23.69 72.36-3.62 152.76-3.62 152.76l-.02.02c-.02.02-.03.05-.05.08-2.79 3.73-93.97 124.75-258.81 122.18 15.02-6.11 21.05-12.26 22.48-13.9l5.98-1.31z"}),g("linearGradient",{id:"b",gradientUnits:"userSpaceOnUse",x1:578.1238,y1:318.1917,x2:862.1276,y2:662.816},g("stop",{offset:.3119,stopColor:"#0a144d"}),g("stop",{offset:.3851,stopColor:"#10144d"}),g("stop",{offset:.4873,stopColor:"#23134d"}),g("stop",{offset:.6064,stopColor:"#40124d"}),g("stop",{offset:.7385,stopColor:"#6a104d"}),g("stop",{offset:.8796,stopColor:"#9e0e4d"}),g("stop",{offset:.9112,stopColor:"#ab0d4d"})),g("path",{fill:"url(#b)",d:"M640.87 373.21c-69.27-29.17-132.5-25.55-149.61-23.85 6.53-4.17 13.54-8.17 21.03-11.89 23.99-8.17 52.72-14.37 87.69-17.49 6.33-.57 12.85-1.04 19.58-1.39 21.6 7.01 115.3 41.34 174.52 126.59 18.77 27.02 53.23 84.56 56.5 165.7-1.81 30.86-6.77 58.33-13.79 82.68.06-53.24-16.09-112.5-24.94-138.18-2.91-8.44-6.34-16.69-10.26-24.7-42.84-87.44-103.83-133.52-160.72-157.47z"}),g("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:306.799,y1:884.7103,x2:578.7616,y2:862.2889},g("stop",{offset:.2765,stopColor:"#ff3051"}),g("stop",{offset:.852,stopColor:"#ed0534"})),g("path",{fill:"url(#c)",d:"M583.56 846.49s-47.32 36.54-176.25 45.26c0 0-52.54-1.67-84.49-18.69l37.63 2.06c.05.02.11.02.16.02-.01 0 111.47 13.9 222.95-28.65z"}),g("path",{fill:"#fbd9df",d:"M836.79 693.57c7.02-24.36 11.98-51.83 13.79-82.68l.17 5.57c1.07 48.16 8.93 195.97-160.47 279.84l19.08-33.8c.02 0 .02-.02.02-.02s91.22-43.2 127.41-168.91z"}),g("linearGradient",{id:"d",gradientUnits:"userSpaceOnUse",x1:678.17,y1:884.6088,x2:788.6159,y2:675.343},g("stop",{offset:.2148,stopColor:"#feb9c2"}),g("stop",{offset:.7754,stopColor:"#c70f4e"})),g("path",{fill:"url(#d)",d:"M798.46 603.44c.83 1.45 23.6 41.64 38.34 90.13-36.2 125.71-127.42 168.91-127.42 168.91s0 .02-.02.02c-1.04.52-47.45 23.95-105.28 38.41 241.25-100.19 195.21-293.99 194.38-297.47z"}),g("linearGradient",{id:"e",gradientUnits:"userSpaceOnUse",x1:509.4222,y1:924.4413,x2:799.0312,y2:683.4119},g("stop",{offset:.3603,stopColor:"#ffafb8"}),g("stop",{offset:.7291,stopColor:"#f60537"})),g("path",{fill:"url(#e)",d:"M543.34 898.79c4.03-1.1 268.08-74.77 255.11-295.39 0 0 0 .02.02.05.83 3.48 46.87 197.28-194.37 297.47-26.31 6.58-54.98 11.3-82.81 11.18 0 0 9.97-6.64 22.01-13.29-.01-.01.01-.01.04-.02z"}),g("linearGradient",{id:"f",gradientUnits:"userSpaceOnUse",x1:698.8871,y1:845.7236,x2:637.436,y2:420.5485},g("stop",{offset:.3569,stopColor:"#cf0038"}),g("stop",{offset:.7682,stopColor:"#211548"})),g("path",{fill:"url(#f)",d:"M811.86 555.39c8.85 25.68 25 84.94 24.94 138.18-14.74-48.49-37.5-88.68-38.34-90.13-.02-.03-.02-.05-.02-.05 12.97 220.63-251.08 294.29-255.11 295.39 64.75-27.41 123.68-94.24 123.68-94.24 63.54-58.53 95.23-149.18 93.37-211.34-3.64-121.27-79.8-191.5-119.52-220 56.9 23.95 117.89 70.03 160.72 157.48 3.93 8.02 7.36 16.27 10.28 24.71z"}),g("linearGradient",{id:"g",gradientUnits:"userSpaceOnUse",x1:587.6385,y1:846.487,x2:587.6385,y2:348.24},g("stop",{offset:.3101,stopColor:"#770840"}),g("stop",{offset:.8408,stopColor:"#42174b"})),g("path",{fill:"url(#g)",d:"M727.22 663c-.57 2-37.36 130.75-143.66 183.49 0 0 46.27-46.96 74.28-121.84 34.82-49.81 50.71-110.64 49.04-153.45v-.03c-1.62-41.69-13.89-74.09-29.27-98.82-9.6-15.44-20.42-27.88-30.64-37.71-5.04-4.86-9.93-9.07-14.45-12.7-4.69-3.78-9.67-7.13-14.88-10.08-9.78-5.56-20.37-9.65-31.39-12.22-25.83-6-52.41-8.86-68.23-10.17-24.07-1.97-48.33 3.07-69.24 15.18-20.97 12.14-33.22 26.83-33.97 27.72.82-1.79 22.92-48.71 76.45-83.01 17.11-1.7 80.34-5.32 149.61 23.85 39.72 28.5 115.89 98.73 119.52 220 1.86 62.15-29.83 152.81-93.37 211.34 0 0 47.73-76.78 60.2-141.55z"}),g("linearGradient",{id:"h",gradientUnits:"userSpaceOnUse",x1:411.3254,y1:909.6648,x2:704.6713,y2:742.1275},g("stop",{offset:.2654,stopColor:"#ff475e"}),g("stop",{offset:.8631,stopColor:"#d9002f"})),g("path",{fill:"url(#h)",d:"M583.56 846.49C689.86 793.75 726.65 665 727.22 663c-12.47 64.77-60.2 141.55-60.2 141.55s-58.93 66.83-123.68 94.24c-.03.02-.05.02-.05.02s-77.65 18.28-171.9-2.49c0 0 18.28-3.32 35.93-4.57 128.92-8.72 176.24-45.26 176.24-45.26z"}),g("linearGradient",{id:"i",gradientUnits:"userSpaceOnUse",x1:308.7588,y1:853.2294,x2:623.2805,y2:787.8339},g("stop",{offset:.2605,stopColor:"#fe0c3a"}),g("stop",{offset:.7245,stopColor:"#960541"})),g("path",{fill:"url(#i)",d:"M619.69 767.19c14.59-12.52 27.3-26.98 38.15-42.54-28.01 74.88-74.28 121.84-74.28 121.84-111.48 42.55-222.96 28.65-222.96 28.65-.05 0-.11 0-.16-.02-3.38-.38-57.84-6.86-88.9-40.05 35.19 23.98 91.55 27.41 117.08 27.41 132.05 0 219.39-85.28 231.07-95.29z"})),X1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",...i},g("circle",{cx:512,cy:512,r:512,style:{fill:"#5865f2"}}),g("path",{d:"M689.43 349a422.21 422.21 0 0 0-104.22-32.32 1.58 1.58 0 0 0-1.68.79 294.11 294.11 0 0 0-13 26.66 389.78 389.78 0 0 0-117.05 0 269.75 269.75 0 0 0-13.18-26.66 1.64 1.64 0 0 0-1.68-.79A421 421 0 0 0 334.44 349a1.49 1.49 0 0 0-.69.59c-66.37 99.17-84.55 195.9-75.63 291.41a1.76 1.76 0 0 0 .67 1.2 424.58 424.58 0 0 0 127.85 64.63 1.66 1.66 0 0 0 1.8-.59 303.45 303.45 0 0 0 26.15-42.54 1.62 1.62 0 0 0-.89-2.25 279.6 279.6 0 0 1-39.94-19 1.64 1.64 0 0 1-.16-2.72c2.68-2 5.37-4.1 7.93-6.22a1.58 1.58 0 0 1 1.65-.22c83.79 38.26 174.51 38.26 257.31 0a1.58 1.58 0 0 1 1.68.2c2.56 2.11 5.25 4.23 8 6.24a1.64 1.64 0 0 1-.14 2.72 262.37 262.37 0 0 1-40 19 1.63 1.63 0 0 0-.87 2.28 340.72 340.72 0 0 0 26.13 42.52 1.62 1.62 0 0 0 1.8.61 423.17 423.17 0 0 0 128-64.63 1.64 1.64 0 0 0 .67-1.18c10.68-110.44-17.88-206.38-75.7-291.42a1.3 1.3 0 0 0-.63-.63zM427.09 582.85c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.02 28.44-20.37 51.6-46 51.6zm170.13 0c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.01 28.44-20.17 51.6-46 51.6z",style:{fill:"#fff"}})),B1=i=>g("svg",{height:"800px",width:"800px",id:"_x36_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",...i},g("g",null,g("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:256.0002,y1:347.8895,x2:256.0002,y2:-8003553e-17},g("stop",{offset:0,style:{stopColor:"#DA9621"}}),g("stop",{offset:.7685,style:{stopColor:"#EAA12F"}})),g("path",{style:{fill:"url(#SVGID_1_)"},d:"M511.972,170.467v11.507c-0.6,0.427-1.372,0.937-2.143,1.448l-19.117,13.041 c-1.285,0.853-2.828,1.875-4.371,2.984c-7.973,5.283-18.345,12.358-25.203,16.876L293.376,329.769l-5.315,3.58l-15.602,10.569 c-1.972,1.278-4.286,2.301-6.858,2.983c-1.029,0.34-2.229,0.511-3.343,0.681c-0.172,0.085-0.343,0.085-0.428,0.085 c-1.972,0.256-3.943,0.256-5.83,0.171c-1.886,0.085-3.857,0.085-5.829-0.171c-1.285-0.171-2.572-0.427-3.772-0.767 c-2.572-0.681-4.886-1.705-6.858-2.983l-7.029-4.774l-8.572-5.795L50.862,216.324c-1.886-1.279-4.029-2.728-6.429-4.262 c-6-4.006-13.03-8.779-18.774-12.614c-1.543-1.109-3.086-2.131-4.372-2.984L2.171,183.423c-0.771-0.511-1.543-1.022-2.143-1.448 v-11.507c0-1.96,0.257-3.494,0.686-4.943c0-0.084,0.086-0.084,0.086-0.084c0.429-0.341,0.857-0.597,1.371-0.939l6.172-4.262 l12.944-8.779c8.143-5.454,21.431-14.489,29.574-19.859L239.541,4.007c4.544-2.898,10.544-4.262,16.459-3.921 c0.6,0,1.114-0.085,1.715-0.085h0.086c5.315,0,10.63,1.365,14.659,4.007l188.679,127.594c6.772,4.432,17.059,11.421,25.031,16.792 c1.629,1.107,3.172,2.131,4.543,3.067l12.944,8.779l6.172,4.262c0.514,0.341,0.943,0.597,1.371,0.939 C511.715,166.888,511.972,168.507,511.972,170.467z"}),g("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:256.0005,y1:398.9169,x2:256.0005,y2:51.0644},g("stop",{offset:0,style:{stopColor:"#DA9621"}}),g("stop",{offset:.7685,style:{stopColor:"#EAA12F"}})),g("path",{style:{fill:"url(#SVGID_2_)"},d:"M512,221.49v11.441c-0.625,0.443-1.429,0.976-2.141,1.508l-19.179,13.037 c-8.116,5.41-21.407,14.455-29.524,19.866L272.502,394.875c-2.051,1.33-4.371,2.305-6.868,3.015 c-3.032,0.887-6.422,1.153-9.633,0.975c-3.211,0.178-6.601-0.089-9.633-0.975c-2.498-0.71-4.817-1.685-6.868-3.015L50.845,267.341 c-8.117-5.411-21.408-14.456-29.524-19.866L2.142,234.439c-0.712-0.533-1.516-1.065-2.141-1.508V221.49 c0-1.951,0.268-3.548,0.714-4.966c0-0.089,0.089-0.089,0.089-0.089c0.446-0.355,0.892-0.622,1.337-0.977l6.245-4.257l12.934-8.78 c8.116-5.41,21.407-14.455,29.524-19.866L239.499,55.023c4.549-2.927,10.614-4.258,16.501-3.903 c5.887-0.355,12.042,0.975,16.501,3.903l188.655,127.532c8.117,5.411,21.408,14.456,29.524,19.866l12.934,8.78l6.245,4.257 c0.445,0.355,0.891,0.621,1.337,0.977C511.732,217.853,512,219.539,512,221.49z"}),g("path",{style:{fill:"#CC8529"},d:"M262.258,314.513v35.968h-1.029l-11.487,0.767H0.028V173.792c0-1.96,0.257-3.58,0.686-4.944 c0-0.085,0.086-0.085,0.086-0.085c0.943-2.983,2.829-4.688,5.315-5.114l10.716,6.307l5.057,2.983l23.06,13.553l1.2,0.681 l14.659,8.609l166.819,98.359l0.343,0.171l33.089,19.433L262.258,314.513z"}),g("g",null,g("path",{style:{fill:"#F6B75A"},d:"M266.715,336.247c0,0.085-1.714,1.279-4.457,3.239c-1.715,1.108-3.858,2.558-6.258,4.262 c-1.2,0.767-2.486,1.619-3.857,2.557l-1.972,1.363l-3.772,2.557l-1.629,1.023l-26.66,17.984c-2.829,1.875-5.658,3.835-8.229,5.626 c-4.886,3.324-8.916,6.051-10.287,6.903c-1.972,1.449-10.201,6.99-18.345,12.529l-44.577,30.088l-0.172,0.171l-0.085,0.085 L27.031,498.447c-1.886,1.279-3.943,2.642-5.915,4.006c-1.115,0.767-2.229,1.449-3.343,2.216H8.515 c-4.972,0-7.801-1.108-8.401-2.983c0-0.085,0-0.085,0-0.085c0-0.341-0.086-0.597,0-1.023c-0.086-0.512-0.086-1.023-0.086-1.62 V173.792c0-1.96,0.257-3.58,0.686-4.944c0-0.085,0.086-0.085,0.086-0.085c0.943-2.983,2.829-4.688,5.315-5.114 c0.771-0.256,1.457-0.256,2.229-0.171c1.886,0.085,4.029,0.938,6.344,2.472l30.346,20.456l1.114,0.767l13.116,8.864 c0.257,0.171,0.514,0.341,0.771,0.512c8.058,5.455,20.745,14.064,28.632,19.348l153.446,103.729 c0.172,0.085,0.343,0.171,0.429,0.256c0.257,0.171,0.514,0.341,0.771,0.512c2.057,1.363,4.029,2.728,5.829,3.92 c3.001,1.96,5.401,3.665,6.858,4.688c0.857,0.512,1.458,0.852,1.543,0.937c0.343,0.255,2.486,1.705,4.715,3.324 c0.086,0,0.086,0.085,0.171,0.085C264.744,334.968,266.715,336.161,266.715,336.247z"}),g("g",null,g("path",{style:{fill:"#F0A642"},d:"M511.865,171.974c0.074,1,0.134,2.92,0.134,4.267v320.232c0,1.347,0,2.708,0,3.025 c0,0.317-0.089,1.248-0.089,1.419c0,0.171,0,0.311,0,0.666c0,0,0,0.02,0,0.044c0,0.024-0.783,0.723-1.74,1.551 c-0.957,0.829-7.747,1.507-9.094,1.507h-4.378c-1.347,0-3.365-0.612-4.486-1.359l-5.204-3.489 c-1.12-0.748-2.95-1.976-4.066-2.731L332.776,395.641c-1.116-0.754-2.942-1.988-4.058-2.742l-14.324-9.753 c-1.112-0.76-2.935-1.999-4.05-2.754l-14.412-9.754c-1.113-0.758-2.938-1.994-4.055-2.747l-24.216-16.33 c-1.117-0.753-2.944-1.984-4.062-2.736l-1.734-1.167c-1.117-0.752-2.95-1.976-4.072-2.72c0,0-0.635-0.421-1.795-1.219 c-6.155-4.257-10.704-7.362-10.704-7.451c0-0.089,1.963-1.329,4.282-2.926c2.318-1.597,2.885-1.986,2.885-1.986 c1.111-0.762,2.161-1.484,2.332-1.607c0.172-0.122,2.109-1.383,3.214-2.152c0,0,5.125-3.567,10.657-7.204 c0.268-0.178,0.268-0.178,0.268-0.178c0.294-0.195,0.595-0.394,0.668-0.443c0.073-0.049,0.954-0.617,1.74-1.153 c0.785-0.536,2.341-1.592,3.457-2.346l146.508-98.984c1.116-0.754,2.941-1.989,4.056-2.745l25.377-17.123 c1.117-0.753,2.944-1.985,4.06-2.739l40.451-27.324c1.116-0.754,3-1.892,4.187-2.529c0,0,1.065-0.637,2.169-0.881 c1.104-0.244,3.079-0.189,4.389,0.123l3.792,2.662C510.562,167.836,511.791,170.974,511.865,171.974z"}))),g("path",{style:{fill:"#CC8529"},d:"M511.999,458.657v40.265c0,0.62,0,1.153-0.089,1.685c0.089,0.355,0,0.621,0,0.976c0,0,0,0,0,0.089 c-0.625,1.862-3.48,3.014-8.385,3.014H46.383l90.001-80.084l0.089-0.089l112.657-100.216l10.972-9.668l2.942-2.661l9.723,5.677 L511.999,458.657z"}),g("path",{style:{fill:"#F6AF47"},d:"M511.999,497.414v1.508c0,0.62,0,1.153-0.089,1.685c0.089,0.355,0,0.621,0,0.976c0,0,0,0,0,0.089 c-0.625,1.862-3.48,3.014-8.385,3.014H8.474c-4.905,0-7.76-1.152-8.385-3.014c0-0.089,0-0.089,0-0.089c0-0.355-0.089-0.621,0-0.976 C0,500.075,0,499.542,0,498.922v-1.508c0.803-1.064,1.963-2.128,3.479-3.193L241.549,320.57c0.089,0,0.089-0.088,0.179-0.176 c0.268-0.178,0.536-0.355,0.803-0.532c4.905-3.46,9.901-5.855,13.469-6.74c1.249,0.354,2.586,0.797,4.104,1.507 c2.854,1.153,6.154,3.016,9.365,5.233c0.356,0.265,0.624,0.443,0.981,0.708l238.069,173.651 C510.035,495.374,511.195,496.438,511.999,497.414z"}))),Y1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint0_radial_87_7153)"}),g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint1_radial_87_7153)"}),g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint2_radial_87_7153)"}),g("path",{d:"M23 10.5C23 11.3284 22.3284 12 21.5 12C20.6716 12 20 11.3284 20 10.5C20 9.67157 20.6716 9 21.5 9C22.3284 9 23 9.67157 23 10.5Z",fill:"white"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21ZM16 19C17.6569 19 19 17.6569 19 16C19 14.3431 17.6569 13 16 13C14.3431 13 13 14.3431 13 16C13 17.6569 14.3431 19 16 19Z",fill:"white"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 15.6C6 12.2397 6 10.5595 6.65396 9.27606C7.2292 8.14708 8.14708 7.2292 9.27606 6.65396C10.5595 6 12.2397 6 15.6 6H16.4C19.7603 6 21.4405 6 22.7239 6.65396C23.8529 7.2292 24.7708 8.14708 25.346 9.27606C26 10.5595 26 12.2397 26 15.6V16.4C26 19.7603 26 21.4405 25.346 22.7239C24.7708 23.8529 23.8529 24.7708 22.7239 25.346C21.4405 26 19.7603 26 16.4 26H15.6C12.2397 26 10.5595 26 9.27606 25.346C8.14708 24.7708 7.2292 23.8529 6.65396 22.7239C6 21.4405 6 19.7603 6 16.4V15.6ZM15.6 8H16.4C18.1132 8 19.2777 8.00156 20.1779 8.0751C21.0548 8.14674 21.5032 8.27659 21.816 8.43597C22.5686 8.81947 23.1805 9.43139 23.564 10.184C23.7234 10.4968 23.8533 10.9452 23.9249 11.8221C23.9984 12.7223 24 13.8868 24 15.6V16.4C24 18.1132 23.9984 19.2777 23.9249 20.1779C23.8533 21.0548 23.7234 21.5032 23.564 21.816C23.1805 22.5686 22.5686 23.1805 21.816 23.564C21.5032 23.7234 21.0548 23.8533 20.1779 23.9249C19.2777 23.9984 18.1132 24 16.4 24H15.6C13.8868 24 12.7223 23.9984 11.8221 23.9249C10.9452 23.8533 10.4968 23.7234 10.184 23.564C9.43139 23.1805 8.81947 22.5686 8.43597 21.816C8.27659 21.5032 8.14674 21.0548 8.0751 20.1779C8.00156 19.2777 8 18.1132 8 16.4V15.6C8 13.8868 8.00156 12.7223 8.0751 11.8221C8.14674 10.9452 8.27659 10.4968 8.43597 10.184C8.81947 9.43139 9.43139 8.81947 10.184 8.43597C10.4968 8.27659 10.9452 8.14674 11.8221 8.0751C12.7223 8.00156 13.8868 8 15.6 8Z",fill:"white"}),g("defs",null,g("radialGradient",{id:"paint0_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12 23) rotate(-55.3758) scale(25.5196)"},g("stop",{stopColor:"#B13589"}),g("stop",{offset:.79309,stopColor:"#C62F94"}),g("stop",{offset:1,stopColor:"#8A3AC8"})),g("radialGradient",{id:"paint1_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 31) rotate(-65.1363) scale(22.5942)"},g("stop",{stopColor:"#E0E8B7"}),g("stop",{offset:.444662,stopColor:"#FB8A2E"}),g("stop",{offset:.71474,stopColor:"#E2425C"}),g("stop",{offset:1,stopColor:"#E2425C",stopOpacity:0})),g("radialGradient",{id:"paint2_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(0.500002 3) rotate(-8.1301) scale(38.8909 8.31836)"},g("stop",{offset:.156701,stopColor:"#406ADC"}),g("stop",{offset:.467799,stopColor:"#6A45BE"}),g("stop",{offset:1,stopColor:"#6A45BE",stopOpacity:0})))),V1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{fill:"#FFE812",d:"M256 236c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20V20C0 8.954 8.954 0 20 0h216c11.046 0 20 8.954 20 20v216z"}),g("path",{d:"M128 36C70.562 36 24 72.713 24 118c0 29.279 19.466 54.97 48.748 69.477-1.593 5.494-10.237 35.344-10.581 37.689 0 0-.207 1.762.934 2.434s2.483.15 2.483.15c3.272-.457 37.943-24.811 43.944-29.04 5.995.849 12.168 1.29 18.472 1.29 57.438 0 104-36.712 104-82 0-45.287-46.562-82-104-82z"}),g("path",{fill:"#FFE812",d:"M70.5 146.625c-3.309 0-6-2.57-6-5.73V105.25h-9.362c-3.247 0-5.888-2.636-5.888-5.875s2.642-5.875 5.888-5.875h30.724c3.247 0 5.888 2.636 5.888 5.875s-2.642 5.875-5.888 5.875H76.5v35.645c0 3.16-2.691 5.73-6 5.73zM123.112 146.547c-2.502 0-4.416-1.016-4.993-2.65l-2.971-7.778-18.296-.001-2.973 7.783c-.575 1.631-2.488 2.646-4.99 2.646a9.155 9.155 0 0 1-3.814-.828c-1.654-.763-3.244-2.861-1.422-8.52l14.352-37.776c1.011-2.873 4.082-5.833 7.99-5.922 3.919.088 6.99 3.049 8.003 5.928l14.346 37.759c1.826 5.672.236 7.771-1.418 8.532a9.176 9.176 0 0 1-3.814.827c-.001 0 0 0 0 0zm-11.119-21.056L106 108.466l-5.993 17.025h11.986zM138 145.75c-3.171 0-5.75-2.468-5.75-5.5V99.5c0-3.309 2.748-6 6.125-6s6.125 2.691 6.125 6v35.25h12.75c3.171 0 5.75 2.468 5.75 5.5s-2.579 5.5-5.75 5.5H138zM171.334 146.547c-3.309 0-6-2.691-6-6V99.5c0-3.309 2.691-6 6-6s6 2.691 6 6v12.896l16.74-16.74c.861-.861 2.044-1.335 3.328-1.335 1.498 0 3.002.646 4.129 1.772 1.051 1.05 1.678 2.401 1.764 3.804.087 1.415-.384 2.712-1.324 3.653l-13.673 13.671 14.769 19.566a5.951 5.951 0 0 1 1.152 4.445 5.956 5.956 0 0 1-2.328 3.957 5.94 5.94 0 0 1-3.609 1.211 5.953 5.953 0 0 1-4.793-2.385l-14.071-18.644-2.082 2.082v13.091a6.01 6.01 0 0 1-6.002 6.003z"})),K1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{d:"M30 14.4979C30 8.15792 23.7199 3 15.9999 3C8.28094 3 2 8.15792 2 14.4979C2 20.1817 6.98063 24.9417 13.7084 25.8418C14.1644 25.9412 14.7849 26.146 14.9419 26.5404C15.0831 26.8986 15.0342 27.4598 14.987 27.8216C14.987 27.8216 14.8227 28.8214 14.7873 29.0343C14.7264 29.3926 14.5061 30.4353 15.9999 29.7981C17.4942 29.1609 24.0626 24.9935 26.9998 21.572C29.0287 19.3204 30 17.0353 30 14.4979Z",fill:"#2CCF54"}),g("path",{d:"M13.1553 11.4244H12.1733C12.0228 11.4244 11.9004 11.5478 11.9004 11.6995V17.866C11.9004 18.0179 12.0228 18.1411 12.1733 18.1411H13.1553C13.3059 18.1411 13.428 18.0179 13.428 17.866V11.6995C13.428 11.5478 13.3059 11.4244 13.1553 11.4244Z",fill:"white"}),g("path",{d:"M19.9147 11.4244H18.9327C18.7821 11.4244 18.66 11.5478 18.66 11.6995V15.3631L15.8645 11.5467C15.8128 11.4683 15.729 11.4295 15.6375 11.4244H14.6558C14.5052 11.4244 14.3828 11.5478 14.3828 11.6995V17.866C14.3828 18.0179 14.5052 18.1411 14.6558 18.1411H15.6375C15.7883 18.1411 15.9104 18.0179 15.9104 17.866V14.2035L18.7094 18.0247C18.7597 18.0967 18.845 18.1411 18.9327 18.1411H19.9147C20.0655 18.1411 20.1874 18.0179 20.1874 17.866V11.6995C20.1874 11.5478 20.0655 11.4244 19.9147 11.4244Z",fill:"white"}),g("path",{d:"M10.7884 16.5969H8.12013V11.6998C8.12013 11.5476 7.99802 11.4241 7.84773 11.4241H6.86545C6.71489 11.4241 6.59277 11.5476 6.59277 11.6998V17.8652C6.59277 18.0149 6.71435 18.1411 6.86518 18.1411H10.7884C10.9389 18.1411 11.0605 18.0174 11.0605 17.8652V16.8725C11.0605 16.7203 10.9389 16.5969 10.7884 16.5969Z",fill:"white"}),g("path",{d:"M25.3372 12.9683C25.4878 12.9683 25.6094 12.8452 25.6094 12.6927V11.7C25.6094 11.5478 25.4878 11.4241 25.3372 11.4241H21.4143C21.2636 11.4241 21.1416 11.5501 21.1416 11.6998V17.8655C21.1416 18.0147 21.2633 18.1411 21.4137 18.1411H25.3372C25.4878 18.1411 25.6094 18.0174 25.6094 17.8655V16.8725C25.6094 16.7206 25.4878 16.5969 25.3372 16.5969H22.6692V15.5546H25.3372C25.4878 15.5546 25.6094 15.4311 25.6094 15.2789V14.2863C25.6094 14.1341 25.4878 14.0104 25.3372 14.0104H22.6692V12.9683H25.3372Z",fill:"white"})),Z1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...i},g("title",null,"Messenger-color"),g("desc",null,"Created with Sketch."),g("defs",null),g("g",{id:"Icons",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},g("g",{id:"Color-",transform:"translate(-301.000000, -860.000000)",fill:"#007FFF"},g("path",{d:"M325,860 C311.745143,860 301,869.949185 301,882.222222 C301,889.215556 304.489988,895.453481 309.944099,899.526963 L309.944099,908 L318.115876,903.515111 C320.296745,904.118667 322.607155,904.444444 325,904.444444 C338.254857,904.444444 349,894.495259 349,882.222222 C349,869.949185 338.254857,860 325,860 L325,860 Z M327.385093,889.925926 L321.273292,883.407407 L309.347826,889.925926 L322.465839,876 L328.726708,882.518519 L340.503106,876 L327.385093,889.925926 L327.385093,889.925926 Z",id:"Messenger"})))),j1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("circle",{cx:16,cy:16,r:14,fill:"url(#paint0_linear_87_7225)"}),g("path",{d:"M22.9866 10.2088C23.1112 9.40332 22.3454 8.76755 21.6292 9.082L7.36482 15.3448C6.85123 15.5703 6.8888 16.3483 7.42147 16.5179L10.3631 17.4547C10.9246 17.6335 11.5325 17.541 12.0228 17.2023L18.655 12.6203C18.855 12.4821 19.073 12.7665 18.9021 12.9426L14.1281 17.8646C13.665 18.3421 13.7569 19.1512 14.314 19.5005L19.659 22.8523C20.2585 23.2282 21.0297 22.8506 21.1418 22.1261L22.9866 10.2088Z",fill:"white"}),g("defs",null,g("linearGradient",{id:"paint0_linear_87_7225",x1:16,y1:2,x2:16,y2:30,gradientUnits:"userSpaceOnUse"},g("stop",{stopColor:"#37BBFE"}),g("stop",{offset:1,stopColor:"#007DBB"})))),H1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 300 300",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{fill:"#2DC100",d:"M300 255c0 24.854-20.147 45-45 45H45c-24.854 0-45-20.146-45-45V45C0 20.147 20.147 0 45 0h210c24.853 0 45 20.147 45 45v210z"}),g("g",{fill:"#FFF"},g("path",{d:"M200.803 111.88c-24.213 1.265-45.268 8.605-62.362 25.188-17.271 16.754-25.155 37.284-23 62.734-9.464-1.172-18.084-2.462-26.753-3.192-2.994-.252-6.547.106-9.083 1.537-8.418 4.75-16.488 10.113-26.053 16.092 1.755-7.938 2.891-14.889 4.902-21.575 1.479-4.914.794-7.649-3.733-10.849-29.066-20.521-41.318-51.232-32.149-82.85 8.483-29.25 29.315-46.989 57.621-56.236 38.635-12.62 82.054.253 105.547 30.927 8.485 11.08 13.688 23.516 15.063 38.224zm-111.437-9.852c.223-5.783-4.788-10.993-10.74-11.167-6.094-.179-11.106 4.478-11.284 10.483-.18 6.086 4.475 10.963 10.613 11.119 6.085.154 11.186-4.509 11.411-10.435zm58.141-11.171c-5.974.11-11.022 5.198-10.916 11.004.109 6.018 5.061 10.726 11.204 10.652 6.159-.074 10.83-4.832 10.772-10.977-.051-6.032-4.981-10.79-11.06-10.679z"}),g("path",{d:"M255.201 262.83c-7.667-3.414-14.7-8.536-22.188-9.318-7.459-.779-15.3 3.524-23.104 4.322-23.771 2.432-45.067-4.193-62.627-20.432-33.397-30.89-28.625-78.254 10.014-103.568 34.341-22.498 84.704-14.998 108.916 16.219 21.129 27.24 18.646 63.4-7.148 86.284-7.464 6.623-10.15 12.073-5.361 20.804.884 1.612.985 3.653 1.498 5.689zm-87.274-84.499c4.881.005 8.9-3.815 9.085-8.636.195-5.104-3.91-9.385-9.021-9.406-5.06-.023-9.299 4.318-9.123 9.346.166 4.804 4.213 8.69 9.059 8.696zm56.261-18.022c-4.736-.033-8.76 3.844-8.953 8.629-.205 5.117 3.772 9.319 8.836 9.332 4.898.016 8.768-3.688 8.946-8.562.19-5.129-3.789-9.364-8.829-9.399z"}))),$1=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"WhatsApp",role:"img",viewBox:"0 0 512 512",...i},g("rect",{width:512,height:512,rx:"15%",fill:"#25d366"}),g("path",{fill:"#25d366",stroke:"#ffffff",strokeWidth:26,d:"M123 393l14-65a138 138 0 1150 47z"}),g("path",{fill:"#ffffff",d:"M308 273c-3-2-6-3-9 1l-12 16c-3 2-5 3-9 1-15-8-36-17-54-47-1-4 1-6 3-8l9-14c2-2 1-4 0-6l-12-29c-3-8-6-7-9-7h-8c-2 0-6 1-10 5-22 22-13 53 3 73 3 4 23 40 66 59 32 14 39 12 48 10 11-1 22-10 27-19 1-3 6-16 2-18"})),q1=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",...i},g("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,transform:"translate(112 112)"},g("path",{fill:"#000",d:"M711.111 800H88.89C39.8 800 0 760.2 0 711.111V88.89C0 39.8 39.8 0 88.889 0H711.11C760.2 0 800 39.8 800 88.889V711.11C800 760.2 760.2 800 711.111 800"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M628 623H484.942L174 179h143.058zm-126.012-37.651h56.96L300.013 216.65h-56.96z"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M219.296885 623 379 437.732409 358.114212 410 174 623z"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M409 348.387347 429.212986 377 603 177 558.330417 177z"}))),J1=i=>g("svg",{id:"Layer_1","data-name":"Layer 1",viewBox:"0 0 960 960","sodipodi:docname":"zalo.svg","inkscape:version":"1.4.2 (f4327f4, 2025-05-13)","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...i},g("sodipodi:namedview",{id:"namedview2",pagecolor:"#ffffff",bordercolor:"#000000",borderopacity:.25,"inkscape:showpageshadow":2,"inkscape:pageopacity":0,"inkscape:pagecheckerboard":0,"inkscape:deskcolor":"#d1d1d1","inkscape:zoom":1.2239583,"inkscape:cx":480,"inkscape:cy":480,"inkscape:window-width":2560,"inkscape:window-height":1377,"inkscape:window-x":-8,"inkscape:window-y":1138,"inkscape:window-maximized":1,"inkscape:current-layer":"Layer_1"}),g("defs",{id:"defs1"},g("style",{id:"style1"},`
|
|
5
|
+
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,e?.key)}return(h=e?.onChange)==null||h.call(e,s),s}return r.updateDeps=o=>{n=o},r}function ta(i,t){if(i===void 0)throw new Error("Unexpected undefined");return i}const uc=(i,t)=>Math.abs(i-t)<1.01,dc=(i,t,e)=>{let n;return function(...s){i.clearTimeout(n),n=i.setTimeout(()=>t.apply(this,s),e)}},ea=i=>{const{offsetWidth:t,offsetHeight:e}=i;return{width:t,height:e}},fc=i=>i,gc=i=>{const t=Math.max(i.startIndex-i.overscan,0),e=Math.min(i.endIndex+i.overscan,i.count-1),n=[];for(let s=t;s<=e;s++)n.push(s);return n},_c=(i,t)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;const s=o=>{const{width:a,height:l}=o;t({width:Math.round(a),height:Math.round(l)})};if(s(ea(e)),!n.ResizeObserver)return()=>{};const r=new n.ResizeObserver(o=>{const a=()=>{const l=o[0];if(l?.borderBoxSize){const h=l.borderBoxSize[0];if(h){s({width:h.inlineSize,height:h.blockSize});return}}s(ea(e))};i.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()});return r.observe(e,{box:"border-box"}),()=>{r.unobserve(e)}},na={passive:!0},ia=typeof window>"u"?!0:"onscrollend"in window,mc=(i,t)=>{const e=i.scrollElement;if(!e)return;const n=i.targetWindow;if(!n)return;let s=0;const r=i.options.useScrollendEvent&&ia?()=>{}:dc(n,()=>{t(s,!1)},i.options.isScrollingResetDelay),o=c=>()=>{const{horizontal:u,isRtl:d}=i.options;s=u?e.scrollLeft*(d&&-1||1):e.scrollTop,r(),t(s,c)},a=o(!0),l=o(!1);l(),e.addEventListener("scroll",a,na);const h=i.options.useScrollendEvent&&ia;return h&&e.addEventListener("scrollend",l,na),()=>{e.removeEventListener("scroll",a),h&&e.removeEventListener("scrollend",l)}},pc=(i,t,e)=>{if(t?.borderBoxSize){const n=t.borderBoxSize[0];if(n)return Math.round(n[e.options.horizontal?"inlineSize":"blockSize"])}return i[e.options.horizontal?"offsetWidth":"offsetHeight"]},yc=(i,{adjustments:t=0,behavior:e},n)=>{var s,r;const o=i+t;(r=(s=n.scrollElement)==null?void 0:s.scrollTo)==null||r.call(s,{[n.options.horizontal?"left":"top"]:o,behavior:e})};class xc{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const n=()=>e||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:e=new this.targetWindow.ResizeObserver(s=>{s.forEach(r=>{const o=()=>{this._measureElement(r.target,r)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(o):o()})}));return{disconnect:()=>{var s;(s=n())==null||s.disconnect(),e=null},observe:s=>{var r;return(r=n())==null?void 0:r.observe(s,{box:"border-box"})},unobserve:s=>{var r;return(r=n())==null?void 0:r.unobserve(s)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([n,s])=>{typeof s>"u"&&delete e[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:fc,rangeExtractor:gc,onChange:()=>{},measureElement:pc,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var n,s;(s=(n=this.options).onChange)==null||s.call(n,this,e)},this.maybeNotify=hn(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.maybeNotify();return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((e=this.scrollElement)==null?void 0:e.window)??null,this.elementsCache.forEach(s=>{this.observer.observe(s)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,s=>{this.scrollRect=s,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(s,r)=>{this.scrollAdjustments=0,this.scrollDirection=r?this.getScrollOffset()<s?"forward":"backward":null,this.scrollOffset=s,this.isScrolling=r,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,n)=>{const s=new Map,r=new Map;for(let o=n-1;o>=0;o--){const a=e[o];if(s.has(a.lane))continue;const l=r.get(a.lane);if(l==null||a.end>l.end?r.set(a.lane,a):a.end<l.end&&s.set(a.lane,!0),s.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((o,a)=>o.end===a.end?o.index-a.index:o.end-a.end)[0]:void 0},this.getMeasurementOptions=hn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,n,s,r,o)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:o}),{key:!1}),this.getMeasurements=hn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:n,scrollMargin:s,getItemKey:r,enabled:o},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(c=>{this.itemSizeCache.set(c.key,c.size)}));const l=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const h=this.measurementsCache.slice(0,l);for(let c=l;c<e;c++){const u=r(c),d=this.options.lanes===1?h[c-1]:this.getFurthestMeasurement(h,c),f=d?d.end+this.options.gap:n+s,_=a.get(u),p=typeof _=="number"?_:this.options.estimateSize(c),m=f+p,y=d?d.lane:c%this.options.lanes;h[c]={index:c,start:f,size:p,end:m,key:u,lane:y}}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=hn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,n,s,r)=>this.range=e.length>0&&n>0?wc({measurements:e,outerSize:n,scrollOffset:s,lanes:r}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=hn(()=>{let e=null,n=null;const s=this.calculateRange();return s&&(e=s.startIndex,n=s.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,n]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,n]},(e,n,s,r,o)=>r===null||o===null?[]:e({startIndex:r,endIndex:o,overscan:n,count:s}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const n=this.options.indexAttribute,s=e.getAttribute(n);return s?parseInt(s,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(e,n)=>{const s=this.indexFromElement(e),r=this.measurementsCache[s];if(!r)return;const o=r.key,a=this.elementsCache.get(o);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(s,this.options.measureElement(e,n,this))},this.resizeItem=(e,n)=>{const s=this.measurementsCache[e];if(!s)return;const r=this.itemSizeCache.get(s.key)??s.size,o=n-r;o!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(s,o,this):s.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=o,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(s.index),this.itemSizeCache=new Map(this.itemSizeCache.set(s.key,n)),this.notify(!1))},this.measureElement=e=>{if(!e){this.elementsCache.forEach((n,s)=>{n.isConnected||(this.observer.unobserve(n),this.elementsCache.delete(s))});return}this._measureElement(e,void 0)},this.getVirtualItems=hn(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,n)=>{const s=[];for(let r=0,o=e.length;r<o;r++){const a=e[r],l=n[a];s.push(l)}return s},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const n=this.getMeasurements();if(n.length!==0)return ta(n[sa(0,n.length-1,s=>ta(n[s]).start,e)])},this.getOffsetForAlignment=(e,n,s=0)=>{const r=this.getSize(),o=this.getScrollOffset();n==="auto"&&(n=e>=o+r?"end":"start"),n==="center"?e+=(s-r)/2:n==="end"&&(e-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,n="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const s=this.measurementsCache[e];if(!s)return;const r=this.getSize(),o=this.getScrollOffset();if(n==="auto")if(s.end>=o+r-this.options.scrollPaddingEnd)n="end";else if(s.start<=o+this.options.scrollPaddingStart)n="start";else return[o,n];const a=n==="end"?s.end+this.options.scrollPaddingEnd:s.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,n,s.size),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:n="start",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,n),{adjustments:void 0,behavior:s})},this.scrollToIndex=(e,{align:n="auto",behavior:s}={})=>{s==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1));let r=0;const o=10,a=h=>{if(!this.targetWindow)return;const c=this.getOffsetForIndex(e,h);if(!c){console.warn("Failed to get offset for index:",e);return}const[u,d]=c;this._scrollToOffset(u,{adjustments:void 0,behavior:s}),this.targetWindow.requestAnimationFrame(()=>{const f=this.getScrollOffset(),_=this.getOffsetForIndex(e,d);if(!_){console.warn("Failed to get offset for index:",e);return}uc(_[0],f)||l(d)})},l=h=>{this.targetWindow&&(r++,r<o?this.targetWindow.requestAnimationFrame(()=>a(h)):console.warn(`Failed to scroll to index ${e} after ${o} attempts.`))};a(n)},this.scrollBy=(e,{behavior:n}={})=>{n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var e;const n=this.getMeasurements();let s;if(n.length===0)s=this.options.paddingStart;else if(this.options.lanes===1)s=((e=n[n.length-1])==null?void 0:e.end)??0;else{const r=Array(this.options.lanes).fill(null);let o=n.length-1;for(;o>=0&&r.some(a=>a===null);){const a=n[o];r[a.lane]===null&&(r[a.lane]=a.end),o--}s=Math.max(...r.filter(a=>a!==null))}return Math.max(s-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:n,behavior:s})=>{this.options.scrollToFn(e,{behavior:s,adjustments:n},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(t)}}const sa=(i,t,e,n)=>{for(;i<=t;){const s=(i+t)/2|0,r=e(s);if(r<n)i=s+1;else if(r>n)t=s-1;else return s}return i>0?i-1:0};function wc({measurements:i,outerSize:t,scrollOffset:e,lanes:n}){const s=i.length-1,r=l=>i[l].start;if(i.length<=n)return{startIndex:0,endIndex:s};let o=sa(0,s,r,e),a=o;if(n===1)for(;a<s&&i[a].end<e+t;)a++;else if(n>1){const l=Array(n).fill(0);for(;a<s&&l.some(c=>c<e+t);){const c=i[a];l[c.lane]=c.end,a++}const h=Array(n).fill(e+t);for(;o>=0&&h.some(c=>c>=e);){const c=i[o];h[c.lane]=c.start,o--}o=Math.max(0,o-o%n),a=Math.min(s,a+(n-1-a%n))}return{startIndex:o,endIndex:a}}const Ec=typeof window<"u"?sc:be;function Cc(i){const t=Ho(()=>({}),{})[1],e={...i,onChange:s=>{t(),i.onChange?.(s)}},[n]=Tt(()=>new xc(e));return n.setOptions(e),be(()=>n._didMount(),[]),Ec(()=>n._willUpdate()),n}function vc(i){return Cc({observeElementRect:_c,observeElementOffset:mc,scrollToFn:yc,...i})}function bc({content:i,timestamp:t,isFromCustomer:e}){return w("div",{class:`message-wrapper ${e?"message-wrapper-end":"message-wrapper-start"}`,children:w("div",{class:`message-bubble message-text-content ${e?"message-bubble-customer":"message-bubble-support"}`,children:[w("p",{class:"message-text",children:i}),w("span",{class:`message-timestamp ${e?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(t).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})}function Sc({url:i,filename:t,size:e,caption:n,timestamp:s,isFromCustomer:r}){const o=()=>{const a=document.createElement("a");a.href=i,a.download=t||"image.jpg",a.click()};return w("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:w("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,style:"overflow: hidden;",children:w("div",{class:"message-media-content",children:[w("img",{src:i,alt:t||"Photo",class:"message-image"}),n&&w("p",{class:`message-caption ${r?"":"message-bubble-support"}`,style:r?"color: white;":"color: #18181b;",children:n}),w("div",{class:"message-meta",children:[w("div",{class:"message-file-info",children:[t&&w("span",{class:`message-filename ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:t}),e&&w("span",{class:`message-filesize ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:[(e/1024).toFixed(1)," KB"]})]}),w("button",{type:"button",onClick:o,class:`message-download-button ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"Download"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),w("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function Rc({url:i,filename:t,size:e,caption:n,timestamp:s,isFromCustomer:r}){const[o,a]=Tt(!0);return w("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:w("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,style:"overflow: hidden;",children:w("div",{class:"message-media-content",children:[w("div",{class:"message-video-container",children:[o&&w("div",{class:"message-video-loading",children:w("svg",{class:"icon-lg icon-spinner",fill:"none",viewBox:"0 0 24 24",children:[w("title",{children:"Loading"}),w("circle",{style:"opacity: 0.25;",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),w("path",{style:"opacity: 0.75;",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}),w("video",{controls:!0,class:"message-video",preload:"metadata",style:{opacity:o?0:1},onLoadedData:()=>a(!1),children:[w("source",{src:i,type:"video/mp4"}),w("track",{kind:"captions"})]})]}),n&&w("p",{class:`message-caption ${r?"":"message-bubble-support"}`,style:r?"color: white;":"color: #18181b;",children:n}),w("div",{class:"message-meta",children:[t&&w("span",{class:`message-filename ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:t}),w("button",{type:"button",onClick:()=>{const h=document.createElement("a");h.href=i,h.download=t||"video.mp4",h.click()},class:`message-download-button ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"Download"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),w("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function Tc({url:i,filename:t,size:e,mimeType:n,timestamp:s,isFromCustomer:r}){const o=()=>{const l=document.createElement("a");l.href=i,l.download=t,l.click()};return w("div",{class:`message-wrapper ${r?"message-wrapper-end":"message-wrapper-start"}`,children:w("div",{class:`message-bubble ${r?"message-bubble-customer":"message-bubble-support"}`,children:w("div",{class:"message-file-container",children:[w("div",{class:"message-file-row",children:[w("div",{class:"message-file-icon",children:n?.startsWith("application/pdf")?w("svg",{class:"icon-lg icon-pdf",fill:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"PDF"}),w("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8l-6-6z"}),w("path",{d:"M14 2v6h6"}),w("path",{d:"M9 13h6"}),w("path",{d:"M9 17h6"})]}):w("svg",{class:"icon-lg icon-file",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"File"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})]})}),w("div",{class:"message-file-details",children:[w("p",{class:"message-file-name ",style:r?"color: white;":"color: #18181b;",children:t}),e&&w("p",{class:`message-file-size ${r?"message-timestamp-customer":"message-timestamp-support"}`,children:[(e/1024).toFixed(1)," KB"]})]}),w("button",{type:"button",onClick:o,class:`message-file-download ${r?"message-download-button-customer":"message-download-button-support"}`,title:"Download",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"Download"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"})]})})]}),w("span",{class:`message-timestamp ${r?"message-timestamp-customer":"message-timestamp-support"}`,style:"margin-top: 0.5rem;",children:new Date(s).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}const Ot={ADD:"add",REMOVE:"remove"},cn={PROPERTYCHANGE:"propertychange"},Y={CHANGE:"change",ERROR:"error",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",TOUCHMOVE:"touchmove",WHEEL:"wheel"};class Fi{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function Ic(i,t,e){let n,s;e=e||ue;let r=0,o=i.length,a=!1;for(;r<o;)n=r+(o-r>>1),s=+e(i[n],t),s<0?r=n+1:(o=n,a=!s);return a?r:~r}function ue(i,t){return i>t?1:i<t?-1:0}function Mc(i,t){return i<t?1:i>t?-1:0}function Ys(i,t,e){if(i[0]<=t)return 0;const n=i.length;if(t<=i[n-1])return n-1;if(typeof e=="function"){for(let s=1;s<n;++s){const r=i[s];if(r===t)return s;if(r<t)return e(t,i[s-1],r)>0?s-1:s}return n-1}if(e>0){for(let s=1;s<n;++s)if(i[s]<t)return s-1;return n-1}if(e<0){for(let s=1;s<n;++s)if(i[s]<=t)return s;return n-1}for(let s=1;s<n;++s){if(i[s]==t)return s;if(i[s]<t)return i[s-1]-t<t-i[s]?s-1:s}return n-1}function Lc(i,t,e){for(;t<e;){const n=i[t];i[t]=i[e],i[e]=n,++t,--e}}function Vs(i,t){const e=Array.isArray(t)?t:[t],n=e.length;for(let s=0;s<n;s++)i[i.length]=e[s]}function Re(i,t){const e=i.length;if(e!==t.length)return!1;for(let n=0;n<e;n++)if(i[n]!==t[n])return!1;return!0}function Ac(i,t,e){const n=t||ue;return i.every(function(s,r){if(r===0)return!0;const o=n(i[r-1],s);return!(o>0||o===0)})}function Vn(){return!0}function zi(){return!1}function Kn(){}function ra(i){let t,e,n;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==n||!Re(s,e))&&(n=this,e=s,t=i.apply(this,arguments)),t}}function kc(i){function t(){let e;try{e=i()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function Zn(i){for(const t in i)delete i[t]}function un(i){let t;for(t in i)return!1;return!t}class de{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ni extends Fi{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),s=n[t]||(n[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",n=e?t:t.type,s=this.listeners_&&this.listeners_[n];if(!s)return;const r=e?new de(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];let l;for(let h=0,c=s.length;h<c;++h)if("handleEvent"in s[h]?l=s[h].handleEvent(r):l=s[h].call(this,r),l===!1||r.propagationStopped){l=!1;break}if(--o[n]===0){let h=a[n];for(delete a[n];h--;)this.removeEventListener(n,Kn);delete o[n]}return l}disposeInternal(){this.listeners_&&Zn(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return this.listeners_?t?t in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const s=n.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[s]=Kn,++this.pendingRemovals_[t]):(n.splice(s,1),n.length===0&&delete this.listeners_[t]))}}function q(i,t,e,n,s){if(s){const o=e;e=function(a){return i.removeEventListener(t,e),o.call(n??this,a)}}else n&&n!==i&&(e=e.bind(n));const r={target:i,type:t,listener:e};return i.addEventListener(t,e),r}function Gi(i,t,e,n){return q(i,t,e,n,!0)}function at(i){i&&i.target&&(i.target.removeEventListener(i.type,i.listener),Zn(i))}class jn extends Ni{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(Y.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=q(this,t[r],e);return s}return q(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const s=t.length;n=new Array(s);for(let r=0;r<s;++r)n[r]=Gi(this,t[r],e)}else n=Gi(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)Oc(n);else if(Array.isArray(t))for(let s=0,r=t.length;s<r;++s)this.removeEventListener(t[s],e);else this.removeEventListener(t,e)}}jn.prototype.on,jn.prototype.once,jn.prototype.un;function Oc(i){if(Array.isArray(i))for(let t=0,e=i.length;t<e;++t)at(i[t]);else at(i)}function J(){throw new Error("Unimplemented abstract method.")}let Pc=0;function Q(i){return i.ol_uid||(i.ol_uid=String(++Pc))}class oa extends de{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class ne extends jn{constructor(t){super(),this.on,this.once,this.un,Q(this),this.values_=null,t!==void 0&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}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(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new oa(n,t,e)),n=cn.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new oa(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const s=this.values_||(this.values_={});if(n)s[t]=e;else{const r=s[t];s[t]=e,r!==e&&this.notify(t,r)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],un(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}const aa={LENGTH:"length"};class Wi extends de{constructor(t,e,n){super(t),this.element=e,this.index=n}}class ie extends ne{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let n=0,s=this.array_.length;n<s;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(aa.LENGTH)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new Wi(Ot.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,s=e.length;n<s;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new Wi(Ot.REMOVE,e,t)),e}setAt(t,e){const n=this.getLength();if(t>=n){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new Wi(Ot.REMOVE,s,t)),this.dispatchEvent(new Wi(Ot.ADD,e,t))}updateLength_(){this.set(aa.LENGTH,this.array_.length)}assertUnique_(t,e){for(let n=0,s=this.array_.length;n<s;++n)if(this.array_[n]===t&&n!==e)throw new Error("Duplicate item added to a unique collection")}}class dn extends de{constructor(t,e,n){super(t),this.map=e,this.frameState=n!==void 0?n:null}}class Te extends dn{constructor(t,e,n,s,r,o){super(t,e,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=s!==void 0?s:!1,this.activePointers=o}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const ct={SINGLECLICK:"singleclick",CLICK:Y.CLICK,DBLCLICK:Y.DBLCLICK,POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},Ve=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"";Ve.includes("safari")&&!Ve.includes("chrom")&&(Ve.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Ve));const Dc=Ve.includes("webkit")&&!Ve.includes("edge"),la=Ve.includes("macintosh"),Fc=typeof devicePixelRatio<"u"?devicePixelRatio:1,Ks=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,ha=typeof Image<"u"&&Image.prototype.decode,ca=(function(){let i=!1;try{const t=Object.defineProperty({},"passive",{get:function(){i=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return i})(),Zs={POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown"};class zc extends Ni{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=e===void 0?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=q(n,Zs.POINTERDOWN,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=q(n,Zs.POINTERMOVE,this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(Y.TOUCHMOVE,this.boundHandleTouchMove_,ca?{passive:!1}:!1)}emulateClick_(t){let e=new Te(ct.CLICK,this.map_,t);this.dispatchEvent(e),this.clickTimeoutId_!==void 0?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Te(ct.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const n=new Te(ct.SINGLECLICK,this.map_,t);this.dispatchEvent(n)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==ct.POINTERUP||e.type==ct.POINTERCANCEL){delete this.trackedTouches_[n];for(const s in this.trackedTouches_)if(this.trackedTouches_[s].target!==e.target){delete this.trackedTouches_[s];break}}else(e.type==ct.POINTERDOWN||e.type==ct.POINTERMOVE)&&(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Te(ct.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),this.activePointers_.length===0&&(this.dragListenerKeys_.forEach(at),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return t.button===0}handlePointerDown_(t){this.emulateClicks_=this.activePointers_.length===0,this.updateActivePointers_(t);const e=new Te(ct.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),this.dragListenerKeys_.length===0){const n=this.map_.getOwnerDocument();this.dragListenerKeys_.push(q(n,ct.POINTERMOVE,this.handlePointerMove_,this),q(n,ct.POINTERUP,this.handlePointerUp_,this),q(this.element_,ct.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==n&&this.dragListenerKeys_.push(q(this.element_.getRootNode(),ct.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Te(ct.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new Te(ct.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&(typeof t.cancelable!="boolean"||t.cancelable===!0)&&t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(at(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(Y.TOUCHMOVE,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(at(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(at),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Ie={POSTRENDER:"postrender",MOVESTART:"movestart",MOVEEND:"moveend",LOADSTART:"loadstart",LOADEND:"loadend"},bt={LAYERGROUP:"layergroup",SIZE:"size",TARGET:"target",VIEW:"view"},G={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function et(i,t){if(!i)throw new Error(t)}const Ui=1/0;class Nc{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Zn(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];t.length==1?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const s=this.keyFunction_(n);return delete this.queuedElements_[s],n}enqueue(t){et(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=Ui?(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0):!1}getCount(){return this.elements_.length}getLeftChildIndex_(t){return t*2+1}getRightChildIndex_(t){return t*2+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return this.elements_.length===0}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,s=e.length,r=e[t],o=n[t],a=t;for(;t<s>>1;){const l=this.getLeftChildIndex_(t),h=this.getRightChildIndex_(t),c=h<s&&n[h]<n[l]?h:l;e[t]=e[c],n[t]=n[c],t=c}e[t]=r,n[t]=o,this.siftDown_(a,t)}siftDown_(t,e){const n=this.elements_,s=this.priorities_,r=n[e],o=s[e];for(;e>t;){const a=this.getParentIndex_(e);if(s[a]>o)n[e]=n[a],s[e]=s[a],e=a;else break}n[e]=r,s[e]=o}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let s=0;const r=e.length;let o,a,l;for(a=0;a<r;++a)o=e[a],l=t(o),l==Ui?delete this.queuedElements_[this.keyFunction_(o)]:(n[s]=l,e[s++]=o);e.length=s,n.length=s,this.heapify_()}}class Gc extends Nc{constructor(t,e){super(n=>t.apply(null,n),n=>n[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(Y.CHANGE,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(n===G.LOADED||n===G.ERROR||n===G.EMPTY){n!==G.ERROR&&e.removeEventListener(Y.CHANGE,this.boundHandleTileChange_);const s=e.getKey();s in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[s],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;){const s=this.dequeue()[0],r=s.getKey();s.getState()===G.IDLE&&!(r in this.tilesLoadingKeys_)&&(this.tilesLoadingKeys_[r]=!0,++this.tilesLoading_,++n,s.load())}}}function Wc(i,t,e,n,s){if(!i||!(e in i.wantedTiles)||!i.wantedTiles[e][t.getKey()])return Ui;const r=i.viewState.center,o=n[0]-r[0],a=n[1]-r[1];return 65536*Math.log(s)+Math.sqrt(o*o+a*a)/s}const St={ANIMATING:0,INTERACTING:1},qt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function lt(i,t,e){return Math.min(Math.max(i,t),e)}function Uc(i,t,e,n,s,r){const o=s-e,a=r-n;if(o!==0||a!==0){const l=((i-e)*o+(t-n)*a)/(o*o+a*a);l>1?(e=s,n=r):l>0&&(e+=o*l,n+=a*l)}return fn(i,t,e,n)}function fn(i,t,e,n){const s=e-i,r=n-t;return s*s+r*r}function Xc(i){const t=i.length;for(let n=0;n<t;n++){let s=n,r=Math.abs(i[n][n]);for(let a=n+1;a<t;a++){const l=Math.abs(i[a][n]);l>r&&(r=l,s=a)}if(r===0)return null;const o=i[s];i[s]=i[n],i[n]=o;for(let a=n+1;a<t;a++){const l=-i[a][n]/i[n][n];for(let h=n;h<t+1;h++)n==h?i[a][h]=0:i[a][h]+=l*i[n][h]}}const e=new Array(t);for(let n=t-1;n>=0;n--){e[n]=i[n][t]/i[n][n];for(let s=n-1;s>=0;s--)i[s][t]-=i[s][n]*e[n]}return e}function ua(i){return i*180/Math.PI}function Me(i){return i*Math.PI/180}function gn(i,t){const e=i%t;return e*t<0?e+t:e}function Ut(i,t,e){return i+e*(t-i)}function Xi(i,t){const e=Math.pow(10,t);return Math.round(i*e)/e}function Bi(i,t){return Math.floor(Xi(i,t))}function Yi(i,t){return Math.ceil(Xi(i,t))}function js(i,t,e){if(i>=t&&i<e)return i;const n=e-t;return((i-t)%n+n)%n+t}function da(i,t,e){return(function(n,s,r,o,a){if(!n)return;if(!s&&!t)return n;const l=t?0:r[0]*s,h=t?0:r[1]*s,c=a?a[0]:0,u=a?a[1]:0;let d=i[0]+l/2+c,f=i[2]-l/2+c,_=i[1]+h/2+u,p=i[3]-h/2+u;d>f&&(d=(f+d)/2,f=d),_>p&&(_=(p+_)/2,p=_);let m=lt(n[0],d,f),y=lt(n[1],_,p);if(o&&e&&s){const x=30*s;m+=-x*Math.log(1+Math.max(0,d-n[0])/x)+x*Math.log(1+Math.max(0,n[0]-f)/x),y+=-x*Math.log(1+Math.max(0,_-n[1])/x)+x*Math.log(1+Math.max(0,n[1]-p)/x)}return[m,y]})}function Bc(i){return i}const pt={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function fa(i){const t=Xt();for(let e=0,n=i.length;e<n;++e)qn(t,i[e]);return t}function Hs(i,t,e){return e?(e[0]=i[0]-t,e[1]=i[1]-t,e[2]=i[2]+t,e[3]=i[3]+t,e):[i[0]-t,i[1]-t,i[2]+t,i[3]+t]}function ga(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i.slice()}function _a(i,t,e){let n,s;return t<i[0]?n=i[0]-t:i[2]<t?n=t-i[2]:n=0,e<i[1]?s=i[1]-e:i[3]<e?s=e-i[3]:s=0,n*n+s*s}function _n(i,t){return ma(i,t[0],t[1])}function Hn(i,t){return i[0]<=t[0]&&t[2]<=i[2]&&i[1]<=t[1]&&t[3]<=i[3]}function ma(i,t,e){return i[0]<=t&&t<=i[2]&&i[1]<=e&&e<=i[3]}function $s(i,t){const e=i[0],n=i[1],s=i[2],r=i[3],o=t[0],a=t[1];let l=pt.UNKNOWN;return o<e?l=l|pt.LEFT:o>s&&(l=l|pt.RIGHT),a<n?l=l|pt.BELOW:a>r&&(l=l|pt.ABOVE),l===pt.UNKNOWN&&(l=pt.INTERSECTING),l}function Xt(){return[1/0,1/0,-1/0,-1/0]}function Le(i,t,e,n,s){return s?(s[0]=i,s[1]=t,s[2]=e,s[3]=n,s):[i,t,e,n]}function Vi(i){return Le(1/0,1/0,-1/0,-1/0,i)}function pa(i,t){const e=i[0],n=i[1];return Le(e,n,e,n,t)}function qs(i,t,e,n,s){const r=Vi(s);return ya(r,i,t,e,n)}function $n(i,t){return i[0]==t[0]&&i[2]==t[2]&&i[1]==t[1]&&i[3]==t[3]}function Yc(i,t){return t[0]<i[0]&&(i[0]=t[0]),t[2]>i[2]&&(i[2]=t[2]),t[1]<i[1]&&(i[1]=t[1]),t[3]>i[3]&&(i[3]=t[3]),i}function qn(i,t){t[0]<i[0]&&(i[0]=t[0]),t[0]>i[2]&&(i[2]=t[0]),t[1]<i[1]&&(i[1]=t[1]),t[1]>i[3]&&(i[3]=t[1])}function ya(i,t,e,n,s){for(;e<n;e+=s)Vc(i,t[e],t[e+1]);return i}function Vc(i,t,e){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}function xa(i,t){let e;return e=t(Ki(i)),e||(e=t(Zi(i)),e)||(e=t(ji(i)),e)||(e=t(je(i)),e)?e:!1}function Js(i){let t=0;return Hi(i)||(t=it(i)*It(i)),t}function Ki(i){return[i[0],i[1]]}function Zi(i){return[i[2],i[1]]}function Ke(i){return[(i[0]+i[2])/2,(i[1]+i[3])/2]}function Kc(i,t){let e;if(t==="bottom-left")e=Ki(i);else if(t==="bottom-right")e=Zi(i);else if(t==="top-left")e=je(i);else if(t==="top-right")e=ji(i);else throw new Error("Invalid corner");return e}function Qs(i,t,e,n,s){const[r,o,a,l,h,c,u,d]=wa(i,t,e,n);return Le(Math.min(r,a,h,u),Math.min(o,l,c,d),Math.max(r,a,h,u),Math.max(o,l,c,d),s)}function wa(i,t,e,n){const s=t*n[0]/2,r=t*n[1]/2,o=Math.cos(e),a=Math.sin(e),l=s*o,h=s*a,c=r*o,u=r*a,d=i[0],f=i[1];return[d-l+u,f-h-c,d-l-u,f-h+c,d+l-u,f+h+c,d+l+u,f+h-c,d-l+u,f-h-c]}function It(i){return i[3]-i[1]}function Ze(i,t,e){const n=e||Xt();return Pt(i,t)?(i[0]>t[0]?n[0]=i[0]:n[0]=t[0],i[1]>t[1]?n[1]=i[1]:n[1]=t[1],i[2]<t[2]?n[2]=i[2]:n[2]=t[2],i[3]<t[3]?n[3]=i[3]:n[3]=t[3]):Vi(n),n}function je(i){return[i[0],i[3]]}function ji(i){return[i[2],i[3]]}function it(i){return i[2]-i[0]}function Pt(i,t){return i[0]<=t[2]&&i[2]>=t[0]&&i[1]<=t[3]&&i[3]>=t[1]}function Hi(i){return i[2]<i[0]||i[3]<i[1]}function Zc(i,t){return t?(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],t):i}function jc(i,t,e){let n=!1;const s=$s(i,t),r=$s(i,e);if(s===pt.INTERSECTING||r===pt.INTERSECTING)n=!0;else{const o=i[0],a=i[1],l=i[2],h=i[3],c=t[0],u=t[1],d=e[0],f=e[1],_=(f-u)/(d-c);let p,m;r&pt.ABOVE&&!(s&pt.ABOVE)&&(p=d-(f-h)/_,n=p>=o&&p<=l),!n&&r&pt.RIGHT&&!(s&pt.RIGHT)&&(m=f-(d-l)*_,n=m>=a&&m<=h),!n&&r&pt.BELOW&&!(s&pt.BELOW)&&(p=d-(f-a)/_,n=p>=o&&p<=l),!n&&r&pt.LEFT&&!(s&pt.LEFT)&&(m=f-(d-o)*_,n=m>=a&&m<=h)}return n}function Ea(i,t){const e=t.getExtent(),n=Ke(i);if(t.canWrapX()&&(n[0]<e[0]||n[0]>=e[2])){const s=it(e),o=Math.floor((n[0]-e[0])/s)*s;i[0]-=o,i[2]-=o}return i}function Ca(i,t,e){if(t.canWrapX()){const n=t.getExtent();if(!isFinite(i[0])||!isFinite(i[2]))return[[n[0],i[1],n[2],i[3]]];Ea(i,t);const s=it(n);if(it(i)>s&&!e)return[[n[0],i[1],n[2],i[3]]];if(i[0]<n[0])return[[i[0]+s,i[1],n[2],i[3]],[n[0],i[1],i[2],i[3]]];if(i[2]>n[2])return[[i[0],i[1],n[2],i[3]],[n[0],i[1],i[2]-s,i[3]]]}return[i]}function Hc(i,t){return i[0]+=+t[0],i[1]+=+t[1],i}function $i(i,t){let e=!0;for(let n=i.length-1;n>=0;--n)if(i[n]!=t[n]){e=!1;break}return e}function tr(i,t){const e=Math.cos(t),n=Math.sin(t),s=i[0]*e-i[1]*n,r=i[1]*e+i[0]*n;return i[0]=s,i[1]=r,i}function $c(i,t){return i[0]*=t,i[1]*=t,i}function va(i,t){if(t.canWrapX()){const e=it(t.getExtent()),n=qc(i,t,e);n&&(i[0]-=n*e)}return i}function qc(i,t,e){const n=t.getExtent();let s=0;return t.canWrapX()&&(i[0]<n[0]||i[0]>n[2])&&(e=e||it(n),s=Math.floor((i[0]-n[0])/e)),s}function ba(i){return Math.pow(i,3)}function mn(i){return 1-ba(1-i)}function Jc(i){return 3*i*i-2*i*i*i}function Qc(i){return i}const tu=63710088e-1;function Sa(i,t,e){e=e||tu;const n=Me(i[1]),s=Me(t[1]),r=(s-n)/2,o=Me(t[0]-i[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Ra(...i){console.warn(...i)}const er={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class nr{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||er[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const Jn=6378137,pn=Math.PI*Jn,eu=[-pn,-pn,pn,pn],nu=[-180,-85,180,85],qi=Jn*Math.log(Math.tan(Math.PI/2));class yn extends nr{constructor(t){super({code:t,units:"m",extent:eu,global:!0,worldExtent:nu,getPointResolution:function(e,n){return e/Math.cosh(n[1]/Jn)}})}}const Ta=[new yn("EPSG:3857"),new yn("EPSG:102100"),new yn("EPSG:102113"),new yn("EPSG:900913"),new yn("http://www.opengis.net/def/crs/EPSG/0/3857"),new yn("http://www.opengis.net/gml/srs/epsg.xml#3857")];function iu(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n){t[r]=pn*i[r]/180;let o=Jn*Math.log(Math.tan(Math.PI*(+i[r+1]+90)/360));o>qi?o=qi:o<-qi&&(o=-qi),t[r+1]=o}return t}function su(i,t,e,n){const s=i.length;e=e>1?e:2,n=n??e,t===void 0&&(e>2?t=i.slice():t=new Array(s));for(let r=0;r<s;r+=n)t[r]=180*i[r]/pn,t[r+1]=360*Math.atan(Math.exp(i[r+1]/Jn))/Math.PI-90;return t}const ru=6378137,Ia=[-180,-90,180,90],ou=Math.PI*ru/180;class He extends nr{constructor(t,e){super({code:t,units:"degrees",extent:Ia,axisOrientation:e,global:!0,metersPerUnit:ou,worldExtent:Ia})}}const Ma=[new He("CRS:84"),new He("EPSG:4326","neu"),new He("urn:ogc:def:crs:OGC:1.3:CRS84"),new He("urn:ogc:def:crs:OGC:2:84"),new He("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new He("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new He("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let ir={};function au(i){return ir[i]||ir[i.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null}function lu(i,t){ir[i]=t}let xn={};function Qn(i,t,e){const n=i.getCode(),s=t.getCode();n in xn||(xn[n]={}),xn[n][s]=e}function sr(i,t){return i in xn&&t in xn[i]?xn[i][t]:null}const Ji=.9996,Bt=.00669438,Qi=Bt*Bt,ts=Qi*Bt,$e=Bt/(1-Bt),La=Math.sqrt(1-Bt),wn=(1-La)/(1+La),Aa=wn*wn,rr=Aa*wn,or=rr*wn,ka=or*wn,Oa=1-Bt/4-3*Qi/64-5*ts/256,hu=3*Bt/8+3*Qi/32+45*ts/1024,cu=15*Qi/256+45*ts/1024,uu=35*ts/3072,du=3/2*wn-27/32*rr+269/512*ka,fu=21/16*Aa-55/32*or,gu=151/96*rr-417/128*ka,_u=1097/512*or,es=6378137;function mu(i,t,e){const n=i-5e5,o=(e.north?t:t-1e7)/Ji/(es*Oa),a=o+du*Math.sin(2*o)+fu*Math.sin(4*o)+gu*Math.sin(6*o)+_u*Math.sin(8*o),l=Math.sin(a),h=l*l,c=Math.cos(a),u=l/c,d=u*u,f=d*d,_=1-Bt*h,p=Math.sqrt(1-Bt*h),m=es/p,y=(1-Bt)/_,x=$e*c**2,v=x*x,E=n/(m*Ji),C=E*E,R=C*E,I=R*E,T=I*E,S=T*E,L=a-u/y*(C/2-I/24*(5+3*d+10*x-4*v-9*$e))+S/720*(61+90*d+298*x+45*f-252*$e-3*v);let O=(E-R/6*(1+2*d+x)+T/120*(5-2*x+28*d-3*v+8*$e+24*f))/c;return O=js(O+Me(Fa(e.number)),-Math.PI,Math.PI),[ua(O),ua(L)]}const Pa=-80,Da=84,pu=-180,yu=180;function xu(i,t,e){i=js(i,pu,yu),t<Pa?t=Pa:t>Da&&(t=Da);const n=Me(t),s=Math.sin(n),r=Math.cos(n),o=s/r,a=o*o,l=a*a,h=Me(i),c=Fa(e.number),u=Me(c),d=es/Math.sqrt(1-Bt*s**2),f=$e*r**2,_=r*js(h-u,-Math.PI,Math.PI),p=_*_,m=p*_,y=m*_,x=y*_,v=x*_,E=es*(Oa*n-hu*Math.sin(2*n)+cu*Math.sin(4*n)-uu*Math.sin(6*n)),C=Ji*d*(_+m/6*(1-a+f)+x/120*(5-18*a+l+72*f-58*$e))+5e5;let R=Ji*(E+d*o*(p/2+y/24*(5-a+9*f+4*f**2)+v/720*(61-58*a+l+600*f-330*$e)));return e.north||(R+=1e7),[C,R]}function Fa(i){return(i-1)*6-180+3}const wu=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function za(i){let t=0;for(const s of wu){const r=i.match(s);if(r){t=parseInt(r[1]);break}}if(!t)return null;let e=0,n=!1;return t>32700&&t<32761?e=t-32700:t>32600&&t<32661&&(n=!0,e=t-32600),e?{number:e,north:n}:null}function Na(i,t){return function(e,n,s,r){const o=e.length;s=s>1?s:2,r=r??s,n||(s>2?n=e.slice():n=new Array(o));for(let a=0;a<o;a+=r){const l=e[a],h=e[a+1],c=i(l,h,t);n[a]=c[0],n[a+1]=c[1]}return n}}function Eu(i){return za(i)?new nr({code:i,units:"m"}):null}function Cu(i){const t=za(i.getCode());return t?{forward:Na(xu,t),inverse:Na(mu,t)}:null}const vu=[Cu],bu=[Eu];let ar=!0;function Ga(i){ar=!1}function lr(i,t){if(t!==void 0){for(let e=0,n=i.length;e<n;++e)t[e]=i[e];t=t}else t=i.slice();return t}function hr(i){lu(i.getCode(),i),Qn(i,i,lr)}function Su(i){i.forEach(hr)}function Dt(i){if(typeof i!="string")return i;const t=au(i);if(t)return t;for(const e of bu){const n=e(i);if(n)return n}return null}function Wa(i,t,e,n){i=Dt(i);let s;const r=i.getPointResolutionFunc();if(r)s=r(t,e);else{const o=i.getUnits();if(o=="degrees"&&!n||n=="degrees")s=t;else{const a=dr(i,Dt("EPSG:4326"));if(!a&&o!=="degrees")s=t*i.getMetersPerUnit();else{let h=[e[0]-t/2,e[1],e[0]+t/2,e[1],e[0],e[1]-t/2,e[0],e[1]+t/2];h=a(h,h,2);const c=Sa(h.slice(0,2),h.slice(2,4)),u=Sa(h.slice(4,6),h.slice(6,8));s=(c+u)/2}const l=i.getMetersPerUnit();l!==void 0&&(s/=l)}}return s}function Ua(i){Su(i),i.forEach(function(t){i.forEach(function(e){t!==e&&Qn(t,e,lr)})})}function Ru(i,t,e,n){i.forEach(function(s){t.forEach(function(r){Qn(s,r,e),Qn(r,s,n)})})}function cr(i,t){return i?typeof i=="string"?Dt(i):i:Dt(t)}function Tu(i){return(function(t,e,n,s){const r=t.length;n=n!==void 0?n:2,s=s??n,e=e!==void 0?e:new Array(r);for(let o=0;o<r;o+=s){const a=i(t.slice(o,o+n)),l=a.length;for(let h=0,c=s;h<c;++h)e[o+h]=h>=l?t[o+h]:a[h]}return e})}function Iu(i,t){return Ga(),gr(i,"EPSG:4326","EPSG:3857")}function ur(i,t){if(i===t)return!0;const e=i.getUnits()===t.getUnits();return(i.getCode()===t.getCode()||dr(i,t)===lr)&&e}function dr(i,t){const e=i.getCode(),n=t.getCode();let s=sr(e,n);if(s)return s;let r=null,o=null;for(const l of vu)r||(r=l(i)),o||(o=l(t));if(!r&&!o)return null;const a="EPSG:4326";if(o)if(r)s=fr(r.inverse,o.forward);else{const l=sr(e,a);l&&(s=fr(l,o.forward))}else{const l=sr(a,n);l&&(s=fr(r.inverse,l))}return s&&(hr(i),hr(t),Qn(i,t,s)),s}function fr(i,t){return function(e,n,s,r){return n=i(e,n,s,r),t(n,n,s,r)}}function ns(i,t){const e=Dt(i),n=Dt(t);return dr(e,n)}function gr(i,t,e){const n=ns(t,e);if(!n){const s=Dt(t).getCode(),r=Dt(e).getCode();throw new Error(`No transform available between ${s} and ${r}`)}return n(i,void 0,i.length)}function _r(i,t){return i}function fe(i,t){return ar&&!$i(i,[0,0])&&i[0]>=-180&&i[0]<=180&&i[1]>=-90&&i[1]<=90&&(ar=!1,Ra("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),i}function Xa(i,t){return i}function Ae(i,t){return i}function Mu(){Ua(Ta),Ua(Ma),Ru(Ma,Ta,iu,su)}Mu(),new Array(6);function Jt(){return[1,0,0,1,0,0]}function Lu(i,t){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i}function yt(i,t){const e=t[0],n=t[1];return t[0]=i[0]*e+i[2]*n+i[4],t[1]=i[1]*e+i[3]*n+i[5],t}function ge(i,t,e,n,s,r,o,a){const l=Math.sin(r),h=Math.cos(r);return i[0]=n*h,i[1]=s*l,i[2]=-n*l,i[3]=s*h,i[4]=o*n*h-a*n*l+t,i[5]=o*s*l+a*s*h+e,i}function Ba(i,t){const e=Au(t);et(e!==0,"Transformation matrix cannot be inverted");const n=t[0],s=t[1],r=t[2],o=t[3],a=t[4],l=t[5];return i[0]=o/e,i[1]=-s/e,i[2]=-r/e,i[3]=n/e,i[4]=(r*l-o*a)/e,i[5]=-(n*l-s*a)/e,i}function Au(i){return i[0]*i[3]-i[1]*i[2]}const ku=[1e5,1e5,1e5,1e5,2,2];function Ou(i){return"matrix("+i.join(", ")+")"}function Ya(i){return i.substring(7,i.length-1).split(",").map(parseFloat)}function Pu(i,t){const e=Ya(i),n=Ya(t);for(let s=0;s<6;++s)if(Math.round((e[s]-n[s])*ku[s])!==0)return!1;return!0}function ke(i,t,e,n,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l<e;l+=n){const h=i[l],c=i[l+1];r[a++]=s[0]*h+s[2]*c+s[4],r[a++]=s[1]*h+s[3]*c+s[5];for(let u=2;u<o;u++)r[a++]=i[l+u]}return r&&r.length!=a&&(r.length=a),r}function Va(i,t,e,n,s,r,o){o=o||[];const a=Math.cos(s),l=Math.sin(s),h=r[0],c=r[1];let u=0;for(let d=t;d<e;d+=n){const f=i[d]-h,_=i[d+1]-c;o[u++]=h+f*a-_*l,o[u++]=c+f*l+_*a;for(let p=d+2;p<d+n;++p)o[u++]=i[p]}return o&&o.length!=u&&(o.length=u),o}function Du(i,t,e,n,s,r,o,a){a=a||[];const l=o[0],h=o[1];let c=0;for(let u=t;u<e;u+=n){const d=i[u]-l,f=i[u+1]-h;a[c++]=l+s*d,a[c++]=h+r*f;for(let _=u+2;_<u+n;++_)a[c++]=i[_]}return a&&a.length!=c&&(a.length=c),a}function Fu(i,t,e,n,s,r,o){o=o||[];let a=0;for(let l=t;l<e;l+=n){o[a++]=i[l]+s,o[a++]=i[l+1]+r;for(let h=l+2;h<l+n;++h)o[a++]=i[h]}return o&&o.length!=a&&(o.length=a),o}const Ka=Jt(),zu=[NaN,NaN];class Nu extends ne{constructor(){super(),this.extent_=Xt(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=ra((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(n),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return J()}closestPointXY(t,e,n,s){return J()}containsXY(t,e){return this.closestPointXY(t,e,zu,Number.MIN_VALUE)===0}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return J()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Vi(e),this.extentRevision_=this.getRevision()}return Zc(this.extent_,t)}rotate(t,e){J()}scale(t,e,n){J()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return J()}getType(){return J()}applyTransform(t){J()}intersectsExtent(t){return J()}translate(t,e){J()}transform(t,e){const n=Dt(t),s=n.getUnits()=="tile-pixels"?function(r,o,a){const l=n.getExtent(),h=n.getWorldExtent(),c=It(h)/It(l);ge(Ka,h[0],h[3],c,-c,0,0,0);const u=ke(r,0,r.length,a,Ka,o),d=ns(n,e);return d?d(u,u,a):u}:ns(n,e);return this.applyTransform(s),this}}class mr extends Nu{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return qs(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return J()}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(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=Za(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){J()}setLayout(t,e,n){let s;if(t)s=Za(t);else{for(let r=0;r<n;++r){if(e.length===0){this.layout="XY",this.stride=2;return}e=e[0]}s=e.length,t=Gu(s)}this.layout=t,this.stride=s}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Va(n,0,n.length,s,t,e,n),this.changed()}}scale(t,e,n){e===void 0&&(e=t),n||(n=Ke(this.getExtent()));const s=this.getFlatCoordinates();if(s){const r=this.getStride();Du(s,0,s.length,r,t,e,n,s),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const s=this.getStride();Fu(n,0,n.length,s,t,e,n),this.changed()}}}function Gu(i){let t;return i==2?t="XY":i==3?t="XYZ":i==4&&(t="XYZM"),t}function Za(i){let t;return i=="XY"?t=2:i=="XYZ"||i=="XYM"?t=3:i=="XYZM"&&(t=4),t}function Wu(i,t,e){const n=i.getFlatCoordinates();if(!n)return null;const s=i.getStride();return ke(n,0,n.length,s,t,e)}function ja(i,t,e,n){let s=0;const r=i[e-n],o=i[e-n+1];let a=0,l=0;for(;t<e;t+=n){const h=i[t]-r,c=i[t+1]-o;s+=l*h-a*c,a=h,l=c}return s/2}function Uu(i,t,e,n){let s=0;for(let r=0,o=e.length;r<o;++r){const a=e[r];s+=ja(i,t,a,n),t=a}return s}function Ha(i,t,e,n,s,r,o){const a=i[t],l=i[t+1],h=i[e]-a,c=i[e+1]-l;let u;if(h===0&&c===0)u=t;else{const d=((s-a)*h+(r-l)*c)/(h*h+c*c);if(d>1)u=e;else if(d>0){for(let f=0;f<n;++f)o[f]=Ut(i[t+f],i[e+f],d);o.length=n;return}else u=t}for(let d=0;d<n;++d)o[d]=i[u+d];o.length=n}function $a(i,t,e,n,s){let r=i[t],o=i[t+1];for(t+=n;t<e;t+=n){const a=i[t],l=i[t+1],h=fn(r,o,a,l);h>s&&(s=h),r=a,o=l}return s}function Xu(i,t,e,n,s){for(let r=0,o=e.length;r<o;++r){const a=e[r];s=$a(i,t,a,n,s),t=a}return s}function qa(i,t,e,n,s,r,o,a,l,h,c){if(t==e)return h;let u,d;if(s===0){if(d=fn(o,a,i[t],i[t+1]),d<h){for(u=0;u<n;++u)l[u]=i[t+u];return l.length=n,d}return h}c=c||[NaN,NaN];let f=t+n;for(;f<e;)if(Ha(i,f-n,f,n,o,a,c),d=fn(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n,f+=n}else f+=n*Math.max((Math.sqrt(d)-Math.sqrt(h))/s|0,1);if(Ha(i,e-n,t,n,o,a,c),d=fn(o,a,c[0],c[1]),d<h){for(h=d,u=0;u<n;++u)l[u]=c[u];l.length=n}return h}function Bu(i,t,e,n,s,r,o,a,l,h,c){c=c||[NaN,NaN];for(let u=0,d=e.length;u<d;++u){const f=e[u];h=qa(i,t,f,n,s,r,o,a,l,h,c),t=f}return h}function Yu(i,t,e,n){for(let s=0,r=e.length;s<r;++s)i[t++]=e[s];return t}function Ja(i,t,e,n){for(let s=0,r=e.length;s<r;++s){const o=e[s];for(let a=0;a<n;++a)i[t++]=o[a]}return t}function Vu(i,t,e,n,s){s=s||[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=Ja(i,t,e[o],n);s[r++]=l,t=l}return s.length=r,s}function En(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=t;o<e;o+=n)s[r++]=i.slice(o,o+n);return s.length=r,s}function is(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=En(i,t,l,n,s[r]),t=l}return s.length=r,s}function Qa(i,t,e,n,s){s=s!==void 0?s:[];let r=0;for(let o=0,a=e.length;o<a;++o){const l=e[o];s[r++]=l.length===1&&l[0]===t?[]:is(i,t,l,n,s[r]),t=l[l.length-1]}return s.length=r,s}function pr(i,t,e,n,s,r,o){const a=(e-t)/n;if(a<3){for(;t<e;t+=n)r[o++]=i[t],r[o++]=i[t+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const h=[t,e-n];let c=0;for(;h.length>0;){const u=h.pop(),d=h.pop();let f=0;const _=i[d],p=i[d+1],m=i[u],y=i[u+1];for(let x=d+n;x<u;x+=n){const v=i[x],E=i[x+1],C=Uc(v,E,_,p,m,y);C>f&&(c=x,f=C)}f>s&&(l[(c-t)/n]=1,d+n<c&&h.push(d,c),c+n<u&&h.push(c,u))}for(let u=0;u<a;++u)l[u]&&(r[o++]=i[t+u*n],r[o++]=i[t+u*n+1]);return o}function Ku(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=pr(i,t,c,n,s,r,o),a.push(o),t=c}return o}function qe(i,t){return t*Math.round(i/t)}function Zu(i,t,e,n,s,r,o){if(t==e)return o;let a=qe(i[t],s),l=qe(i[t+1],s);t+=n,r[o++]=a,r[o++]=l;let h,c;do if(h=qe(i[t],s),c=qe(i[t+1],s),t+=n,t==e)return r[o++]=h,r[o++]=c,o;while(h==a&&c==l);for(;t<e;){const u=qe(i[t],s),d=qe(i[t+1],s);if(t+=n,u==h&&d==c)continue;const f=h-a,_=c-l,p=u-a,m=d-l;if(f*m==_*p&&(f<0&&p<f||f==p||f>0&&p>f)&&(_<0&&m<_||_==m||_>0&&m>_)){h=u,c=d;continue}r[o++]=h,r[o++]=c,a=h,l=c,h=u,c=d}return r[o++]=h,r[o++]=c,o}function tl(i,t,e,n,s,r,o,a){for(let l=0,h=e.length;l<h;++l){const c=e[l];o=Zu(i,t,c,n,s,r,o),a.push(o),t=c}return o}class ti extends mr{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,e!==void 0&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}clone(){return new ti(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,s){return s<_a(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt($a(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),qa(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,s))}getArea(){return ja(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return En(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=pr(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new ti(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Ja(this.flatCoordinates,0,t,this.stride),this.changed()}}class ss extends mr{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new ss(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,s){const r=this.flatCoordinates,o=fn(t,e,r[0],r[1]);if(o<s){const a=this.stride;for(let l=0;l<a;++l)n[l]=r[l];return n.length=a,o}return s}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return pa(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return ma(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=Yu(this.flatCoordinates,0,t,this.stride),this.changed()}}function ju(i,t,e,n,s){return!xa(s,function(o){return!Je(i,t,e,n,o[0],o[1])})}function Je(i,t,e,n,s,r){let o=0,a=i[e-n],l=i[e-n+1];for(;t<e;t+=n){const h=i[t],c=i[t+1];l<=r?c>r&&(h-a)*(r-l)-(s-a)*(c-l)>0&&o++:c<=r&&(h-a)*(r-l)-(s-a)*(c-l)<0&&o--,a=h,l=c}return o!==0}function el(i,t,e,n,s,r){if(e.length===0||!Je(i,t,e[0],n,s,r))return!1;for(let o=1,a=e.length;o<a;++o)if(Je(i,e[o-1],e[o],n,s,r))return!1;return!0}function yr(i,t,e,n,s,r,o){let a,l,h,c,u,d,f;const _=s[r+1],p=[];for(let x=0,v=e.length;x<v;++x){const E=e[x];for(c=i[E-n],d=i[E-n+1],a=t;a<E;a+=n)u=i[a],f=i[a+1],(_<=d&&f<=_||d<=_&&_<=f)&&(h=(_-d)/(f-d)*(u-c)+c,p.push(h)),c=u,d=f}let m=NaN,y=-1/0;for(p.sort(ue),c=p[0],a=1,l=p.length;a<l;++a){u=p[a];const x=Math.abs(u-c);x>y&&(h=(c+u)/2,el(i,t,e,n,h,_)&&(m=h,y=x)),c=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,_,y),o):[m,_,y]}function Hu(i,t,e,n,s){let r=[];for(let o=0,a=e.length;o<a;++o){const l=e[o];r=yr(i,t,l,n,s,2*o,r),t=l[l.length-1]}return r}function $u(i,t,e,n,s){let r;for(t+=n;t<e;t+=n)if(r=s(i.slice(t-n,t),i.slice(t,t+n)),r)return r;return!1}function nl(i,t,e,n,s,r){return r=r??ya(Xt(),i,t,e,n),Pt(s,r)?r[0]>=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:$u(i,t,e,n,function(o,a){return jc(s,o,a)}):!1}function il(i,t,e,n,s){return!!(nl(i,t,e,n,s)||Je(i,t,e,n,s[0],s[1])||Je(i,t,e,n,s[0],s[3])||Je(i,t,e,n,s[2],s[1])||Je(i,t,e,n,s[2],s[3]))}function qu(i,t,e,n,s){if(!il(i,t,e[0],n,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r<o;++r)if(ju(i,e[r-1],e[r],n,s)&&!nl(i,e[r-1],e[r],n,s))return!1;return!0}function Ju(i,t,e,n){for(;t<e-n;){for(let s=0;s<n;++s){const r=i[t+s];i[t+s]=i[e-n+s],i[e-n+s]=r}t+=n,e-=n}}function xr(i,t,e,n){let s=0,r=i[e-n],o=i[e-n+1];for(;t<e;t+=n){const a=i[t],l=i[t+1];s+=(a-r)*(l+o),r=a,o=l}return s===0?void 0:s>0}function Qu(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=xr(i,t,a,n);if(r===0){if(s&&l||!s&&!l)return!1}else if(s&&!l||!s&&l)return!1;t=a}return!0}function sl(i,t,e,n,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r<o;++r){const a=e[r],l=xr(i,t,a,n);(r===0?s&&l||!s&&!l:s&&!l||!s&&l)&&Ju(i,t,a,n),t=a}return t}function td(i,t){const e=[];let n=0,s=0,r;for(let o=0,a=t.length;o<a;++o){const l=t[o],h=xr(i,n,l,2);if(r===void 0&&(r=h),h===r)e.push(t.slice(s,o+1));else{if(e.length===0)continue;e[e.length-1].push(t[s])}s=o+1,n=l}return e}class ei extends mr{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,e!==void 0&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?Vs(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new ei(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,s){return s<_a(this.getExtent(),t,e)?s:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(Xu(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),Bu(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,s))}containsXY(t,e){return el(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return Uu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return t!==void 0?(e=this.getOrientedFlatCoordinates().slice(),sl(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,is(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=Ke(this.getExtent());this.flatInteriorPoint_=yr(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ss(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new ti(this.flatCoordinates.slice(t===0?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,s=[];let r=0;for(let o=0,a=n.length;o<a;++o){const l=n[o],h=new ti(e.slice(r,l),t);s.push(h),r=l}return s}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;Qu(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=sl(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=tl(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new ei(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return qu(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=Vu(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=n.length===0?0:n[n.length-1],this.changed()}}function rl(i){if(Hi(i))throw new Error("Cannot create polygon from empty extent");const t=i[0],e=i[1],n=i[2],s=i[3],r=[t,e,t,s,n,s,n,e,t,e];return new ei(r,"XY",[r.length])}function wr(i,t,e,n){const s=it(t)/e[0],r=It(t)/e[1];return n?Math.min(i,Math.max(s,r)):Math.min(i,Math.min(s,r))}function Er(i,t,e){let n=Math.min(i,t);const s=50;return n*=Math.log(1+s*Math.max(0,i/t-1))/s+1,e&&(n=Math.max(n,e),n/=Math.log(1+s*Math.max(0,e/i-1))/s+1),lt(n,e/2,t*2)}function ed(i,t,e,n){return t=t!==void 0?t:!0,(function(s,r,o,a){if(s!==void 0){const l=i[0],h=i[i.length-1],c=e?wr(l,e,o,n):l;if(a)return t?Er(s,c,h):lt(s,h,c);const u=Math.min(c,s),d=Math.floor(Ys(i,u,r));return i[d]>c&&d<i.length-1?i[d+1]:i[d]}})}function nd(i,t,e,n,s,r){return n=n!==void 0?n:!0,e=e!==void 0?e:0,(function(o,a,l,h){if(o!==void 0){const c=s?wr(t,s,l,r):t;if(h)return n?Er(o,c,e):lt(o,e,c);const u=1e-9,d=Math.ceil(Math.log(t/c)/Math.log(i)-u),f=-a*(.5-u)+.5,_=Math.min(c,o),p=Math.floor(Math.log(t/_)/Math.log(i)+f),m=Math.max(d,p),y=t/Math.pow(i,m);return lt(y,e,c)}})}function ol(i,t,e,n,s){return e=e!==void 0?e:!0,(function(r,o,a,l){if(r!==void 0){const h=n?wr(i,n,a,s):i;return!e||!l?lt(r,t,h):Er(r,h,t)}})}function Cr(i){if(i!==void 0)return 0}function al(i){if(i!==void 0)return i}function id(i){const t=2*Math.PI/i;return(function(e,n){if(n)return e;if(e!==void 0)return e=Math.floor(e/t+.5)*t,e})}function sd(i){const t=Me(5);return(function(e,n){return n||e===void 0?e:Math.abs(e)<=t?0:e})}const rd=42,vr=256,br=0;class se extends ne{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=cr(t.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,t.projection&&Ga(),t.center&&(t.center=fe(t.center,this.projection_)),t.extent&&(t.extent=Ae(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const a in qt)delete e[a];this.setProperties(e,!0);const n=ad(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const s=od(t),r=n.constraint,o=ld(t);this.constraints_={center:s,resolution:r,rotation:o},this.setRotation(t.rotation!==void 0?t.rotation:0),this.setCenterInternal(t.center!==void 0?t.center:null),t.resolution!==void 0?this.setResolution(t.resolution):t.zoom!==void 0&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const s=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),o=r/2*(s[3]-e[3]+e[1]-s[1]),a=r/2*(s[0]-e[0]+e[2]-s[2]);this.setCenterInternal([n[0]+o,n[1]-a])}}getUpdatedOptions_(t){const e=this.getProperties();return e.resolution!==void 0?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let s=arguments[n];s.center&&(s=Object.assign({},s),s.center=fe(s.center,this.getProjection())),s.anchor&&(s=Object.assign({},s),s.anchor=fe(s.anchor,this.getProjection())),e[n]=s}this.animateInternal.apply(this,e)}animateInternal(t){let e=arguments.length,n;e>1&&typeof arguments[e-1]=="function"&&(n=arguments[e-1],--e);let s=0;for(;s<e&&!this.isDef();++s){const c=arguments[s];c.center&&this.setCenterInternal(c.center),c.zoom!==void 0?this.setZoom(c.zoom):c.resolution&&this.setResolution(c.resolution),c.rotation!==void 0&&this.setRotation(c.rotation)}if(s===e){n&&rs(n,!0);return}let r=Date.now(),o=this.targetCenter_.slice(),a=this.targetResolution_,l=this.targetRotation_;const h=[];for(;s<e;++s){const c=arguments[s],u={start:r,complete:!1,anchor:c.anchor,duration:c.duration!==void 0?c.duration:1e3,easing:c.easing||Jc,callback:n};if(c.center&&(u.sourceCenter=o,u.targetCenter=c.center.slice(),o=u.targetCenter),c.zoom!==void 0?(u.sourceResolution=a,u.targetResolution=this.getResolutionForZoom(c.zoom),a=u.targetResolution):c.resolution&&(u.sourceResolution=a,u.targetResolution=c.resolution,a=u.targetResolution),c.rotation!==void 0){u.sourceRotation=l;const d=gn(c.rotation-l+Math.PI,2*Math.PI)-Math.PI;u.targetRotation=l+d,l=u.targetRotation}hd(u)?u.complete=!0:r+=u.duration,h.push(u)}this.animations_.push(h),this.setHint(St.ANIMATING,1),this.updateAnimations_()}getAnimating(){return this.hints_[St.ANIMATING]>0}getInteracting(){return this.hints_[St.INTERACTING]>0}cancelAnimations(){this.setHint(St.ANIMATING,-this.hints_[St.ANIMATING]);let t;for(let e=0,n=this.animations_.length;e<n;++e){const s=this.animations_[e];if(s[0].callback&&rs(s[0].callback,!1),!t)for(let r=0,o=s.length;r<o;++r){const a=s[r];if(!a.complete){t=a.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,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;const t=Date.now();let e=!1;for(let n=this.animations_.length-1;n>=0;--n){const s=this.animations_[n];let r=!0;for(let o=0,a=s.length;o<a;++o){const l=s[o];if(l.complete)continue;const h=t-l.start;let c=l.duration>0?h/l.duration:1;c>=1?(l.complete=!0,c=1):r=!1;const u=l.easing(c);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],_=l.targetCenter[0],p=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(_-d),y=f+u*(p-f);this.targetCenter_=[m,y]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),_=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(_,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?gn(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[n]=null,this.setHint(St.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&rs(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const s=this.getCenterInternal();return s!==void 0&&(n=[s[0]-e[0],s[1]-e[1]],tr(n,t-this.getRotation()),Hc(n,e)),n}calculateCenterZoom(t,e){let n;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;n=[o,a]}return n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],s=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&_r(t,this.getProjection())}getCenterInternal(){return this.get(qt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return Xa(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();et(e,"The view center is not defined");const n=this.getResolution();et(n!==void 0,"The view resolution is not defined");const s=this.getRotation();return et(s!==void 0,"The view rotation is not defined"),Qs(e,n,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(qt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Ae(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=it(t)/e[0],s=It(t)/e[1];return Math.max(n,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,s=Math.log(e/n)/Math.log(t);return(function(r){return e/Math.pow(t,r*s)})}getRotation(){return this.get(qt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(n/s)/e;return(function(o){return Math.log(n/o)/e/r})}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=Sr(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,n)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,n,s;if(this.resolutions_){const r=Ys(this.resolutions_,t,1);e=r,n=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=n/this.resolutions_[r+1]}else n=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(n/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=lt(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,lt(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(et(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){et(!Hi(t),"Cannot fit empty extent provided as `geometry`");const s=Ae(t,this.getProjection());n=rl(s)}else if(t.getType()==="Circle"){const s=Ae(t.getExtent(),this.getProjection());n=rl(s),n.rotate(this.getRotation(),Ke(s))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,h=-1/0,c=-1/0;for(let u=0,d=r.length;u<d;u+=o){const f=r[u]*n-r[u+1]*s,_=r[u]*s+r[u+1]*n;a=Math.min(a,f),l=Math.min(l,_),h=Math.max(h,f),c=Math.max(c,_)}return[a,l,h,c]}fitInternal(t,e){e=e||{};let n=e.size;n||(n=this.getViewportSizeMinusPadding_());const s=e.padding!==void 0?e.padding:[0,0,0,0],r=e.nearest!==void 0?e.nearest:!1;let o;e.minResolution!==void 0?o=e.minResolution:e.maxZoom!==void 0?o=this.getResolutionForZoom(e.maxZoom):o=0;const a=this.rotatedExtentForGeometry(t);let l=this.getResolutionForExtentInternal(a,[n[0]-s[1]-s[3],n[1]-s[0]-s[2]]);l=isNaN(l)?o:Math.max(l,o),l=this.getConstrainedResolution(l,r?0:1);const h=this.getRotation(),c=Math.sin(h),u=Math.cos(h),d=Ke(a);d[0]+=(s[1]-s[3])/2*l,d[1]+=(s[0]-s[2])/2*l;const f=d[0]*u-d[1]*c,_=d[1]*u+d[0]*c,p=this.getConstrainedCenter([f,_],l),m=e.callback?e.callback:Kn;e.duration!==void 0?this.animateInternal({resolution:l,center:p,duration:e.duration,easing:e.easing},m):(this.targetResolution_=l,this.targetCenter_=p,this.applyTargetState_(!1,!0),rs(m,!0))}centerOn(t,e,n){this.centerOnInternal(fe(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(Sr(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,s){let r;const o=this.padding_;if(o&&t){const a=this.getViewportSizeMinusPadding_(-n),l=Sr(t,s,[a[0]/2+o[3],a[1]/2+o[0]],e,n);r=[t[0]-l[0],t[1]-l[1]]}return r}isDef(){return!!this.getCenterInternal()&&this.getResolution()!==void 0}adjustCenter(t){const e=_r(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&fe(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,s,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=fe(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),s=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(s,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t&&fe(t,this.getProjection()))}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e,s=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(s),o=this.constraints_.resolution(this.targetResolution_,0,r,n),a=this.constraints_.center(this.targetCenter_,o,r,n,this.calculateCenterShift(this.targetCenter_,o,s,r));this.get(qt.ROTATION)!==s&&this.set(qt.ROTATION,s),this.get(qt.RESOLUTION)!==o&&(this.set(qt.RESOLUTION,o),this.set("zoom",this.getZoom(),!0)),(!a||!this.get(qt.CENTER)||!$i(this.get(qt.CENTER),a))&&this.set(qt.CENTER,a),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){t=t!==void 0?t:200;const s=e||0,r=this.constraints_.rotation(this.targetRotation_),o=this.getViewportSize_(r),a=this.constraints_.resolution(this.targetResolution_,s,o),l=this.constraints_.center(this.targetCenter_,a,o,!1,this.calculateCenterShift(this.targetCenter_,a,r,o));if(t===0&&!this.cancelAnchor_){this.targetResolution_=a,this.targetRotation_=r,this.targetCenter_=l,this.applyTargetState_();return}n=n||(t===0?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,(this.getResolution()!==a||this.getRotation()!==r||!this.getCenterInternal()||!$i(this.getCenterInternal(),l))&&(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:l,resolution:a,duration:t,easing:mn,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(St.INTERACTING,1)}endInteraction(t,e,n){n=n&&fe(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(St.INTERACTING,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function rs(i,t){setTimeout(function(){i(t)},0)}function od(i){if(i.extent!==void 0){const e=i.smoothExtentConstraint!==void 0?i.smoothExtentConstraint:!0;return da(i.extent,i.constrainOnlyCenter,e)}const t=cr(i.projection,"EPSG:3857");if(i.multiWorld!==!0&&t.isGlobal()){const e=t.getExtent().slice();return e[0]=-1/0,e[2]=1/0,da(e,!1,!1)}return Bc}function ad(i){let t,e,n,o=i.minZoom!==void 0?i.minZoom:br,a=i.maxZoom!==void 0?i.maxZoom:28;const l=i.zoomFactor!==void 0?i.zoomFactor:2,h=i.multiWorld!==void 0?i.multiWorld:!1,c=i.smoothResolutionConstraint!==void 0?i.smoothResolutionConstraint:!0,u=i.showFullExtent!==void 0?i.showFullExtent:!1,d=cr(i.projection,"EPSG:3857"),f=d.getExtent();let _=i.constrainOnlyCenter,p=i.extent;if(!h&&!p&&d.isGlobal()&&(_=!1,p=f),i.resolutions!==void 0){const m=i.resolutions;e=m[o],n=m[a]!==void 0?m[a]:m[m.length-1],i.constrainResolution?t=ed(m,c,!_&&p,u):t=ol(e,n,c,!_&&p,u)}else{const y=(f?Math.max(it(f),It(f)):360*er.degrees/d.getMetersPerUnit())/vr/Math.pow(2,br),x=y/Math.pow(2,28-br);e=i.maxResolution,e!==void 0?o=0:e=y/Math.pow(l,o),n=i.minResolution,n===void 0&&(i.maxZoom!==void 0?i.maxResolution!==void 0?n=e/Math.pow(l,a):n=y/Math.pow(l,a):n=x),a=o+Math.floor(Math.log(e/n)/Math.log(l)),n=e/Math.pow(l,a-o),i.constrainResolution?t=nd(l,e,n,c,!_&&p,u):t=ol(e,n,c,!_&&p,u)}return{constraint:t,maxResolution:e,minResolution:n,minZoom:o,zoomFactor:l}}function ld(i){if(i.enableRotation!==void 0?i.enableRotation:!0){const e=i.constrainRotation;return e===void 0||e===!0?sd():e===!1?al:typeof e=="number"?id(e):al}return Cr}function hd(i){return!(i.sourceCenter&&i.targetCenter&&!$i(i.sourceCenter,i.targetCenter)||i.sourceResolution!==i.targetResolution||i.sourceRotation!==i.targetRotation)}function Sr(i,t,e,n,s){const r=Math.cos(-s);let o=Math.sin(-s),a=i[0]*r-i[1]*o,l=i[1]*r+i[0]*o;a+=(t[0]/2-e[0])*n,l+=(e[1]-t[1]/2)*n,o=-o;const h=a*r-l*o,c=l*r+a*o;return[h,c]}const os="ol-hidden",as="ol-unselectable",Rr="ol-control",ll="ol-collapsed",cd=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"),hl=["style","variant","weight","size","lineHeight","family"],Tr={normal:400,bold:700},Ir=function(i){const t=i.match(cd);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let n=0,s=hl.length;n<s;++n){const r=t[n+1];r!==void 0&&(e[hl[n]]=typeof r=="string"?r.trim():r)}return isNaN(Number(e.weight))&&e.weight in Tr&&(e.weight=Tr[e.weight]),e.families=e.family.split(/,\s?/).map(n=>n.trim().replace(/^['"]|['"]$/g,"")),e};function ft(i,t,e,n){let s;return e&&e.length?s=e.shift():Ks?s=new OffscreenCanvas(i||300,t||300):s=document.createElement("canvas"),i&&(s.width=i),t&&(s.height=t),s.getContext("2d",n)}let Mr;function ls(){return Mr||(Mr=ft(1,1)),Mr}function hs(i){const t=i.canvas;t.width=1,t.height=1,i.clearRect(0,0,1,1)}function cl(i,t){const e=t.parentNode;e&&e.replaceChild(i,t)}function ud(i){for(;i.lastChild;)i.lastChild.remove()}function dd(i,t){const e=i.childNodes;for(let n=0;;++n){const s=e[n],r=t[n];if(!s&&!r)break;if(s!==r){if(!s){i.appendChild(r);continue}if(!r){i.removeChild(s),--n;continue}i.insertBefore(r,s)}}}class Lr extends ne{constructor(t){super();const e=t.element;e&&!t.target&&!e.style.pointerEvents&&(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,n=this.listenerKeys.length;e<n;++e)at(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){const e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==Kn&&this.listenerKeys.push(q(t,Ie.POSTRENDER,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_=typeof t=="string"?document.getElementById(t):t}}class fd extends Lr{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=t.collapsed!==void 0?t.collapsed:!0,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=t.collapsible!==void 0,this.collapsible_=t.collapsible!==void 0?t.collapsible:!0,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=t.className!==void 0?t.className:"ol-attribution",n=t.tipLabel!==void 0?t.tipLabel:"Attributions",s=t.expandClassName!==void 0?t.expandClassName:e+"-expand",r=t.collapseLabel!==void 0?t.collapseLabel:"›",o=t.collapseClassName!==void 0?t.collapseClassName:e+"-collapse";typeof r=="string"?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=o):this.collapseLabel_=r;const a=t.label!==void 0?t.label:"i";typeof a=="string"?(this.label_=document.createElement("span"),this.label_.textContent=a,this.label_.className=s):this.label_=a;const l=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(l),this.toggleButton_.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1);const h=e+" "+as+" "+Rr+(this.collapsed_&&this.collapsible_?" "+ll:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=h,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),n=new Set(e.flatMap(s=>s.getAttributions(t)));if(this.attributions_!==void 0&&(Array.isArray(this.attributions_)?this.attributions_.forEach(s=>n.add(s)):n.add(this.attributions_)),!this.overrideCollapsible_){const s=!e.some(r=>r.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(s)}return Array.from(n)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}const e=await Promise.all(this.collectSourceAttributions_(t).map(s=>kc(()=>s))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!Re(e,this.renderedAttributions_)){ud(this.ulElement_);for(let s=0,r=e.length;s<r;++s){const o=document.createElement("li");o.innerHTML=e[s],this.ulElement_.appendChild(o)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(ll),this.collapsed_?cl(this.collapseLabel_,this.label_):cl(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,!(!this.collapsible_||this.collapsed_===t)&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}class gd extends Lr{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=t.className!==void 0?t.className:"ol-rotate",n=t.label!==void 0?t.label:"⇧",s=t.compassClassName!==void 0?t.compassClassName:"ol-compass";this.label_=null,typeof n=="string"?(this.label_=document.createElement("span"),this.label_.className=s,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(s));const r=t.tipLabel?t.tipLabel:"Reset rotation",o=document.createElement("button");o.className=e+"-reset",o.setAttribute("type","button"),o.title=r,o.appendChild(this.label_),o.addEventListener(Y.CLICK,this.handleClick_.bind(this),!1);const a=e+" "+as+" "+Rr,l=this.element;l.className=a,l.appendChild(o),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=t.duration!==void 0?t.duration:250,this.autoHide_=t.autoHide!==void 0?t.autoHide:!0,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(os)}handleClick_(t){t.preventDefault(),this.callResetNorth_!==void 0?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const e=this.getMap().getView();if(!e)return;const n=e.getRotation();n!==void 0&&(this.duration_>0&&n%(2*Math.PI)!==0?e.animate({rotation:0,duration:this.duration_,easing:mn}):e.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const s="rotate("+n+"rad)";if(this.autoHide_){const r=this.element.classList.contains(os);!r&&n===0?this.element.classList.add(os):r&&n!==0&&this.element.classList.remove(os)}this.label_.style.transform=s}this.rotation_=n}}class _d extends Lr{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=t.className!==void 0?t.className:"ol-zoom",n=t.delta!==void 0?t.delta:1,s=t.zoomInClassName!==void 0?t.zoomInClassName:e+"-in",r=t.zoomOutClassName!==void 0?t.zoomOutClassName:e+"-out",o=t.zoomInLabel!==void 0?t.zoomInLabel:"+",a=t.zoomOutLabel!==void 0?t.zoomOutLabel:"–",l=t.zoomInTipLabel!==void 0?t.zoomInTipLabel:"Zoom in",h=t.zoomOutTipLabel!==void 0?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=s,c.setAttribute("type","button"),c.title=l,c.appendChild(typeof o=="string"?document.createTextNode(o):o),c.addEventListener(Y.CLICK,this.handleClick_.bind(this,n),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=h,u.appendChild(typeof a=="string"?document.createTextNode(a):a),u.addEventListener(Y.CLICK,this.handleClick_.bind(this,-n),!1);const d=e+" "+as+" "+Rr,f=this.element;f.className=d,f.appendChild(c),f.appendChild(u),this.duration_=t.duration!==void 0?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const n=this.getMap().getView();if(!n)return;const s=n.getZoom();if(s!==void 0){const r=n.getConstrainedZoom(s+t);this.duration_>0?(n.getAnimating()&&n.cancelAnimations(),n.animate({zoom:r,duration:this.duration_,easing:mn})):n.setZoom(r)}}}function md(i){i=i||{};const t=new ie;return(i.zoom!==void 0?i.zoom:!0)&&t.push(new _d(i.zoomOptions)),(i.rotate!==void 0?i.rotate:!0)&&t.push(new gd(i.rotateOptions)),(i.attribution!==void 0?i.attribution:!0)&&t.push(new fd(i.attributionOptions)),t}class pd{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const s=this.points_[e+2]-this.points_[n+2];if(s<1e3/60)return!1;const r=this.points_[e]-this.points_[n],o=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(o,r),this.initialVelocity_=Math.sqrt(r*r+o*o)/s,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const ul={ACTIVE:"active"};class ni extends ne{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(ul.ACTIVE)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(ul.ACTIVE,t)}setMap(t){this.map_=t}}function yd(i,t,e){const n=i.getCenterInternal();if(n){const s=[n[0]+t[0],n[1]+t[1]];i.animateInternal({duration:e!==void 0?e:250,easing:Qc,center:i.getConstrainedCenter(s)})}}function Ar(i,t,e,n){const s=i.getZoom();if(s===void 0)return;const r=i.getConstrainedZoom(s+t),o=i.getResolutionForZoom(r);i.getAnimating()&&i.cancelAnimations(),i.animate({resolution:o,anchor:e,duration:n!==void 0?n:250,easing:mn})}class xd extends ni{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:250}handleEvent(t){let e=!1;if(t.type==ct.DBLCLICK){const n=t.originalEvent,s=t.map,r=t.coordinate,o=n.shiftKey?-this.delta_:this.delta_,a=s.getView();Ar(a,o,r,this.duration_),n.preventDefault(),e=!0}return!e}}function kr(i){const t=arguments;return function(e){let n=!0;for(let s=0,r=t.length;s<r&&(n=n&&t[s](e),!!n);++s);return n}}const wd=function(i){const t=i.originalEvent;return t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},Ed=function(i){const t=i.map.getTargetElement(),e=t.getRootNode(),n=i.map.getOwnerDocument().activeElement;return e instanceof ShadowRoot?e.host.contains(n):t.contains(n)},dl=function(i){const t=i.map.getTargetElement(),e=t.getRootNode();return(e instanceof ShadowRoot?e.host:t).hasAttribute("tabindex")?Ed(i):!0},Cd=Vn,fl=function(i){const t=i.originalEvent;return"pointerId"in t&&t.button==0&&!(Dc&&la&&t.ctrlKey)},gl=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&!t.shiftKey},vd=function(i){const t=i.originalEvent;return la?t.metaKey:t.ctrlKey},bd=function(i){const t=i.originalEvent;return!t.altKey&&!(t.metaKey||t.ctrlKey)&&t.shiftKey},_l=function(i){const t=i.originalEvent,e=t.target.tagName;return e!=="INPUT"&&e!=="SELECT"&&e!=="TEXTAREA"&&!t.target.isContentEditable},Or=function(i){const t=i.originalEvent;return"pointerId"in t&&t.pointerType=="mouse"},Sd=function(i){const t=i.originalEvent;return"pointerId"in t&&t.isPrimary&&t.button===0};class ii extends ni{constructor(t){t=t||{},super(t),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==ct.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==ct.POINTERUP){const n=this.handleUpEvent(t);this.handlingDownUpSequence=n&&this.targetPointers.length>0}}else if(t.type==ct.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==ct.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function Pr(i){const t=i.length;let e=0,n=0;for(let s=0;s<t;s++)e+=i[s].clientX,n+=i[s].clientY;return{clientX:e/t,clientY:n/t}}class Rd extends ii{constructor(t){super({stopDown:zi}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:kr(gl,Sd);this.condition_=t.onFocusOnly?kr(dl,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,s=e.getEventPixel(Pr(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(s[0],s[1]),this.lastCentroid){const r=[this.lastCentroid[0]-s[0],s[1]-this.lastCentroid[1]],a=t.map.getView();$c(r,a.getResolution()),tr(r,a.getRotation()),a.adjustCenterInternal(r)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=s,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,n=e.getView();if(this.targetPointers.length===0){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const s=this.kinetic_.getDistance(),r=this.kinetic_.getAngle(),o=n.getCenterInternal(),a=e.getPixelFromCoordinateInternal(o),l=e.getCoordinateFromPixelInternal([a[0]-s*Math.cos(r),a[1]-s*Math.sin(r)]);n.animateInternal({center:n.getConstrainedCenter(l),duration:500,easing:mn})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const n=t.map.getView();return this.lastCentroid=null,n.getAnimating()&&n.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class Td extends ii{constructor(t){t=t||{},super({stopDown:zi}),this.condition_=t.condition?t.condition:wd,this.lastAngle_=void 0,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){if(!Or(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===Cr)return;const s=e.getSize(),r=t.pixel,o=Math.atan2(s[1]/2-r[1],r[0]-s[0]/2);if(this.lastAngle_!==void 0){const a=o-this.lastAngle_;n.adjustRotationInternal(-a)}this.lastAngle_=o}handleUpEvent(t){return Or(t)?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){return Or(t)&&fl(t)&&this.condition_(t)?(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0):!1}}class Id extends Fi{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",s=this.element_.style;s.left=Math.min(t[0],e[0])+n,s.top=Math.min(t[1],e[1])+n,s.width=Math.abs(e[0]-t[0])+n,s.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const e=this.element_.style;e.left="inherit",e.top="inherit",e.width="inherit",e.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,s=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);s[4]=s[0].slice(),this.geometry_?this.geometry_.setCoordinates([s]):this.geometry_=new ei([s])}getGeometry(){return this.geometry_}}const Cn={BOXSTART:"boxstart",BOXDRAG:"boxdrag",BOXEND:"boxend",BOXCANCEL:"boxcancel"};class si extends de{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class Md extends ii{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new Id(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??fl,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const s=n[0]-e[0],r=n[1]-e[1];return s*s+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new si(Cn.BOXDRAG,t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new si(e?Cn.BOXEND:Cn.BOXCANCEL,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return this.condition_(t)?(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new si(Cn.BOXSTART,t.coordinate,t)),!0):!1}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new si(Cn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new si(Cn.BOXCANCEL,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class Ld extends Md{constructor(t){t=t||{};const e=t.condition?t.condition:bd;super({condition:e,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=t.duration!==void 0?t.duration:200,this.out_=t.out!==void 0?t.out:!1}onBoxEnd(t){const n=this.getMap().getView();let s=this.getGeometry();if(this.out_){const r=n.rotatedExtentForGeometry(s),o=n.getResolutionForExtentInternal(r),a=n.getResolution()/o;s=s.clone(),s.scale(a*a)}n.fitInternal(s,{duration:this.duration_,easing:mn})}}const Qe={LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",DOWN:"ArrowDown"};class Ad extends ni{constructor(t){super(),t=t||{},this.defaultCondition_=function(e){return gl(e)&&_l(e)},this.condition_=t.condition!==void 0?t.condition:this.defaultCondition_,this.duration_=t.duration!==void 0?t.duration:100,this.pixelDelta_=t.pixelDelta!==void 0?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==Y.KEYDOWN){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==Qe.DOWN||s==Qe.LEFT||s==Qe.RIGHT||s==Qe.UP)){const o=t.map.getView(),a=o.getResolution()*this.pixelDelta_;let l=0,h=0;s==Qe.DOWN?h=-a:s==Qe.LEFT?l=-a:s==Qe.RIGHT?l=a:h=a;const c=[l,h];tr(c,o.getRotation()),yd(o,c,this.duration_),n.preventDefault(),e=!0}}return!e}}class kd extends ni{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(e){return!vd(e)&&_l(e)},this.delta_=t.delta?t.delta:1,this.duration_=t.duration!==void 0?t.duration:100}handleEvent(t){let e=!1;if(t.type==Y.KEYDOWN||t.type==Y.KEYPRESS){const n=t.originalEvent,s=n.key;if(this.condition_(t)&&(s==="+"||s==="-")){const r=t.map,o=s==="+"?this.delta_:-this.delta_,a=r.getView();Ar(a,o,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}}const Od=40,Pd=300;class Dd extends ni{constructor(t){t=t||{},super(t),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=t.maxDelta!==void 0?t.maxDelta:1,this.duration_=t.duration!==void 0?t.duration:250,this.timeout_=t.timeout!==void 0?t.timeout:80,this.useAnchor_=t.useAnchor!==void 0?t.useAnchor:!0,this.constrainResolution_=t.constrainResolution!==void 0?t.constrainResolution:!1;const e=t.condition?t.condition:Cd;this.condition_=t.onFocusOnly?kr(dl,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();if(!t)return;t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t)||t.type!==Y.WHEEL)return!0;const n=t.map,s=t.originalEvent;s.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let r=s.deltaY;switch(s.deltaMode){case WheelEvent.DOM_DELTA_LINE:r*=Od;break;case WheelEvent.DOM_DELTA_PAGE:r*=Pd;break}if(r===0)return!1;this.lastDelta_=r;const o=Date.now();this.startTime_===void 0&&(this.startTime_=o),(!this.mode_||o-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(r)<4?"trackpad":"wheel");const a=n.getView();if(this.mode_==="trackpad"&&!(a.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(a.getAnimating()&&a.cancelAnimations(),a.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),a.adjustZoom(-r/this.deltaPerZoom_,this.lastAnchor_?n.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=o,!1;this.totalDelta_+=r;const l=Math.max(this.timeout_-(o-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,n),l),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-lt(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),Ar(e,n,this.lastAnchor_?t.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(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class Fd extends ii{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=zi),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=t.threshold!==void 0?t.threshold:.3,this.duration_=t.duration!==void 0?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],s=this.targetPointers[1],r=Math.atan2(s.clientY-n.clientY,s.clientX-n.clientX);if(this.lastAngle_!==void 0){const l=r-this.lastAngle_;this.rotationDelta_+=l,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=l}this.lastAngle_=r;const o=t.map,a=o.getView();a.getConstraints().rotation!==Cr&&(this.anchor_=o.getCoordinateFromPixelInternal(o.getEventPixel(Pr(this.targetPointers))),this.rotating_&&(o.render(),a.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return this.targetPointers.length<2?(t.map.getView().endInteraction(this.duration_),!1):!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class zd extends ii{constructor(t){t=t||{};const e=t;e.stopDown||(e.stopDown=zi),super(e),this.anchor_=null,this.duration_=t.duration!==void 0?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],s=this.targetPointers[1],r=n.clientX-s.clientX,o=n.clientY-s.clientY,a=Math.sqrt(r*r+o*o);this.lastDistance_!==void 0&&(e=this.lastDistance_/a),this.lastDistance_=a;const l=t.map,h=l.getView();e!=1&&(this.lastScaleDelta_=e),this.anchor_=l.getCoordinateFromPixelInternal(l.getEventPixel(Pr(this.targetPointers))),l.render(),h.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const n=t.map.getView(),s=this.lastScaleDelta_>1?1:-1;return n.endInteraction(this.duration_,s),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function Nd(i){i=i||{};const t=new ie,e=new pd(-.005,.05,100);return(i.altShiftDragRotate!==void 0?i.altShiftDragRotate:!0)&&t.push(new Td),(i.doubleClickZoom!==void 0?i.doubleClickZoom:!0)&&t.push(new xd({delta:i.zoomDelta,duration:i.zoomDuration})),(i.dragPan!==void 0?i.dragPan:!0)&&t.push(new Rd({onFocusOnly:i.onFocusOnly,kinetic:e})),(i.pinchRotate!==void 0?i.pinchRotate:!0)&&t.push(new Fd),(i.pinchZoom!==void 0?i.pinchZoom:!0)&&t.push(new zd({duration:i.zoomDuration})),(i.keyboard!==void 0?i.keyboard:!0)&&(t.push(new Ad),t.push(new kd({delta:i.zoomDelta,duration:i.zoomDuration}))),(i.mouseWheelZoom!==void 0?i.mouseWheelZoom:!0)&&t.push(new Dd({onFocusOnly:i.onFocusOnly,duration:i.zoomDuration})),(i.shiftDragZoom!==void 0?i.shiftDragZoom:!0)&&t.push(new Ld({duration:i.zoomDuration})),t}const st={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"};class ml extends ne{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[st.OPACITY]=t.opacity!==void 0?t.opacity:1,et(typeof e[st.OPACITY]=="number","Layer opacity must be a number"),e[st.VISIBLE]=t.visible!==void 0?t.visible:!0,e[st.Z_INDEX]=t.zIndex,e[st.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[st.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[st.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[st.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},n=this.getZIndex();return e.opacity=lt(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=n===void 0&&!e.managed?1/0:n,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return J()}getLayerStatesArray(t){return J()}getExtent(){return this.get(st.EXTENT)}getMaxResolution(){return this.get(st.MAX_RESOLUTION)}getMinResolution(){return this.get(st.MIN_RESOLUTION)}getMinZoom(){return this.get(st.MIN_ZOOM)}getMaxZoom(){return this.get(st.MAX_ZOOM)}getOpacity(){return this.get(st.OPACITY)}getSourceState(){return J()}getVisible(){return this.get(st.VISIBLE)}getZIndex(){return this.get(st.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(st.EXTENT,t)}setMaxResolution(t){this.set(st.MAX_RESOLUTION,t)}setMinResolution(t){this.set(st.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(st.MAX_ZOOM,t)}setMinZoom(t){this.set(st.MIN_ZOOM,t)}setOpacity(t){et(typeof t=="number","Layer opacity must be a number"),this.set(st.OPACITY,t)}setVisible(t){this.set(st.VISIBLE,t)}setZIndex(t){this.set(st.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}class Oe extends de{constructor(t,e){super(t),this.layer=e}}const Dr={LAYERS:"layers"};class vn extends ml{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(Dr.LAYERS,this.handleLayersChanged_),n?Array.isArray(n)?n=new ie(n.slice(),{unique:!0}):et(typeof n.getArray=="function","Expected `layers` to be an array or a `Collection`"):n=new ie(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(at),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(q(t,Ot.ADD,this.handleLayersAdd_,this),q(t,Ot.REMOVE,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(at);Zn(this.listenerKeys_);const e=t.getArray();for(let n=0,s=e.length;n<s;n++){const r=e[n];this.registerLayerListeners_(r),this.dispatchEvent(new Oe("addlayer",r))}this.changed()}registerLayerListeners_(t){const e=[q(t,cn.PROPERTYCHANGE,this.handleLayerChange_,this),q(t,Y.CHANGE,this.handleLayerChange_,this)];t instanceof vn&&e.push(q(t,"addlayer",this.handleLayerGroupAdd_,this),q(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[Q(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new Oe("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new Oe("removelayer",t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new Oe("addlayer",e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=Q(e);this.listenerKeys_[n].forEach(at),delete this.listenerKeys_[n],this.dispatchEvent(new Oe("removelayer",e)),this.changed()}getLayers(){return this.get(Dr.LAYERS)}setLayers(t){const e=this.getLayers();if(e){const n=e.getArray();for(let s=0,r=n.length;s<r;++s)this.dispatchEvent(new Oe("removelayer",n[s]))}this.set(Dr.LAYERS,t)}getLayersArray(t){return t=t!==void 0?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=t!==void 0?t:[],n=e.length;this.getLayers().forEach(function(o){o.getLayerStatesArray(e)});const s=this.getLayerState();let r=s.zIndex;!t&&s.zIndex===void 0&&(r=0);for(let o=n,a=e.length;o<a;o++){const l=e[o];l.opacity*=s.opacity,l.visible=l.visible&&s.visible,l.maxResolution=Math.min(l.maxResolution,s.maxResolution),l.minResolution=Math.max(l.minResolution,s.minResolution),l.minZoom=Math.max(l.minZoom,s.minZoom),l.maxZoom=Math.min(l.maxZoom,s.maxZoom),s.extent!==void 0&&(l.extent!==void 0?l.extent=Ze(l.extent,s.extent):l.extent=s.extent),l.zIndex===void 0&&(l.zIndex=r)}return e}getSourceState(){return"ready"}}const Yt={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"};class cs extends ml{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(st.SOURCE,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return t=t||[],t.push(this),t}getLayerStatesArray(t){return t=t||[],t.push(this.getLayerState()),t}getSource(){return this.get(st.SOURCE)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),!(this.sourceReady_||this.getSource().getState()!=="ready")&&(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(at(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=q(t,Y.CHANGE,this.handleSourceChange_,this),t.getState()==="ready"&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const n=this.getMapInternal();!t&&n&&(t=n.getView()),t instanceof se?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray());let s;if(e.layerStatesArray){if(s=e.layerStatesArray.find(o=>o.layer===this),!s)return!1}else s=this.getLayerState();const r=this.getExtent();return Fr(s,e.viewState)&&(!r||Pt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const n=t instanceof se?t.getViewStateAndExtent():t;let s=e(n);return Array.isArray(s)||(s=[s]),s}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(st.MAP,t)}getMapInternal(){return this.get(st.MAP)}setMap(t){this.mapPrecomposeKey_&&(at(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(at(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=q(t,Yt.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=q(this,Y.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);et(!e.some(s=>s.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set(st.SOURCE,t)}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 Fr(i,t){if(!i.visible)return!1;const e=t.resolution;if(e<i.minResolution||e>=i.maxResolution)return!1;const n=t.zoom;return n>i.minZoom&&n<=i.maxZoom}function pl(i,t,e=0,n=i.length-1,s=Gd){for(;n>e;){if(n-e>600){const l=n-e+1,h=t-e+1,c=Math.log(l),u=.5*Math.exp(2*c/3),d=.5*Math.sqrt(c*u*(l-u)/l)*(h-l/2<0?-1:1),f=Math.max(e,Math.floor(t-h*u/l+d)),_=Math.min(n,Math.floor(t+(l-h)*u/l+d));pl(i,t,f,_,s)}const r=i[t];let o=e,a=n;for(ri(i,e,t),s(i[n],r)>0&&ri(i,e,n);o<a;){for(ri(i,o,a),o++,a--;s(i[o],r)<0;)o++;for(;s(i[a],r)>0;)a--}s(i[e],r)===0?ri(i,e,a):(a++,ri(i,a,n)),a<=t&&(e=a+1),t<=a&&(n=a-1)}}function ri(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function Gd(i,t){return i<t?-1:i>t?1:0}let yl=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!ds(t,e))return n;const s=this.toBBox,r=[];for(;e;){for(let o=0;o<e.children.length;o++){const a=e.children[o],l=e.leaf?s(a):a;ds(t,l)&&(e.leaf?n.push(a):Nr(t,l)?this._all(a,n):r.push(a))}e=r.pop()}return n}collides(t){let e=this.data;if(!ds(t,e))return!1;const n=[];for(;e;){for(let s=0;s<e.children.length;s++){const r=e.children[s],o=e.leaf?this.toBBox(r):r;if(ds(t,o)){if(e.leaf||Nr(t,o))return!0;n.push(r)}}e=n.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let n=0;n<t.length;n++)this.insert(t[n]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=e;else if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const n=this.data;this.data=e,e=n}this._insert(e,this.data.height-e.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=Sn([]),this}remove(t,e){if(!t)return this;let n=this.data;const s=this.toBBox(t),r=[],o=[];let a,l,h;for(;n||r.length;){if(n||(n=r.pop(),l=r[r.length-1],a=o.pop(),h=!0),n.leaf){const c=Wd(t,n.children,e);if(c!==-1)return n.children.splice(c,1),r.push(n),this._condense(r),this}!h&&!n.leaf&&Nr(n,s)?(r.push(n),o.push(a),a=0,l=n,n=n.children[0]):l?(a++,n=l.children[a],h=!1):n=null}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,s){const r=n-e+1;let o=this._maxEntries,a;if(r<=o)return a=Sn(t.slice(e,n+1)),bn(a,this.toBBox),a;s||(s=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,s-1))),a=Sn([]),a.leaf=!1,a.height=s;const l=Math.ceil(r/o),h=l*Math.ceil(Math.sqrt(o));xl(t,e,n,h,this.compareMinX);for(let c=e;c<=n;c+=h){const u=Math.min(c+h-1,n);xl(t,c,u,l,this.compareMinY);for(let d=c;d<=u;d+=l){const f=Math.min(d+l-1,u);a.children.push(this._build(t,d,f,s-1))}}return bn(a,this.toBBox),a}_chooseSubtree(t,e,n,s){for(;s.push(e),!(e.leaf||s.length-1===n);){let r=1/0,o=1/0,a;for(let l=0;l<e.children.length;l++){const h=e.children[l],c=zr(h),u=Bd(t,h)-c;u<o?(o=u,r=c<r?c:r,a=h):u===o&&c<r&&(r=c,a=h)}e=a||e.children[0]}return e}_insert(t,e,n){const s=n?t:this.toBBox(t),r=[],o=this._chooseSubtree(s,this.data,e,r);for(o.children.push(t),ai(o,s);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const n=t[e],s=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,s);const o=this._chooseSplitIndex(n,r,s),a=Sn(n.children.splice(o,n.children.length-o));a.height=n.height,a.leaf=n.leaf,bn(n,this.toBBox),bn(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(n,a)}_splitRoot(t,e){this.data=Sn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,bn(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let s,r=1/0,o=1/0;for(let a=e;a<=n-e;a++){const l=oi(t,0,a,this.toBBox),h=oi(t,a,n,this.toBBox),c=Yd(l,h),u=zr(l)+zr(h);c<r?(r=c,s=a,o=u<o?u:o):c===r&&u<o&&(o=u,s=a)}return s||n-e}_chooseSplitAxis(t,e,n){const s=t.leaf?this.compareMinX:Ud,r=t.leaf?this.compareMinY:Xd,o=this._allDistMargin(t,e,n,s),a=this._allDistMargin(t,e,n,r);o<a&&t.children.sort(s)}_allDistMargin(t,e,n,s){t.children.sort(s);const r=this.toBBox,o=oi(t,0,e,r),a=oi(t,n-e,n,r);let l=us(o)+us(a);for(let h=e;h<n-e;h++){const c=t.children[h];ai(o,t.leaf?r(c):c),l+=us(o)}for(let h=n-e-1;h>=e;h--){const c=t.children[h];ai(a,t.leaf?r(c):c),l+=us(a)}return l}_adjustParentBBoxes(t,e,n){for(let s=n;s>=0;s--)ai(e[s],t)}_condense(t){for(let e=t.length-1,n;e>=0;e--)t[e].children.length===0?e>0?(n=t[e-1].children,n.splice(n.indexOf(t[e]),1)):this.clear():bn(t[e],this.toBBox)}};function Wd(i,t,e){if(!e)return t.indexOf(i);for(let n=0;n<t.length;n++)if(e(i,t[n]))return n;return-1}function bn(i,t){oi(i,0,i.children.length,t,i)}function oi(i,t,e,n,s){s||(s=Sn(null)),s.minX=1/0,s.minY=1/0,s.maxX=-1/0,s.maxY=-1/0;for(let r=t;r<e;r++){const o=i.children[r];ai(s,i.leaf?n(o):o)}return s}function ai(i,t){return i.minX=Math.min(i.minX,t.minX),i.minY=Math.min(i.minY,t.minY),i.maxX=Math.max(i.maxX,t.maxX),i.maxY=Math.max(i.maxY,t.maxY),i}function Ud(i,t){return i.minX-t.minX}function Xd(i,t){return i.minY-t.minY}function zr(i){return(i.maxX-i.minX)*(i.maxY-i.minY)}function us(i){return i.maxX-i.minX+(i.maxY-i.minY)}function Bd(i,t){return(Math.max(t.maxX,i.maxX)-Math.min(t.minX,i.minX))*(Math.max(t.maxY,i.maxY)-Math.min(t.minY,i.minY))}function Yd(i,t){const e=Math.max(i.minX,t.minX),n=Math.max(i.minY,t.minY),s=Math.min(i.maxX,t.maxX),r=Math.min(i.maxY,t.maxY);return Math.max(0,s-e)*Math.max(0,r-n)}function Nr(i,t){return i.minX<=t.minX&&i.minY<=t.minY&&t.maxX<=i.maxX&&t.maxY<=i.maxY}function ds(i,t){return t.minX<=i.maxX&&t.minY<=i.maxY&&t.maxX>=i.minX&&t.maxY>=i.minY}function Sn(i){return{children:i,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function xl(i,t,e,n,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=n)continue;const o=t+Math.ceil((e-t)/n/2)*n;pl(i,o,t,e,s),r.push(t,o,o,e)}}const Gr=[NaN,NaN,NaN,0];let Wr;function Vd(){return Wr||(Wr=ft(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),Wr}const Kd=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Zd=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,jd=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,Hd=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function fs(i,t){return i.endsWith("%")?Number(i.substring(0,i.length-1))/t:Number(i)}function li(i){throw new Error('failed to parse "'+i+'" as color')}function wl(i){if(i.toLowerCase().startsWith("rgb")){const r=i.match(Zd)||i.match(Kd)||i.match(jd);if(r){const o=r[4],a=100/255;return[lt(fs(r[1],a)+.5|0,0,255),lt(fs(r[2],a)+.5|0,0,255),lt(fs(r[3],a)+.5|0,0,255),o!==void 0?lt(fs(o,100),0,1):1]}li(i)}if(i.startsWith("#")){if(Hd.test(i)){const r=i.substring(1),o=r.length<=4?1:2,a=[0,0,0,255];for(let l=0,h=r.length;l<h;l+=o){let c=parseInt(r.substring(l,l+o),16);o===1&&(c+=c<<4),a[l/o]=c}return a[3]=a[3]/255,a}li(i)}const t=Vd();t.fillStyle="#abcdef";let e=t.fillStyle;t.fillStyle=i,t.fillStyle===e&&(t.fillStyle="#fedcba",e=t.fillStyle,t.fillStyle=i,t.fillStyle===e&&li(i));const n=t.fillStyle;if(n.startsWith("#")||n.startsWith("rgba"))return wl(n);t.clearRect(0,0,1,1),t.fillRect(0,0,1,1);const s=Array.from(t.getImageData(0,0,1,1).data);return s[3]=Xi(s[3]/255,3),s}function $d(i){return typeof i=="string"?i:Zr(i)}const qd=1024,hi={};let Ur=0;function Jd(i){if(i.length===4)return i;const t=i.slice();return t[3]=1,t}function Xr(i){return i>.0031308?Math.pow(i,1/2.4)*269.025-14.025:i*3294.6}function Br(i){return i>.2068965?Math.pow(i,3):(i-4/29)*(108/841)}function Yr(i){return i>10.314724?Math.pow((i+14.025)/269.025,2.4):i/3294.6}function Vr(i){return i>.0088564?Math.pow(i,1/3):i/(108/841)+4/29}function El(i){const t=Yr(i[0]),e=Yr(i[1]),n=Yr(i[2]),s=Vr(t*.222488403+e*.716873169+n*.06060791),r=500*(Vr(t*.452247074+e*.399439023+n*.148375274)-s),o=200*(s-Vr(t*.016863605+e*.117638439+n*.865350722)),a=Math.atan2(o,r)*(180/Math.PI);return[116*s-16,Math.sqrt(r*r+o*o),a<0?a+360:a,i[3]]}function Qd(i){const t=(i[0]+16)/116,e=i[1],n=i[2]*Math.PI/180,s=Br(t),r=Br(t+e/500*Math.cos(n)),o=Br(t-e/200*Math.sin(n)),a=Xr(r*3.021973625-s*1.617392459-o*.404875592),l=Xr(r*-.943766287+s*1.916279586+o*.027607165),h=Xr(r*.069407491-s*.22898585+o*1.159737864);return[lt(a+.5|0,0,255),lt(l+.5|0,0,255),lt(h+.5|0,0,255),i[3]]}function Kr(i){if(i==="none")return Gr;if(hi.hasOwnProperty(i))return hi[i];if(Ur>=qd){let e=0;for(const n in hi)(e++&3)===0&&(delete hi[n],--Ur)}const t=wl(i);t.length!==4&&li(i);for(const e of t)isNaN(e)&&li(i);return hi[i]=t,++Ur,t}function Rn(i){return Array.isArray(i)?i:Kr(i)}function Zr(i){let t=i[0];t!=(t|0)&&(t=t+.5|0);let e=i[1];e!=(e|0)&&(e=e+.5|0);let n=i[2];n!=(n|0)&&(n=n+.5|0);const s=i[3]===void 0?1:Math.round(i[3]*1e3)/1e3;return"rgba("+t+","+e+","+n+","+s+")"}function Cl(i){return i[0]>0&&i[1]>0}function tf(i,t,e){return e===void 0&&(e=[0,0]),e[0]=i[0]*t+.5|0,e[1]=i[1]*t+.5|0,e}function Ft(i,t){return Array.isArray(i)?i:(t===void 0?t=[i,i]:(t[0]=i,t[1]=i),t)}let tn=0;const Mt=1<<tn++,$=1<<tn++,zt=1<<tn++,Qt=1<<tn++,en=1<<tn++,ci=1<<tn++,gs=Math.pow(2,tn)-1,jr={[Mt]:"boolean",[$]:"number",[zt]:"string",[Qt]:"color",[en]:"number[]",[ci]:"size"},ef=Object.keys(jr).map(Number).sort(ue);function nf(i){return i in jr}function ui(i){const t=[];for(const e of ef)di(i,e)&&t.push(jr[e]);return t.length===0?"untyped":t.length<3?t.join(" or "):t.slice(0,-1).join(", ")+", or "+t[t.length-1]}function di(i,t){return(i&t)===t}function Pe(i,t){return i===t}class gt{constructor(t,e){if(!nf(t))throw new Error(`literal expressions must have a specific type, got ${ui(t)}`);this.type=t,this.value=e}}class sf{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function vl(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function Ct(i,t,e){switch(typeof i){case"boolean":{if(Pe(t,zt))return new gt(zt,i?"true":"false");if(!di(t,Mt))throw new Error(`got a boolean, but expected ${ui(t)}`);return new gt(Mt,i)}case"number":{if(Pe(t,ci))return new gt(ci,Ft(i));if(Pe(t,Mt))return new gt(Mt,!!i);if(Pe(t,zt))return new gt(zt,i.toString());if(!di(t,$))throw new Error(`got a number, but expected ${ui(t)}`);return new gt($,i)}case"string":{if(Pe(t,Qt))return new gt(Qt,Kr(i));if(Pe(t,Mt))return new gt(Mt,!!i);if(!di(t,zt))throw new Error(`got a string, but expected ${ui(t)}`);return new gt(zt,i)}}if(!Array.isArray(i))throw new Error("expression must be an array or a primitive value");if(i.length===0)throw new Error("empty expression");if(typeof i[0]=="string")return _f(i,t,e);for(const n of i)if(typeof n!="number")throw new Error("expected an array of numbers");if(Pe(t,ci)){if(i.length!==2)throw new Error(`expected an array of two values for a size, got ${i.length}`);return new gt(ci,i)}if(Pe(t,Qt)){if(i.length===3)return new gt(Qt,[...i,1]);if(i.length===4)return new gt(Qt,i);throw new Error(`expected an array of 3 or 4 values for a color, got ${i.length}`)}if(!di(t,en))throw new Error(`got an array of numbers, but expected ${ui(t)}`);return new gt(en,i)}const b={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"},rf={[b.Get]:U(V(1,1/0),bl),[b.Var]:U(V(1,1),of),[b.Has]:U(V(1,1/0),bl),[b.Id]:U(af,Tn),[b.Concat]:U(V(2,1/0),tt(zt)),[b.GeometryType]:U(lf,Tn),[b.LineMetric]:U(Tn),[b.Resolution]:U(Hr,Tn),[b.Zoom]:U(Hr,Tn),[b.Time]:U(Hr,Tn),[b.Any]:U(V(2,1/0),tt(Mt)),[b.All]:U(V(2,1/0),tt(Mt)),[b.Not]:U(V(1,1),tt(Mt)),[b.Equal]:U(V(2,2),tt(gs)),[b.NotEqual]:U(V(2,2),tt(gs)),[b.GreaterThan]:U(V(2,2),tt($)),[b.GreaterThanOrEqualTo]:U(V(2,2),tt($)),[b.LessThan]:U(V(2,2),tt($)),[b.LessThanOrEqualTo]:U(V(2,2),tt($)),[b.Multiply]:U(V(2,1/0),Sl),[b.Coalesce]:U(V(2,1/0),Sl),[b.Divide]:U(V(2,2),tt($)),[b.Add]:U(V(2,1/0),tt($)),[b.Subtract]:U(V(2,2),tt($)),[b.Clamp]:U(V(3,3),tt($)),[b.Mod]:U(V(2,2),tt($)),[b.Pow]:U(V(2,2),tt($)),[b.Abs]:U(V(1,1),tt($)),[b.Floor]:U(V(1,1),tt($)),[b.Ceil]:U(V(1,1),tt($)),[b.Round]:U(V(1,1),tt($)),[b.Sin]:U(V(1,1),tt($)),[b.Cos]:U(V(1,1),tt($)),[b.Atan]:U(V(1,2),tt($)),[b.Sqrt]:U(V(1,1),tt($)),[b.Match]:U(V(4,1/0),Rl,cf),[b.Between]:U(V(3,3),tt($)),[b.Interpolate]:U(V(6,1/0),Rl,uf),[b.Case]:U(V(3,1/0),hf,df),[b.In]:U(V(2,2),ff),[b.Number]:U(V(1,1/0),tt(gs)),[b.String]:U(V(1,1/0),tt(gs)),[b.Array]:U(V(1,1/0),tt($)),[b.Color]:U(V(1,4),tt($)),[b.Band]:U(V(1,3),tt($)),[b.Palette]:U(V(2,2),gf),[b.ToString]:U(V(1,1),tt(Mt|$|zt|Qt))};function bl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=i[r+1];switch(typeof o){case"number":{s[r]=new gt($,o);break}case"string":{s[r]=new gt(zt,o);break}default:throw new Error(`expected a string key or numeric array index for a get operation, got ${o}`)}r===0&&e.properties.add(String(o))}return s}function of(i,t,e){const n=i[1];if(typeof n!="string")throw new Error("expected a string argument for var operation");return e.variables.add(n),[new gt(zt,n)]}function af(i,t,e){e.featureId=!0}function lf(i,t,e){e.geometryType=!0}function Hr(i,t,e){e.mapState=!0}function Tn(i,t,e){const n=i[0];if(i.length!==1)throw new Error(`expected no arguments for ${n} operation`);return[]}function V(i,t){return function(e,n,s){const r=e[0],o=e.length-1;if(i===t){if(o!==i){const a=i===1?"":"s";throw new Error(`expected ${i} argument${a} for ${r}, got ${o}`)}}else if(o<i||o>t){const a=t===1/0?`${i} or more`:`${i} to ${t}`;throw new Error(`expected ${a} arguments for ${r}, got ${o}`)}}}function Sl(i,t,e){const n=i.length-1,s=new Array(n);for(let r=0;r<n;++r){const o=Ct(i[r+1],t,e);s[r]=o}return s}function tt(i){return function(t,e,n){const s=t.length-1,r=new Array(s);for(let o=0;o<s;++o){const a=Ct(t[o+1],i,n);r[o]=a}return r}}function hf(i,t,e){const n=i[0],s=i.length-1;if(s%2===0)throw new Error(`expected an odd number of arguments for ${n}, got ${s} instead`)}function Rl(i,t,e){const n=i[0],s=i.length-1;if(s%2===1)throw new Error(`expected an even number of arguments for operation ${n}, got ${s} instead`)}function cf(i,t,e){const n=i.length-1,s=zt|$|Mt,r=Ct(i[1],s,e),o=Ct(i[i.length-1],t,e),a=new Array(n-2);for(let l=0;l<n-2;l+=2){try{const h=Ct(i[l+2],r.type,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+1} of match expression: ${h.message}`)}try{const h=Ct(i[l+3],o.type,e);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+2} of match expression: ${h.message}`)}}return[r,...a,o]}function uf(i,t,e){const n=i[1];let s;switch(n[0]){case"linear":s=1;break;case"exponential":const l=n[1];if(typeof l!="number"||l<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(l)} instead`);s=l;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(n)}`)}const r=new gt($,s);let o;try{o=Ct(i[2],$,e)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(i.length-3);for(let l=0;l<a.length;l+=2){try{const h=Ct(i[l+3],$,e);a[l]=h}catch(h){throw new Error(`failed to parse argument ${l+2} for interpolate expression: ${h.message}`)}try{const h=Ct(i[l+4],t,e);a[l+1]=h}catch(h){throw new Error(`failed to parse argument ${l+3} for interpolate expression: ${h.message}`)}}return[r,o,...a]}function df(i,t,e){const n=Ct(i[i.length-1],t,e),s=new Array(i.length-1);for(let r=0;r<s.length-1;r+=2){try{const o=Ct(i[r+1],Mt,e);s[r]=o}catch(o){throw new Error(`failed to parse argument ${r} of case expression: ${o.message}`)}try{const o=Ct(i[r+2],n.type,e);s[r+1]=o}catch(o){throw new Error(`failed to parse argument ${r+1} of case expression: ${o.message}`)}}return s[s.length-1]=n,s}function ff(i,t,e){let n=i[2];if(!Array.isArray(n))throw new Error('the second argument for the "in" operator must be an array');let s;if(typeof n[0]=="string"){if(n[0]!=="literal")throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(n[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');n=n[1],s=zt}else s=$;const r=new Array(n.length);for(let a=0;a<r.length;a++)try{const l=Ct(n[a],s,e);r[a]=l}catch(l){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${l.message}`)}return[Ct(i[1],s,e),...r]}function gf(i,t,e){let n;try{n=Ct(i[1],$,e)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const s=i[2];if(!Array.isArray(s))throw new Error("the second argument of palette must be an array");const r=new Array(s.length);for(let o=0;o<r.length;o++){let a;try{a=Ct(s[o],Qt,e)}catch(l){throw new Error(`failed to parse color at index ${o} in palette expression: ${l.message}`)}if(!(a instanceof gt))throw new Error(`the palette color at index ${o} must be a literal value`);r[o]=a}return[n,...r]}function U(...i){return function(t,e,n){const s=t[0];let r;for(let o=0;o<i.length;o++){const a=i[o](t,e,n);if(o==i.length-1){if(!a)throw new Error("expected last argument validator to return the parsed args");r=a}}return new sf(e,s,...r)}}function _f(i,t,e){const n=i[0],s=rf[n];if(!s)throw new Error(`unknown operator: ${n}`);return s(i,t,e)}function Tl(i){if(!i)return"";const t=i.getType();switch(t){case"Point":case"LineString":case"Polygon":return t;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return t.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return Tl(i.getGeometries()[0]);default:return""}}function Il(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function _e(i,t,e){const n=Ct(i,t,e);return te(n)}function te(i,t){if(i instanceof gt){if(i.type===Qt&&typeof i.value=="string"){const n=Kr(i.value);return function(){return n}}return function(){return i.value}}const e=i.operator;switch(e){case b.Number:case b.String:case b.Coalesce:return mf(i);case b.Get:case b.Var:case b.Has:return pf(i);case b.Id:return n=>n.featureId;case b.GeometryType:return n=>n.geometryType;case b.Concat:{const n=i.args.map(s=>te(s));return s=>"".concat(...n.map(r=>r(s).toString()))}case b.Resolution:return n=>n.resolution;case b.Any:case b.All:case b.Between:case b.In:case b.Not:return xf(i);case b.Equal:case b.NotEqual:case b.LessThan:case b.LessThanOrEqualTo:case b.GreaterThan:case b.GreaterThanOrEqualTo:return yf(i);case b.Multiply:case b.Divide:case b.Add:case b.Subtract:case b.Clamp:case b.Mod:case b.Pow:case b.Abs:case b.Floor:case b.Ceil:case b.Round:case b.Sin:case b.Cos:case b.Atan:case b.Sqrt:return wf(i);case b.Case:return Ef(i);case b.Match:return Cf(i);case b.Interpolate:return vf(i);case b.ToString:return bf(i);default:throw new Error(`Unsupported operator ${e}`)}}function mf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r]);switch(e){case b.Coalesce:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a<"u"&&a!==null)return a}throw new Error("Expected one of the values to be non-null")};case b.Number:case b.String:return r=>{for(let o=0;o<n;++o){const a=s[o](r);if(typeof a===e)return a}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}function pf(i,t){const n=i.args[0].value;switch(i.operator){case b.Get:return s=>{const r=i.args;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;o=o[c]}return o};case b.Var:return s=>s.variables[n];case b.Has:return s=>{const r=i.args;if(!(n in s.properties))return!1;let o=s.properties[n];for(let a=1,l=r.length;a<l;++a){const c=r[a].value;if(!o||!Object.hasOwn(o,c))return!1;o=o[c]}return!0};default:throw new Error(`Unsupported accessor operator ${i.operator}`)}}function yf(i,t){const e=i.operator,n=te(i.args[0]),s=te(i.args[1]);switch(e){case b.Equal:return r=>n(r)===s(r);case b.NotEqual:return r=>n(r)!==s(r);case b.LessThan:return r=>n(r)<s(r);case b.LessThanOrEqualTo:return r=>n(r)<=s(r);case b.GreaterThan:return r=>n(r)>s(r);case b.GreaterThanOrEqualTo:return r=>n(r)>=s(r);default:throw new Error(`Unsupported comparison operator ${e}`)}}function xf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r]);switch(e){case b.Any:return r=>{for(let o=0;o<n;++o)if(s[o](r))return!0;return!1};case b.All:return r=>{for(let o=0;o<n;++o)if(!s[o](r))return!1;return!0};case b.Between:return r=>{const o=s[0](r),a=s[1](r),l=s[2](r);return o>=a&&o<=l};case b.In:return r=>{const o=s[0](r);for(let a=1;a<n;++a)if(o===s[a](r))return!0;return!1};case b.Not:return r=>!s[0](r);default:throw new Error(`Unsupported logical operator ${e}`)}}function wf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r]);switch(e){case b.Multiply:return r=>{let o=1;for(let a=0;a<n;++a)o*=s[a](r);return o};case b.Divide:return r=>s[0](r)/s[1](r);case b.Add:return r=>{let o=0;for(let a=0;a<n;++a)o+=s[a](r);return o};case b.Subtract:return r=>s[0](r)-s[1](r);case b.Clamp:return r=>{const o=s[0](r),a=s[1](r);if(o<a)return a;const l=s[2](r);return o>l?l:o};case b.Mod:return r=>s[0](r)%s[1](r);case b.Pow:return r=>Math.pow(s[0](r),s[1](r));case b.Abs:return r=>Math.abs(s[0](r));case b.Floor:return r=>Math.floor(s[0](r));case b.Ceil:return r=>Math.ceil(s[0](r));case b.Round:return r=>Math.round(s[0](r));case b.Sin:return r=>Math.sin(s[0](r));case b.Cos:return r=>Math.cos(s[0](r));case b.Atan:return n===2?r=>Math.atan2(s[0](r),s[1](r)):r=>Math.atan(s[0](r));case b.Sqrt:return r=>Math.sqrt(s[0](r));default:throw new Error(`Unsupported numeric operator ${e}`)}}function Ef(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s]);return s=>{for(let r=0;r<e-1;r+=2)if(n[r](s))return n[r+1](s);return n[e-1](s)}}function Cf(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s]);return s=>{const r=n[0](s);for(let o=1;o<e-1;o+=2)if(r===n[o](s))return n[o+1](s);return n[e-1](s)}}function vf(i,t){const e=i.args.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=te(i.args[s]);return s=>{const r=n[0](s),o=n[1](s);let a,l;for(let h=2;h<e;h+=2){const c=n[h](s);let u=n[h+1](s);const d=Array.isArray(u);if(d&&(u=Jd(u)),c>=o)return h===2?u:d?Sf(r,o,a,l,c,u):fi(r,o,a,l,c,u);a=c,l=u}return l}}function bf(i,t){const e=i.operator,n=i.args.length,s=new Array(n);for(let r=0;r<n;++r)s[r]=te(i.args[r]);switch(e){case b.ToString:return r=>{const o=s[0](r);return i.args[0].type===Qt?Zr(o):o.toString()};default:throw new Error(`Unsupported convert operator ${e}`)}}function fi(i,t,e,n,s,r){const o=s-e;if(o===0)return n;const a=t-e,l=i===1?a/o:(Math.pow(i,a)-1)/(Math.pow(i,o)-1);return n+l*(r-n)}function Sf(i,t,e,n,s,r){if(s-e===0)return n;const a=El(n),l=El(r);let h=l[2]-a[2];h>180?h-=360:h<-180&&(h+=360);const c=[fi(i,t,e,a[0],s,l[0]),fi(i,t,e,a[1],s,l[1]),a[2]+fi(i,t,e,0,s,h),fi(i,t,e,n[3],s,r[3])];return Qd(c)}const Z={IDLE:0,LOADING:1,LOADED:2,ERROR:3};function Rf(i,t,e){const n=i;let s=!0,r=!1,o=!1;const a=[Gi(n,Y.LOAD,function(){o=!0,r||t()})];return n.src&&ha?(r=!0,n.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(Gi(n,Y.ERROR,e)),function(){s=!1,a.forEach(at)}}function Tf(i,t){return new Promise((e,n)=>{function s(){o(),e(i)}function r(){o(),n(new Error("Image load error"))}function o(){i.removeEventListener("load",s),i.removeEventListener("error",r)}i.addEventListener("load",s),i.addEventListener("error",r)})}function If(i,t){return t&&(i.src=t),i.src&&ha?new Promise((e,n)=>i.decode().then(()=>e(i)).catch(s=>i.complete&&i.width?e(i):n(s))):Tf(i)}class Mf{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 t=0;for(const e in this.cache_){const n=this.cache_[e];(t++&3)===0&&!n.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const s=$r(t,e,n);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,n){const s=$r(t,e,n);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,n,s,r){const o=$r(t,e,n),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===Z.IDLE&&s.load(),s.getImageState()===Z.LOADING?s.ready().then(()=>{this.patternCache_[o]=ls().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=ls().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function $r(i,t,e){const n=e?Rn(e):"null";return t+":"+i+":"+n}const Vt=new Mf;let gi=null;class Ml extends Ni{constructor(t,e,n,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=s===void 0?Z.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Z.LOADED){gi||(gi=ft(1,1,void 0,{willReadFrequently:!0})),gi.drawImage(this.image_,0,0);try{gi.getImageData(0,0,1,1),this.tainted_=!1}catch{gi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(Y.CHANGE)}handleImageError_(){this.imageState_=Z.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Z.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=ft(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Z.IDLE){this.image_||this.initializeImage_(),this.imageState_=Z.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&If(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Z.LOADED)return;const e=this.image_,n=ft(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=n.canvas;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle=$d(this.color_),n.fillRect(0,0,s.width/t,s.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===Z.LOADED||this.imageState_===Z.ERROR)t();else{const e=()=>{(this.imageState_===Z.LOADED||this.imageState_===Z.ERROR)&&(this.removeEventListener(Y.CHANGE,e),t())};this.addEventListener(Y.CHANGE,e)}})),this.ready_}}function qr(i,t,e,n,s,r){let o=t===void 0?void 0:Vt.get(t,e,s);return o||(o=new Ml(i,i&&"src"in i?i.src||void 0:t,e,n,s),Vt.set(t,e,s,o,r)),r&&o&&!Vt.getPattern(t,e,s)&&Vt.set(t,e,s,o,r),o}function re(i){return i?Array.isArray(i)?Zr(i):typeof i=="object"&&"src"in i?Lf(i):i:null}function Lf(i){if(!i.offset||!i.size)return Vt.getPattern(i.src,"anonymous",i.color);const t=i.src+":"+i.offset,e=Vt.getPattern(t,void 0,i.color);if(e)return e;const n=Vt.get(i.src,"anonymous",null);if(n.getImageState()!==Z.LOADED)return null;const s=ft(i.size[0],i.size[1]);return s.drawImage(n.getImage(1),i.offset[0],i.offset[1],i.size[0],i.size[1],0,0,i.size[0],i.size[1]),qr(s.canvas,t,void 0,Z.LOADED,i.color,!0),Vt.getPattern(t,void 0,i.color)}const Ll="10px sans-serif",Nt="#000",In="round",me=[],pe=0,Mn="round",_i=10,mi="#000",pi="center",_s="middle",nn=[0,0,0,0],yi=1,Ln=new ne;let xi=null,Al;const Jr={},Af=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function kf(i,t,e){return`${i} ${t} 16px "${e}"`}const Of=(function(){let t,e;async function n(r){await e.ready;const o=await e.load(r);if(o.length===0)return!1;const a=Ir(r),l=a.families[0].toLowerCase(),h=a.weight;return o.some(c=>{const u=c.family.replace(/^['"]|['"]$/g,"").toLowerCase(),d=Tr[c.weight]||c.weight;return u===l&&c.style===a.style&&d==h})}async function s(){await e.ready;let r=!0;const o=Ln.getProperties(),a=Object.keys(o).filter(l=>o[l]<100);for(let l=a.length-1;l>=0;--l){const h=a[l];let c=o[h];c<100&&(await n(h)?(Zn(Jr),Ln.set(h,100)):(c+=10,Ln.set(h,c,!0),c<100&&(r=!1)))}t=void 0,r||(t=setTimeout(s,100))}return async function(r){e||(e=Ks?self.fonts:document.fonts);const o=Ir(r);if(!o)return;const a=o.families;let l=!1;for(const h of a){if(Af.has(h))continue;const c=kf(o.style,o.weight,h);Ln.get(c)===void 0&&(Ln.set(c,0,!0),l=!0)}l&&(clearTimeout(t),t=setTimeout(s,100))}})(),Pf=(function(){let i;return function(t){let e=Jr[t];if(e==null){if(Ks){const n=Ir(t),s=kl(t,"Žg");e=(isNaN(Number(n.lineHeight))?1.2:Number(n.lineHeight))*(s.actualBoundingBoxAscent+s.actualBoundingBoxDescent)}else i||(i=document.createElement("div"),i.innerHTML="M",i.style.minHeight="0",i.style.maxHeight="none",i.style.height="auto",i.style.padding="0",i.style.border="none",i.style.position="absolute",i.style.display="block",i.style.left="-99999px"),i.style.font=t,document.body.appendChild(i),e=i.offsetHeight,document.body.removeChild(i);Jr[t]=e}return e}})();function kl(i,t){return xi||(xi=ft(1,1)),i!=Al&&(xi.font=i,Al=xi.font),xi.measureText(t)}function Ol(i,t){return kl(i,t).width}function Pl(i,t,e){if(t in e)return e[t];const n=t.split(`
|
|
6
|
+
`).reduce((s,r)=>Math.max(s,Ol(i,r)),0);return e[t]=n,n}function Df(i,t){const e=[],n=[],s=[];let r=0,o=0,a=0,l=0;for(let h=0,c=t.length;h<=c;h+=2){const u=t[h];if(u===`
|
|
7
|
+
`||h===c){r=Math.max(r,o),s.push(o),o=0,a+=l,l=0;continue}const d=t[h+1]||i.font,f=Ol(d,u);e.push(f),o+=f;const _=Pf(d);n.push(_),l=Math.max(l,_)}return{width:r,height:a,widths:e,heights:n,lineWidths:s}}function Ff(i,t,e,n,s,r,o,a,l,h,c){i.save(),e!==1&&(i.globalAlpha===void 0?i.globalAlpha=u=>u.globalAlpha*=e:i.globalAlpha*=e),t&&i.transform.apply(i,t),n.contextInstructions?(i.translate(l,h),i.scale(c[0],c[1]),zf(n,i)):c[0]<0||c[1]<0?(i.translate(l,h),i.scale(c[0],c[1]),i.drawImage(n,s,r,o,a,0,0,o,a)):i.drawImage(n,s,r,o,a,l,h,o*c[0],a*c[1]),i.restore()}function zf(i,t){const e=i.contextInstructions;for(let n=0,s=e.length;n<s;n+=2)Array.isArray(e[n+1])?t[e[n]].apply(t,e[n+1]):t[e[n]]=e[n+1]}class ms{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=Ft(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new ms({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 J()}getImage(t){return J()}getHitDetectionImage(){return J()}getPixelRatio(t){return 1}getImageState(){return J()}getImageSize(){return J()}getOrigin(){return J()}getSize(){return J()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Ft(t)}listenImageChange(t){J()}load(){J()}unlistenImageChange(t){J()}ready(){return Promise.resolve()}}class ps extends ms{constructor(t){super({opacity:1,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,rotation:t.rotation!==void 0?t.rotation:0,scale:t.scale!==void 0?t.scale:1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=t.fill!==void 0?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=t.angle!==void 0?t.angle:0,this.stroke_=t.stroke!==void 0?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?Z.LOADING:Z.LOADED,this.imageState_===Z.LOADING&&this.ready().then(()=>this.imageState_=Z.LOADED),this.render()}clone(){const t=this.getScale(),e=new ps({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const e=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(",");let s=Vt.get(n,null,null)?.getImage(1);if(!s){const r=this.renderOptions_,o=Math.ceil(r.size*t),a=ft(o,o);this.draw_(r,a,t),s=a.canvas,Vt.set(n,null,null,new Ml(s,void 0,null,Z.LOADED,null))}return s}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(e===0||this.points_===1/0||t!=="bevel"&&t!=="miter")return e;let s=this.radius,r=this.radius2_===void 0?s:this.radius2_;if(s<r){const R=s;s=r,r=R}const o=this.radius2_===void 0?this.points_:this.points_*2,a=2*Math.PI/o,l=r*Math.sin(a),h=Math.sqrt(r*r-l*l),c=s-h,u=Math.sqrt(l*l+c*c),d=u/l;if(t==="miter"&&d<=n)return d*e;const f=e/2/d,_=e/2*(c/u),m=Math.sqrt((s+f)*(s+f)+_*_)-s;if(this.radius2_===void 0||t==="bevel")return m*2;const y=s*Math.sin(a),x=Math.sqrt(s*s-y*y),v=r-x,C=Math.sqrt(y*y+v*v)/y;if(C<=n){const R=C*e/2-r-s;return 2*Math.max(m,R)}return m*2}createRenderOptions(){let t=In,e=Mn,n=0,s=null,r=0,o,a=0;this.stroke_&&(o=re(this.stroke_.getColor()??mi),a=this.stroke_.getWidth()??yi,s=this.stroke_.getLineDash(),r=this.stroke_.getLineDashOffset()??0,e=this.stroke_.getLineJoin()??Mn,t=this.stroke_.getLineCap()??In,n=this.stroke_.getMiterLimit()??_i);const l=this.calculateLineJoinSize_(e,a,n),h=Math.max(this.radius,this.radius2_||0),c=Math.ceil(2*h+l);return{strokeStyle:o,strokeWidth:a,size:c,lineCap:t,lineDash:s,lineDashOffset:r,lineJoin:e,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let s=this.fill_.getColor();s===null&&(s=Nt),e.fillStyle=re(s),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor(),s=0;typeof n=="string"&&(n=Rn(n)),n===null?s=1:Array.isArray(n)&&(s=n.length===4?n[3]:1),s===0&&(e=ft(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const s=this.radius2_===void 0?n:this.radius2_;this.radius2_!==void 0&&(e*=2);const r=this.angle_-Math.PI/2,o=2*Math.PI/e;for(let a=0;a<e;a++){const l=r+a*o,h=a%2===0?n:s;t.lineTo(h*Math.cos(l),h*Math.sin(l))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=Nt,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class ys extends ps{constructor(t){t=t||{radius:5},super({points:1/0,fill:t.fill,radius:t.radius,stroke:t.stroke,scale:t.scale!==void 0?t.scale:1,rotation:t.rotation!==void 0?t.rotation:0,rotateWithView:t.rotateWithView!==void 0?t.rotateWithView:!1,displacement:t.displacement!==void 0?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new ys({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}class wi{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,t.color!==void 0&&this.setColor(t.color)}clone(){const t=this.getColor();return new wi({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(t!==null&&typeof t=="object"&&"src"in t){const e=qr(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),e.getImageState()===Z.IDLE&&e.load(),e.getImageState()===Z.LOADING&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?Q(t):typeof t=="object"&&"src"in t?t.src+":"+t.offset:Rn(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function Dl(i,t,e,n){return e!==void 0&&n!==void 0?[e/i,n/t]:e!==void 0?e/i:n!==void 0?n/t:1}class Ei extends ms{constructor(t){t=t||{};const e=t.opacity!==void 0?t.opacity:1,n=t.rotation!==void 0?t.rotation:0,s=t.scale!==void 0?t.scale:1,r=t.rotateWithView!==void 0?t.rotateWithView:!1;super({opacity:e,rotation:n,scale:s,displacement:t.displacement!==void 0?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=t.anchor!==void 0?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=t.anchorOrigin!==void 0?t.anchorOrigin:"top-left",this.anchorXUnits_=t.anchorXUnits!==void 0?t.anchorXUnits:"fraction",this.anchorYUnits_=t.anchorYUnits!==void 0?t.anchorYUnits:"fraction",this.crossOrigin_=t.crossOrigin!==void 0?t.crossOrigin:null;const o=t.img!==void 0?t.img:null;let a=t.src;et(!(a!==void 0&&o),"`image` and `src` cannot be provided at the same time"),(a===void 0||a.length===0)&&o&&(a=o.src||Q(o)),et(a!==void 0&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),et(!((t.width!==void 0||t.height!==void 0)&&t.scale!==void 0),"`width` or `height` cannot be provided together with `scale`");let l;if(t.src!==void 0?l=Z.IDLE:o!==void 0&&("complete"in o?o.complete?l=o.src?Z.LOADED:Z.IDLE:l=Z.LOADING:l=Z.LOADED),this.color_=t.color!==void 0?Rn(t.color):null,this.iconImage_=qr(o,a,this.crossOrigin_,l,this.color_),this.offset_=t.offset!==void 0?t.offset:[0,0],this.offsetOrigin_=t.offsetOrigin!==void 0?t.offsetOrigin:"top-left",this.origin_=null,this.size_=t.size!==void 0?t.size:null,this.initialOptions_,t.width!==void 0||t.height!==void 0){let h,c;if(t.size)[h,c]=t.size;else{const u=this.getImage(1);if(u.width&&u.height)h=u.width,c=u.height;else if(u instanceof HTMLImageElement){this.initialOptions_=t;const d=()=>{if(this.unlistenImageChange(d),!this.initialOptions_)return;const f=this.iconImage_.getSize();this.setScale(Dl(f[0],f[1],t.width,t.height))};this.listenImageChange(d);return}}h!==void 0&&this.setScale(Dl(h,c,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new Ei({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:this.size_!==null?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const s=this.getSize();if(this.anchorXUnits_=="fraction"||this.anchorYUnits_=="fraction"){if(!s)return null;t=this.anchor_.slice(),this.anchorXUnits_=="fraction"&&(t[0]*=s[0]),this.anchorYUnits_=="fraction"&&(t[1]*=s[1])}if(this.anchorOrigin_!="top-left"){if(!s)return null;t===this.anchor_&&(t=this.anchor_.slice()),(this.anchorOrigin_=="top-right"||this.anchorOrigin_=="bottom-right")&&(t[0]=-t[0]+s[0]),(this.anchorOrigin_=="bottom-left"||this.anchorOrigin_=="bottom-right")&&(t[1]=-t[1]+s[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if(this.offsetOrigin_!="top-left"){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),(this.offsetOrigin_=="top-right"||this.offsetOrigin_=="bottom-right")&&(t[0]=n[0]-e[0]-t[0]),(this.offsetOrigin_=="bottom-left"||this.offsetOrigin_=="bottom-right")&&(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();if(this.size_)return this.size_[0]*t[0];if(this.iconImage_.getImageState()==Z.LOADED)return this.iconImage_.getSize()[0]*t[0]}getHeight(){const t=this.getScaleArray();if(this.size_)return this.size_[1]*t[1];if(this.iconImage_.getImageState()==Z.LOADED)return this.iconImage_.getSize()[1]*t[1]}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(Y.CHANGE,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(Y.CHANGE,t)}ready(){return this.iconImage_.ready()}}class xs{constructor(t){t=t||{},this.color_=t.color!==void 0?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=t.lineDash!==void 0?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new xs({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class De{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=zl,t.geometry!==void 0&&this.setGeometry(t.geometry),this.fill_=t.fill!==void 0?t.fill:null,this.image_=t.image!==void 0?t.image:null,this.renderer_=t.renderer!==void 0?t.renderer:null,this.hitDetectionRenderer_=t.hitDetectionRenderer!==void 0?t.hitDetectionRenderer:null,this.stroke_=t.stroke!==void 0?t.stroke:null,this.text_=t.text!==void 0?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&typeof t=="object"&&(t=t.clone()),new De({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){typeof t=="function"?this.geometryFunction_=t:typeof t=="string"?this.geometryFunction_=function(e){return e.get(t)}:t?t!==void 0&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=zl,this.geometry_=t}setZIndex(t){this.zIndex_=t}}function Nf(i){let t;if(typeof i=="function")t=i;else{let e;Array.isArray(i)?e=i:(et(typeof i.getZIndex=="function","Expected an `Style` or an array of `Style`"),e=[i]),t=function(){return e}}return t}let Qr=null;function Fl(i,t){if(!Qr){const e=new wi({color:"rgba(255,255,255,0.4)"}),n=new xs({color:"#3399CC",width:1.25});Qr=[new De({image:new ys({fill:e,stroke:n,radius:5}),fill:e,stroke:n})]}return Qr}function zl(i){return i.getGeometry()}const Gf="#333";class to{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=Ft(t.scale!==void 0?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=t.fill!==void 0?t.fill:new wi({color:Gf}),this.maxAngle_=t.maxAngle!==void 0?t.maxAngle:Math.PI/4,this.placement_=t.placement!==void 0?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=t.stroke!==void 0?t.stroke:null,this.offsetX_=t.offsetX!==void 0?t.offsetX:0,this.offsetY_=t.offsetY!==void 0?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=t.padding===void 0?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new to({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(t)?t.slice():t,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=Ft(t!==void 0?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function Wf(i){return!0}function Uf(i){const t=vl(),e=Xf(i,t),n=Il();return function(s,r){if(n.properties=s.getPropertiesInternal(),n.resolution=r,t.featureId){const o=s.getId();o!==void 0?n.featureId=o:n.featureId=null}return t.geometryType&&(n.geometryType=Tl(s.getGeometry())),e(n)}}function Nl(i){const t=vl(),e=i.length,n=new Array(e);for(let o=0;o<e;++o)n[o]=eo(i[o],t);const s=Il(),r=new Array(e);return function(o,a){if(s.properties=o.getPropertiesInternal(),s.resolution=a,t.featureId){const h=o.getId();h!==void 0?s.featureId=h:s.featureId=null}let l=0;for(let h=0;h<e;++h){const c=n[h](s);c&&(r[l]=c,l+=1)}return r.length=l,r}}function Xf(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s){const r=i[s],o="filter"in r?_e(r.filter,Mt,t):Wf;let a;if(Array.isArray(r.style)){const l=r.style.length;a=new Array(l);for(let h=0;h<l;++h)a[h]=eo(r.style[h],t)}else a=[eo(r.style,t)];n[s]={filter:o,styles:a}}return function(s){const r=[];let o=!1;for(let a=0;a<e;++a){const l=n[a].filter;if(l(s)&&!(i[a].else&&o)){o=!0;for(const h of n[a].styles){const c=h(s);c&&r.push(c)}}}return r}}function eo(i,t){const e=Ci(i,"",t),n=vi(i,"",t),s=Bf(i,t),r=Yf(i,t),o=Gt(i,"z-index",t);if(!e&&!n&&!s&&!r&&!un(i))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(i));const a=new De;return function(l){let h=!0;if(e){const c=e(l);c&&(h=!1),a.setFill(c)}if(n){const c=n(l);c&&(h=!1),a.setStroke(c)}if(s){const c=s(l);c&&(h=!1),a.setText(c)}if(r){const c=r(l);c&&(h=!1),a.setImage(c)}return o&&a.setZIndex(o(l)),h?null:a}}function Ci(i,t,e){let n;if(t+"fill-pattern-src"in i)n=jf(i,t+"fill-",e);else{if(i[t+"fill-color"]==="none")return r=>null;n=no(i,t+"fill-color",e)}if(!n)return null;const s=new wi;return function(r){const o=n(r);return o===Gr?null:(s.setColor(o),s)}}function vi(i,t,e){const n=Gt(i,t+"stroke-width",e),s=no(i,t+"stroke-color",e);if(!n&&!s)return null;const r=ye(i,t+"stroke-line-cap",e),o=ye(i,t+"stroke-line-join",e),a=Gl(i,t+"stroke-line-dash",e),l=Gt(i,t+"stroke-line-dash-offset",e),h=Gt(i,t+"stroke-miter-limit",e),c=new xs;return function(u){if(s){const d=s(u);if(d===Gr)return null;c.setColor(d)}if(n&&c.setWidth(n(u)),r){const d=r(u);if(d!=="butt"&&d!=="round"&&d!=="square")throw new Error("Expected butt, round, or square line cap");c.setLineCap(d)}if(o){const d=o(u);if(d!=="bevel"&&d!=="round"&&d!=="miter")throw new Error("Expected bevel, round, or miter line join");c.setLineJoin(d)}return a&&c.setLineDash(a(u)),l&&c.setLineDashOffset(l(u)),h&&c.setMiterLimit(h(u)),c}}function Bf(i,t){const e="text-",n=ye(i,e+"value",t);if(!n)return null;const s=Ci(i,e,t),r=Ci(i,e+"background-",t),o=vi(i,e,t),a=vi(i,e+"background-",t),l=ye(i,e+"font",t),h=Gt(i,e+"max-angle",t),c=Gt(i,e+"offset-x",t),u=Gt(i,e+"offset-y",t),d=An(i,e+"overflow",t),f=ye(i,e+"placement",t),_=Gt(i,e+"repeat",t),p=Es(i,e+"scale",t),m=An(i,e+"rotate-with-view",t),y=Gt(i,e+"rotation",t),x=ye(i,e+"align",t),v=ye(i,e+"justify",t),E=ye(i,e+"baseline",t),C=An(i,e+"keep-upright",t),R=Gl(i,e+"padding",t),I=vs(i,e+"declutter-mode"),T=new to({declutterMode:I});return function(S){if(T.setText(n(S)),s&&T.setFill(s(S)),r&&T.setBackgroundFill(r(S)),o&&T.setStroke(o(S)),a&&T.setBackgroundStroke(a(S)),l&&T.setFont(l(S)),h&&T.setMaxAngle(h(S)),c&&T.setOffsetX(c(S)),u&&T.setOffsetY(u(S)),d&&T.setOverflow(d(S)),f){const L=f(S);if(L!=="point"&&L!=="line")throw new Error("Expected point or line for text-placement");T.setPlacement(L)}if(_&&T.setRepeat(_(S)),p&&T.setScale(p(S)),m&&T.setRotateWithView(m(S)),y&&T.setRotation(y(S)),x){const L=x(S);if(L!=="left"&&L!=="center"&&L!=="right"&&L!=="end"&&L!=="start")throw new Error("Expected left, right, center, start, or end for text-align");T.setTextAlign(L)}if(v){const L=v(S);if(L!=="left"&&L!=="right"&&L!=="center")throw new Error("Expected left, right, or center for text-justify");T.setJustify(L)}if(E){const L=E(S);if(L!=="bottom"&&L!=="top"&&L!=="middle"&&L!=="alphabetic"&&L!=="hanging")throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");T.setTextBaseline(L)}return R&&T.setPadding(R(S)),C&&T.setKeepUpright(C(S)),T}}function Yf(i,t){return"icon-src"in i?Vf(i,t):"shape-points"in i?Kf(i,t):"circle-radius"in i?Zf(i,t):null}function Vf(i,t){const e="icon-",n=e+"src",s=Bl(i[n],n),r=ws(i,e+"anchor",t),o=Es(i,e+"scale",t),a=Gt(i,e+"opacity",t),l=ws(i,e+"displacement",t),h=Gt(i,e+"rotation",t),c=An(i,e+"rotate-with-view",t),u=Ul(i,e+"anchor-origin"),d=Xl(i,e+"anchor-x-units"),f=Xl(i,e+"anchor-y-units"),_=Jf(i,e+"color"),p=$f(i,e+"cross-origin"),m=qf(i,e+"offset"),y=Ul(i,e+"offset-origin"),x=Cs(i,e+"width"),v=Cs(i,e+"height"),E=Hf(i,e+"size"),C=vs(i,e+"declutter-mode"),R=new Ei({src:s,anchorOrigin:u,anchorXUnits:d,anchorYUnits:f,color:_,crossOrigin:p,offset:m,offsetOrigin:y,height:v,width:x,size:E,declutterMode:C});return function(I){return a&&R.setOpacity(a(I)),l&&R.setDisplacement(l(I)),h&&R.setRotation(h(I)),c&&R.setRotateWithView(c(I)),o&&R.setScale(o(I)),r&&R.setAnchor(r(I)),R}}function Kf(i,t){const e="shape-",n=e+"points",s=e+"radius",r=io(i[n],n),o=io(i[s],s),a=Ci(i,e,t),l=vi(i,e,t),h=Es(i,e+"scale",t),c=ws(i,e+"displacement",t),u=Gt(i,e+"rotation",t),d=An(i,e+"rotate-with-view",t),f=Cs(i,e+"radius2"),_=Cs(i,e+"angle"),p=vs(i,e+"declutter-mode"),m=new ps({points:r,radius:o,radius2:f,angle:_,declutterMode:p});return function(y){return a&&m.setFill(a(y)),l&&m.setStroke(l(y)),c&&m.setDisplacement(c(y)),u&&m.setRotation(u(y)),d&&m.setRotateWithView(d(y)),h&&m.setScale(h(y)),m}}function Zf(i,t){const e="circle-",n=Ci(i,e,t),s=vi(i,e,t),r=Gt(i,e+"radius",t),o=Es(i,e+"scale",t),a=ws(i,e+"displacement",t),l=Gt(i,e+"rotation",t),h=An(i,e+"rotate-with-view",t),c=vs(i,e+"declutter-mode"),u=new ys({radius:5,declutterMode:c});return function(d){return r&&u.setRadius(r(d)),n&&u.setFill(n(d)),s&&u.setStroke(s(d)),a&&u.setDisplacement(a(d)),l&&u.setRotation(l(d)),h&&u.setRotateWithView(h(d)),o&&u.setScale(o(d)),u}}function Gt(i,t,e){if(!(t in i))return;const n=_e(i[t],$,e);return function(s){return io(n(s),t)}}function ye(i,t,e){if(!(t in i))return null;const n=_e(i[t],zt,e);return function(s){return Bl(n(s),t)}}function jf(i,t,e){const n=ye(i,t+"pattern-src",e),s=Wl(i,t+"pattern-offset",e),r=Wl(i,t+"pattern-size",e),o=no(i,t+"color",e);return function(a){return{src:n(a),offset:s&&s(a),size:r&&r(a),color:o&&o(a)}}}function An(i,t,e){if(!(t in i))return null;const n=_e(i[t],Mt,e);return function(s){const r=n(s);if(typeof r!="boolean")throw new Error(`Expected a boolean for ${t}`);return r}}function no(i,t,e){if(!(t in i))return null;const n=_e(i[t],Qt,e);return function(s){return Yl(n(s),t)}}function Gl(i,t,e){if(!(t in i))return null;const n=_e(i[t],en,e);return function(s){return bi(n(s),t)}}function ws(i,t,e){if(!(t in i))return null;const n=_e(i[t],en,e);return function(s){const r=bi(n(s),t);if(r.length!==2)throw new Error(`Expected two numbers for ${t}`);return r}}function Wl(i,t,e){if(!(t in i))return null;const n=_e(i[t],en,e);return function(s){return Vl(n(s),t)}}function Es(i,t,e){if(!(t in i))return null;const n=_e(i[t],en|$,e);return function(s){return Qf(n(s),t)}}function Cs(i,t){const e=i[t];if(e!==void 0){if(typeof e!="number")throw new Error(`Expected a number for ${t}`);return e}}function Hf(i,t){const e=i[t];if(e!==void 0){if(typeof e=="number")return Ft(e);if(!Array.isArray(e))throw new Error(`Expected a number or size array for ${t}`);if(e.length!==2||typeof e[0]!="number"||typeof e[1]!="number")throw new Error(`Expected a number or size array for ${t}`);return e}}function $f(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);return e}}function Ul(i,t){const e=i[t];if(e!==void 0){if(e!=="bottom-left"&&e!=="bottom-right"&&e!=="top-left"&&e!=="top-right")throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${t}`);return e}}function Xl(i,t){const e=i[t];if(e!==void 0){if(e!=="pixels"&&e!=="fraction")throw new Error(`Expected pixels or fraction for ${t}`);return e}}function qf(i,t){const e=i[t];if(e!==void 0)return bi(e,t)}function vs(i,t){const e=i[t];if(e!==void 0){if(typeof e!="string")throw new Error(`Expected a string for ${t}`);if(e!=="declutter"&&e!=="obstacle"&&e!=="none")throw new Error(`Expected declutter, obstacle, or none for ${t}`);return e}}function Jf(i,t){const e=i[t];if(e!==void 0)return Yl(e,t)}function bi(i,t){if(!Array.isArray(i))throw new Error(`Expected an array for ${t}`);const e=i.length;for(let n=0;n<e;++n)if(typeof i[n]!="number")throw new Error(`Expected an array of numbers for ${t}`);return i}function Bl(i,t){if(typeof i!="string")throw new Error(`Expected a string for ${t}`);return i}function io(i,t){if(typeof i!="number")throw new Error(`Expected a number for ${t}`);return i}function Yl(i,t){if(typeof i=="string")return i;const e=bi(i,t),n=e.length;if(n<3||n>4)throw new Error(`Expected a color with 3 or 4 values for ${t}`);return e}function Vl(i,t){const e=bi(i,t);if(e.length!==2)throw new Error(`Expected an array of two numbers for ${t}`);return e}function Qf(i,t){return typeof i=="number"?i:Vl(i,t)}const Kl={RENDER_ORDER:"renderOrder"};class Zl extends cs{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=t.renderBuffer!==void 0?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=t.updateWhileAnimating!==void 0?t.updateWhileAnimating:!1,this.updateWhileInteracting_=t.updateWhileInteracting!==void 0?t.updateWhileInteracting:!1}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(Kl.RENDER_ORDER)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter||(t.declutter[n]=new yl(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(Kl.RENDER_ORDER,t)}setStyle(t){this.style_=t===void 0?Fl:t;const e=tg(t);this.styleFunction_=t===null?void 0:Nf(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}function tg(i){if(i===void 0)return Fl;if(!i)return null;if(typeof i=="function"||i instanceof De)return i;if(!Array.isArray(i))return Nl([i]);if(i.length===0)return[];const t=i.length,e=i[0];if(e instanceof De){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!(o instanceof De))throw new Error("Expected a list of style instances");s[r]=o}return s}if("style"in e){const s=new Array(t);for(let r=0;r<t;++r){const o=i[r];if(!("style"in o))throw new Error("Expected a list of rules with a style property");s[r]=o}return Uf(s)}return Nl(i)}class jl extends de{constructor(t,e,n,s){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=s}}class eg extends Fi{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){J()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,s=t.pixelToCoordinateTransform;ge(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),Ba(s,n)}forEachFeatureAtCoordinate(t,e,n,s,r,o,a,l){let h;const c=e.viewState;function u(E,C,R,I){return r.call(o,C,E?R:null,I)}const d=c.projection,f=va(t.slice(),d),_=[[0,0]];if(d.canWrapX()&&s){const E=d.getExtent(),C=it(E);_.push([-C,0],[C,0])}const p=e.layerStatesArray,m=p.length,y=[],x=[];for(let E=0;E<_.length;E++)for(let C=m-1;C>=0;--C){const R=p[C],I=R.layer;if(I.hasRenderer()&&Fr(R,c)&&a.call(l,I)){const T=I.getRenderer(),S=I.getSource();if(T&&S){const L=S.getWrapX()?f:t,O=u.bind(null,R.managed);x[0]=L[0]+_[E][0],x[1]=L[1]+_[E][1],h=T.forEachFeatureAtCoordinate(x,e,n,O,y)}if(h)return h}}if(y.length===0)return;const v=1/y.length;return y.forEach((E,C)=>E.distanceSq+=C*v),y.sort((E,C)=>E.distanceSq-C.distanceSq),y.some(E=>h=E.callback(E.feature,E.layer,E.geometry)),h}hasFeatureAtCoordinate(t,e,n,s,r,o){return this.forEachFeatureAtCoordinate(t,e,n,s,Vn,this,r,o)!==void 0}getMap(){return this.map_}renderFrame(t){J()}scheduleExpireIconCache(t){Vt.canExpireCache()&&t.postRenderFunctions.push(ng)}}function ng(i,t){Vt.expire()}class ig extends eg{constructor(t){super(t),this.fontChangeListenerKey_=q(Ln,cn.PROPERTYCHANGE,t.redrawText,t),this.element_=document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=as+" ol-layers";const n=t.getViewport();n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const s=new jl(t,void 0,e);n.dispatchEvent(s)}}disposeInternal(){at(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t){this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1);return}this.calculateMatrices2D(t),this.dispatchRenderEvent(Yt.PRECOMPOSE,t);const e=t.layerStatesArray.sort((a,l)=>a.zIndex-l.zIndex);e.some(a=>a.layer instanceof Zl&&a.layer.getDeclutter())&&(t.declutter={});const s=t.viewState;this.children_.length=0;const r=[];let o=null;for(let a=0,l=e.length;a<l;++a){const h=e[a];t.layerIndex=a;const c=h.layer,u=c.getSourceState();if(!Fr(h,s)||u!="ready"&&u!="undefined"){c.unrender();continue}const d=c.render(t,o);d&&(d!==o&&(this.children_.push(d),o=d),r.push(h))}this.declutter(t,r),dd(this.element_,this.children_),this.dispatchRenderEvent(Yt.POSTCOMPOSE,t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const s=e[n],r=s.layer;r.getDeclutter()&&r.renderDeclutter(t,s)}e.forEach(n=>n.layer.renderDeferred(t))}}}function Hl(i){if(i instanceof cs){i.setMapInternal(null);return}i instanceof vn&&i.getLayers().forEach(Hl)}function $l(i,t){if(i instanceof cs){i.setMapInternal(t);return}if(i instanceof vn){const e=i.getLayers().getArray();for(let n=0,s=e.length;n<s;++n)$l(e[n],t)}}let sg=class extends ne{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=rg(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=t.maxTilesLoading!==void 0?t.maxTilesLoading:16,this.pixelRatio_=t.pixelRatio!==void 0?t.pixelRatio:Fc,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=Jt(),this.pixelToCoordinateTransform_=Jt(),this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,this.resizeObserver_=new ResizeObserver(()=>this.updateSize()),this.controls=e.controls||md(),this.interactions=e.interactions||Nd({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new Gc(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(bt.LAYERGROUP,this.handleLayerGroupChanged_),this.addChangeListener(bt.VIEW,this.handleViewChanged_),this.addChangeListener(bt.SIZE,this.handleSizeChanged_),this.addChangeListener(bt.TARGET,this.handleTargetChanged_),this.setProperties(e.values);const n=this;t.view&&!(t.view instanceof se)&&t.view.then(function(s){n.setView(new se(s))}),this.controls.addEventListener(Ot.ADD,s=>{s.element.setMap(this)}),this.controls.addEventListener(Ot.REMOVE,s=>{s.element.setMap(null)}),this.interactions.addEventListener(Ot.ADD,s=>{s.element.setMap(this)}),this.interactions.addEventListener(Ot.REMOVE,s=>{s.element.setMap(null)}),this.overlays_.addEventListener(Ot.ADD,s=>{this.addOverlayInternal_(s.element)}),this.overlays_.addEventListener(Ot.REMOVE,s=>{const r=s.element.getId();r!==void 0&&delete this.overlayIdIndex_[r.toString()],s.element.setMap(null)}),this.controls.forEach(s=>{s.setMap(this)}),this.interactions.forEach(s=>{s.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){$l(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();e!==void 0&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const s=this.getCoordinateFromPixelInternal(t);n=n!==void 0?n:{};const r=n.hitTolerance!==void 0?n.hitTolerance:0,o=n.layerFilter!==void 0?n.layerFilter:Vn,a=n.checkWrapped!==!1;return this.renderer_.forEachFeatureAtCoordinate(s,this.frameState_,r,a,e,null,o,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(s){n.push(s)},e),n}getAllLayers(){const t=[];function e(n){n.forEach(function(s){s instanceof vn?e(s.getLayers()):t.push(s)})}return e(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t);e=e!==void 0?e:{};const s=e.layerFilter!==void 0?e.layerFilter:Vn,r=e.hitTolerance!==void 0?e.hitTolerance:0,o=e.checkWrapped!==!1;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,o,s,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const n=this.viewport_.getBoundingClientRect(),s=this.getSize(),r=n.width/s[0],o=n.height/s[1],a="changedTouches"in t?t.changedTouches[0]:t;return[(a.clientX-n.left)/r,(a.clientY-n.top)/o]}getTarget(){return this.get(bt.TARGET)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return _r(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?yt(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return e!==void 0?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(bt.LAYERGROUP)}setLayers(t){const e=this.getLayerGroup();if(t instanceof ie){e.setLayers(t);return}const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const s=t[e];if(!s.visible)continue;const r=s.layer.getRenderer();if(r&&!r.ready)return!0;const o=s.layer.getSource();if(o&&o.loading)return!0}return!1}getPixelFromCoordinate(t){const e=fe(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?yt(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(bt.SIZE)}getView(){return this.get(bt.VIEW)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,s){return Wc(this.frameState_,t,e,n,s)}handleBrowserEvent(t,e){e=e||t.type;const n=new Te(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if(n===Zs.POINTERDOWN||n===Y.WHEEL||n===Y.KEYDOWN){const s=this.getOwnerDocument(),r=this.viewport_.getRootNode?this.viewport_.getRootNode():s,o=e.target,a=r instanceof ShadowRoot?r.host===o?r.host.ownerDocument:r:r===s?s.documentElement:r;if(this.overlayContainerStopEvent_.contains(o)||!a.contains(o))return}if(t.frameState=this.frameState_,this.dispatchEvent(t)!==!1){const s=this.getInteractions().getArray().slice();for(let r=s.length-1;r>=0;r--){const o=s[r];if(o.getMap()!==this||!o.getActive()||!this.getTargetElement())continue;if(!o.handleEvent(t)||t.propagationStopped)break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let s=this.maxTilesLoading_,r=s;if(t){const o=t.viewHints;if(o[St.ANIMATING]||o[St.INTERACTING]){const a=Date.now()-t.time>8;s=a?0:8,r=a?0:2}}e.getTilesLoading()<s&&(e.reprioritize(),e.loadMoreTiles(s,r))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(Yt.RENDERCOMPLETE)&&this.renderer_.dispatchRenderEvent(Yt.RENDERCOMPLETE,t),this.loaded_===!1&&(this.loaded_=!0,this.dispatchEvent(new dn(Ie.LOADEND,this,t)))):this.loaded_===!0&&(this.loaded_=!1,this.dispatchEvent(new dn(Ie.LOADSTART,this,t))));const n=this.postRenderFunctions_;if(t)for(let s=0,r=n.length;s<r;++s)n[s](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let n=0,s=this.targetChangeHandlerKeys_.length;n<s;++n)at(this.targetChangeHandlerKeys_[n]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(Y.CONTEXTMENU,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(Y.WHEEL,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);const n=this.targetElement_.getRootNode();n instanceof ShadowRoot&&this.resizeObserver_.unobserve(n.host),this.setSize(void 0)}const t=this.getTarget(),e=typeof t=="string"?document.getElementById(t):t;if(this.targetElement_=e,!e)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{e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new ig(this)),this.mapBrowserEventHandler_=new zc(this,this.moveTolerance_);for(const r in ct)this.mapBrowserEventHandler_.addEventListener(ct[r],this.handleMapBrowserEvent.bind(this));this.viewport_.addEventListener(Y.CONTEXTMENU,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(Y.WHEEL,this.boundHandleBrowserEvent_,ca?{passive:!1}:!1);let n;if(this.keyboardEventTarget_)n=this.keyboardEventTarget_;else{const r=e.getRootNode();n=r instanceof ShadowRoot?r.host:e}this.targetChangeHandlerKeys_=[q(n,Y.KEYDOWN,this.handleBrowserEvent,this),q(n,Y.KEYPRESS,this.handleBrowserEvent,this)];const s=e.getRootNode();s instanceof ShadowRoot&&this.resizeObserver_.observe(s.host),this.resizeObserver_.observe(e)}this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(at(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(at(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=q(t,cn.PROPERTYCHANGE,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=q(t,Y.CHANGE,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(at),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new Oe("addlayer",t)),this.layerGroupPropertyListenerKeys_=[q(t,cn.PROPERTYCHANGE,this.render,this),q(t,Y.CHANGE,this.render,this),q(t,"addlayer",this.handleLayerAdd_,this),q(t,"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;const t=this.frameState_.layerStatesArray;for(let e=0,n=t.length;e<n;++e){const s=t[e].layer;s.hasRenderer()&&s.getRenderer().handleFontsChanged()}}render(){this.renderer_&&this.animationDelayKey_===void 0&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){Hl(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),s=this.frameState_;let r=null;if(e!==void 0&&Cl(e)&&n&&n.isDef()){const o=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),a=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:Qs(a.center,a.resolution,a.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:a,viewHints:o,wantedTiles:{},mapId:Q(this),renderTargets:{}},a.nextCenter&&a.nextResolution){const l=isNaN(a.nextRotation)?a.rotation:a.nextRotation;r.nextExtent=Qs(a.nextCenter,a.nextResolution,l,e)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),s&&(!this.previousExtent_||!Hi(this.previousExtent_)&&!$n(r.extent,this.previousExtent_))&&(this.dispatchEvent(new dn(Ie.MOVESTART,this,s)),this.previousExtent_=Vi(this.previousExtent_)),this.previousExtent_&&!r.viewHints[St.ANIMATING]&&!r.viewHints[St.INTERACTING]&&!$n(r.extent,this.previousExtent_)&&(this.dispatchEvent(new dn(Ie.MOVEEND,this,r)),ga(r.extent,this.previousExtent_))),this.dispatchEvent(new dn(Ie.POSTRENDER,this,r)),this.renderComplete_=(this.hasListener(Ie.LOADSTART)||this.hasListener(Ie.LOADEND)||this.hasListener(Yt.RENDERCOMPLETE))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new Oe("removelayer",e)),this.set(bt.LAYERGROUP,t)}setSize(t){this.set(bt.SIZE,t)}setTarget(t){this.set(bt.TARGET,t)}setView(t){if(!t||t instanceof se){this.set(bt.VIEW,t);return}this.set(bt.VIEW,new se);const e=this;t.then(function(n){e.setView(new se(n))})}updateSize(){const t=this.getTargetElement();let e;if(t){const s=getComputedStyle(t),r=t.offsetWidth-parseFloat(s.borderLeftWidth)-parseFloat(s.paddingLeft)-parseFloat(s.paddingRight)-parseFloat(s.borderRightWidth),o=t.offsetHeight-parseFloat(s.borderTopWidth)-parseFloat(s.paddingTop)-parseFloat(s.paddingBottom)-parseFloat(s.borderBottomWidth);!isNaN(r)&&!isNaN(o)&&(e=[Math.max(0,r),Math.max(0,o)],!Cl(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&Ra("No map visible because the map container's width or height are 0."))}const n=this.getSize();e&&(!n||!Re(e,n))&&(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};function rg(i){let t=null;i.keyboardEventTarget!==void 0&&(t=typeof i.keyboardEventTarget=="string"?document.getElementById(i.keyboardEventTarget):i.keyboardEventTarget);const e={},n=i.layers&&typeof i.layers.getLayers=="function"?i.layers:new vn({layers:i.layers});e[bt.LAYERGROUP]=n,e[bt.TARGET]=i.target,e[bt.VIEW]=i.view instanceof se?i.view:new se;let s;i.controls!==void 0&&(Array.isArray(i.controls)?s=new ie(i.controls.slice()):(et(typeof i.controls.getArray=="function","Expected `controls` to be an array or an `ol/Collection.js`"),s=i.controls));let r;i.interactions!==void 0&&(Array.isArray(i.interactions)?r=new ie(i.interactions.slice()):(et(typeof i.interactions.getArray=="function","Expected `interactions` to be an array or an `ol/Collection.js`"),r=i.interactions));let o;return i.overlays!==void 0?Array.isArray(i.overlays)?o=new ie(i.overlays.slice()):(et(typeof i.overlays.getArray=="function","Expected `overlays` to be an array or an `ol/Collection.js`"),o=i.overlays):o=new ie,{controls:s,interactions:r,keyboardEventTarget:t,overlays:o,values:e}}class so extends Ni{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(Y.CHANGE)}release(){this.setState(G.EMPTY)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(this.state!==G.EMPTY){if(this.state!==G.ERROR&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){J()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(!n)n=e,this.transitionStarts_[t]=n;else if(n===-1)return 1;const s=e-n+1e3/60;return s>=this.transition_?1:ba(s/this.transition_)}inTransition(t){return this.transition_?this.transitionStarts_[t]!==-1:!1}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}function ro(i){return i instanceof Image||i instanceof HTMLCanvasElement||i instanceof HTMLVideoElement||i instanceof ImageBitmap?i:null}const og=new Error("disposed"),ag=[256,256];class ql extends so{constructor(t){const e=G.IDLE;super(t.tileCoord,e,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=ro(this.data_);return t?[t.width,t.height]:ag}getData(){return this.data_}getError(){return this.error_}load(){if(this.state!==G.IDLE&&this.state!==G.ERROR)return;this.state=G.LOADING,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=G.LOADED,t.changed()}).catch(function(e){t.error_=e,t.state=G.ERROR,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(og),this.controller_=null),super.disposeInternal()}}class Jl extends so{constructor(t,e,n,s,r,o){super(t,e,o),this.crossOrigin_=s,this.src_=n,this.key=n,this.image_=new Image,s!==null&&(this.image_.crossOrigin=s),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=G.LOADED,this.unlistenImage_(),this.changed()}handleImageError_(){this.state=G.ERROR,this.unlistenImage_(),this.image_=lg(),this.changed()}handleImageLoad_(){const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=G.LOADED:this.state=G.EMPTY,this.unlistenImage_(),this.changed()}load(){this.state==G.ERROR&&(this.state=G.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)),this.state==G.IDLE&&(this.state=G.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Rf(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 lg(){const i=ft(1,1);return i.fillStyle="rgba(0,0,0,0)",i.fillRect(0,0,1,1),i.canvas}class oo{constructor(t,e,n,s){this.minX=t,this.maxX=e,this.minY=n,this.maxY=s}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function kn(i,t,e,n,s){return s!==void 0?(s.minX=i,s.maxX=t,s.minY=e,s.maxY=n,s):new oo(i,t,e,n)}let ao;const On=[];function Ql(i,t,e,n,s){i.beginPath(),i.moveTo(0,0),i.lineTo(t,e),i.lineTo(n,s),i.closePath(),i.save(),i.clip(),i.fillRect(0,0,Math.max(t,n)+1,Math.max(e,s)),i.restore()}function lo(i,t){return Math.abs(i[t*4]-210)>2||Math.abs(i[t*4+3]-.75*255)>2}function hg(){if(ao===void 0){const i=ft(6,6,On);i.globalCompositeOperation="lighter",i.fillStyle="rgba(210, 0, 0, 0.75)",Ql(i,4,5,4,0),Ql(i,4,5,0,5);const t=i.getImageData(0,0,3,3).data;ao=lo(t,0)||lo(t,4)||lo(t,8),hs(i),On.push(i.canvas)}return ao}function th(i,t,e,n){const s=gr(e,t,i);let r=Wa(t,n,e);const o=t.getMetersPerUnit();o!==void 0&&(r*=o);const a=i.getMetersPerUnit();a!==void 0&&(r/=a);const l=i.getExtent();if(!l||_n(l,s)){const h=Wa(i,r,s)/r;isFinite(h)&&h>0&&(r/=h)}return r}function cg(i,t,e,n){const s=Ke(e);let r=th(i,t,s,n);return(!isFinite(r)||r<=0)&&xa(e,function(o){return r=th(i,t,o,n),isFinite(r)&&r>0}),r}function ug(i,t,e,n,s,r,o,a,l,h,c,u,d,f){const _=ft(Math.round(e*i),Math.round(e*t),On);if(u||(_.imageSmoothingEnabled=!1),l.length===0)return _.canvas;_.scale(e,e);function p(C){return Math.round(C*e)/e}_.globalCompositeOperation="lighter";const m=Xt();l.forEach(function(C,R,I){Yc(m,C.extent)});let y;const x=e/n,v=(u?1:1+Math.pow(2,-24))/x;y=ft(Math.round(it(m)*x),Math.round(It(m)*x),On),u||(y.imageSmoothingEnabled=!1),l.forEach(function(C,R,I){if(C.image.width>0&&C.image.height>0){if(C.clipExtent){y.save();const A=(C.clipExtent[0]-m[0])*x,k=-(C.clipExtent[3]-m[3])*x,P=it(C.clipExtent)*x,X=It(C.clipExtent)*x;y.rect(u?A:Math.round(A),u?k:Math.round(k),u?P:Math.round(A+P)-Math.round(A),u?X:Math.round(k+X)-Math.round(k)),y.clip()}const T=(C.extent[0]-m[0])*x,S=-(C.extent[3]-m[3])*x,L=it(C.extent)*x,O=It(C.extent)*x;y.drawImage(C.image,h,h,C.image.width-2*h,C.image.height-2*h,u?T:Math.round(T),u?S:Math.round(S),u?L:Math.round(T+L)-Math.round(T),u?O:Math.round(S+O)-Math.round(S)),C.clipExtent&&y.restore()}});const E=je(o);return a.getTriangles().forEach(function(C,R,I){const T=C.source,S=C.target;let L=T[0][0],O=T[0][1],A=T[1][0],k=T[1][1],P=T[2][0],X=T[2][1];const D=p((S[0][0]-E[0])/r),W=p(-(S[0][1]-E[1])/r),N=p((S[1][0]-E[0])/r),K=p(-(S[1][1]-E[1])/r),j=p((S[2][0]-E[0])/r),nt=p(-(S[2][1]-E[1])/r),M=L,xt=O;L=0,O=0,A-=M,k-=xt,P-=M,X-=xt;const vt=[[A,k,0,0,N-D],[P,X,0,0,j-D],[0,0,A,k,K-W],[0,0,P,X,nt-W]],ht=Xc(vt);if(!ht)return;if(_.save(),_.beginPath(),hg()||!u){_.moveTo(N,K);const wt=4,Zt=D-N,Wt=W-K;for(let F=0;F<wt;F++)_.lineTo(N+p((F+1)*Zt/wt),K+p(F*Wt/(wt-1))),F!=wt-1&&_.lineTo(N+p((F+1)*Zt/wt),K+p((F+1)*Wt/(wt-1)));_.lineTo(j,nt)}else _.moveTo(N,K),_.lineTo(D,W),_.lineTo(j,nt);_.clip(),_.transform(ht[0],ht[2],ht[1],ht[3],D,W),_.translate(m[0]-M,m[3]-xt);let Lt;if(y)Lt=y.canvas,_.scale(v,-v);else{const wt=l[0],Zt=wt.extent;Lt=wt.image,_.scale(it(Zt)/Lt.width,-It(Zt)/Lt.height)}_.drawImage(Lt,0,0),_.restore()}),y&&(hs(y),On.push(y.canvas)),c&&(_.save(),_.globalCompositeOperation="source-over",_.strokeStyle="black",_.lineWidth=1,a.getTriangles().forEach(function(C,R,I){const T=C.target,S=(T[0][0]-E[0])/r,L=-(T[0][1]-E[1])/r,O=(T[1][0]-E[0])/r,A=-(T[1][1]-E[1])/r,k=(T[2][0]-E[0])/r,P=-(T[2][1]-E[1])/r;_.beginPath(),_.moveTo(O,A),_.lineTo(S,L),_.lineTo(k,P),_.closePath(),_.stroke()}),_.restore()),_.canvas}const dg=10,eh=.25;class fg{constructor(t,e,n,s,r,o,a){this.sourceProj_=t,this.targetProj_=e;let l={};const h=a?Tu(v=>yt(a,gr(v,this.targetProj_,this.sourceProj_))):ns(this.targetProj_,this.sourceProj_);this.transformInv_=function(v){const E=v[0]+"/"+v[1];return l[E]||(l[E]=h(v)),l[E]},this.maxSourceExtent_=s,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!s&&!!this.sourceProj_.getExtent()&&it(s)>=it(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?it(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?it(this.targetProj_.getExtent()):null;const c=je(n),u=ji(n),d=Zi(n),f=Ki(n),_=this.transformInv_(c),p=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(f),x=dg+(o?Math.max(0,Math.ceil(Math.log2(Js(n)/(o*o*256*256)))):0);if(this.addQuad_(c,u,d,f,_,p,m,y,x),this.wrapsXInSource_){let v=1/0;this.triangles_.forEach(function(E,C,R){v=Math.min(v,E.source[0][0],E.source[1][0],E.source[2][0])}),this.triangles_.forEach(E=>{if(Math.max(E.source[0][0],E.source[1][0],E.source[2][0])-v>this.sourceWorldWidth_/2){const C=[[E.source[0][0],E.source[0][1]],[E.source[1][0],E.source[1][1]],[E.source[2][0],E.source[2][1]]];C[0][0]-v>this.sourceWorldWidth_/2&&(C[0][0]-=this.sourceWorldWidth_),C[1][0]-v>this.sourceWorldWidth_/2&&(C[1][0]-=this.sourceWorldWidth_),C[2][0]-v>this.sourceWorldWidth_/2&&(C[2][0]-=this.sourceWorldWidth_);const R=Math.min(C[0][0],C[1][0],C[2][0]);Math.max(C[0][0],C[1][0],C[2][0])-R<this.sourceWorldWidth_/2&&(E.source=C)}})}l={}}addTriangle_(t,e,n,s,r,o){this.triangles_.push({source:[s,r,o],target:[t,e,n]})}addQuad_(t,e,n,s,r,o,a,l,h){const c=fa([r,o,a,l]),u=this.sourceWorldWidth_?it(c)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1;let _=!1;if(h>0){if(this.targetProj_.isGlobal()&&this.targetWorldWidth_){const m=fa([t,e,n,s]);_=it(m)/this.targetWorldWidth_>eh||_}!f&&this.sourceProj_.isGlobal()&&u&&(_=u>eh||_)}if(!_&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!Pt(c,this.maxSourceExtent_))return;let p=0;if(!_&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(l[0])||!isFinite(l[1]))){if(h>0)_=!0;else if(p=(!isFinite(r[0])||!isFinite(r[1])?8:0)+(!isFinite(o[0])||!isFinite(o[1])?4:0)+(!isFinite(a[0])||!isFinite(a[1])?2:0)+(!isFinite(l[0])||!isFinite(l[1])?1:0),p!=1&&p!=2&&p!=4&&p!=8)return}if(h>0){if(!_){const m=[(t[0]+n[0])/2,(t[1]+n[1])/2],y=this.transformInv_(m);let x;f?x=(gn(r[0],d)+gn(a[0],d))/2-gn(y[0],d):x=(r[0]+a[0])/2-y[0];const v=(r[1]+a[1])/2-y[1];_=x*x+v*v>this.errorThresholdSquared_}if(_){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const m=[(e[0]+n[0])/2,(e[1]+n[1])/2],y=this.transformInv_(m),x=[(s[0]+t[0])/2,(s[1]+t[1])/2],v=this.transformInv_(x);this.addQuad_(t,e,m,x,r,o,y,v,h-1),this.addQuad_(x,m,n,s,v,y,a,l,h-1)}else{const m=[(t[0]+e[0])/2,(t[1]+e[1])/2],y=this.transformInv_(m),x=[(n[0]+s[0])/2,(n[1]+s[1])/2],v=this.transformInv_(x);this.addQuad_(t,m,x,s,r,y,v,l,h-1),this.addQuad_(m,e,n,x,y,o,a,v,h-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(p&11)==0&&this.addTriangle_(t,n,s,r,a,l),(p&14)==0&&this.addTriangle_(t,n,e,r,a,o),p&&((p&13)==0&&this.addTriangle_(e,s,t,o,l,r),(p&7)==0&&this.addTriangle_(e,s,n,o,l,a))}calculateSourceExtent(){const t=Xt();return this.triangles_.forEach(function(e,n,s){const r=e.source;qn(t,r[0]),qn(t,r[1]),qn(t,r[2])}),t}getTriangles(){return this.triangles_}}const gg=.5;class nh extends so{constructor(t,e,n,s,r,o,a,l,h,c,u,d){super(r,G.IDLE,d),this.renderEdges_=u!==void 0?u:!1,this.pixelRatio_=a,this.gutter_=l,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=s,this.wrappedTileCoord_=o||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const f=s.getTileCoordExtent(this.wrappedTileCoord_),_=this.targetTileGrid_.getExtent();let p=this.sourceTileGrid_.getExtent();const m=_?Ze(f,_):f;if(Js(m)===0){this.state=G.EMPTY;return}const y=t.getExtent();y&&(p?p=Ze(p,y):p=y);const x=s.getResolution(this.wrappedTileCoord_[0]),v=cg(t,n,m,x);if(!isFinite(v)||v<=0){this.state=G.EMPTY;return}const E=c!==void 0?c:gg;if(this.triangulation_=new fg(t,n,m,p,v*E,x),this.triangulation_.getTriangles().length===0){this.state=G.EMPTY;return}this.sourceZ_=e.getZForResolution(v);let C=this.triangulation_.calculateSourceExtent();if(p&&(t.canWrapX()?(C[1]=lt(C[1],p[1],p[3]),C[3]=lt(C[3],p[1],p[3])):C=Ze(C,p)),!Js(C))this.state=G.EMPTY;else{let R=0,I=0;t.canWrapX()&&(R=it(y),I=Math.floor((C[0]-y[0])/R)),Ca(C.slice(),t,!0).forEach(S=>{const L=e.getTileRangeForExtentAndZ(S,this.sourceZ_);for(let O=L.minX;O<=L.maxX;O++)for(let A=L.minY;A<=L.maxY;A++){const k=h(this.sourceZ_,O,A,a);if(k){const P=I*R;this.sourceTiles_.push({tile:k,offset:P})}}++I}),this.sourceTiles_.length===0&&(this.state=G.EMPTY)}}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const n=e.tile;if(n&&n.getState()==G.LOADED){const s=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);s[0]+=e.offset,s[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:s,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,t.length===0)this.state=G.ERROR;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),s=typeof n=="number"?n:n[0],r=typeof n=="number"?n:n[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=ug(s,r,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=G.LOADED}this.changed()}load(){if(this.state==G.IDLE){this.state=G.LOADING,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(n==G.IDLE||n==G.LOADING){t++;const s=q(e,Y.CHANGE,r=>{const o=e.getState();(o==G.LOADED||o==G.ERROR||o==G.EMPTY)&&(at(s),t--,t===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(s)}}),t===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},n,s){e.getState()==G.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(at),this.sourcesListenerKeys_=null}release(){this.canvas_&&(hs(this.canvas_.getContext("2d")),On.push(this.canvas_),this.canvas_=null),super.release()}}class _g{constructor(t){this.highWaterMark=t!==void 0?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof Fi&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return et(n!==void 0,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(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(t){const e=this.entries_[t];return et(e!==void 0,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.key_;return t}getValues(){const t=new Array(this.count_);let e=0,n;for(n=this.newest_;n;n=n.older)t[e++]=n.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){et(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function bs(i,t,e,n){return n!==void 0?(n[0]=i,n[1]=t,n[2]=e,n):[i,t,e]}function mg(i,t,e){return i+"/"+t+"/"+e}function pg(i){return yg(i[0],i[1],i[2])}function yg(i,t,e){return(t<<i)+e}function xg(i,t){const e=i[0],n=i[1],s=i[2];if(t.getMinZoom()>e||e>t.getMaxZoom())return!1;const r=t.getFullTileRange(e);return r?r.containsXY(n,s):!0}class ih{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(ls(),{get:(t,e)=>{if(typeof ls()[e]=="function")return this.push_(e),this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,s=e.length;n<s;++n){const r=e[n];if(typeof r=="function"){r(t);continue}const o=e[++n];if(typeof t[r]=="function")t[r](...o);else{if(typeof o=="function"){t[r]=o(t);continue}t[r]=o}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const wg=5;class Eg extends jn{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=wg}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return J()}getData(t){return null}prepareFrame(t){return J()}renderFrame(t,e){return J()}forEachFeatureAtCoordinate(t,e,n,s,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;(e.getState()===Z.LOADED||e.getState()===Z.ERROR)&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return e!=Z.LOADED&&e!=Z.ERROR&&t.addEventListener(Y.CHANGE,this.boundHandleImageChange_),e==Z.IDLE&&(t.load(),e=t.getState()),e==Z.LOADED}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&t.getSourceState()==="ready"&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const sh=[];let Pn=null;function Cg(){Pn=ft(1,1,void 0,{willReadFrequently:!0})}class rh extends Eg{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=Jt(),this.pixelTransform=Jt(),this.inversePixelTransform=Jt(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){Pn||Cg(),Pn.clearRect(0,0,1,1);let s;try{Pn.drawImage(t,e,n,1,1,0,0,1,1),s=Pn.getImageData(0,0,1,1).data}catch{return Pn=null,null}return s}getBackground(t){let n=this.getLayer().getBackground();return typeof n=="function"&&(n=n(t.viewState.resolution)),n||void 0}useContainer(t,e,n){const s=this.getLayer().getClassName();let r,o;if(t&&t.className===s&&(!n||t&&t.style.backgroundColor&&Re(Rn(t.style.backgroundColor),Rn(n)))){const a=t.firstElementChild;a instanceof HTMLCanvasElement&&(o=a.getContext("2d"))}if(o&&Pu(o.canvas.style.transform,e)?(this.container=t,this.context=o,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=document.createElement("div"),r.className=s;let a=r.style;a.position="absolute",a.width="100%",a.height="100%",o=ft();const l=o.canvas;r.appendChild(l),a=l.style,a.position="absolute",a.left="0",a.transformOrigin="top left",this.container=r,this.context=o}!this.containerReused&&n&&!this.container.style.backgroundColor&&(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const s=je(n),r=ji(n),o=Zi(n),a=Ki(n);yt(e.coordinateToPixelTransform,s),yt(e.coordinateToPixelTransform,r),yt(e.coordinateToPixelTransform,o),yt(e.coordinateToPixelTransform,a);const l=this.inversePixelTransform;yt(l,s),yt(l,r),yt(l,o),yt(l,a),t.save(),t.beginPath(),t.moveTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.lineTo(Math.round(a[0]),Math.round(a[1])),t.clip()}prepareContainer(t,e){const n=t.extent,s=t.viewState.resolution,r=t.viewState.rotation,o=t.pixelRatio,a=Math.round(it(n)/s*o),l=Math.round(It(n)/s*o);ge(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/o,1/o,r,-a/2,-l/2),Ba(this.inversePixelTransform,this.pixelTransform);const h=Ou(this.pixelTransform);if(this.useContainer(e,h,this.getBackground(t)),!this.containerReused){const c=this.context.canvas;c.width!=a||c.height!=l?(c.width=a,c.height=l):this.context.clearRect(0,0,a,l),h!==c.style.transform&&(c.style.transform=h)}}dispatchRenderEvent_(t,e,n){const s=this.getLayer();if(s.hasListener(t)){const r=new jl(t,this.inversePixelTransform,n,e);s.dispatchEvent(r)}}preRender(t,e){this.frameState=e,!e.declutter&&this.dispatchRenderEvent_(Yt.PRERENDER,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(Yt.POSTRENDER,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new ih),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(Yt.PRERENDER,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(Yt.POSTRENDER,this.context,t))}getRenderTransform(t,e,n,s,r,o,a){const l=r/2,h=o/2,c=s/e,u=-c,d=-t[0]+a,f=-t[1];return ge(this.tempTransform,l,h,c,u,-n,d,f)}disposeInternal(){delete this.frameState,super.disposeInternal()}}function ho(i,t,e,n,s){return`${Q(i)},${t},${mg(e,n,s)}`}function co(i,t,e){if(!(e in i))return i[e]=new Set([t]),!0;const n=i[e],s=n.has(t);return s||n.add(t),!s}function vg(i,t,e){const n=i[e];return n?n.delete(t):!1}function oh(i,t){const e=i.layerStatesArray[i.layerIndex];e.extent&&(t=Ze(t,Ae(e.extent,i.viewState.projection)));const n=e.layer.getRenderSource();if(!n.getWrapX()){const s=n.getTileGridForProjection(i.viewState.projection).getExtent();s&&(t=Ze(t,s))}return t}class bg extends rh{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=Xt(),this.tempTileRange_=new oo(0,0,0,0),this.tempTileCoord_=bs(0,0,0);const n=e.cacheSize!==void 0?e.cacheSize:512;this.tileCache_=new _g(n),this.maxStaleKeys=n*.5}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,n,s){const r=this.tileCache_,a=this.getLayer().getSource(),l=ho(a,a.getKey(),t,e,n);let h;if(r.containsKey(l))h=r.get(l);else{if(h=a.getTile(t,e,n,s.pixelRatio,s.viewState.projection),!h)return null;r.set(l,h)}return h}getTile(t,e,n,s){const r=this.getOrCreateTile(t,e,n,s);return r||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),s=yt(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!_n(r,s))return null;const o=e.viewState,a=n.getRenderSource(),l=a.getTileGridForProjection(o.projection),h=a.getTilePixelRatio(e.pixelRatio);for(let c=l.getZForResolution(o.resolution);c>=l.getMinZoom();--c){const u=l.getTileCoordForCoordAndZ(s,c),d=this.getTile(c,u[1],u[2],e);if(!d||d.getState()!==G.LOADED)continue;const f=l.getOrigin(c),_=Ft(l.getTileSize(c)),p=l.getResolution(c);let m;if(d instanceof Jl||d instanceof nh)m=d.getImage();else if(d instanceof ql){if(m=ro(d.getData()),!m)continue}else continue;const y=Math.floor(h*((s[0]-f[0])/p-u[1]*_[0])),x=Math.floor(h*((f[1]-s[1])/p-u[2]*_[1])),v=Math.round(h*a.getGutterForProjection(o.projection));return this.getImageData(m,y+v,x+v)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=n,!0}enqueueTiles(t,e,n,s,r){const o=t.viewState,a=this.getLayer(),l=a.getRenderSource(),h=l.getTileGridForProjection(o.projection),c=Q(l);c in t.wantedTiles||(t.wantedTiles[c]={});const u=t.wantedTiles[c],d=a.getMapInternal(),f=Math.max(n-r,h.getMinZoom(),h.getZForResolution(Math.min(a.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(a.getMinZoom(),0)):h.getResolution(0)),l.zDirection)),_=o.rotation,p=_?wa(o.center,o.resolution,_,t.size):void 0;for(let m=n;m>=f;--m){const y=h.getTileRangeForExtentAndZ(e,m,this.tempTileRange_),x=h.getResolution(m);for(let v=y.minX;v<=y.maxX;++v)for(let E=y.minY;E<=y.maxY;++E){if(_&&!h.tileCoordIntersectsViewport([m,v,E],p))continue;const C=this.getTile(m,v,E,t);if(!C||!co(s,C,m))continue;const I=C.getKey();if(u[I]=!0,C.getState()===G.IDLE&&!t.tileQueue.isKeyQueued(I)){const T=bs(m,v,E,this.tempTileCoord_);t.tileQueue.enqueue([C,c,h.getTileCoordCenter(T),x])}}}}findStaleTile_(t,e){const n=this.tileCache_,s=t[0],r=t[1],o=t[2],a=this.getStaleKeys();for(let l=0;l<a.length;++l){const h=ho(this.getLayer().getSource(),a[l],s,r,o);if(n.containsKey(h)){const c=n.peek(h);if(c.getState()===G.LOADED)return c.endTransition(Q(this)),co(e,c,s),!0}}return!1}findAltTiles_(t,e,n,s){const r=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!r)return!1;let o=!0;const a=this.tileCache_,l=this.getLayer().getRenderSource(),h=l.getKey();for(let c=r.minX;c<=r.maxX;++c)for(let u=r.minY;u<=r.maxY;++u){const d=ho(l,h,n,c,u);let f=!1;if(a.containsKey(d)){const _=a.peek(d);_.getState()===G.LOADED&&(co(s,_,n),f=!0)}f||(o=!1)}return o}renderFrame(t,e){this.renderComplete=!0;const n=t.layerStatesArray[t.layerIndex],s=t.viewState,r=s.projection,o=s.resolution,a=s.center,l=t.pixelRatio,h=this.getLayer(),c=h.getSource(),u=c.getTileGridForProjection(r),d=u.getZForResolution(o,c.zDirection),f=u.getResolution(d),_=c.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==_&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=_):this.renderedSourceKey_=_;let p=t.extent;const m=c.getTilePixelRatio(l);this.prepareContainer(t,e);const y=this.context.canvas.width,x=this.context.canvas.height,v=n.extent&&Ae(n.extent);v&&(p=Ze(p,Ae(n.extent)));const E=f*y/2/m,C=f*x/2/m,R=[a[0]-E,a[1]-C,a[0]+E,a[1]+C],I={};this.renderedTiles.length=0;const T=h.getPreload();if(t.nextExtent){const N=u.getZForResolution(s.nextResolution,c.zDirection),K=oh(t,t.nextExtent);this.enqueueTiles(t,K,N,I,T)}const S=oh(t,p);if(this.enqueueTiles(t,S,d,I,0),T>0&&setTimeout(()=>{this.enqueueTiles(t,S,d-1,I,T-1)},0),!(d in I))return this.container;const L=Q(this),O=t.time;for(const N of I[d]){const K=N.getState();if(K===G.EMPTY)continue;const j=N.tileCoord;if(K===G.LOADED&&N.getAlpha(L,O)===1){N.endTransition(L);continue}if(K!==G.ERROR&&(this.renderComplete=!1),this.findStaleTile_(j,I)){vg(I,N,d),t.animate=!0;continue}if(this.findAltTiles_(u,j,d+1,I))continue;const xt=u.getMinZoom();for(let vt=d-1;vt>=xt&&!this.findAltTiles_(u,j,vt,I);--vt);}const A=f/o*l/m,k=this.getRenderContext(t);ge(this.tempTransform,y/2,x/2,A,A,0,-y/2,-x/2),n.extent&&this.clipUnrotated(k,t,v),c.getInterpolate()||(k.imageSmoothingEnabled=!1),this.preRender(k,t);const P=Object.keys(I).map(Number);P.sort(ue);let X;const D=[],W=[];for(let N=P.length-1;N>=0;--N){const K=P[N],j=c.getTilePixelSize(K,l,r),M=u.getResolution(K)/f,xt=j[0]*M*A,vt=j[1]*M*A,ht=u.getTileCoordForCoordAndZ(je(R),K),Lt=u.getTileCoordExtent(ht),wt=yt(this.tempTransform,[m*(Lt[0]-R[0])/f,m*(R[3]-Lt[3])/f]),Zt=m*c.getGutterForProjection(r);for(const Wt of I[K]){if(Wt.getState()!==G.LOADED)continue;const F=Wt.tileCoord,rt=ht[1]-F[1],H=Math.round(wt[0]-(rt-1)*xt),_t=ht[2]-F[2],mt=Math.round(wt[1]-(_t-1)*vt),Rt=Math.round(wt[0]-rt*xt),ae=Math.round(wt[1]-_t*vt),zn=H-Rt,Nn=mt-ae,Ri=P.length===1;let on=!1;X=[Rt,ae,Rt+zn,ae,Rt+zn,ae+Nn,Rt,ae+Nn];for(let Gn=0,Wn=D.length;Gn<Wn;++Gn)if(!Ri&&K<W[Gn]){const Et=D[Gn];Pt([Rt,ae,Rt+zn,ae+Nn],[Et[0],Et[3],Et[4],Et[7]])&&(on||(k.save(),on=!0),k.beginPath(),k.moveTo(X[0],X[1]),k.lineTo(X[2],X[3]),k.lineTo(X[4],X[5]),k.lineTo(X[6],X[7]),k.moveTo(Et[6],Et[7]),k.lineTo(Et[4],Et[5]),k.lineTo(Et[2],Et[3]),k.lineTo(Et[0],Et[1]),k.clip())}D.push(X),W.push(K),this.drawTile(Wt,t,Rt,ae,zn,Nn,Zt,Ri),on&&k.restore(),this.renderedTiles.unshift(Wt),this.updateUsedTiles(t.usedTiles,c,Wt)}}if(this.renderedResolution=f,this.extentChanged=!this.renderedExtent_||!$n(this.renderedExtent_,R),this.renderedExtent_=R,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&k.restore(),k.imageSmoothingEnabled=!0,this.renderComplete){const N=(K,j)=>{const nt=Q(c),M=j.wantedTiles[nt],xt=M?Object.keys(M).length:0;this.updateCacheSize(xt),this.tileCache_.expireCache()};t.postRenderFunctions.push(N)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,t*2)}drawTile(t,e,n,s,r,o,a,l){let h;if(t instanceof ql){if(h=ro(t.getData()),!h)throw new Error("Rendering array data is not yet supported")}else h=this.getTileImage(t);if(!h)return;const c=this.getRenderContext(e),u=Q(this),d=e.layerStatesArray[e.layerIndex],f=d.opacity*(l?t.getAlpha(u,e.time):1),_=f!==c.globalAlpha;_&&(c.save(),c.globalAlpha=f),c.drawImage(h,a,a,h.width-2*a,h.height-2*a,n,s,r,o),_&&c.restore(),f!==d.opacity?e.animate=!0:l&&t.endTransition(u)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const s=Q(e);s in t||(t[s]={}),t[s][n.getKey()]=!0}}const Ss={PRELOAD:"preload",USE_INTERIM_TILES_ON_ERROR:"useInterimTilesOnError"};class Sg extends cs{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(t.preload!==void 0?t.preload:0),this.setUseInterimTilesOnError(t.useInterimTilesOnError!==void 0?t.useInterimTilesOnError:!0)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(Ss.PRELOAD)}setPreload(t){this.set(Ss.PRELOAD,t)}getUseInterimTilesOnError(){return this.get(Ss.USE_INTERIM_TILES_ON_ERROR)}setUseInterimTilesOnError(t){this.set(Ss.USE_INTERIM_TILES_ON_ERROR,t)}getData(t){return super.getData(t)}}class Rg extends Sg{constructor(t){super(t)}createRenderer(){return new bg(this,{cacheSize:this.getCacheSize()})}}const Dn=[0,0,0],Fe=5;class ah{constructor(t){this.minZoom=t.minZoom!==void 0?t.minZoom:0,this.resolutions_=t.resolutions,et(Ac(this.resolutions_,(s,r)=>r-s),"`resolutions` must be sorted in descending order");let e;if(!t.origins){for(let s=0,r=this.resolutions_.length-1;s<r;++s)if(!e)e=this.resolutions_[s]/this.resolutions_[s+1];else if(this.resolutions_[s]/this.resolutions_[s+1]!==e){e=void 0;break}}this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=t.origin!==void 0?t.origin:null,this.origins_=null,t.origins!==void 0&&(this.origins_=t.origins,et(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=je(n)),et(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,t.tileSizes!==void 0&&(this.tileSizes_=t.tileSizes,et(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=t.tileSize!==void 0?t.tileSize:this.tileSizes_?null:vr,et(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n!==void 0?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],t.sizes!==void 0?this.fullTileRanges_=t.sizes.map((s,r)=>{const o=new oo(Math.min(0,s[0]),Math.max(s[0]-1,-1),Math.min(0,s[1]),Math.max(s[1]-1,-1));if(n){const a=this.getTileRangeForExtentAndZ(n,r);o.minX=Math.max(a.minX,o.minX),o.maxX=Math.min(a.maxX,o.maxX),o.minY=Math.max(a.minY,o.minY),o.maxY=Math.min(a.maxY,o.maxY)}return o}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const s=this.getTileRangeForExtentAndZ(t,e);for(let r=s.minX,o=s.maxX;r<=o;++r)for(let a=s.minY,l=s.maxY;a<=l;++a)n([e,r,a])}forEachTileCoordParentTileRange(t,e,n,s){let r,o,a,l=null,h=t[0]-1;for(this.zoomFactor_===2?(o=t[1],a=t[2]):l=this.getTileCoordExtent(t,s);h>=this.minZoom;){if(o!==void 0&&a!==void 0?(o=Math.floor(o/2),a=Math.floor(a/2),r=kn(o,o,a,a,n)):r=this.getTileRangeForExtentAndZ(l,h,n),e(h,r))return!0;--h}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(this.zoomFactor_===2){const r=t[1]*2,o=t[2]*2;return kn(r,r+1,o,o+1,e)}const s=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(s,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const s=t[0],r=t[1],o=t[2];if(e===s)return kn(r,o,r,o,n);if(this.zoomFactor_){const l=Math.pow(this.zoomFactor_,e-s),h=Math.floor(r*l),c=Math.floor(o*l);if(e<s)return kn(h,h,c,c,n);const u=Math.floor(l*(r+1))-1,d=Math.floor(l*(o+1))-1;return kn(h,u,c,d,n)}const a=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(a,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,Dn);const s=Dn[1],r=Dn[2];this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,Dn);const o=Dn[1],a=Dn[2];return kn(s,o,r,a,n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),s=Ft(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*s[0]*n,e[1]-(t[2]+.5)*s[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]),s=this.getResolution(t[0]),r=Ft(this.getTileSize(t[0]),this.tmpSize_),o=n[0]+t[1]*r[0]*s,a=n[1]-(t[2]+1)*r[1]*s,l=o+r[0]*s,h=a+r[1]*s;return Le(o,a,l,h,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,n,s,r){const o=this.getZForResolution(n),a=n/this.getResolution(o),l=this.getOrigin(o),h=Ft(this.getTileSize(o),this.tmpSize_);let c=a*(t-l[0])/n/h[0],u=a*(l[1]-e)/n/h[1];return s?(c=Yi(c,Fe)-1,u=Yi(u,Fe)-1):(c=Bi(c,Fe),u=Bi(u,Fe)),bs(o,c,u,r)}getTileCoordForXYAndZ_(t,e,n,s,r){const o=this.getOrigin(n),a=this.getResolution(n),l=Ft(this.getTileSize(n),this.tmpSize_);let h=(t-o[0])/a/l[0],c=(o[1]-e)/a/l[1];return s?(h=Yi(h,Fe)-1,c=Yi(c,Fe)-1):(h=Bi(h,Fe),c=Bi(c,Fe)),bs(n,h,c,r)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){const n=Ys(this.resolutions_,t,e||0);return lt(n,this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return il(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let s=this.minZoom;s<e;++s)n[s]=this.getTileRangeForExtentAndZ(t,s);this.fullTileRanges_=n}}function lh(i){let t=i.getDefaultTileGrid();return t||(t=Lg(i),i.setDefaultTileGrid(t)),t}function Tg(i,t,e){const n=t[0],s=i.getTileCoordCenter(t),r=uo(e);if(!_n(r,s)){const o=it(r),a=Math.ceil((r[0]-s[0])/o);return s[0]+=o*a,i.getTileCoordForCoordAndZ(s,n)}return t}function Ig(i,t,e,n){n=n!==void 0?n:"top-left";const s=hh(i,t,e);return new ah({extent:i,origin:Kc(i,n),resolutions:s,tileSize:e})}function Mg(i){const t=i||{},e=t.extent||Dt("EPSG:3857").getExtent(),n={extent:e,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:hh(e,t.maxZoom,t.tileSize,t.maxResolution)};return new ah(n)}function hh(i,t,e,n){t=t!==void 0?t:rd,e=Ft(e!==void 0?e:vr);const s=It(i),r=it(i);n=n>0?n:Math.max(r/e[0],s/e[1]);const o=t+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=n/Math.pow(2,l);return a}function Lg(i,t,e,n){const s=uo(i);return Ig(s,t,e,n)}function uo(i){i=Dt(i);let t=i.getExtent();if(!t){const e=180*er.degrees/i.getMetersPerUnit();t=Le(-e,-e,e,e)}return t}const Ag=/\{z\}/g,kg=/\{x\}/g,Og=/\{y\}/g,Pg=/\{-y\}/g;function Dg(i,t,e,n,s){return i.replace(Ag,t.toString()).replace(kg,e.toString()).replace(Og,n.toString()).replace(Pg,function(){if(s===void 0)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(s-n).toString()})}function Fg(i){const t=[];let e=/\{([a-z])-([a-z])\}/.exec(i);if(e){const n=e[1].charCodeAt(0),s=e[2].charCodeAt(0);let r;for(r=n;r<=s;++r)t.push(i.replace(e[0],String.fromCharCode(r)));return t}if(e=/\{(\d+)-(\d+)\}/.exec(i),e){const n=parseInt(e[2],10);for(let s=parseInt(e[1],10);s<=n;s++)t.push(i.replace(e[0],s.toString()));return t}return t.push(i),t}function zg(i,t){return(function(e,n,s){if(!e)return;let r;const o=e[0];if(t){const a=t.getFullTileRange(o);a&&(r=a.getHeight()-1)}return Dg(i,o,e[1],e[2],r)})}function Ng(i,t){const e=i.length,n=new Array(e);for(let s=0;s<e;++s)n[s]=zg(i[s],t);return Gg(n)}function Gg(i){return i.length===1?i[0]:(function(t,e,n){if(!t)return;const s=pg(t),r=gn(s,i.length);return i[r](t,e,n)})}class ch extends ne{constructor(t){super(),this.projection=Dt(t.projection),this.attributions_=uh(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=t.state!==void 0?t.state:"ready",this.wrapX_=t.wrapX!==void 0?t.wrapX:!1,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(n,s){e.viewResolver=n,e.viewRejector=s})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=uh(t),this.changed()}setState(t){this.state_=t,this.changed()}}function uh(i){return i?typeof i=="function"?i:(Array.isArray(i)||(i=[i]),t=>i):null}class Wg extends ch{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=t.tilePixelRatio!==void 0?t.tilePixelRatio:1,this.tileGrid=t.tileGrid!==void 0?t.tileGrid:null;const e=[256,256];this.tileGrid&&Ft(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),e),this.tmpSize=[0,0],this.key_=t.key||Q(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,s,r){return J()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:lh(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const s=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),o=Ft(s.getTileSize(t),this.tmpSize);return r==1?o:tf(o,r,this.tmpSize)}getTileCoordForTileUrlFunction(t,e){const n=e!==void 0?e:this.getProjection(),s=e!==void 0?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=Tg(s,t,n)),xg(t,s)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class Ug extends de{constructor(t,e){super(t),this.tile=e}}const fo={TILELOADSTART:"tileloadstart",TILELOADEND:"tileloadend",TILELOADERROR:"tileloaderror"};class go extends Wg{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===go.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(t){const e=t.target,n=Q(e),s=e.getState();let r;s==G.LOADING?(this.tileLoadingKeys_[n]=!0,r=fo.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=s==G.ERROR?fo.TILELOADERROR:s==G.LOADED?fo.TILELOADEND:void 0),r!=null&&this.dispatchEvent(new Ug(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,typeof e<"u"?this.setKey(e):this.changed()}setUrl(t){const e=Fg(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join(`
|
|
8
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(Ng(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}}class Xg extends go{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Bg,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate!==void 0?t.interpolate:!0,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=t.crossOrigin!==void 0?t.crossOrigin:null,this.tileClass=t.tileClass!==void 0?t.tileClass:Jl,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!ur(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||ur(e,t)))return this.tileGrid;const n=Q(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=lh(t)),this.tileGridForProjection[n]}createTile_(t,e,n,s,r,o){const a=[t,e,n],l=this.getTileCoordForTileUrlFunction(a,r),h=l?this.tileUrlFunction(l,s,r):void 0,c=new this.tileClass(a,h!==void 0?G.IDLE:G.EMPTY,h!==void 0?h:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=o,c.addEventListener(Y.CHANGE,this.handleTileChange.bind(this)),c}getTile(t,e,n,s,r){const o=this.getProjection();if(!o||!r||ur(o,r))return this.getTileInternal(t,e,n,s,o||r);const a=[t,e,n],l=this.getKey(),h=this.getTileGridForProjection(o),c=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(a,r),d=new nh(o,h,r,c,a,u,this.getTilePixelRatio(s),this.getGutter(),(f,_,p,m)=>this.getTileInternal(f,_,p,m,o),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,n,s,r){const o=this.getKey();return this.createTile_(t,e,n,s,r,o)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=Dt(t);if(n){const s=Q(n);s in this.tileGridForProjection||(this.tileGridForProjection[s]=e)}}}function Bg(i,t){i.getImage().src=t}class Yg extends Xg{constructor(t){t=t||{};const e=t.projection!==void 0?t.projection:"EPSG:3857",n=t.tileGrid!==void 0?t.tileGrid:Mg({extent:uo(e),maxResolution:t.maxResolution,maxZoom:t.maxZoom,minZoom:t.minZoom,tileSize:t.tileSize});super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:e,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX!==void 0?t.wrapX:!0,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=t.gutter!==void 0?t.gutter:0}getGutter(){return this.gutter_}}const Vg='© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.';class Kg extends Yg{constructor(t){t=t||{};let e;t.attributions!==void 0?e=t.attributions:e=[Vg];const n=t.crossOrigin!==void 0?t.crossOrigin:"anonymous",s=t.url!==void 0?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:n,interpolate:t.interpolate,maxZoom:t.maxZoom!==void 0?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:s,wrapX:t.wrapX,zDirection:t.zDirection})}}class _o extends ne{constructor(t){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_),t)if(typeof t.getSimplifiedGeometry=="function"){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new _o(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),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_&&(at(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=q(t,Y.CHANGE,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?Zg(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function Zg(i){if(typeof i=="function")return i;let t;return Array.isArray(i)?t=i:(et(typeof i.getZIndex=="function","Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),t=[i]),function(){return t}}function dh(i,t,e,n,s,r,o){let a,l;const h=(e-t)/n;if(h===1)a=t;else if(h===2)a=t,l=s;else if(h!==0){let c=i[t],u=i[t+1],d=0;const f=[0];for(let m=t+n;m<e;m+=n){const y=i[m],x=i[m+1];d+=Math.sqrt((y-c)*(y-c)+(x-u)*(x-u)),f.push(d),c=y,u=x}const _=s*d,p=Ic(f,_);p<0?(l=(_-f[-p-2])/(f[-p-1]-f[-p-2]),a=t+(-p-2)*n):a=t+p*n}o=o>1?o:2,r=r||new Array(o);for(let c=0;c<o;++c)r[c]=a===void 0?NaN:l===void 0?i[a+c]:Ut(i[a+c],i[a+n+c],l);return r}function jg(i,t,e,n){let s=i[t],r=i[t+1],o=0;for(let a=t+n;a<e;a+=n){const l=i[a],h=i[a+1];o+=Math.sqrt((l-s)*(l-s)+(h-r)*(h-r)),s=l,r=h}return o}class fh{drawCustom(t,e,n,s,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}class Hg extends fh{constructor(t,e,n,s,r,o,a){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=s,this.transformRotation_=s?Xi(Math.atan2(s[1],s[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=o,this.userTransform_=a,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_=Jt()}drawImages_(t,e,n,s){if(!this.image_)return;const r=ke(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_,a=this.tmpLocalTransform_,l=o.globalAlpha;this.imageOpacity_!=1&&(o.globalAlpha=l*this.imageOpacity_);let h=this.imageRotation_;this.transformRotation_===0&&(h-=this.viewRotation_),this.imageRotateWithView_&&(h+=this.viewRotation_);for(let c=0,u=r.length;c<u;c+=2){const d=r[c]-this.imageAnchorX_,f=r[c+1]-this.imageAnchorY_;if(h!==0||this.imageScale_[0]!=1||this.imageScale_[1]!=1){const _=d+this.imageAnchorX_,p=f+this.imageAnchorY_;ge(a,_,p,1,1,h,-_,-p),o.save(),o.transform.apply(o,a),o.translate(_,p),o.scale(this.imageScale_[0],this.imageScale_[1]),o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),o.restore()}else o.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,d,f,this.imageWidth_,this.imageHeight_)}this.imageOpacity_!=1&&(o.globalAlpha=l)}drawText_(t,e,n,s){if(!this.textState_||this.text_==="")return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=ke(t,e,n,s,this.transform_,this.pixelCoordinates_),o=this.context_;let a=this.textRotation_;for(this.transformRotation_===0&&(a-=this.viewRotation_),this.textRotateWithView_&&(a+=this.viewRotation_);e<n;e+=s){const l=r[e]+this.textOffsetX_,h=r[e+1]+this.textOffsetY_;a!==0||this.textScale_[0]!=1||this.textScale_[1]!=1?(o.save(),o.translate(l-this.textOffsetX_,h-this.textOffsetY_),o.rotate(a),o.translate(this.textOffsetX_,this.textOffsetY_),o.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&o.strokeText(this.text_,0,0),this.textFillState_&&o.fillText(this.text_,0,0),o.restore()):(this.textStrokeState_&&o.strokeText(this.text_,l,h),this.textFillState_&&o.fillText(this.text_,l,h))}}moveToLineTo_(t,e,n,s,r){const o=this.context_,a=ke(t,e,n,s,this.transform_,this.pixelCoordinates_);o.moveTo(a[0],a[1]);let l=a.length;r&&(l-=2);for(let h=2;h<l;h+=2)o.lineTo(a[h],a[h+1]);return r&&o.closePath(),n}drawRings_(t,e,n,s){for(let r=0,o=n.length;r<o;++r)e=this.moveToLineTo_(t,e,n[r],s,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Pt(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=Wu(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],s=e[3]-e[1],r=Math.sqrt(n*n+s*s),o=this.context_;o.beginPath(),o.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&o.fill(),this.strokeState_&&o.stroke()}this.text_!==""&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t);break}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,s=e.length;n<s;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),this.text_!==""&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Pt(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(this.text_!==""){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(Pt(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const n=this.context_,s=t.getFlatCoordinates();let r=0;const o=t.getEnds(),a=t.getStride();n.beginPath();for(let l=0,h=o.length;l<h;++l)r=this.moveToLineTo_(s,r,o[l],a,!1);n.stroke()}if(this.text_!==""){const n=t.getFlatMidpoints();this.drawText_(n,0,n.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Pt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),!!Pt(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let s=0;const r=t.getEndss(),o=t.getStride();e.beginPath();for(let a=0,l=r.length;a<l;++a){const h=r[a];s=this.drawRings_(n,s,h,o)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(this.text_!==""){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),Re(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,s=t.textAlign?t.textAlign:pi;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=s&&(n.textAlign=s,e.textAlign=s),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=s,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:s,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(!t)this.fillState_=null;else{const n=t.getColor();this.fillState_={fillStyle:re(n||Nt)}}if(!e)this.strokeState_=null;else{const n=e.getColor(),s=e.getLineCap(),r=e.getLineDash(),o=e.getLineDashOffset(),a=e.getLineJoin(),l=e.getWidth(),h=e.getMiterLimit(),c=r||me;this.strokeState_={lineCap:s!==void 0?s:In,lineDash:this.pixelRatio_===1?c:c.map(u=>u*this.pixelRatio_),lineDashOffset:(o||pe)*this.pixelRatio_,lineJoin:a!==void 0?a:Mn,lineWidth:(l!==void 0?l:yi)*this.pixelRatio_,miterLimit:h!==void 0?h:_i,strokeStyle:re(n||mi)}}}setImageStyle(t){let e;if(!t||!(e=t.getSize())){this.image_=null;return}const n=t.getPixelRatio(this.pixelRatio_),s=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=s[0]*n,this.imageAnchorY_=s[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const o=t.getScaleArray();this.imageScale_=[o[0]*this.pixelRatio_/n,o[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(!t)this.text_="";else{const e=t.getFill();if(!e)this.textFillState_=null;else{const f=e.getColor();this.textFillState_={fillStyle:re(f||Nt)}}const n=t.getStroke();if(!n)this.textStrokeState_=null;else{const f=n.getColor(),_=n.getLineCap(),p=n.getLineDash(),m=n.getLineDashOffset(),y=n.getLineJoin(),x=n.getWidth(),v=n.getMiterLimit();this.textStrokeState_={lineCap:_!==void 0?_:In,lineDash:p||me,lineDashOffset:m||pe,lineJoin:y!==void 0?y:Mn,lineWidth:x!==void 0?x:yi,miterLimit:v!==void 0?v:_i,strokeStyle:re(f||mi)}}const s=t.getFont(),r=t.getOffsetX(),o=t.getOffsetY(),a=t.getRotateWithView(),l=t.getRotation(),h=t.getScaleArray(),c=t.getText(),u=t.getTextAlign(),d=t.getTextBaseline();this.textState_={font:s!==void 0?s:Ll,textAlign:u!==void 0?u:pi,textBaseline:d!==void 0?d:_s},this.text_=c!==void 0?Array.isArray(c)?c.reduce((f,_,p)=>f+=p%2?" ":_,""):c:"",this.textOffsetX_=r!==void 0?this.pixelRatio_*r:0,this.textOffsetY_=o!==void 0?this.pixelRatio_*o:0,this.textRotateWithView_=a!==void 0?a:!1,this.textRotation_=l!==void 0?l:0,this.textScale_=[this.pixelRatio_*h[0],this.pixelRatio_*h[1]]}}}const $g=.5,gh={Point:s1,LineString:e1,Polygon:o1,MultiPoint:r1,MultiLineString:n1,MultiPolygon:i1,GeometryCollection:t1,Circle:Jg};function qg(i,t){return parseInt(Q(i),10)-parseInt(Q(t),10)}function _h(i,t){const e=mh(i,t);return e*e}function mh(i,t){return $g*i/t}function Jg(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Circle");l.setFillStrokeStyle(r,o),l.drawCircle(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n)}}function ph(i,t,e,n,s,r,o,a){const l=[],h=e.getImage();if(h){let d=!0;const f=h.getImageState();f==Z.LOADED||f==Z.ERROR?d=!1:f==Z.IDLE&&h.load(),d&&l.push(h.ready())}const c=e.getFill();c&&c.loading()&&l.push(c.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>s(null)),Qg(i,t,e,n,r,o,a),u}function Qg(i,t,e,n,s,r,o){const a=e.getGeometryFunction()(t);if(!a)return;const l=a.simplifyTransformed(n,s);if(e.getRenderer())yh(i,l,e,t,o);else{const c=gh[l.getType()];c(i,l,e,t,o,r)}}function yh(i,t,e,n,s){if(t.getType()=="GeometryCollection"){const o=t.getGeometries();for(let a=0,l=o.length;a<l;++a)yh(i,o[a],e,n,s);return}i.getBuilder(e.getZIndex(),"Default").drawCustom(t,n,e.getRenderer(),e.getHitDetectionRenderer(),s)}function t1(i,t,e,n,s,r){const o=t.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a){const h=gh[o[a].getType()];h(i,o[a],e,n,s,r)}}function e1(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function n1(i,t,e,n,s){const r=e.getStroke();if(r){const a=i.getBuilder(e.getZIndex(),"LineString");a.setFillStrokeStyle(null,r),a.drawMultiLineString(t,n,s)}const o=e.getText();if(o&&o.getText()){const a=i.getBuilder(e.getZIndex(),"Text");a.setTextStyle(o),a.drawText(t,n,s)}}function i1(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(o||r){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawMultiPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}function s1(i,t,e,n,s,r){const o=e.getImage(),a=e.getText(),l=a&&a.getText(),h=r&&o&&l?{}:void 0;if(o){if(o.getImageState()!=Z.LOADED)return;const c=i.getBuilder(e.getZIndex(),"Image");c.setImageStyle(o,h),c.drawPoint(t,n,s)}if(l){const c=i.getBuilder(e.getZIndex(),"Text");c.setTextStyle(a,h),c.drawText(t,n,s)}}function r1(i,t,e,n,s,r){const o=e.getImage(),a=o&&o.getOpacity()!==0,l=e.getText(),h=l&&l.getText(),c=r&&a&&h?{}:void 0;if(a){if(o.getImageState()!=Z.LOADED)return;const u=i.getBuilder(e.getZIndex(),"Image");u.setImageStyle(o,c),u.drawMultiPoint(t,n,s)}if(h){const u=i.getBuilder(e.getZIndex(),"Text");u.setTextStyle(l,c),u.drawText(t,n,s)}}function o1(i,t,e,n,s){const r=e.getFill(),o=e.getStroke();if(r||o){const l=i.getBuilder(e.getZIndex(),"Polygon");l.setFillStrokeStyle(r,o),l.drawPolygon(t,n,s)}const a=e.getText();if(a&&a.getText()){const l=i.getBuilder(e.getZIndex(),"Text");l.setTextStyle(a),l.drawText(t,n,s)}}let a1=!1;function l1(i,t,e,n,s,r,o){const a=new XMLHttpRequest;a.open("GET",typeof i=="function"?i(e,n,s):i,!0),t.getType()=="arraybuffer"&&(a.responseType="arraybuffer"),a.withCredentials=a1,a.onload=function(l){if(!a.status||a.status>=200&&a.status<300){const h=t.getType();try{let c;h=="text"||h=="json"?c=a.responseText:h=="xml"?c=a.responseXML||a.responseText:h=="arraybuffer"&&(c=a.response),c?r(t.readFeatures(c,{extent:e,featureProjection:s}),t.readProjection(c)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function xh(i,t){return function(e,n,s,r,o){l1(i,t,e,n,s,(a,l)=>{this.addFeatures(a),r!==void 0&&r(a)},()=>{this.changed(),o!==void 0&&o()})}}function h1(i,t){return[[-1/0,-1/0,1/0,1/0]]}function c1(i,t,e,n){const s=[];let r=Xt();for(let o=0,a=e.length;o<a;++o){const l=e[o];r=qs(i,t,l[0],n),s.push((r[0]+r[2])/2,(r[1]+r[3])/2),t=l[l.length-1]}return s}const wh=Jt();class ee{constructor(t,e,n,s,r,o){this.styleFunction,this.extent_,this.id_=o,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=r,this.squaredTolerance_,this.stride_=s,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_=this.type_==="Point"?pa(this.flatCoordinates_):qs(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=Ke(this.getExtent());this.flatInteriorPoints_=yr(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=td(this.flatCoordinates_,this.ends_),e=c1(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=Hu(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=dh(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let s=0,r=n.length;s<r;++s){const o=n[s],a=dh(t,e,o,2,.5);Vs(this.flatMidpoints_,a),e=o}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){t=Dt(t);const e=t.getExtent(),n=t.getWorldExtent();if(e&&n){const s=It(n)/It(e);ge(wh,n[0],n[3],s,-s,0,0,0),ke(this.flatCoordinates_,0,this.flatCoordinates_.length,2,wh,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new ee(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=ra((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let s;switch(this.type_){case"LineString":n.length=pr(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),s=[n.length];break;case"MultiLineString":s=[],n.length=Ku(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,s);break;case"Polygon":s=[],n.length=tl(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,s);break}return s&&(this.simplifiedGeometry_=new ee(this.type_,n,s,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}ee.prototype.getFlatCoordinates=ee.prototype.getOrientedFlatCoordinates;class Eh{constructor(t){this.rbush_=new yl(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[Q(e)]=n}load(t,e){const n=new Array(e.length);for(let s=0,r=e.length;s<r;s++){const o=t[s],a=e[s],l={minX:o[0],minY:o[1],maxX:o[2],maxY:o[3],value:a};n[s]=l,this.items_[Q(a)]=l}this.rbush_.load(n)}remove(t){const e=Q(t),n=this.items_[e];return delete this.items_[e],this.rbush_.remove(n)!==null}update(t,e){const n=this.items_[Q(e)],s=[n.minX,n.minY,n.maxX,n.maxY];$n(s,t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(e){return e.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(s){return s.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let s=0,r=t.length;s<r;s++)if(n=e(t[s]),n)return n;return n}isEmpty(){return un(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return Le(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}const Kt={ADDFEATURE:"addfeature",CHANGEFEATURE:"changefeature",CLEAR:"clear",REMOVEFEATURE:"removefeature",FEATURESLOADSTART:"featuresloadstart",FEATURESLOADEND:"featuresloadend",FEATURESLOADERROR:"featuresloaderror"};class ze extends de{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class u1 extends ch{constructor(t){t=t||{},super({attributions:t.attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:t.wrapX!==void 0?t.wrapX:!0}),this.on,this.once,this.un,this.loader_=Kn,this.format_=t.format||null,this.overlaps_=t.overlaps===void 0?!0:t.overlaps,this.url_=t.url,t.loader!==void 0?this.loader_=t.loader:this.url_!==void 0&&(et(this.format_,"`format` must be set when `url` is set"),this.loader_=xh(this.url_,this.format_)),this.strategy_=t.strategy!==void 0?t.strategy:h1;const e=t.useSpatialIndex!==void 0?t.useSpatialIndex:!0;this.featuresRtree_=e?new Eh:null,this.loadedExtentsRtree_=new Eh,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null;let n,s;Array.isArray(t.features)?s=t.features:t.features&&(n=t.features,s=n.getArray()),!e&&n===void 0&&(n=new ie(s)),s!==void 0&&this.addFeaturesInternal(s),n!==void 0&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=Q(t);if(!this.addToIndex_(e,t)){this.featuresCollection_&&this.featuresCollection_.remove(t);return}this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const s=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(s,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new ze(Kt.ADDFEATURE,t))}setupChangeEvents_(t,e){e instanceof ee||(this.featureChangeKeys_[t]=[q(e,Y.CHANGE,this.handleFeatureChange_,this),q(e,cn.PROPERTYCHANGE,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(e.getId()!==void 0){const s=String(e.getId());if(!(s in this.idIndex_))this.idIndex_[s]=e;else if(e instanceof ee){const r=this.idIndex_[s];r instanceof ee?Array.isArray(r)?r.push(e):this.idIndex_[s]=[r,e]:n=!1}else n=!1}return n&&(et(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],s=[];for(let r=0,o=t.length;r<o;r++){const a=t[r],l=Q(a);this.addToIndex_(l,a)&&n.push(a)}for(let r=0,o=n.length;r<o;r++){const a=n[r],l=Q(a);this.setupChangeEvents_(l,a);const h=a.getGeometry();if(h){const c=h.getExtent();e.push(c),s.push(a)}else this.nullGeometryFeatures_[l]=a}if(this.featuresRtree_&&this.featuresRtree_.load(e,s),this.hasListener(Kt.ADDFEATURE))for(let r=0,o=n.length;r<o;r++)this.dispatchEvent(new ze(Kt.ADDFEATURE,n[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(Kt.ADDFEATURE,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(Kt.REMOVEFEATURE,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(Ot.ADD,n=>{e||(e=!0,this.addFeature(n.element),e=!1)}),t.addEventListener(Ot.REMOVE,n=>{e||(e=!0,this.removeFeature(n.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const n in this.featureChangeKeys_)this.featureChangeKeys_[n].forEach(at);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(n=>{this.removeFeatureInternal(n)});for(const n in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[n])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new ze(Kt.CLEAR);this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(s){const r=s.getGeometry();if(r instanceof ee||r.intersectsCoordinate(t))return e(s)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const s=n.getGeometry();if(s instanceof ee||s.intersectsExtent(t)){const r=e(n);if(r)return r}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),un(this.nullGeometryFeatures_)||Vs(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(n){e.push(n)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const s=Ca(t,e);return[].concat(...s.map(r=>this.featuresRtree_.getInExtent(r)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],s=t[1];let r=null;const o=[NaN,NaN];let a=1/0;const l=[-1/0,-1/0,1/0,1/0];return e=e||Vn,this.featuresRtree_.forEachInExtent(l,function(h){if(e(h)){const c=h.getGeometry(),u=a;if(a=c instanceof ee?0:c.closestPointXY(n,s,o,a),a<u){r=h;const d=Math.sqrt(a);l[0]=n-d,l[1]=s-d,l[2]=n+d,l[3]=s+d}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return e!==void 0?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return e!==void 0?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=Q(e),s=e.getGeometry();if(!s)n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);else{const o=s.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(o,e)):this.featuresRtree_&&this.featuresRtree_.update(o,e)}const r=e.getId();if(r!==void 0){const o=r.toString();this.idIndex_[o]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[o]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new ze(Kt.CHANGEFEATURE,e))}hasFeature(t){const e=t.getId();return e!==void 0?e in this.idIndex_:Q(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&un(this.nullGeometryFeatures_):this.featuresCollection_?this.featuresCollection_.getLength()===0:!0}loadFeatures(t,e,n){const s=this.loadedExtentsRtree_,r=this.strategy_(t,e,n);for(let o=0,a=r.length;o<a;++o){const l=r[o];s.forEachInExtent(l,function(c){return Hn(c.extent,l)})||(++this.loadingExtentsCount_,this.dispatchEvent(new ze(Kt.FEATURESLOADSTART)),this.loader_.call(this,l,e,n,c=>{--this.loadingExtentsCount_,this.dispatchEvent(new ze(Kt.FEATURESLOADEND,void 0,c))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new ze(Kt.FEATURESLOADERROR))}),s.insert(l,{extent:l.slice()}))}this.loading=this.loader_.length<4?!1:this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,n=e.forEachInExtent(t,function(s){if($n(s.extent,t))return s});n&&e.remove(n)}removeFeatures(t){let e=!1;for(let n=0,s=t.length;n<s;++n)e=this.removeFeatureInternal(t[n])||e;e&&this.changed()}removeFeature(t){if(!t)return;this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=Q(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t),this.featureChangeKeys_[e]?.forEach(at),delete this.featureChangeKeys_[e];const s=t.getId();if(s!==void 0){const r=s.toString(),o=this.idIndex_[r];o===t?delete this.idIndex_[r]:Array.isArray(o)&&(o.splice(o.indexOf(t),1),o.length===1&&(this.idIndex_[r]=o[0]))}return delete this.uidIndex_[e],this.hasListener(Kt.REMOVEFEATURE)&&this.dispatchEvent(new ze(Kt.REMOVEFEATURE,t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){et(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader(xh(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}}const z={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},Rs=[z.FILL],Ne=[z.STROKE],sn=[z.BEGIN_PATH],Ch=[z.CLOSE_PATH];class Si extends fh{constructor(t,e,n,s){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=s,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(t){const e=this.pixelRatio;return e==1?t:t.map(function(n){return n*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),s=this.tmpCoordinate_,r=this.coordinates;let o=r.length;for(let a=0,l=t.length;a<l;a+=e)s[0]=t[a],s[1]=t[a+1],_n(n,s)&&(r[o++]=s[0],r[o++]=s[1]);return o}appendFlatLineCoordinates(t,e,n,s,r,o){const a=this.coordinates;let l=a.length;const h=this.getBufferedMaxExtent();o&&(e+=s);let c=t[e],u=t[e+1];const d=this.tmpCoordinate_;let f=!0,_,p,m;for(_=e+s;_<n;_+=s)d[0]=t[_],d[1]=t[_+1],m=$s(h,d),m!==p?(f&&(a[l++]=c,a[l++]=u,f=!1),a[l++]=d[0],a[l++]=d[1]):m===pt.INTERSECTING?(a[l++]=d[0],a[l++]=d[1],f=!1):f=!0,c=d[0],u=d[1],p=m;return(r&&f||_===e+s)&&(a[l++]=c,a[l++]=u),l}drawCustomCoordinates_(t,e,n,s,r){for(let o=0,a=n.length;o<a;++o){const l=n[o],h=this.appendFlatLineCoordinates(t,e,l,s,!1,!1);r.push(h),e=l}return e}drawCustom(t,e,n,s,r){this.beginGeometry(t,e,r);const o=t.getType(),a=t.getStride(),l=this.coordinates.length;let h,c,u,d,f;switch(o){case"MultiPolygon":h=t.getOrientedFlatCoordinates(),d=[];const _=t.getEndss();f=0;for(let p=0,m=_.length;p<m;++p){const y=[];f=this.drawCustomCoordinates_(h,f,_[p],a,y),d.push(y)}this.instructions.push([z.CUSTOM,l,d,t,n,Qa,r]),this.hitDetectionInstructions.push([z.CUSTOM,l,d,t,s||n,Qa,r]);break;case"Polygon":case"MultiLineString":u=[],h=o=="Polygon"?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),f=this.drawCustomCoordinates_(h,0,t.getEnds(),a,u),this.instructions.push([z.CUSTOM,l,u,t,n,is,r]),this.hitDetectionInstructions.push([z.CUSTOM,l,u,t,s||n,is,r]);break;case"LineString":case"Circle":h=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(h,0,h.length,a,!1,!1),this.instructions.push([z.CUSTOM,l,c,t,n,En,r]),this.hitDetectionInstructions.push([z.CUSTOM,l,c,t,s||n,En,r]);break;case"MultiPoint":h=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(h,a),c>l&&(this.instructions.push([z.CUSTOM,l,c,t,n,En,r]),this.hitDetectionInstructions.push([z.CUSTOM,l,c,t,s||n,En,r]));break;case"Point":h=t.getFlatCoordinates(),this.coordinates.push(h[0],h[1]),c=this.coordinates.length,this.instructions.push([z.CUSTOM,l,c,t,n,void 0,r]),this.hitDetectionInstructions.push([z.CUSTOM,l,c,t,s||n,void 0,r]);break}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[z.BEGIN_GEOMETRY,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[z.BEGIN_GEOMETRY,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;t.reverse();let e;const n=t.length;let s,r,o=-1;for(e=0;e<n;++e)s=t[e],r=s[0],r==z.END_GEOMETRY?o=e:r==z.BEGIN_GEOMETRY&&(s[2]=e,Lc(this.hitDetectionInstructions,o,e),o=-1)}fillStyleToState(t,e={}){if(t){const n=t.getColor();e.fillPatternScale=n&&typeof n=="object"&&"src"in n?this.pixelRatio:1,e.fillStyle=re(n||Nt)}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){const n=t.getColor();e.strokeStyle=re(n||mi);const s=t.getLineCap();e.lineCap=s!==void 0?s:In;const r=t.getLineDash();e.lineDash=r?r.slice():me;const o=t.getLineDashOffset();e.lineDashOffset=o||pe;const a=t.getLineJoin();e.lineJoin=a!==void 0?a:Mn;const l=t.getWidth();e.lineWidth=l!==void 0?l:yi;const h=t.getMiterLimit();e.miterLimit=h!==void 0?h:_i,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(e,n)}createFill(t){const e=t.fillStyle,n=[z.SET_FILL_STYLE,e];return typeof e!="string"&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[z.SET_STROKE_STYLE,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;(typeof n!="string"||t.currentFillStyle!=n)&&(this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,s=t.lineCap,r=t.lineDash,o=t.lineDashOffset,a=t.lineJoin,l=t.lineWidth,h=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=s||r!=t.currentLineDash&&!Re(t.currentLineDash,r)||t.currentLineDashOffset!=o||t.currentLineJoin!=a||t.currentLineWidth!=l||t.currentMiterLimit!=h)&&(e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=s,t.currentLineDash=r,t.currentLineDashOffset=o,t.currentLineJoin=a,t.currentLineWidth=l,t.currentMiterLimit=h)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[z.END_GEOMETRY,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=ga(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;Hs(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class d1 extends Si{constructor(t,e,n,s){super(t,e,n,s),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(t,e,n){if(!this.image_||this.maxExtent&&!_n(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=t.getStride(),o=this.coordinates.length,a=this.appendFlatPointCoordinates(s,r);this.instructions.push([z.DRAW_IMAGE,o,a,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([z.DRAW_IMAGE,o,a,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(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const s=t.getFlatCoordinates(),r=[];for(let l=0,h=s.length;l<h;l+=t.getStride())(!this.maxExtent||_n(this.maxExtent,s.slice(l,l+2)))&&r.push(s[l],s[l+1]);const o=this.coordinates.length,a=this.appendFlatPointCoordinates(r,2);this.instructions.push([z.DRAW_IMAGE,o,a,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([z.DRAW_IMAGE,o,a,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(e)}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(t,e){const n=t.getAnchor(),s=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=s[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=s[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}class f1 extends Si{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinates_(t,e,n,s){const r=this.coordinates.length,o=this.appendFlatLineCoordinates(t,e,n,s,!1,!1),a=[z.MOVE_TO_LINE_TO,r,o];return this.instructions.push(a),this.hitDetectionInstructions.push(a),n}drawLineString(t,e,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([z.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,me,pe],sn);const a=t.getFlatCoordinates(),l=t.getStride();this.drawFlatCoordinates_(a,0,a.length,l),this.hitDetectionInstructions.push(Ne),this.endGeometry(e)}drawMultiLineString(t,e,n){const s=this.state,r=s.strokeStyle,o=s.lineWidth;if(r===void 0||o===void 0)return;this.updateStrokeStyle(s,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([z.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,me,pe],sn);const a=t.getEnds(),l=t.getFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,d=a.length;u<d;++u)c=this.drawFlatCoordinates_(l,c,a[u],h);this.hitDetectionInstructions.push(Ne),this.endGeometry(e)}finish(){const t=this.state;return t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&this.instructions.push(Ne),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){t.lastStroke!=null&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(Ne),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(sn)}}class vh extends Si{constructor(t,e,n,s){super(t,e,n,s)}drawFlatCoordinatess_(t,e,n,s){const r=this.state,o=r.fillStyle!==void 0,a=r.strokeStyle!==void 0,l=n.length;this.instructions.push(sn),this.hitDetectionInstructions.push(sn);for(let h=0;h<l;++h){const c=n[h],u=this.coordinates.length,d=this.appendFlatLineCoordinates(t,e,c,s,!0,!a),f=[z.MOVE_TO_LINE_TO,u,d];this.instructions.push(f),this.hitDetectionInstructions.push(f),a&&(this.instructions.push(Ch),this.hitDetectionInstructions.push(Ch)),e=c}return o&&(this.instructions.push(Rs),this.hitDetectionInstructions.push(Rs)),a&&(this.instructions.push(Ne),this.hitDetectionInstructions.push(Ne)),e}drawCircle(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_FILL_STYLE,Nt]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,me,pe]);const a=t.getFlatCoordinates(),l=t.getStride(),h=this.coordinates.length;this.appendFlatLineCoordinates(a,0,a.length,l,!1,!1);const c=[z.CIRCLE,h];this.instructions.push(sn,c),this.hitDetectionInstructions.push(sn,c),s.fillStyle!==void 0&&(this.instructions.push(Rs),this.hitDetectionInstructions.push(Rs)),s.strokeStyle!==void 0&&(this.instructions.push(Ne),this.hitDetectionInstructions.push(Ne)),this.endGeometry(e)}drawPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_FILL_STYLE,Nt]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,me,pe]);const a=t.getEnds(),l=t.getOrientedFlatCoordinates(),h=t.getStride();this.drawFlatCoordinatess_(l,0,a,h),this.endGeometry(e)}drawMultiPolygon(t,e,n){const s=this.state,r=s.fillStyle,o=s.strokeStyle;if(r===void 0&&o===void 0)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),s.fillStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_FILL_STYLE,Nt]),s.strokeStyle!==void 0&&this.hitDetectionInstructions.push([z.SET_STROKE_STYLE,s.strokeStyle,s.lineWidth,s.lineCap,s.lineJoin,s.miterLimit,me,pe]);const a=t.getEndss(),l=t.getOrientedFlatCoordinates(),h=t.getStride();let c=0;for(let u=0,d=a.length;u<d;++u)c=this.drawFlatCoordinatess_(l,c,a[u],h);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(t!==0){const e=this.coordinates;for(let n=0,s=e.length;n<s;++n)e[n]=qe(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}}function g1(i,t,e,n,s){const r=[];let o=e,a=0,l=t.slice(e,2);for(;a<i&&o+s<n;){const[h,c]=l.slice(-2),u=t[o+s],d=t[o+s+1],f=Math.sqrt((u-h)*(u-h)+(d-c)*(d-c));if(a+=f,a>=i){const _=(i-a+f)/f,p=Ut(h,u,_),m=Ut(c,d,_);l.push(p,m),r.push(l),l=[p,m],a==i&&(o+=s),a=0}else if(a<i)l.push(t[o+s],t[o+s+1]),o+=s;else{const _=f-a,p=Ut(h,u,_/f),m=Ut(c,d,_/f);l.push(p,m),r.push(l),l=[p,m],a=0,o+=s}}return a>0&&r.push(l),r}function _1(i,t,e,n,s){let r=e,o=e,a=0,l=0,h=e,c,u,d,f,_,p,m,y,x,v;for(u=e;u<n;u+=s){const E=t[u],C=t[u+1];_!==void 0&&(x=E-_,v=C-p,f=Math.sqrt(x*x+v*v),m!==void 0&&(l+=d,c=Math.acos((m*x+y*v)/(d*f)),c>i&&(l>a&&(a=l,r=h,o=u),l=0,h=u-s)),d=f,m=x,y=v),_=E,p=C}return l+=f,l>a?[h,u]:[r,o]}const Ts={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1};class m1 extends Si{constructor(t,e,n,s){super(t,e,n,s),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[Nt]={fillStyle:Nt},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const s=this.textFillState_,r=this.textStrokeState_,o=this.textState_;if(this.text_===""||!o||!s&&!r)return;const a=this.coordinates;let l=a.length;const h=t.getType();let c=null,u=t.getStride();if(o.placement==="line"&&(h=="LineString"||h=="MultiLineString"||h=="Polygon"||h=="MultiPolygon")){if(!Pt(this.maxExtent,t.getExtent()))return;let d;if(c=t.getFlatCoordinates(),h=="LineString")d=[c.length];else if(h=="MultiLineString")d=t.getEnds();else if(h=="Polygon")d=t.getEnds().slice(0,1);else if(h=="MultiPolygon"){const m=t.getEndss();d=[];for(let y=0,x=m.length;y<x;++y)d.push(m[y][0])}this.beginGeometry(t,e,n);const f=o.repeat,_=f?void 0:o.textAlign;let p=0;for(let m=0,y=d.length;m<y;++m){let x;f?x=g1(f*this.resolution,c,p,d[m],u):x=[c.slice(p,d[m])];for(let v=0,E=x.length;v<E;++v){const C=x[v];let R=0,I=C.length;if(_==null){const S=_1(o.maxAngle,C,0,C.length,2);R=S[0],I=S[1]}for(let S=R;S<I;S+=u)a.push(C[S],C[S+1]);const T=a.length;p=d[m],this.drawChars_(l,T),l=T}}this.endGeometry(e)}else{let d=o.overflow?null:[];switch(h){case"Point":case"MultiPoint":c=t.getFlatCoordinates();break;case"LineString":c=t.getFlatMidpoint();break;case"Circle":c=t.getCenter();break;case"MultiLineString":c=t.getFlatMidpoints(),u=2;break;case"Polygon":c=t.getFlatInteriorPoint(),o.overflow||d.push(c[2]/this.resolution),u=3;break;case"MultiPolygon":const E=t.getFlatInteriorPoints();c=[];for(let C=0,R=E.length;C<R;C+=3)o.overflow||d.push(E[C+2]/this.resolution),c.push(E[C],E[C+1]);if(c.length===0)return;u=2;break}const f=this.appendFlatPointCoordinates(c,u);if(f===l)return;if(d&&(f-l)/2!==c.length/u){let E=l/2;d=d.filter((C,R)=>{const I=a[(E+R)*2]===c[R*u]&&a[(E+R)*2+1]===c[R*u+1];return I||--E,I})}this.saveTextStates_();const _=o.backgroundFill?this.createFill(this.fillStyleToState(o.backgroundFill)):null,p=o.backgroundStroke?this.createStroke(this.strokeStyleToState(o.backgroundStroke)):null;this.beginGeometry(t,e,n);let m=o.padding;if(m!=nn&&(o.scale[0]<0||o.scale[1]<0)){let E=o.padding[0],C=o.padding[1],R=o.padding[2],I=o.padding[3];o.scale[0]<0&&(C=-C,I=-I),o.scale[1]<0&&(E=-E,R=-R),m=[E,C,R,I]}const y=this.pixelRatio;this.instructions.push([z.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,m==nn?nn:m.map(function(E){return E*y}),_,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]);const x=1/y,v=_?_.slice(0):null;v&&(v[1]=Nt),this.hitDetectionInstructions.push([z.DRAW_IMAGE,l,f,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[x,x],NaN,this.declutterMode_,this.declutterImageWithText_,m,v,p,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?Nt:this.fillKey_,this.textOffsetX_,this.textOffsetY_,d]),this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,s=this.strokeKey_;t&&(s in this.strokeStates||(this.strokeStates[s]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||pi,justify:e.justify,textBaseline:e.textBaseline||_s,scale:e.scale});const o=this.fillKey_;n&&(o in this.fillStates||(this.fillStates[o]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,s=this.textState_,r=this.strokeKey_,o=this.textKey_,a=this.fillKey_;this.saveTextStates_();const l=this.pixelRatio,h=Ts[s.textBaseline],c=this.textOffsetY_*l,u=this.text_,d=n?n.lineWidth*Math.abs(s.scale[0])/2:0;this.instructions.push([z.DRAW_CHARS,t,e,h,s.overflow,a,s.maxAngle,l,c,r,d*l,u,o,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([z.DRAW_CHARS,t,e,h,s.overflow,a&&Nt,s.maxAngle,l,c,r,d*l,u,o,1/l,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let n,s,r;if(!t)this.text_="";else{const o=t.getFill();o?(s=this.textFillState_,s||(s={},this.textFillState_=s),s.fillStyle=re(o.getColor()||Nt)):(s=null,this.textFillState_=s);const a=t.getStroke();if(!a)r=null,this.textStrokeState_=r;else{r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const p=a.getLineDash(),m=a.getLineDashOffset(),y=a.getWidth(),x=a.getMiterLimit();r.lineCap=a.getLineCap()||In,r.lineDash=p?p.slice():me,r.lineDashOffset=m===void 0?pe:m,r.lineJoin=a.getLineJoin()||Mn,r.lineWidth=y===void 0?yi:y,r.miterLimit=x===void 0?_i:x,r.strokeStyle=re(a.getColor()||mi)}n=this.textState_;const l=t.getFont()||Ll;Of(l);const h=t.getScaleArray();n.overflow=t.getOverflow(),n.font=l,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||_s,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||nn,n.scale=h===void 0?[1,1]:h;const c=t.getOffsetX(),u=t.getOffsetY(),d=t.getRotateWithView(),f=t.getKeepUpright(),_=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=c===void 0?0:c,this.textOffsetY_=u===void 0?0:u,this.textRotateWithView_=d===void 0?!1:d,this.textKeepUpright_=f===void 0?!0:f,this.textRotation_=_===void 0?0:_,this.strokeKey_=r?(typeof r.strokeStyle=="string"?r.strokeStyle:Q(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=s&&s.fillStyle?typeof s.fillStyle=="string"?s.fillStyle:"|"+Q(s.fillStyle):""}this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}const p1={Circle:vh,Default:Si,Image:d1,LineString:f1,Polygon:vh,Text:m1};class y1{constructor(t,e,n,s){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=s,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const s in n){const r=n[s].finish();t[e][s]=r}}return t}getBuilder(t,e){const n=t!==void 0?t.toString():"0";let s=this.buildersByZIndex_[n];s===void 0&&(s={},this.buildersByZIndex_[n]=s);let r=s[e];if(r===void 0){const o=p1[e];r=new o(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),s[e]=r}return r}}function x1(i,t,e,n,s,r,o,a,l,h,c,u,d=!0){let f=i[t],_=i[t+1],p=0,m=0,y=0,x=0;function v(){p=f,m=_,t+=n,f=i[t],_=i[t+1],x+=y,y=Math.sqrt((f-p)*(f-p)+(_-m)*(_-m))}do v();while(t<e-n&&x+y<r);let E=y===0?0:(r-x)/y;const C=Ut(p,f,E),R=Ut(m,_,E),I=t-n,T=x,S=r+a*l(h,s,c);for(;t<e-n&&x+y<S;)v();E=y===0?0:(S-x)/y;const L=Ut(p,f,E),O=Ut(m,_,E);let A=!1;if(d)if(u){const W=[C,R,L,O];Va(W,0,4,2,u,W,W),A=W[0]>W[2]}else A=C>L;const k=Math.PI,P=[],X=I+n===t;t=I,y=0,x=T,f=i[t],_=i[t+1];let D;if(X){v(),D=Math.atan2(_-m,f-p),A&&(D+=D>0?-k:k);const W=(L+C)/2,N=(O+R)/2;return P[0]=[W,N,(S-r)/2,D,s],P}s=s.replace(/\n/g," ");for(let W=0,N=s.length;W<N;){v();let K=Math.atan2(_-m,f-p);if(A&&(K+=K>0?-k:k),D!==void 0){let ht=K-D;if(ht+=ht>k?-2*k:ht<-k?2*k:0,Math.abs(ht)>o)return null}D=K;const j=W;let nt=0;for(;W<N;++W){const ht=A?N-W-1:W,Lt=a*l(h,s[ht],c);if(t+n<e&&x+y<r+nt+Lt/2)break;nt+=Lt}if(W===j)continue;const M=A?s.substring(N-j,N-W):s.substring(j,W);E=y===0?0:(r+nt/2-x)/y;const xt=Ut(p,f,E),vt=Ut(m,_,E);P.push([xt,vt,nt/2,K,M]),r+=nt}return P}const Fn=Xt(),Ge=[],xe=[],we=[],We=[];function bh(i){return i[3].declutterBox}const Sh=new RegExp("[֑-ࣿיִ-﷿ﹰ-ﻼࠀ--]");function mo(i,t){return t==="start"?t=Sh.test(i)?"right":"left":t==="end"&&(t=Sh.test(i)?"left":"right"),Ts[t]}function w1(i,t,e){return e>0&&i.push(`
|
|
9
|
+
`,""),i.push(t,""),i}function E1(i,t,e){return e%2===0&&(i+=t),i}class C1{constructor(t,e,n,s,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=s.instructions,this.coordinates=s.coordinates,this.coordinateCache_={},this.renderedTransform_=Jt(),this.hitDetectionInstructions=s.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=s.fillStates||{},this.strokeStates=s.strokeStates||{},this.textStates=s.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new ih:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,s){const r=t+e+n+s;if(this.labels_[r])return this.labels_[r];const o=s?this.strokeStates[s]:null,a=n?this.fillStates[n]:null,l=this.textStates[e],h=this.pixelRatio,c=[l.scale[0]*h,l.scale[1]*h],u=l.justify?Ts[l.justify]:mo(Array.isArray(t)?t[0]:t,l.textAlign||pi),d=s&&o.lineWidth?o.lineWidth:0,f=Array.isArray(t)?t:String(t).split(`
|
|
10
|
+
`).reduce(w1,[]),{width:_,height:p,widths:m,heights:y,lineWidths:x}=Df(l,f),v=_+d,E=[],C=(v+2)*c[0],R=(p+d)*c[1],I={width:C<0?Math.floor(C):Math.ceil(C),height:R<0?Math.floor(R):Math.ceil(R),contextInstructions:E};(c[0]!=1||c[1]!=1)&&E.push("scale",c),s&&(E.push("strokeStyle",o.strokeStyle),E.push("lineWidth",d),E.push("lineCap",o.lineCap),E.push("lineJoin",o.lineJoin),E.push("miterLimit",o.miterLimit),E.push("setLineDash",[o.lineDash]),E.push("lineDashOffset",o.lineDashOffset)),n&&E.push("fillStyle",a.fillStyle),E.push("textBaseline","middle"),E.push("textAlign","center");const T=.5-u;let S=u*v+T*d;const L=[],O=[];let A=0,k=0,P=0,X=0,D;for(let W=0,N=f.length;W<N;W+=2){const K=f[W];if(K===`
|
|
11
|
+
`){k+=A,A=0,S=u*v+T*d,++X;continue}const j=f[W+1]||l.font;j!==D&&(s&&L.push("font",j),n&&O.push("font",j),D=j),A=Math.max(A,y[P]);const nt=[K,S+T*m[P]+u*(m[P]-x[X]),.5*(d+A)+k];S+=m[P],s&&L.push("strokeText",nt),n&&O.push("fillText",nt),++P}return Array.prototype.push.apply(E,L),Array.prototype.push.apply(E,O),this.labels_[r]=I,I}replayTextBackground_(t,e,n,s,r,o,a){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,s),t.lineTo.apply(t,r),t.lineTo.apply(t,e),o&&(this.alignAndScaleFill_=o[2],t.fillStyle=o[1],this.fill_(t)),a&&(this.setStrokeStyle_(t,a),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,s,r,o,a,l,h,c,u,d,f,_,p,m){a*=d[0],l*=d[1];let y=n-a,x=s-l;const v=r+h>t?t-h:r,E=o+c>e?e-c:o,C=_[3]+v*d[0]+_[1],R=_[0]+E*d[1]+_[2],I=y-_[3],T=x-_[0];(p||u!==0)&&(Ge[0]=I,We[0]=I,Ge[1]=T,xe[1]=T,xe[0]=I+C,we[0]=xe[0],we[1]=T+R,We[1]=we[1]);let S;return u!==0?(S=ge(Jt(),n,s,1,1,u,-n,-s),yt(S,Ge),yt(S,xe),yt(S,we),yt(S,We),Le(Math.min(Ge[0],xe[0],we[0],We[0]),Math.min(Ge[1],xe[1],we[1],We[1]),Math.max(Ge[0],xe[0],we[0],We[0]),Math.max(Ge[1],xe[1],we[1],We[1]),Fn)):Le(Math.min(I,I+C),Math.min(T,T+R),Math.max(I,I+C),Math.max(T,T+R),Fn),f&&(y=Math.round(y),x=Math.round(x)),{drawImageX:y,drawImageY:x,drawImageW:v,drawImageH:E,originX:h,originY:c,declutterBox:{minX:Fn[0],minY:Fn[1],maxX:Fn[2],maxY:Fn[3],value:m},canvasTransform:S,scale:d}}replayImageOrLabel_(t,e,n,s,r,o,a){const l=!!(o||a),h=s.declutterBox,c=a?a[2]*s.scale[0]/2:0;return h.minX-c<=e[0]&&h.maxX+c>=0&&h.minY-c<=e[1]&&h.maxY+c>=0&&(l&&this.replayTextBackground_(t,Ge,xe,we,We,o,a),Ff(t,s.canvasTransform,r,n,s.originX,s.originY,s.drawImageW,s.drawImageH,s.drawImageX,s.drawImageY,s.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=yt(this.renderedTransform_,[0,0]),s=512*this.pixelRatio;t.save(),t.translate(n[0]%s,n[1]%s),e!==1&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,n,s){const r=this.textStates[e],o=this.createLabel(t,e,s,n),a=this.strokeStates[n],l=this.pixelRatio,h=mo(Array.isArray(t)?t[0]:t,r.textAlign||pi),c=Ts[r.textBaseline||_s],u=a&&a.lineWidth?a.lineWidth:0,d=o.width/l-2*r.scale[0],f=h*d+2*(.5-h)*u,_=c*o.height/l+2*(.5-c)*u;return{label:o,anchorX:f,anchorY:_}}execute_(t,e,n,s,r,o,a,l){const h=this.zIndexContext_;let c;this.pixelCoordinates_&&Re(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=ke(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),Lu(this.renderedTransform_,n));let u=0;const d=s.length;let f=0,_,p,m,y,x,v,E,C,R,I,T,S,L,O=0,A=0;const k=this.coordinateCache_,P=this.viewRotation_,X=Math.round(Math.atan2(-n[1],n[0])*1e12)/1e12,D={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},W=this.instructions!=s||this.overlaps?0:200;let N,K,j,nt;for(;u<d;){const M=s[u];switch(M[0]){case z.BEGIN_GEOMETRY:N=M[1],nt=M[3],N.getGeometry()?a!==void 0&&!Pt(a,nt.getExtent())?u=M[2]+1:++u:u=M[2],h&&(h.zIndex=M[4]);break;case z.BEGIN_PATH:O>W&&(this.fill_(t),O=0),A>W&&(t.stroke(),A=0),!O&&!A&&(t.beginPath(),x=NaN,v=NaN),++u;break;case z.CIRCLE:f=M[1];const vt=c[f],ht=c[f+1],Lt=c[f+2],wt=c[f+3],Zt=Lt-vt,Wt=wt-ht,F=Math.sqrt(Zt*Zt+Wt*Wt);t.moveTo(vt+F,ht),t.arc(vt,ht,F,0,2*Math.PI,!0),++u;break;case z.CLOSE_PATH:t.closePath(),++u;break;case z.CUSTOM:f=M[1],_=M[2];const rt=M[3],H=M[4],_t=M[5];D.geometry=rt,D.feature=N,u in k||(k[u]=[]);const mt=k[u];_t?_t(c,f,_,2,mt):(mt[0]=c[f],mt[1]=c[f+1],mt.length=2),h&&(h.zIndex=M[6]),H(mt,D),++u;break;case z.DRAW_IMAGE:f=M[1],_=M[2],R=M[3],p=M[4],m=M[5];let Rt=M[6];const ae=M[7],zn=M[8],Nn=M[9],Ri=M[10];let on=M[11];const Gn=M[12];let Wn=M[13];y=M[14]||"declutter";const Et=M[15];if(!R&&M.length>=20){I=M[19],T=M[20],S=M[21],L=M[22];const jt=this.drawLabelWithPointPlacement_(I,T,S,L);R=jt.label,M[3]=R;const an=M[23];p=(jt.anchorX-an)*this.pixelRatio,M[4]=p;const Ht=M[24];m=(jt.anchorY-Ht)*this.pixelRatio,M[5]=m,Rt=R.height,M[6]=Rt,Wn=R.width,M[13]=Wn}let Eo;M.length>25&&(Eo=M[25]);let Co,Ls,As;M.length>17?(Co=M[16],Ls=M[17],As=M[18]):(Co=nn,Ls=null,As=null),Ri&&X?on+=P:!Ri&&!X&&(on-=P);let c0=0;for(;f<_;f+=2){if(Eo&&Eo[c0++]<Wn/this.pixelRatio)continue;const jt=this.calculateImageOrLabelDimensions_(R.width,R.height,c[f],c[f+1],Wn,Rt,p,m,zn,Nn,on,Gn,r,Co,!!Ls||!!As,N),an=[t,e,R,jt,ae,Ls,As];if(l){let Ht,le,$t;if(Et){const ut=_-f;if(!Et[ut]){Et[ut]={args:an,declutterMode:y};continue}const At=Et[ut];Ht=At.args,le=At.declutterMode,delete Et[ut],$t=bh(Ht)}let Ee,Ce;if(Ht&&(le!=="declutter"||!l.collides($t))&&(Ee=!0),(y!=="declutter"||!l.collides(jt.declutterBox))&&(Ce=!0),le==="declutter"&&y==="declutter"){const ut=Ee&&Ce;Ee=ut,Ce=ut}Ee&&(le!=="none"&&l.insert($t),this.replayImageOrLabel_.apply(this,Ht)),Ce&&(y!=="none"&&l.insert(jt.declutterBox),this.replayImageOrLabel_.apply(this,an))}else this.replayImageOrLabel_.apply(this,an)}++u;break;case z.DRAW_CHARS:const Bh=M[1],Yh=M[2],vo=M[3],u0=M[4];L=M[5];const d0=M[6],Vh=M[7],Kh=M[8];S=M[9];const bo=M[10];I=M[11],Array.isArray(I)&&(I=I.reduce(E1,"")),T=M[12];const Zh=[M[13],M[13]];y=M[14]||"declutter";const f0=M[15],So=this.textStates[T],Ti=So.font,Ii=[So.scale[0]*Vh,So.scale[1]*Vh];let Mi;Ti in this.widths_?Mi=this.widths_[Ti]:(Mi={},this.widths_[Ti]=Mi);const jh=jg(c,Bh,Yh,2),Hh=Math.abs(Ii[0])*Pl(Ti,I,Mi);if(u0||Hh<=jh){const jt=this.textStates[T].textAlign,an=(jh-Hh)*mo(I,jt),Ht=x1(c,Bh,Yh,2,I,an,d0,Math.abs(Ii[0]),Pl,Ti,Mi,X?0:this.viewRotation_,f0);t:if(Ht){const le=[];let $t,Ee,Ce,ut,At;if(S)for($t=0,Ee=Ht.length;$t<Ee;++$t){At=Ht[$t],Ce=At[4],ut=this.createLabel(Ce,T,"",S),p=At[2]+(Ii[0]<0?-bo:bo),m=vo*ut.height+(.5-vo)*2*bo*Ii[1]/Ii[0]-Kh;const ve=this.calculateImageOrLabelDimensions_(ut.width,ut.height,At[0],At[1],ut.width,ut.height,p,m,0,0,At[3],Zh,!1,nn,!1,N);if(l&&y==="declutter"&&l.collides(ve.declutterBox))break t;le.push([t,e,ut,ve,1,null,null])}if(L)for($t=0,Ee=Ht.length;$t<Ee;++$t){At=Ht[$t],Ce=At[4],ut=this.createLabel(Ce,T,L,""),p=At[2],m=vo*ut.height-Kh;const ve=this.calculateImageOrLabelDimensions_(ut.width,ut.height,At[0],At[1],ut.width,ut.height,p,m,0,0,At[3],Zh,!1,nn,!1,N);if(l&&y==="declutter"&&l.collides(ve.declutterBox))break t;le.push([t,e,ut,ve,1,null,null])}l&&y!=="none"&&l.load(le.map(bh));for(let ve=0,g0=le.length;ve<g0;++ve)this.replayImageOrLabel_.apply(this,le[ve])}}++u;break;case z.END_GEOMETRY:if(o!==void 0){N=M[1];const jt=o(N,nt,y);if(jt)return jt}++u;break;case z.FILL:W?O++:this.fill_(t),++u;break;case z.MOVE_TO_LINE_TO:for(f=M[1],_=M[2],K=c[f],j=c[f+1],t.moveTo(K,j),x=K+.5|0,v=j+.5|0,f+=2;f<_;f+=2)K=c[f],j=c[f+1],E=K+.5|0,C=j+.5|0,(f==_-2||E!==x||C!==v)&&(t.lineTo(K,j),x=E,v=C);++u;break;case z.SET_FILL_STYLE:this.alignAndScaleFill_=M[2],O&&(this.fill_(t),O=0,A&&(t.stroke(),A=0)),t.fillStyle=M[1],++u;break;case z.SET_STROKE_STYLE:A&&(t.stroke(),A=0),this.setStrokeStyle_(t,M),++u;break;case z.STROKE:W?A++:t.stroke(),++u;break;default:++u;break}}O&&this.fill_(t),A&&t.stroke()}execute(t,e,n,s,r,o){this.viewRotation_=s,this.execute_(t,e,n,this.instructions,r,void 0,void 0,o)}executeHitDetection(t,e,n,s,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,s,r)}}const rn=["Polygon","Circle","LineString","Image","Text","Default"],Rh=["Image","Text"],v1=rn.filter(i=>!Rh.includes(i));class b1{constructor(t,e,n,s,r,o,a){this.maxExtent_=t,this.overlaps_=s,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=o,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=Jt(),this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,a)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let s=this.executorsByZIndex_[n];s===void 0&&(s={},this.executorsByZIndex_[n]=s);const r=t[n];for(const o in r){const a=r[o];s[o]=new C1(this.resolution_,this.pixelRatio_,this.overlaps_,a,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let s=0,r=t.length;s<r;++s)if(t[s]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,s,r,o){s=Math.round(s);const a=s*2+1,l=ge(this.hitDetectionTransform_,s+.5,s+.5,1/e,-1/e,-n,-t[0],-t[1]),h=!this.hitDetectionContext_;h&&(this.hitDetectionContext_=ft(a,a));const c=this.hitDetectionContext_;c.canvas.width!==a||c.canvas.height!==a?(c.canvas.width=a,c.canvas.height=a):h||c.clearRect(0,0,a,a);let u;this.renderBuffer_!==void 0&&(u=Xt(),qn(u,t),Hs(u,e*(this.renderBuffer_+s),u));const d=S1(s);let f;function _(C,R,I){const T=c.getImageData(0,0,a,a).data;for(let S=0,L=d.length;S<L;S++)if(T[d[S]]>0){if(!o||I==="none"||f!=="Image"&&f!=="Text"||o.includes(C)){const O=(d[S]-3)/4,A=s-O%a,k=s-(O/a|0),P=r(C,R,A*A+k*k);if(P)return P}c.clearRect(0,0,a,a);break}}const p=Object.keys(this.executorsByZIndex_).map(Number);p.sort(ue);let m,y,x,v,E;for(m=p.length-1;m>=0;--m){const C=p[m].toString();for(x=this.executorsByZIndex_[C],y=rn.length-1;y>=0;--y)if(f=rn[y],v=x[f],v!==void 0&&(E=v.executeHitDetection(c,l,n,_,u),E))return E}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],s=e[1],r=e[2],o=e[3],a=[n,s,n,o,r,o,r,s];return ke(a,0,8,2,t,a),a}isEmpty(){return un(this.executorsByZIndex_)}execute(t,e,n,s,r,o,a){const l=Object.keys(this.executorsByZIndex_).map(Number);l.sort(a?Mc:ue),o=o||rn;const h=rn.length;for(let c=0,u=l.length;c<u;++c){const d=l[c].toString(),f=this.executorsByZIndex_[d];for(let _=0,p=o.length;_<p;++_){const m=o[_],y=f[m];if(y!==void 0){const x=a===null?void 0:y.getZIndexContext(),v=x?x.getContext():t,E=this.maxExtent_&&m!=="Image"&&m!=="Text";if(E&&(v.save(),this.clip(v,n)),!x||m==="Text"||m==="Image"?y.execute(v,e,n,s,r,a):x.pushFunction(C=>y.execute(C,e,n,s,r,a)),E&&v.restore(),x){x.offset();const C=l[c]*h+rn.indexOf(m);this.deferredZIndexContexts_[C]||(this.deferredZIndexContexts_[C]=[]),this.deferredZIndexContexts_[C].push(x)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(ue);for(let n=0,s=e.length;n<s;++n)t[e[n]].forEach(r=>{r.draw(this.renderedContext_),r.clear()}),t[e[n]].length=0}}const po={};function S1(i){if(po[i]!==void 0)return po[i];const t=i*2+1,e=i*i,n=new Array(e+1);for(let r=0;r<=i;++r)for(let o=0;o<=i;++o){const a=r*r+o*o;if(a>e)break;let l=n[a];l||(l=[],n[a]=l),l.push(((i+r)*t+(i+o))*4+3),r>0&&l.push(((i-r)*t+(i+o))*4+3),o>0&&(l.push(((i+r)*t+(i-o))*4+3),r>0&&l.push(((i-r)*t+(i-o))*4+3))}const s=[];for(let r=0,o=n.length;r<o;++r)n[r]&&s.push(...n[r]);return po[i]=s,s}const oe=.5;function R1(i,t,e,n,s,r,o,a,l){const h=s,c=i[0]*oe,u=i[1]*oe,d=ft(c,u);d.imageSmoothingEnabled=!1;const f=d.canvas,_=new Hg(d,oe,s,null,o,a,null),p=e.length,m=Math.floor((256*256*256-1)/p),y={};for(let v=1;v<=p;++v){const E=e[v-1],C=E.getStyleFunction()||n;if(!C)continue;let R=C(E,r);if(!R)continue;Array.isArray(R)||(R=[R]);const T=(v*m).toString(16).padStart(7,"#00000");for(let S=0,L=R.length;S<L;++S){const O=R[S],A=O.getGeometryFunction()(E);if(!A||!Pt(h,A.getExtent()))continue;const k=O.clone(),P=k.getFill();P&&P.setColor(T);const X=k.getStroke();X&&(X.setColor(T),X.setLineDash(null)),k.setText(void 0);const D=O.getImage();if(D){const j=D.getImageSize();if(!j)continue;const nt=ft(j[0],j[1],void 0,{alpha:!1}),M=nt.canvas;nt.fillStyle=T,nt.fillRect(0,0,M.width,M.height),k.setImage(new Ei({img:M,anchor:D.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:D.getOrigin(),opacity:1,size:D.getSize(),scale:D.getScale(),rotation:D.getRotation(),rotateWithView:D.getRotateWithView()}))}const W=k.getZIndex()||0;let N=y[W];N||(N={},y[W]=N,N.Polygon=[],N.Circle=[],N.LineString=[],N.Point=[]);const K=A.getType();if(K==="GeometryCollection"){const j=A.getGeometriesArrayRecursive();for(let nt=0,M=j.length;nt<M;++nt){const xt=j[nt];N[xt.getType().replace("Multi","")].push(xt,k)}}else N[K.replace("Multi","")].push(A,k)}}const x=Object.keys(y).map(Number).sort(ue);for(let v=0,E=x.length;v<E;++v){const C=y[x[v]];for(const R in C){const I=C[R];for(let T=0,S=I.length;T<S;T+=2){_.setStyle(I[T+1]);for(let L=0,O=t.length;L<O;++L)_.setTransform(t[L]),_.drawGeometry(I[T])}}}return d.getImageData(0,0,f.width,f.height)}function T1(i,t,e){const n=[];if(e){const s=Math.floor(Math.round(i[0])*oe),r=Math.floor(Math.round(i[1])*oe),o=(lt(s,0,e.width-1)+lt(r,0,e.height-1)*e.width)*4,a=e.data[o],l=e.data[o+1],c=e.data[o+2]+256*(l+256*a),u=Math.floor((256*256*256-1)/t.length);c&&c%u===0&&n.push(t[c/u-1])}return n}class I1 extends rh{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=Xt(),this.wrappedRenderedExtent_=Xt(),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(t,e,n){const s=e.extent,r=e.viewState,o=r.center,a=r.resolution,l=r.projection,h=r.rotation,c=l.getExtent(),u=this.getLayer().getSource(),d=this.getLayer().getDeclutter(),f=e.pixelRatio,_=e.viewHints,p=!(_[St.ANIMATING]||_[St.INTERACTING]),m=this.context,y=Math.round(it(s)/a*f),x=Math.round(It(s)/a*f),v=u.getWrapX()&&l.canWrapX(),E=v?it(c):null,C=v?Math.ceil((s[2]-c[2])/E)+1:1;let R=v?Math.floor((s[0]-c[0])/E):0;do{let I=this.getRenderTransform(o,a,0,f,y,x,R*E);e.declutter&&(I=I.slice(0)),t.execute(m,[m.canvas.width,m.canvas.height],I,h,p,n===void 0?rn:n?Rh:v1,n?d&&e.declutter[d]:void 0)}while(++R<C)}setDrawContext_(){this.opacity_!==1&&(this.targetContext_=this.context,this.context=ft(this.context.canvas.width,this.context.canvas.height,sh))}resetDrawContext_(){if(this.opacity_!==1&&this.targetContext_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,hs(this.context),sh.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){!this.replayGroup_||!this.getLayer().getDeclutter()||this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const s=t.viewState;this.prepareContainer(t,e);const r=this.context,o=this.replayGroup_;let a=o&&!o.isEmpty();if(!a&&!(this.getLayer().hasListener(Yt.PRERENDER)||this.getLayer().hasListener(Yt.POSTRENDER)))return this.container;if(this.setDrawContext_(),this.preRender(r,t),s.projection,this.clipped_=!1,a&&n.extent&&this.clipping){const l=Ae(n.extent);a=Pt(l,t.extent),this.clipped_=a&&!Hn(l,t.extent),this.clipped_&&this.clipUnrotated(r,t,l)}return a&&this.renderWorlds(o,t,this.getLayer().getDeclutter()?!1:void 0),!t.declutter&&this.clipped_&&r.restore(),this.postRender(r,t),this.renderedRotation_!==s.rotation&&(this.renderedRotation_=s.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const n=this.frameState.size.slice(),s=this.renderedCenter_,r=this.renderedResolution_,o=this.renderedRotation_,a=this.renderedProjection_,l=this.wrappedRenderedExtent_,h=this.getLayer(),c=[],u=n[0]*oe,d=n[1]*oe;c.push(this.getRenderTransform(s,r,o,oe,u,d,0).slice());const f=h.getSource(),_=a.getExtent();if(f.getWrapX()&&a.canWrapX()&&!Hn(_,l)){let p=l[0];const m=it(_);let y=0,x;for(;p<_[0];)--y,x=m*y,c.push(this.getRenderTransform(s,r,o,oe,u,d,x).slice()),p+=m;for(y=0,p=l[2];p>_[2];)++y,x=m*y,c.push(this.getRenderTransform(s,r,o,oe,u,d,x).slice()),p-=m}this.hitDetectionImageData_=R1(n,c,this.renderedFeatures_,h.getStyleFunction(),l,r,o,_h(r,this.renderedPixelRatio_))}e(T1(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,s,r){if(!this.replayGroup_)return;const o=e.viewState.resolution,a=e.viewState.rotation,l=this.getLayer(),h={},c=function(d,f,_){const p=Q(d),m=h[p];if(m){if(m!==!0&&_<m.distanceSq){if(_===0)return h[p]=!0,r.splice(r.lastIndexOf(m),1),s(d,l,f);m.geometry=f,m.distanceSq=_}}else{if(_===0)return h[p]=!0,s(d,l,f);r.push(h[p]={feature:d,layer:l,geometry:f,distanceSq:_,callback:s})}},u=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,o,a,n,c,u?e.declutter?.[u]?.all().map(d=>d.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const s=t.viewHints[St.ANIMATING],r=t.viewHints[St.INTERACTING],o=e.getUpdateWhileAnimating(),a=e.getUpdateWhileInteracting();if(this.ready&&!o&&s||!a&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const l=t.extent,h=t.viewState,c=h.projection,u=h.resolution,d=t.pixelRatio,f=e.getRevision(),_=e.getRenderBuffer();let p=e.getRenderOrder();p===void 0&&(p=qg);const m=h.center.slice(),y=Hs(l,_*u),x=y.slice(),v=[y.slice()],E=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!Hn(E,t.extent)){const P=it(E),X=Math.max(it(y)/2,P);y[0]=E[0]-X,y[2]=E[2]+X,va(m,c);const D=Ea(v[0],c);D[0]<E[0]&&D[2]<E[2]?v.push([D[0]+P,D[1],D[2]+P,D[3]]):D[0]>E[0]&&D[2]>E[2]&&v.push([D[0]-P,D[1],D[2]-P,D[3]])}if(this.ready&&this.renderedResolution_==u&&this.renderedRevision_==f&&this.renderedRenderOrder_==p&&this.renderedFrameDeclutter_===!!t.declutter&&Hn(this.wrappedRenderedExtent_,y))return Re(this.renderedExtent_,x)||(this.hitDetectionImageData_=null,this.renderedExtent_=x),this.renderedCenter_=m,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const C=new y1(mh(u,d),y,u,d);let R;for(let P=0,X=v.length;P<X;++P)n.loadFeatures(v[P],u,c);const I=_h(u,d);let T=!0;const S=(P,X)=>{let D;const W=P.getStyleFunction()||e.getStyleFunction();if(W&&(D=W(P,u)),D){const N=this.renderFeature(P,I,D,C,R,this.getLayer().getDeclutter(),X);T=T&&!N}},L=Xa(y),O=n.getFeaturesInExtent(L);p&&O.sort(p);for(let P=0,X=O.length;P<X;++P)S(O[P],P);this.renderedFeatures_=O,this.ready=T;const A=C.finish(),k=new b1(y,u,d,n.getOverlaps(),A,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=u,this.renderedRevision_=f,this.renderedRenderOrder_=p,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=x,this.wrappedRenderedExtent_=y,this.renderedCenter_=m,this.renderedProjection_=c,this.renderedPixelRatio_=d,this.replayGroup_=k,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,s,r,o,a){if(!n)return!1;let l=!1;if(Array.isArray(n))for(let h=0,c=n.length;h<c;++h)l=ph(s,t,n[h],e,this.boundHandleStyleImageChange_,r,o,a)||l;else l=ph(s,t,n,e,this.boundHandleStyleImageChange_,r,o,a);return l}}class M1 extends Zl{constructor(t){super(t)}createRenderer(){return new I1(this)}}function L1({latitude:i,longitude:t,name:e,address:n,url:s,timestamp:r,isFromCustomer:o}){const a=Ye(null),l=Ye(null);be(()=>{if(!a.current)return;const u=Iu([t,i]),d=new _o({geometry:new ss(u)});d.setStyle(new De({image:new Ei({anchor:[.5,1],src:"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23ef4444' stroke='white' stroke-width='2'%3E%3Cpath d='M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z'%3E%3C/path%3E%3Ccircle cx='12' cy='10' r='3' fill='white'%3E%3C/circle%3E%3C/svg%3E",scale:1.5})}));const f=new u1({features:[d]}),_=new M1({source:f}),p=new sg({target:a.current,layers:[new Rg({source:new Kg}),_],view:new se({center:u,zoom:15}),controls:[]});return l.current=p,()=>{p.setTarget(void 0),l.current=null}},[i,t]);const h=`https://www.google.com/maps?q=${i},${t}`,c=`https://www.openstreetmap.org/?mlat=${i}&mlon=${t}&zoom=15`;return w("div",{class:`message-wrapper ${o?"message-wrapper-end":"message-wrapper-start"}`,children:w("div",{class:`message-bubble ${o?"message-bubble-customer":"message-bubble-support"}`,children:w("div",{class:"message-media-content",children:[w("div",{ref:a,class:"message-location-map"}),(e||n)&&w("div",{class:"message-location-info",children:[e&&w("p",{class:"message-location-name ",style:o?"color: white;":"color: #18181b;",children:e}),n&&w("p",{class:`message-location-address ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:n})]}),w("div",{class:"message-location-coords",children:[w("svg",{class:`icon-xs ${o?"message-timestamp-customer":"message-timestamp-support"}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("title",{children:"Pin"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),w("span",{class:`message-filesize ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:[i.toFixed(6),", ",t.toFixed(6)]})]}),s&&w("a",{href:s,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,children:"Visit Website"}),w("div",{class:"message-location-links",children:[w("a",{href:h,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,style:"flex: 1;",children:"Google Maps"}),w("a",{href:c,target:"_blank",rel:"noopener noreferrer",class:`message-location-link ${o?"message-location-link-customer":"message-location-link-support"}`,style:"flex: 1;",children:"OpenStreetMap"})]}),w("span",{class:`message-timestamp ${o?"message-timestamp-customer":"message-timestamp-support"}`,children:new Date(r).toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})})]})})})}function A1({messages:i}){const t=Ye(null),e=vc({count:i.length,getScrollElement:()=>t.current,estimateSize:()=>192,overscan:5});be(()=>{i.length>0&&e.scrollToIndex(i.length-1,{align:"end"})},[i.length]);const n=r=>{const o={timestamp:r.timestamp,isFromCustomer:!r.isSupport};switch(r.type){case"text":return w(bc,{content:r.content||"",...o});case"photo":return w(Sc,{url:r.url||"",filename:r.filename,size:r.size,caption:r.content,...o});case"video":return w(Rc,{url:r.url||"",filename:r.filename,size:r.size,caption:r.content,...o});case"file":return w(Tc,{url:r.url||"",filename:r.filename||"file",size:r.size,mimeType:r.mimeType,...o});case"location":return w(L1,{latitude:r.latitude||0,longitude:r.longitude||0,name:r.name,address:r.address,...o});default:return null}},s=e.getVirtualItems();return w("div",{ref:t,class:"message-list",children:w("div",{style:{height:`${e.getTotalSize()}px`,width:"100%",position:"relative"},children:s.map(r=>{const o=i[r.index];return o?w("div",{"data-index":r.index,ref:e.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${r.start}px)`},children:n(o)},r.key):null})})})}function k1(i,t){for(var e in t)i[e]=t[e];return i}function Th(i,t){for(var e in i)if(e!=="__source"&&!(e in t))return!0;for(var n in t)if(n!=="__source"&&i[n]!==t[n])return!0;return!1}function Ih(i,t){this.props=i,this.context=t}(Ih.prototype=new ce).isPureReactComponent=!0,Ih.prototype.shouldComponentUpdate=function(i,t){return Th(this.props,i)||Th(this.state,t)};var Mh=B.__b;B.__b=function(i){i.type&&i.type.__f&&i.ref&&(i.props.ref=i.ref,i.ref=null),Mh&&Mh(i)};var O1=B.__e;B.__e=function(i,t,e,n){if(i.then){for(var s,r=t;r=r.__;)if((s=r.__c)&&s.__c)return t.__e==null&&(t.__e=e.__e,t.__k=e.__k),s.__c(i,t)}O1(i,t,e,n)};var Lh=B.unmount;function Ah(i,t,e){return i&&(i.__c&&i.__c.__H&&(i.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),i.__c.__H=null),(i=k1({},i)).__c!=null&&(i.__c.__P===e&&(i.__c.__P=t),i.__c.__e=!0,i.__c=null),i.__k=i.__k&&i.__k.map(function(n){return Ah(n,t,e)})),i}function kh(i,t,e){return i&&e&&(i.__v=null,i.__k=i.__k&&i.__k.map(function(n){return kh(n,t,e)}),i.__c&&i.__c.__P===t&&(i.__e&&e.appendChild(i.__e),i.__c.__e=!0,i.__c.__P=e)),i}function yo(){this.__u=0,this.o=null,this.__b=null}function Oh(i){var t=i.__.__c;return t&&t.__a&&t.__a(i)}function Is(){this.i=null,this.l=null}B.unmount=function(i){var t=i.__c;t&&t.__R&&t.__R(),t&&32&i.__u&&(i.type=null),Lh&&Lh(i)},(yo.prototype=new ce).__c=function(i,t){var e=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(e);var s=Oh(n.__v),r=!1,o=function(){r||(r=!0,e.__R=null,s?s(a):a())};e.__R=o;var a=function(){if(!--n.__u){if(n.state.__a){var l=n.state.__a;n.__v.__k[0]=kh(l,l.__c.__P,l.__c.__O)}var h;for(n.setState({__a:n.__b=null});h=n.o.pop();)h.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),i.then(o,o)},yo.prototype.componentWillUnmount=function(){this.o=[]},yo.prototype.render=function(i,t){if(this.__b){if(this.__v.__k){var e=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Ah(this.__b,e,n.__O=n.__P)}this.__b=null}var s=t.__a&&g(Xe,null,i.fallback);return s&&(s.__u&=-33),[g(Xe,null,t.__a?null:i.children),s]};var Ph=function(i,t,e){if(++e[1]===e[0]&&i.l.delete(t),i.props.revealOrder&&(i.props.revealOrder[0]!=="t"||!i.l.size))for(e=i.i;e;){for(;e.length>3;)e.pop()();if(e[1]<e[0])break;i.i=e=e[2]}};(Is.prototype=new ce).__a=function(i){var t=this,e=Oh(t.__v),n=t.l.get(i);return n[0]++,function(s){var r=function(){t.props.revealOrder?(n.push(s),Ph(t,i,n)):s()};e?e(r):r()}},Is.prototype.render=function(i){this.i=null,this.l=new Map;var t=Oi(i.children);i.revealOrder&&i.revealOrder[0]==="b"&&t.reverse();for(var e=t.length;e--;)this.l.set(t[e],this.i=[1,0,this.i]);return i.children},Is.prototype.componentDidUpdate=Is.prototype.componentDidMount=function(){var i=this;this.l.forEach(function(t,e){Ph(i,e,t)})};var P1=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,D1=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,F1=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,z1=/[A-Z0-9]/g,N1=typeof document<"u",G1=function(i){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(i)};ce.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(i){Object.defineProperty(ce.prototype,i,{configurable:!0,get:function(){return this["UNSAFE_"+i]},set:function(t){Object.defineProperty(this,i,{configurable:!0,writable:!0,value:t})}})});var Dh=B.event;function W1(){}function U1(){return this.cancelBubble}function X1(){return this.defaultPrevented}B.event=function(i){return Dh&&(i=Dh(i)),i.persist=W1,i.isPropagationStopped=U1,i.isDefaultPrevented=X1,i.nativeEvent=i};var B1={enumerable:!1,configurable:!0,get:function(){return this.class}},Fh=B.vnode;B.vnode=function(i){typeof i.type=="string"&&(function(t){var e=t.props,n=t.type,s={},r=n.indexOf("-")===-1;for(var o in e){var a=e[o];if(!(o==="value"&&"defaultValue"in e&&a==null||N1&&o==="children"&&n==="noscript"||o==="class"||o==="className")){var l=o.toLowerCase();o==="defaultValue"&&"value"in e&&e.value==null?o="value":o==="download"&&a===!0?a="":l==="translate"&&a==="no"?a=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?o="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||G1(e.type)?l==="onfocus"?o="onfocusin":l==="onblur"?o="onfocusout":F1.test(o)&&(o=l):l=o="oninput":r&&D1.test(o)?o=o.replace(z1,"-$&").toLowerCase():a===null&&(a=void 0),l==="oninput"&&s[o=l]&&(o="oninputCapture"),s[o]=a}}n=="select"&&s.multiple&&Array.isArray(s.value)&&(s.value=Oi(e.children).forEach(function(h){h.props.selected=s.value.indexOf(h.props.value)!=-1})),n=="select"&&s.defaultValue!=null&&(s.value=Oi(e.children).forEach(function(h){h.props.selected=s.multiple?s.defaultValue.indexOf(h.props.value)!=-1:s.defaultValue==h.props.value})),e.class&&!e.className?(s.class=e.class,Object.defineProperty(s,"className",B1)):(e.className&&!e.class||e.class&&e.className)&&(s.class=s.className=e.className),t.props=s})(i),i.$$typeof=P1,Fh&&Fh(i)};var zh=B.__r;B.__r=function(i){zh&&zh(i),i.__c};var Nh=B.diffed;B.diffed=function(i){Nh&&Nh(i);var t=i.props,e=i.__e;e!=null&&i.type==="textarea"&&"value"in t&&t.value!==e.value&&(e.value=t.value==null?"":t.value)};const xo=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg",baseProfile:"tiny",viewBox:"0 0 1000 1000",overflow:"visible","xmlns:v":"https://vecta.io/nano",...i},g("linearGradient",{id:"A",gradientUnits:"userSpaceOnUse",x1:830.5784,y1:292.0937,x2:904.9009,y2:370.9836},g("stop",{offset:.176,stopColor:"#fb8c0b"}),g("stop",{offset:.2112,stopColor:"#fb8d12"}),g("stop",{offset:.5104,stopColor:"#fd964b"}),g("stop",{offset:.7327,stopColor:"#ff9c6e"}),g("stop",{offset:.852,stopColor:"#ff9e7b"})),g("path",{fill:"url(#A)",d:"M858.44 302.57l.02.02c44.13 50.68 60.09 100.95 60.58 102.51-11.62-16.59-25.32-28.2-25.32-28.2-44.96-75.63-79.85-89.47-80.92-89.88.94.14 19.93 3.2 45.62 15.54l.02.01z"}),g("linearGradient",{id:"B",gradientUnits:"userSpaceOnUse",x1:550.4614,y1:225.9705,x2:954.0455,y2:611.2855},g("stop",{offset:.0927,stopColor:"#ff9b00"}),g("stop",{offset:.1525,stopColor:"#fd9501"}),g("stop",{offset:.3972,stopColor:"#f78105"}),g("stop",{offset:.5633,stopColor:"#f57a07"}),g("stop",{offset:.6623,stopColor:"#f68006"}),g("stop",{offset:.7888,stopColor:"#f88f05"}),g("stop",{offset:.9298,stopColor:"#fcaa02"}),g("stop",{offset:.9506,stopColor:"#fdae01"})),g("path",{fill:"url(#B)",d:"M767.48 327.05c-147.63-77.8-276.72-27.72-321.56-5.16 42.21-31.97 102.06-62.94 178.44-67.27 0 0 114.88-1.26 181.54 68.47-.71-1.17-23.82-38.95-74.72-62.25 0 0 81.58 26.17 131.39 85.31-.27-.98-9.32-32.16-49.76-59.13 1.07.41 35.96 14.25 80.92 89.88 42.37 107.53 37.37 172 37.37 172-3.12-14.64-9.65-37.69-9.65-37.69 5.92 74.75-19.62 145.44-19.62 145.44 5.29-42.35 2.49-86.57 2.49-86.57-.31 9.04-3.73 28.65-3.73 28.65-5.92-151.34-70.56-210.27-94.98-227.65-62.6-44.52-152.21-53.8-175.95-52.93l-10.09.46c-6.74.35-13.26.82-19.58 1.39 65.15-24.14 165.23 6.36 167.49 7.05z"}),g("linearGradient",{id:"C",gradientUnits:"userSpaceOnUse",x1:371.8762,y1:310.8523,x2:862.566,y2:310.8523},g("stop",{offset:.0887,stopColor:"#ffb506"}),g("stop",{offset:.1614,stopColor:"#fd9e05"}),g("stop",{offset:.312,stopColor:"#fa7402"}),g("stop",{offset:.4305,stopColor:"#f85b01"}),g("stop",{offset:.5012,stopColor:"#f75100"}),g("stop",{offset:.6939,stopColor:"#f75f00"}),g("stop",{offset:.8718,stopColor:"#f67000"})),g("path",{fill:"url(#C)",d:"M445.92 321.89c-47.34 35.85-72.51 72.97-74.04 75.24 1.28-2.55 24.45-47.67 76.17-91.23l.03-.03c44.13-37.17 109.02-73.19 198.85-80.67 13.21-1.1 26.5-.72 39.59 1.26 35.22 5.34 107.97 22.42 171.9 76.1-25.69-12.34-44.68-15.4-45.62-15.54 40.44 26.97 49.5 58.16 49.76 59.13-49.81-59.15-131.39-85.31-131.39-85.31 50.9 23.3 74.01 61.08 74.72 62.25-66.66-69.73-181.54-68.47-181.54-68.47-76.37 4.32-136.22 35.29-178.43 67.27z"}),g("linearGradient",{id:"D",gradientUnits:"userSpaceOnUse",x1:768.9774,y1:212.5162,x2:881.7068,y2:297.219},g("stop",{offset:.1369,stopColor:"#feaf02"}),g("stop",{offset:.305,stopColor:"#fcad2e"}),g("stop",{offset:.542,stopColor:"#faab67"}),g("stop",{offset:.7183,stopColor:"#f9aa8a"}),g("stop",{offset:.8128,stopColor:"#f8a997"})),g("path",{fill:"url(#D)",d:"M840.59 250.66c43.31 41.28 60.5 82.56 61.02 83.83-20.04-20.83-42.46-31.58-43.15-31.91l-.02-.02-.02-.02c-.74-1.21-40-64.01-123.03-88.86 11.56-1.62 37-3.27 71.68 5.49.02 0 .02 0 .03.02 39.26 20.51 58.39 42.26 58.39 42.26-10.37-5.8-24.9-10.79-24.9-10.79z"}),g("linearGradient",{id:"E",gradientUnits:"userSpaceOnUse",x1:493.187,y1:254.5463,x2:806.463,y2:255.7919},g("stop",{offset:.2263,stopColor:"#ffaf00"}),g("stop",{offset:.5904,stopColor:"#fd9401"}),g("stop",{offset:.8408,stopColor:"#fc8702"})),g("path",{fill:"url(#E)",d:"M735.39 213.7c83.03 24.84 122.29 87.64 123.03 88.86-63.93-53.68-136.68-70.77-171.9-76.1-13.1-1.98-26.39-2.36-39.59-1.26-89.83 7.48-154.73 43.5-198.85 80.67 28.95-34.29 102.76-102.85 219.37-102.11 25.24.15 47.88 3.92 67.94 9.94z"}),g("linearGradient",{id:"F",gradientUnits:"userSpaceOnUse",x1:311.0594,y1:578.8053,x2:347.5978,y2:307.2579},g("stop",{offset:.2039,stopColor:"#002d61"}),g("stop",{offset:.8575,stopColor:"#006b7c"})),g("path",{fill:"url(#F)",d:"M323.64 464.49s-2.42 55.5 25.71 94.52c-5.2-3.51-10.31-7.23-15.37-11.15-9.43-7.26-18.59-15.21-27.5-23.79-6.69-21.27-10.06-43.78-11.71-62.36-.94-10.63-.71-21.25.69-31.72 1.09-8.12 2.87-16.14 5.35-23.96 0-.02.02-.03.02-.05 2.82-8.93 6.55-17.6 11.15-25.85 11.32-20.31 27.99-44.93 50.57-65.49-21.33 33-31.12 69.37-35.53 98-4.69 30.23-3.38 51.85-3.38 51.85z"}),g("linearGradient",{id:"G",gradientUnits:"userSpaceOnUse",x1:351.8596,y1:378.1933,x2:635.0329,y2:152.319},g("stop",{offset:.176,stopColor:"#00b6af"}),g("stop",{offset:.8408,stopColor:"#06114c"})),g("path",{fill:"url(#G)",d:"M667.02 135.23c58.03 20.84 84.31 41.29 85.11 41.92-58.96-24.91-112.46-24.91-112.46-24.91-157.31-2.06-249.91 128.47-258.73 138.27-6.94 7.71-13.04 15.81-18.4 24.12-22.58 20.56-39.25 45.18-50.57 65.49-4.6 8.25-8.33 16.92-11.15 25.85 1.01-4.44 70.71-305.01 366.2-270.74z"}),g("linearGradient",{id:"H",gradientUnits:"userSpaceOnUse",x1:317.6593,y1:353.339,x2:594.1892,y2:140.7514},g("stop",{offset:.1536,stopColor:"#017c84"}),g("stop",{offset:.8743,stopColor:"#00396d"})),g("path",{fill:"url(#H)",d:"M396.23 170.36c95.5-79.58 228.12-56.71 228.12-56.71 70.39 15.13 109.12 41.09 110.31 41.91-41.09-14.52-67.65-20.32-67.65-20.32-295.49-34.27-365.18 266.3-366.19 270.75 0 .02-.02.03-.02.05 3.69-120.9 44.23-193.02 95.43-235.68z"}),g("linearGradient",{id:"I",gradientUnits:"userSpaceOnUse",x1:266.0229,y1:513.5699,x2:343.252,y2:155.6588},g("stop",{offset:.2934,stopColor:"#004f63"}),g("stop",{offset:.3903,stopColor:"#005366"}),g("stop",{offset:.4955,stopColor:"#006070"}),g("stop",{offset:.6045,stopColor:"#007680"}),g("stop",{offset:.7156,stopColor:"#009497"}),g("stop",{offset:.7731,stopColor:"#00a7a5"})),g("path",{fill:"url(#I)",d:"M284.61 320s22.31-91.88 111.62-149.64c-51.2 42.66-91.74 114.79-95.42 235.68-2.49 7.82-4.27 15.84-5.35 23.96-1.4 10.47-1.64 21.1-.69 31.72 1.65 18.58 5.02 41.09 11.71 62.36-13.78-13.27-26.91-28.05-39.3-44.22-11.4-14.86-20.94-28.79-28.59-43.26-2.2-65.95 11.87-121.84 31.91-167.3 13.54-22.01 28.01-41.18 43.01-57.87-10.05 20.94-25.83 60.64-28.9 108.57z"}),g("linearGradient",{id:"J",gradientUnits:"userSpaceOnUse",x1:302.5277,y1:300.2615,x2:573.4523,y2:113.4169},g("stop",{offset:.1592,stopColor:"#00c6b9"}),g("stop",{offset:.8687,stopColor:"#005399"})),g("path",{fill:"url(#J)",d:"M582.32 102.01c81.38 6.23 111.7 21.17 111.7 21.17-39.45-9.13-69.66-9.54-69.66-9.54s-132.62-22.88-228.12 56.71C306.92 228.12 284.61 320 284.61 320c3.07-47.92 18.84-87.63 28.9-108.58C431.2 80.49 582.32 102.01 582.32 102.01z"}),g("linearGradient",{id:"K",gradientUnits:"userSpaceOnUse",x1:549.8682,y1:85.1864,x2:327.3156,y2:216.3928},g("stop",{offset:.2318,stopColor:"#d2f3ff"}),g("stop",{offset:.6229,stopColor:"#4799c4"})),g("path",{fill:"url(#K)",d:"M313.52 211.41c-15 16.69-29.47 35.86-43.01 57.87 10.12-22.95 21.77-43.25 33.63-60.83 45.47-67.49 118.91-111.42 200-118.3 65.15-5.53 110.99 8.96 110.99 8.96-18.28 0-32.81 2.9-32.81 2.9s-151.12-21.52-268.8 109.4z"}),g("path",{fill:"#f9a9b2",d:"M350.17 106.19c-13.26 7.05-21.95 15.35-21.95 15.35s-23.63 12.08-51.18 35.08c-41.85 28.67-68.09 58.44-68.09 58.44 7.65-19 18.83-40.52 19.18-41.18l.02-.02c63.34-50.69 120.25-67.17 122.02-67.67z"}),g("linearGradient",{id:"L",gradientUnits:"userSpaceOnUse",x1:108.8685,y1:422.9365,x2:199.3843,y2:204.536},g("stop",{offset:.2877,stopColor:"#badbf2"}),g("stop",{offset:.824,stopColor:"#ea8f97"})),g("path",{fill:"url(#L)",d:"M248.04 152.69c-8.71 7.07-19.9 21.16-19.9 21.16l-.02.02c-57.68 58.55-84.26 155.36-84.26 155.36s0 .02-.02.03c-.6 1.09-18.33 33.9-21.13 94.33-10.45-70.31 7.07-143.55 52.79-202.16 35.75-45.82 71.44-68.06 72.54-68.74z"}),g("path",{fill:"#7a8abc",d:"M143.85 329.25c-.6 2.47-32.12 133.35 65.63 260.24-16.29-17.18-30.35-35.11-42.4-52.76-23.68-34.65-38.48-73.41-44.36-113.1v-.05c2.8-60.43 20.53-93.24 21.13-94.33z"}),g("linearGradient",{id:"M",gradientUnits:"userSpaceOnUse",x1:220.3083,y1:187.7026,x2:215.3258,y2:476.6888},g("stop",{offset:.1201,stopColor:"#ff4e62"}),g("stop",{offset:.9134,stopColor:"#f81134"})),g("path",{fill:"url(#M)",d:"M287.41 598.8c-25.21-14.89-50.22-35.01-72.55-62.06-80.56-97.56-71-207.51-71-207.51s26.57-96.81 84.26-155.36c-.35.66-11.52 22.18-19.18 41.18 0 0 26.24-29.77 68.09-58.44-22.25 18.56-47.06 44.27-64.03 76.5-7.67 14.55-13.38 29.93-17.08 45.75-10.26 21.32-26.32 70.04-9.71 145.78 0 0 13.18 105.53 101.2 174.16z"}),g("linearGradient",{id:"N",gradientUnits:"userSpaceOnUse",x1:298.8625,y1:138.71,x2:355.3311,y2:582.9848},g("stop",{offset:.159,stopColor:"#fc152e"}),g("stop",{offset:.4989,stopColor:"#fb163f"}),g("stop",{offset:.6118,stopColor:"#fb1b3c"}),g("stop",{offset:.7462,stopColor:"#f92933"}),g("stop",{offset:.8397,stopColor:"#f8382a"})),g("path",{fill:"url(#N)",d:"M238.59 436.59c7.65 14.47 17.19 28.4 28.59 43.26 12.39 16.17 25.52 30.95 39.3 44.22 8.91 8.58 18.07 16.53 27.5 23.79-102.76-25.31-132.54-137.76-141.17-197.6-3.45-23.91-2.35-48.13 3.12-71.4 3.7-15.82 9.41-31.2 17.08-45.75 16.97-32.23 41.78-57.94 64.03-76.5 27.55-23 51.18-35.08 51.18-35.08 65.18-29.9 97.15-33.63 97.15-33.63-58.96 22.83-110.9 60.74-143.5 96.88-50.85 56.36-67.95 116.83-66.59 156.8 1.35 39.66 9.11 68.23 23.31 95.01z"}),g("linearGradient",{id:"O",gradientUnits:"userSpaceOnUse",x1:358.3707,y1:541.8871,x2:681.6118,y2:217.4005},g("stop",{offset:.1373,stopColor:"#fce304"}),g("stop",{offset:.3727,stopColor:"#fcc703"}),g("stop",{offset:.714,stopColor:"#fca401"}),g("stop",{offset:.8979,stopColor:"#fc9700"})),g("path",{fill:"url(#O)",d:"M370.25 508.1s.54 43.92 20.59 74.09l-7.05-3.27c-11.78-5.68-23.27-12.33-34.45-19.9-28.13-39.03-25.71-94.52-25.71-94.52s-1.31-21.62 3.37-51.84c39-86.01 110.41-144.13 110.41-144.13 108.36-88.02 230.03-84.7 230.03-84.7 60.74 2.25 107.1 18.4 139.63 35.38-34.68-8.77-60.12-7.12-71.68-5.49-20.06-6.01-42.7-9.79-67.95-9.95-116.61-.74-190.42 67.82-219.37 102.11l-.03.03c-51.72 43.56-74.89 88.68-76.17 91.23 1.53-2.27 26.7-39.39 74.04-75.24 44.84-22.56 173.93-72.64 321.56 5.16-2.25-.69-102.33-31.19-167.49-7.07-34.97 3.12-63.7 9.32-87.69 17.49-44.18 15.05-72.31 36.87-93.81 58.8-51.55 52.56-48.23 111.82-48.23 111.82z"}),g("linearGradient",{id:"P",gradientUnits:"userSpaceOnUse",x1:317.0297,y1:590.4086,x2:549.5474,y2:591.2391},g("stop",{offset:.2035,stopColor:"#ffcf00"}),g("stop",{offset:.8463,stopColor:"#ee961e"})),g("path",{fill:"url(#P)",d:"M390.85 582.19c25.98 11.6 53.24 18.5 81.44 20.15 76.89 4.52 121.87-44.98 123.19-46.46-22.56 37.91-56.96 58.61-87.34 69.88-122.63 8.14-175.98-51.24-175.98-51.24s22.99 6.39 51.64 4.39c2.32 1.14 4.69 2.22 7.05 3.28z"}),g("path",{fill:"#ffb709",d:"M508.14 625.76c-35.14 13.07-64.91 13.54-64.91 13.54-22.99 1.78-89.28-1.57-154.68-39.83 113.13 52.35 219.59 26.29 219.59 26.29z"}),g("linearGradient",{id:"Q",gradientUnits:"userSpaceOnUse",x1:173.8351,y1:282.2208,x2:410.5049,y2:644.284},g("stop",{offset:.2095,stopColor:"#fb2847"}),g("stop",{offset:.3121,stopColor:"#fb2c44"}),g("stop",{offset:.4235,stopColor:"#fb393c"}),g("stop",{offset:.5392,stopColor:"#fb4f2d"}),g("stop",{offset:.6576,stopColor:"#fa6e1a"}),g("stop",{offset:.7772,stopColor:"#fa9400"}),g("stop",{offset:.7793,stopColor:"#fa9500"})),g("path",{fill:"url(#Q)",d:"M349.35 559.01c11.18 7.57 22.67 14.22 34.45 19.9-28.65 2-51.64-4.39-51.64-4.39s53.35 59.38 175.98 51.24c0 0-106.46 26.06-219.59-26.29-.38-.22-.76-.44-1.13-.68-88.02-68.63-101.2-174.15-101.2-174.15-16.61-75.74-.55-124.47 9.71-145.78-5.46 23.27-6.57 47.48-3.12 71.4 8.63 59.84 38.41 172.3 141.17 197.61 5.06 3.92 10.17 7.63 15.37 11.14z"}),g("linearGradient",{id:"R",gradientUnits:"userSpaceOnUse",x1:162.403,y1:411.6314,x2:468.828,y2:623.3885},g("stop",{offset:.2318,stopColor:"#09144e"}),g("stop",{offset:.7179,stopColor:"#071c4c"})),g("path",{fill:"url(#R)",d:"M288.55 599.47c65.4 38.26 131.69 41.61 154.68 39.83 0 0 29.77-.47 64.91-13.54 30.38-11.27 64.78-31.97 87.34-69.88h.02c-.38 1.29-11.13 36.15-46.9 71.41-45.07 36.37-91.89 57.15-135.66 67.18-90.21-11.63-156.19-55.1-203.4-104.93l-.05-.05c-97.75-126.89-66.23-257.77-65.63-260.24.02-.02.02-.03.02-.03s-9.56 109.95 71 207.51c22.32 27.05 47.34 47.17 72.55 62.06.36.24.74.46 1.12.68z"}),g("linearGradient",{id:"S",gradientUnits:"userSpaceOnUse",x1:138.8448,y1:758.079,x2:493.8495,y2:801.0532},g("stop",{offset:.1872,stopColor:"#b0185c"}),g("stop",{offset:.852,stopColor:"#431d55"})),g("path",{fill:"url(#S)",d:"M426 804.55s64.78-5.76 134.13-34.04c-95.53 63.68-185 63.52-185 63.52-179.25 6.6-252.16-127.49-253.26-129.52 12.69 15.54 42.22 36.27 43.15 36.92l.02.02s38.6 27.13 77.22 39.93C322.82 825.31 426 804.55 426 804.55z"}),g("linearGradient",{id:"T",gradientUnits:"userSpaceOnUse",x1:85.7245,y1:679.5264,x2:355.015,y2:679.5264},g("stop",{offset:.1927,stopColor:"#ff4e6c"}),g("stop",{offset:.4075,stopColor:"#bc3963"}),g("stop",{offset:.6132,stopColor:"#84285c"}),g("stop",{offset:.765,stopColor:"#601d58"}),g("stop",{offset:.8464,stopColor:"#531956"})),g("path",{fill:"url(#T)",d:"M355.02 781.21c-54.69 5.49-112.75.16-112.75.16-38.62-12.8-77.22-39.93-77.22-39.93l-.02-.02c-67.67-79.32-79.3-166.08-79.3-166.08 9.65 27.76 27.88 56.68 29.02 58.46.02.03.03.06.05.09 44.65 89.69 130.39 122.89 130.39 122.89.02 0 .02 0 .03.02 1.43.72 45.92 22.42 109.8 24.41z"}),g("linearGradient",{id:"U",gradientUnits:"userSpaceOnUse",x1:98.0806,y1:561.1125,x2:281.6034,y2:754.6004},g("stop",{offset:.3101,stopColor:"#f32e6f"}),g("stop",{offset:.4613,stopColor:"#b22566"}),g("stop",{offset:.6104,stopColor:"#7a1e5e"}),g("stop",{offset:.7204,stopColor:"#561959"}),g("stop",{offset:.7793,stopColor:"#491757"})),g("path",{fill:"url(#U)",d:"M154.44 668.16s67.89 83.46 199.31 91.55c0 0-67.04 6.64-108.55-2.9-.02-.02-.02-.02-.03-.02 0 0-85.74-33.2-130.39-122.89-.02-.03-.03-.06-.05-.09-32.23-70.26-45.6-135.14-46.01-137.16 6.03 15.24 21.9 47.37 22.39 48.36.02.02.02.02.02.03-.01.01 23.66 73.5 63.31 123.12z"}),g("linearGradient",{id:"V",gradientUnits:"userSpaceOnUse",x1:75.0084,y1:526.226,x2:365.6554,y2:746.2873},g("stop",{offset:.2655,stopColor:"#001149"}),g("stop",{offset:.3455,stopColor:"#381a59"}),g("stop",{offset:.4348,stopColor:"#702368"}),g("stop",{offset:.5013,stopColor:"#942972"}),g("stop",{offset:.537,stopColor:"#a12b76"}),g("stop",{offset:.5872,stopColor:"#972a75"}),g("stop",{offset:.7885,stopColor:"#742771"}),g("stop",{offset:.8969,stopColor:"#67266f"})),g("path",{fill:"url(#V)",d:"M384.49 709.68c-15.63 6.36-41 12.64-81.05 13.74-45.64-8.25-100.19-24.29-149-55.26-39.66-49.62-63.32-123.11-63.32-123.11 0-.02 0-.02-.02-.03-16.59-56.05-14.52-91.74-14.52-91.74s12.04 121.24 101.23 193.91c35.96 29.3 89.77 50.65 152.88 54.39 23.36 1.39 49.18-.17 76.26-5.81-1.41 1.64-7.44 7.8-22.46 13.91z"}),g("linearGradient",{id:"W",gradientUnits:"userSpaceOnUse",x1:362.453,y1:725.0145,x2:621.5441,y2:629.5162},g("stop",{offset:.2207,stopColor:"#061f5e"}),g("stop",{offset:.5032,stopColor:"#033378"}),g("stop",{offset:.8408,stopColor:"#00509c"})),g("path",{fill:"url(#W)",d:"M643.29 587.49c-1.83 3.72-58.09 114.67-217.98 141.44-14.63 2.46-29.49 3.35-44.32 2.85-18.2-.61-45.7-2.6-77.55-8.36 40.05-1.1 65.41-7.38 81.05-13.74 164.83 2.56 256.02-118.46 258.8-122.19z"}),g("linearGradient",{id:"X",gradientUnits:"userSpaceOnUse",x1:164.869,y1:742.5378,x2:707.341,y2:652.2296},g("stop",{offset:.1242,stopColor:"#281f60"}),g("stop",{offset:.5843,stopColor:"#091a4d"}),g("stop",{offset:.6629,stopColor:"#081d51"}),g("stop",{offset:.7483,stopColor:"#07265e"}),g("stop",{offset:.8369,stopColor:"#043574"}),g("stop",{offset:.9271,stopColor:"#014a92"}),g("stop",{offset:.9419,stopColor:"#004e98"})),g("path",{fill:"url(#X)",d:"M355.02 781.21c-63.87-2-108.36-23.69-109.81-24.4 41.52 9.54 108.55 2.9 108.55 2.9-131.43-8.09-199.31-91.55-199.31-91.55 48.8 30.97 103.36 47.01 149 55.26 31.85 5.76 59.35 7.75 77.55 8.36 14.83.5 29.69-.39 44.32-2.85 159.89-26.76 216.16-137.72 217.98-141.44.02-.03.03-.06.05-.08-27.41 80.56-102.25 142.37-159.31 168.22-46.53 21.07-91.18 26.78-129.02 25.58z"}),g("linearGradient",{id:"Y",gradientUnits:"userSpaceOnUse",x1:523.5785,y1:779.6559,x2:676.3758,y2:497.313},g("stop",{offset:.1313,stopColor:"#04174d"}),g("stop",{offset:.2856,stopColor:"#053067"}),g("stop",{offset:.6132,stopColor:"#0970a9"}),g("stop",{offset:.8799,stopColor:"#0ca8e3"})),g("path",{fill:"url(#Y)",d:"M706.88 571.17v.03c-13.89 84.35-79.3 142.84-79.3 142.84-22.09 22.92-44.93 41.47-67.44 56.47C490.79 798.78 426 804.55 426 804.55s148.48-59.42 216.44-178.84c5.73-10.08 10.33-20.75 14-31.75 7.87-23.65 20.29-68.92 21.17-121.6 15.38 24.72 27.65 57.12 29.27 98.81z"}),g("linearGradient",{id:"Z",gradientUnits:"userSpaceOnUse",x1:307.9633,y1:836.7527,x2:672.5178,y2:504.5846},g("stop",{offset:.1313,stopColor:"#251f5c"}),g("stop",{offset:.5559,stopColor:"#043d80"}),g("stop",{offset:.6334,stopColor:"#1d5795"}),g("stop",{offset:.798,stopColor:"#5b99cb"}),g("stop",{offset:.8911,stopColor:"#81c1ec"})),g("path",{fill:"url(#Z)",d:"M677.61 472.35c-.88 52.68-13.3 97.96-21.17 121.6-3.67 11-8.27 21.68-14 31.75C574.48 745.13 426 804.55 426 804.55s-103.18 20.77-183.74-23.17c0 0 58.06 5.34 112.75-.16 37.85 1.2 82.5-4.52 129.02-25.58 57.05-25.85 131.9-87.66 159.31-168.22l.02-.02s27.31-80.4 3.62-152.76c10.21 9.82 21.03 22.26 30.63 37.71z"}),g("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:429.3755,y1:719.3273,x2:689.297,y2:436.1541},g("stop",{offset:.1416,stopColor:"#0b3882"}),g("stop",{offset:.3507,stopColor:"#074f9d"}),g("stop",{offset:.6646,stopColor:"#036dc0"}),g("stop",{offset:.8337,stopColor:"#0178cd"})),g("path",{fill:"url(#a)",d:"M412.93 694.47c43.77-10.03 90.59-30.81 135.66-67.18 17.55-14.17 34.84-30.68 51.58-49.86 10.91-12.48 32.43-44.68 38.63-83.8 1.2-7.51 1.12-15.16-.03-22.69-2.03-13.18-7.34-35.22-21.13-59.08 5.21 2.94 10.19 6.3 14.88 10.08 4.52 3.64 9.41 7.84 14.45 12.7 23.69 72.36-3.62 152.76-3.62 152.76l-.02.02c-.02.02-.03.05-.05.08-2.79 3.73-93.97 124.75-258.81 122.18 15.02-6.11 21.05-12.26 22.48-13.9l5.98-1.31z"}),g("linearGradient",{id:"b",gradientUnits:"userSpaceOnUse",x1:578.1238,y1:318.1917,x2:862.1276,y2:662.816},g("stop",{offset:.3119,stopColor:"#0a144d"}),g("stop",{offset:.3851,stopColor:"#10144d"}),g("stop",{offset:.4873,stopColor:"#23134d"}),g("stop",{offset:.6064,stopColor:"#40124d"}),g("stop",{offset:.7385,stopColor:"#6a104d"}),g("stop",{offset:.8796,stopColor:"#9e0e4d"}),g("stop",{offset:.9112,stopColor:"#ab0d4d"})),g("path",{fill:"url(#b)",d:"M640.87 373.21c-69.27-29.17-132.5-25.55-149.61-23.85 6.53-4.17 13.54-8.17 21.03-11.89 23.99-8.17 52.72-14.37 87.69-17.49 6.33-.57 12.85-1.04 19.58-1.39 21.6 7.01 115.3 41.34 174.52 126.59 18.77 27.02 53.23 84.56 56.5 165.7-1.81 30.86-6.77 58.33-13.79 82.68.06-53.24-16.09-112.5-24.94-138.18-2.91-8.44-6.34-16.69-10.26-24.7-42.84-87.44-103.83-133.52-160.72-157.47z"}),g("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:306.799,y1:884.7103,x2:578.7616,y2:862.2889},g("stop",{offset:.2765,stopColor:"#ff3051"}),g("stop",{offset:.852,stopColor:"#ed0534"})),g("path",{fill:"url(#c)",d:"M583.56 846.49s-47.32 36.54-176.25 45.26c0 0-52.54-1.67-84.49-18.69l37.63 2.06c.05.02.11.02.16.02-.01 0 111.47 13.9 222.95-28.65z"}),g("path",{fill:"#fbd9df",d:"M836.79 693.57c7.02-24.36 11.98-51.83 13.79-82.68l.17 5.57c1.07 48.16 8.93 195.97-160.47 279.84l19.08-33.8c.02 0 .02-.02.02-.02s91.22-43.2 127.41-168.91z"}),g("linearGradient",{id:"d",gradientUnits:"userSpaceOnUse",x1:678.17,y1:884.6088,x2:788.6159,y2:675.343},g("stop",{offset:.2148,stopColor:"#feb9c2"}),g("stop",{offset:.7754,stopColor:"#c70f4e"})),g("path",{fill:"url(#d)",d:"M798.46 603.44c.83 1.45 23.6 41.64 38.34 90.13-36.2 125.71-127.42 168.91-127.42 168.91s0 .02-.02.02c-1.04.52-47.45 23.95-105.28 38.41 241.25-100.19 195.21-293.99 194.38-297.47z"}),g("linearGradient",{id:"e",gradientUnits:"userSpaceOnUse",x1:509.4222,y1:924.4413,x2:799.0312,y2:683.4119},g("stop",{offset:.3603,stopColor:"#ffafb8"}),g("stop",{offset:.7291,stopColor:"#f60537"})),g("path",{fill:"url(#e)",d:"M543.34 898.79c4.03-1.1 268.08-74.77 255.11-295.39 0 0 0 .02.02.05.83 3.48 46.87 197.28-194.37 297.47-26.31 6.58-54.98 11.3-82.81 11.18 0 0 9.97-6.64 22.01-13.29-.01-.01.01-.01.04-.02z"}),g("linearGradient",{id:"f",gradientUnits:"userSpaceOnUse",x1:698.8871,y1:845.7236,x2:637.436,y2:420.5485},g("stop",{offset:.3569,stopColor:"#cf0038"}),g("stop",{offset:.7682,stopColor:"#211548"})),g("path",{fill:"url(#f)",d:"M811.86 555.39c8.85 25.68 25 84.94 24.94 138.18-14.74-48.49-37.5-88.68-38.34-90.13-.02-.03-.02-.05-.02-.05 12.97 220.63-251.08 294.29-255.11 295.39 64.75-27.41 123.68-94.24 123.68-94.24 63.54-58.53 95.23-149.18 93.37-211.34-3.64-121.27-79.8-191.5-119.52-220 56.9 23.95 117.89 70.03 160.72 157.48 3.93 8.02 7.36 16.27 10.28 24.71z"}),g("linearGradient",{id:"g",gradientUnits:"userSpaceOnUse",x1:587.6385,y1:846.487,x2:587.6385,y2:348.24},g("stop",{offset:.3101,stopColor:"#770840"}),g("stop",{offset:.8408,stopColor:"#42174b"})),g("path",{fill:"url(#g)",d:"M727.22 663c-.57 2-37.36 130.75-143.66 183.49 0 0 46.27-46.96 74.28-121.84 34.82-49.81 50.71-110.64 49.04-153.45v-.03c-1.62-41.69-13.89-74.09-29.27-98.82-9.6-15.44-20.42-27.88-30.64-37.71-5.04-4.86-9.93-9.07-14.45-12.7-4.69-3.78-9.67-7.13-14.88-10.08-9.78-5.56-20.37-9.65-31.39-12.22-25.83-6-52.41-8.86-68.23-10.17-24.07-1.97-48.33 3.07-69.24 15.18-20.97 12.14-33.22 26.83-33.97 27.72.82-1.79 22.92-48.71 76.45-83.01 17.11-1.7 80.34-5.32 149.61 23.85 39.72 28.5 115.89 98.73 119.52 220 1.86 62.15-29.83 152.81-93.37 211.34 0 0 47.73-76.78 60.2-141.55z"}),g("linearGradient",{id:"h",gradientUnits:"userSpaceOnUse",x1:411.3254,y1:909.6648,x2:704.6713,y2:742.1275},g("stop",{offset:.2654,stopColor:"#ff475e"}),g("stop",{offset:.8631,stopColor:"#d9002f"})),g("path",{fill:"url(#h)",d:"M583.56 846.49C689.86 793.75 726.65 665 727.22 663c-12.47 64.77-60.2 141.55-60.2 141.55s-58.93 66.83-123.68 94.24c-.03.02-.05.02-.05.02s-77.65 18.28-171.9-2.49c0 0 18.28-3.32 35.93-4.57 128.92-8.72 176.24-45.26 176.24-45.26z"}),g("linearGradient",{id:"i",gradientUnits:"userSpaceOnUse",x1:308.7588,y1:853.2294,x2:623.2805,y2:787.8339},g("stop",{offset:.2605,stopColor:"#fe0c3a"}),g("stop",{offset:.7245,stopColor:"#960541"})),g("path",{fill:"url(#i)",d:"M619.69 767.19c14.59-12.52 27.3-26.98 38.15-42.54-28.01 74.88-74.28 121.84-74.28 121.84-111.48 42.55-222.96 28.65-222.96 28.65-.05 0-.11 0-.16-.02-3.38-.38-57.84-6.86-88.9-40.05 35.19 23.98 91.55 27.41 117.08 27.41 132.05 0 219.39-85.28 231.07-95.29z"})),Y1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",...i},g("circle",{cx:512,cy:512,r:512,style:{fill:"#5865f2"}}),g("path",{d:"M689.43 349a422.21 422.21 0 0 0-104.22-32.32 1.58 1.58 0 0 0-1.68.79 294.11 294.11 0 0 0-13 26.66 389.78 389.78 0 0 0-117.05 0 269.75 269.75 0 0 0-13.18-26.66 1.64 1.64 0 0 0-1.68-.79A421 421 0 0 0 334.44 349a1.49 1.49 0 0 0-.69.59c-66.37 99.17-84.55 195.9-75.63 291.41a1.76 1.76 0 0 0 .67 1.2 424.58 424.58 0 0 0 127.85 64.63 1.66 1.66 0 0 0 1.8-.59 303.45 303.45 0 0 0 26.15-42.54 1.62 1.62 0 0 0-.89-2.25 279.6 279.6 0 0 1-39.94-19 1.64 1.64 0 0 1-.16-2.72c2.68-2 5.37-4.1 7.93-6.22a1.58 1.58 0 0 1 1.65-.22c83.79 38.26 174.51 38.26 257.31 0a1.58 1.58 0 0 1 1.68.2c2.56 2.11 5.25 4.23 8 6.24a1.64 1.64 0 0 1-.14 2.72 262.37 262.37 0 0 1-40 19 1.63 1.63 0 0 0-.87 2.28 340.72 340.72 0 0 0 26.13 42.52 1.62 1.62 0 0 0 1.8.61 423.17 423.17 0 0 0 128-64.63 1.64 1.64 0 0 0 .67-1.18c10.68-110.44-17.88-206.38-75.7-291.42a1.3 1.3 0 0 0-.63-.63zM427.09 582.85c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.02 28.44-20.37 51.6-46 51.6zm170.13 0c-25.23 0-46-23.16-46-51.6s20.38-51.6 46-51.6c25.83 0 46.42 23.36 46 51.6.01 28.44-20.17 51.6-46 51.6z",style:{fill:"#fff"}})),V1=i=>g("svg",{height:"800px",width:"800px",id:"_x36_",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 512 512",xmlSpace:"preserve",...i},g("g",null,g("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:256.0002,y1:347.8895,x2:256.0002,y2:-8003553e-17},g("stop",{offset:0,style:{stopColor:"#DA9621"}}),g("stop",{offset:.7685,style:{stopColor:"#EAA12F"}})),g("path",{style:{fill:"url(#SVGID_1_)"},d:"M511.972,170.467v11.507c-0.6,0.427-1.372,0.937-2.143,1.448l-19.117,13.041 c-1.285,0.853-2.828,1.875-4.371,2.984c-7.973,5.283-18.345,12.358-25.203,16.876L293.376,329.769l-5.315,3.58l-15.602,10.569 c-1.972,1.278-4.286,2.301-6.858,2.983c-1.029,0.34-2.229,0.511-3.343,0.681c-0.172,0.085-0.343,0.085-0.428,0.085 c-1.972,0.256-3.943,0.256-5.83,0.171c-1.886,0.085-3.857,0.085-5.829-0.171c-1.285-0.171-2.572-0.427-3.772-0.767 c-2.572-0.681-4.886-1.705-6.858-2.983l-7.029-4.774l-8.572-5.795L50.862,216.324c-1.886-1.279-4.029-2.728-6.429-4.262 c-6-4.006-13.03-8.779-18.774-12.614c-1.543-1.109-3.086-2.131-4.372-2.984L2.171,183.423c-0.771-0.511-1.543-1.022-2.143-1.448 v-11.507c0-1.96,0.257-3.494,0.686-4.943c0-0.084,0.086-0.084,0.086-0.084c0.429-0.341,0.857-0.597,1.371-0.939l6.172-4.262 l12.944-8.779c8.143-5.454,21.431-14.489,29.574-19.859L239.541,4.007c4.544-2.898,10.544-4.262,16.459-3.921 c0.6,0,1.114-0.085,1.715-0.085h0.086c5.315,0,10.63,1.365,14.659,4.007l188.679,127.594c6.772,4.432,17.059,11.421,25.031,16.792 c1.629,1.107,3.172,2.131,4.543,3.067l12.944,8.779l6.172,4.262c0.514,0.341,0.943,0.597,1.371,0.939 C511.715,166.888,511.972,168.507,511.972,170.467z"}),g("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:256.0005,y1:398.9169,x2:256.0005,y2:51.0644},g("stop",{offset:0,style:{stopColor:"#DA9621"}}),g("stop",{offset:.7685,style:{stopColor:"#EAA12F"}})),g("path",{style:{fill:"url(#SVGID_2_)"},d:"M512,221.49v11.441c-0.625,0.443-1.429,0.976-2.141,1.508l-19.179,13.037 c-8.116,5.41-21.407,14.455-29.524,19.866L272.502,394.875c-2.051,1.33-4.371,2.305-6.868,3.015 c-3.032,0.887-6.422,1.153-9.633,0.975c-3.211,0.178-6.601-0.089-9.633-0.975c-2.498-0.71-4.817-1.685-6.868-3.015L50.845,267.341 c-8.117-5.411-21.408-14.456-29.524-19.866L2.142,234.439c-0.712-0.533-1.516-1.065-2.141-1.508V221.49 c0-1.951,0.268-3.548,0.714-4.966c0-0.089,0.089-0.089,0.089-0.089c0.446-0.355,0.892-0.622,1.337-0.977l6.245-4.257l12.934-8.78 c8.116-5.41,21.407-14.455,29.524-19.866L239.499,55.023c4.549-2.927,10.614-4.258,16.501-3.903 c5.887-0.355,12.042,0.975,16.501,3.903l188.655,127.532c8.117,5.411,21.408,14.456,29.524,19.866l12.934,8.78l6.245,4.257 c0.445,0.355,0.891,0.621,1.337,0.977C511.732,217.853,512,219.539,512,221.49z"}),g("path",{style:{fill:"#CC8529"},d:"M262.258,314.513v35.968h-1.029l-11.487,0.767H0.028V173.792c0-1.96,0.257-3.58,0.686-4.944 c0-0.085,0.086-0.085,0.086-0.085c0.943-2.983,2.829-4.688,5.315-5.114l10.716,6.307l5.057,2.983l23.06,13.553l1.2,0.681 l14.659,8.609l166.819,98.359l0.343,0.171l33.089,19.433L262.258,314.513z"}),g("g",null,g("path",{style:{fill:"#F6B75A"},d:"M266.715,336.247c0,0.085-1.714,1.279-4.457,3.239c-1.715,1.108-3.858,2.558-6.258,4.262 c-1.2,0.767-2.486,1.619-3.857,2.557l-1.972,1.363l-3.772,2.557l-1.629,1.023l-26.66,17.984c-2.829,1.875-5.658,3.835-8.229,5.626 c-4.886,3.324-8.916,6.051-10.287,6.903c-1.972,1.449-10.201,6.99-18.345,12.529l-44.577,30.088l-0.172,0.171l-0.085,0.085 L27.031,498.447c-1.886,1.279-3.943,2.642-5.915,4.006c-1.115,0.767-2.229,1.449-3.343,2.216H8.515 c-4.972,0-7.801-1.108-8.401-2.983c0-0.085,0-0.085,0-0.085c0-0.341-0.086-0.597,0-1.023c-0.086-0.512-0.086-1.023-0.086-1.62 V173.792c0-1.96,0.257-3.58,0.686-4.944c0-0.085,0.086-0.085,0.086-0.085c0.943-2.983,2.829-4.688,5.315-5.114 c0.771-0.256,1.457-0.256,2.229-0.171c1.886,0.085,4.029,0.938,6.344,2.472l30.346,20.456l1.114,0.767l13.116,8.864 c0.257,0.171,0.514,0.341,0.771,0.512c8.058,5.455,20.745,14.064,28.632,19.348l153.446,103.729 c0.172,0.085,0.343,0.171,0.429,0.256c0.257,0.171,0.514,0.341,0.771,0.512c2.057,1.363,4.029,2.728,5.829,3.92 c3.001,1.96,5.401,3.665,6.858,4.688c0.857,0.512,1.458,0.852,1.543,0.937c0.343,0.255,2.486,1.705,4.715,3.324 c0.086,0,0.086,0.085,0.171,0.085C264.744,334.968,266.715,336.161,266.715,336.247z"}),g("g",null,g("path",{style:{fill:"#F0A642"},d:"M511.865,171.974c0.074,1,0.134,2.92,0.134,4.267v320.232c0,1.347,0,2.708,0,3.025 c0,0.317-0.089,1.248-0.089,1.419c0,0.171,0,0.311,0,0.666c0,0,0,0.02,0,0.044c0,0.024-0.783,0.723-1.74,1.551 c-0.957,0.829-7.747,1.507-9.094,1.507h-4.378c-1.347,0-3.365-0.612-4.486-1.359l-5.204-3.489 c-1.12-0.748-2.95-1.976-4.066-2.731L332.776,395.641c-1.116-0.754-2.942-1.988-4.058-2.742l-14.324-9.753 c-1.112-0.76-2.935-1.999-4.05-2.754l-14.412-9.754c-1.113-0.758-2.938-1.994-4.055-2.747l-24.216-16.33 c-1.117-0.753-2.944-1.984-4.062-2.736l-1.734-1.167c-1.117-0.752-2.95-1.976-4.072-2.72c0,0-0.635-0.421-1.795-1.219 c-6.155-4.257-10.704-7.362-10.704-7.451c0-0.089,1.963-1.329,4.282-2.926c2.318-1.597,2.885-1.986,2.885-1.986 c1.111-0.762,2.161-1.484,2.332-1.607c0.172-0.122,2.109-1.383,3.214-2.152c0,0,5.125-3.567,10.657-7.204 c0.268-0.178,0.268-0.178,0.268-0.178c0.294-0.195,0.595-0.394,0.668-0.443c0.073-0.049,0.954-0.617,1.74-1.153 c0.785-0.536,2.341-1.592,3.457-2.346l146.508-98.984c1.116-0.754,2.941-1.989,4.056-2.745l25.377-17.123 c1.117-0.753,2.944-1.985,4.06-2.739l40.451-27.324c1.116-0.754,3-1.892,4.187-2.529c0,0,1.065-0.637,2.169-0.881 c1.104-0.244,3.079-0.189,4.389,0.123l3.792,2.662C510.562,167.836,511.791,170.974,511.865,171.974z"}))),g("path",{style:{fill:"#CC8529"},d:"M511.999,458.657v40.265c0,0.62,0,1.153-0.089,1.685c0.089,0.355,0,0.621,0,0.976c0,0,0,0,0,0.089 c-0.625,1.862-3.48,3.014-8.385,3.014H46.383l90.001-80.084l0.089-0.089l112.657-100.216l10.972-9.668l2.942-2.661l9.723,5.677 L511.999,458.657z"}),g("path",{style:{fill:"#F6AF47"},d:"M511.999,497.414v1.508c0,0.62,0,1.153-0.089,1.685c0.089,0.355,0,0.621,0,0.976c0,0,0,0,0,0.089 c-0.625,1.862-3.48,3.014-8.385,3.014H8.474c-4.905,0-7.76-1.152-8.385-3.014c0-0.089,0-0.089,0-0.089c0-0.355-0.089-0.621,0-0.976 C0,500.075,0,499.542,0,498.922v-1.508c0.803-1.064,1.963-2.128,3.479-3.193L241.549,320.57c0.089,0,0.089-0.088,0.179-0.176 c0.268-0.178,0.536-0.355,0.803-0.532c4.905-3.46,9.901-5.855,13.469-6.74c1.249,0.354,2.586,0.797,4.104,1.507 c2.854,1.153,6.154,3.016,9.365,5.233c0.356,0.265,0.624,0.443,0.981,0.708l238.069,173.651 C510.035,495.374,511.195,496.438,511.999,497.414z"}))),K1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint0_radial_87_7153)"}),g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint1_radial_87_7153)"}),g("rect",{x:2,y:2,width:28,height:28,rx:6,fill:"url(#paint2_radial_87_7153)"}),g("path",{d:"M23 10.5C23 11.3284 22.3284 12 21.5 12C20.6716 12 20 11.3284 20 10.5C20 9.67157 20.6716 9 21.5 9C22.3284 9 23 9.67157 23 10.5Z",fill:"white"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16 21C18.7614 21 21 18.7614 21 16C21 13.2386 18.7614 11 16 11C13.2386 11 11 13.2386 11 16C11 18.7614 13.2386 21 16 21ZM16 19C17.6569 19 19 17.6569 19 16C19 14.3431 17.6569 13 16 13C14.3431 13 13 14.3431 13 16C13 17.6569 14.3431 19 16 19Z",fill:"white"}),g("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6 15.6C6 12.2397 6 10.5595 6.65396 9.27606C7.2292 8.14708 8.14708 7.2292 9.27606 6.65396C10.5595 6 12.2397 6 15.6 6H16.4C19.7603 6 21.4405 6 22.7239 6.65396C23.8529 7.2292 24.7708 8.14708 25.346 9.27606C26 10.5595 26 12.2397 26 15.6V16.4C26 19.7603 26 21.4405 25.346 22.7239C24.7708 23.8529 23.8529 24.7708 22.7239 25.346C21.4405 26 19.7603 26 16.4 26H15.6C12.2397 26 10.5595 26 9.27606 25.346C8.14708 24.7708 7.2292 23.8529 6.65396 22.7239C6 21.4405 6 19.7603 6 16.4V15.6ZM15.6 8H16.4C18.1132 8 19.2777 8.00156 20.1779 8.0751C21.0548 8.14674 21.5032 8.27659 21.816 8.43597C22.5686 8.81947 23.1805 9.43139 23.564 10.184C23.7234 10.4968 23.8533 10.9452 23.9249 11.8221C23.9984 12.7223 24 13.8868 24 15.6V16.4C24 18.1132 23.9984 19.2777 23.9249 20.1779C23.8533 21.0548 23.7234 21.5032 23.564 21.816C23.1805 22.5686 22.5686 23.1805 21.816 23.564C21.5032 23.7234 21.0548 23.8533 20.1779 23.9249C19.2777 23.9984 18.1132 24 16.4 24H15.6C13.8868 24 12.7223 23.9984 11.8221 23.9249C10.9452 23.8533 10.4968 23.7234 10.184 23.564C9.43139 23.1805 8.81947 22.5686 8.43597 21.816C8.27659 21.5032 8.14674 21.0548 8.0751 20.1779C8.00156 19.2777 8 18.1132 8 16.4V15.6C8 13.8868 8.00156 12.7223 8.0751 11.8221C8.14674 10.9452 8.27659 10.4968 8.43597 10.184C8.81947 9.43139 9.43139 8.81947 10.184 8.43597C10.4968 8.27659 10.9452 8.14674 11.8221 8.0751C12.7223 8.00156 13.8868 8 15.6 8Z",fill:"white"}),g("defs",null,g("radialGradient",{id:"paint0_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(12 23) rotate(-55.3758) scale(25.5196)"},g("stop",{stopColor:"#B13589"}),g("stop",{offset:.79309,stopColor:"#C62F94"}),g("stop",{offset:1,stopColor:"#8A3AC8"})),g("radialGradient",{id:"paint1_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(11 31) rotate(-65.1363) scale(22.5942)"},g("stop",{stopColor:"#E0E8B7"}),g("stop",{offset:.444662,stopColor:"#FB8A2E"}),g("stop",{offset:.71474,stopColor:"#E2425C"}),g("stop",{offset:1,stopColor:"#E2425C",stopOpacity:0})),g("radialGradient",{id:"paint2_radial_87_7153",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"translate(0.500002 3) rotate(-8.1301) scale(38.8909 8.31836)"},g("stop",{offset:.156701,stopColor:"#406ADC"}),g("stop",{offset:.467799,stopColor:"#6A45BE"}),g("stop",{offset:1,stopColor:"#6A45BE",stopOpacity:0})))),Z1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{fill:"#FFE812",d:"M256 236c0 11.046-8.954 20-20 20H20c-11.046 0-20-8.954-20-20V20C0 8.954 8.954 0 20 0h216c11.046 0 20 8.954 20 20v216z"}),g("path",{d:"M128 36C70.562 36 24 72.713 24 118c0 29.279 19.466 54.97 48.748 69.477-1.593 5.494-10.237 35.344-10.581 37.689 0 0-.207 1.762.934 2.434s2.483.15 2.483.15c3.272-.457 37.943-24.811 43.944-29.04 5.995.849 12.168 1.29 18.472 1.29 57.438 0 104-36.712 104-82 0-45.287-46.562-82-104-82z"}),g("path",{fill:"#FFE812",d:"M70.5 146.625c-3.309 0-6-2.57-6-5.73V105.25h-9.362c-3.247 0-5.888-2.636-5.888-5.875s2.642-5.875 5.888-5.875h30.724c3.247 0 5.888 2.636 5.888 5.875s-2.642 5.875-5.888 5.875H76.5v35.645c0 3.16-2.691 5.73-6 5.73zM123.112 146.547c-2.502 0-4.416-1.016-4.993-2.65l-2.971-7.778-18.296-.001-2.973 7.783c-.575 1.631-2.488 2.646-4.99 2.646a9.155 9.155 0 0 1-3.814-.828c-1.654-.763-3.244-2.861-1.422-8.52l14.352-37.776c1.011-2.873 4.082-5.833 7.99-5.922 3.919.088 6.99 3.049 8.003 5.928l14.346 37.759c1.826 5.672.236 7.771-1.418 8.532a9.176 9.176 0 0 1-3.814.827c-.001 0 0 0 0 0zm-11.119-21.056L106 108.466l-5.993 17.025h11.986zM138 145.75c-3.171 0-5.75-2.468-5.75-5.5V99.5c0-3.309 2.748-6 6.125-6s6.125 2.691 6.125 6v35.25h12.75c3.171 0 5.75 2.468 5.75 5.5s-2.579 5.5-5.75 5.5H138zM171.334 146.547c-3.309 0-6-2.691-6-6V99.5c0-3.309 2.691-6 6-6s6 2.691 6 6v12.896l16.74-16.74c.861-.861 2.044-1.335 3.328-1.335 1.498 0 3.002.646 4.129 1.772 1.051 1.05 1.678 2.401 1.764 3.804.087 1.415-.384 2.712-1.324 3.653l-13.673 13.671 14.769 19.566a5.951 5.951 0 0 1 1.152 4.445 5.956 5.956 0 0 1-2.328 3.957 5.94 5.94 0 0 1-3.609 1.211 5.953 5.953 0 0 1-4.793-2.385l-14.071-18.644-2.082 2.082v13.091a6.01 6.01 0 0 1-6.002 6.003z"})),j1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{d:"M30 14.4979C30 8.15792 23.7199 3 15.9999 3C8.28094 3 2 8.15792 2 14.4979C2 20.1817 6.98063 24.9417 13.7084 25.8418C14.1644 25.9412 14.7849 26.146 14.9419 26.5404C15.0831 26.8986 15.0342 27.4598 14.987 27.8216C14.987 27.8216 14.8227 28.8214 14.7873 29.0343C14.7264 29.3926 14.5061 30.4353 15.9999 29.7981C17.4942 29.1609 24.0626 24.9935 26.9998 21.572C29.0287 19.3204 30 17.0353 30 14.4979Z",fill:"#2CCF54"}),g("path",{d:"M13.1553 11.4244H12.1733C12.0228 11.4244 11.9004 11.5478 11.9004 11.6995V17.866C11.9004 18.0179 12.0228 18.1411 12.1733 18.1411H13.1553C13.3059 18.1411 13.428 18.0179 13.428 17.866V11.6995C13.428 11.5478 13.3059 11.4244 13.1553 11.4244Z",fill:"white"}),g("path",{d:"M19.9147 11.4244H18.9327C18.7821 11.4244 18.66 11.5478 18.66 11.6995V15.3631L15.8645 11.5467C15.8128 11.4683 15.729 11.4295 15.6375 11.4244H14.6558C14.5052 11.4244 14.3828 11.5478 14.3828 11.6995V17.866C14.3828 18.0179 14.5052 18.1411 14.6558 18.1411H15.6375C15.7883 18.1411 15.9104 18.0179 15.9104 17.866V14.2035L18.7094 18.0247C18.7597 18.0967 18.845 18.1411 18.9327 18.1411H19.9147C20.0655 18.1411 20.1874 18.0179 20.1874 17.866V11.6995C20.1874 11.5478 20.0655 11.4244 19.9147 11.4244Z",fill:"white"}),g("path",{d:"M10.7884 16.5969H8.12013V11.6998C8.12013 11.5476 7.99802 11.4241 7.84773 11.4241H6.86545C6.71489 11.4241 6.59277 11.5476 6.59277 11.6998V17.8652C6.59277 18.0149 6.71435 18.1411 6.86518 18.1411H10.7884C10.9389 18.1411 11.0605 18.0174 11.0605 17.8652V16.8725C11.0605 16.7203 10.9389 16.5969 10.7884 16.5969Z",fill:"white"}),g("path",{d:"M25.3372 12.9683C25.4878 12.9683 25.6094 12.8452 25.6094 12.6927V11.7C25.6094 11.5478 25.4878 11.4241 25.3372 11.4241H21.4143C21.2636 11.4241 21.1416 11.5501 21.1416 11.6998V17.8655C21.1416 18.0147 21.2633 18.1411 21.4137 18.1411H25.3372C25.4878 18.1411 25.6094 18.0174 25.6094 17.8655V16.8725C25.6094 16.7206 25.4878 16.5969 25.3372 16.5969H22.6692V15.5546H25.3372C25.4878 15.5546 25.6094 15.4311 25.6094 15.2789V14.2863C25.6094 14.1341 25.4878 14.0104 25.3372 14.0104H22.6692V12.9683H25.3372Z",fill:"white"})),H1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 48 48",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",...i},g("title",null,"Messenger-color"),g("desc",null,"Created with Sketch."),g("defs",null),g("g",{id:"Icons",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},g("g",{id:"Color-",transform:"translate(-301.000000, -860.000000)",fill:"#007FFF"},g("path",{d:"M325,860 C311.745143,860 301,869.949185 301,882.222222 C301,889.215556 304.489988,895.453481 309.944099,899.526963 L309.944099,908 L318.115876,903.515111 C320.296745,904.118667 322.607155,904.444444 325,904.444444 C338.254857,904.444444 349,894.495259 349,882.222222 C349,869.949185 338.254857,860 325,860 L325,860 Z M327.385093,889.925926 L321.273292,883.407407 L309.347826,889.925926 L322.465839,876 L328.726708,882.518519 L340.503106,876 L327.385093,889.925926 L327.385093,889.925926 Z",id:"Messenger"})))),$1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...i},g("circle",{cx:16,cy:16,r:14,fill:"url(#paint0_linear_87_7225)"}),g("path",{d:"M22.9866 10.2088C23.1112 9.40332 22.3454 8.76755 21.6292 9.082L7.36482 15.3448C6.85123 15.5703 6.8888 16.3483 7.42147 16.5179L10.3631 17.4547C10.9246 17.6335 11.5325 17.541 12.0228 17.2023L18.655 12.6203C18.855 12.4821 19.073 12.7665 18.9021 12.9426L14.1281 17.8646C13.665 18.3421 13.7569 19.1512 14.314 19.5005L19.659 22.8523C20.2585 23.2282 21.0297 22.8506 21.1418 22.1261L22.9866 10.2088Z",fill:"white"}),g("defs",null,g("linearGradient",{id:"paint0_linear_87_7225",x1:16,y1:2,x2:16,y2:30,gradientUnits:"userSpaceOnUse"},g("stop",{stopColor:"#37BBFE"}),g("stop",{offset:1,stopColor:"#007DBB"})))),q1=i=>g("svg",{width:"800px",height:"800px",viewBox:"0 0 300 300",xmlns:"http://www.w3.org/2000/svg",...i},g("path",{fill:"#2DC100",d:"M300 255c0 24.854-20.147 45-45 45H45c-24.854 0-45-20.146-45-45V45C0 20.147 20.147 0 45 0h210c24.853 0 45 20.147 45 45v210z"}),g("g",{fill:"#FFF"},g("path",{d:"M200.803 111.88c-24.213 1.265-45.268 8.605-62.362 25.188-17.271 16.754-25.155 37.284-23 62.734-9.464-1.172-18.084-2.462-26.753-3.192-2.994-.252-6.547.106-9.083 1.537-8.418 4.75-16.488 10.113-26.053 16.092 1.755-7.938 2.891-14.889 4.902-21.575 1.479-4.914.794-7.649-3.733-10.849-29.066-20.521-41.318-51.232-32.149-82.85 8.483-29.25 29.315-46.989 57.621-56.236 38.635-12.62 82.054.253 105.547 30.927 8.485 11.08 13.688 23.516 15.063 38.224zm-111.437-9.852c.223-5.783-4.788-10.993-10.74-11.167-6.094-.179-11.106 4.478-11.284 10.483-.18 6.086 4.475 10.963 10.613 11.119 6.085.154 11.186-4.509 11.411-10.435zm58.141-11.171c-5.974.11-11.022 5.198-10.916 11.004.109 6.018 5.061 10.726 11.204 10.652 6.159-.074 10.83-4.832 10.772-10.977-.051-6.032-4.981-10.79-11.06-10.679z"}),g("path",{d:"M255.201 262.83c-7.667-3.414-14.7-8.536-22.188-9.318-7.459-.779-15.3 3.524-23.104 4.322-23.771 2.432-45.067-4.193-62.627-20.432-33.397-30.89-28.625-78.254 10.014-103.568 34.341-22.498 84.704-14.998 108.916 16.219 21.129 27.24 18.646 63.4-7.148 86.284-7.464 6.623-10.15 12.073-5.361 20.804.884 1.612.985 3.653 1.498 5.689zm-87.274-84.499c4.881.005 8.9-3.815 9.085-8.636.195-5.104-3.91-9.385-9.021-9.406-5.06-.023-9.299 4.318-9.123 9.346.166 4.804 4.213 8.69 9.059 8.696zm56.261-18.022c-4.736-.033-8.76 3.844-8.953 8.629-.205 5.117 3.772 9.319 8.836 9.332 4.898.016 8.768-3.688 8.946-8.562.19-5.129-3.789-9.364-8.829-9.399z"}))),J1=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg","aria-label":"WhatsApp",role:"img",viewBox:"0 0 512 512",...i},g("rect",{width:512,height:512,rx:"15%",fill:"#25d366"}),g("path",{fill:"#25d366",stroke:"#ffffff",strokeWidth:26,d:"M123 393l14-65a138 138 0 1150 47z"}),g("path",{fill:"#ffffff",d:"M308 273c-3-2-6-3-9 1l-12 16c-3 2-5 3-9 1-15-8-36-17-54-47-1-4 1-6 3-8l9-14c2-2 1-4 0-6l-12-29c-3-8-6-7-9-7h-8c-2 0-6 1-10 5-22 22-13 53 3 73 3 4 23 40 66 59 32 14 39 12 48 10 11-1 22-10 27-19 1-3 6-16 2-18"})),Q1=i=>g("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024",...i},g("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:1,transform:"translate(112 112)"},g("path",{fill:"#000",d:"M711.111 800H88.89C39.8 800 0 760.2 0 711.111V88.89C0 39.8 39.8 0 88.889 0H711.11C760.2 0 800 39.8 800 88.889V711.11C800 760.2 760.2 800 711.111 800"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M628 623H484.942L174 179h143.058zm-126.012-37.651h56.96L300.013 216.65h-56.96z"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M219.296885 623 379 437.732409 358.114212 410 174 623z"}),g("path",{fill:"#FFF",fillRule:"nonzero",d:"M409 348.387347 429.212986 377 603 177 558.330417 177z"}))),t0=i=>g("svg",{id:"Layer_1","data-name":"Layer 1",viewBox:"0 0 960 960","sodipodi:docname":"zalo.svg","inkscape:version":"1.4.2 (f4327f4, 2025-05-13)","xmlns:inkscape":"http://www.inkscape.org/namespaces/inkscape","xmlns:sodipodi":"http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg",...i},g("sodipodi:namedview",{id:"namedview2",pagecolor:"#ffffff",bordercolor:"#000000",borderopacity:.25,"inkscape:showpageshadow":2,"inkscape:pageopacity":0,"inkscape:pagecheckerboard":0,"inkscape:deskcolor":"#d1d1d1","inkscape:zoom":1.2239583,"inkscape:cx":480,"inkscape:cy":480,"inkscape:window-width":2560,"inkscape:window-height":1377,"inkscape:window-x":-8,"inkscape:window-y":1138,"inkscape:window-maximized":1,"inkscape:current-layer":"Layer_1"}),g("defs",{id:"defs1"},g("style",{id:"style1"},`
|
|
12
12
|
.cls-1, .cls-2 {
|
|
13
13
|
fill: #0068ff;
|
|
14
14
|
}
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
.cls-3 {
|
|
25
25
|
fill: #005be0;
|
|
26
26
|
}
|
|
27
|
-
`)),g("rect",{style:{fill:"#ffffff"},id:"rect2",width:789.24261,height:759.82971,x:142.1617,y:50.655319}),g("path",{className:"cls-1",d:"M347.49,51.61c-.54,3.31-3.8,3.72-6.11,5.07-39.25,22.99-75.12,50.54-105.25,84.63-49.95,56.29-84.24,121.1-95.93,196.02-5.36,34.55-6.54,67.72-3.69,99.54.21,2.32.44,4.64.69,6.95.17,1.54.34,3.08.53,4.61.1.82.2,1.65.31,2.47,10.86,84.82,50.9,159.98,116.73,225.95,12.05,12.2,16.52,22.42,13.03,35.72-1.38,4.97-3.86,10.35-7.48,16.41-16.06,27.15-40.43,45.58-66.4,62.43-2.78,1.78-5.55,3.57-8.13,5.55-.27.23-.51.46-.73.67-.04.04-.08.07-.11.11-3.23,3.18-.75,4.85,2.62,6.35.8,1.78,1.78,3.37,2.97,4.96,22.79,20.21,44.4,41.82,66.79,62.43,10.51,9.71,21.01,19.82,31.12,29.93.87.79,1.87,1.47,2.91,2.11,2.63,1.76,5.53,3.19,7.38,5.62h-143.88c-71.15,0-128.83-57.68-128.83-128.83V179.76c0-71.15,57.68-128.83,128.83-128.83h192.28c.13.18.24.4.34.68Z",id:"path1"}),g("path",{className:"cls-3",d:"M933.09,672.64c0,1.51-.27,2.98-.27,4.41v117.14c0,.1,0,.2,0,.3,0,.4,0,.8,0,1.19,0,.06,0,.12,0,.19,0,.47-.01.94-.03,1.4,0,.27-.01.53-.02.8,0,.12-.01.24-.01.35-8.8,62.58-62.56,110.72-127.57,110.72h-506.34c-1.85-2.54-4.79-3.97-7.47-5.62-1.04-.69-2.04-1.43-2.91-2.31-10.11-10.31-20.61-20.22-31.12-29.93-22.4-20.61-44-42.22-66.79-62.44-1.19-1.58-2.18-3.17-2.97-4.95,50.54,9.91,99.9,3.17,148.46-11.69,16.45-4.96,32.9-9.91,49.55-14.07,11.3-2.97,23.19-2.38,34.09,1.59,125.66,43.21,249.74,39.24,371.83-14.27,49.75-22,95.14-52.92,133.59-91.57,1.98-1.98,3.37-4.95,6.94-5.15.81,1.27,1.05,2.58,1.06,3.91Z",id:"path2"}),g("g",{id:"Page-1"},g("path",{id:"Combined-Shape",className:"cls-2",d:"M569.49,365.98v-11.69h35v164.32h-20.03c-8.24,0-14.94-6.66-14.98-14.89,0,0-.01,0-.02.01-14.1,10.31-31.53,16.43-50.35,16.43-47.15,0-85.37-38.2-85.37-85.32s38.23-85.32,85.37-85.32c18.83,0,36.25,6.12,50.35,16.43,0,0,.01,0,.02.01ZM424.68,301.45v5.33c0,9.94-1.33,18.05-7.78,27.57l-.78.89c-1.41,1.6-4.72,5.35-6.29,7.39l-112.37,141.04h127.23v19.97c0,8.27-6.71,14.98-14.99,14.98h-164.85v-9.41c0-11.53,2.86-16.67,6.49-22.03l119.79-148.27h-121.28v-37.44h174.85ZM646.95,518.62c-6.88,0-12.48-5.59-12.48-12.47v-204.69h37.47v217.16h-24.99ZM782.72,348.51c47.47,0,85.95,38.49,85.95,85.89s-38.47,85.93-85.95,85.93-85.95-38.49-85.95-85.93,38.47-85.89,85.95-85.89ZM519.12,485.05c27.75,0,50.23-22.47,50.23-50.2s-22.48-50.15-50.23-50.15-50.23,22.47-50.23,50.15,22.48,50.2,50.23,50.2ZM782.72,484.96c27.91,0,50.56-22.63,50.56-50.57s-22.65-50.52-50.56-50.52-50.56,22.63-50.56,50.52,22.61,50.57,50.56,50.57Z"}))),Q1=({platform:i,className:t})=>{const e={className:t};switch(i){case"telegram":return E(j1,{...e});case"whatsapp":return E($1,{...e});case"discord":return E(X1,{...e});case"zalo":return E(J1,{...e});case"email":return E(B1,{...e});case"wechat":return E(H1,{...e});case"kakaotalk":return E(V1,{...e});case"instagram":return E(Y1,{...e});case"line":return E(K1,{...e});case"x":return E(q1,{...e});case"messenger":return E(Z1,{...e});case"converge":return E(zh,{...e});default:return E(zh,{...e})}};function t0(i){switch(i){case"telegram":return"Telegram";case"zalo":return"Zalo";case"email":return"Email";case"whatsapp":return"WhatsApp";case"wechat":return"WeChat";case"discord":return"Discord";case"converge":return"Converge";case"instagram":return"Instagram";case"x":return"X";case"line":return"LINE";case"kakaotalk":return"KakaoTalk";case"messenger":return"Messenger";default:return"Chat"}}function e0(){const{isOpen:i,onMainMenu:t,inputMessage:e,isSending:n,availablePlatforms:s,showAttachmentMenu:r,customerName:o,messages:a,platformError:l,canRetryPlatforms:h,toggleChat:c,setInputMessage:u,sendMessage:d,selectPlatform:f,goBackToMainMenu:_,startChat:p,toggleAttachmentMenu:m,handleGalleryUpload:y,handleFileUpload:x,handleLocationShare:v,retryFetchPlatforms:w}=lc(),C=We(null);he(()=>{if(!i||typeof window.visualViewport>"u")return;const b=()=>{if(!C.current||!window.visualViewport)return;const I=window.visualViewport.height;if(window.innerHeight-I>100){const A=I-32;C.current.style.setProperty("--widget-height-mobile",`${A}px`)}else C.current.style.setProperty("--widget-height-mobile","85dvh")};return window.visualViewport.addEventListener("resize",b),window.visualViewport.addEventListener("scroll",b),()=>{window.visualViewport?.removeEventListener("resize",b),window.visualViewport?.removeEventListener("scroll",b)}},[i]);const T=b=>{b.preventDefault(),d()};return E("div",{class:"widget-container",ref:C,children:[!i&&E("button",{type:"button",onClick:c,class:"chat-toggle-button",children:E("svg",{class:"icon-md",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z"})})}),i&&E("div",{class:"chat-window",children:[E("div",{class:"chat-header",children:[!t&&E("button",{type:"button",onClick:_,class:"icon-button",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})})}),E("div",{class:"chat-title-container",children:E("h2",{class:"chat-title",children:t?"Contact Support":`Chat with ${o||"Guest"}`})}),E("button",{type:"button",onClick:c,class:"icon-button",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),t&&E("div",{class:"content-section content-fade-in",children:[E("h3",{class:"section-title",children:"Choose how to contact us"}),E("p",{class:"section-description",children:"Select your preferred platform to chat with our support team."}),l?E("div",{class:"error-message",children:[E("svg",{class:"icon-md",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),E("p",{children:l}),E("button",{type:"button",onClick:w,disabled:!h,class:"button-primary",style:{marginTop:"0.5rem"},children:h?"Retry":"Please wait..."})]}):s.length===0?E("div",{class:"loading-container",children:E("div",{class:"loading-content",children:[E("div",{class:"spinner"}),E("p",{class:"loading-text",children:"Loading platforms..."}),E("button",{type:"button",onClick:w,disabled:!h,class:"button-secondary",style:{marginTop:"0.75rem"},children:h?"Retry":"Please wait..."})]})}):E("div",{class:"platform-list",children:s.map(b=>E("button",{type:"button",onClick:()=>f(b),class:"platform-button",children:[E("div",{class:"platform-icon-container",children:E(Q1,{platform:b.type,className:"icon-md"})}),E("div",{class:"platform-info",children:[E("div",{class:"platform-name",children:t0(b.type)}),E("div",{class:"platform-description",children:b.type==="converge"?"Chat directly on this website":"Opens in new tab"})]}),E("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]},b.type))})]},"platform-selection"),!t&&!o&&E("div",{class:"content-section content-fade-in",children:[E("h3",{class:"section-title",children:"Welcome!"}),E("p",{class:"section-description",children:"Please enter your details to start chatting."}),E("form",{onSubmit:b=>{b.preventDefault();const R=new FormData(b.currentTarget),I=R.get("name"),L=R.get("email");p(I,L)},class:"name-form",children:[E("input",{type:"text",name:"name",placeholder:"Your name",required:!0,class:"form-input"}),E("input",{type:"email",name:"email",placeholder:"Email (optional)",class:"form-input"}),E("button",{type:"submit",class:"button-primary",children:"Start Chat"})]})]},"name-entry"),!t&&o&&E("div",{class:"chat-view-container",children:[E(M1,{messages:a}),r&&E("div",{class:"attachment-menu",children:[E("button",{type:"button",onClick:y,disabled:n,class:"attachment-button",children:[E("svg",{class:"icon-md icon-blue",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),E("span",{class:"attachment-label",children:"Photo/Video"})]}),E("button",{type:"button",onClick:x,disabled:n,class:"attachment-button",children:[E("svg",{class:"icon-md icon-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),E("span",{class:"attachment-label",children:"File"})]}),E("button",{type:"button",onClick:v,disabled:n,class:"attachment-button",children:[E("svg",{class:"icon-md icon-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),E("span",{class:"attachment-label",children:"Location"})]})]}),E("div",{class:"chat-input-container",children:E("form",{onSubmit:T,class:"chat-input-form",children:[E("button",{type:"button",onClick:m,disabled:n,class:"input-icon-button",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})})}),E("input",{type:"text",value:e,onInput:b=>u(b.target.value),placeholder:"Type a message...",disabled:n,class:"message-input"}),E("button",{type:"submit",disabled:n||!e.trim(),class:"send-button",children:E("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:E("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})})]},"chat-view")]})]})}const n0=`* {
|
|
27
|
+
`)),g("rect",{style:{fill:"#ffffff"},id:"rect2",width:789.24261,height:759.82971,x:142.1617,y:50.655319}),g("path",{className:"cls-1",d:"M347.49,51.61c-.54,3.31-3.8,3.72-6.11,5.07-39.25,22.99-75.12,50.54-105.25,84.63-49.95,56.29-84.24,121.1-95.93,196.02-5.36,34.55-6.54,67.72-3.69,99.54.21,2.32.44,4.64.69,6.95.17,1.54.34,3.08.53,4.61.1.82.2,1.65.31,2.47,10.86,84.82,50.9,159.98,116.73,225.95,12.05,12.2,16.52,22.42,13.03,35.72-1.38,4.97-3.86,10.35-7.48,16.41-16.06,27.15-40.43,45.58-66.4,62.43-2.78,1.78-5.55,3.57-8.13,5.55-.27.23-.51.46-.73.67-.04.04-.08.07-.11.11-3.23,3.18-.75,4.85,2.62,6.35.8,1.78,1.78,3.37,2.97,4.96,22.79,20.21,44.4,41.82,66.79,62.43,10.51,9.71,21.01,19.82,31.12,29.93.87.79,1.87,1.47,2.91,2.11,2.63,1.76,5.53,3.19,7.38,5.62h-143.88c-71.15,0-128.83-57.68-128.83-128.83V179.76c0-71.15,57.68-128.83,128.83-128.83h192.28c.13.18.24.4.34.68Z",id:"path1"}),g("path",{className:"cls-3",d:"M933.09,672.64c0,1.51-.27,2.98-.27,4.41v117.14c0,.1,0,.2,0,.3,0,.4,0,.8,0,1.19,0,.06,0,.12,0,.19,0,.47-.01.94-.03,1.4,0,.27-.01.53-.02.8,0,.12-.01.24-.01.35-8.8,62.58-62.56,110.72-127.57,110.72h-506.34c-1.85-2.54-4.79-3.97-7.47-5.62-1.04-.69-2.04-1.43-2.91-2.31-10.11-10.31-20.61-20.22-31.12-29.93-22.4-20.61-44-42.22-66.79-62.44-1.19-1.58-2.18-3.17-2.97-4.95,50.54,9.91,99.9,3.17,148.46-11.69,16.45-4.96,32.9-9.91,49.55-14.07,11.3-2.97,23.19-2.38,34.09,1.59,125.66,43.21,249.74,39.24,371.83-14.27,49.75-22,95.14-52.92,133.59-91.57,1.98-1.98,3.37-4.95,6.94-5.15.81,1.27,1.05,2.58,1.06,3.91Z",id:"path2"}),g("g",{id:"Page-1"},g("path",{id:"Combined-Shape",className:"cls-2",d:"M569.49,365.98v-11.69h35v164.32h-20.03c-8.24,0-14.94-6.66-14.98-14.89,0,0-.01,0-.02.01-14.1,10.31-31.53,16.43-50.35,16.43-47.15,0-85.37-38.2-85.37-85.32s38.23-85.32,85.37-85.32c18.83,0,36.25,6.12,50.35,16.43,0,0,.01,0,.02.01ZM424.68,301.45v5.33c0,9.94-1.33,18.05-7.78,27.57l-.78.89c-1.41,1.6-4.72,5.35-6.29,7.39l-112.37,141.04h127.23v19.97c0,8.27-6.71,14.98-14.99,14.98h-164.85v-9.41c0-11.53,2.86-16.67,6.49-22.03l119.79-148.27h-121.28v-37.44h174.85ZM646.95,518.62c-6.88,0-12.48-5.59-12.48-12.47v-204.69h37.47v217.16h-24.99ZM782.72,348.51c47.47,0,85.95,38.49,85.95,85.89s-38.47,85.93-85.95,85.93-85.95-38.49-85.95-85.93,38.47-85.89,85.95-85.89ZM519.12,485.05c27.75,0,50.23-22.47,50.23-50.2s-22.48-50.15-50.23-50.15-50.23,22.47-50.23,50.15,22.48,50.2,50.23,50.2ZM782.72,484.96c27.91,0,50.56-22.63,50.56-50.57s-22.65-50.52-50.56-50.52-50.56,22.63-50.56,50.52,22.61,50.57,50.56,50.57Z"}))),e0=({platform:i,className:t})=>{const e={className:t};switch(i){case"telegram":return w($1,{...e});case"whatsapp":return w(J1,{...e});case"discord":return w(Y1,{...e});case"zalo":return w(t0,{...e});case"email":return w(V1,{...e});case"wechat":return w(q1,{...e});case"kakaotalk":return w(Z1,{...e});case"instagram":return w(K1,{...e});case"line":return w(j1,{...e});case"x":return w(Q1,{...e});case"messenger":return w(H1,{...e});case"converge":return w(xo,{...e});default:return w(xo,{...e})}};function n0(i){switch(i){case"telegram":return"Telegram";case"zalo":return"Zalo";case"email":return"Email";case"whatsapp":return"WhatsApp";case"wechat":return"WeChat";case"discord":return"Discord";case"converge":return"Converge";case"instagram":return"Instagram";case"x":return"X";case"line":return"LINE";case"kakaotalk":return"KakaoTalk";case"messenger":return"Messenger";default:return"Chat"}}function i0(){const{config:i,isOpen:t,onMainMenu:e,inputMessage:n,isSending:s,availablePlatforms:r,showAttachmentMenu:o,customerName:a,messages:l,platformError:h,canRetryPlatforms:c,isUsingCachedPlatforms:u,toggleChat:d,setInputMessage:f,sendMessage:_,selectPlatform:p,goBackToMainMenu:m,startChat:y,toggleAttachmentMenu:x,handleGalleryUpload:v,handleFileUpload:E,handleLocationShare:C,retryFetchPlatforms:R}=cc(),I=Ye(null),T=S=>{S.preventDefault(),_()};return w("div",{class:"widget-container",ref:I,children:[!t&&w("button",{type:"button",onClick:d,class:"chat-toggle-button","data-tooltip":"Chat with us","aria-label":"Open chat",children:w(xo,{className:"w-6 h-6"})}),t&&w("div",{class:"chat-window",children:[w("div",{class:"chat-header",children:[!e&&w("button",{type:"button",onClick:m,class:"icon-button",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})})}),w("div",{class:"chat-title-container",children:w("h2",{class:"chat-title",children:e?"Contact Support":`Chat with ${a||"Guest"}`})}),w("button",{type:"button",onClick:d,class:"icon-button",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})})})]}),e&&w("div",{class:"content-section content-fade-in",children:[w("h3",{class:"section-title",children:"Choose how to contact us"}),w("p",{class:"section-description",children:"Select your preferred platform to chat with our support team."}),r.length===0?h?w("div",{class:"error-message",children:[w("svg",{class:"icon-md",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),w("p",{children:h}),w("button",{type:"button",onClick:R,disabled:!c,class:"button-primary",style:{marginTop:"0.5rem"},children:c?"Retry":"Please wait..."})]}):w("div",{class:"loading-container",children:w("div",{class:"loading-content",children:[w("div",{class:"spinner"}),w("p",{class:"loading-text",children:"Loading platforms..."}),w("button",{type:"button",onClick:R,disabled:!c,class:"button-secondary",style:{marginTop:"0.75rem"},children:c?"Retry":"Please wait..."})]})}):w(Xe,{children:[u&&w("div",{class:"platform-warning",children:[w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),w("span",{children:h})]}),w("div",{class:"platform-list",children:r.map(S=>{const L=u&&S.type==="converge";return w("button",{type:"button",onClick:()=>!L&&p(S),class:`platform-button ${L?"platform-button-disabled":""}`,disabled:L,children:[w("div",{class:"platform-icon-container",children:w(e0,{platform:S.type,className:"icon-md"})}),w("div",{class:"platform-info",children:[w("div",{class:"platform-name",children:n0(S.type)}),w("div",{class:"platform-description",children:L?"Temporarily unavailable":S.type==="converge"?"Chat directly on this website":"Opens in new tab"})]}),w("svg",{class:"icon-sm icon-muted",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 5l7 7-7 7"})})]},S.type)})})]})]}),!e&&!a&&w("div",{class:"content-section content-fade-in",children:[w("h3",{class:"section-title",children:"Welcome!"}),w("p",{class:"section-description",children:"Please enter your details to start chatting."}),w("form",{onSubmit:S=>{S.preventDefault();const L=new FormData(S.currentTarget),O=L.get("name"),A=L.get("email"),k=L.get("phone");y(O,A,k)},class:"name-form",children:[w("input",{type:"text",name:"name",placeholder:"Your name",required:!0,class:"form-input"}),i.emailRequirement!=="none"&&w("input",{type:"email",name:"email",placeholder:i.emailRequirement==="required"?"Email":"Email (optional)",required:i.emailRequirement==="required",class:"form-input"}),i.phoneRequirement!=="none"&&w("input",{type:"tel",name:"phone",placeholder:i.phoneRequirement==="required"?"Phone (e.g. +1234567890)":"Phone (optional, e.g. +1234567890)",required:i.phoneRequirement==="required",class:"form-input",onInput:S=>{const L=S.target;let O=L.value;const A=O.startsWith("+"),k=O.replace(/[^\d+]/g,""),P=k.replace(/\+/g,"");A&&P.length>0?L.value="+"+P:P.length>0?L.value=P:k==="+"?L.value="+":L.value=""},maxLength:20}),w("button",{type:"submit",class:"button-primary",children:"Start Chat"})]})]}),!e&&a&&w("div",{class:"chat-view-container",children:[w(A1,{messages:l}),o&&w("div",{class:"attachment-menu",children:[w("button",{type:"button",onClick:v,disabled:s,class:"attachment-button",children:[w("svg",{class:"icon-md icon-blue",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),w("span",{class:"attachment-label",children:"Photo/Video"})]}),w("button",{type:"button",onClick:E,disabled:s,class:"attachment-button",children:[w("svg",{class:"icon-md icon-green",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),w("span",{class:"attachment-label",children:"File"})]}),w("button",{type:"button",onClick:C,disabled:s,class:"attachment-button",children:[w("svg",{class:"icon-md icon-red",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"}),w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 11a3 3 0 11-6 0 3 3 0 016 0z"})]}),w("span",{class:"attachment-label",children:"Location"})]})]}),w("div",{class:"chat-input-container",children:w("form",{onSubmit:T,class:"chat-input-form",children:[w("button",{type:"button",onClick:x,disabled:s,class:"input-icon-button",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M12 4v16m8-8H4"})})}),w("input",{type:"text",value:n,onInput:S=>f(S.target.value),placeholder:"Type a message...",disabled:s,class:"message-input"}),w("button",{type:"submit",disabled:s||!n.trim(),class:"send-button",children:w("svg",{class:"icon-sm",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:w("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M5 10l7-7m0 0l7 7m-7-7v18"})})})]})})]})]})]})}const s0=`* {
|
|
28
28
|
box-sizing: border-box;
|
|
29
29
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
30
30
|
}
|
|
@@ -49,21 +49,90 @@
|
|
|
49
49
|
.chat-toggle-button {
|
|
50
50
|
width: 3.5rem;
|
|
51
51
|
height: 3.5rem;
|
|
52
|
-
background
|
|
52
|
+
background: rgba(255, 255, 255, 0.15);
|
|
53
|
+
backdrop-filter: blur(16px);
|
|
54
|
+
-webkit-backdrop-filter: blur(16px);
|
|
55
|
+
border: 1px solid rgba(255, 255, 255, 0.25);
|
|
53
56
|
color: white;
|
|
54
|
-
border: none;
|
|
55
57
|
border-radius: 9999px;
|
|
56
|
-
box-shadow:
|
|
58
|
+
box-shadow:
|
|
59
|
+
0 8px 16px -4px rgba(251, 140, 11, 0.3),
|
|
60
|
+
0 4px 8px -2px rgba(0, 182, 175, 0.25),
|
|
61
|
+
0 2px 4px -1px rgba(255, 78, 98, 0.2),
|
|
62
|
+
0 0 0 1px rgba(255, 255, 255, 0.1);
|
|
57
63
|
display: flex;
|
|
58
64
|
align-items: center;
|
|
59
65
|
justify-content: center;
|
|
60
66
|
cursor: pointer;
|
|
61
|
-
transition: all 0.
|
|
62
|
-
animation: fadeInScale 0.3s ease-out;
|
|
67
|
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
68
|
+
animation: fadeInScale 0.3s ease-out, pulse 2.5s ease-in-out infinite;
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.chat-toggle-button::before {
|
|
73
|
+
content: attr(data-tooltip);
|
|
74
|
+
position: absolute;
|
|
75
|
+
right: 100%;
|
|
76
|
+
top: 50%;
|
|
77
|
+
transform: translateY(-50%);
|
|
78
|
+
margin-right: 0.75rem;
|
|
79
|
+
padding: 0.5rem 0.75rem;
|
|
80
|
+
background: rgba(24, 24, 27, 0.95);
|
|
81
|
+
backdrop-filter: blur(12px);
|
|
82
|
+
-webkit-backdrop-filter: blur(12px);
|
|
83
|
+
color: white;
|
|
84
|
+
font-size: 0.875rem;
|
|
85
|
+
font-weight: 500;
|
|
86
|
+
white-space: nowrap;
|
|
87
|
+
border-radius: 0.5rem;
|
|
88
|
+
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
89
|
+
opacity: 0;
|
|
90
|
+
pointer-events: none;
|
|
91
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
92
|
+
box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.3);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.chat-toggle-button::after {
|
|
96
|
+
content: '';
|
|
97
|
+
position: absolute;
|
|
98
|
+
right: 100%;
|
|
99
|
+
top: 50%;
|
|
100
|
+
transform: translateY(-50%);
|
|
101
|
+
margin-right: 0.25rem;
|
|
102
|
+
border: 0.375rem solid transparent;
|
|
103
|
+
border-left-color: rgba(24, 24, 27, 0.95);
|
|
104
|
+
opacity: 0;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
63
107
|
}
|
|
64
108
|
|
|
65
109
|
.chat-toggle-button:hover {
|
|
66
|
-
background
|
|
110
|
+
background: rgba(255, 255, 255, 0.25);
|
|
111
|
+
backdrop-filter: blur(20px);
|
|
112
|
+
-webkit-backdrop-filter: blur(20px);
|
|
113
|
+
border-color: rgba(255, 255, 255, 0.4);
|
|
114
|
+
transform: scale(1.08) translateY(-2px);
|
|
115
|
+
box-shadow:
|
|
116
|
+
0 12px 24px -6px rgba(251, 140, 11, 0.4),
|
|
117
|
+
0 8px 16px -4px rgba(0, 182, 175, 0.35),
|
|
118
|
+
0 4px 8px -2px rgba(255, 78, 98, 0.3),
|
|
119
|
+
0 0 0 1px rgba(255, 255, 255, 0.2),
|
|
120
|
+
0 0 32px -8px rgba(252, 151, 0, 0.3);
|
|
121
|
+
animation: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.chat-toggle-button:hover::before {
|
|
125
|
+
opacity: 1;
|
|
126
|
+
transform: translateY(-50%) translateX(-4px);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.chat-toggle-button:hover::after {
|
|
130
|
+
opacity: 1;
|
|
131
|
+
transform: translateY(-50%) translateX(-2px);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.chat-toggle-button:active {
|
|
135
|
+
transform: scale(0.96) translateY(0);
|
|
67
136
|
}
|
|
68
137
|
|
|
69
138
|
.chat-window {
|
|
@@ -162,6 +231,23 @@
|
|
|
162
231
|
margin: 0;
|
|
163
232
|
}
|
|
164
233
|
|
|
234
|
+
.platform-warning {
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
gap: 0.5rem;
|
|
238
|
+
padding: 0.75rem;
|
|
239
|
+
background-color: #fef3c7;
|
|
240
|
+
border: 1px solid #fbbf24;
|
|
241
|
+
border-radius: 0.5rem;
|
|
242
|
+
font-size: 0.875rem;
|
|
243
|
+
color: #92400e;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.platform-warning svg {
|
|
247
|
+
flex-shrink: 0;
|
|
248
|
+
color: #f59e0b;
|
|
249
|
+
}
|
|
250
|
+
|
|
165
251
|
.platform-list {
|
|
166
252
|
display: flex;
|
|
167
253
|
flex-direction: column;
|
|
@@ -182,11 +268,21 @@
|
|
|
182
268
|
transition: all 0.2s;
|
|
183
269
|
}
|
|
184
270
|
|
|
185
|
-
.platform-button:hover {
|
|
271
|
+
.platform-button:hover:not(:disabled) {
|
|
186
272
|
border-color: #3b82f6;
|
|
187
273
|
background-color: #eff6ff;
|
|
188
274
|
}
|
|
189
275
|
|
|
276
|
+
.platform-button-disabled {
|
|
277
|
+
opacity: 0.5;
|
|
278
|
+
cursor: not-allowed;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
.platform-button-disabled:hover {
|
|
282
|
+
border-color: #e4e4e7;
|
|
283
|
+
background-color: white;
|
|
284
|
+
}
|
|
285
|
+
|
|
190
286
|
.platform-icon-container {
|
|
191
287
|
width: 2.5rem;
|
|
192
288
|
height: 2.5rem;
|
|
@@ -395,6 +491,7 @@
|
|
|
395
491
|
|
|
396
492
|
.message-list {
|
|
397
493
|
flex: 1;
|
|
494
|
+
min-height: 0;
|
|
398
495
|
overflow-y: auto;
|
|
399
496
|
padding: 1rem;
|
|
400
497
|
}
|
|
@@ -403,13 +500,26 @@
|
|
|
403
500
|
.widget-container {
|
|
404
501
|
bottom: max(var(--widget-bottom-mobile), env(safe-area-inset-bottom, 0px));
|
|
405
502
|
right: max(var(--widget-right-mobile), env(safe-area-inset-right, 0px));
|
|
406
|
-
left:
|
|
503
|
+
left: auto;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.widget-container:has(.chat-window) {
|
|
507
|
+
inset: 0;
|
|
407
508
|
}
|
|
408
509
|
|
|
409
510
|
.chat-window {
|
|
410
511
|
width: 100%;
|
|
411
|
-
height:
|
|
412
|
-
max-height:
|
|
512
|
+
height: 100dvh;
|
|
513
|
+
max-height: none;
|
|
514
|
+
border-radius: 0;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.chat-header {
|
|
518
|
+
padding: 0.75rem 1rem;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.chat-title {
|
|
522
|
+
font-size: 0.9375rem;
|
|
413
523
|
}
|
|
414
524
|
}
|
|
415
525
|
|
|
@@ -715,6 +825,25 @@
|
|
|
715
825
|
}
|
|
716
826
|
}
|
|
717
827
|
|
|
828
|
+
@keyframes pulse {
|
|
829
|
+
0%, 100% {
|
|
830
|
+
box-shadow:
|
|
831
|
+
0 8px 16px -4px rgba(251, 140, 11, 0.3),
|
|
832
|
+
0 4px 8px -2px rgba(0, 182, 175, 0.25),
|
|
833
|
+
0 2px 4px -1px rgba(255, 78, 98, 0.2),
|
|
834
|
+
0 0 0 1px rgba(255, 255, 255, 0.1);
|
|
835
|
+
}
|
|
836
|
+
50% {
|
|
837
|
+
box-shadow:
|
|
838
|
+
0 12px 24px -6px rgba(251, 140, 11, 0.35),
|
|
839
|
+
0 8px 16px -4px rgba(0, 182, 175, 0.3),
|
|
840
|
+
0 4px 8px -2px rgba(255, 78, 98, 0.25),
|
|
841
|
+
0 0 0 1px rgba(255, 255, 255, 0.15),
|
|
842
|
+
0 0 0 12px rgba(186, 230, 253, 0.15),
|
|
843
|
+
0 0 0 20px rgba(224, 242, 254, 0.08);
|
|
844
|
+
}
|
|
845
|
+
}
|
|
846
|
+
|
|
718
847
|
@keyframes slideUpFade {
|
|
719
848
|
from {
|
|
720
849
|
opacity: 0;
|
|
@@ -757,6 +886,7 @@
|
|
|
757
886
|
display: flex;
|
|
758
887
|
flex-direction: column;
|
|
759
888
|
flex: 1;
|
|
889
|
+
min-height: 0;
|
|
760
890
|
animation: contentFadeIn 0.25s ease-out;
|
|
761
891
|
}
|
|
762
|
-
`,
|
|
892
|
+
`,Ms=document.querySelector("script[data-api-key]"),r0=Ms?.getAttribute("data-api-key")||"",o0=Ms?.getAttribute("data-api-url")||"https://useconverge.app/api/widget",Gh=Ms?.getAttribute("data-email")||"optional",Wh=Ms?.getAttribute("data-phone")||"none",a0=["none","optional","required"].includes(Gh)?Gh:"optional",l0=["none","optional","required"].includes(Wh)?Wh:"none",h0={apiKey:r0,apiUrl:o0,emailRequirement:a0,phoneRequirement:l0},wo=document.createElement("div"),Uh=wo.attachShadow({mode:"open"});wo.id="__converge-chat-widget";const Xh=document.createElement("style");Xh.textContent=s0,Uh.appendChild(Xh),document.body.appendChild(wo),ec(w(hc,{config:h0,children:w(i0,{})}),Uh),window.ConvergeChat={open:()=>window.dispatchEvent(new Event("converge-chat-open")),close:()=>window.dispatchEvent(new Event("converge-chat-close"))}})();
|