1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,980672,500474,t=>{"use strict";let e,i,n;var r,s,o=t.i(391398),a=t.i(435236),l=t.i(185214),h=t.i(691317),u=t.i(191788);let d="remove",c="propertychange",g="change",f="contextmenu",_="click",p="keydown",m="keypress",v="touchmove",y="wheel",x=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function w(t,e){return t>e?1:t<e?-1:0}function E(t,e,i){if(t[0]<=e)return 0;let n=t.length;if(e<=t[n-1])return n-1;if("function"==typeof i){for(let r=1;r<n;++r){let n=t[r];if(n===e)return r;if(n<e){if(i(e,t[r-1],n)>0)return r-1;return r}}return n-1}if(i>0){for(let i=1;i<n;++i)if(t[i]<e)return i-1;return n-1}if(i<0){for(let i=1;i<n;++i)if(t[i]<=e)return i;return n-1}for(let i=1;i<n;++i){if(t[i]==e)return i;if(t[i]<e){if(t[i-1]-e<e-t[i])return i-1;return i}}return n-1}function C(t,e){let i=t.length;if(i!==e.length)return!1;for(let n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function S(){return!0}function R(){return!1}function b(){}function M(t){for(let e in t)delete t[e]}function T(t){let e;for(e in t)return!1;return!e}let I=class{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},P=class extends x{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;let i=this.listeners_||(this.listeners_={}),n=i[t]||(i[t]=[]);n.includes(e)||n.push(e)}dispatchEvent(t){let e,i="string"==typeof t,n=i?t:t.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let s=i?new I(t):t;s.target||(s.target=this.eventTarget_||this);let o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});n in o||(o[n]=0,a[n]=0),++o[n];for(let t=0,i=r.length;t<i;++t)if(!1===(e="handleEvent"in r[t]?r[t].handleEvent(s):r[t].call(this,s))||s.propagationStopped){e=!1;break}if(0==--o[n]){let t=a[n];for(delete a[n];t--;)this.removeEventListener(n,b);delete o[n]}return e}disposeInternal(){this.listeners_&&M(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)}removeEventListener(t,e){if(!this.listeners_)return;let i=this.listeners_[t];if(!i)return;let n=i.indexOf(e);-1!==n&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[n]=b,++this.pendingRemovals_[t]):(i.splice(n,1),0===i.length&&delete this.listeners_[t]))}};function L(t,e,i,n,r){if(r){let r=i;i=function(s){return t.removeEventListener(e,i),r.call(n??this,s)}}else n&&n!==t&&(i=i.bind(n));let s={target:t,type:e,listener:i};return t.addEventListener(e,i),s}function A(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),M(t))}class F extends P{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(g)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){let i=t.length,n=Array(i);for(let r=0;r<i;++r)n[r]=L(this,t[r],e);return n}return L(this,t,e)}onceInternal(t,e){let i;if(Array.isArray(t)){let n=t.length;i=Array(n);for(let r=0;r<n;++r)i[r]=L(this,t[r],e,void 0,!0)}else i=L(this,t,e,void 0,!0);return e.ol_key=i,i}unInternal(t,e){let i=e.ol_key;if(i){var n=i;if(Array.isArray(n))for(let t=0,e=n.length;t<e;++t)A(n[t]);else A(n)}else if(Array.isArray(t))for(let i=0,n=t.length;i<n;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}F.prototype.on,F.prototype.once,F.prototype.un;let O=F;function k(){throw Error("Unimplemented abstract method.")}let z=0;function D(t){return t.ol_uid||(t.ol_uid=String(++z))}class j extends I{constructor(t,e,i){super(t),this.key=e,this.oldValue=i}}let N=class extends O{constructor(t){super(),this.on,this.once,this.un,D(this),this.values_=null,void 0!==t&&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_}
1hasProperties(){return!!this.values_}notify(t,e){let i;i=`change:${t}`,this.hasListener(i)&&this.dispatchEvent(new j(i,t,e)),i=c,this.hasListener(i)&&this.dispatchEvent(new j(i,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,i){let n=this.values_||(this.values_={});if(i)n[t]=e;else{let i=n[t];n[t]=e,i!==e&&this.notify(t,i)}}setProperties(t,e){for(let i in t)this.set(i,t[i],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){let i=this.values_[t];delete this.values_[t],T(this.values_)&&(this.values_=null),e||this.notify(t,i)}}},K="length";class X extends I{constructor(t,e,i){super(t),this.element=e,this.index=i}}let G=class extends N{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t||[],this.unique_)for(let t=0,e=this.array_.length;t<e;++t)this.assertUnique_(this.array_[t],t);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,i=t.length;e<i;++e)this.push(t[e]);return this}forEach(t){let e=this.array_;for(let i=0,n=e.length;i<n;++i)t(e[i],i,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(K)}insertAt(t,e){if(t<0||t>this.getLength())throw Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new X("add",e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);let e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){let e=this.array_;for(let i=0,n=e.length;i<n;++i)if(e[i]===t)return this.removeAt(i)}removeAt(t){if(t<0||t>=this.getLength())return;let e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new X(d,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);let i=this.array_[t];this.array_[t]=e,this.dispatchEvent(new X(d,i,t)),this.dispatchEvent(new X("add",e,t))}updateLength_(){this.set(K,this.array_.length)}assertUnique_(t,e){for(let i=0,n=this.array_.length;i<n;++i)if(this.array_[i]===t&&i!==e)throw Error("Duplicate item added to a unique collection")}},Z=class extends I{constructor(t,e,i){super(t),this.map=e,this.frameState=void 0!==i?i:null}},V=class extends Z{constructor(t,e,i,n,r,s){super(t,e,r),this.originalEvent=i,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==n&&n,this.activePointers=s}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()}},W={SINGLECLICK:"singleclick",CLICK:_,DBLCLICK:"dblclick",POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},U="u">typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";U.includes("safari")&&!U.includes("chrom")&&(U.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(U));let Y=U.includes("webkit")&&!U.includes("edge"),B=U.includes("macintosh"),$="u">typeof devicePixelRatio?devicePixelRatio:1,q="u">typeof WorkerGlobalScope&&"u">typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,H="u">typeof Image&&Image.prototype.decode,J=function(){let t=!1;try{let e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}(),Q="pointerdown",tt=class extends P{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const i=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=i,this.pointerdownListenerKey_=L(i,Q,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=L(i,"pointermove",this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(v,this.boundHandleTouchMove_,!!J&&{passive:!1})}emulateClick_(t){let e=new V(W.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new V(W.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;let e=new V(W.SINGLECLICK,this.map_,t);this.dispatchEvent(e)},250)}updateActivePointers_(t){let e=t.pointerId;if(t.type==W.POINTERUP||t.type==W.POINTERCANCEL){for(let i in delete this.trackedTouches_[e],this.trackedTouches_)if(this.trackedTouches_[i].target!==t.target){delete this.trackedTouches_[i];break}}else(t.type==W.POINTERDOWN||t.type==W.POINTERMOVE)&&(this.trackedTouches_[e]=t);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);let e=new V(W.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_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(A),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);let e=new V(W.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);
1if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){let t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(L(t,W.POINTERMOVE,this.handlePointerMove_,this),L(t,W.POINTERUP,this.handlePointerUp_,this),L(this.element_,W.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push(L(this.element_.getRootNode(),W.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;let e=new V(W.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;let e=!!(this.down_&&this.isMoving_(t));this.dispatchEvent(new V(W.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){let e=this.originalPointerMoveEvent_;(!e||e.defaultPrevented)&&("boolean"!=typeof t.cancelable||!0===t.cancelable)&&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_&&(A(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(v,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(A(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(A),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}},te="postrender",ti="loadstart",tn="loadend",tr="layergroup",ts="size",to="target",ta="view";function tl(t,e){if(!t)throw Error(e)}let th=1/0,tu=class{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,M(this.queuedElements_)}dequeue(){let t=this.elements_,e=this.priorities_,i=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));let n=this.keyFunction_(i);return delete this.queuedElements_[n],i}enqueue(t){tl(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");let e=this.priorityFunction_(t);return e!=th&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+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 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){let e=this.elements_,i=this.priorities_,n=e.length,r=e[t],s=i[t],o=t;for(;t<n>>1;){let r=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),o=s<n&&i[s]<i[r]?s:r;e[t]=e[o],i[t]=i[o],t=o}e[t]=r,i[t]=s,this.siftDown_(o,t)}siftDown_(t,e){let i=this.elements_,n=this.priorities_,r=i[e],s=n[e];for(;e>t;){let t=this.getParentIndex_(e);if(n[t]>s)i[e]=i[t],n[e]=n[t],e=t;else break}i[e]=r,n[e]=s}reprioritize(){let t,e,i,n=this.priorityFunction_,r=this.elements_,s=this.priorities_,o=0,a=r.length;for(e=0;e<a;++e)(i=n(t=r[e]))==th?delete this.queuedElements_[this.keyFunction_(t)]:(s[o]=i,r[o++]=t);r.length=o,s.length=o,this.heapify_()}},td=class extends tu{constructor(t,e){super(e=>t.apply(null,e),t=>t[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){let e=super.enqueue(t);return e&&t[0].addEventListener(g,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){let e=t.target,i=e.getState();if(2===i||3===i||4===i){3!==i&&e.removeEventListener(g,this.boundHandleTileChange_);let t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let i=0;for(;this.tilesLoading_<t&&i<e&&this.getCount()>0;){let t=this.dequeue()[0],e=t.getKey();0!==t.getState()||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++i,t.load())}}},tc={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function tg(t,e,i){return Math.min(Math.max(t,e),i)}function tf(t,e,i,n){let r=i-t,s=n-e;return r*r+s*s}function t_(t){return 180*t/Math.PI}function tp(t){return t*Math.PI/180}function tm(t,e){let i=t%e;return i*e<0?i+e:i}function tv(t,e){let i=Math.pow(10,e);return Math.round(t*i)/i}function ty(t,e){return Math.floor(tv(t,e))}function tx(t,e){return Math.ceil(tv(t,e))}function tw(t,e,i){if(t>=e&&t<i)return t;let n=i-e;return((t-e)%n+n)%n+e}function tE(t,e,i){return function(n,r,s,o,a){if(!n)return;if(!r&&!e)return n;let l=e?0:s[0]*r,h=e?0:s[1]*r,u=a?a[0]:0,d=a?a[1]:0,c=t[0]+l/2+u,g=t[2]-l/2+u,f=t[1]+h/2+d,_=t[3]-h/2+d;c>g&&(g=c=(g+c)/2),f>_&&(_=f=(_+f)/2);let p=tg(n[0],c,g),m=tg(n[1],f,_);if(o&&i&&r){let t=30*r;p+=-t*Math.log(1+Math.max(0,c-n[0])/t)+t*Math.log(1+Math.max(0,n[0]-g)/t),m+=-t*Math.log(1+Math.max(0,f-n[1])/t)+t*Math.log(1+Math.max(0,n[1]-_)/t)}return[p,m]}}function tC(t){return t}function tS(t){let e=tI();for(let i=0,n=t.length;i<n;++i)tF(e,t[i]);return e}function tR(t,e,i){let n,r;return(n=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0)*n+(r=i<t[1]?t[1]-i:t[3]<i?i-t[3]:0)*r}function tb(t,e){return tM(t,e[0],e[1])}function tM(t,e,i){return t[0]<=e&&e<=t[2]&&t[1]<=i&&i<=t[3]}function tT(t,e){let i=t[0],n=t[1],r=t[2],s=t[3],o=e[0],a=e[1],l=0;return o<i?l|=16:o>r&&(l|=4),a<n?l|=8:a>s&&(l|=2),0===l&&(l=1),l}function tI(){return[1/0,1/0,-1/0,-1/0]}function tP(t,e,i,n,r){return r?(r[0]=t,r[1]=e,r[2]=i,r[3]=n,r):[t,e,i,n]}function tL(t){return tP(1/0,1/0,-1/0,-1/0,t)}function tA(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function tF(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function tO(t,e,i,n,r){for(;i<n;i+=r){var s,o,a;s=t,o=e[i],a=e[i+1],s[0]=Math.min(s[0],o),s[1]=Math.min(s[1],a),s[2]=Math.max(s[2],o),s[3]=Math.max(s[3],a)}return t}function tk(t,e){let i;return!!((i=e(tD(t)))||(i=e(tj(t)))||(i=e(tW(t)))||(i=e(tV(t))))&&i}function tz(t){let e=0;return tB(t)||(e=tU(t)*tG(t)),e}function tD(t){return[t[0],t[1]]}function tj(t){return[t[2],t[1]]}function tN(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function tK(t,e,i,n,r){let[s,o,a,l,h,u,d,c]=tX(t,e,i,n);return tP(Math.min(s,a,h,d),Math.min(o,l,u,c),Math.max(s,a,h,d),Math.max(o,l,u,c),r)}function tX(t,e,i,n){let r=e*n[0]/2,s=e*n[1]/2,o=Math.cos(i),a=Math.sin(i),l=r*o,h=r*a,u=s*o,d=s*a,c=t[0],g=t[1];return[c-l+d,g-h-u,c-l-d,g-h+u,c+l-d,g+h+u,c+l+d,g+h-u,c-l+d,g-h-u]}function tG(t){return t[3]-t[1]}
1function tZ(t,e,i){let n=i||tI();return tY(t,e)?(t[0]>e[0]?n[0]=t[0]:n[0]=e[0],t[1]>e[1]?n[1]=t[1]:n[1]=e[1],t[2]<e[2]?n[2]=t[2]:n[2]=e[2],t[3]<e[3]?n[3]=t[3]:n[3]=e[3]):tL(n),n}function tV(t){return[t[0],t[3]]}function tW(t){return[t[2],t[3]]}function tU(t){return t[2]-t[0]}function tY(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function tB(t){return t[2]<t[0]||t[3]<t[1]}function t$(t,e){let i=!0;for(let n=t.length-1;n>=0;--n)if(t[n]!=e[n]){i=!1;break}return i}function tq(t,e){let i=Math.cos(e),n=Math.sin(e),r=t[0]*i-t[1]*n,s=t[1]*i+t[0]*n;return t[0]=r,t[1]=s,t}function tH(t){return Math.pow(t,3)}function tJ(t){return 1-tH(1-t)}function tQ(t){return 3*t*t-2*t*t*t}function t0(t){return t}function t1(...t){console.warn(...t)}let t2={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},t3=class{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,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_||t2[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_}},t5=6378137*Math.PI,t4=[-t5,-t5,t5,t5],t6=[-180,-85,180,85],t8=6378137*Math.log(Math.tan(Math.PI/2));class t9 extends t3{constructor(t){super({code:t,units:"m",extent:t4,global:!0,worldExtent:t6,getPointResolution:function(t,e){return t/Math.cosh(e[1]/6378137)}})}}let t7=[new t9("EPSG:3857"),new t9("EPSG:102100"),new t9("EPSG:102113"),new t9("EPSG:900913"),new t9("http://www.opengis.net/def/crs/EPSG/0/3857"),new t9("http://www.opengis.net/gml/srs/epsg.xml#3857")],et=[-180,-90,180,90],ee=6378137*Math.PI/180;class ei extends t3{constructor(t,e){super({code:t,units:"degrees",extent:et,axisOrientation:e,global:!0,metersPerUnit:ee,worldExtent:et})}}let en=[new ei("CRS:84"),new ei("EPSG:4326","neu"),new ei("urn:ogc:def:crs:OGC:1.3:CRS84"),new ei("urn:ogc:def:crs:OGC:2:84"),new ei("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ei("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ei("http://www.opengis.net/def/crs/EPSG/0/4326","neu")],er={},es={};function eo(t,e,i){let n=t.getCode(),r=e.getCode();n in es||(es[n]={}),es[n][r]=i}function ea(t,e){return t in es&&e in es[t]?es[t][e]:null}let el=.00669438/.99330562,eh=Math.sqrt(.99330562),eu=(1-eh)/(1+eh),ed=eu*eu,ec=ed*eu,eg=ec*eu,ef=eg*eu,e_=1-.001673595-1344441707532e-16/64-15000339463446782e-22/256,ep=.02008314/8+1344441707532e-16/32+13500305517102105e-21/1024,em=672220853766e-15/256+13500305517102105e-21/1024,ev=10500237624412747e-21/3072,ey=1.5*eu-27/32*ec+269/512*ef,ex=21/16*ed-55/32*eg,ew=151/96*ec-417/128*ef,eE=1097/512*eg;function eC(t,e,i){let n=(i.north?e:e-1e7)/.9996/(6378137*e_),r=n+ey*Math.sin(2*n)+ex*Math.sin(4*n)+ew*Math.sin(6*n)+eE*Math.sin(8*n),s=Math.sin(r),o=s*s,a=Math.cos(r),l=s/a,h=l*l,u=h*h,d=el*a**2,c=d*d,g=(t-5e5)/(6378137/Math.sqrt(1-.00669438*o)*.9996),f=g*g,_=f*g,p=_*g,m=p*g,v=r-l/(.99330562/(1-.00669438*o))*(f/2-p/24*(5+3*h+10*d-4*c-9*el))+m*g/720*(61+90*h+298*d+45*u-252*el-3*c),y=(g-_/6*(1+2*h+d)+m/120*(5-2*d+28*h-3*c+8*el+24*u))/a;return[t_(y=tw(y+tp(eR(i.number)),-Math.PI,Math.PI)),t_(v)]}function eS(t,e,i){t=tw(t,-180,180),e<-80?e=-80:e>84&&(e=84);let n=tp(e),r=Math.sin(n),s=Math.cos(n),o=r/s,a=o*o,l=a*a,h=tp(t),u=tp(eR(i.number)),d=6378137/Math.sqrt(1-.00669438*r**2),c=el*s**2,g=s*tw(h-u,-Math.PI,Math.PI),f=g*g,_=f*g,p=_*g,m=p*g,v=.9996*d*(g+_/6*(1-a+c)+m/120*(5-18*a+l+72*c-58*el))+5e5,y=.9996*(6378137*(e_*n-ep*Math.sin(2*n)+em*Math.sin(4*n)-ev*Math.sin(6*n))+d*o*(f/2+p/24*(5-a+9*c+4*c**2)+m*g/720*(61-58*a+l+600*c-330*el)));return i.north||(y+=1e7),[v,y]}function eR(t){return(t-1)*6-180+3}let eb=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function eM(t){let e=0;for(let i of eb){let n=t.match(i);if(n){e=parseInt(n[1]);break}}if(!e)return null;let i=0,n=!1;return(e>32700&&e<32761?i=e-32700:e>32600&&e<32661&&(n=!0,i=e-32600),i)?{number:i,north:n}:null}function eT(t,e){return function(i,n,r,s){let o=i.length;r=r>1?r:2,s=s??r,n||(n=r>2?i.slice():Array(o));for(let r=0;r<o;r+=s){let s=t(i[r],i[r+1],e);n[r]=s[0],n[r+1]=s[1]}return n}}function eI(t,e,i){i=i||6371008.8;let n=tp(t[1]),r=tp(e[1]),s=(r-n)/2,o=tp(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(n)*Math.cos(r);return 2*i*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}let eP=[function(t){let e=eM(t.getCode());return e?{forward:eT(eS,e),inverse:eT(eC,e)}:null}],eL=[function(t){return eM(t)?new t3({code:t,units:"m"}):null}],eA=!0;function eF(t){eA=!(void 0===t||t)}function eO(t,e){if(void 0!==e)for(let i=0,n=t.length;i<n;++i)e[i]=t[i];else e=t.slice();return e}function ek(t){var e;e=t.getCode(),er[e]=t,eo(t,t,eO)}function ez(t){if("string"!=typeof t)return t;let e=er[t]||er[t.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null;if(e)return e;for(let e of eL){let i=e(t);if(i)return i}return null}function eD(t,e,i,n){let r,s=(t=ez(t)).getPointResolutionFunc();if(s){if(r=s(e,i),n&&n!==t.getUnits()){let e=t.getMetersPerUnit();e&&(r=r*e/t2[n])}}else{let s=t.getUnits();if(("degrees"!=s||n)&&"degrees"!=n){let o=eG(t,ez("EPSG:4326"));if(o||"degrees"===s){let t=[i[0]-e/2,i[1],i[0]+e/2,i[1],i[0],i[1]-e/2,i[0],i[1]+e/2];r=(eI((t=o(t,t,2)).slice(0,2),t.slice(2,4))+eI(t.slice(4,6),t.slice(6,8)))/2}else r=e*t.getMetersPerUnit();let a=n?t2[n]:t.getMetersPerUnit();void 0!==a&&(r/=a)}else r=e}return r}function ej(t){t.forEach(ek),t.forEach(function(e){t.forEach(function(t){e!==t&&eo(e,t,eO)})})}function eN(t,e){return t?"string"==typeof t?ez(t):t:ez(e)}function eK(t,e){return eF(),eW(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function eX(t,e){if(t===e)return!0;let i=t.getUnits()===e.getUnits();return t.getCode()===e.getCode()?i:eG(t,e)===eO&&i}function eG(t,e){let i=t.getCode(),n=e.getCode(),r=ea(i,n);if(r)return r;let s=null,o=null;for(let i of eP)s||(s=i(t)),o||(o=i(e));if(!s&&!o)return null;let a="EPSG:4326";if(o)if(s)r=eZ(s.inverse,o.forward);else{let t=ea(i,a);t&&(r=eZ(t,o.forward))}else{let t=ea(a,n);t&&(r=eZ(s.inverse,t))}return r&&(ek(t),ek(e),eo(t,e,r)),r}function eZ(t,e){return function(i,n,r,s){return e(n=t(i,n,r,s),n,r,s)}}function eV(t,e){return eG(ez(t),ez(e))}function eW(t,e,i){let n=eV(e,i);if(!n){let t=ez(e).getCode(),n=ez(i).getCode();throw Error(`No transform available between ${t} and ${n}`)}return n(t,void 0,t.length)}function eU(t,e){return eA&&!t$(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(eA=!1,t1("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function eY(){return[1,0,0,1,0,0]}function eB(t,e){let i=e[0],n=e[1];return e[0]=t[0]*i+t[2]*n+t[4],e[1]=t[1]*i+t[3]*n+t[5],e}function e$(t,e,i,n,r,s,o,a){let l=Math.sin(s),h=Math.cos(s);return t[0]=n*h,t[1]=r*l,t[2]=-n*l,t[3]=r*h,t[4]=o*n*h-a*n*l+e,t[5]=o*r*l+a*r*h+i,t}function eq(t,e){var i;let n=(i=e)[0]*i[3]-i[1]*i[2];tl(0!==n,"Transformation matrix cannot be inverted");let r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],h=e[5];return t[0]=a/n,t[1]=-s/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*h-a*l)/n,t[5]=-(r*h-s*l)/n,t}
1ej(t7),ej(en),r=function(t,e,i,n){let r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():Array(r));for(let i=0;i<r;i+=n){e[i]=t5*t[i]/180;let n=6378137*Math.log(Math.tan(Math.PI*(+t[i+1]+90)/360));n>t8?n=t8:n<-t8&&(n=-t8),e[i+1]=n}return e},s=function(t,e,i,n){let r=t.length;i=i>1?i:2,n=n??i,void 0===e&&(e=i>2?t.slice():Array(r));for(let i=0;i<r;i+=n)e[i]=180*t[i]/t5,e[i+1]=360*Math.atan(Math.exp(t[i+1]/6378137))/Math.PI-90;return e},en.forEach(function(t){t7.forEach(function(e){eo(t,e,r),eo(e,t,s)})});let eH=[1e5,1e5,1e5,1e5,2,2];function eJ(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}let eQ=eY(),e0=[NaN,NaN],e1=class extends N{constructor(){super(),this.extent_=tI(),this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=function(t){let e,i,n;return function(){let r=Array.prototype.slice.call(arguments);return i&&this===n&&C(r,i)||(n=this,i=r,e=t.apply(this,arguments)),e}}((t,e,i)=>{if(!i)return this.getSimplifiedGeometry(e);let n=this.clone();return n.applyTransform(i),n.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return k()}closestPointXY(t,e,i,n){return k()}containsXY(t,e){return 0===this.closestPointXY(t,e,e0,5e-324)}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 k()}getExtent(t){var e;if(this.extentRevision_!=this.getRevision()){let t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&tL(t),this.extentRevision_=this.getRevision()}return e=this.extent_,t?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):e}rotate(t,e){k()}scale(t,e,i){k()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return k()}getType(){return k()}applyTransform(t){k()}intersectsExtent(t){return k()}translate(t,e){k()}transform(t,e){let i=ez(t),n="tile-pixels"==i.getUnits()?function(t,n,r){let s=i.getExtent(),o=i.getWorldExtent(),a=tG(o)/tG(s);e$(eQ,o[0],o[3],a,-a,0,0,0);let l=function(t,e,i,n,r,s){r=r||[],s=s||2;let o=0;for(let a=0;a<e;a+=i){let e=t[a],i=t[a+1];r[o++]=n[0]*e+n[2]*i+n[4],r[o++]=n[1]*e+n[3]*i+n[5];for(let e=2;e<s;e++)r[o++]=t[a+e]}return r&&r.length!=o&&(r.length=o),r}(t,t.length,r,eQ,n),h=eV(i,e);return h?h(l,l,r):l}:eV(i,e);return this.applyTransform(n),this}};function e2(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}let e3=class extends e1{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){var e,i,n;return e=this.flatCoordinates,i=this.flatCoordinates.length,n=this.stride,tO(tL(t),e,0,i,n)}getCoordinates(){return k()}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||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;let 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=e2(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){k()}setLayout(t,e,i){let n;if(t)n=e2(t);else{var r;let s;for(let t=0;t<i;++t){if(0===e.length){this.layout="XY",this.stride=2;return}e=e[0]}2==(r=n=e.length)?s="XY":3==r?s="XYZ":4==r&&(s="XYZM"),t=s}this.layout=t,this.stride=n}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();
1!function(t,e,i,n,r,s){s=s||[];let o=Math.cos(n),a=Math.sin(n),l=r[0],h=r[1],u=0;for(let n=0;n<e;n+=i){let e=t[n]-l,r=t[n+1]-h;s[u++]=l+e*o-r*a,s[u++]=h+e*a+r*o;for(let e=n+2;e<n+i;++e)s[u++]=t[e]}s&&s.length!=u&&(s.length=u)}(i,i.length,n,t,e,i),this.changed()}}scale(t,e,i){void 0===e&&(e=t),i||(i=tN(this.getExtent()));let n=this.getFlatCoordinates();if(n){let r=this.getStride();!function(t,e,i,n,r,s,o){o=o||[];let a=s[0],l=s[1],h=0;for(let s=0;s<e;s+=i){let e=t[s]-a,u=t[s+1]-l;o[h++]=a+n*e,o[h++]=l+r*u;for(let e=s+2;e<s+i;++e)o[h++]=t[e]}o&&o.length!=h&&(o.length=h)}(n,n.length,r,t,e,i,n),this.changed()}}translate(t,e){let i=this.getFlatCoordinates();if(i){let n=this.getStride();!function(t,e,i,n,r,s){s=s||[];let o=0;for(let a=0;a<e;a+=i){s[o++]=t[a]+n,s[o++]=t[a+1]+r;for(let e=a+2;e<a+i;++e)s[o++]=t[e]}s&&s.length!=o&&(s.length=o)}(i,i.length,n,t,e,i),this.changed()}}};function e5(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1],a=0,l=0;for(;e<i;e+=n){let i=t[e]-s,n=t[e+1]-o;r+=l*i-a*n,a=i,l=n}return r/2}function e4(t,e,i,n,r,s,o){let a,l=t[e],h=t[e+1],u=t[i]-l,d=t[i+1]-h;if(0===u&&0===d)a=e;else{let g=((r-l)*u+(s-h)*d)/(u*u+d*d);if(g>1)a=i;else if(g>0){for(let r=0;r<n;++r){var c;o[r]=(c=t[e+r],c+g*(t[i+r]-c))}o.length=n;return}else a=e}for(let e=0;e<n;++e)o[e]=t[a+e];o.length=n}function e6(t,e,i,n,r){let s=t[e],o=t[e+1];for(e+=n;e<i;e+=n){let i=t[e],n=t[e+1],a=tf(s,o,i,n);a>r&&(r=a),s=i,o=n}return r}function e8(t,e,i,n,r,s,o,a,l,h,u){let d,c;if(e==i)return h;if(0===r){if((c=tf(o,a,t[e],t[e+1]))<h){for(d=0;d<n;++d)l[d]=t[e+d];return l.length=n,c}return h}u=u||[NaN,NaN];let g=e+n;for(;g<i;)if(e4(t,g-n,g,n,o,a,u),(c=tf(o,a,u[0],u[1]))<h){for(d=0,h=c;d<n;++d)l[d]=u[d];l.length=n,g+=n}else g+=n*Math.max((Math.sqrt(c)-Math.sqrt(h))/r|0,1);if(s&&(e4(t,i-n,e,n,o,a,u),(c=tf(o,a,u[0],u[1]))<h)){for(d=0,h=c;d<n;++d)l[d]=u[d];l.length=n}return h}function e9(t,e,i,n){for(let r=0,s=i.length;r<s;++r){let s=i[r];for(let i=0;i<n;++i)t[e++]=s[i]}return e}function e7(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<i;o+=n)r[s++]=t.slice(o,o+n);return r.length=s,r}function it(t,e){return e*Math.round(t/e)}class ie extends e3{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new ie(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,i,n){return n<tR(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(e6(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),e8(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,i,n))}getArea(){return e5(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return e7(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){let e=[];return e.length=function(t,e,i,n,r,s,o){let a=(i-e)/n;if(a<3){for(;e<i;e+=n)s[o++]=t[e],s[o++]=t[e+1];return o}let l=Array(a);l[0]=1,l[a-1]=1;let h=[e,i-n],u=0;for(;h.length>0;){let i=h.pop(),s=h.pop(),o=0,a=t[s],d=t[s+1],c=t[i],g=t[i+1];for(let e=s+n;e<i;e+=n){let i=function(t,e,i,n,r,s){let o=r-i,a=s-n;if(0!==o||0!==a){let l=((t-i)*o+(e-n)*a)/(o*o+a*a);l>1?(i=r,n=s):l>0&&(i+=o*l,n+=a*l)}return tf(t,e,i,n)}(t[e],t[e+1],a,d,c,g);i>o&&(u=e,o=i)}o>r&&(l[(u-e)/n]=1,s+n<u&&h.push(s,u),u+n<i&&h.push(u,i))}for(let i=0;i<a;++i)l[i]&&(s[o++]=t[e+i*n],s[o++]=t[e+i*n+1]);return o}(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new ie(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=e9(this.flatCoordinates,0,t,this.stride),this.changed()}}class ii extends e3{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){let t=new ii(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,i,n){let r=this.flatCoordinates,s=tf(t,e,r[0],r[1]);if(s<n){let t=this.stride;for(let e=0;e<t;++e)i[e]=r[e];return i.length=t,s}return n}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){var e;let i,n;return e=this.flatCoordinates,i=e[0],tP(i,n=e[1],i,n,t)}getType(){return"Point"}intersectsExtent(t){return tM(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(t,e,
1i,n){for(let n=0,r=i.length;n<r;++n)t[e++]=i[n];return e}(this.flatCoordinates,0,t,this.stride),this.changed()}}function ir(t,e,i,n,r,s){let o=0,a=t[i-n],l=t[i-n+1];for(;e<i;e+=n){let i=t[e],n=t[e+1];l<=s?n>s&&(i-a)*(s-l)-(r-a)*(n-l)>0&&o++:n<=s&&(i-a)*(s-l)-(r-a)*(n-l)<0&&o--,a=i,l=n}return 0!==o}function is(t,e,i,n,r,s){if(0===i.length||!ir(t,e,i[0],n,r,s))return!1;for(let e=1,o=i.length;e<o;++e)if(ir(t,i[e-1],i[e],n,r,s))return!1;return!0}function io(t,e,i,n,r,s){let o;if(!tY(r,s=s??tO(tI(),t,e,i,n)))return!1;if(s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3])return!0;var a,l=e;for(l+=n;l<i;l+=n){if(a=t.slice(l-n,l),o=function(t,e,i){let n=!1,r=tT(t,e),s=tT(t,i);if(1===r||1===s)n=!0;else{let o,a,l=t[0],h=t[1],u=t[2],d=t[3],c=e[0],g=e[1],f=i[0],_=i[1],p=(_-g)/(f-c);2&s&&!(2&r)&&(n=(o=f-(_-d)/p)>=l&&o<=u),n||!(4&s)||4&r||(n=(a=_-(f-u)*p)>=h&&a<=d),n||!(8&s)||8&r||(n=(o=f-(_-h)/p)>=l&&o<=u),n||!(16&s)||16&r||(n=(a=_-(f-l)*p)>=h&&a<=d)}return n}(r,a,t.slice(l,l+n)))return o}return!1}function ia(t,e,i,n,r){return!!(io(t,e,i,n,r)||ir(t,e,i,n,r[0],r[1])||ir(t,e,i,n,r[0],r[3])||ir(t,e,i,n,r[2],r[1])||ir(t,e,i,n,r[2],r[3]))}function il(t,e,i,n){let r=0,s=t[i-n],o=t[i-n+1];for(;e<i;e+=n){let i=t[e],n=t[e+1];r+=(i-s)*(n+o),s=i,o=n}return 0===r?void 0:r>0}function ih(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=il(t,e,o,n);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&function(t,e,i,n){for(;e<i-n;){for(let r=0;r<n;++r){let s=t[e+r];t[e+r]=t[i-n+r],t[i-n+r]=s}e+=n,i-=n}}(t,e,o,n),e=o}return e}class iu extends e3{constructor(t,e,i){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&i?(this.setFlatCoordinates(e,t),this.ends_=i):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?function(t,e){let i=Array.isArray(e)?e:[e],n=i.length;for(let e=0;e<n;e++)t[t.length]=i[e]}(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){let t=new iu(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,i,n){return n<tR(this.getExtent(),t,e)?n:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,i,n,r){for(let s=0,o=i.length;s<o;++s){let o=i[s];r=e6(t,e,o,n,r),e=o}return r}(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,i,n,r,s,o,a,l,h,u){u=u||[NaN,NaN];for(let d=0,c=i.length;d<c;++d){let c=i[d];h=e8(t,e,c,n,r,s,o,a,l,h,u),e=c}return h}(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,i,n))}containsXY(t,e){return is(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return function(t,e,i,n){let r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s];r+=e5(t,e,o,n),e=o}return r}(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?ih(e=this.getOrientedFlatCoordinates().slice(),0,this.ends_,this.stride,t):e=this.flatCoordinates,function(t,e,i,n,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=i[o];r[s++]=e7(t,e,a,n,r[s]),e=a}return r.length=s,r}(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){let t=tN(this.getExtent());this.flatInteriorPoint_=function(t,e,i,n){let r,s,o,a,l,h,u,d=n[1],c=[];for(let n=0,s=e.length;n<s;++n){let s=e[n];for(a=t[s-i],h=t[s-i+1],r=0;r<s;r+=i)l=t[r],u=t[r+1],(d<=h&&u<=d||h<=d&&d<=u)&&(o=(d-h)/(u-h)*(l-a)+a,c.push(o)),a=l,h=u}let g=NaN,f=-1/0;for(c.sort(w),a=c[0],r=1,s=c.length;r<s;++r){let n=Math.abs((l=c[r])-a);n>f&&is(t,0,e,i,o=(a+l)/2,d)&&(g=o,f=n),a=l}return isNaN(g)&&(g=n[0]),[g,d,f]}(this.getOrientedFlatCoordinates(),this.ends_,this.stride,t),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new ii(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new ie(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){let t=this.layout,e=this.flatCoordinates,i=this.ends_,n=[],r=0;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=new ie(e.slice(r,o),t);n.push(a),r=o}return n}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){let t=this.flatCoordinates;
1!function(t,e,i,n,r){r=void 0!==r&&r;for(let s=0,o=i.length;s<o;++s){let o=i[s],a=il(t,e,o,n);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}(t,0,this.ends_,this.stride)?(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=ih(this.orientedFlatCoordinates_,0,this.ends_,this.stride)):this.orientedFlatCoordinates_=t,this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){let e=[],i=[];return e.length=function(t,e,i,n,r,s,o,a){for(let l=0,h=i.length;l<h;++l){let h=i[l];o=function(t,e,i,n,r,s,o){let a,l;if(e==i)return o;let h=it(t[e],r),u=it(t[e+1],r);e+=n,s[o++]=h,s[o++]=u;do if(a=it(t[e],r),l=it(t[e+1],r),(e+=n)==i)return s[o++]=a,s[o++]=l,o;while(a==h&&l==u)for(;e<i;){let i=it(t[e],r),d=it(t[e+1],r);if(e+=n,i==a&&d==l)continue;let c=a-h,g=l-u,f=i-h,_=d-u;if(c*_==g*f&&(c<0&&f<c||c==f||c>0&&f>c)&&(g<0&&_<g||g==_||g>0&&_>g)){a=i,l=d;continue}s[o++]=a,s[o++]=l,h=a,u=l,a=i,l=d}return s[o++]=a,s[o++]=l,o}(t,e,h,n,r,s,o),a.push(o),e=h}return o}(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,i),new iu(e,"XY",i)}getType(){return"Polygon"}intersectsExtent(t){return function(t,e,i,n){if(!ia(t,0,e[0],i,n))return!1;if(1===e.length)return!0;for(let r=1,s=e.length;r<s;++r)if(function(t,e,i,n,r){return!tk(r,function(r){return!ir(t,e,i,n,r[0],r[1])})}(t,e[r-1],e[r],i,n)&&!io(t,e[r-1],e[r],i,n))return!1;return!0}(this.getOrientedFlatCoordinates(),this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);let i=function(t,e,i,n,r){r=r||[];let s=0;for(let o=0,a=i.length;o<a;++o){let a=e9(t,e,i[o],n);r[s++]=a,e=a}return r.length=s,r}(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===i.length?0:i[i.length-1],this.changed()}}function id(t){if(tB(t))throw Error("Cannot create polygon from empty extent");let e=t[0],i=t[1],n=t[2],r=t[3],s=[e,i,e,r,n,r,n,i,e,i];return new iu(s,"XY",[s.length])}function ic(t,e,i,n){let r=tU(e)/i[0],s=tG(e)/i[1];return n?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function ig(t,e,i){let n=Math.min(t,e);return n*=Math.log(1+50*Math.max(0,t/e-1))/50+1,i&&(n=Math.max(n,i)/(Math.log(1+50*Math.max(0,i/t-1))/50+1)),tg(n,i/2,2*e)}function i_(t,e,i,n,r){return i=void 0===i||i,function(s,o,a,l){if(void 0!==s){let o=n?ic(t,n,a,r):t;return i&&l?ig(s,o,e):tg(s,e,o)}}}function ip(t){if(void 0!==t)return 0}function im(t){if(void 0!==t)return t}function iv(t,e){setTimeout(function(){t(e)},0)}function iy(t,e,i,n,r){let s=Math.cos(-r),o=Math.sin(-r),a=t[0]*s-t[1]*o,l=t[1]*s+t[0]*o;return a+=(e[0]/2-i[0])*n,[a*s-(l+=(i[1]-e[1]/2)*n)*(o=-o),l*s+a*o]}let ix=class extends N{constructor(t){var e,i;super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=eN(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&&eF(),t.center&&(t.center=eU(t.center,this.projection_)),t.extent&&(t.extent=(e=t.extent,i=this.projection_,e)),this.applyOptions_(t)}applyOptions_(t){let e=Object.assign({},t);for(let t in tc)delete e[t];this.setProperties(e,!0);let i=function(t){var e,i,n,r,s,o;let a,l,h,u=void 0!==t.minZoom?t.minZoom:0,d=void 0!==t.maxZoom?t.maxZoom:28,c=void 0!==t.zoomFactor?t.zoomFactor:2,g=void 0!==t.multiWorld&&t.multiWorld,f=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,_=void 0!==t.showFullExtent&&t.showFullExtent,p=eN(t.projection,"EPSG:3857"),m=p.getExtent(),v=t.constrainOnlyCenter,y=t.extent;if(!g&&!y&&p.isGlobal()&&(v=!1,y=m),void 0!==t.resolutions){let n=t.resolutions;(l=n[u],h=void 0!==n[d]?n[d]:n[n.length-1],t.constrainResolution)?(e=f,i=!v&&y,e=void 0===e||e,a=function(t,r,s,o){if(void 0!==t){let a=n[0],l=n[n.length-1],h=i?ic(a,i,s,_):a;if(o)return e?ig(t,h,l):tg(t,l,h);let u=Math.floor(E(n,Math.min(h,t),r));return n[u]>h&&u<n.length-1?n[u+1]:n[u]}}):a=i_(l,h,f,!v&&y,_)}else{let e=(m?Math.max(tU(m),tG(m)):360*t2.degrees/p.getMetersPerUnit())/256/1;(void 0!==(l=t.maxResolution)?u=0:l=e/Math.pow(c,u),void 0===(h=t.minResolution)&&(h=void 0!==t.maxZoom?void 0!==t.maxResolution?l/Math.pow(c,d):e/Math.pow(c,d):e/0x10000000),d=u+Math.floor(Math.log(l/h)/Math.log(c)),h=l/Math.pow(c,d-u),t.constrainResolution)?(n=l,r=h,s=f,o=!v&&y,s=void 0===s||s,r=void 0!==r?r:0,a=function(t,e,
1i,a){if(void 0!==t){let l=o?ic(n,o,i,_):n;if(a)return s?ig(t,l,r):tg(t,r,l);let h=Math.max(Math.ceil(Math.log(n/l)/Math.log(c)-1e-9),Math.floor(Math.log(n/Math.min(l,t))/Math.log(c)+(-(.499999999*e)+.5)));return tg(n/Math.pow(c,h),r,l)}}):a=i_(l,h,f,!v&&y,_)}return{constraint:a,maxResolution:l,minResolution:h,minZoom:u,zoomFactor:c}}(t);this.maxResolution_=i.maxResolution,this.minResolution_=i.minResolution,this.zoomFactor_=i.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=i.minZoom;let n=function(t){if(void 0!==t.extent){let e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return tE(t.extent,t.constrainOnlyCenter,e)}let e=eN(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){let t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,tE(t,!1,!1)}return tC}(t),r=i.constraint,s=function(t){if(void 0===t.enableRotation||t.enableRotation){let e=t.constrainRotation;if(void 0===e||!0===e){let t;return t=tp(5),function(e,i){return i||void 0===e?e:Math.abs(e)<=t?0:e}}if(!1===e)return im;if("number"==typeof e){let t;return t=2*Math.PI/e,function(e,i){return i?e:void 0!==e?e=Math.floor(e/t+.5)*t:void 0}}return im}return ip}(t);this.constraints_={center:n,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;let i=this.getCenterInternal();if(i){let n=t||[0,0,0,0];e=e||[0,0,0,0];let r=this.getResolution(),s=r/2*(n[3]-e[3]+e[1]-n[1]),o=r/2*(n[0]-e[0]+e[2]-n[2]);this.setCenterInternal([i[0]+s,i[1]-o])}}getUpdatedOptions_(t){let e=this.getProperties();return void 0!==e.resolution?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);let e=Array(arguments.length);for(let t=0;t<e.length;++t){let i=arguments[t];i.center&&((i=Object.assign({},i)).center=eU(i.center,this.getProjection())),i.anchor&&((i=Object.assign({},i)).anchor=eU(i.anchor,this.getProjection())),e[t]=i}this.animateInternal.apply(this,e)}animateInternal(t){let e,i=arguments.length;i>1&&"function"==typeof arguments[i-1]&&(e=arguments[i-1],--i);let n=0;for(;n<i&&!this.isDef();++n){let t=arguments[n];t.center&&this.setCenterInternal(t.center),void 0!==t.zoom?this.setZoom(t.zoom):t.resolution&&this.setResolution(t.resolution),void 0!==t.rotation&&this.setRotation(t.rotation)}if(n===i){e&&iv(e,!0);return}let r=Date.now(),s=this.targetCenter_.slice(),o=this.targetResolution_,a=this.targetRotation_,l=[];for(;n<i;++n){var h;let t=arguments[n],i={start:r,complete:!1,anchor:t.anchor,duration:void 0!==t.duration?t.duration:1e3,easing:t.easing||tQ,callback:e};if(t.center&&(i.sourceCenter=s,i.targetCenter=t.center.slice(),s=i.targetCenter),void 0!==t.zoom?(i.sourceResolution=o,i.targetResolution=this.getResolutionForZoom(t.zoom),o=i.targetResolution):t.resolution&&(i.sourceResolution=o,i.targetResolution=t.resolution,o=i.targetResolution),void 0!==t.rotation){i.sourceRotation=a;let e=tm(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;i.targetRotation=a+e,a=i.targetRotation}(!(h=i).sourceCenter||!h.targetCenter||t$(h.sourceCenter,h.targetCenter))&&h.sourceResolution===h.targetResolution&&h.sourceRotation===h.targetRotation?i.complete=!0:r+=i.duration,l.push(i)}this.animations_.push(l),this.setHint(0,1),this.updateAnimations_()}getAnimating(){return this.hints_[0]>0}getInteracting(){return this.hints_[1]>0}cancelAnimations(){let t;this.setHint(0,-this.hints_[0]);for(let e=0,i=this.animations_.length;e<i;++e){let i=this.animations_[e];if(i[0].callback&&iv(i[0].callback,!1),!t)for(let e=0,n=i.length;e<n;++e){let n=i[e];if(!n.complete){t=n.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;let t=Date.now(),e=!1;for(let i=this.animations_.length-1;i>=0;--i){let n=this.animations_[i],r=!0;for(let i=0,s=n.length;i<s;++i){let s=n[i];if(s.complete)continue;let o=t-s.start,a=s.duration>0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;let l=s.easing(a);if(s.sourceCenter){let t=s.sourceCenter[0],e=s.sourceCenter[1],i=s.targetCenter[0],n=s.targetCenter[1];this.nextCenter_=s.targetCenter;let r=t+l*(i-t),o=e+l*(n-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){let t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){let e=this.getViewportSize_(this.getRotation()),i=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(i,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){let t=1===l?tm(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){let e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[i]=null,this.setHint(0,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;let t=n[0].callback;t&&iv(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i,n=this.getCenterInternal();if(void 0!==n){var r;tq(i=[n[0]-e[0],n[1]-e[1]],t-this.getRotation()),r=i,r[0]+=+e[0],r[1]+=+e[1]}return i}calculateCenterZoom(t,e){let i,n=this.getCenterInternal(),r=this.getResolution();return void 0!==n&&void 0!==r&&(i=[e[0]-t*(e[0]-n[0])/r,e[1]-t*(e[1]-n[1])/r]),i}getViewportSize_(t){let e=this.viewportSize_;if(t){let i=e[0],n=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(n*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(n*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){var t,e;let i=this.getCenterInternal();return i?(t=i,e=this.getProjection(),t):i}getCenterInternal(){return this.get(tc.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){var e;return e=this.calculateExtentInternal(t),this.getProjection(),e}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();let e=this.getCenterInternal();tl(e,"The view center is not defined");let i=this.getResolution();tl(void 0!==i,"The view resolution is not defined");let n=this.getRotation();return tl(void 0!==n,"The view rotation is not defined"),tK(e,i,n,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(tc.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){var i,n;return this.getResolutionForExtentInternal((i=t,n=this.getProjection(),i),e)}getResolutionForExtentInternal(t,e){return e=e||this.getViewportSizeMinusPadding_(),Math.max(tU(t)/e[0],tG(t)/e[1])}getResolutionForValueFunction(t){t=t||2;let e=this.getConstrainedResolution(this.maxResolution_),i=Math.log(e/this.minResolution_)/Math.log(t);return function(n){return e/Math.pow(t,n*i)}}getRotation(){return this.get(tc.ROTATION)}getValueForResolutionFunction(t){let e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),n=Math.log(i/this.minResolution_)/e;return function(t){return Math.log(i/t)/e/n}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t),i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){let t=this.getProjection(),e=this.getResolution(),i=this.getRotation(),n=this.getCenterInternal(),r=this.padding_;if(r){let t=this.getViewportSizeMinusPadding_();n=iy(n,this.getViewportSize_(),[t[0]/2+r[3],t[1]/2+r[0]],e,i)}return{center:n.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t,e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,i,n=this.minZoom_||0;if(this.resolutions_){let r=E(this.resolutions_,t,1);n=r,e=this.resolutions_[r],i=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,i=this.zoomFactor_;return n+Math.log(e/t)/Math.log(i)}getResolutionForZoom(t){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];let e=tg(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,tg(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}
1fit(t,e){var i,n,r,s;let o;if(tl(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){tl(!tB(t),"Cannot fit empty extent provided as `geometry`"),o=id((i=t,n=this.getProjection(),i))}else if("Circle"===t.getType()){let e=(r=t.getExtent(),s=this.getProjection(),r);(o=id(e)).rotate(this.getRotation(),tN(e))}else o=t;this.fitInternal(o,e)}rotatedExtentForGeometry(t){let e=this.getRotation(),i=Math.cos(e),n=Math.sin(-e),r=t.getFlatCoordinates(),s=t.getStride(),o=Infinity,a=Infinity,l=-1/0,h=-1/0;for(let t=0,e=r.length;t<e;t+=s){let e=r[t]*i-r[t+1]*n,s=r[t]*n+r[t+1]*i;o=Math.min(o,e),a=Math.min(a,s),l=Math.max(l,e),h=Math.max(h,s)}return[o,a,l,h]}fitInternal(t,e){let i,n=(e=e||{}).size;n||(n=this.getViewportSizeMinusPadding_());let r=void 0!==e.padding?e.padding:[0,0,0,0],s=void 0!==e.nearest&&e.nearest;i=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;let o=this.rotatedExtentForGeometry(t),a=this.getResolutionForExtentInternal(o,[n[0]-r[1]-r[3],n[1]-r[0]-r[2]]);a=isNaN(a)?i:Math.max(a,i),a=this.getConstrainedResolution(a,+!s);let l=this.getRotation(),h=Math.sin(l),u=Math.cos(l),d=tN(o);d[0]+=(r[1]-r[3])/2*a,d[1]+=(r[0]-r[2])/2*a;let c=d[0]*u-d[1]*h,g=d[1]*u+d[0]*h,f=this.getConstrainedCenter([c,g],a),_=e.callback?e.callback:b;void 0!==e.duration?this.animateInternal({resolution:a,center:f,duration:e.duration,easing:e.easing},_):(this.targetResolution_=a,this.targetCenter_=f,this.applyTargetState_(!1,!0),iv(_,!0))}centerOn(t,e,i){this.centerOnInternal(eU(t,this.getProjection()),e,i)}centerOnInternal(t,e,i){this.setCenterInternal(iy(t,e,i,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,i,n){let r,s=this.padding_;if(s&&t){let o=this.getViewportSizeMinusPadding_(-i),a=iy(t,n,[o[0]/2+s[3],o[1]/2+s[0]],e,i);r=[t[0]-a[0],t[1]-a[1]]}return r}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(t){var e,i;let n=(e=this.targetCenter_,i=this.getProjection(),e);this.setCenter([n[0]+t[0],n[1]+t[1]])}adjustCenterInternal(t){let e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&eU(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){let i=this.getAnimating()||this.getInteracting(),n=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,n,i);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=eU(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){let i=this.getAnimating()||this.getInteracting(),n=this.constraints_.rotation(this.targetRotation_+t,i);e&&(this.targetCenter_=this.calculateCenterRotate(n,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t?eU(t,this.getProjection()):t)}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){let i=this.getAnimating()||this.getInteracting()||e,n=this.constraints_.rotation(this.targetRotation_,i),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,0,r,i),o=this.constraints_.center(this.targetCenter_,s,r,i,this.calculateCenterShift(this.targetCenter_,s,n,r));this.get(tc.ROTATION)!==n&&this.set(tc.ROTATION,n),this.get(tc.RESOLUTION)!==s&&(this.set(tc.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),o&&this.get(tc.CENTER)&&t$(this.get(tc.CENTER),o)||this.set(tc.CENTER,o),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,i){t=void 0!==t?t:200;let n=this.constraints_.rotation(this.targetRotation_),r=this.getViewportSize_(n),s=this.constraints_.resolution(this.targetResolution_,e||0,r),o=this.constraints_.center(this.targetCenter_,s,r,!1,this.calculateCenterShift(this.targetCenter_,s,n,r));if(0===t&&!this.cancelAnchor_){this.targetResolution_=s,this.targetRotation_=n,this.targetCenter_=o,this.applyTargetState_();return}i=i||(0===t?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,this.getResolution()===s&&this.getRotation()===n&&this.getCenterInternal()&&t$(this.getCenterInternal(),o)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:n,center:o,resolution:s,duration:t,easing:tJ,anchor:i}))}beginInteraction(){this.resolveConstraints(0),this.setHint(1,1)}
1endInteraction(t,e,i){i=i&&eU(i,this.getProjection()),this.endInteractionInternal(t,e,i)}endInteractionInternal(t,e,i){this.getInteracting()&&(this.setHint(1,-1),this.resolveConstraints(t,e,i))}getConstrainedCenter(t,e){let i=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),i)}getConstrainedZoom(t,e){let i=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(i,e))}getConstrainedResolution(t,e){e=e||0;let i=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,i)}},iw="ol-hidden",iE="ol-unselectable",iC="ol-control",iS="ol-collapsed",iR=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*$","i");function ib(t,e,i,n){let r;return r=i&&i.length?i.shift():q?new OffscreenCanvas(t||300,e||300):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",n)}function iM(){return e||(e=ib(1,1)),e}function iT(t){let e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function iI(t,e){let i=e.parentNode;i&&i.replaceChild(t,e)}function iP(t){for(;t.lastChild;)t.lastChild.remove()}let iL=class extends N{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 t=0,e=this.listenerKeys.length;t<e;++t)A(this.listenerKeys[t]);if(this.listenerKeys.length=0,this.map_=t,t){let e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==b&&this.listenerKeys.push(L(t,te,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}},iA=class extends iL{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=void 0!==t.className?t.className:"ol-attribution",i=void 0!==t.tipLabel?t.tipLabel:"Attributions",n=void 0!==t.expandClassName?t.expandClassName:e+"-expand",r=void 0!==t.collapseLabel?t.collapseLabel:"›",s=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=s):this.collapseLabel_=r;const o=void 0!==t.label?t.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o,this.label_.className=n):this.label_=o;const a=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=i,this.toggleButton_.appendChild(a),this.toggleButton_.addEventListener(_,this.handleClick_.bind(this),!1);const l=e+" "+iE+" "+iC+(this.collapsed_&&this.collapsible_?" "+iS:"")+(this.collapsible_?"":" ol-uncollapsible"),h=this.element;h.className=l,h.appendChild(this.toggleButton_),h.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){let e=this.getMap().getAllLayers(),i=new Set(e.flatMap(e=>e.getAttributions(t)));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach(t=>i.add(t)):i.add(this.attributions_)),!this.overrideCollapsible_){let t=!e.some(t=>t.getSource()?.getAttributionsCollapsible()===!1);this.setCollapsible(t)}return Array.from(i)}async updateElement_(t){if(!t){this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1);return}let e=await Promise.all(this.collectSourceAttributions_(t).map(t=>(function(t){let e;try{e=t()}catch(t){return Promise.reject(t)}return e instanceof Promise?e:Promise.resolve(e)})(()=>t))),i=e.length>0;if(this.renderedVisible_!=i&&(this.element.style.display=i?"":"none",this.renderedVisible_=i),!C(e,this.renderedAttributions_)){iP(this.ulElement_);for(let t=0,i=e.length;t<i;++t){let i=document.createElement("li");i.innerHTML=e[t],this.ulElement_.appendChild(i)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(iS),this.collapsed_?iI(this.collapseLabel_,this.label_):iI(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)}},iF=class extends iL{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",i=void 0!==t.label?t.label:"⇧",n=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof i?(this.label_=document.createElement("span"),this.label_.className=n,this.label_.textContent=i):(this.label_=i,this.label_.classList.add(n));const r=t.tipLabel?t.tipLabel:"Reset rotation",s=document.createElement("button");s.className=e+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),s.addEventListener(_,this.handleClick_.bind(this),!1);const o=this.element;o.className=e+" "+iE+" "+iC,o.appendChild(s),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(iw)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){let t=this.getMap().getView();if(!t)return;let e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:tJ}):t.setRotation(0))}render(t){let e=t.frameState;if(!e)return;let i=e.viewState.rotation;if(i!=this.rotation_){if(this.autoHide_){let t=this.element.classList.contains(iw);t||0!==i?t&&0!==i&&this.element.classList.remove(iw):this.element.classList.add(iw)}this.label_.style.transform="rotate("+i+"rad)"}this.rotation_=i}},iO=class extends iL{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",i=void 0!==t.delta?t.delta:1,n=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",r=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",s=void 0!==t.zoomInLabel?t.zoomInLabel:"+",o=void 0!==t.zoomOutLabel?t.zoomOutLabel:"–",a=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",l=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",h=document.createElement("button");h.className=n,h.setAttribute("type","button"),h.title=a,h.appendChild("string"==typeof s?document.createTextNode(s):s),h.addEventListener(_,this.handleClick_.bind(this,i),!1);const u=document.createElement("button");u.className=r,u.setAttribute("type","button"),u.title=l,u.appendChild("string"==typeof o?document.createTextNode(o):o),u.addEventListener(_,this.handleClick_.bind(this,-i),!1);const d=this.element;d.className=e+" "+iE+" "+iC,d.appendChild(h),d.appendChild(u),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){let e=this.getMap().getView();if(!e)return;let i=e.getZoom();if(void 0!==i){let n=e.getConstrainedZoom(i+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:n,duration:this.duration_,easing:tJ})):e.setZoom(n)}}};function ik(t){t=t||{};let e=new G;return(void 0===t.zoom||t.zoom)&&e.push(new iO(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&e.push(new iF(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&e.push(new iA(t.attributionOptions)),e}let iz=class{constructor(t,e,i){this.decay_=t,this.minVelocity_=e,this.delay_=i,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;let t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let i=e-3;for(;i>0&&this.points_[i+2]>t;)i-=3;let n=this.points_[e+2]-this.points_[i+2];if(n<1e3/60)return!1;let r=this.points_[e]-this.points_[i],s=this.points_[e+1]-this.points_[i+1];return this.angle_=Math.atan2(s,r),this.initialVelocity_=Math.sqrt(r*r+s*s)/n,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}},iD="active";
1function ij(t,e,i,n){let r=t.getZoom();if(void 0===r)return;let s=t.getConstrainedZoom(r+e),o=t.getResolutionForZoom(s);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:i,duration:void 0!==n?n:250,easing:tJ})}let iN=class extends N{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(iD)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(iD,t)}setMap(t){this.map_=t}},iK=class extends iN{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==W.DBLCLICK){let i=t.originalEvent,n=t.map,r=t.coordinate,s=i.shiftKey?-this.delta_:this.delta_;ij(n.getView(),s,r,this.duration_),i.preventDefault(),e=!0}return!e}};function iX(t){let e=arguments;return function(t){let i=!0;for(let n=0,r=e.length;n<r&&(i=i&&e[n](t));++n);return i}}let iG=function(t){let e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},iZ=function(t){let e=t.map.getTargetElement(),i=e.getRootNode(),n=t.map.getOwnerDocument().activeElement;return i instanceof ShadowRoot?i.host.contains(n):e.contains(n)},iV=function(t){let e=t.map.getTargetElement(),i=e.getRootNode();return!(i instanceof ShadowRoot?i.host:e).hasAttribute("tabindex")||iZ(t)},iW=function(t){let e=t.originalEvent;return"pointerId"in e&&0==e.button&&!(Y&&B&&e.ctrlKey)},iU=function(t){let e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},iY=function(t){let e=t.originalEvent;return B?e.metaKey:e.ctrlKey},iB=function(t){let e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},i$=function(t){let e=t.originalEvent,i=e.target.tagName;return"INPUT"!==i&&"SELECT"!==i&&"TEXTAREA"!==i&&!e.target.isContentEditable},iq=function(t){let e=t.originalEvent;return"pointerId"in e&&"mouse"==e.pointerType},iH=function(t){let e=t.originalEvent;return"pointerId"in e&&e.isPrimary&&0===e.button};function iJ(t){let e=t.length,i=0,n=0;for(let r=0;r<e;r++)i+=t[r].clientX,n+=t[r].clientY;return{clientX:i/e,clientY:n/e}}let iQ=class extends iN{constructor(t){super(t=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==W.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==W.POINTERUP){let e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==W.POINTERDOWN){let i=this.handleDownEvent(t);this.handlingDownUpSequence=i,e=this.stopDown(i)}else t.type==W.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}},i0=class extends iQ{constructor(t){super({stopDown:R}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:iX(iU,iH);this.condition_=t.onFocusOnly?iX(iV,e):e,this.noKinetic_=!1}handleDragEvent(t){let e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());let i=this.targetPointers,n=e.getEventPixel(iJ(i));if(i.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(n[0],n[1]),this.lastCentroid){var r;let e=[this.lastCentroid[0]-n[0],n[1]-this.lastCentroid[1]],i=t.map.getView();r=i.getResolution(),e[0]*=r,e[1]*=r,tq(e,i.getRotation()),i.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();this.lastCentroid=n,this.lastPointersCount_=i.length,t.originalEvent.preventDefault()}handleUpEvent(t){let e=t.map,i=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){let t=this.kinetic_.getDistance(),n=this.kinetic_.getAngle(),r=i.getCenterInternal(),s=e.getPixelFromCo
1ordinateInternal(r),o=e.getCoordinateFromPixelInternal([s[0]-t*Math.cos(n),s[1]-t*Math.sin(n)]);i.animateInternal({center:i.getConstrainedCenter(o),duration:500,easing:tJ})}return this.panning_&&(this.panning_=!1,i.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){let e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}},i1=class extends iQ{constructor(t){t=t||{},super({stopDown:R}),this.condition_=t.condition?t.condition:iG,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!iq(t))return;let e=t.map,i=e.getView();if(i.getConstraints().rotation===ip)return;let n=e.getSize(),r=t.pixel,s=Math.atan2(n[1]/2-r[1],r[0]-n[0]/2);if(void 0!==this.lastAngle_){let t=s-this.lastAngle_;i.adjustRotationInternal(-t)}this.lastAngle_=s}handleUpEvent(t){return!iq(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!!iq(t)&&!!(iW(t)&&this.condition_(t))&&(t.map.getView().beginInteraction(),this.lastAngle_=void 0,!0)}},i2=class extends x{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_(){let t=this.startPixel_,e=this.endPixel_,i=this.element_.style;i.left=Math.min(t[0],e[0])+"px",i.top=Math.min(t[1],e[1])+"px",i.width=Math.abs(e[0]-t[0])+"px",i.height=Math.abs(e[1]-t[1])+"px"}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);let t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.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;let t=this.startPixel_,e=this.endPixel_,i=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);i[4]=i[0].slice(),this.geometry_?this.geometry_.setCoordinates([i]):this.geometry_=new iu([i])}getGeometry(){return this.geometry_}},i3="boxcancel";class i5 extends I{constructor(t,e,i){super(t),this.coordinate=e,this.mapBrowserEvent=i}}let i4=class extends iQ{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new i2(t.className||"ol-dragbox"),this.minArea_=t.minArea??
164,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??iW,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,i){let n=i[0]-e[0],r=i[1]-e[1];return n*n+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new i5("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;let e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new i5(e?"boxend":i3,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 i5("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){!t&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new i5(i3,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new i5(i3,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}},i6=class extends i4{constructor(t){super({condition:(t=t||{}).condition?t.condition:iB,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){let e=this.getMap().getView(),i=this.getGeometry();if(this.out_){let t=e.rotatedExtentForGeometry(i),n=e.getResolutionForExtentInternal(t),r=e.getResolution()/n;(i=i.clone()).scale(r*r)}e.fitInternal(i,{duration:this.duration_,easing:tJ})}},i8="ArrowLeft",i9="ArrowRight",i7="ArrowDown",nt=class extends iN{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return iU(t)&&i$(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==p){let n=t.originalEvent,r=n.key;if(this.condition_(t)&&(r==i7||r==i8||r==i9||"ArrowUp"==r)){let s=t.map.getView(),o=s.getResolution()*this.pixelDelta_,a=0,l=0;r==i7?l=-o:r==i8?a=-o:r==i9?a=o:l=o;let h=[a,l];tq(h,s.getRotation());var i=this.duration_;let u=s.getCenterInternal();if(u){let t=[u[0]+h[0],u[1]+h[1]];s.animateInternal({duration:void 0!==i?i:250,easing:t0,center:s.getConstrainedCenter(t)})}n.preventDefault(),e=!0}}return!e}},ne=class extends iN{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!iY(t)&&i$(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==p||t.type==m){let i=t.originalEvent,n=i.key;if(this.condition_(t)&&("+"===n||"-"===n)){let r=t.map,s="+"===n?this.delta_:-this.delta_;ij(r.getView(),s,void 0,this.duration_),i.preventDefault(),e=!0}}return!e}},ni=class extends iN{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:S;this.condition_=t.onFocusOnly?iX(iV,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;let t=this.getMap();t&&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)return!0;let e=t.map,i=t.originalEvent;i.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let n=i.deltaY;switch(i.deltaMode){case WheelEvent.DOM_DELTA_LINE:n*=40;break;case WheelEvent.DOM_DELTA_PAGE:n*=300}if(0===n)return!1;this.lastDelta_=n;let r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=4>Math.abs(n)?"trackpad":"wheel");let s=e.getView();if("trackpad"===this.mode_&&!(s.getConstrainResolution()||this.constrainResolution_))return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adju
1stZoom(-n/this.deltaPerZoom_,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=r,!1;this.totalDelta_+=n;let o=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),o),!1}handleWheelZoom_(t){let e=t.getView();e.getAnimating()&&e.cancelAnimations();let i=-tg(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(i=i?i>0?1:-1:0),ij(e,i,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)}},nn=class extends iQ{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=R),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0,i=this.targetPointers[0],n=this.targetPointers[1],r=Math.atan2(n.clientY-i.clientY,n.clientX-i.clientX);if(void 0!==this.lastAngle_){let t=r-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=r;let s=t.map,o=s.getView();o.getConstraints().rotation!==ip&&(this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(iJ(this.targetPointers))),this.rotating_&&(s.render(),o.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){if(this.targetPointers.length>=2){let 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}},nr=class extends iQ{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=R),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1,i=this.targetPointers[0],n=this.targetPointers[1],r=i.clientX-n.clientX,s=i.clientY-n.clientY,o=Math.sqrt(r*r+s*s);void 0!==this.lastDistance_&&(e=this.lastDistance_/o),this.lastDistance_=o;let a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(iJ(this.targetPointers))),a.render(),l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){let e=t.map.getView(),i=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,i),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){let e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}},ns="opacity",no="visible",na="extent",nl="zIndex",nh="maxResolution",nu="minResolution",nd="maxZoom",nc="minZoom",ng="source",nf=class extends N{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[ns]=void 0!==t.opacity?t.opacity:1,tl("number"==typeof e[ns],"Layer opacity must be a number"),e[no]=void 0===t.visible||t.visible,e[nl]=t.zIndex,e[nh]=void 0!==t.maxResolution?t.maxResolution:1/0,e[nu]=void 0!==t.minResolution?t.minResolution:0,e[nc]=void 0!==t.minZoom?t.minZoom:-1/0,e[nd]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){let e=this.state_||{layer:this,managed:void 0===t||t},i=this.getZIndex();return e.opacity=tg(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==i||e.managed?i:1/0,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 k()}getLayerStatesArray(t){return k()}getExtent(){return this.get(na)}getMaxResolution(){return this.get(nh)}getMinResolution(){return this.get(nu)}getMinZoom(){return this.get(nc)}getMaxZoom(){return this.get(nd)}getOpacity(){return this.get(ns)}getSourceState(){return k()}getVisible(){return this.get(no)}getZIndex(){return this.get(nl)}
1setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(na,t)}setMaxResolution(t){this.set(nh,t)}setMinResolution(t){this.set(nu,t)}setMaxZoom(t){this.set(nd,t)}setMinZoom(t){this.set(nc,t)}setOpacity(t){tl("number"==typeof t,"Layer opacity must be a number"),this.set(ns,t)}setVisible(t){this.set(no,t)}setZIndex(t){this.set(nl,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}};class n_ extends I{constructor(t,e){super(t),this.layer=e}}let np="layers";class nm extends nf{constructor(t){const e=Object.assign({},t=t||{});delete e.layers;let i=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(np,this.handleLayersChanged_),i?Array.isArray(i)?i=new G(i.slice(),{unique:!0}):tl("function"==typeof i.getArray,"Expected `layers` to be an array or a `Collection`"):i=new G(void 0,{unique:!0}),this.setLayers(i)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(A),this.layersListenerKeys_.length=0;let t=this.getLayers();for(let e in this.layersListenerKeys_.push(L(t,"add",this.handleLayersAdd_,this),L(t,d,this.handleLayersRemove_,this)),this.listenerKeys_)this.listenerKeys_[e].forEach(A);M(this.listenerKeys_);let e=t.getArray();for(let t=0,i=e.length;t<i;t++){let i=e[t];this.registerLayerListeners_(i),this.dispatchEvent(new n_("addlayer",i))}this.changed()}registerLayerListeners_(t){let e=[L(t,c,this.handleLayerChange_,this),L(t,g,this.handleLayerChange_,this)];t instanceof nm&&e.push(L(t,"addlayer",this.handleLayerGroupAdd_,this),L(t,"removelayer",this.handleLayerGroupRemove_,this)),this.listenerKeys_[D(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new n_("addlayer",t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new n_("removelayer",t.layer))}handleLayersAdd_(t){let e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new n_("addlayer",e)),this.changed()}handleLayersRemove_(t){let e=t.element,i=D(e);this.listenerKeys_[i].forEach(A),delete this.listenerKeys_[i],this.dispatchEvent(new n_("removelayer",e)),this.changed()}getLayers(){return this.get(np)}setLayers(t){let e=this.getLayers();if(e){let t=e.getArray();for(let e=0,i=t.length;e<i;++e)this.dispatchEvent(new n_("removelayer",t[e]))}this.set(np,t)}getLayersArray(t){return t=void 0!==t?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){let e=void 0!==t?t:[],i=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});let n=this.getLayerState(),r=n.zIndex;t||void 0!==n.zIndex||(r=0);for(let t=i,s=e.length;t<s;t++){let i=e[t];i.opacity*=n.opacity,i.visible=i.visible&&n.visible,i.maxResolution=Math.min(i.maxResolution,n.maxResolution),i.minResolution=Math.max(i.minResolution,n.minResolution),i.minZoom=Math.max(i.minZoom,n.minZoom),i.maxZoom=Math.min(i.maxZoom,n.maxZoom),void 0!==n.extent&&(void 0!==i.extent?i.extent=tZ(i.extent,n.extent):i.extent=n.extent),void 0===i.zIndex&&(i.zIndex=r)}return e}getSourceState(){return"ready"}}let nv="prerender",ny="postrender",nx="precompose",nw="rendercomplete";function nE(t,e){if(!t.visible)return!1;let i=e.resolution;if(i<t.minResolution||i>=t.maxResolution)return!1;let n=e.zoom;return n>t.minZoom&&n<=t.maxZoom}let nC=class extends nf{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(ng,this.handleSourcePropertyChange_);const i=t.source?t.source:null;this.setSource(i)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(ng)||null}getRenderSource(){return this.getSource()}getSourceState(){let t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(A(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;let t=this.getSource();t&&(this.sourceChangeKey_=L(t,g,this.handleSourceChange_,this),"ready"===t.getState()&&(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?this.renderer_.getData(t):null}isVisible(t){let e,i,n=this.getMapInternal();if(!t&&n&&(t=n.getView()),!(e=t instanceof ix?{viewState:t.getState(),extent:t.calculateExtent()}:t).layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray()),e.layerStatesArray){if(!(i=e.layerStatesArray.find(t=>t.layer===this)))return!1}else i=this.getLayerState();let r=this.getExtent();return nE(i,e.viewState)&&(!r||tY(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];let e=this.getSource()?.getAttributions();if(!e)return[];let i=e(t instanceof ix?t.getViewStateAndExtent():t);return Array.isArray(i)||(i=[i]),i}render(t,e){let i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){let e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set("map",t)}getMapInternal(){return this.get("map")}setMap(t){this.mapPrecomposeKey_&&(A(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(A(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=L(t,nx,this.handlePrecompose_,this),this.mapRenderKey_=L(this,g,t.render,t),this.changed())}handlePrecompose_(t){let e=t.frameState.layerStatesArray,i=this.getLayerState(!1);tl(!e.some(t=>t.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(ng,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 nS(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}class nR{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data,i=[];if(!nO(t,e))return i;let n=this.toBBox,r=[];for(;e;){for(let s=0;s<e.children.length;s++){let o=e.children[s],a=e.leaf?n(o):o;nO(t,a)&&(e.leaf?i.push(o):nF(t,a)?this._all(o,i):r.push(o))}e=r.pop()}return i}collides(t){let e=this.data;if(!nO(t,e))return!1;let i=[];for(;e;){for(let n=0;n<e.children.length;n++){let r=e.children[n],s=e.leaf?this.toBBox(r):r;if(nO(t,s)){if(e.leaf||nF(t,s))return!0;
1i.push(r)}}e=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){let t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=nk([]),this}remove(t,e){let i,n,r;if(!t)return this;let s=this.data,o=this.toBBox(t),a=[],l=[];for(;s||a.length;){if(s||(s=a.pop(),n=a[a.length-1],i=l.pop(),r=!0),s.leaf){let i=function(t,e,i){if(!i)return e.indexOf(t);for(let n=0;n<e.length;n++)if(i(t,e[n]))return n;return -1}(t,s.children,e);if(-1!==i){s.children.splice(i,1),a.push(s),this._condense(a);break}}!r&&!s.leaf&&nF(s,o)?(a.push(s),l.push(i),i=0,n=s,s=s.children[0]):n?(i++,s=n.children[i],r=!1):s=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){let i=[];for(;t;)t.leaf?e.push(...t.children):i.push(...t.children),t=i.pop();return e}_build(t,e,i,n){let r,s=i-e+1,o=this._maxEntries;if(s<=o)return nb(r=nk(t.slice(e,i+1)),this.toBBox),r;n||(n=Math.ceil(Math.log(s)/Math.log(o)),o=Math.ceil(s/Math.pow(o,n-1))),(r=nk([])).leaf=!1,r.height=n;let a=Math.ceil(s/o),l=a*Math.ceil(Math.sqrt(o));nz(t,e,i,l,this.compareMinX);for(let s=e;s<=i;s+=l){let e=Math.min(s+l-1,i);nz(t,s,e,a,this.compareMinY);for(let i=s;i<=e;i+=a){let s=Math.min(i+a-1,e);r.children.push(this._build(t,i,s,n-1))}}return nb(r,this.toBBox),r}_chooseSubtree(t,e,i,n){for(;;){let o;if(n.push(e),e.leaf||n.length-1===i)break;let a=1/0,l=1/0;for(let i=0;i<e.children.length;i++){var r,s;let n=e.children[i],h=nL(n),u=(r=t,(Math.max((s=n).maxX,r.maxX)-Math.min(s.minX,r.minX))*(Math.max(s.maxY,r.maxY)-Math.min(s.minY,r.minY))-h);u<l?(l=u,a=h<a?h:a,o=n):u===l&&h<a&&(a=h,o=n)}e=o||e.children[0]}return e}_insert(t,e,i){let n=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(n,this.data,e,r);for(s.children.push(t),nT(s,n);e>=0;)if(r[e].children.length>this._maxEntries)this._split(r,e),e--;else break;this._adjustParentBBoxes(n,r,e)}_split(t,e){let i=t[e],n=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,n);let s=this._chooseSplitIndex(i,r,n),o=nk(i.children.splice(s,i.children.length-s));o.height=i.height,o.leaf=i.leaf,nb(i,this.toBBox),nb(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(i,o)}_splitRoot(t,e){this.data=nk([t,e]),this.data.height=t.height+1,this.data.leaf=!1,nb(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let n,r=1/0,s=1/0;for(let o=e;o<=i-e;o++){let e=nM(t,0,o,this.toBBox),a=nM(t,o,i,this.toBBox),l=function(t,e){let i=Math.max(t.minX,e.minX),n=Math.max(t.minY,e.minY);return Math.max(0,Math.min(t.maxX,e.maxX)-i)*Math.max(0,Math.min(t.maxY,e.maxY)-n)}(e,a),h=nL(e)+nL(a);l<r?(r=l,n=o,s=h<s?h:s):l===r&&h<s&&(s=h,n=o)}return n||i-e}_chooseSplitAxis(t,e,i){let n=t.leaf?this.compareMinX:nI,r=t.leaf?this.compareMinY:nP;this._allDistMargin(t,e,i,n)<this._allDistMargin(t,e,i,r)&&t.children.sort(n)}_allDistMargin(t,e,i,n){t.children.sort(n);let r=this.toBBox,s=nM(t,0,e,r),o=nM(t,i-e,i,r),a=nA(s)+nA(o);for(let n=e;n<i-e;n++){let e=t.children[n];nT(s,t.leaf?r(e):e),a+=nA(s)}for(let n=i-e-1;n>=e;n--){let e=t.children[n];nT(o,t.leaf?r(e):e),a+=nA(o)}return a}_adjustParentBBoxes(t,e,i){for(let n=i;n>=0;n--)nT(e[n],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)0===t[e].children.length?e>0?(i=t[e-1].children).splice(i.indexOf(t[e]),1):this.clear():nb(t[e],this.toBBox)}}function nb(t,e){nM(t,0,t.children.length,e,t)}function nM(t,e,i,n,r){r||(r=nk(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<i;s++){let e=t.children[s];nT(r,t.leaf?n(e):e)}return r}function nT(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function nI(t,e){return t.minX-e.minX}function nP(t,e){return t.minY-e.minY}
1function nL(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function nA(t){return t.maxX-t.minX+(t.maxY-t.minY)}function nF(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function nO(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function nk(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function nz(t,e,i,n,r){let s=[e,i];for(;s.length;){if((i=s.pop())-(e=s.pop())<=n)continue;let o=e+Math.ceil((i-e)/n/2)*n;!function t(e,i,n=0,r=e.length-1,s=function(t,e){return t<e?-1:+(t>e)}){for(;r>n;){if(r-n>600){let o=r-n+1,a=i-n+1,l=Math.log(o),h=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*h*(o-h)/o)*(a-o/2<0?-1:1),d=Math.max(n,Math.floor(i-a*h/o+u)),c=Math.min(r,Math.floor(i+(o-a)*h/o+u));t(e,i,d,c,s)}let o=e[i],a=n,l=r;for(nS(e,n,i),s(e[r],o)>0&&nS(e,n,r);a<l;){for(nS(e,a,l),a++,l--;0>s(e[a],o);)a++;for(;s(e[l],o)>0;)l--}0===s(e[n],o)?nS(e,n,l):nS(e,++l,r),l<=i&&(n=l+1),i<=l&&(r=l-1)}}(t,o,e,i,r),s.push(e,o,o,i)}}let nD=[NaN,NaN,NaN,0],nj=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,nN=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,nK=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,nX=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function nG(t,e){return t.endsWith("%")?Number(t.substring(0,t.length-1))/e:Number(t)}function nZ(t){throw Error('failed to parse "'+t+'" as color')}let nV={},nW=0;function nU(t){return t>.0031308?269.025*Math.pow(t,1/2.4)-14.025:3294.6*t}function nY(t){return t>.2068965?Math.pow(t,3):108/841*(t-4/29)}function nB(t){return t>10.314724?Math.pow((t+14.025)/269.025,2.4):t/3294.6}function n$(t){return t>.0088564?Math.pow(t,1/3):t/(108/841)+4/29}function nq(t){let e=nB(t[0]),i=nB(t[1]),n=nB(t[2]),r=n$(.222488403*e+.716873169*i+.06060791*n),s=500*(n$(.452247074*e+.399439023*i+.148375274*n)-r),o=200*(r-n$(.016863605*e+.117638439*i+.865350722*n)),a=180/Math.PI*Math.atan2(o,s);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,t[3]]}function nH(t){if("none"===t)return nD;if(nV.hasOwnProperty(t))return nV[t];if(nW>=1024){let t=0;for(let e in nV)(3&t++)==0&&(delete nV[e],--nW)}let e=function t(e){if(e.toLowerCase().startsWith("rgb")){let t=e.match(nN)||e.match(nj)||e.match(nK);if(t){let e=t[4],i=100/255;return[tg(nG(t[1],i)+.5|0,0,255),tg(nG(t[2],i)+.5|0,0,255),tg(nG(t[3],i)+.5|0,0,255),void 0!==e?tg(nG(e,100),0,1):1]}nZ(e)}if(e.startsWith("#")){if(nX.test(e)){let t=e.substring(1),i=t.length<=4?1:2,n=[0,0,0,255];for(let e=0,r=t.length;e<r;e+=i){let r=parseInt(t.substring(e,e+i),16);1===i&&(r+=r<<4),n[e/i]=r}return n[3]=n[3]/255,n}nZ(e)}let n=(i||(i=ib(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),i);n.fillStyle="#abcdef";let r=n.fillStyle;n.fillStyle=e,n.fillStyle===r&&(n.fillStyle="#fedcba",r=n.fillStyle,n.fillStyle=e,n.fillStyle===r&&nZ(e));let s=n.fillStyle;if(s.startsWith("#")||s.startsWith("rgba"))return t(s);n.clearRect(0,0,1,1),n.fillRect(0,0,1,1);let o=Array.from(n.getImageData(0,0,1,1).data);return o[3]=tv(o[3]/255,3),o}(t);for(let i of(4!==e.length&&nZ(t),e))isNaN(i)&&nZ(t);return nV[t]=e,++nW,e}function nJ(t){return Array.isArray(t)?t:nH(t)}function nQ(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let i=t[1];i!=(0|i)&&(i=i+.5|0);let n=t[2];return n!=(0|n)&&(n=n+.5|0),"rgba("+e+","+i+","+n+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}function n0(t){return t[0]>0&&t[1]>0}function n1(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}let n2=0,n3=1<<n2++,n5=1<<n2++,n4=1<<n2++,n6=1<<n2++,n8=1<<n2++,n9=1<<n2++,n7=Math.pow(2,n2)-1,rt={[n3]:"boolean",[n5]:"number",[n4]:"string",[n6]:"color",[n8]:"number[]",[n9]:"size"},re=Object.keys(rt).map(Number).sort(w);function ri(t){let e=[];for(let n of re){var i;(t&(i=n))===i&&e.push(rt[n])}return 0===e.length?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}class rn{constructor(t,e){if(!(t in rt))throw Error(`literal expressions must have a specific type, got ${ri(t)}`);this.type=t,this.value=e}}class rr{constructor(t,e,...i){this.type=t,this.operator=e,this.args=i}}function rs(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function ro(t,e,i){switch(typeof t){case"boolean":if(e===n4)return new rn(n4,t?"true":"false");if((e&n3)!==n3)throw Error(`got a boolean, but expected ${ri(e)}`);return new rn(n3,t);case"number":if(e===n9)return new rn(n9,n1(t));if(e===n3)return new rn(n3,!!t);if(e===n4)return new rn(n4,t.toString());if((e&n5)!==n5)throw Error(`got a number, but expected ${ri(e)}`);return new rn(n5,t);case"string":if(e===n6)return new rn(n6,nH(t));if(e===n3)return new rn(n3,!!t);if((e&n4)!==n4)throw Error(`got a string, but expected ${ri(e)}`);return new rn(n4,t)}if(!Array.isArray(t))throw Error("expression must be an array or a primitive value");if(0===t.length)throw Error("empty expression");if("string"==typeof t[0]){var n=t,r=e,s=i;let o=n[0],a=rS[o];if(!a)throw Error(`unknown operator: ${o}`);return a(n,r,s)}for(let e of t)if("number"!=typeof e)throw Error("expected an array of numbers");if(e===n9){if(2!==t.length)throw Error(`expected an array of two values for a size, got ${t.length}`);return new rn(n9,t)}if(e===n6){if(3===t.length)return new rn(n6,[...t,1]);if(4===t.length)return new rn(n6,t);throw Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if((e&n8)!==n8)throw Error(`got an array of numbers, but expected ${ri(e)}`);return new rn(n8,t)}let ra="concat",rl="geometry-type",rh="resolution",ru="clamp",rd="floor",rc="ceil",rg="round",rf="atan",r_="sqrt",rp="match",rm="between",rv="interpolate",ry="coalesce",rx="case",rw="number",rE="string",rC="to-string",rS={get:rA(rT(1,1/0),rR),var:rA(rT(1,1),function(t,e,
1i){let n=t[1];if("string"!=typeof n)throw Error("expected a string argument for var operation");return i.variables.add(n),[new rn(n4,n)]}),has:rA(rT(1,1/0),rR),id:rA(function(t,e,i){i.featureId=!0},rM),[ra]:rA(rT(2,1/0),rP(n4)),[rl]:rA(function(t,e,i){i.geometryType=!0},rM),"line-metric":rA(rM),[rh]:rA(rb,rM),zoom:rA(rb,rM),time:rA(rb,rM),any:rA(rT(2,1/0),rP(n3)),all:rA(rT(2,1/0),rP(n3)),"!":rA(rT(1,1),rP(n3)),"==":rA(rT(2,2),rP(n7)),"!=":rA(rT(2,2),rP(n7)),">":rA(rT(2,2),rP(n5)),">=":rA(rT(2,2),rP(n5)),"<":rA(rT(2,2),rP(n5)),"<=":rA(rT(2,2),rP(n5)),"*":rA(rT(2,1/0),rI),[ry]:rA(rT(2,1/0),rI),"/":rA(rT(2,2),rP(n5)),"+":rA(rT(2,1/0),rP(n5)),"-":rA(rT(2,2),rP(n5)),[ru]:rA(rT(3,3),rP(n5)),"%":rA(rT(2,2),rP(n5)),"^":rA(rT(2,2),rP(n5)),abs:rA(rT(1,1),rP(n5)),[rd]:rA(rT(1,1),rP(n5)),[rc]:rA(rT(1,1),rP(n5)),[rg]:rA(rT(1,1),rP(n5)),sin:rA(rT(1,1),rP(n5)),cos:rA(rT(1,1),rP(n5)),[rf]:rA(rT(1,2),rP(n5)),[r_]:rA(rT(1,1),rP(n5)),[rp]:rA(rT(4,1/0),rL,function(t,e,i){let n=t.length-1,r=n4|n5|n3,s=ro(t[1],r,i),o=ro(t[t.length-1],e,i),a=Array(n-2);for(let e=0;e<n-2;e+=2){try{let n=ro(t[e+2],s.type,i);a[e]=n}catch(t){throw Error(`failed to parse argument ${e+1} of match expression: ${t.message}`)}try{let n=ro(t[e+3],o.type,i);a[e+1]=n}catch(t){throw Error(`failed to parse argument ${e+2} of match expression: ${t.message}`)}}return[s,...a,o]}),[rm]:rA(rT(3,3),rP(n5)),[rv]:rA(rT(6,1/0),rL,function(t,e,i){let n,r,s=t[1];switch(s[0]){case"linear":n=1;break;case"exponential":let o=s[1];if("number"!=typeof o||o<=0)throw Error(`expected a number base for exponential interpolation, got ${JSON.stringify(o)} instead`);n=o;break;default:throw Error(`invalid interpolation type: ${JSON.stringify(s)}`)}let a=new rn(n5,n);try{r=ro(t[2],n5,i)}catch(t){throw Error(`failed to parse argument 1 in interpolate expression: ${t.message}`)}let l=Array(t.length-3);for(let n=0;n<l.length;n+=2){try{let e=ro(t[n+3],n5,i);l[n]=e}catch(t){throw Error(`failed to parse argument ${n+2} for interpolate expression: ${t.message}`)}try{let r=ro(t[n+4],e,i);l[n+1]=r}catch(t){throw Error(`failed to parse argument ${n+3} for interpolate expression: ${t.message}`)}}return[a,r,...l]}),[rx]:rA(rT(3,1/0),function(t,e,i){let n=t[0],r=t.length-1;if(r%2==0)throw Error(`expected an odd number of arguments for ${n}, got ${r} instead`)},function(t,e,i){let n=ro(t[t.length-1],e,i),r=Array(t.length-1);for(let e=0;e<r.length-1;e+=2){try{let n=ro(t[e+1],n3,i);r[e]=n}catch(t){throw Error(`failed to parse argument ${e} of case expression: ${t.message}`)}try{let s=ro(t[e+2],n.type,i);r[e+1]=s}catch(t){throw Error(`failed to parse argument ${e+1} of case expression: ${t.message}`)}}return r[r.length-1]=n,r}),in:rA(rT(2,2),function(t,e,i){let n,r=t[2];if(!Array.isArray(r))throw Error('the second argument for the "in" operator must be an array');if("string"==typeof r[0]){if("literal"!==r[0])throw Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(r[1]))throw Error('failed to parse "in" expression: the literal operator must be followed by an array');r=r[1],n=n4}else n=n5;let s=Array(r.length);for(let t=0;t<s.length;t++)try{let e=ro(r[t],n,i);s[t]=e}catch(e){throw Error(`failed to parse haystack item ${t} for "in" expression: ${e.message}`)}return[ro(t[1],n,i),...s]}),[rw]:rA(rT(1,1/0),rP(n7)),[rE]:rA(rT(1,1/0),rP(n7)),array:rA(rT(1,1/0),rP(n5)),color:rA(rT(1,4),rP(n5)),band:rA(rT(1,3),rP(n5)),palette:rA(rT(2,2),function(t,e,i){let n;try{n=ro(t[1],n5,i)}catch(t){throw Error(`failed to parse first argument in palette expression: ${t.message}`)}let r=t[2];if(!Array.isArray(r))throw Error("the second argument of palette must be an array");let s=Array(r.length);for(let t=0;t<s.length;t++){let e;try{e=ro(r[t],n6,i)}catch(e){throw Error(`failed to parse color at index ${t} in palette expression: ${e.message}`)}if(!(e instanceof rn))throw Error(`the palette color at index ${t} must be a literal value`);s[t]=e}return[n,...s]}),[rC]:rA(rT(1,1),rP(n3|n5|n4|n6))};function rR(t,e,i){let n=t.length-1,r=Array(n);for(let e=0;e<n;++e){let n=t[e+1];switch(typeof n){case"number":r[e]=new rn(n5,n);break;case"string":r[e]=new rn(n4,n);break;default:throw Error(`expected a string key or numeric array index for a get operation, got ${n}`)}0===e&&i.properties.add(String(n))}return r}function rb(t,e,i){i.mapState=!0}function rM(t,e,i){let n=t[0];if(1!==t.length)throw Error(`expected no arguments for ${n} operation`);return[]}function rT(t,e){return function(i,n,r){let s=i[0],o=i.length-1;if(t===e){if(o!==t)throw Error(`expected ${t} argument${1===t?"":"s"} for ${s}, got ${o}`)}else if(o<t||o>e){let i=e===1/0?`${t} or more`:`${t} to ${e}`;throw Error(`expected ${i} arguments for ${s}, got ${o}`)}}}function rI(t,e,i){let n=t.length-1,r=Array(n);for(let s=0;s<n;++s){let n=ro(t[s+1],e,i);r[s]=n}return r}function rP(t){return function(e,i,n){let r=e.length-1,s=Array(r);for(let i=0;i<r;++i){let r=ro(e[i+1],t,n);s[i]=r}return s}}function rL(t,e,i){let n=t[0],r=t.length-1;if(r%2==1)throw Error(`expected an even number of arguments for operation ${n}, got ${r} instead`)}function rA(...t){return function(e,i,n){let r,s=e[0];for(let s=0;s<t.length;s++){let o=t[s](e,i,n);if(s==t.length-1){if(!o)throw Error("expected last argument validator to return the parsed args");r=o}}return new rr(i,s,...r)}}function rF(){return{variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""}}function rO(t,e,i){return function t(e,i){if(e instanceof rn){if(e.type===n6&&"string"==typeof e.value){let t=nH(e.value);return function(){return t}}return function(){return e.value}}let n=e.operator;switch(n){case rw:case rE:case ry:var r=e,s=i;let o=r.operator,a=r.args.length,l=Array(a);for(let e=0;e<a;++e)l[e]=t(r.args[e],s);switch(o){case ry:return t=>{for(let e=0;e<a;++e){let i=l[e](t);if(null!=i)return i}throw Error("Expected one of the values to be non-null")};case rw:case rE:return t=>{for(let e=0;e<a;++e){let i=l[e](t);if(typeof i===o)return i}throw Error(`Expected one of the values to be a ${o}`)};default:throw Error(`Unsupported assertion operator ${o}`)}case"get":case"var":case"has":var h=e;let u=h.args[0].value;switch(h.operator){case"get":return t=>{let e=h.args,i=t.properties[u];for(let t=1,n=e.length;t<n;++t)i=i[e[t].value];return i};case"var":return t=>t.variables[u];case"has":return t=>{let e=h.args;if(!(u in t.properties))return!1;let i=t.properties[u];for(let t=1,n=e.length;t<n;++t){let n=e[t].value;if(!i||!Object.hasOwn(i,n))return!1;i=i[n]}return!0};default:throw Error(`Unsupported accessor operator ${h.operator}`)}case"id":return t=>t.featureId;case rl:return t=>t.geometryType;case ra:{let n=e.args.map(e=>t(e,i));return t=>"".concat(...n.map(e=>e(t).toString()))}case rh:return t=>t.resolution;case"any":case"all":case rm:case"in":case"!":var d=e,c=i;let g=d.operator,f=d.args.length,_=Array(f);for(let e=0;e<f;++e)_[e]=t(d.args[e],c);switch(g){case"any":return t=>{for(let e=0;e<f;++e)if(_[e](t))return!0;return!1};case"all":return t=>{for(let e=0;e<f;++e)if(!_[e](t))return!1;return!0};case rm:return t=>{let e=_[0](t),i=_[1](t),n=_[2](t);return e>=i&&e<=n};case"in":return t=>{let e=_[0](t);for(let i=1;i<f;++i)if(e===_[i](t))return!0;return!1};case"!":return t=>!_[0](t);default:throw Error(`Unsupported logical operator ${g}`)}case"==":case"!=":case"<":case"<=":case">":case">=":var p=e,m=i;let v=p.operator,y=t(p.args[0],m),x=t(p.args[1],m);switch(v){case"==":return t=>y(t)===x(t);case"!=":return t=>y(t)!==x(t);case"<":return t=>y(t)<x(t);case"<=":return t=>y(t)<=x(t);case">":return t=>y(t)>x(t);case">=":return t=>y(t)>=x(t);default:throw Error(`Unsupported comparison operator ${v}`)}case"*":case"/":case"+":case"-":case ru:case"%":case"^":case"abs":case rd:case rc:case rg:case"sin":case"cos":case rf:case r_:var w=e,E=i;let C=w.operator,S=w.args.length,R=Array(S);for(let e=0;e<S;++e)R[e]=t(w.args[e],E);switch(C){case"*":return t=>{let e=1;for(let i=0;i<S;++i)e*=R[i](t);return e};case"/":return t=>R[0](t)/R[1](t);case"+":return t=>{let e=0;for(let i=0;i<S;++i)e+=R[i](t);return e};case"-":return t=>R[0](t)-R[1](t);case ru:return t=>{let e=R[0](t),i=R[1](t);if(e<i)return i;let n=R[2](t);return e>n?n:e};case"%":return t=>R[0](t)%R[1](t);case"^":return t=>Math.pow(R[0](t),R[1](t));case"abs":return t=>Math.abs(R[0](t));case rd:return t=>Math.floor(R[0](t));case rc:return t=>Math.ceil(R[0](t));case rg:return t=>Math.round(R[0](t));case"sin":return t=>Math.sin(R[0](t));case"cos":return t=>Math.cos(R[0](t));case rf:if(2===S)return t=>Math.atan2(R[0](t),R[1](t));return t=>Math.atan(R[0](t));case r_:return t=>Math.sqrt(R[0](t));default:throw Error(`Unsupported numeric operator ${C}`)}case rx:var b=e,M=i;let T=b.args.length,I=Array(T);for(let e=0;e<T;++e)I[e]=t(b.args[e],M);return t=>{for(let e=0;e<T-1;e+=2)if(I[e](t))return I[e+1](t);return I[T-1](t)};case rp:var P=e,L=i;let A=P.args.length,F=Array(A);for(let e=0;e<A;++e)F[e]=t(P.args[e],L);return t=>{let e=F[0](t);for(let i=1;i<A-1;i+=2)if(e===F[i](t))return F[i+1](t);return F[A-1](t)};case rv:var O=e,k=i;let z=O.args.length,D=Array(z);for(let e=0;e<z;++e)D[e]=t(O.args[e],k);return t=>{let e,i,n=D[0](t),r=D[1](t);for(let s=2;s<z;s+=2){let o=D[s](t),a=D[s+1](t),l=Array.isArray(a);if(l&&(a=function(t){if(4===t.length)return t;let e=t.slice();return e[3]=1,e}(a)),o>=r){if(2===s)return a;
1if(l)return function(t,e,i,n,r,s){var o;let a,l,h,u,d,c,g,f,_;if(0==r-i)return n;let p=nq(n),m=nq(s),v=m[2]-p[2];return v>180?v-=360:v<-180&&(v+=360),a=((o=[rk(t,e,i,p[0],r,m[0]),rk(t,e,i,p[1],r,m[1]),p[2]+rk(t,e,i,0,r,v),rk(t,e,i,n[3],r,s[3])])[0]+16)/116,l=o[1],h=o[2]*Math.PI/180,u=nY(a),d=nY(a+l/500*Math.cos(h)),g=nU(3.021973625*d-1.617392459*u-.404875592*(c=nY(a-l/200*Math.sin(h)))),f=nU(-.943766287*d+1.916279586*u+.027607165*c),_=nU(.069407491*d-.22898585*u+1.159737864*c),[tg(g+.5|0,0,255),tg(f+.5|0,0,255),tg(_+.5|0,0,255),o[3]]}(n,r,e,i,o,a);return rk(n,r,e,i,o,a)}e=o,i=a}return i};case rC:var j=e,N=i;let K=j.operator,X=j.args.length,G=Array(X);for(let e=0;e<X;++e)G[e]=t(j.args[e],N);if(K===rC)return t=>{let e=G[0](t);return j.args[0].type===n6?nQ(e):e.toString()};throw Error(`Unsupported convert operator ${K}`);default:throw Error(`Unsupported operator ${n}`)}}(ro(t,e,i),i)}function rk(t,e,i,n,r,s){let o=r-i;if(0===o)return n;let a=e-i;return n+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(s-n)}function rz(t,e,i){return e+":"+t+":"+(i?nJ(i):"null")}let rD=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(let e in this.cache_){let i=this.cache_[e];(3&t++)==0&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){let n=rz(t,e,i);return n in this.cache_?this.cache_[n]:null}getPattern(t,e,i){let n=rz(t,e,i);return n in this.patternCache_?this.patternCache_[n]:null}set(t,e,i,n,r){let s=rz(t,e,i),o=s in this.cache_;this.cache_[s]=n,r&&(0===n.getImageState()&&n.load(),1===n.getImageState()?n.ready().then(()=>{this.patternCache_[s]=iM().createPattern(n.getImage(1),"repeat")}):this.patternCache_[s]=iM().createPattern(n.getImage(1),"repeat")),!o&&++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}},rj=null;class rN extends P{constructor(t,e,i,n,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=void 0===n?0:n,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,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&2===this.imageState_){rj||(rj=ib(1,1,void 0,{willReadFrequently:!0})),rj.drawImage(this.image_,0,0);try{rj.getImageData(0,0,1,1),this.tainted_=!1}catch{rj=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(g)}handleImageError_(){this.imageState_=3,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=2,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_()){let t=this.size_[0],e=this.size_[1],i=ib(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(0===this.imageState_){var t,e;this.image_||this.initializeImage_(),this.imageState_=1;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&(t=this.image_,(e=this.src_)&&(t.src=e),t.src&&H?new Promise((e,i)=>t.decode().then(()=>e(t)).catch(n=>t.complete&&t.width?e(t):i(n))):new Promise((e,i)=>{function n(){s(),e(t)}function r(){s(),i(Error("Image load error"))}function s(){t.removeEventListener("load",n),t.removeEventListener("error",r)}t.addEventListener("load",n),t.addEventListener("error",r)})).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){var e;if(!this.color_||this.canvas_[t]||2!==this.imageState_)return;let i=this.image_,n=ib(Math.ceil(i.width*t),Math.ceil(i.height*t)),r=n.canvas;n.scale(t,t),n.drawImage(i,0,0),n.globalCompositeOperation="multiply",n.fillStyle="string"==typeof(e=this.color_)?e:nQ(e),n.fillRect(0,0,r.width/t,r.height/t),n.globalCompositeOperation="destination-in",n.drawImage(i,0,0),this.canvas_[t]=r}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(2===this.imageState_||3===this.imageState_)t();else{let e=()=>{(2===this.imageState_||3===this.imageState_)&&(this.removeEventListener(g,e),t())};this.addEventListener(g,e)}})),this.ready_}}function rK(t,e,i,n,r,s){let o=void 0===e?void 0:rD.get(e,i,r);return o||(o=new rN(t,t&&"src"in t?t.src||void 0:e,i,n,r),rD.set(e,i,r,o,s)),s&&o&&!rD.getPattern(e,i,r)&&rD.set(e,i,r,o,s),o}function rX(t){return t?Array.isArray(t)?nQ(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return rD.getPattern(t.src,"anonymous",t.color);let e=t.src+":"+t.offset,i=rD.getPattern(e,void 0,t.color);if(i)return i;let n=rD.get(t.src,"anonymous",null);if(2!==n.getImageState())return null;let r=ib(t.size[0],t.size[1]);return r.drawImage(n.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),rK(r.canvas,e,void 0,2,t.color,!0),rD.getPattern(e,void 0,t.color)}(t):t:null}let rG="#000",rZ="round",rV="round",rW=new N;class rU{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=n1(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new rU({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 k()}getImage(t){return k()}getHitDetectionImage(){return k()}getPixelRatio(t){return 1}getImageState(){return k()}getImageSize(){return k()}getOrigin(){return k()}getSize(){return k()}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_=n1(t)}listenImageChange(t){k()}load(){k()}unlistenImageChange(t){k()}ready(){return Promise.resolve()}}let rY=rU;class rB extends rY{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.dis
1placement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?1:2,1===this.imageState_&&this.ready().then(()=>this.imageState_=2),this.render()}clone(){let t=this.getScale(),e=new rB({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(){let t=this.size_,e=this.getDisplacement(),i=this.getScaleArray();return[t[0]/2-e[0]/i[0],t[1]/2+e[1]/i[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){let e=this.fill_?.getKey(),i=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(","),n=rD.get(i,null,null)?.getImage(1);if(!n){let e=this.renderOptions_,r=Math.ceil(e.size*t),s=ib(r,r);this.draw_(e,s,t),n=s.canvas,rD.set(i,null,null,new rN(n,void 0,null,2,null))}return n}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,i){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let n=this.radius,r=void 0===this.radius2_?n:this.radius2_;if(n<r){let t=n;n=r,r=t}let s=2*Math.PI/(void 0===this.radius2_?this.points_:2*this.points_),o=r*Math.sin(s),a=n-Math.sqrt(r*r-o*o),l=Math.sqrt(o*o+a*a),h=l/o;if("miter"===t&&h<=i)return h*e;let u=e/2/h,d=e/2*(a/l),c=Math.sqrt((n+u)*(n+u)+d*d)-n;if(void 0===this.radius2_||"bevel"===t)return 2*c;let g=n*Math.sin(s),f=r-Math.sqrt(n*n-g*g),_=Math.sqrt(g*g+f*f)/g;return _<=i?2*Math.max(c,_*e/2-r-n):2*c}createRenderOptions(){let t,e=rZ,i=rV,n=0,r=null,s=0,o=0;this.stroke_&&(t=rX(this.stroke_.getColor()??"#000"),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,i=this.stroke_.getLineJoin()??rV,e=this.stroke_.getLineCap()??rZ,n=this.stroke_.getMiterLimit()??10);let a=this.calculateLineJoinSize_(i,o,n);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*Math.max(this.radius,this.radius2_||0)+a),lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:i,miterLimit:n}}render(){this.renderOptions_=this.createRenderOptions();let t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,i){if(e.scale(i,i),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let t=this.fill_.getColor();null===t&&(t=rG),e.fillStyle=rX(t),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 i=this.fill_.getColor(),n=0;"string"==typeof i&&(i=nJ(i)),null===i?n=1:Array.isArray(i)&&(n=4===i.length?i[3]:1),0===n&&(e=ib(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_,i=this.radius;if(e===1/0)t.arc(0,0,i,0,2*Math.PI);else{let n=void 0===this.radius2_?i:this.radius2_;void 0!==this.radius2_&&(e*=2);let r=this.angle_-Math.PI/2,s=2*Math.PI/e;for(let o=0;o<e;o++){let e=r+o*s,a=o%2==0?i:n;t.lineTo(a*Math.cos(e),a*Math.sin(e))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=rG,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()}}let r$=rB;class rq extends r${constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.dis
1placement:[0,0],declutterMode:t.declutterMode})}clone(){let t=this.getScale(),e=new rq({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 rH{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){let t=this.getColor();return new rH({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){let e=rK(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),0===e.getImageState()&&e.load(),1===e.getImageState()&&(this.patternImage_=e)}this.color_=t}getKey(){let t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?D(t):"object"==typeof t&&"src"in t?t.src+":"+t.offset:nJ(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function rJ(t,e,i,n){return void 0!==i&&void 0!==n?[i/t,n/e]:void 0!==i?i/t:void 0!==n?n/e:1}class rQ extends rY{constructor(t){let e;const i=void 0!==(t=t||{}).opacity?t.opacity:1,n=void 0!==t.rotation?t.rotation:0,r=void 0!==t.scale?t.scale:1,s=void 0!==t.rotateWithView&&t.rotateWithView;super({opacity:i,rotation:n,scale:r,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:s,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const o=void 0!==t.img?t.img:null;let a=t.src;if(tl(!(void 0!==a&&o),"`image` and `src` cannot be provided at the same time"),(void 0===a||0===a.length)&&o&&(a=o.src||D(o)),tl(void 0!==a&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),tl(void 0===t.width&&void 0===t.height||void 0===t.scale,"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?e=0:void 0!==o&&(e="complete"in o?o.complete?2*!!o.src:1:2),this.color_=void 0!==t.color?nJ(t.color):null,this.iconImage_=rK(o,a,this.crossOrigin_,e,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,i;if(t.size)[e,i]=t.size;else{const n=this.getImage(1);if(n.width&&n.height)e=n.width,i=n.height;else if(n instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;let i=this.iconImage_.getSize();this.setScale(rJ(i[0],i[1],t.width,t.height))};this.listenImageChange(e);return}}void 0!==e&&this.setScale(rJ(e,i,t.width,t.height))}}clone(){let t,e,i;return this.initialOptions_?(e=this.initialOptions_.width,i=this.initialOptions_.height):t=Array.isArray(t=this.getScale())?t.slice():t,new rQ({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:i,size:null!==this.size_?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_;let e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),("top-right"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[0]=-t[0]+e[0]),("bottom-left"==this.anchorOrigin_||"bottom-right"==this.anchorOrigin_)&&(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}let e=this.getDisplacement(),i=this.getScaleArray();return[t[0]-e[0]/i[0],t[1]+e[1]/i[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("top-left"!=this.offsetOrigin_){let e=this.getSize(),i=this.iconImage_.getSize();if(!e||!i)return null;t=t.slice(),("top-right"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[0]=i[0]-e[0]-t[0]),("bottom-left"==this.offsetOrigin_||"bottom-right"==this.offsetOrigin_)&&(t[1]=i[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(){let t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){let t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(g,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(g,t)}ready(){return this.iconImage_.ready()}}class r0{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){let t=this.getColor();return new r0({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 r1{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=r5,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new r1({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.get
vendor: 4,219 bytes, line 1
1Stroke().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){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=r5,this.geometry_=t}setZIndex(t){this.zIndex_=t}}let r2=null;function r3(t,e){if(!r2){let t=new rH({color:"rgba(255,255,255,0.4)"}),e=new r0({color:"#3399CC",width:1.25});r2=[new r1({image:new rq({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return r2}function r5(t){return t.getGeometry()}class r4{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_=n1(void 0!==t.scale?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_=void 0!==t.fill?t.fill:new rH({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){let t=this.getScale();return new r4({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_=n1(void 0!==t?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}
1setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}}function r6(t){return!0}function r8(t){let e=rs(),i=t.length,n=Array(i);for(let r=0;r<i;++r)n[r]=r9(t[r],e);let r=rF(),s=Array(i);return function(t,o){if(r.properties=t.getPropertiesInternal(),r.resolution=o,e.featureId){let e=t.getId();void 0!==e?r.featureId=e:r.featureId=null}let a=0;for(let t=0;t<i;++t){let e=n[t](r);e&&(s[a]=e,a+=1)}return s.length=a,s}}function r9(t,e){var i,n,r,s,o,a,l,h;let u,d,c,g,f,_,p,m,v,y,x,w,E,C,S,R,b,M,I,P,L,A,F,O,k,z,D,j,N,K,X,G,Z,V,W,U,Y,B,$,q=r7(t,"",e),H=st(t,"",e),J=function(t,e){let i="text-",n=si(t,i+"value",e);if(!n)return null;let r=r7(t,i,e),s=r7(t,i+"background-",e),o=st(t,i,e),a=st(t,i+"background-",e),l=si(t,i+"font",e),h=se(t,i+"max-angle",e),u=se(t,i+"offset-x",e),d=se(t,i+"offset-y",e),c=sn(t,i+"overflow",e),g=si(t,i+"placement",e),f=se(t,i+"repeat",e),_=sl(t,i+"scale",e),p=sn(t,i+"rotate-with-view",e),m=se(t,i+"rotation",e),v=si(t,i+"align",e),y=si(t,i+"justify",e),x=si(t,i+"baseline",e),w=sn(t,i+"keep-upright",e),E=ss(t,i+"padding",e),C=new r4({declutterMode:sc(t,i+"declutter-mode")});return function(t){if(C.setText(n(t)),r&&C.setFill(r(t)),s&&C.setBackgroundFill(s(t)),o&&C.setStroke(o(t)),a&&C.setBackgroundStroke(a(t)),l&&C.setFont(l(t)),h&&C.setMaxAngle(h(t)),u&&C.setOffsetX(u(t)),d&&C.setOffsetY(d(t)),c&&C.setOverflow(c(t)),g){let e=g(t);if("point"!==e&&"line"!==e)throw Error("Expected point or line for text-placement");C.setPlacement(e)}if(f&&C.setRepeat(f(t)),_&&C.setScale(_(t)),p&&C.setRotateWithView(p(t)),m&&C.setRotation(m(t)),v){let e=v(t);if("left"!==e&&"center"!==e&&"right"!==e&&"end"!==e&&"start"!==e)throw Error("Expected left, right, center, start, or end for text-align");C.setTextAlign(e)}if(y){let e=y(t);if("left"!==e&&"right"!==e&&"center"!==e)throw Error("Expected left, right, or center for text-justify");C.setJustify(e)}if(x){let e=x(t);if("bottom"!==e&&"top"!==e&&"middle"!==e&&"alphabetic"!==e&&"hanging"!==e)throw Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");C.setTextBaseline(e)}return E&&C.setPadding(E(t)),w&&C.setKeepUpright(w(t)),C}}(t,e),Q=(i=t,n=e,"icon-src"in i?(r=i,s=n,c=sf(r[d=(u="icon-")+"src"],d),g=so(r,u+"anchor",s),f=sl(r,u+"scale",s),_=se(r,u+"opacity",s),p=so(r,u+"displacement",s),m=se(r,u+"rotation",s),v=sn(r,u+"rotate-with-view",s),y=su(r,u+"anchor-origin"),x=sd(r,u+"anchor-x-units"),w=sd(r,u+"anchor-y-units"),E=function(t,e){let i=t[e];if(void 0!==i)return sp(i,e)}(r,u+"color"),C=function(t,e){let i=t[e];if(void 0!==i){if("string"!=typeof i)throw Error(`Expected a string for ${e}`);return i}}(r,u+"cross-origin"),S=function(t,e){let i=t[e];if(void 0!==i)return sg(i,e)}(r,u+"offset"),R=su(r,u+"offset-origin"),b=sh(r,u+"width"),M=new rQ({src:c,anchorOrigin:y,anchorXUnits:x,anchorYUnits:w,color:E,crossOrigin:C,offset:S,offsetOrigin:R,height:sh(r,u+"height"),width:b,size:function(t,e){let i=t[e];if(void 0!==i){if("number"==typeof i)return n1(i);if(!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])throw Error(`Expected a number or size array for ${e}`);return i}}(r,u+"size"),declutterMode:sc(r,u+"declutter-mode")}),function(t){return _&&M.setOpacity(_(t)),p&&M.setDisplacement(p(t)),m&&M.setRotation(m(t)),v&&M.setRotateWithView(v(t)),f&&M.setScale(f(t)),g&&M.setAnchor(g(t)),M}):"shape-points"in i?(o=i,a=n,P=(I="shape-")+"points",L=I+"radius",A=s_(o[P],P),F=s_(o[L],L),O=r7(o,I,a),k=st(o,I,a),z=sl(o,I+"scale",a),D=so(o,I+"displacement",a),j=se(o,I+"rotation",a),N=sn(o,I+"rotate-with-view",a),K=new r$({points:A,radius:F,radius2:sh(o,I+"radius2"),angle:sh(o,I+"angle"),declutterMode:sc(o,I+"declutter-mode")}),function(t){return O&&K.setFill(O(t)),k&&K.setStroke(k(t)),D&&K.setDisplacement(D(t)),j&&K.setRotation(j(t)),N&&K.setRotateWithView(N(t)),z&&K.setScale(z(t)),K}):"circle-radius"in i?(G=r7(l=i,X="circle-",h=n),Z=st(l,X,h),V=se(l,X+"radius",h),W=sl(l,X+"scale",h),U=so(l,X+"displacement",h),Y=se(l,X+"rotation",h),B=sn(l,X+"rotate-with-view",h),$=new rq({radius:5,declutterMode:sc(l,X+"declutter-mode")}),function(t){return V&&$.setRadius(V(t)),G&&$.setFill(G(t)),Z&&$.setStroke(Z(t)),U&&$.setDisplacement(U(t)),Y&&$.setRotation(Y(t)),B&&$.setRotateWithView(B(t)),W&&$.setScale(W(t)),$}):null),tt=se(t,"z-index",e);if(!q&&!H&&!J&&!Q&&!T(t))throw Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t));let te=new r1;return function(t){let e=!0;if(q){let i=q(t);i&&(e=!1),te.setFill(i)}if(H){let i=H(t);i&&(e=!1),te.setStroke(i)}if(J){let i=J(t);i&&(e=!1),te.setText(i)}if(Q){let i=Q(t);i&&(e=!1),te.setImage(i)}return(tt&&te.setZIndex(tt(t)),e)?null:te}}function r7(t,e,i){let n;if(e+"fill-pattern-src"in t){var r,s,o;let a,l,h,u;a=si(r=t,(s=e+"fill-")+"pattern-src",o=i),l=sa(r,s+"pattern-offset",o),h=sa(r,s+"pattern-size",o),u=sr(r,s+"color",o),n=function(t){return{src:a(t),offset:l&&l(t),size:h&&h(t),color:u&&u(t)}}}else{if("none"===t[e+"fill-color"])return t=>null;n=sr(t,e+"fill-color",i)}if(!n)return null;let a=new rH;return function(t){let e=n(t);return e===nD?null:(a.setColor(e),a)}}function st(t,e,i){let n=se(t,e+"stroke-width",i),r=sr(t,e+"stroke-color",i);if(!n&&!r)return null;let s=si(t,e+"stroke-line-cap",i),o=si(t,e+"stroke-line-join",i),a=ss(t,e+"stroke-line-dash",i),l=se(t,e+"stroke-line-dash-offset",i),h=se(t,e+"stroke-miter-limit",i),u=new r0;return function(t){if(r){let e=r(t);if(e===nD)return null;u.setColor(e)}if(n&&u.setWidth(n(t)),s){let e=s(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw Error("Expected butt, round, or square line cap");u.setLineCap(e)}if(o){let e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw Error("Expected bevel, round, or miter line join");u.setLineJoin(e)}return a&&u.setLineDash(a(t)),l&&u.setLineDashOffset(l(t)),h&&u.setMiterLimit(h(t)),u}}function se(t,e,i){if(!(e in t))return;let n=rO(t[e],n5,i);return function(t){return s_(n(t),e)}}
1function si(t,e,i){if(!(e in t))return null;let n=rO(t[e],n4,i);return function(t){return sf(n(t),e)}}function sn(t,e,i){if(!(e in t))return null;let n=rO(t[e],n3,i);return function(t){let i=n(t);if("boolean"!=typeof i)throw Error(`Expected a boolean for ${e}`);return i}}function sr(t,e,i){if(!(e in t))return null;let n=rO(t[e],n6,i);return function(t){return sp(n(t),e)}}function ss(t,e,i){if(!(e in t))return null;let n=rO(t[e],n8,i);return function(t){return sg(n(t),e)}}function so(t,e,i){if(!(e in t))return null;let n=rO(t[e],n8,i);return function(t){let i=sg(n(t),e);if(2!==i.length)throw Error(`Expected two numbers for ${e}`);return i}}function sa(t,e,i){if(!(e in t))return null;let n=rO(t[e],n8,i);return function(t){return sm(n(t),e)}}function sl(t,e,i){if(!(e in t))return null;let n=rO(t[e],n8|n5,i);return function(t){var i,r;return i=n(t),r=e,"number"==typeof i?i:sm(i,r)}}function sh(t,e){let i=t[e];if(void 0!==i){if("number"!=typeof i)throw Error(`Expected a number for ${e}`);return i}}function su(t,e){let i=t[e];if(void 0!==i){if("bottom-left"!==i&&"bottom-right"!==i&&"top-left"!==i&&"top-right"!==i)throw Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return i}}function sd(t,e){let i=t[e];if(void 0!==i){if("pixels"!==i&&"fraction"!==i)throw Error(`Expected pixels or fraction for ${e}`);return i}}function sc(t,e){let i=t[e];if(void 0!==i){if("string"!=typeof i)throw Error(`Expected a string for ${e}`);if("declutter"!==i&&"obstacle"!==i&&"none"!==i)throw Error(`Expected declutter, obstacle, or none for ${e}`);return i}}function sg(t,e){if(!Array.isArray(t))throw Error(`Expected an array for ${e}`);let i=t.length;for(let n=0;n<i;++n)if("number"!=typeof t[n])throw Error(`Expected an array of numbers for ${e}`);return t}function sf(t,e){if("string"!=typeof t)throw Error(`Expected a string for ${e}`);return t}function s_(t,e){if("number"!=typeof t)throw Error(`Expected a number for ${e}`);return t}function sp(t,e){if("string"==typeof t)return t;let i=sg(t,e),n=i.length;if(n<3||n>4)throw Error(`Expected a color with 3 or 4 values for ${e}`);return i}function sm(t,e){let i=sg(t,e);if(2!==i.length)throw Error(`Expected an array of two numbers for ${e}`);return i}let sv="renderOrder",sy=class extends nC{constructor(t){const e=Object.assign({},t=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_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(sv)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){let i=this.getDeclutter();i in t.declutter==!1&&(t.declutter[i]=new nR(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(sv,t)}setStyle(t){this.style_=void 0===t?r3:t;let e=function(t){if(void 0===t)return r3;if(!t)return null;if("function"==typeof t||t instanceof r1)return t;if(!Array.isArray(t))return r8([t]);if(0===t.length)return[];let e=t.length,i=t[0];if(i instanceof r1){let i=Array(e);for(let n=0;n<e;++n){let e=t[n];if(!(e instanceof r1))throw Error("Expected a list of style instances");i[n]=e}return i}if("style"in i){let i,n,r,s=Array(e);for(let i=0;i<e;++i){let e=t[i];if(!("style"in e))throw Error("Expected a list of rules with a style property");s[i]=e}return n=function(t,e){let i=t.length,n=Array(i);for(let r=0;r<i;++r){let i,s=t[r],o="filter"in s?rO(s.filter,n3,e):r6;if(Array.isArray(s.style)){let t=s.style.length;i=Array(t);for(let n=0;n<t;++n)i[n]=r9(s.style[n],e)}else i=[r9(s.style,e)];
1n[r]={filter:o,styles:i}}return function(e){let r=[],s=!1;for(let o=0;o<i;++o)if((0,n[o].filter)(e)&&(!t[o].else||!s))for(let t of(s=!0,n[o].styles)){let i=t(e);i&&r.push(i)}return r}}(s,i=rs()),r=rF(),function(t,e){if(r.properties=t.getPropertiesInternal(),r.resolution=e,i.featureId){let e=t.getId();void 0!==e?r.featureId=e:r.featureId=null}return i.geometryType&&(r.geometryType=function t(e){if(!e)return"";let i=e.getType();switch(i){case"Point":case"LineString":case"Polygon":return i;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return i.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return t(e.getGeometries()[0]);default:return""}}(t.getGeometry())),n(r)}}return r8(t)}(t);this.styleFunction_=null===t?void 0:function(t){let e;if("function"==typeof t)e=t;else{let i;Array.isArray(t)?i=t:(tl("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`"),i=[t]),e=function(){return i}}return e}(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}},sx=class extends I{constructor(t,e,i,n){super(t),this.inversePixelTransform=e,this.frameState=i,this.context=n}};function sw(t,e){rD.expire()}let sE=class extends x{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){k()}calculateMatrices2D(t){let e=t.viewState,i=t.coordinateToPixelTransform,n=t.pixelToCoordinateTransform;e$(i,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),eq(n,i)}forEachFeatureAtCoordinate(t,e,i,n,r,s,o,a){let l,h=e.viewState;function u(t,e,i,n){return r.call(s,e,t?i:null,n)}let d=h.projection,c=function(t,e){if(e.canWrapX()){var i,n,r;let s,o,a=tU(e.getExtent()),l=(i=t,n=e,r=a,s=n.getExtent(),o=0,n.canWrapX()&&(i[0]<s[0]||i[0]>s[2])&&(r=r||tU(s),o=Math.floor((i[0]-s[0])/r)),o);l&&(t[0]-=l*a)}return t}(t.slice(),d),g=[[0,0]];if(d.canWrapX()&&n){let t=tU(d.getExtent());g.push([-t,0],[t,0])}let f=e.layerStatesArray,_=f.length,p=[],m=[];for(let n=0;n<g.length;n++)for(let r=_-1;r>=0;--r){let s=f[r],d=s.layer;if(d.hasRenderer()&&nE(s,h)&&o.call(a,d)){let r=d.getRenderer(),o=d.getSource();if(r&&o){let a=o.getWrapX()?c:t,h=u.bind(null,s.managed);m[0]=a[0]+g[n][0],m[1]=a[1]+g[n][1],l=r.forEachFeatureAtCoordinate(m,e,i,h,p)}if(l)return l}}if(0===p.length)return;let v=1/p.length;return p.forEach((t,e)=>t.distanceSq+=e*v),p.sort((t,e)=>t.distanceSq-e.distanceSq),p.some(t=>l=t.callback(t.feature,t.layer,t.geometry)),l}hasFeatureAtCoordinate(t,e,i,n,r,s){return void 0!==this.forEachFeatureAtCoordinate(t,e,i,n,S,this,r,s)}getMap(){return this.map_}renderFrame(t){k()}scheduleExpireIconCache(t){rD.canExpireCache()&&t.postRenderFunctions.push(sw)}},sC=class extends sE{constructor(t){super(t),this.fontChangeListenerKey_=L(rW,c,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=iE+" ol-layers";const i=t.getViewport();i.insertBefore(this.element_,i.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){let i=this.getMap();if(i.hasListener(t)){let n=new sx(t,void 0,e);i.dispatchEvent(n)}}disposeInternal(){A(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(nx,t);let e=t.layerStatesArray.sort((t,e)=>t.zIndex-e.zIndex);e.some(t=>t.layer instanceof sy&&t.layer.getDeclutter())&&(t.declutter={});let i=t.viewState;this.children_.length=0;let n=[],r=null;for(let s=0,o=e.length;s<o;++s){let o=e[s];t.layerIndex=s;let a=o.layer,l=a.getSourceState();if(!nE(o,i)||"ready"!=l&&"undefined"!=l){a.unrender();continue}let h=a.render(t,r);h&&(h!==r&&(this.children_.push(h),r=h),n.push(o))}this.declutter(t,n),function(t,e){let i=t.childNodes;for(let n=0;;++n){let r=i[n],s=e[n];if(!r&&!s)break;if(r!==s){if(!r){t.appendChild(s);continue}if(!s){t.removeChild(r),--n;continue}t.insertBefore(s,r)}}}(this.element_,this.children_),this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let i=e.length-1;i>=0;--i){let n=e[i],r=n.layer;r.getDeclutter()&&r.renderDeclutter(t,n)}
1e.forEach(e=>e.layer.renderDeferred(t))}}},sS=class extends N{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=function(t){let e,i,n,r=null;void 0!==t.keyboardEventTarget&&(r="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);let s={},o=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new nm({layers:t.layers});return s[tr]=o,s[to]=t.target,s[ta]=t.view instanceof ix?t.view:new ix,void 0!==t.controls&&(Array.isArray(t.controls)?e=new G(t.controls.slice()):(tl("function"==typeof t.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),e=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?i=new G(t.interactions.slice()):(tl("function"==typeof t.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),i=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?n=new G(t.overlays.slice()):(tl("function"==typeof t.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),n=t.overlays):n=new G,{controls:e,interactions:i,keyboardEventTarget:r,overlays:n,values:s}}(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:$,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=eY(),this.pixelToCoordinateTransform_=eY(),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||ik(),this.interactions=e.interactions||function(t){t=t||{};let e=new G,i=new iz(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new i1),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new iK({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&e.push(new i0({onFocusOnly:t.onFocusOnly,kinetic:i})),(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new nn),(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new nr({duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(e.push(new nt),e.push(new ne({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new ni({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new i6({duration:t.zoomDuration})),e}({onFocusOnly:!0}),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new td(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(tr,this.handleLayerGroupChanged_),this.addChangeListener(ta,this.handleViewChanged_),this.addChangeListener(ts,this.handleSizeChanged_),this.addChangeListener(to,this.handleTargetChanged_),this.setProperties(e.values);const i=this;
1!t.view||t.view instanceof ix||t.view.then(function(t){i.setView(new ix(t))}),this.controls.addEventListener("add",t=>{t.element.setMap(this)}),this.controls.addEventListener(d,t=>{t.element.setMap(null)}),this.interactions.addEventListener("add",t=>{t.element.setMap(this)}),this.interactions.addEventListener(d,t=>{t.element.setMap(null)}),this.overlays_.addEventListener("add",t=>{this.addOverlayInternal_(t.element)}),this.overlays_.addEventListener(d,t=>{let e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}),this.controls.forEach(t=>{t.setMap(this)}),this.interactions.forEach(t=>{t.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){!function t(e,i){if(e instanceof nC)return void e.setMapInternal(i);if(e instanceof nm){let n=e.getLayers().getArray();for(let e=0,r=n.length;e<r;++e)t(n[e],i)}}(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){let e=t.getId();void 0!==e&&(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,i){if(!this.frameState_||!this.renderer_)return;let n=this.getCoordinateFromPixelInternal(t),r=void 0!==(i=void 0!==i?i:{}).hitTolerance?i.hitTolerance:0,s=void 0!==i.layerFilter?i.layerFilter:S,o=!1!==i.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(n,this.frameState_,r,o,e,null,s,null)}getFeaturesAtPixel(t,e){let i=[];return this.forEachFeatureAtPixel(t,function(t){i.push(t)},e),i}getAllLayers(){let t=[];return!function e(i){i.forEach(function(i){i instanceof nm?e(i.getLayers()):t.push(i)})}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;let i=this.getCoordinateFromPixelInternal(t),n=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:S,r=void 0!==e.hitTolerance?e.hitTolerance:0,s=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(i,this.frameState_,r,s,n,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){let e=this.viewport_.getBoundingClientRect(),i=this.getSize(),n=e.width/i[0],r=e.height/i[1],s="changedTouches"in t?t.changedTouches[0]:t;return[(s.clientX-e.left)/n,(s.clientY-e.top)/r]}getTarget(){return this.get(to)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){var e,i;return e=this.getCoordinateFromPixelInternal(t),i=this.getView().getProjection(),e}getCoordinateFromPixelInternal(t){let e=this.frameState_;return e?eB(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){let e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(tr)}setLayers(t){let e=this.getLayerGroup();if(t instanceof G)return void e.setLayers(t);let i=e.getLayers();i.clear(),i.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){let t=this.getLayerGroup().getLayerStatesArray();for(let e=0,i=t.length;e<i;++e){let i=t[e];if(!i.visible)continue;let n=i.layer.getRenderer();if(n&&!n.ready)return!0;let r=i.layer.getSource();if(r&&r.loading)return!0}return!1}getPixelFromCoordinate(t){let e=eU(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){let e=this.frameState_;return e?eB(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(ts)}getView(){return this.get(ta)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){let t=this.getTargetElement();return t?t.ownerDocument:document}
1getTilePriority(t,e,i,n){return function(t,e,i,n,r){if(!t||!(i in t.wantedTiles)||!t.wantedTiles[i][e.getKey()])return th;let s=t.viewState.center,o=n[0]-s[0],a=n[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}(this.frameState_,t,e,i,n)}handleBrowserEvent(t,e){let i=new V(e=e||t.type,this,t);this.handleMapBrowserEvent(i)}handleMapBrowserEvent(t){if(!this.frameState_)return;let e=t.originalEvent,i=e.type;if(i===Q||i===y||i===p){let t=this.getOwnerDocument(),i=this.viewport_.getRootNode?this.viewport_.getRootNode():t,n=e.target,r=i instanceof ShadowRoot?i.host===n?i.host.ownerDocument:i:i===t?t.documentElement:i;if(this.overlayContainerStopEvent_.contains(n)||!r.contains(n))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t)){let e=this.getInteractions().getArray().slice();for(let i=e.length-1;i>=0;i--){let n=e[i];if(n.getMap()===this&&n.getActive()&&this.getTargetElement()&&(!n.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){let t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let i=this.maxTilesLoading_,n=i;if(t){let e=t.viewHints;if(e[0]||e[1]){let e=Date.now()-t.time>8;i=8*!e,n=2*!e}}e.getTilesLoading()<i&&(e.reprioritize(),e.loadMoreTiles(i,n))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(nw)&&this.renderer_.dispatchRenderEvent(nw,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Z(tn,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Z(ti,this,t))));let i=this.postRenderFunctions_;if(t)for(let e=0,n=i.length;e<n;++e)i[e](this,t);i.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)A(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(f,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(y,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_){this.resizeObserver_.unobserve(this.targetElement_);let t=this.targetElement_.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.unobserve(t.host),this.setSize(void 0)}let t=this.getTarget(),e="string"==typeof t?document.getElementById(t):t;if(this.targetElement_=e,e){let t;for(let t in e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new sC(this)),this.mapBrowserEventHandler_=new tt(this,this.moveTolerance_),W)this.mapBrowserEventHandler_.addEventListener(W[t],this.handleMapBrowserEvent.bind(this));if(this.viewport_.addEventListener(f,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(y,this.boundHandleBrowserEvent_,!!J&&{passive:!1}),this.keyboardEventTarget_)t=this.keyboardEventTarget_;else{let i=e.getRootNode();t=i instanceof ShadowRoot?i.host:e}this.targetChangeHandlerKeys_=[L(t,p,this.handleBrowserEvent,this),L(t,m,this.handleBrowserEvent,this)];let i=e.getRootNode();i instanceof ShadowRoot&&this.resizeObserver_.observe(i.host),this.resizeObserver_.observe(e)}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0);this.updateSize()}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(A(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(A(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);let t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=L(t,c,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=L(t,g,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(A),this.layerGroupPropertyListenerKeys_=null);let t=this.getLayerGroup();t&&(this.handleLayerAdd_(new n_("addlayer",t)),this.layerGroupPropertyListenerKeys_=[L(t,c,this.render,this),L(t,g,this.render,this),L(t,"addlayer",this.handleLayerAdd_,this),L(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;let t=this.frameState_.layerStatesArray;for(let e=0,i=t.length;e<i;++e){let i=t[e].layer;i.hasRenderer()&&i.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}
1removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){!function t(e){e instanceof nC?e.setMapInternal(null):e instanceof nm&&e.getLayers().forEach(t)}(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){let e=this.getSize(),i=this.getView(),n=this.frameState_,r=null;if(void 0!==e&&n0(e)&&i&&i.isDef()){let n=i.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=i.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:tK(s.center,s.resolution,s.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:s,viewHints:n,wantedTiles:{},mapId:D(this),renderTargets:{}},s.nextCenter&&s.nextResolution){let t=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=tK(s.nextCenter,s.nextResolution,t,e)}}if(this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),n&&(this.previousExtent_&&(tB(this.previousExtent_)||tA(r.extent,this.previousExtent_))||(this.dispatchEvent(new Z("movestart",this,n)),this.previousExtent_=tL(this.previousExtent_))),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!tA(r.extent,this.previousExtent_))){var s,o;this.dispatchEvent(new Z("moveend",this,r)),s=r.extent,(o=this.previousExtent_)?(o[0]=s[0],o[1]=s[1],o[2]=s[2],o[3]=s[3]):s.slice()}this.dispatchEvent(new Z(te,this,r)),this.renderComplete_=(this.hasListener(ti)||this.hasListener(tn)||this.hasListener(nw))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){let e=this.getLayerGroup();e&&this.handleLayerRemove_(new n_("removelayer",e)),this.set(tr,t)}setSize(t){this.set(ts,t)}setTarget(t){this.set(to,t)}setView(t){if(!t||t instanceof ix)return void this.set(ta,t);this.set(ta,new ix);let e=this;t.then(function(t){e.setView(new ix(t))})}updateSize(){let t,e=this.getTargetElement();if(e){let i=getComputedStyle(e),n=e.offsetWidth-parseFloat(i.borderLeftWidth)-parseFloat(i.paddingLeft)-parseFloat(i.paddingRight)-parseFloat(i.borderRightWidth),r=e.offsetHeight-parseFloat(i.borderTopWidth)-parseFloat(i.paddingTop)-parseFloat(i.paddingBottom)-parseFloat(i.borderBottomWidth);!isNaN(n)&&!isNaN(r)&&!n0(t=[Math.max(0,n),Math.max(0,r)])&&(e.offsetWidth||e.offsetHeight||e.getClientRects().length)&&t1("No map visible because the map container's width or height are 0.")}let i=this.getSize();!t||i&&C(t,i)||(this.setSize(t),this.updateViewportSize_(t))}updateViewportSize_(t){let e=this.getView();e&&e.setViewportSize(t)}},sR=class extends P{constructor(t,e,i){super(),i=i||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===i.transition?250:i.transition,this.transitionStarts_={},this.interpolate=!!i.interpolate}changed(){this.dispatchEvent(g)}release(){this.setState(4)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(4!==this.state){if(3!==this.state&&this.state>t)throw Error("Tile load sequence violation");this.state=t,this.changed()}}load(){k()}getAlpha(t,e){if(!this.transition_)return 1;let i=this.transitionStarts_[t];if(i){if(-1===i)return 1}else i=e,this.transitionStarts_[t]=i;let n=e-i+1e3/60;return n>=this.transition_?1:tH(n/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function sb(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}let sM=Error("disposed"),sT=[256,256],sI=class extends sR{constructor(t){super(t.tileCoord,0,{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_;let t=sb(this.data_);return t?[t.width,t.height]:sT}getData(){return this.data_}getError(){return this.error_}load(){if(0!==this.state&&3!==this.state)return;this.state=1,this.changed();let t=this;this.loader_().then(function(e){t.data_=e,t.state=2,t.changed()}).catch(function(e){t.error_=e,t.state=3,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(sM),this.controller_=null),super.disposeInternal()}},sP=class extends sR{constructor(t,e,i,n,r,s){super(t,e,s),this.crossOrigin_=n,this.src_=i,this.key=i,this.image_=new Image,null!==n&&(this.image_.crossOrigin=n),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=2,this.unlistenImage_(),this.changed()}handleImageError_(){let t;this.state=3,this.unlistenImage_(),this.image_=((t=ib(1,1)).fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas),this.changed()}handleImageLoad_(){let t=this.image_;
1t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4,this.unlistenImage_(),this.changed()}load(){var t,e,i;let n,r,s,o;3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=(t=this.image_,e=this.handleImageLoad_.bind(this),i=this.handleImageError_.bind(this),n=!0,r=!1,s=!1,o=[L(t,"load",function(){s=!0,r||e()},void 0,!0)],t.src&&H?(r=!0,t.decode().then(function(){n&&e()}).catch(function(t){n&&(s?e():i())})):o.push(L(t,"error",i,void 0,!0)),function(){n=!1,o.forEach(A)}))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};class sL{constructor(t,e,i,n){this.minX=t,this.maxX=e,this.minY=i,this.maxY=n}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)}
1getHeight(){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 sA(t,e,i,n,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=i,r.maxY=n,r):new sL(t,e,i,n)}let sF=[];function sO(t,e,i,n,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,i),t.lineTo(n,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,n)+1,Math.max(i,r)),t.restore()}function sk(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function sz(t,e,i,n){let r=eW(i,e,t),s=eD(e,n,i),o=e.getMetersPerUnit();void 0!==o&&(s*=o);let a=t.getMetersPerUnit();void 0!==a&&(s/=a);let l=t.getExtent();if(!l||tb(l,r)){let e=eD(t,s,r)/s;isFinite(e)&&e>0&&(s/=e)}return s}let sD=class{constructor(t,e,i,n,r,s,o){var a;this.sourceProj_=t,this.targetProj_=e;let l={};const h=o?(a=t=>eB(o,eW(t,this.targetProj_,this.sourceProj_)),function(t,e,i,n){let r=t.length;i=void 0!==i?i:2,n=n??i,e=void 0!==e?e:Array(r);for(let s=0;s<r;s+=n){let r=a(t.slice(s,s+i)),o=r.length;for(let i=0,a=n;i<a;++i)e[s+i]=i>=o?t[s+i]:r[i]}return e}):eV(this.targetProj_,this.sourceProj_);this.transformInv_=function(t){let e=t[0]+"/"+t[1];return l[e]||(l[e]=h(t)),l[e]},this.maxSourceExtent_=n,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!n&&!!this.sourceProj_.getExtent()&&tU(n)>=tU(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?tU(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?tU(this.targetProj_.getExtent()):null;const u=tV(i),d=tW(i),c=tj(i),g=tD(i),f=this.transformInv_(u),_=this.transformInv_(d),p=this.transformInv_(c),m=this.transformInv_(g),v=10+(s?Math.max(0,Math.ceil(Math.log2(tz(i)/(s*s*65536)))):0);if(this.addQuad_(u,d,c,g,f,_,p,m,v),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach(function(e,i,n){t=Math.min(t,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])-t>this.sourceWorldWidth_/2){let i=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];i[0][0]-t>this.sourceWorldWidth_/2&&(i[0][0]-=this.sourceWorldWidth_),i[1][0]-t>this.sourceWorldWidth_/2&&(i[1][0]-=this.sourceWorldWidth_),i[2][0]-t>this.sourceWorldWidth_/2&&(i[2][0]-=this.sourceWorldWidth_);let n=Math.min(i[0][0],i[1][0],i[2][0]);Math.max(i[0][0],i[1][0],i[2][0])-n<this.sourceWorldWidth_/2&&(e.source=i)}})}l={}}addTriangle_(t,e,i,n,r,s){this.triangles_.push({source:[n,r,s],target:[t,e,i]})}addQuad_(t,e,i,n,r,s,o,a,l){let h=tS([r,s,o,a]),u=this.sourceWorldWidth_?tU(h)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,c=this.sourceProj_.canWrapX()&&u>.5&&u<1,g=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(g=tU(tS([t,e,i,n]))/this.targetWorldWidth_>.25||g),!c&&this.sourceProj_.isGlobal()&&u&&(g=u>.25||g)),!g&&this.maxSourceExtent_&&isFinite(h[0])&&isFinite(h[1])&&isFinite(h[2])&&isFinite(h[3])&&!tY(h,this.maxSourceExtent_))return;let f=0;if(!g&&(!isFinite(r[0])||!isFinite(r[1])||!isFinite(s[0])||!isFinite(s[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(a[0])||!isFinite(a[1]))){if(l>0)g=!0;else if(1!=(f=8*!(isFinite(r[0])&&isFinite(r[1]))+4*!(isFinite(s[0])&&isFinite(s[1]))+2*!(isFinite(o[0])&&isFinite(o[1]))+ +!(isFinite(a[0])&&isFinite(a[1])))&&2!=f&&4!=f&&8!=f)return}if(l>0){if(!g){let e,n=[(t[0]+i[0])/2,(t[1]+i[1])/2],s=this.transformInv_(n);e=c?(tm(r[0],d)+tm(o[0],d))/2-tm(s[0],d):(r[0]+o[0])/2-s[0];let a=(r[1]+o[1])/2-s[1];g=e*e+a*a>this.errorThresholdSquared_}if(g){if(Math.abs(t[0]-i[0])<=Math.abs(t[1]-i[1])){let h=[(e[0]+i[0])/2,(e[1]+i[1])/2],u=this.transformInv_(h),d=[(n[0]+t[0])/2,(n[1]+t[1])/2],c=this.transformInv_(d);this.addQuad_(t,e,h,d,r,s,u,c,l-1),this.addQuad_(d,h,i,n,c,u,o,a,l-1)}else{let h=[(t[0]+e[0])/2,(t[1]+e[1])/2],u=this.transformInv_(h),d=[(i[0]+n[0])/2,(i[1]+n[1])/2],c=this.transformInv_(d);this.addQuad_(t,h,d,n,r,u,c,a,l-1),this.addQuad_(h,e,i,d,u,s,o,c,l-1)}return}}
1if(c){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}(11&f)==0&&this.addTriangle_(t,i,n,r,o,a),(14&f)==0&&this.addTriangle_(t,i,e,r,o,s),f&&((13&f)==0&&this.addTriangle_(e,n,t,s,a,r),(7&f)==0&&this.addTriangle_(e,n,i,s,a,o))}calculateSourceExtent(){let t=tI();return this.triangles_.forEach(function(e,i,n){let r=e.source;tF(t,r[0]),tF(t,r[1]),tF(t,r[2])}),t}getTriangles(){return this.triangles_}},sj=class extends sR{constructor(t,e,i,n,r,s,o,a,l,h,u,d){super(r,0,d),this.renderEdges_=void 0!==u&&u,this.pixelRatio_=o,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=n,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const c=n.getTileCoordExtent(this.wrappedTileCoord_),g=this.targetTileGrid_.getExtent();let f=this.sourceTileGrid_.getExtent();const _=g?tZ(c,g):c;if(0===tz(_)){this.state=4;return}const p=t.getExtent();p&&(f=f?tZ(f,p):p);const m=n.getResolution(this.wrappedTileCoord_[0]),v=function(t,e,i,n){let r=sz(t,e,tN(i),n);return(!isFinite(r)||r<=0)&&tk(i,function(i){return isFinite(r=sz(t,e,i,n))&&r>0}),r}(t,i,_,m);if(!isFinite(v)||v<=0||(this.triangulation_=new sD(t,i,_,f,v*(void 0!==h?h:.5),m),0===this.triangulation_.getTriangles().length)){this.state=4;return}this.sourceZ_=e.getZForResolution(v);let y=this.triangulation_.calculateSourceExtent();if(f&&(t.canWrapX()?(y[1]=tg(y[1],f[1],f[3]),y[3]=tg(y[3],f[1],f[3])):y=tZ(y,f)),tz(y)){let i=0,n=0;t.canWrapX()&&(i=tU(p),n=Math.floor((y[0]-p[0])/i)),(function(t,e,i){if(e.canWrapX()){let s=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[s[0],t[1],s[2],t[3]]];var n=t,r=e;let o=r.getExtent(),a=tN(n);if(r.canWrapX()&&(a[0]<o[0]||a[0]>=o[2])){let t=tU(o),e=Math.floor((a[0]-o[0])/t)*t;n[0]-=e,n[2]-=e}let l=tU(s);if(tU(t)>l&&!i)return[[s[0],t[1],s[2],t[3]]];if(t[0]<s[0])return[[t[0]+l,t[1],s[2],t[3]],[s[0],t[1],t[2],t[3]]];if(t[2]>s[2])return[[t[0],t[1],s[2],t[3]],[s[0],t[1],t[2]-l,t[3]]]}return[t]}
1)(y.slice(),t,!0).forEach(t=>{let r=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let t=r.minX;t<=r.maxX;t++)for(let e=r.minY;e<=r.maxY;e++){let r=l(this.sourceZ_,t,e,o);if(r){let t=n*i;this.sourceTiles_.push({tile:r,offset:t})}}++n}),0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}getImage(){return this.canvas_}reproject_(){let t=[];if(this.sourceTiles_.forEach(e=>{let i=e.tile;if(i&&2==i.getState()){let n=this.sourceTileGrid_.getTileCoordExtent(i.tileCoord);n[0]+=e.offset,n[2]+=e.offset;let r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:n,clipExtent:r,image:i.getImage()})}}),this.sourceTiles_.length=0,0===t.length)this.state=3;else{let e=this.wrappedTileCoord_[0],i=this.targetTileGrid_.getTileSize(e),r="number"==typeof i?i:i[0],s="number"==typeof i?i:i[1],o=this.targetTileGrid_.getResolution(e),a=this.sourceTileGrid_.getResolution(this.sourceZ_),l=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=function(t,e,i,r,s,o,a,l,h,u,d,c){let g,f=ib(Math.round(i*t),Math.round(i*e),sF);if(c||(f.imageSmoothingEnabled=!1),0===h.length)return f.canvas;function _(t){return Math.round(t*i)/i}f.scale(i,i),f.globalCompositeOperation="lighter";let p=tI();h.forEach(function(t,e,i){var n;(n=t.extent)[0]<p[0]&&(p[0]=n[0]),n[2]>p[2]&&(p[2]=n[2]),n[1]<p[1]&&(p[1]=n[1]),n[3]>p[3]&&(p[3]=n[3])});let m=i/r,v=(c?1:1.0000000596046448)/m;g=ib(Math.round(tU(p)*m),Math.round(tG(p)*m),sF),c||(g.imageSmoothingEnabled=!1),h.forEach(function(t,e,i){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){g.save();let e=(t.clipExtent[0]-p[0])*m,i=-(t.clipExtent[3]-p[3])*m,n=tU(t.clipExtent)*m,r=tG(t.clipExtent)*m;g.rect(c?e:Math.round(e),c?i:Math.round(i),c?n:Math.round(e+n)-Math.round(e),c?r:Math.round(i+r)-Math.round(i)),g.clip()}let e=(t.extent[0]-p[0])*m,i=-(t.extent[3]-p[3])*m,n=tU(t.extent)*m,r=tG(t.extent)*m;g.drawImage(t.image,u,u,t.image.width-2*u,t.image.height-2*u,c?e:Math.round(e),c?i:Math.round(i),c?n:Math.round(e+n)-Math.round(e),c?r:Math.round(i+r)-Math.round(i)),t.clipExtent&&g.restore()}});let y=tV(a);
1return l.getTriangles().forEach(function(t,e,i){let r,s=t.source,a=t.target,l=s[0][0],u=s[0][1],d=s[1][0],m=s[1][1],x=s[2][0],w=s[2][1],E=_((a[0][0]-y[0])/o),C=_(-(a[0][1]-y[1])/o),S=_((a[1][0]-y[0])/o),R=_(-(a[1][1]-y[1])/o),b=_((a[2][0]-y[0])/o),M=_(-(a[2][1]-y[1])/o),T=l,I=u;l=0,u=0;let P=function(t){let e=t.length;for(let i=0;i<e;i++){let n=i,r=Math.abs(t[i][i]);for(let s=i+1;s<e;s++){let e=Math.abs(t[s][i]);e>r&&(r=e,n=s)}if(0===r)return null;let s=t[n];t[n]=t[i],t[i]=s;for(let n=i+1;n<e;n++){let r=-t[n][i]/t[i][i];for(let s=i;s<e+1;s++)i==s?t[n][s]=0:t[n][s]+=r*t[i][s]}}let i=Array(e);for(let n=e-1;n>=0;n--){i[n]=t[n][e]/t[n][n];for(let r=n-1;r>=0;r--)t[r][e]-=t[r][n]*i[n]}return i}([[d-=T,m-=I,0,0,S-E],[x-=T,w-=I,0,0,b-E],[0,0,d,m,R-C],[0,0,x,w,M-C]]);if(P){if(f.save(),f.beginPath(),function(){if(void 0===n){let t=ib(6,6,sF);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",sO(t,4,5,4,0),sO(t,4,5,0,5);let e=t.getImageData(0,0,3,3).data;n=sk(e,0)||sk(e,4)||sk(e,8),iT(t),sF.push(t.canvas)}return n}()||!c){f.moveTo(S,R);let t=E-S,e=C-R;for(let i=0;i<4;i++)f.lineTo(S+_((i+1)*t/4),R+_(i*e/3)),3!=i&&f.lineTo(S+_((i+1)*t/4),R+_((i+1)*e/3));f.lineTo(b,M)}else f.moveTo(S,R),f.lineTo(E,C),f.lineTo(b,M);if(f.clip(),f.transform(P[0],P[2],P[1],P[3],E,C),f.translate(p[0]-T,p[3]-I),g)r=g.canvas,f.scale(v,-v);else{let t=h[0],e=t.extent;r=t.image,f.scale(tU(e)/r.width,-tG(e)/r.height)}f.drawImage(r,0,0),f.restore()}}),g&&(iT(g),sF.push(g.canvas)),d&&(f.save(),f.globalCompositeOperation="source-over",f.strokeStyle="black",f.lineWidth=1,l.getTriangles().forEac
1h(function(t,e,i){let n=t.target,r=(n[0][0]-y[0])/o,s=-(n[0][1]-y[1])/o,a=(n[1][0]-y[0])/o,l=-(n[1][1]-y[1])/o,h=(n[2][0]-y[0])/o,u=-(n[2][1]-y[1])/o;f.beginPath(),f.moveTo(a,l),f.lineTo(r,s),f.lineTo(h,u),f.closePath(),f.stroke()}),f.restore()),f.canvas}(r,s,this.pixelRatio_,a,this.sourceTileGrid_.getExtent(),o,l,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=2}this.changed()}load(){if(0==this.state){this.state=1,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{let i=e.getState();if(0==i||1==i){t++;let i=L(e,g,n=>{let r=e.getState();(2==r||3==r||4==r)&&(A(i),0==--t&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(i)}}),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t},e,i){0==t.getState()&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(A),this.sourcesListenerKeys_=null}release(){this.canvas_&&(iT(this.canvas_.getContext("2d")),sF.push(this.canvas_),this.canvas_=null),super.release()}},sN=class{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){let t=this.pop();t instanceof x&&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){let i=this.entries_[t];return tl(void 0!==i,"Tried to get a value for a key that does not exist in the cache"),i===this.newest_||(i===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(i.newer.older=i.older,i.older.newer=i.newer),i.newer=null,i.older=this.newest_,this.newest_.newer=i,this.newest_=i),i.value_}remove(t){let e=this.entries_[t];return tl(void 0!==e,"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(){let t,e=Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.key_;return e}getValues(){let t,e=Array(this.count_),i=0;for(t=this.newest_;t;t=t.older)e[i++]=t.value_;return e}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){let 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){tl(!(t in this.entries_),"Tried to set a value for a key that is used already");let i={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=i:this.oldest_=i,this.newest_=i,this.entries_[t]=i,++this.count_}setSize(t){this.highWaterMark=t}};function sK(t,e,i,n){return void 0!==n?(n[0]=t,n[1]=e,n[2]=i,n):[t,e,i]}let sX=class{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(iM(),{get:(t,e)=>{if("function"==typeof iM()[e])return this.push_(e),this.pushMethodArgs_},set:(t,e,i)=>(this.push_(e,i),!0)})}push_(...t){let e=this.instructions_,i=this.zIndex+this.offset_;e[i]||(e[i]=[]),e[i].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 i=0,n=e.length;i<n;++i){let n=e[i];if("function"==typeof n){n(t);continue}let r=e[++i];if("function"==typeof t[n])t[n](...r);else{if("function"==typeof r){t[n]=r(t);continue}t[n]=r}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}},sG=class extends O{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=[],this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return k()}getData(t){return null}prepareFrame(t){return k()}renderFrame(t,e){return k()}forEachFeatureAtCoordinate(t,e,i,n,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){let e=t.target;(2===e.getState()||3===e.getState())&&this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return 2!=e&&3!=e&&t.addEventListener(g,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e}renderIfReadyAndVisible(){let t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}},sZ=null,sV=class extends sG{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=eY(),this.pixelTransform=eY(),this.inversePixelTransform=eY(),this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}
1getImageData(t,e,i){let n;sZ||(sZ=ib(1,1,void 0,{willReadFrequently:!0})),sZ.clearRect(0,0,1,1);try{sZ.drawImage(t,e,i,1,1,0,0,1,1),n=sZ.getImageData(0,0,1,1).data}catch{return sZ=null,null}return n}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,i){let n,r,s=this.getLayer().getClassName();if(t&&t.className===s&&(!i||t&&t.style.backgroundColor&&C(nJ(t.style.backgroundColor),nJ(i)))){let e=t.firstElementChild;e instanceof HTMLCanvasElement&&(r=e.getContext("2d"))}if(r&&function(t,e){let i=eJ(t),n=eJ(e);for(let t=0;t<6;++t)if(0!==Math.round((i[t]-n[t])*eH[t]))return!1;return!0}(r.canvas.style.transform,e)?(this.container=t,this.context=r,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){(n=document.createElement("div")).className=s;let t=n.style;t.position="absolute",t.width="100%",t.height="100%";let e=(r=ib()).canvas;n.appendChild(e),(t=e.style).position="absolute",t.left="0",t.transformOrigin="top left",this.container=n,this.context=r}this.containerReused||!i||this.container.style.backgroundColor||(this.container.style.backgroundColor=i)}clipUnrotated(t,e,i){let n=tV(i),r=tW(i),s=tj(i),o=tD(i);eB(e.coordinateToPixelTransform,n),eB(e.coordinateToPixelTransform,r),eB(e.coordinateToPixelTransform,s),eB(e.coordinateToPixelTransform,o);let a=this.inversePixelTransform;eB(a,n),eB(a,r),eB(a,s),eB(a,o),t.save(),t.beginPath(),t.moveTo(Math.round(n[0]),Math.round(n[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])
1),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){let i=t.extent,n=t.viewState.resolution,r=t.viewState.rotation,s=t.pixelRatio,o=Math.round(tU(i)/n*s),a=Math.round(tG(i)/n*s);e$(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,r,-o/2,-a/2),eq(this.inversePixelTransform,this.pixelTransform);let l="matrix("+this.pixelTransform.join(", ")+")";if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){let t=this.context.canvas;t.width!=o||t.height!=a?(t.width=o,t.height=a):this.context.clearRect(0,0,o,a),l!==t.style.transform&&(t.style.transform=l)}}dispatchRenderEvent_(t,e,i){let n=this.getLayer();if(n.hasListener(t)){let r=new sx(t,this.inversePixelTransform,i,e);n.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(nv,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(ny,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new sX),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(nv,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(ny,this.context,t))}getRenderTransform(t,e,i,n,r,s,o){let a=n/e,l=-t[0]+o,h=-t[1];return e$(this.tempTransform,r/2,s/2,a,-a,-i,l,h)}disposeInternal(){delete this.frameState,super.disposeInternal()}};function sW(t,e,i,n,r){return`${D(t)},${e},${i+"/"+n+"/"+r}`}function sU(t,e,i){if(!(i in t))return t[i]=new Set([e]),!0;let n=t[i],r=n.has(e);
1return r||n.add(e),!r}function sY(t,e){var i,n;let r=t.layerStatesArray[t.layerIndex];r.extent&&(e=tZ(e,(i=r.extent,n=t.viewState.projection,i)));let s=r.layer.getRenderSource();if(!s.getWrapX()){let i=s.getTileGridForProjection(t.viewState.projection).getExtent();i&&(e=tZ(e,i))}return e}let sB=class extends sV{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=tI(),this.tempTileRange_=new sL(0,0,0,0),this.tempTileCoord_=sK(0,0,0);const i=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new sN(i),this.maxStaleKeys=.5*i}getTileCache(){return this.tileCache_}getOrCreateTile(t,e,i,n){let r,s=this.tileCache_,o=this.getLayer().getSource(),a=sW(o,o.getKey(),t,e,i);if(s.containsKey(a))r=s.get(a);else{if(!(r=o.getTile(t,e,i,n.pixelRatio,n.viewState.projection)))return null;s.set(a,r)}return r}getTile(t,e,i,n){let r=this.getOrCreateTile(t,e,i,n);return r||null}getData(t){let e=this.frameState;if(!e)return null;let i=this.getLayer(),n=eB(e.pixelToCoordinateTransform,t.slice()),r=i.getExtent();if(r&&!tb(r,n))return null;let s=e.viewState,o=i.getRenderSource(),a=o.getTileGridForProjection(s.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let t=a.getZForResolution(s.resolution);t>=a.getMinZoom();--t){let i,r=a.getTileCoordForCoordAndZ(n,t),h=this.getTile(t,r[1],r[2],e);if(!h||2!==h.getState())continue;let u=a.getOrigin(t),d=n1(a.getTileSize(t)),c=a.getResolution(t);if(h instanceof sP||h instanceof sj)i=h.getImage();else if(!(h instanceof sI))continue;else if(!(i=sb(h.getData())))continue;let g=Math.floor(l*((n[0]-u[0])/c-r[1]*d[0])),f=Math.floor(l*((u[1]-n[1])/c-r[2]*d[1])),_=Math.round(l*o.getGutterForProjection(s.projection));return this.getImageData(i,g+_,f+_)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;let e=this.getLayer().getSource();if(!e)return!1;let i=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==i&&(this.renderedSourceRevision_=i,this.renderedSourceKey_===e.getKey()&&this.tileCache_.clear()):this.renderedSourceRevision_=i,!0}enqueueTiles(t,e,i,n,r){let s=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),h=D(a);h in t.wantedTiles||(t.wantedTiles[h]={});let u=t.wantedTiles[h],d=o.getMapInternal(),c=Math.max(i-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),d?d.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection)),g=s.rotation,f=g?tX(s.center,s.resolution,g,t.size):void 0;for(let r=i;r>=c;--r){let i=l.getTileRangeForExtentAndZ(e,r,this.tempTileRange_),s=l.getResolution(r);for(let e=i.minX;e<=i.maxX;++e)for(let o=i.minY;o<=i.maxY;++o){if(g&&!l.tileCoordIntersectsViewport([r,e,o],f))continue;let i=this.getTile(r,e,o,t);if(!i||!sU(n,i,r))continue;let a=i.getKey();if(u[a]=!0,0===i.getState()&&!t.tileQueue.isKeyQueued(a)){let n=sK(r,e,o,this.tempTileCoord_);t.tileQueue.enqueue([i,h,l.getTileCoordCenter(n),s])}}}}findStaleTile_(t,e){let i=this.tileCache_,n=t[0],r=t[1],s=t[2],o=this.getStaleKeys();for(let t=0;t<o.length;++t){let a=sW(this.getLayer().getSource(),o[t],n,r,s);if(i.containsKey(a)){let t=i.peek(a);if(2===t.getState())return t.endTransition(D(this)),sU(e,t,n),!0}}return!1}findAltTiles_(t,e,i,n){let r=t.getTileRangeForTileCoordAndZ(e,i,this.tempTileRange_);if(!r)return!1;let s=!0,o=this.tileCache_,a=this.getLayer().getRenderSource(),l=a.getKey();for(let t=r.minX;t<=r.maxX;++t)for(let e=r.minY;e<=r.maxY;++e){let r=sW(a,l,i,t,e),h=!1;if(o.containsKey(r)){let t=o.peek(r);2===t.getState()&&(sU(n,t,i),h=!0)}h||(s=!1)}return s}renderFrame(t,e){let i;this.renderComplete=!0;let n=t.layerStatesArray[t.layerIndex],r=t.viewState,s=r.projection,o=r.resolution,a=r.center,l=t.pixelRatio,h=this.getLayer(),u=h.getSource(),d=u.getTileGridForProjection(s),c=d.getZForResolution(o,u.zDirection),g=d.getResolution(c),f=u.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==f&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=f):this.renderedSourceKey_=f;let _=t.extent,p=u.getTilePixelRatio(l);this.prepareContainer(t,e);let m=this.context.canvas.width,v=this.context.canvas.height,y=n.extent&&n.extent;y&&(_=tZ(_,n.extent));let x=g*m/2/p,E=g*v/2/p,C=[a[0]-x,a[1]-E,a[0]+x,a[1]+E],S={};this.renderedTiles.length=0;let R=h.getPreload();if(t.nextExtent){let e=d.getZForResolution(r.nextResolution,u.zDirection),i=sY(t,t.nextExtent);this.enqueueTiles(t,i,e,S,R)}let b=sY(t,_);if(this.enqueueTiles(t,b,c,S,0),R>0&&setTimeout(()=>{this.enqueueTiles(t,b,c-1,S,R-1)},0),!(c in S))return this.container;let M=D(this),T=t.time;for(let e of S[c]){let i=e.getState();if(4===i)continue;let n=e.tileCoord;if(2===i&&1===e.getAlpha(M,T)){e.endTransition(M);continue}if(3!==i&&(this.renderComplete=!1),this.findStaleTile_(n,S)){!function(t,e,
1i){let n=t[i];n&&n.delete(e)}(S,e,c),t.animate=!0;continue}if(this.findAltTiles_(d,n,c+1,S))continue;let r=d.getMinZoom();for(let t=c-1;t>=r&&!this.findAltTiles_(d,n,t,S);--t);}let I=g/o*l/p,P=this.getRenderContext(t);e$(this.tempTransform,m/2,v/2,I,I,0,-m/2,-v/2),n.extent&&this.clipUnrotated(P,t,y),u.getInterpolate()||(P.imageSmoothingEnabled=!1),this.preRender(P,t);let L=Object.keys(S).map(Number);L.sort(w);let A=[],F=[];for(let e=L.length-1;e>=0;--e){let n=L[e],r=u.getTilePixelSize(n,l,s),o=d.getResolution(n)/g,a=r[0]*o*I,h=r[1]*o*I,c=d.getTileCoordForCoordAndZ(tV(C),n),f=d.getTileCoordExtent(c),_=eB(this.tempTransform,[p*(f[0]-C[0])/g,p*(C[3]-f[3])/g]),m=p*u.getGutterForProjection(s);for(let e of S[n]){if(2!==e.getState())continue;let r=e.tileCoord,s=c[1]-r[1],o=Math.round(_[0]-(s-1)*a),l=c[2]-r[2],d=Math.round(_[1]-(l-1)*h),g=Math.round(_[0]-s*a),f=Math.round(_[1]-l*h),p=o-g,v=d-f,y=1===L.length,x=!1;i=[g,f,g+p,f,g+p,f+v,g,f+v];for(let t=0,e=A.length;t<e;++t)if(!y&&n<F[t]){let e=A[t];tY([g,f,g+p,f+v],[e[0],e[3],e[4],e[7]])&&(x||(P.save(),x=!0),P.beginPath(),P.moveTo(i[0],i[1]),P.lineTo(i[2],i[3]),P.lineTo(i[4],i[5]),P.lineTo(i[6],i[7]),P.moveTo(e[6],e[7]),P.lineTo(e[4],e[5]),P.lineTo(e[2],e[3]),P.lineTo(e[0],e[1]),P.clip())}A.push(i),F.push(n),this.drawTile(e,t,g,f,p,v,m,y),x&&P.restore(),this.renderedTiles.unshift(e),this.updateUsedTiles(t.usedTiles,u,e)}}if(this.renderedResolution=g,this.extentChanged=!this.renderedExtent_||!tA(this.renderedExtent_,C),this.renderedExtent_=C,this.renderedPixelRatio=l,this.postRender(this.context,t),n.extent&&P.restore(),P.imageSmoothingEnabled=!0,this.renderComplete){let e=(t,e)=>{let i=D(u),n=e.wantedTiles[i],r=n?Object.keys(n).length:0;this.updateCacheSize(r),this.tileCache_.expireCache()};t.postRenderFunctions.push(e)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,i,n,r,s,o,a){let l;if(t instanceof sI){if(!(l=sb(t.getData())))throw Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;let h=this.getRenderContext(e),u=D(this),d=e.layerStatesArray[e.layerIndex],c=d.opacity*(a?t.getAlpha(u,e.time):1),g=c!==h.globalAlpha;g&&(h.save(),h.globalAlpha=c),h.drawImage(l,o,o,l.width-2*o,l.height-2*o,i,n,r,s),g&&h.restore(),c!==d.opacity?e.animate=!0:a&&t.endTransition(u)}getImage(){let t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,i){let n=D(e);n in t||(t[n]={}),t[n][i.getKey()]=!0}},s$="preload",sq="useInterimTilesOnError",sH=class extends nC{constructor(t){const e=Object.assign({},t=t||{}),i=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=i,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(s$)}setPreload(t){this.set(s$,t)}getUseInterimTilesOnError(){return this.get(sq)}setUseInterimTilesOnError(t){this.set(sq,t)}getData(t){return super.getData(t)}},sJ=class extends sH{constructor(t){super(t)}createRenderer(){return new sB(this,{cacheSize:this.getCacheSize()})}},sQ=[0,0,0],s0=class{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,tl(function(t,e,i){let n=e||w;return t.every(function(e,r){if(0===r)return!0;let s=n(t[r-1],e);return!(s>0||i&&0===s)})}(this.resolutions_,(t,e)=>e-t,!0),"`resolutions` must be sorted in descending order"),!t.origins)for(let t=0,i=this.resolutions_.length-1;t<i;++t)if(e){if(this.resolutions_[t]/this.resolutions_[t+1]!==e){e=void 0;break}}else e=this.resolutions_[t]/this.resolutions_[t+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,tl(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const i=t.extent;void 0===i||this.origin_||this.origins_||(this.origin_=tV(i)),tl(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,tl(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,tl(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=void 0!==i?i:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((t,e)=>{let n=new sL(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(i){let t=this.getTileRangeForExtentAndZ(i,e);n.minX=Math.max(t.minX,n.minX),n.maxX=Math.min(t.maxX,n.maxX),n.minY=Math.max(t.minY,n.minY),n.maxY=M
1ath.min(t.maxY,n.maxY)}return n}):i&&this.calculateTileRanges_(i)}forEachTileCoord(t,e,i){let n=this.getTileRangeForExtentAndZ(t,e);for(let t=n.minX,r=n.maxX;t<=r;++t)for(let r=n.minY,s=n.maxY;r<=s;++r)i([e,t,r])}forEachTileCoordParentTileRange(t,e,i,n){let r,s,o,a=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],o=t[2]):a=this.getTileCoordExtent(t,n);l>=this.minZoom;){if(r=void 0!==s&&void 0!==o?sA(s=Math.floor(s/2),s,o=Math.floor(o/2),o,i):this.getTileRangeForExtentAndZ(a,l,i),e(l,r))return!0;--l}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,i){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){let i=2*t[1],n=2*t[2];return sA(i,i+1,n,n+1,e)}let n=this.getTileCoordExtent(t,i||this.tmpExtent_);return this.getTileRangeForExtentAndZ(n,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,i){if(e>this.maxZoom||e<this.minZoom)return null;let n=t[0],r=t[1],s=t[2];if(e===n)return sA(r,s,r,s,i);if(this.zoomFactor_){let t=Math.pow(this.zoomFactor_,e-n),o=Math.floor(r*t),a=Math.floor(s*t);return e<n?sA(o,o,a,a,i):sA(o,Math.floor(t*(r+1))-1,a,Math.floor(t*(s+1))-1,i)}let o=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e,i)}getTileRangeForExtentAndZ(t,e,i){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,sQ);let n=sQ[1],r=sQ[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,sQ),sA(n,sQ[1],r,sQ[2],i)}getTileCoordCenter(t){let e=this.getOrigin(t[0]),i=this.getResolution(t[0]),n=n1(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*n[0]*i,e[1]-(t[2]+.5)*n[1]*i]}getTileCoordExtent(t,e){let i=this.getOrigin(t[0]),n=this.getResolution(t[0]),r=n1(this.getTileSize(t[0]),this.tmpSize_),s=i[0]+t[1]*r[0]*n,o=i[1]-(t[2]+1)*r[1]*n,a=s+r[0]*n,l=o+r[1]*n;return tP(s,o,a,l,e)}getTileCoordForCoordAndResolution(t,e,i){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,i)}getTileCoordForXYAndResolution_(t,e,i,n,r){let s=this.getZForResolution(i),o=i/this.getResolution(s),a=this.getOrigin(s),l=n1(this.getTileSize(s),this.tmpSize_),h=o*(t-a[0])/i/l[0],u=o*(a[1]-e)/i/l[1];return n?(h=tx(h,5)-1,u=tx(u,5)-1):(h=ty(h,5),u=ty(u,5)),sK(s,h,u,r)}getTileCoordForXYAndZ_(t,e,i,n,r){let s=this.getOrigin(i),o=this.getResolution(i),a=n1(this.getTileSize(i),this.tmpSize_),l=(t-s[0])/o/a[0],h=(s[1]-e)/o/a[1];return n?(l=tx(l,5)-1,h=tx(h,5)-1):(l=ty(l,5),h=ty(h,5)),sK(i,l,h,r)}getTileCoordForCoordAndZ(t,e,i){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,i)}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){return tg(E(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return ia(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){let e=this.resolutions_.length,i=Array(e);for(let n=this.minZoom;n<e;++n)i[n]=this.getTileRangeForExtentAndZ(t,n);this.fullTileRanges_=i}};function s1(t){let e=t.getDefaultTileGrid();return e||(e=function(t){var e,i;let n;return e=s3(t),i=(i=void 0,"top-left"),n=s2(e,void 0,void 0),new s0({extent:e,origin:function(t,e){let i;if("bottom-left"===e)i=tD(t);else if("bottom-right"===e)i=tj(t);else if("top-left"===e)i=tV(t);else if("top-right"===e)i=tW(t);else throw Error("Invalid corner");return i}(e,i),resolutions:n,tileSize:void 0})}(t),t.setDefaultTileGrid(e)),e}function s2(t,e,i,n){e=void 0!==e?e:42,i=n1(void 0!==i?i:256);let r=tG(t),s=tU(t);n=n>0?n:Math.max(s/i[0],r/i[1]);let o=e+1,a=Array(o);for(let t=0;t<o;++t)a[t]=n/Math.pow(2,t);return a}function s3(t){let e=(t=ez(t)).getExtent();if(!e){let i=180*t2.degrees/t.getMetersPerUnit();e=tP(-i,-i,i,i)}return e}let s5=/\{z\}/g,s4=/\{x\}/g,s6=/\{y\}/g,s8=/\{-y\}/g;function s9(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),e=>t):null}let s7=class extends N{constructor(t){super(),this.projection=ez(t.projection),this.attributions_=s9(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(t,i){e.viewResolver=t,e.viewRejector=i})}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_=s9(t),this.changed()}setState(t){this.state_=t,this.changed()}};class ot extends I{constructor(t,e){super(t),this.tile=e}}let oe=class extends s7{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_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileGrid&&n1(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=t.key||D(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){let e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,i,n,r){return k()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:s1(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,i){var n;let r=this.getTileGridForProjection(i),s=this.getTilePixelRatio(e),o=n1(r.getTileSize(t),this.tmpSize);return 1==s?o:(void 0===(n=this.tmpSize)&&(n=[0,0]),n[0]=o[0]*s+.5|0,n[1]=o[1]*s+.5|0,n)}getTileCoordForTileUrlFunction(t,e){let i=void 0!==e?e:this.getProjection(),n=void 0!==e?this.getTileGridForProjection(i):this.tileGrid||this.getTileGridForProjection(i);
1return this.getWrapX()&&i.isGlobal()&&(t=function(t,e,i){let n=e[0],r=t.getTileCoordCenter(e),s=s3(i);if(!tb(s,r)){let e=tU(s),i=Math.ceil((s[0]-r[0])/e);return r[0]+=e*i,t.getTileCoordForCoordAndZ(r,n)}return e}(n,t,i)),!function(t,e){let i=t[0],n=t[1],r=t[2];if(e.getMinZoom()>i||i>e.getMaxZoom())return!1;let s=e.getFullTileRange(i);return!s||s.containsXY(n,r)}(t,n)?null:t}clear(){}refresh(){this.clear(),super.refresh()}};class oi extends oe{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===oi.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){let e,i=t.target,n=D(i),r=i.getState();1==r?(this.tileLoadingKeys_[n]=!0,e="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],e=3==r?"tileloaderror":2==r?"tileloadend":void 0),void 0!=e&&this.dispatchEvent(new ot(e,i))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){let e=function(t){let e=[],i=/\{([a-z])-([a-z])\}/.exec(t);if(i){let n,r=i[1].charCodeAt(0),s=i[2].charCodeAt(0);for(n=r;n<=s;++n)e.push(t.replace(i[0],String.fromCharCode(n)));return e}if(i=/\{(\d+)-(\d+)\}/.exec(t)){let n=parseInt(i[2],10);for(let r=parseInt(i[1],10);r<=n;r++)e.push(t.replace(i[0],r.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;let e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(function(t,e){var i;let n=t.length,r=Array(n);for(let i=0;i<n;++i)r[i]=function(t,e){return function(i,n,r){var s,o,a;let l;if(!i)return;let h=i[0];if(e){let t=e.getFullTileRange(h);t&&(l=t.getHeight()-1)}return s=i[1],o=i[2],a=l,t.replace(s5,h.toString()).replace(s4,s.toString()).replace(s6,o.toString()).replace(s8,function(){if(void 0===a)throw Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(a-o).toString()})}}(t[i],e);return 1===(i=r).length?i[0]:function(t,e,n){var r,s;if(!t)return;let o=tm((r=t[0],s=t[1],(s<<r)+t[2]),i.length);return i[o](t,e,n)}}(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,i){}}let on=oi;function or(t,e){t.getImage().src=e}let os=class extends on{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:or,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:sP,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!eX(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){let e=this.getProjection();if(this.tileGrid&&(!e||eX(e,t)))return this.tileGrid;let i=D(t);return i in this.tileGridForProjection||(this.tileGridForProjection[i]=s1(t)),this.tileGridForProjection[i]}createTile_(t,e,i,n,r,s){let o=[t,e,i],a=this.getTileCoordForTileUrlFunction(o,r),l=a?this.tileUrlFunction(a,n,r):void 0,h=new this.tileClass(o,4*(void 0===l),void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return h.key=s,h.addEventListener(g,this.handleTileChange.bind(this)),h}getTile(t,e,i,n,r){let s=this.getProjection();if(!s||!r||eX(s,r))return this.getTileInternal(t,e,i,n,s||r);let o=[t,e,i],a=this.getKey(),l=this.getTileGridForProjection(s),h=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(o,r),d=new sj(s,l,r,h,o,u,this.getTilePixelRatio(n),this.getGutter(),(t,e,i,n)=>this.getTileInternal(t,e,i,n,s),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=a,d}getTileInternal(t,e,i,n,r){let s=this.getKey();return this.createTile_(t,e,i,n,r,s)}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){let i=ez(t);if(i){let t=D(i);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}},oo=class extends os{constructor(t){const e=void 0!==(t=t||{}).projection?t.projection:"EPSG:3857",i=void 0!==t.tileGrid?t.tileGrid:function(t){let e=t||{},i=e.extent||ez("EPSG:3857").getExtent();return new s0({extent:i,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:s2(i,e.maxZoom,e.tileSize,e.maxResolution)})}({extent:s3(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:i,tileLoadFunction:t.tileLoadFunction,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.gutter_=void 0!==t.gutter?t.gutter:0}getGutter(){return this.gutter_}},oa=class extends oo{constructor(t){let e;e=void 0!==(t=t||{}).attributions?t.attributions:['© <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors.'];const i=void 0!==t.crossOrigin?t.crossOrigin:"anonymous",n=void 0!==t.url?t.url:"https://tile.openstreetmap.org/{z}/{x}/{y}.png";
1super({attributions:e,attributionsCollapsible:!1,cacheSize:t.cacheSize,crossOrigin:i,interpolate:t.interpolate,maxZoom:void 0!==t.maxZoom?t.maxZoom:19,reprojectionErrorThreshold:t.reprojectionErrorThreshold,tileLoadFunction:t.tileLoadFunction,transition:t.transition,url:n,wrapX:t.wrapX,zDirection:t.zDirection})}};var ol=t.i(439549),oh=t.i(344884),ou=t.i(941337),od=t.i(450493),oc=t.i(960958),og=t.i(633634),of=t.i(478992),o_=t.i(750551);function op({store:t,distance:e,isStoreDetailsPage:i,handleSelectedStore:n}){let r=(0,of.useTranslations)(),s=new Date().getDay()-1;return(0,o.jsxs)("div",{"data-test-id":"store-data",className:"flex flex-col",children:[(0,o.jsxs)("div",{className:"pb-8",children:[i&&(0,o.jsx)("h1",{className:"text-body font-medium","data-test-id":"store-name",children:t.name})||(0,o.jsx)("h2",{className:"cursor-pointer text-body font-medium hover:font-semibold","data-test-id":"store-name",onClick:()=>n(t.id),children:t.name}),e&&(0,o.jsxs)("span",{className:"font-medium",children:[e.value," ",e.unit]})]}),(0,o.jsxs)("div",{className:"text-body font-normal","data-test-id":"store-address",children:[(0,o.jsx)("p",{children:t.address.lines[0]}),(0,o.jsx)("p",{children:t.address.postalCode})]}),(0,o.jsxs)("div",{className:"py-16 text-grey-800",children:[(0,o.jsxs)("p",{className:"pb-8 text-body-small font-medium text-grey-800",children:[r("storeLocator.normalOpeningHoursTitle"),":"]}),t.openingHours.standard.map((t,e)=>(0,o.jsx)("div",{children:t.isOpen?(0,o.jsx)("p",{className:e===s?"flex text-caption font-medium":"flex text-caption","data-test-id":"opening-hours",children:`${t.weekday} ${t.openAt.formatted} - ${t.closedAt.formatted}`}):(0,o.jsxs)("p",{children:[t.weekday," ",r("storeLocator.closedText")]})},t.weekday)),(0,o.jsx)("p",{className:(0,og.cn)(["pt-20 text-caption"]),children:r("storeLocator.openingHoursDisclaimer")})]}),t.address?.phone&&t.address.phone.length>3&&(0,o.jsxs)("div",{className:"flex flex-col gap-16 pb-8",children:[(0,o.jsx)("div",{className:"font-medium",children:r("storeLocator.labelTelephone")}),(0,o.jsx)(o_.Link,{href:`tel:${t.address.phone}`,children:t.address.phone})]})]})}function om({store:t}){let e=(0,of.useTranslations)();return(0,o.jsx)("div",{className:"flex flex-col gap-16",children:(0,o.jsxs)(o_.Link,{href:`https://www.google.com/maps/dir/?api=1&destination=${t.name}&destination=${t.address.latitude},${t.address.longitude}`,className:(0,od.buttonVariants)(),target:"_blank","data-test-id":"get-directions-link",children:[e("storeLocator.buttonLabelGetDirections"),(0,o.jsx)(oc.default,{})]})})}function ov({children:t,type:e="card",isSelected:i=!1}){return(0,o.jsx)("div",{"data-test-id":"store-details-container",className:"card"===e?(0,og.cn)(["flex flex-col gap-20 border p-16 radius-4 md:w-[300px]",i?"border-grey-1000":"border-grey-400"]):"",children:t})}let oy="element",ox="offset",ow="position",oE="positioning",oC=class extends N{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(oy,this.handleElementChanged),this.addChangeListener("map",this.handleMapChanged),this.addChangeListener(ox,this.handleOffsetChanged),this.addChangeListener(ow,this.handlePositionChanged),this.addChangeListener(oE,this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get(oy)}getId(){return this.id}getMap(){return this.get("map")||null}getOffset(){return this.get(ox)}getPosition(){return this.get(ow)}getPositioning(){return this.get(oE)}handleElementChanged(){iP(this.element);let t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),A(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);let t=this.getMap();if(t){this.mapPostrenderListenerKey=L(t,te,this.render,this),this.updatePixelPosition();let e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(oy,t)}setMap(t){this.set("map",t)}setOffset(t){this.set(ox,t)}setPosition(t){this.set(ow,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){let e,i,n,r,s=this.getMap();if(!s||!s.getTargetElement()||!this.get(ow))return;let o=this.getRect(s.getTargetElement(),s.getSize()),a=this.getElement(),l=this.getRect(a,[(e=a.offsetWidth,e+=parseInt((i=getComputedStyle(a)).marginLeft,10)+parseInt(i.marginRight,10)),(n=a.offsetHeight,n+=parseInt((r=getComputedStyle(a)).marginTop,10)+parseInt(r.marginBottom,10))]),h=void 0===(t=t||{}).margin?20:t.margin;if(!(o[0]<=l[0])||!(l[2]<=o[2])||!(o[1]<=l[1])||!(l[3]<=o[3])){let e=l[0]-o[0],i=o[2]-l[2],n=l[1]-o[1],r=o[3]-l[3],a=[0,0];if(e<0?a[0]=e-h:i<0&&(a[0]=Math.abs(i)+h),n<0?a[1]=n-h:r<0&&(a[1]=Math.abs(r)+h),0!==a[0]||0!==a[1]){let e=s.getView().getCenterInternal(),i=s.getPixelFromCo
1ordinateInternal(e);if(!i)return;let n=[i[0]+a[0],i[1]+a[1]],r=t.animation||{};s.getView().animateInternal({center:s.getCoordinateFromPixelInternal(n),duration:r.duration,easing:r.easing})}}}getRect(t,e){let i=t.getBoundingClientRect(),n=i.left+window.pageXOffset,r=i.top+window.pageYOffset;return[n,r,n+e[0],r+e[1]]}setPositioning(t){this.set(oE,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){let t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);let i=t.getPixelFromCoordinate(e),n=t.getSize();this.updateRenderedPosition(i,n)}updateRenderedPosition(t,e){let i=this.element.style,n=this.getOffset(),r=this.getPositioning();this.setVisible(!0);let s=`${t[0]+n[0]}px`,o=`${t[1]+n[1]}px`,a="0%",l="0%";"bottom-right"==r||"center-right"==r||"top-right"==r?a="-100%":("bottom-center"==r||"center-center"==r||"top-center"==r)&&(a="-50%"),"bottom-left"==r||"bottom-center"==r||"bottom-right"==r?l="-100%":("center-left"==r||"center-center"==r||"center-right"==r)&&(l="-50%");let h=`translate(${a}, ${l}) translate(${s}, ${o})`;this.rendered.transform_!=h&&(this.rendered.transform_=h,i.transform=h)}getOptions(){return this.options}};function oS({stores:t,handleSelectedStore:e,selectedStoreId:i}){let[n,r]=(0,u.useState)(null),s=(0,u.useRef)(null),a=(0,u.useRef)(null),l=(0,of.useTranslations)(),h=(0,ol.useMediaQuery)(`(width < ${oh.default.md}px)`,!1),d=(0,u.useCallback)(t=>{e(t.id),h&&r(t)},[e,h]);return(0,u.useEffect)(()=>{if(!s.current||a.current)return;let t=new sS({target:s.current,layers:[new sJ({source:new oa})],view:new ix({center:[0,0],zoom:2}),controls:ik({attribution:!1}).extend([new iO])});return a.current=t,()=>{t.setTarget(void 0),a.current=null}},[]),(0,u.useEffect)(()=>{if(!a.current||!t.length)return;let e=t.find(t=>t.id===i)||t[0];e?.address?.longitude&&e?.address?.latitude&&(a.current.getView().setCenter(eK([e.address.longitude,e.address.latitude])),a.current.getView().setZoom(12))},[t,i]),(0,u.useEffect)(()=>{if(!a.current||!t.length)return;let e=a.current,n=t.map(t=>(function({map:t,store:e,isSelected:i,onClick:n}){if(!e?.address?.longitude||!e?.address?.latitude)return null;let r=document.createElement("div");r.className="relative flex items-center justify-center cursor-pointer",r.innerHTML=` 2 <div 3 class="flex items-center justify-center shadow-lg transition-transform duration-200" 4 style=" 5 width: 30px; 6 height: 30px; 7 border-radius: 60px 60px 0px 60px; 8 background: ${i?"#000":"#fff"}; 9 scale: ${i?"1.2":"1"}; 10 position: relative; 11 transform: rotate(45deg); 12 " 13 > 14 <img 15 src="${i?"/map-icon-white-42x42.png":"/map-icon-black-32x32.png"}" 16 alt="alt-img" 17 aria-hidden="true" 18 style="width:24px; height:24px; transform:rotate(-45deg);" 19 /> 20 </div> 21 `,r.addEventListener("click",()=>n(e));let s=new oC({position:eK([e.address.longitude,e.address.latitude]),positioning:"bottom-center",element:r,stopEvent:!1});return t.addOverlay(s),s})({map:e,store:t,isSelected:i===t.id,onClick:d}));return()=>n.forEach(t=>e.removeOverlay(t))},[t,i,d]),(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{ref:s,className:"h-full w-full rounded-lg shadow-md"}),(0,o.jsx)(ou.ModalRoot,{open:!!n&&h,onOpenChange:()=>r(null),children:(0,o.jsxs)(ou.ModalPortal,{children:[(0,o.jsx)(ou.ModalLayer,{}),(0,o.jsxs)(ou.ModalContent,{"data-test-id":"store-locator-modal",size:"sm",children:[(0,o.jsx)(ou.ModalTitle,{title:l("storeLocator.modalTitle")}),(0,o.jsx)("div",{className:"overflow-auto px-16 pt-16",children:n&&(0,o.jsx)(ov,{type:"content",children:(0,o.jsx)(op,{store:n,handleSelectedStore:e})})}),(0,o.jsxs)(ou.ModalFooter,{children:[(0,o.jsx)("div",{className:"border-b"}),n&&(0,o.jsx)(om,{store:n})]})]})]})})]})}let oR=/^\d{4,}$/;function ob({stores:t,selectedStoreId:e,isStoreDetailsPage:i=!1}){let[n,r]=(0,u.useState)(e),s=t=>r(t),a=t.filter(({store:t},e,i)=>{let n;return n=t.id,oR.test(n)&&i.findIndex(e=>e.store.id===t.id)===e}),l=[...a].sort((t,e)=>t.store.id===n?-1:+(e.store.id===n));return a.length>0&&(0,o.jsxs)("div",{className:"flex w-full gap-32 sm:flex-col md:flex-row",children:[(0,o.jsx)("div",{className:(0,og.cn)(["flex gap-12 sm:flex-col md:flex-col"]),children:l.map(({store:t,distance:e})=>(0,o.jsx)("div",{children:(0,o.jsxs)(ov,{isSelected:n===t.id,children:[(0,o.jsx)(op,{store:t,distance:e,handleSelectedStore:s,isStoreDetailsPage:i}),(0,o.jsx)(om,{store:t,distance:e,isStoreDetailsPage:i})]})},t.id))}),(0,o.jsx)("div",{className:"md:grow",children:(0,o.jsx)("div",{className:"sticky top-16 h-screen max-h-[423px] w-full overflow-hidden md:max-h-[500px] xl:max-h-[600px]","data-test-id":"store-map",children:(0,o.jsx)(oS,{handleSelectedStore:s,selectedStoreId:n,stores:a.map(({store:t})=>t)})})})]})}t.s(["StoreResults",0,ob],500474);var oM=t.i(545348);function oT(){return(0,o.jsx)(oM.Skeleton,{className:"h-screen max-h-[30vh] w-full md:max-h-[500px]"})}function oI(){return(0,o.jsxs)("div",{className:"my-16 p-16 md:w-[300px]",children:[(0,o.jsx)(oM.Skeleton,{className:"mb-8 h-8 w-2/3"}),(0,o.jsx)(oM.Skeleton,{className:"mb-8 h-8 w-2/3"}),(0,o.jsx)(oM.Skeleton,{className:"mb-32 h-8 w-1/3"}),(0,o.jsx)(oM.Skeleton,{className:"mb-8 h-16 w-2/3"}),(0,o.jsxs)("div",{className:"flex flex-col gap-8 pb-20",children:[(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"}),(0,o.jsx)(oM.Skeleton,{className:"h-8 w-1/2"})]}),(0,o.jsx)("div",{className:"mb-10 flex",children:(0,o.jsx)(oM.Skeleton,{className:"h-8 w-full"})}),(0,o.jsxs)("div",{className:"flex flex-col gap-16 pt-10",children:[(0,o.jsx)(oM.Skeleton,{className:"h-40"}),(0,o.jsx)(oM.Skeleton,{className:"h-40"})]})]})}function oP(){return(0,o.jsxs)("div",{children:[(0,o.jsx)(oI,{}),(0,o.jsx)(oI,{}),(0,o.jsx)(oI,{})]})}function oL(){return(0,o.jsxs)("div",{className:"flex flex-col items-center gap-12",children:[(0,o.jsxs)("div",{className:"flex w-full flex-col items-center gap-16 py-32",children:[(0,o.jsx)(oM.Skeleton,{className:"mb-8 h-32 w-2/3 md:m-auto md:w-1/4"}),(0,o.jsx)(oM.Skeleton,{className:"m-auto mb-8 h-40 w-full md:w-1/2"}),(0,o.jsxs)("div",{className:"flex flex-col items-center gap-12 md:flex-row md:gap-16",children:[(0,o.jsx)(oM.Skeleton,{className:"m-auto h-40 w-[154px] font-normal md:m-0"}),(0,o.jsx)(oM.Skeleton,{className:"m-auto h-40 w-[154px] font-normal md:m-0"})]})]}),(0,o.jsxs)("div",{className:"flex w-full flex-col-reverse gap-32 md:flex-row",children:[(0,o.jsx)("div",{className:"md:flex md:flex-col md:gap-12",children:(0,o.jsx)(oP,{})}),(0,o.jsx)("div",{className:"h-screen max-h-[423px] w-full overflow-hidden md:max-h-[500px] xl:max-h-[600px]",children:(0,o.jsx)(oT,{})})]})]})}
21var oA=t.i(388559),oF=t.i(733279),oO=t.i(10287),ok=t.i(619758),oz=t.i(465623),oD=t.i(167559),oj=t.i(379257);let oN={timeout:5e3,maximumAge:6e4,enableHighAccuracy:!1};async function oK({locale:t,geocode:e,countryCode:i}){let n=(0,oO.initializeApollo)(t),{data:r}=await n.query({query:oj.RETAIL_STORES_NEAR_LOCATION_QUERY,variables:{input:{lat:e.latitude,lon:e.longitude,countryCode:i,distance:{unit:oF.DistanceUnitEnum.km,value:13e3},limit:5,locale:t}}});return r.retailStore.query}function oX({stores:t,state:e}){let[i,n]=(0,u.useState)(""),{toast:r}=(0,oA.useToast)(),[s,a]=(0,u.useState)(e),[l,d]=(0,u.useState)(t),c=(0,of.useTranslations)(),g=(0,oD.useLocale)(),[,f]=g.split("-"),_=t=>{let e=f.toLocaleUpperCase(),i={latitude:t.coords.latitude,longitude:t.coords.longitude};a("loading");try{oK({locale:g,geocode:i,countryCode:e}).then(t=>{d(t??[]),a("completed")}).finally(()=>{n("")})}catch(t){oz.logger.debug({err:t},"error getting stores by browser location")}},p=()=>{r({title:c("storeLocator.browserLocationNotSharedErrorTitle"),description:c("storeLocator.browserLocationNotSharedErrorDescription"),variant:"error","data-test-id":"browser-location-not-shared-error"})};return"loading"===s?(0,o.jsx)(oL,{}):(0,o.jsxs)("div",{className:"flex flex-col items-center gap-12",children:[(0,o.jsx)(h.StoreLocatorHeader,{query:i,onSearch:t=>{if(t.preventDefault(),i){a("loading");try{(0,ok.getGeocode)({country:f,location:{type:"QUERY",query:i}}).then(t=>{if(!t){d([]),a("completed");return}let e=f.toLocaleUpperCase();oK({locale:g,geocode:t,countryCode:e}).then(t=>{d(t??[]),a("completed")})}).finally(()=>{n("")})}catch(t){oz.logger.debug({err:t},"error searching for stores")}}},onSearchInputChange:t=>n(t),onClickGetIPLocation:()=>{navigator.geolocation?navigator.geolocation.getCurrentPosition(_,p,oN):r({title:c("storeLocator.geolocationNotSupportedErrorTitle"),description:c("storeLocator.geolocationNotSupportedErrorDescription")})},title:c("storeLocator.title")}),"completed"===s&&0===l.length&&(0,o.jsxs)("div",{className:"my-48 flex h-full flex-col items-center justify-center gap-24 px-16","data-test-id":"no-store-error",children:[(0,o.jsx)("h2",{className:"text-title-4 font-medium md:text-title-5",children:c("storeLocator.noStoresFoundTitle")}),(0,o.jsx)("p",{className:"text-caption",children:c("storeLocator.noStoresFoundText")})]}),"completed"===s&&l.length>0&&(0,o.jsx)(ob,{stores:l})]})}oX.getLayout=function(t,e){return(0,o.jsx)(a.default,{...e,children:(0,o.jsx)(l.default,{page:"root",children:t})})},t.s(["GEOLOCATION_OPTIONS",0,oN,"STORE_LOCATOR_URL",0,"/store-locator","__N_SSP",0,!0,"default",0,oX],980672)}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.